mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
FIX: incorrect path to country coa json after building
This commit is contained in:
parent
2d2c9d4e6a
commit
ebf6800d65
@ -58,15 +58,12 @@ async function getCountryCOA() {
|
|||||||
const doc = await frappe.getDoc('AccountingSettings');
|
const doc = await frappe.getDoc('AccountingSettings');
|
||||||
const conCode = countries[doc.country].code;
|
const conCode = countries[doc.country].code;
|
||||||
|
|
||||||
const countryCOA = path.resolve(
|
try {
|
||||||
path.join('./fixtures/verified/', conCode + '.json')
|
const countryCoa = require('../../../fixtures/verified/' +
|
||||||
);
|
conCode +
|
||||||
|
'.json');
|
||||||
if (fs.existsSync(countryCOA)) {
|
return countryCoa.tree;
|
||||||
const jsonText = fs.readFileSync(countryCOA, 'utf-8');
|
} catch (e) {
|
||||||
const json = JSON.parse(jsonText);
|
|
||||||
return json.tree;
|
|
||||||
} else {
|
|
||||||
return standardCOA;
|
return standardCOA;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
13
src/main.js
13
src/main.js
@ -45,7 +45,6 @@ frappe.events.on(
|
|||||||
country,
|
country,
|
||||||
name,
|
name,
|
||||||
email,
|
email,
|
||||||
abbreviation,
|
|
||||||
bankName,
|
bankName,
|
||||||
fiscalYearStart,
|
fiscalYearStart,
|
||||||
fiscalYearEnd
|
fiscalYearEnd
|
||||||
@ -64,10 +63,16 @@ frappe.events.on(
|
|||||||
});
|
});
|
||||||
|
|
||||||
await doc.update();
|
await doc.update();
|
||||||
await frappe.call({ method: 'import-coa' });
|
await frappe.call({
|
||||||
|
method: 'import-coa'
|
||||||
|
});
|
||||||
|
const generateRegionalTaxes = require('../models/doctype/Tax/RegionalChanges');
|
||||||
|
await generateRegionalTaxes(country);
|
||||||
|
if (country === 'India') {
|
||||||
|
frappe.models.Party = require('../models/doctype/Party/RegionalChanges');
|
||||||
|
await frappe.db.migrate();
|
||||||
|
}
|
||||||
frappe.events.trigger('show-desk');
|
frappe.events.trigger('show-desk');
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
window.frappe = frappe;
|
window.frappe = frappe;
|
||||||
|
Loading…
Reference in New Issue
Block a user