screw123 / chassis2

0 stars 0 forks source link

Method of create new journal #42

Closed screw123 closed 6 years ago

screw123 commented 6 years ago

A method in DBSchema/acct_journal.js, so that when called, provide minimum field + a bunch of optional, will check debit/credit, other validity, and then post to acct_journal as a batch

screw123 commented 6 years ago

In the middle of specify checking of acctJournal.postNewJournal

screw123 commented 6 years ago

Header: First check, then fetch all related data in from DB.

First check validity of "entries" then get all relevant COA from DB, store in array then plus all additional data into entries

            //entries: [{COAId, journalDesc, ExCurrency, EXRate, EXAmt}]
            // 'COADesc': 'longText',
            // 'COA': {type: 'autocomplete', key: 'COADesc', value: 'COAId', link: { 'q': 'CoA.list', 'text': "name", "value": "_id" }},
            // 'COAAcctType': 'list',
            // 'COAisDebit': 'boolean',
            // 'COAsubcat1': 'list',
            // 'COAsubcat2': 'text',
screw123 commented 6 years ago

still fixing, now trying to test the method with testaaa. But first need to convert all errors into Meteor.Error, then find out why EXCurrency has "unknown key"

screw123 commented 6 years ago

Issue of having error is, collections like CoA is not published to client, thus Collection.find() will yields nothing. Either move it all to server, or publish to client. Better to do the first.

screw123 commented 6 years ago

Basically tested and passed. Further check a bit and this can be closed