[fix] [minor] fiscal year validation ignored for test cases

This commit is contained in:
Akhilesh Darjee 2013-11-27 17:26:25 +05:30
parent a8e704d4ab
commit ed3e05e181
2 changed files with 13 additions and 17 deletions

View File

@ -41,6 +41,7 @@ class DocType:
from `tabFiscal Year` where name!=%s""", (self.doc.name)) from `tabFiscal Year` where name!=%s""", (self.doc.name))
for fiscal_year, ysd, yed in year_start_end_dates: 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: 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 \ and (not webnotes.flags.in_test):
set in Fiscal Year: ") + fiscal_year) webnotes.throw(_("Year Start Date and Year End Date are already \
set in Fiscal Year: ") + fiscal_year)

View File

@ -322,7 +322,6 @@ erpnext.POS = Class.extend({
var me = this; var me = this;
this.party_field.set_input(this.frm.doc[this.party.toLowerCase()]); this.party_field.set_input(this.frm.doc[this.party.toLowerCase()]);
this.barcode.set_input(""); this.barcode.set_input("");
this.total_flat_discount = 0.0;
this.show_items_in_item_cart(); this.show_items_in_item_cart();
this.show_taxes(); this.show_taxes();
@ -377,19 +376,15 @@ erpnext.POS = Class.extend({
.find("tbody").empty(); .find("tbody").empty();
$.each(taxes, function(i, d) { $.each(taxes, function(i, d) {
if (d.charge_type == "Discount Amount") { $(repl('<tr>\
me.total_flat_discount += flt(d.rate); <td>%(description)s %(rate)s</td>\
} else { <td style="text-align: right;">%(tax_amount)s</td>\
$(repl('<tr>\ <tr>', {
<td>%(description)s %(rate)s</td>\ description: d.description,
<td style="text-align: right;">%(tax_amount)s</td>\ rate: ((d.charge_type == "Actual") ? '' : ("(" + d.rate + "%)")),
<tr>', { tax_amount: format_currency(flt(d.tax_amount)/flt(me.frm.doc.conversion_rate),
description: d.description, me.frm.doc.currency)
rate: ((d.charge_type == "Actual") ? '' : ("(" + d.rate + "%)")), })).appendTo(".tax-table tbody");
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() { set_totals: function() {