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) {
|
callback: function(r) {
|
||||||
if(!r.exc) {
|
if(!r.exc) {
|
||||||
var jv_name = frappe.model.make_new_doc_and_get_name('Journal Voucher');
|
var doclist = frappe.model.sync(r.message);
|
||||||
var jv = locals["Journal Voucher"][jv_name];
|
frappe.set_route("Form", doclist[0].doctype, doclist[0].name);
|
||||||
$.extend(jv, r.message);
|
|
||||||
loaddoc("Journal Voucher", jv_name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -780,14 +780,10 @@ def make_return_jv(stock_entry):
|
|||||||
from erpnext.accounts.utils import get_balance_on
|
from erpnext.accounts.utils import get_balance_on
|
||||||
for r in result:
|
for r in result:
|
||||||
jv.append("entries", {
|
jv.append("entries", {
|
||||||
"__islocal": 1,
|
|
||||||
"doctype": "Journal Voucher Detail",
|
|
||||||
"parentfield": "entries",
|
|
||||||
"account": r.get("account"),
|
"account": r.get("account"),
|
||||||
"against_invoice": r.get("against_invoice"),
|
"against_invoice": r.get("against_invoice"),
|
||||||
"against_voucher": r.get("against_voucher"),
|
"against_voucher": r.get("against_voucher"),
|
||||||
"balance": get_balance_on(r.get("account"), se.posting_date) \
|
"balance": get_balance_on(r.get("account"), se.posting_date) if r.get("account") else 0
|
||||||
if r.get("account") else 0
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return jv
|
return jv
|
||||||
|
Loading…
x
Reference in New Issue
Block a user