diff --git a/models/doctype/Event/Event.js b/models/doctype/Event/Event.js index 3f75f623..f1cf76b6 100644 --- a/models/doctype/Event/Event.js +++ b/models/doctype/Event/Event.js @@ -18,18 +18,6 @@ module.exports = { label: 'Date', fieldtype: 'Date' }, - { - fieldname: 'daysUntil', - label: 'Days Until Event', - fieldtype: 'Data', - formula: (doc) => { - const today = DateTime.local(); - const eventDate = DateTime.fromISO(doc.date); - const diff = eventDate.diff(today); - let daydiff = Math.floor(diff.as('day')); - return daydiff+1; - } - }, { fieldname: 'schedule', fieldtype: 'Table', diff --git a/models/doctype/Invoice/Invoice.js b/models/doctype/Invoice/Invoice.js index a740427d..cede997c 100644 --- a/models/doctype/Invoice/Invoice.js +++ b/models/doctype/Invoice/Invoice.js @@ -136,6 +136,10 @@ module.exports = { payment.party = form.doc.customer; payment.account = form.doc.account; payment.for = [{ referenceType: form.doc.doctype, referenceName: form.doc.name, amount: form.doc.grandTotal }]; + payment.on('afterInsert', () => { + form.$formModal.close(); + payment.submit(); + }) await form.$formModal.open(payment); } } diff --git a/models/doctype/Payment/Payment.js b/models/doctype/Payment/Payment.js index 1374c2fe..db712d7a 100644 --- a/models/doctype/Payment/Payment.js +++ b/models/doctype/Payment/Payment.js @@ -75,4 +75,4 @@ module.exports = { links: [ utils.ledgerLink ] -} \ No newline at end of file +} diff --git a/reports/SalesRegister/SalesRegisterView.js b/reports/SalesRegister/SalesRegisterView.js index 0e51b319..693d0388 100644 --- a/reports/SalesRegister/SalesRegisterView.js +++ b/reports/SalesRegister/SalesRegisterView.js @@ -20,7 +20,7 @@ module.exports = class SalesRegisterView extends RegisterView { getColumns() { return [ { label: 'Invoice', fieldname: 'name' }, - { label: 'Posting Date', fieldname: 'date' }, + { label: 'Posting Date', fieldname: 'date' , fieldtype: 'Date' }, { label: 'Customer', fieldname: 'customer' }, { label: 'Receivable Account', fieldname: 'account' }, { label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' }, diff --git a/reports/SalesRegister/viewConfig.js b/reports/SalesRegister/viewConfig.js index 94942f24..623a49f0 100644 --- a/reports/SalesRegister/viewConfig.js +++ b/reports/SalesRegister/viewConfig.js @@ -10,7 +10,7 @@ module.exports = { getColumns() { return [ { label: 'Invoice', fieldname: 'name' }, - { label: 'Posting Date', fieldname: 'date' }, + { label: 'Posting Date', fieldname: 'date' , fieldtype: 'Date' }, { label: 'Customer', fieldname: 'customer' }, { label: 'Receivable Account', fieldname: 'account' }, { label: 'Net Total', fieldname: 'netTotal', fieldtype: 'Currency' },