mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-18 00:55:02 +00:00
chore: better comments for context
(cherry picked from commit e7505e92c9)
This commit is contained in:
@@ -1221,6 +1221,7 @@ class PaymentEntry(AccountsController):
|
||||
|
||||
if self.book_advance_payments_in_separate_party_account:
|
||||
if d.reference_doctype in advance_payment_doctypes:
|
||||
# Upon reconciliation, whole ledger will be reposted. So, reference to SO/PO is fine
|
||||
gle.update(
|
||||
{
|
||||
"against_voucher_type": d.reference_doctype,
|
||||
@@ -1228,6 +1229,7 @@ class PaymentEntry(AccountsController):
|
||||
}
|
||||
)
|
||||
else:
|
||||
# Do not reference Invoices while Advance is in separate party account
|
||||
gle.update({"against_voucher_type": self.doctype, "against_voucher": self.name})
|
||||
else:
|
||||
gle.update(
|
||||
|
||||
@@ -474,8 +474,8 @@ def reconcile_against_document(
|
||||
doc = frappe.get_doc(voucher_type, voucher_no)
|
||||
frappe.flags.ignore_party_validation = True
|
||||
|
||||
# For payments with `Advance` in separate account feature enabled, only new ledger entries are posted for each reference.
|
||||
# No need to cancel/delete payment ledger entries
|
||||
# When Advance is allocated from an Order to an Invoice
|
||||
# whole ledger must be reposted
|
||||
repost_whole_ledger = any([x.voucher_detail_no for x in entries])
|
||||
if voucher_type == "Payment Entry" and doc.book_advance_payments_in_separate_party_account:
|
||||
if repost_whole_ledger:
|
||||
@@ -515,11 +515,13 @@ def reconcile_against_document(
|
||||
doc = frappe.get_doc(entry.voucher_type, entry.voucher_no)
|
||||
|
||||
if voucher_type == "Payment Entry" and doc.book_advance_payments_in_separate_party_account:
|
||||
# both ledgers must be posted to for `Advance` in separate account feature
|
||||
# TODO: find a more efficient way post only for the new linked vouchers
|
||||
# When Advance is allocated from an Order to an Invoice
|
||||
# whole ledger must be reposted
|
||||
if repost_whole_ledger:
|
||||
doc.make_gl_entries()
|
||||
else:
|
||||
# both ledgers must be posted to for `Advance` in separate account feature
|
||||
# TODO: find a more efficient way post only for the new linked vouchers
|
||||
doc.make_advance_gl_entries()
|
||||
else:
|
||||
gl_map = doc.build_gl_map()
|
||||
|
||||
Reference in New Issue
Block a user