2
0
mirror of https://github.com/frappe/books.git synced 2025-02-10 07:59:03 +00:00

created default party account and corrected date-remaining in Event (#67)

* creating a default party account

* changed formula to fetch in invoices

* proper naming convention for daydiff
This commit is contained in:
sahil28297 2018-09-20 16:27:23 +05:30 committed by Faris Ansari
parent 91f6c693e0
commit 0b4cbfe35a
2 changed files with 3 additions and 3 deletions

View File

@ -26,8 +26,8 @@ module.exports = {
const today = DateTime.local();
const eventDate = DateTime.fromISO(doc.date);
const diff = eventDate.diff(today);
return Math.floor(diff.as('day'));
let daydiff = Math.floor(diff.as('day'));
return daydiff+1;
}
},
{

View File

@ -38,7 +38,7 @@ module.exports = {
label: 'Account',
fieldtype: 'Link',
target: 'Account',
formula : (doc) => doc.getFrom('Party', doc.customer , 'default_account'),
fetch: (doc) => doc.getFrom('Party', doc.customer , 'default_account'),
getFilters: (query, control) => {
return {
keywords: ['like', query],