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