Fixes in making credit note from Sales Return

This commit is contained in:
Nabin Hait 2014-08-07 15:34:53 +05:30
parent 849b7b172a
commit 67cd3fb89c
2 changed files with 9 additions and 14 deletions

View File

@ -211,10 +211,9 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
},
callback: function(r) {
if(!r.exc) {
var jv_name = frappe.model.make_new_doc_and_get_name('Journal Voucher');
var jv = locals["Journal Voucher"][jv_name];
$.extend(jv, r.message);
loaddoc("Journal Voucher", jv_name);
var doclist = frappe.model.sync(r.message);
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
}
}
});
@ -266,20 +265,20 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
customer: function() {
this.get_party_details({
party: this.frm.doc.customer,
party_type:"Customer",
party: this.frm.doc.customer,
party_type:"Customer",
doctype: this.frm.doc.doctype
});
},
supplier: function() {
this.get_party_details({
party: this.frm.doc.supplier,
party_type:"Supplier",
party: this.frm.doc.supplier,
party_type:"Supplier",
doctype: this.frm.doc.doctype
});
},
get_party_details: function(args) {
var me = this;
frappe.call({

View File

@ -780,14 +780,10 @@ def make_return_jv(stock_entry):
from erpnext.accounts.utils import get_balance_on
for r in result:
jv.append("entries", {
"__islocal": 1,
"doctype": "Journal Voucher Detail",
"parentfield": "entries",
"account": r.get("account"),
"against_invoice": r.get("against_invoice"),
"against_voucher": r.get("against_voucher"),
"balance": get_balance_on(r.get("account"), se.posting_date) \
if r.get("account") else 0
"balance": get_balance_on(r.get("account"), se.posting_date) if r.get("account") else 0
})
return jv