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-27 13:52:59 +00:00
|
|
|
const naming = require('frappejs/model/naming')
|
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');
|
2018-03-27 13:52:59 +00:00
|
|
|
frappe.models.Payment.documentClass = require('../models/doctype/Payment/PaymentServer.js');
|
|
|
|
|
2018-03-26 12:14:27 +00:00
|
|
|
frappe.metaCache = {};
|
|
|
|
|
|
|
|
frappe.syncDoc(require('../fixtures/invoicePrint'));
|
|
|
|
|
2018-03-27 13:52:59 +00:00
|
|
|
// init naming series if missing
|
|
|
|
await naming.createNumberSeries('INV-', 'InvoiceSetting');
|
|
|
|
await naming.createNumberSeries('PAY-', 'PaymentSetting');
|
|
|
|
|
2018-03-26 12:57:03 +00:00
|
|
|
frappe.registerMethod({
|
|
|
|
method: 'general-ledger',
|
2018-03-27 13:52:59 +00:00
|
|
|
handler: args => GeneralLedger(args)
|
2018-03-26 12:57:03 +00:00
|
|
|
});
|
2018-03-26 12:14:27 +00:00
|
|
|
}
|
|
|
|
}
|