mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-24 00:58:29 +00:00
[cleanup] [accounts] delete gl entries on cancellation of accounting transactions
This commit is contained in:
@@ -330,11 +330,8 @@ class AccountsController(TransactionBase):
|
||||
|
||||
self.calculate_outstanding_amount()
|
||||
|
||||
def get_gl_dict(self, args, cancel=None):
|
||||
def get_gl_dict(self, args):
|
||||
"""this method populates the common properties of a gl entry record"""
|
||||
if cancel is None:
|
||||
cancel = (self.doc.docstatus == 2)
|
||||
|
||||
gl_dict = {
|
||||
'company': self.doc.company,
|
||||
'posting_date': self.doc.posting_date,
|
||||
@@ -342,7 +339,6 @@ class AccountsController(TransactionBase):
|
||||
'voucher_no': self.doc.name,
|
||||
'aging_date': self.doc.fields.get("aging_date") or self.doc.posting_date,
|
||||
'remarks': self.doc.remarks,
|
||||
'is_cancelled': cancel and "Yes" or "No",
|
||||
'fiscal_year': self.doc.fiscal_year,
|
||||
'debit': 0,
|
||||
'credit': 0,
|
||||
|
||||
@@ -23,7 +23,7 @@ class StockController(AccountsController):
|
||||
"against": against_stock_account,
|
||||
"debit": amount,
|
||||
"remarks": self.doc.remarks or "Accounting Entry for Stock",
|
||||
}, self.doc.docstatus == 2),
|
||||
}),
|
||||
|
||||
# account against stock in hand
|
||||
self.get_gl_dict({
|
||||
@@ -32,7 +32,7 @@ class StockController(AccountsController):
|
||||
"credit": amount,
|
||||
"cost_center": cost_center or None,
|
||||
"remarks": self.doc.remarks or "Accounting Entry for Stock",
|
||||
}, self.doc.docstatus == 2),
|
||||
}),
|
||||
]
|
||||
|
||||
return gl_entries
|
||||
|
||||
Reference in New Issue
Block a user