fix: Item Tax Updation via Update Items in SO/PO

This commit is contained in:
marination
2020-08-19 14:59:46 +05:30
parent 1fb1c08872
commit 698d983eef
3 changed files with 31 additions and 8 deletions

View File

@@ -223,8 +223,13 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
},
_get_tax_rate: function(tax, item_tax_map) {
return (Object.keys(item_tax_map).indexOf(tax.account_head) != -1) ?
flt(item_tax_map[tax.account_head], precision("rate", tax)) : tax.rate;
if(!$.isEmptyObject(item_tax_map)) {
return (Object.keys(item_tax_map).indexOf(tax.account_head) != -1) ?
flt(item_tax_map[tax.account_head], precision("rate", tax)) : tax.rate;
} else {
// If no item tax template against item dont calculate tax against it
return 0
}
},
calculate_net_total: function() {
@@ -595,7 +600,7 @@ erpnext.taxes_and_totals = erpnext.payments.extend({
$.each(actual_taxes_dict, function(key, value) {
if (value) total_actual_tax += value;
});
return flt(this.frm.doc.grand_total - total_actual_tax, precision("grand_total"));
}
},