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

feat: utility to repost accounting ledgers without cancellation #36469

Merged
merged 24 commits into from
Aug 8, 2023

Conversation

ruthra-kumar
Copy link
Member

@ruthra-kumar ruthra-kumar commented Aug 3, 2023

Introducing a utility doctype Repost Accounting Ledger. This will repost GL Entry and Payment Ledger Entry for source documents, without need for cancel and amending. Currently supports Sales Invoice, Purchase Invoice, Payment Entry and Journal Entry.

Show Preview gives the list of old and the new entries that will be created.

Screenshot 2023-08-03 at 10 11 56 AM

This utility will be backported along with Exchange Gain/Loss booking refactor

no-docs

@codecov
Copy link

codecov bot commented Aug 3, 2023

Codecov Report

Merging #36469 (4c56043) into develop (5435c64) will increase coverage by 0.08%.
Report is 17 commits behind head on develop.
The diff coverage is 99.09%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #36469      +/-   ##
===========================================
+ Coverage    64.61%   64.69%   +0.08%     
===========================================
  Files          788      791       +3     
  Lines        61436    61572     +136     
===========================================
+ Hits         39697    39837     +140     
+ Misses       21739    21735       -4     
Files Changed Coverage Δ
...xt/accounts/doctype/journal_entry/journal_entry.py 69.32% <ø> (ø)
...xt/accounts/doctype/payment_entry/payment_entry.py 83.79% <ø> (ø)
...ounts/doctype/purchase_invoice/purchase_invoice.py 84.19% <0.00%> (+0.03%) ⬆️
...xt/accounts/doctype/sales_invoice/sales_invoice.py 83.88% <ø> (+0.01%) ⬆️
...post_accounting_ledger/repost_accounting_ledger.py 100.00% <100.00%> (ø)
...ing_ledger_items/repost_accounting_ledger_items.py 100.00% <100.00%> (ø)
erpnext/accounts/test/accounts_mixin.py 80.76% <100.00%> (+1.17%) ⬆️

... and 11 files with indirect coverage changes

@ruthra-kumar ruthra-kumar marked this pull request as draft August 7, 2023 04:21
@ruthra-kumar
Copy link
Member Author

ruthra-kumar commented Aug 7, 2023

Need to add validation to prevent reposting on Invoices with Deferred Revenue or Expense

Edit: Added

@ruthra-kumar ruthra-kumar marked this pull request as ready for review August 8, 2023 14:56
@ruthra-kumar ruthra-kumar merged commit e64b004 into frappe:develop Aug 8, 2023
12 of 13 checks passed
@ruthra-kumar ruthra-kumar added the backport version-14-hotfix backport to version 14 label Aug 16, 2023
mergify bot pushed a commit that referenced this pull request Aug 16, 2023
* feat: introduce doctypes for repost

* refactor: basic filters and validations

* chore: basic validations

* chore: added barebones function to generate ledger entries

* chore: repost on submit

* chore: repost in background

* chore: include payment entry and journal entry

* chore: ignore repost doc on cancel

* chore: preview method

* chore: rudimentary form of preview

* refactor: preview template

* refactor: basic background colors to differentiate old and new

* chore: remove commented code

* test: basic functionality

* chore: fix conflict

* chore: prevent repost on invoices with deferred accounting

* refactor(test): rename and test basic validations and methods

* refactor(test): test all validations

* fix(test): use proper name account name

* refactor(test): fix failing test case

* refactor(test): clear old entries

* refactor(test): simpler logic to clear old records

* refactor(test): make use of deletion flag

* refactor(test): split into multiple test cases

(cherry picked from commit e64b004)

# Conflicts:
#	erpnext/accounts/doctype/journal_entry/journal_entry.js
ruthra-kumar added a commit that referenced this pull request Aug 19, 2023
…-36469

feat: utility to repost accounting ledgers without cancellation (backport #36469)
frappe-pr-bot pushed a commit that referenced this pull request Aug 23, 2023
# [14.36.0](v14.35.2...v14.36.0) (2023-08-23)

### Bug Fixes

* Accounts Payable Currency bug ([94612b9](94612b9))
* Add company filters for account ([e62ffa9](e62ffa9))
* add missing items labels back ([#36737](#36737)) ([3634e80](3634e80))
* broken advance field in Accounts Receivable summary rpt ([296a4d7](296a4d7))
* broken consolidated report due to finance book filter ([5bd2a09](5bd2a09))
* check tax and charges if it is passed ([1f76c69](1f76c69))
* clear dimension defaults after test ([2a467a9](2a467a9))
* dict value for dimension for gl entries defined without the dimension ([11ba553](11ba553))
* dimension name in remark ([01ae513](01ae513))
* divide offsetting amount for multiple dimensions ([1269f2d](1269f2d))
* divide offsetting amount only when account exists ([2c8c3a0](2c8c3a0))
* Document Name link validation in Bank Reconciliation Tool ([#36495](#36495)) ([83cbc1b](83cbc1b)), closes [#35540](#35540) [#35540](#35540)
* don't throw if item does not have default BOM (backport [#36709](#36709)) ([#36734](#36734)) ([e1bd9a7](e1bd9a7))
* duplicate acc dimension in test ([cdb66bf](cdb66bf))
* fetch acc dimensions correctly when fieldname is different from name ([7ac35b4](7ac35b4))
* fetch accounting dimension details specific to company ([c1f1a21](c1f1a21))
* include gain/loss journal in AR/AP reports ([4606079](4606079))
* incorrect gl balance on multi company setup ([cb9aad3](cb9aad3))
* incorrect schedule in asset value adjustment ([#36725](#36725)) ([a0575ed](a0575ed))
* make offsetting entry for acc dimensions ([3198f26](3198f26))
* make offsetting entry for all doctypes ([f578c32](f578c32))
* mode of payment fetched from pos profile company in POS ([c74a414](c74a414))
* not able to make stock entry ([#36759](#36759)) ([873ee38](873ee38))
* Procurement Tracker report not showing material request items ([#36768](#36768)) ([6a9935c](6a9935c))
* reset dimension defaults when company changedin test ([37ef6e9](37ef6e9))
* **RFQ:** make "update password" and "submit quotation" buttons the same size (backport [#36667](#36667)) ([#36686](#36686)) ([36147ec](36147ec))
* timeout error coming during reposting ([#36715](#36715)) ([620b21f](620b21f))
* **ux:** change batch selection message to alert (backport [#36500](#36500)) ([#36697](#36697)) ([0a4947a](0a4947a))
* **UX:** Ignore prepared report ([3e23e1f](3e23e1f))

### Features

* **RFQ:** make email message fully configurable (backport [#36353](#36353)) ([#36531](#36531)) ([c308bd5](c308bd5))
* Tick on checkbox to include draft timesheets (backport [#36577](#36577)) ([#36640](#36640)) ([9668615](9668615))
* utility to repost accounting ledgers without cancellation ([#36469](#36469)) ([f8d6fe6](f8d6fe6))

### Performance Improvements

* pull latest details only for referenced vouchers ([47345e8](47345e8))
@barredterra
Copy link
Collaborator

@ruthra-kumar a test that was introduced here is consistently failing across unrelated PRs. For example:

Kindly have a look at this.

@ruthra-kumar
Copy link
Member Author

@barredterra
#38679 should fix it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants