Updated GL system allows changing account defaults and add/updating journal entries
This commit is contained in:
@@ -635,9 +635,11 @@ function pmBookLedger(year, companyId) {
|
||||
count += 1;
|
||||
}
|
||||
const assets = Object.values(byAsset).map((a) => ({ ...a, cost: round2(a.cost) })).sort((a, b) => b.cost - a.cost);
|
||||
// Post PM spend to the company's configured maintenance expense / clearing accounts (admin-set defaults).
|
||||
const defaults = require('./glAccounts').getDefaults(companyId);
|
||||
const accounts = [
|
||||
{ account: '6450', type: 'PM / maintenance expense', debit: round2(total), credit: 0 },
|
||||
{ account: '2000', type: 'Maintenance clearing', debit: 0, credit: round2(total) }
|
||||
{ account: defaults.pm_expense_account || '6450', type: 'PM / maintenance expense', debit: round2(total), credit: 0 },
|
||||
{ account: defaults.pm_clearing_account || '2000', type: 'Maintenance clearing', debit: 0, credit: round2(total) }
|
||||
];
|
||||
return {
|
||||
year: Number(year),
|
||||
|
||||
Reference in New Issue
Block a user