mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
refactor: restrict to 'Advance in Separate Party Account' type
This commit is contained in:
@@ -782,6 +782,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "No",
|
"default": "No",
|
||||||
|
"depends_on": "eval: doc.book_advance_payments_in_separate_party_account == 1",
|
||||||
"fieldname": "is_opening",
|
"fieldname": "is_opening",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"label": "Is Opening",
|
"label": "Is Opening",
|
||||||
@@ -801,7 +802,7 @@
|
|||||||
"table_fieldname": "payment_entries"
|
"table_fieldname": "payment_entries"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2024-05-31 16:54:59.618516",
|
"modified": "2024-05-31 17:07:06.197249",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Payment Entry",
|
"name": "Payment Entry",
|
||||||
|
|||||||
@@ -199,11 +199,13 @@ class PaymentEntry(AccountsController):
|
|||||||
|
|
||||||
self.book_advance_payments_in_separate_party_account = False
|
self.book_advance_payments_in_separate_party_account = False
|
||||||
if self.party_type not in ("Customer", "Supplier"):
|
if self.party_type not in ("Customer", "Supplier"):
|
||||||
|
self.is_opening = "No"
|
||||||
return
|
return
|
||||||
|
|
||||||
if not frappe.db.get_value(
|
if not frappe.db.get_value(
|
||||||
"Company", self.company, "book_advance_payments_in_separate_party_account"
|
"Company", self.company, "book_advance_payments_in_separate_party_account"
|
||||||
):
|
):
|
||||||
|
self.is_opening = "No"
|
||||||
return
|
return
|
||||||
|
|
||||||
# Important to set this flag for the gl building logic to work properly
|
# Important to set this flag for the gl building logic to work properly
|
||||||
@@ -215,6 +217,7 @@ class PaymentEntry(AccountsController):
|
|||||||
if (account_type == "Payable" and self.party_type == "Customer") or (
|
if (account_type == "Payable" and self.party_type == "Customer") or (
|
||||||
account_type == "Receivable" and self.party_type == "Supplier"
|
account_type == "Receivable" and self.party_type == "Supplier"
|
||||||
):
|
):
|
||||||
|
self.is_opening = "No"
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.references:
|
if self.references:
|
||||||
@@ -224,6 +227,7 @@ class PaymentEntry(AccountsController):
|
|||||||
# If there are referencers other than `allowed_types`, treat this as a normal payment entry
|
# If there are referencers other than `allowed_types`, treat this as a normal payment entry
|
||||||
if reference_types - allowed_types:
|
if reference_types - allowed_types:
|
||||||
self.book_advance_payments_in_separate_party_account = False
|
self.book_advance_payments_in_separate_party_account = False
|
||||||
|
self.is_opening = "No"
|
||||||
return
|
return
|
||||||
|
|
||||||
liability_account = get_party_account(
|
liability_account = get_party_account(
|
||||||
|
|||||||
Reference in New Issue
Block a user