Fixes in making credit note from Sales Return
This commit is contained in:
parent
849b7b172a
commit
67cd3fb89c
@ -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({
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user