mirror of
https://github.com/frappe/books.git
synced 2024-12-25 20:11:15 +00:00
Corrected path for print.html
This commit is contained in:
parent
ea2d0a8383
commit
2a1673dfe3
@ -25,7 +25,16 @@ async function getPDFForElectron(doctype, name, destination, htmlContent) {
|
|||||||
const { remote, shell } = require('electron');
|
const { remote, shell } = require('electron');
|
||||||
const { BrowserWindow } = remote;
|
const { BrowserWindow } = remote;
|
||||||
const html = htmlContent || (await getHTML(doctype, name));
|
const html = htmlContent || (await getHTML(doctype, name));
|
||||||
const filepath = path.join(destination, name + '.pdf');
|
if (!destination) {
|
||||||
|
destination =
|
||||||
|
process.env.NODE_ENV === 'development'
|
||||||
|
? path.resolve('.')
|
||||||
|
: remote.getGlobal('documentsPath');
|
||||||
|
}
|
||||||
|
|
||||||
|
const filepath = path.resolve(
|
||||||
|
path.join(destination, '/frappe-accounting/' + name + '.pdf')
|
||||||
|
);
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
let printWindow = new BrowserWindow({
|
let printWindow = new BrowserWindow({
|
||||||
@ -33,6 +42,9 @@ async function getPDFForElectron(doctype, name, destination, htmlContent) {
|
|||||||
height: 800,
|
height: 800,
|
||||||
show: false
|
show: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const __static = remote.getGlobal('__static') || __static;
|
||||||
|
|
||||||
printWindow.loadURL(`file://${path.join(__static, 'print.html')}`);
|
printWindow.loadURL(`file://${path.join(__static, 'print.html')}`);
|
||||||
|
|
||||||
printWindow.on('closed', () => {
|
printWindow.on('closed', () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user