2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

changes in events, payment modal and date in sales register (#68)

* creating a default party account

* changed formula to fetch in invoices

* changes in events, Invoice, Payments and date in sales register view
This commit is contained in:
sahil28297 2018-09-20 18:23:30 +05:30 committed by Faris Ansari
parent 0b4cbfe35a
commit d8dace31f8
5 changed files with 7 additions and 15 deletions

View File

@ -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',

View File

@ -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);
}
}

View File

@ -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' },

View File

@ -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' },