2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 11:29:00 +00:00
books/server/registerServerMethods.js
Prssanna Desai c7f27601c3 Revert "Merge #79 Winter Sprint: Work"
This reverts commit 1715116668.
2019-02-17 23:16:50 +05:30

27 lines
796 B
JavaScript

const frappe = require('frappejs');
const registerReportMethods = require('../reports');
module.exports = function registerServerMethods() {
registerReportMethods();
frappe.registerMethod({
method: 'import-coa',
async handler() {
const importCOA = require('../models/doctype/Account/importCOA');
await importCOA();
}
});
frappe.registerMethod({
method: 'print-pdf',
handler({doctype, name, html}) {
if (frappe.isElectron) {
const path = require('path');
const { getPDFForElectron } = require('frappejs/server/pdf');
const { getSettings } = require('../electron/settings');
const destination = path.resolve(getSettings().dbPath, '..')
getPDFForElectron(doctype, name, destination, html);
}
}
})
}