fix: invoices can alter profit and loss of a closed year
This commit is contained in:
parent
25b953ad16
commit
48036b4bab
@ -121,8 +121,7 @@ class GLEntry(Document):
|
|||||||
|
|
||||||
def check_pl_account(self):
|
def check_pl_account(self):
|
||||||
if self.is_opening=='Yes' and \
|
if self.is_opening=='Yes' and \
|
||||||
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss" and \
|
frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss":
|
||||||
self.voucher_type not in ['Purchase Invoice', 'Sales Invoice']:
|
|
||||||
frappe.throw(_("{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry")
|
frappe.throw(_("{0} {1}: 'Profit and Loss' type account {2} not allowed in Opening Entry")
|
||||||
.format(self.voucher_type, self.voucher_no, self.account))
|
.format(self.voucher_type, self.voucher_no, self.account))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user