mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-11 13:41:47 +00:00
fix: check for bank account permission when updating balance (backport #56016)
This commit is contained in:
@@ -250,7 +250,7 @@ const ClosingBalanceForm = ({ defaultBalance, date, bankAccount, onClose }: { de
|
|||||||
{_("Enter the closing balance you see in your bank statement for {0} as of the {1}", [bankAccount?.account_name ?? bankAccount?.name ?? '', formatDate(date, 'Do MMM YYYY')])}
|
{_("Enter the closing balance you see in your bank statement for {0} as of the {1}", [bankAccount?.account_name ?? bankAccount?.name ?? '', formatDate(date, 'Do MMM YYYY')])}
|
||||||
</DialogDescription>
|
</DialogDescription>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
{error && <ErrorBanner error={error} />}
|
{error && <div className="py-2"><ErrorBanner error={error} /></div>}
|
||||||
<div className="py-4">
|
<div className="py-4">
|
||||||
<CurrencyFormField
|
<CurrencyFormField
|
||||||
name="balance"
|
name="balance"
|
||||||
|
|||||||
@@ -33,6 +33,16 @@ export const getErrorMessages = (error?: FrappeError | null): ParsedErrorMessage
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// @ts-expect-error - some errors have _error_message
|
||||||
|
if (error?._error_message) {
|
||||||
|
eMessages.push({
|
||||||
|
// @ts-expect-error - some errors have _error_message
|
||||||
|
message: error?._error_message,
|
||||||
|
title: "Error",
|
||||||
|
indicator: "red"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
if (eMessages.length === 0) {
|
if (eMessages.length === 0) {
|
||||||
// Get the message from the exception by removing the exc_type
|
// Get the message from the exception by removing the exc_type
|
||||||
const indexOfFirstColon = error?.exception?.indexOf(':')
|
const indexOfFirstColon = error?.exception?.indexOf(':')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
|
"allow_bulk_edit": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"creation": "2026-04-11 19:48:13.622253",
|
"creation": "2026-04-11 19:48:13.622253",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
@@ -7,7 +8,8 @@
|
|||||||
"field_order": [
|
"field_order": [
|
||||||
"bank_account",
|
"bank_account",
|
||||||
"date",
|
"date",
|
||||||
"balance"
|
"balance",
|
||||||
|
"company"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -31,12 +33,20 @@
|
|||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Balance",
|
"label": "Balance",
|
||||||
"reqd": 1
|
"reqd": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fetch_from": "bank_account.company",
|
||||||
|
"fieldname": "company",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "Company",
|
||||||
|
"options": "Company",
|
||||||
|
"read_only": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"grid_page_length": 50,
|
"grid_page_length": 50,
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2026-04-11 19:49:45.374695",
|
"modified": "2026-06-16 22:17:48.007982",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Bank Account Balance",
|
"name": "Bank Account Balance",
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class BankAccountBalance(Document):
|
|||||||
|
|
||||||
balance: DF.Currency
|
balance: DF.Currency
|
||||||
bank_account: DF.Link
|
bank_account: DF.Link
|
||||||
|
company: DF.Link | None
|
||||||
date: DF.Date
|
date: DF.Date
|
||||||
# end: auto-generated types
|
# end: auto-generated types
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user