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: Provisional accounting for expenses #29451

Merged

Conversation

deepeshgarg007
Copy link
Member

@deepeshgarg007 deepeshgarg007 commented Jan 25, 2022

Provisional Accounting Entry for Expenses (Non-Stock Item Purchases)

Step 1: Enable Provisional Accounting in Company Master and set default provision account

Screenshot 2022-01-28 at 1 10 42 PM

Step 2: Make a Purchase Receipt For a non-stock item

image

Expected GL Entries on posting of Purchase Receipt

image

Step 3: Make a Purchase Invoice against the Purchase Receipt

image

Expected GL Entries on posting Purchase Invoice

Against Purchase Invoice:
image

Aginst Purchase Receipt (GL entries against purchase receipt should be reversed), remember to remove group by filter in General Ledger report to view this:

image

Now you may be wondering why we are doing all this, lets try and understand this with an example. In many scenarios lets say a services is received and the expense is incurred but the Invoice is done later, so this expense doesn't flow into your month end MIS if the purchase invoice is made in the later month. This feature aims to solve that issue. On posting a purchase receipt for that Non Stock Item provisional accounting entries will be passed and the same will be reversed on posting the actual purchase invoice on the purchase invoice posting date.

docs: https://docs.erpnext.com/docs/v13/user/manual/en/accounts/purchase-invoice/edit?wiki_page_patch=4c596d26e3

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Jan 25, 2022
@deepeshgarg007 deepeshgarg007 changed the title feat: Provisional accounting for expenses [WIP] feat: Provisional accounting for expenses Jan 28, 2022
@deepeshgarg007 deepeshgarg007 removed the needs-tests This PR needs automated unit-tests. label Jan 31, 2022
@codecov
Copy link

codecov bot commented Jan 31, 2022

Codecov Report

Merging #29451 (ac50c20) into develop (b75b00f) will decrease coverage by 0.21%.
The diff coverage is 98.03%.

❗ Current head ac50c20 differs from pull request most recent head 57cc600. Consider uploading reports for the commit 57cc600 to get more accurate results

@@             Coverage Diff             @@
##           develop   #29451      +/-   ##
===========================================
- Coverage    58.57%   58.35%   -0.22%     
===========================================
  Files         1091     1097       +6     
  Lines        67886    68841     +955     
===========================================
+ Hits         39765    40174     +409     
- Misses       28121    28667     +546     
Impacted Files Coverage Δ
erpnext/setup/doctype/company/company.py 73.18% <83.33%> (+0.17%) ⬆️
...ounts/doctype/purchase_invoice/purchase_invoice.py 82.27% <100.00%> (+0.89%) ⬆️
erpnext/controllers/stock_controller.py 90.45% <100.00%> (-0.21%) ⬇️
...stock/doctype/purchase_receipt/purchase_receipt.py 90.93% <100.00%> (+0.24%) ⬆️
...unts/report/purchase_register/purchase_register.py 34.24% <0.00%> (-45.90%) ⬇️
...e_purchase_register/item_wise_purchase_register.py 58.00% <0.00%> (-20.00%) ⬇️
...poor_quality_report/cost_of_poor_quality_report.py 33.33% <0.00%> (-20.00%) ⬇️
...em_wise_sales_register/item_wise_sales_register.py 51.36% <0.00%> (-10.00%) ⬇️
.../manufacturing/report/bom_explorer/bom_explorer.py 94.44% <0.00%> (-5.56%) ⬇️
erpnext/regional/india/utils.py 62.26% <0.00%> (-2.20%) ⬇️
... and 64 more

nabinhait
nabinhait previously approved these changes Jan 31, 2022
@nabinhait
Copy link
Member

@deepeshgarg007 I think we should add a field for "Provisional Account" in the Purchase Receipt so that the user can change it in the transaction. It can be set by default using the default provisional account defined in the company.

@deepeshgarg007
Copy link
Member Author

@Mergifyio backport version-13-hotfix

@mergify
Copy link
Contributor

mergify bot commented Feb 1, 2022

backport version-13-hotfix

🟠 Waiting for conditions to match

  • merged [:pushpin: backport requirement]

"fieldname": "provisional_expense_account",
"fieldtype": "Link",
"hidden": 1,
"label": "Provisional Expense Account",
Copy link
Member

Choose a reason for hiding this comment

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

Fetch from company if blank

@nabinhait nabinhait merged commit 528c713 into frappe:develop Feb 1, 2022
mergify bot pushed a commit that referenced this pull request Feb 1, 2022
* feat: Provisonal accounting for expenses

* fix: Method for provisional accounting entry

* chore: Add test case

* fix: Remove test case

* fix: Use company doctype

* fix: Add provisional expense account field in Purchase Receipt Item

* fix: Test case

* fix: Move provisional expense account to parent

* fix: Patch

(cherry picked from commit 528c713)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
#	erpnext/patches.txt
#	erpnext/setup/doctype/company/company.json
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
@mergify
Copy link
Contributor

mergify bot commented Feb 1, 2022

backport version-13-hotfix

✅ Backports have been created

deepeshgarg007 added a commit that referenced this pull request Feb 1, 2022
…-29451

feat: Provisional accounting for expenses (backport #29451)
mergify bot pushed a commit that referenced this pull request Feb 1, 2022
* feat: Provisonal accounting for expenses

* fix: Method for provisional accounting entry

* chore: Add test case

* fix: Remove test case

* fix: Use company doctype

* fix: Add provisional expense account field in Purchase Receipt Item

* fix: Test case

* fix: Move provisional expense account to parent

* fix: Patch

(cherry picked from commit 528c713)

# Conflicts:
#	erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py
#	erpnext/patches.txt
#	erpnext/setup/doctype/company/company.json
#	erpnext/stock/doctype/purchase_receipt/purchase_receipt.py
#	erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py
(cherry picked from commit a54c847)

# Conflicts:
#	erpnext/patches.txt
deepeshgarg007 added a commit that referenced this pull request Feb 1, 2022
…se/pr-29561

feat: Provisional accounting for expenses (backport #29451) (backport #29561)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants