fix: item tax template not applied if valid from is blank

This commit is contained in:
Rohit Waghchaure
2020-05-21 10:09:42 +05:30
parent 72892a40d6
commit 2caac24071

View File

@@ -1459,7 +1459,11 @@ erpnext.pos.PointOfSale = erpnext.taxes_and_totals.extend({
this.child.serial_no = (this.item_serial_no[this.child.item_code]
? this.item_serial_no[this.child.item_code][0] : '');
const tax_template_is_valid = frappe.datetime.get_diff(frappe.datetime.now_date(), this.items[0].valid_from) > 0;
const tax_template_is_valid = true;
if (this.items && this.items[0].valid_from) {
tax_template_is_valid = frappe.datetime.get_diff(frappe.datetime.now_date(),
this.items[0].valid_from) > 0;
}
this.child.item_tax_template = tax_template_is_valid ? this.items[0].item_tax_template : '';
this.child.item_tax_rate = JSON.stringify(this.tax_data[this.child.item_tax_template]);