Updated GL system allows changing account defaults and add/updating journal entries
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { all, audit, now, one, run, seedBooksForCompany, seedReferenceValuesForCompany } = require('../db');
|
||||
const { all, audit, now, one, run, seedBooksForCompany, seedGlAccountsForCompany, seedReferenceValuesForCompany } = require('../db');
|
||||
|
||||
// Companies are stored in the `entities` table. Each gets its own books/GL, PM plans, alerts, and
|
||||
// (in phase 2) reference data. Disposing a company is a soft status change that preserves all history.
|
||||
@@ -29,9 +29,10 @@ function createCompany(body, userId) {
|
||||
Number(body.fiscal_year_end_month || 12), body.base_currency || 'USD', ts, ts
|
||||
]
|
||||
);
|
||||
// A new company starts with the standard book set + reference data (categories/locations/depts).
|
||||
// A new company starts with the standard book set, reference data, and chart of accounts + defaults.
|
||||
seedBooksForCompany(result.lastInsertRowid);
|
||||
seedReferenceValuesForCompany(result.lastInsertRowid);
|
||||
seedGlAccountsForCompany(result.lastInsertRowid);
|
||||
audit(userId, 'create', 'entity', result.lastInsertRowid, null, { name });
|
||||
return getCompany(result.lastInsertRowid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user