refactor: exclude balance while setting acc details
This commit is contained in:
parent
aba3065573
commit
c99e7ca999
@ -397,11 +397,11 @@ frappe.ui.form.on("Journal Entry Account", {
|
||||
}
|
||||
},
|
||||
cost_center: function(frm, dt, dn) {
|
||||
erpnext.journal_entry.set_account_balance(frm, dt, dn);
|
||||
erpnext.journal_entry.set_account_details(frm, dt, dn);
|
||||
},
|
||||
|
||||
account: function(frm, dt, dn) {
|
||||
erpnext.journal_entry.set_account_balance(frm, dt, dn);
|
||||
erpnext.journal_entry.set_account_details(frm, dt, dn);
|
||||
},
|
||||
|
||||
debit_in_account_currency: function(frm, cdt, cdn) {
|
||||
@ -585,14 +585,14 @@ $.extend(erpnext.journal_entry, {
|
||||
});
|
||||
|
||||
$.extend(erpnext.journal_entry, {
|
||||
set_account_balance: function(frm, dt, dn) {
|
||||
set_account_details: function(frm, dt, dn) {
|
||||
var d = locals[dt][dn];
|
||||
if(d.account) {
|
||||
if(!frm.doc.company) frappe.throw(__("Please select Company first"));
|
||||
if(!frm.doc.posting_date) frappe.throw(__("Please select Posting Date first"));
|
||||
|
||||
return frappe.call({
|
||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_account_balance_and_party_type",
|
||||
method: "erpnext.accounts.doctype.journal_entry.journal_entry.get_account_details_and_party_type",
|
||||
args: {
|
||||
account: d.account,
|
||||
date: frm.doc.posting_date,
|
||||
@ -600,7 +600,6 @@ $.extend(erpnext.journal_entry, {
|
||||
debit: flt(d.debit_in_account_currency),
|
||||
credit: flt(d.credit_in_account_currency),
|
||||
exchange_rate: d.exchange_rate,
|
||||
cost_center: d.cost_center
|
||||
},
|
||||
callback: function(r) {
|
||||
if(r.message) {
|
||||
|
@ -1410,8 +1410,8 @@ def get_party_account_and_balance(company, party_type, party, cost_center=None):
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_account_balance_and_party_type(
|
||||
account, date, company, debit=None, credit=None, exchange_rate=None, cost_center=None
|
||||
def get_account_details_and_party_type(
|
||||
account, date, company, debit=None, credit=None, exchange_rate=None
|
||||
):
|
||||
"""Returns dict of account balance and party type to be set in Journal Entry on selection of account."""
|
||||
if not frappe.has_permission("Account"):
|
||||
@ -1433,7 +1433,6 @@ def get_account_balance_and_party_type(
|
||||
party_type = ""
|
||||
|
||||
grid_values = {
|
||||
"balance": get_balance_on(account, date, cost_center=cost_center),
|
||||
"party_type": party_type,
|
||||
"account_type": account_details.account_type,
|
||||
"account_currency": account_details.account_currency or company_currency,
|
||||
|
Loading…
x
Reference in New Issue
Block a user