Merge pull request #1107 from akhileshdarjee/master

[fix] [minor] fiscal year validation ignored for test cases
This commit is contained in:
Nabin Hait 2013-11-27 04:05:36 -08:00
commit 86d7139c21
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))
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)
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)

View File

@ -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('<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() {