From ed3e05e181901b2618a2aa90e9523d4e88401d5b Mon Sep 17 00:00:00 2001 From: Akhilesh Darjee Date: Wed, 27 Nov 2013 17:26:25 +0530 Subject: [PATCH] [fix] [minor] fiscal year validation ignored for test cases --- accounts/doctype/fiscal_year/fiscal_year.py | 7 ++++--- accounts/doctype/sales_invoice/pos.js | 23 ++++++++------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/accounts/doctype/fiscal_year/fiscal_year.py b/accounts/doctype/fiscal_year/fiscal_year.py index d1f121765b..55e414cb27 100644 --- a/accounts/doctype/fiscal_year/fiscal_year.py +++ b/accounts/doctype/fiscal_year/fiscal_year.py @@ -41,6 +41,7 @@ class DocType: from `tabFiscal Year` where name!=%s""", (self.doc.name)) for fiscal_year, ysd, yed in year_start_end_dates: - if getdate(self.doc.year_start_date) == ysd and getdate(self.doc.year_end_date) == yed: - webnotes.throw(_("Year Start Date and Year End Date are already \ - set in Fiscal Year: ") + fiscal_year) \ No newline at end of file + if (getdate(self.doc.year_start_date) == ysd and getdate(self.doc.year_end_date) == yed) \ + and (not webnotes.flags.in_test): + webnotes.throw(_("Year Start Date and Year End Date are already \ + set in Fiscal Year: ") + fiscal_year) \ No newline at end of file diff --git a/accounts/doctype/sales_invoice/pos.js b/accounts/doctype/sales_invoice/pos.js index dabfb97fd3..adbdca1b63 100644 --- a/accounts/doctype/sales_invoice/pos.js +++ b/accounts/doctype/sales_invoice/pos.js @@ -322,7 +322,6 @@ erpnext.POS = Class.extend({ var me = this; this.party_field.set_input(this.frm.doc[this.party.toLowerCase()]); this.barcode.set_input(""); - this.total_flat_discount = 0.0; this.show_items_in_item_cart(); this.show_taxes(); @@ -377,19 +376,15 @@ erpnext.POS = Class.extend({ .find("tbody").empty(); $.each(taxes, function(i, d) { - if (d.charge_type == "Discount Amount") { - me.total_flat_discount += flt(d.rate); - } else { - $(repl('\ - %(description)s %(rate)s\ - %(tax_amount)s\ - ', { - description: d.description, - rate: ((d.charge_type == "Actual") ? '' : ("(" + d.rate + "%)")), - tax_amount: format_currency(flt(d.tax_amount)/flt(me.frm.doc.conversion_rate), - me.frm.doc.currency) - })).appendTo(".tax-table tbody"); - } + $(repl('\ + %(description)s %(rate)s\ + %(tax_amount)s\ + ', { + description: d.description, + rate: ((d.charge_type == "Actual") ? '' : ("(" + d.rate + "%)")), + tax_amount: format_currency(flt(d.tax_amount)/flt(me.frm.doc.conversion_rate), + me.frm.doc.currency) + })).appendTo(".tax-table tbody"); }); }, set_totals: function() {