File tree 1 file changed +12
-0
lines changed
erpnext/accounts/doctype/repost_accounting_ledger
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors
2
2
# For license information, please see license.txt
3
3
4
+ import inspect
5
+
4
6
import frappe
5
7
from frappe import _ , qb
6
8
from frappe .model .document import Document
@@ -142,6 +144,8 @@ def on_submit(self):
142
144
143
145
@frappe .whitelist ()
144
146
def start_repost (account_repost_doc = str ) -> None :
147
+ from erpnext .accounts .general_ledger import make_reverse_gl_entries
148
+
145
149
frappe .flags .through_repost_accounting_ledger = True
146
150
if account_repost_doc :
147
151
repost_doc = frappe .get_doc ("Repost Accounting Ledger" , account_repost_doc )
@@ -177,6 +181,14 @@ def start_repost(account_repost_doc=str) -> None:
177
181
if not repost_doc .delete_cancelled_entries :
178
182
doc .make_gl_entries (1 )
179
183
doc .make_gl_entries ()
184
+ else :
185
+ if hasattr (doc , "make_gl_entries" ) and callable (doc .make_gl_entries ):
186
+ if not repost_doc .delete_cancelled_entries :
187
+ if "cancel" in inspect .getfullargspec (doc .make_gl_entries ):
188
+ doc .make_gl_entries (cancel = 1 )
189
+ else :
190
+ make_reverse_gl_entries (voucher_type = doc .doctype , voucher_no = doc .name )
191
+ doc .make_gl_entries ()
180
192
181
193
182
194
def get_allowed_types_from_settings ():
You can’t perform that action at this time.
0 commit comments