mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00: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 () {
|
frm.add_custom_button(__('Make Journal Entry'), function () {
|
||||||
erpnext.share_transfer.make_jv(frm);
|
erpnext.share_transfer.make_jv(frm);
|
||||||
});
|
});
|
||||||
@@ -92,6 +92,7 @@ erpnext.share_transfer.make_jv = function (frm) {
|
|||||||
debit_applicant_type = "Shareholder";
|
debit_applicant_type = "Shareholder";
|
||||||
debit_applicant = frm.doc.from_shareholder;
|
debit_applicant = frm.doc.from_shareholder;
|
||||||
}
|
}
|
||||||
|
|
||||||
frappe.call({
|
frappe.call({
|
||||||
args: {
|
args: {
|
||||||
"company": frm.doc.company,
|
"company": frm.doc.company,
|
||||||
|
|||||||
@@ -292,11 +292,14 @@ def make_jv_entry( company, account, amount, payment_account,\
|
|||||||
"party_type": debit_applicant_type,
|
"party_type": debit_applicant_type,
|
||||||
"party": debit_applicant,
|
"party": debit_applicant,
|
||||||
})
|
})
|
||||||
|
|
||||||
account_amt_list.append({
|
account_amt_list.append({
|
||||||
"account": payment_account,
|
"account": payment_account,
|
||||||
"credit_in_account_currency": amount,
|
"credit_in_account_currency": amount,
|
||||||
"party_type": credit_applicant_type,
|
"party_type": credit_applicant_type,
|
||||||
"party": credit_applicant,
|
"party": credit_applicant,
|
||||||
})
|
})
|
||||||
|
|
||||||
journal_entry.set("accounts", account_amt_list)
|
journal_entry.set("accounts", account_amt_list)
|
||||||
|
|
||||||
return journal_entry.as_dict()
|
return journal_entry.as_dict()
|
||||||
Reference in New Issue
Block a user