2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

Merge pull request #305 from piyushsinghania/fix/profit-loss-report-filter-fields

Fixed profit loss report half-yearly filter field
This commit is contained in:
Alan 2022-01-14 13:02:10 +05:30 committed by GitHub
commit 2758580a12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -192,10 +192,13 @@ function getPeriodKey(date, periodicity) {
}[quarter];
},
'Half Yearly': () => {
return {
1: `Apr ${year} - Sep ${year}`,
2: `Oct ${year} - Mar ${year}`,
}[[2, 3].includes(quarter) ? 1 : 2];
if (month > 3) {
return {
1: `Apr ${year} - Sep ${year}`,
2: `Oct ${year} - Mar ${year + 1}`,
}[[2, 3].includes(quarter) ? 1 : 2];
}
return `Oct ${year - 1} - Mar ${year}`;
},
Yearly: () => {
if (month > 3) {

View File

@ -52,6 +52,7 @@ export default {
label: name,
fieldname: name,
fieldtype: 'Currency',
width: 1
}));
columns.push(...columnDefs);