mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-30 01:22:18 +02:00
fix: Don't show make jv button if equity or liability account and asset account not specified (#19349)
This commit is contained in:
@@ -16,7 +16,7 @@ frappe.ui.form.on('Share Transfer', {
|
||||
};
|
||||
};
|
||||
});
|
||||
if (frm.doc.docstatus == 1) {
|
||||
if (frm.doc.docstatus == 1 && frm.doc.equity_or_liability_account && frm.doc.asset_account ) {
|
||||
frm.add_custom_button(__('Make Journal Entry'), function () {
|
||||
erpnext.share_transfer.make_jv(frm);
|
||||
});
|
||||
@@ -92,6 +92,7 @@ erpnext.share_transfer.make_jv = function (frm) {
|
||||
debit_applicant_type = "Shareholder";
|
||||
debit_applicant = frm.doc.from_shareholder;
|
||||
}
|
||||
|
||||
frappe.call({
|
||||
args: {
|
||||
"company": frm.doc.company,
|
||||
|
||||
@@ -292,11 +292,14 @@ def make_jv_entry( company, account, amount, payment_account,\
|
||||
"party_type": debit_applicant_type,
|
||||
"party": debit_applicant,
|
||||
})
|
||||
|
||||
account_amt_list.append({
|
||||
"account": payment_account,
|
||||
"credit_in_account_currency": amount,
|
||||
"party_type": credit_applicant_type,
|
||||
"party": credit_applicant,
|
||||
})
|
||||
|
||||
journal_entry.set("accounts", account_amt_list)
|
||||
|
||||
return journal_entry.as_dict()
|
||||
Reference in New Issue
Block a user