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

Conditional fixes

This commit is contained in:
Piyush Singhania 2021-12-09 19:42:18 +05:30 committed by Alan
parent b4c6faae17
commit 93540b35fd
2 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@ class BaseGSTR {
row.rate = 0;
row.inState = true;
row.reverseCharge = !party.gstin ? 'Y' : 'N';
ledgerEntry.taxes.forEach(tax => {
ledgerEntry.taxes && ledgerEntry.taxes.forEach(tax => {
row.rate += tax.rate;
const taxAmt = (tax.rate * ledgerEntry.netTotal) / 100;
if (tax.account === 'IGST') row.igstAmt = taxAmt;

View File

@ -14,10 +14,10 @@ class GSTR1 extends BaseGSTR {
const data = await this.getCompleteReport('GSTR-1', filters);
const conditions = {
B2B: row => row.gstin,
'B2B': row => row.gstin,
'B2C-Large': row => !row.gstin && !row.inState && row.invAmt >= 250000,
'B2C-Small': row =>
!row.gstin && (row.inState || (row.inState && row.invAmt < 250000))
'B2C-Small': row => !row.gstin && (row.inState || (row.inState && row.invAmt < 250000)),
'Nil Rated, Exempted and Non GST supplies': row => row
};
if (!params.transferType) return data;