mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
Merge pull request #35 from netchampfaris/electron-pdf
frappe.getPDF for electron
This commit is contained in:
commit
a8028b8708
@ -1,8 +1,10 @@
|
||||
const frappe = require('frappejs');
|
||||
const path = require('path');
|
||||
const electron = require('frappejs/client/electron');
|
||||
const { writeFile } = require('frappejs/server/utils');
|
||||
const appClient = require('../client');
|
||||
const SetupWizard = require('../setup');
|
||||
const { getPDFForElectron } = require('frappejs/server/pdf');
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
@ -20,6 +22,10 @@ require.extensions['.html'] = function (module, filename) {
|
||||
settings = {}
|
||||
}
|
||||
|
||||
frappe.electronConfig = settings;
|
||||
|
||||
frappe.getPDF = getPDFForElectron;
|
||||
|
||||
if (settings.dbPath) {
|
||||
dbPath = settings.dbPath;
|
||||
electron.start({
|
||||
@ -50,10 +56,14 @@ require.extensions['.html'] = function (module, filename) {
|
||||
dbPath,
|
||||
models: require('../models')
|
||||
}).then(async () => {
|
||||
await writeFile(configFilePath, JSON.stringify({
|
||||
const config = {
|
||||
directory: path.dirname(dbPath),
|
||||
dbPath: dbPath
|
||||
}));
|
||||
};
|
||||
|
||||
await writeFile(configFilePath, JSON.stringify(config));
|
||||
|
||||
frappe.electronConfig = config;
|
||||
|
||||
const doc = await frappe.getDoc('AccountingSettings');
|
||||
|
||||
|
28
www/dist/js/bundle.js
vendored
28
www/dist/js/bundle.js
vendored
@ -4575,7 +4575,7 @@ if (typeof undefined === 'function' && undefined.amd) {
|
||||
}
|
||||
}).call(commonjsGlobal);
|
||||
|
||||
//# sourceMappingURL=showdown.js.map
|
||||
|
||||
});
|
||||
|
||||
var moment = createCommonjsModule(function (module, exports) {
|
||||
@ -23075,7 +23075,7 @@ Popper.placements = placements;
|
||||
Popper.Defaults = Defaults;
|
||||
|
||||
|
||||
//# sourceMappingURL=popper.js.map
|
||||
|
||||
|
||||
|
||||
var popper = Object.freeze({
|
||||
@ -26974,7 +26974,7 @@ exports.Tooltip = Tooltip;
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
//# sourceMappingURL=bootstrap.js.map
|
||||
|
||||
});
|
||||
|
||||
unwrapExports(bootstrap);
|
||||
@ -28192,6 +28192,7 @@ object-assign
|
||||
@license MIT
|
||||
*/
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
@ -28456,6 +28457,8 @@ class Tree extends baseComponent {
|
||||
|
||||
window.customElements.define('f-tree', Tree);
|
||||
|
||||
// const keyboard = require('frappejs/client/ui/keyboard');
|
||||
|
||||
var tree$3 = class BaseTree extends list {
|
||||
|
||||
init() {
|
||||
@ -41300,6 +41303,11 @@ var htmlmixed = createCommonjsModule(function (module, exports) {
|
||||
});
|
||||
});
|
||||
|
||||
// const frappe = require('frappejs');
|
||||
|
||||
// eslint-disable-line
|
||||
// eslint-disable-line
|
||||
|
||||
class CodeControl extends base {
|
||||
makeInput() {
|
||||
if (!this.options) {
|
||||
@ -49195,6 +49203,9 @@ DataTable.__version__ = packageJson.version;
|
||||
module.exports = DataTable;
|
||||
});
|
||||
|
||||
// eslint-disable-line
|
||||
|
||||
|
||||
var modal = class Modal extends observable {
|
||||
constructor({ title, body, primary, secondary }) {
|
||||
super();
|
||||
@ -57861,7 +57872,7 @@ module.exports = installCompat;
|
||||
/***/ })
|
||||
/******/ ]);
|
||||
});
|
||||
//# sourceMappingURL=nunjucks.js.map
|
||||
|
||||
});
|
||||
|
||||
unwrapExports(nunjucks);
|
||||
@ -58093,6 +58104,10 @@ var menu = class DeskMenu {
|
||||
}
|
||||
};
|
||||
|
||||
// const Search = require('./search');
|
||||
|
||||
|
||||
|
||||
const views = {};
|
||||
views.Form = formpage;
|
||||
views.List = listpage;
|
||||
@ -58873,6 +58888,10 @@ var client = {
|
||||
}
|
||||
};
|
||||
|
||||
// baseclass for report
|
||||
// `url` url for report
|
||||
// `getColumns` return columns
|
||||
|
||||
var reportpage = class ReportPage extends page {
|
||||
constructor({title, filterFields}) {
|
||||
super({title: title, hasRoute: true});
|
||||
@ -60765,6 +60784,7 @@ var client$2 = {
|
||||
|
||||
const countryList$1 = Object.keys(require$$0$13).sort();
|
||||
|
||||
// start server
|
||||
client.start({
|
||||
server: 'localhost:8000',
|
||||
makeDesk: 0
|
||||
|
Loading…
Reference in New Issue
Block a user