2
0
mirror of https://github.com/frappe/books.git synced 2025-01-05 16:12:21 +00:00

refactor: minor cleanups

This commit is contained in:
18alantom 2021-10-19 14:35:47 +05:30
parent f0bdc4e669
commit 7ad7bf7b2f
4 changed files with 5 additions and 10 deletions

View File

@ -99,7 +99,6 @@ module.exports = {
} }
}, },
{ {
//insert at 3rd position
fieldname: 'gstin', fieldname: 'gstin',
label: 'GSTIN No.', label: 'GSTIN No.',
fieldtype: 'Data', fieldtype: 'Data',

View File

@ -68,10 +68,7 @@ module.exports = {
label: 'Tax', label: 'Tax',
fieldtype: 'Link', fieldtype: 'Link',
target: 'Tax', target: 'Tax',
formula: (row, doc) => { formula: (row, doc) => doc.getFrom('Item', row.item, 'tax'),
// if (row.tax) return row.tax;
return doc.getFrom('Item', row.item, 'tax');
},
formulaDependsOn: ['item'] formulaDependsOn: ['item']
}, },
{ {

View File

@ -200,10 +200,10 @@ export default {
toValue(date) { toValue(date) {
// toISOString is buggy and reduces the day by one // toISOString is buggy and reduces the day by one
// this is because it considers the UTC timestmap // this is because it considers the UTC timestamp
// in order to curcumvent that we need to use luxon/moment // in order to circumvent that we need to use luxon/moment
// but that refactor could take some time, so fixing the time differnece // but that refactor could take some time, so fixing the time difference
// ass suggested in this answer. // as suggested in this answer.
// https://stackoverflow.com/a/16084846/3541205 // https://stackoverflow.com/a/16084846/3541205
date.setHours(0, -date.getTimezoneOffset(), 0, 0); date.setHours(0, -date.getTimezoneOffset(), 0, 0);
return date.toISOString().slice(0, 10); return date.toISOString().slice(0, 10);

View File

@ -97,7 +97,6 @@ export default {
}; };
let { filePath } = await remote.dialog.showSaveDialog(options); let { filePath } = await remote.dialog.showSaveDialog(options);
console.log(filePath);
if (filePath) { if (filePath) {
if (!filePath.endsWith('.pdf')) { if (!filePath.endsWith('.pdf')) {
filePath = filePath + '.pdf'; filePath = filePath + '.pdf';