Merge branch '1310' of github.com:webnotes/erpnext

Conflicts:
	accounts/doctype/account/account.py
	controllers/accounts_controller.py
	patches/patch_list.py
	selling/doctype/sales_common/sales_common.py
	stock/doctype/purchase_receipt/purchase_receipt.py
This commit is contained in:
Anand Doshi
2013-11-15 19:12:09 +05:30
26 changed files with 590 additions and 143 deletions

View File

@@ -25,7 +25,11 @@ erpnext.StockGridReport = wn.views.TreeGridReport.extend({
add_qty = 0;
}
}
var value_diff = (rate * add_qty);
if(sl.serial_no) {
var value_diff = this.get_serialized_value_diff(sl);
} else {
var value_diff = (rate * add_qty);
}
if(add_qty)
wh.fifo_stack.push([add_qty, sl.incoming_rate, sl.posting_date]);
@@ -108,15 +112,8 @@ erpnext.StockGridReport = wn.views.TreeGridReport.extend({
get_serialized_buying_rates: function() {
var serialized_buying_rates = {};
$.each(wn.report_dump.data["Stock Ledger Entry"], function(i, sle) {
if(sle.qty > 0 && sle.serial_no) {
$.each(sle.serial_no.trim().split("\n"), function(i, sr) {
if(sr && sle.incoming_rate !== undefined
&& !serialized_buying_rates[sr.trim().toLowerCase()]) {
serialized_buying_rates[sr.trim().toLowerCase()] = flt(sle.incoming_rate);
}
});
}
$.each(wn.report_dump.data["Serial No"], function(i, sn) {
serialized_buying_rates[sn.name.toLowerCase()] = flt(sn.incoming_rate);
});
return serialized_buying_rates;

View File

@@ -496,16 +496,17 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({
this.frm.doc.conversion_rate = flt(this.frm.doc.conversion_rate, precision("conversion_rate"));
var conversion_rate_label = wn.meta.get_label(this.frm.doc.doctype, "conversion_rate",
this.frm.doc.name);
if(this.frm.doc.conversion_rate == 0) {
wn.throw(wn._(conversion_rate_label) + " " + wn._("cannot be 0"));
}
var company_currency = this.get_company_currency();
if(!this.frm.doc.conversion_rate) {
wn.throw(wn._("Please enter valid") + " " + wn._(conversion_rate_label) +
" 1 " + this.frm.doc.currency + " = [?] " + company_currency);
wn.throw(repl('%(conversion_rate_label)s' +
wn._(' is mandatory. Maybe Currency Exchange record is not created for ') +
'%(from_currency)s' + wn._(" to ") + '%(to_currency)s',
{
"conversion_rate_label": conversion_rate_label,
"from_currency": this.frm.doc.currency,
"to_currency": company_currency
}));
}
},