chore: code cleanup
This commit is contained in:
parent
1bcb728c85
commit
cd42b26839
@ -363,12 +363,6 @@ class PaymentReconciliation(Document):
|
|||||||
payment_details = self.get_payment_details(row, dr_or_cr)
|
payment_details = self.get_payment_details(row, dr_or_cr)
|
||||||
reconciled_entry.append(payment_details)
|
reconciled_entry.append(payment_details)
|
||||||
|
|
||||||
# if payment_details.difference_amount and row.reference_type not in [
|
|
||||||
# "Sales Invoice",
|
|
||||||
# "Purchase Invoice",
|
|
||||||
# ]:
|
|
||||||
# self.make_difference_entry(payment_details)
|
|
||||||
|
|
||||||
if entry_list:
|
if entry_list:
|
||||||
reconcile_against_document(entry_list, skip_ref_details_update_for_pe)
|
reconcile_against_document(entry_list, skip_ref_details_update_for_pe)
|
||||||
|
|
||||||
|
@ -972,9 +972,12 @@ class AccountsController(TransactionBase):
|
|||||||
"""
|
"""
|
||||||
Make Exchange Gain/Loss journal for Invoices and Payments
|
Make Exchange Gain/Loss journal for Invoices and Payments
|
||||||
"""
|
"""
|
||||||
# Cancelling existing exchange gain/loss journals is handled in on_cancel event in accounts/utils.py
|
# Cancelling existing exchange gain/loss journals is handled during the `on_cancel` event.
|
||||||
|
# see accounts/utils.py:cancel_exchange_gain_loss_journal()
|
||||||
if self.docstatus == 1:
|
if self.docstatus == 1:
|
||||||
if self.get("doctype") == "Journal Entry":
|
if self.get("doctype") == "Journal Entry":
|
||||||
|
# 'args' is populated with exchange gain/loss account and the amount to be booked.
|
||||||
|
# These are generated by Sales/Purchase Invoice during reconciliation and advance allocation.
|
||||||
if args:
|
if args:
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg.get("difference_amount", 0) != 0 and arg.get("difference_account"):
|
if arg.get("difference_amount", 0) != 0 and arg.get("difference_account"):
|
||||||
@ -1035,6 +1038,7 @@ class AccountsController(TransactionBase):
|
|||||||
"exchange_rate": 1,
|
"exchange_rate": 1,
|
||||||
"cost_center": erpnext.get_default_cost_center(self.company),
|
"cost_center": erpnext.get_default_cost_center(self.company),
|
||||||
# TODO: figure out a way to pass reference
|
# TODO: figure out a way to pass reference
|
||||||
|
# throws 'Journal Entry doesn't have {account} or doesn't have matched account'
|
||||||
# "reference_type": self.doctype,
|
# "reference_type": self.doctype,
|
||||||
# "reference_name": self.name,
|
# "reference_name": self.name,
|
||||||
# "reference_detail_no": arg.idx,
|
# "reference_detail_no": arg.idx,
|
||||||
@ -1049,7 +1053,7 @@ class AccountsController(TransactionBase):
|
|||||||
journal_entry.submit()
|
journal_entry.submit()
|
||||||
|
|
||||||
if self.get("doctype") == "Payment Entry":
|
if self.get("doctype") == "Payment Entry":
|
||||||
# For Payment Entry, exchange_gain_loss field in the `reference` table is the trigger for journal creation
|
# For Payment Entry, exchange_gain_loss field in the `references` table is the trigger for journal creation
|
||||||
gain_loss_to_book = [x for x in self.references if x.exchange_gain_loss != 0]
|
gain_loss_to_book = [x for x in self.references if x.exchange_gain_loss != 0]
|
||||||
booked = []
|
booked = []
|
||||||
if gain_loss_to_book:
|
if gain_loss_to_book:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user