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:
parent
0b4cbfe35a
commit
d8dace31f8
@ -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',
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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' },
|
||||
|
@ -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' },
|
||||
|
Loading…
Reference in New Issue
Block a user