2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00
books/server/index.js

29 lines
874 B
JavaScript
Raw Normal View History

2018-03-26 12:14:27 +00:00
const server = require('frappejs/server');
const frappe = require('frappejs');
2018-03-27 04:20:58 +00:00
const GeneralLedger = require('../reports/generalLedger/GeneralLedger')
2018-03-26 12:14:27 +00:00
module.exports = {
async start() {
await server.start({
backend: 'sqlite',
connectionParams: {dbPath: 'test.db'},
staticPath: './www',
models: require('../models')
})
// set server-side modules
frappe.models.Invoice.documentClass = require('../models/doctype/Invoice/InvoiceServer.js');
frappe.metaCache = {};
frappe.syncDoc(require('../fixtures/invoicePrint'));
2018-03-26 12:57:03 +00:00
frappe.registerMethod({
method: 'general-ledger',
handler: async (args) => {
const generalLedger = new GeneralLedger();
return await generalLedger.run(args);
}
});
2018-03-26 12:14:27 +00:00
}
}