Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Payment Reconciliation tool will use Payment Ledger #31136

Conversation

ruthra-kumar
Copy link
Member

@ruthra-kumar ruthra-kumar commented May 26, 2022

Payment Reconciliation tool

Refactoring the reconciliation tool to use Payment ledger for pulling invoices and return invoices with outstanding balances.
Changes in this PR

  • outstanding invoices and outstanding return invoices are fetched from payment ledger
  • 'get_outstanding_invoices' function in utils.py has been refactored
  • 'get_outstanding_reference_documents' function in payment_entry.py has been refactored
  • helper class to query Payment Ledger
  • unit tests for PR tool
  • update outstanding amount using payment ledger

@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #31136 (4a90cd6) into develop (e457288) will decrease coverage by 0.05%.
The diff coverage is 88.23%.

@@             Coverage Diff             @@
##           develop   #31136      +/-   ##
===========================================
- Coverage    63.92%   63.87%   -0.06%     
===========================================
  Files          984      984              
  Lines        67573    67723     +150     
===========================================
+ Hits         43197    43258      +61     
- Misses       24376    24465      +89     
Impacted Files Coverage Δ
...xt/accounts/doctype/payment_entry/payment_entry.py 69.38% <41.66%> (+0.28%) ⬆️
...ctype/payment_ledger_entry/payment_ledger_entry.py 76.36% <73.33%> (-13.64%) ⬇️
...e/payment_reconciliation/payment_reconciliation.py 92.51% <93.61%> (+7.71%) ⬆️
erpnext/accounts/utils.py 73.53% <97.77%> (+3.21%) ⬆️
erpnext/accounts/doctype/gl_entry/gl_entry.py 69.10% <100.00%> (-3.00%) ⬇️
...xt/accounts/doctype/journal_entry/journal_entry.py 69.08% <100.00%> (+0.13%) ⬆️
erpnext/accounts/general_ledger.py 94.61% <100.00%> (+0.02%) ⬆️
...tch_item_expiry_status/batch_item_expiry_status.py 67.92% <0.00%> (-24.53%) ⬇️
...wise_balance_history/batch_wise_balance_history.py 67.79% <0.00%> (-22.04%) ⬇️
...e_request/pending_so_items_for_purchase_request.py 85.10% <0.00%> (-12.77%) ⬇️
... and 41 more

@ruthra-kumar ruthra-kumar force-pushed the refactor_payment_reconciliation_tool branch 5 times, most recently from 8e2cdac to cb792dd Compare June 2, 2022 04:48
@ankush ankush force-pushed the refactor_payment_reconciliation_tool branch from 4c7087a to 492f193 Compare June 2, 2022 07:05
@ruthra-kumar ruthra-kumar force-pushed the refactor_payment_reconciliation_tool branch from 492f193 to 171c317 Compare June 2, 2022 09:07
@ruthra-kumar ruthra-kumar marked this pull request as ready for review June 5, 2022 10:36
@ruthra-kumar ruthra-kumar force-pushed the refactor_payment_reconciliation_tool branch 2 times, most recently from 8871025 to e8f0544 Compare June 8, 2022 09:07
@ruthra-kumar ruthra-kumar marked this pull request as draft June 8, 2022 10:08
@ruthra-kumar ruthra-kumar force-pushed the refactor_payment_reconciliation_tool branch 2 times, most recently from fe0e0b2 to cc13b42 Compare June 9, 2022 12:26
@ruthra-kumar ruthra-kumar marked this pull request as ready for review June 10, 2022 01:25
@ruthra-kumar ruthra-kumar force-pushed the refactor_payment_reconciliation_tool branch 2 times, most recently from 0978be7 to 6e3ba51 Compare June 14, 2022 12:18
@ruthra-kumar ruthra-kumar force-pushed the refactor_payment_reconciliation_tool branch 2 times, most recently from e49aa77 to 927f468 Compare June 17, 2022 12:23
PR uses payment ledger for outstanding invoice and unreconcilied
cr/dr notes.
unit test cases for partial reconciliation, return invoice against
invoice, invoice against journals and journal against journal have
been added
outstanding invoice function has been refactored to use payment ledger
Payment entry has option to select outstanding invoices using a popup
form. This change refactors the pop to use payment ledger to fetch +ve
outstanding invoices.
Outstanding amount is updated from payment ledger, only for
receivable/payable accounts. For remaining account types, update happens
from GL Entry.
@ruthra-kumar ruthra-kumar force-pushed the refactor_payment_reconciliation_tool branch from 927f468 to 3a238b4 Compare June 17, 2022 12:28
Comment on lines +37 to +42
ret = frappe.db.sql(
"""select is_group, docstatus, company
from tabAccount where name=%s""",
self.account,
as_dict=1,
)[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • why raw sql?
  • ret is bad variable name 😅, account or account_data adds more info.

@ruthra-kumar ruthra-kumar deleted the refactor_payment_reconciliation_tool branch June 14, 2023 16:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants