[fix] [minor] fiscal year validation ignored for test cases
diff --git a/accounts/doctype/fiscal_year/fiscal_year.py b/accounts/doctype/fiscal_year/fiscal_year.py
index d1f1217..55e414c 100644
--- a/accounts/doctype/fiscal_year/fiscal_year.py
+++ b/accounts/doctype/fiscal_year/fiscal_year.py
@@ -41,6 +41,7 @@
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 dabfb97..adbdca1 100644
--- a/accounts/doctype/sales_invoice/pos.js
+++ b/accounts/doctype/sales_invoice/pos.js
@@ -322,7 +322,6 @@
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 @@
.find("tbody").empty();
$.each(taxes, function(i, d) {
- if (d.charge_type == "Discount Amount") {
- me.total_flat_discount += flt(d.rate);
- } else {
- $(repl('<tr>\
- <td>%(description)s %(rate)s</td>\
- <td style="text-align: right;">%(tax_amount)s</td>\
- <tr>', {
- 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('<tr>\
+ <td>%(description)s %(rate)s</td>\
+ <td style="text-align: right;">%(tax_amount)s</td>\
+ <tr>', {
+ 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() {