refactor(gl): give SI and PI their own precision-loss GL entry method

Remove the doctype-branching make_precision_loss_gl_entry from
exchange_gain_loss.py (and its accounts_controller wrapper); add a
dedicated method to each of SalesInvoiceGLComposer and
PurchaseInvoiceGLComposer. The SI variant now passes 'Sales Invoice'
as the round-off voucher type (output-equivalent) and the throwaway
return value no longer shadows the gettext _ helper.
This commit is contained in:
Nabin Hait
2026-06-03 12:45:58 +05:30
parent d8760b76a8
commit cfed16ab6c
4 changed files with 60 additions and 36 deletions

View File

@@ -1043,11 +1043,6 @@ class AccountsController(TransactionBase):
set_advance_gain_or_loss(self)
def make_precision_loss_gl_entry(self, gl_entries):
from erpnext.accounts.services.exchange_gain_loss import make_precision_loss_gl_entry
make_precision_loss_gl_entry(self, gl_entries)
def gain_loss_journal_already_booked(
self, gain_loss_account, exc_gain_loss, ref2_dt, ref2_dn, ref2_detail_no
) -> bool: