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(india): Generate E-way Bill with IRN Settings #31143

Conversation

maharshivpatel
Copy link
Contributor

@maharshivpatel maharshivpatel commented May 26, 2022

Problem: If Transport details are available while generating IRN ewaybill will be generated without consent.
user also doesn't have an indicator if eway bill will be generated.
Cases:

  1. The sales Invoice was duplicated so transport details were copied and eway is generated.
  2. The invoice value is less than 50000 so the user doesn't want to create eway bill but it is still generated.
  3. currently, transport fields are not shown inside the transporter section as intended so the user can't change or add all the required fields to generate eway bill.

Current vs Proposed Flow

Eway Flow

I have added e-way bill settings and renamed the label of the advanced setting to GSP Setting as it was more appropriate

E Invoice Settings

Note: I have considered "" value as "Always Ask" and "Always" for eway_auto_generate and eway_when_generate respectively as there is some bug and because of that the default value of the select field is not honored.

Generate IRN Preview Changes

If ewaybill will be generated.

generate eway preview

If ewaybill will not be generated.

don't generate eway preview

GST E-Invoice Print Format Changes

If IRN is not generated:

print format no irn

If Eway Bill Details are available:
print format eway details

no-docs

i have added settings for e-way bill under E Invoice Setting doctype. I have also changed Label for advanced_settings_section to GSP Setting
settings and logic is added so user can choose their desired flow for ewaybill generation when generating irn.
allows eway bill generation for part A & B before ewaybill was only generated if transporter(part A) was added.
msgprint for eway bill errors while generating irn is added.
E-Way bill details added to GST E-Invoice print format.
@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label May 26, 2022
@codecov
Copy link

codecov bot commented May 26, 2022

Codecov Report

Merging #31143 (18c6554) into develop (43bf327) will decrease coverage by 0.18%.
The diff coverage is 33.33%.

@@             Coverage Diff             @@
##           develop   #31143      +/-   ##
===========================================
- Coverage    63.59%   63.41%   -0.19%     
===========================================
  Files          988      988              
  Lines        67576    67614      +38     
===========================================
- Hits         42977    42875     -102     
- Misses       24599    24739     +140     
Impacted Files Coverage Δ
erpnext/regional/india/e_invoice/utils.py 38.35% <33.33%> (-0.18%) ⬇️
.../report/delayed_item_report/delayed_item_report.py 60.78% <0.00%> (-35.30%) ⬇️
...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%) ⬇️
...ext/accounts/report/balance_sheet/balance_sheet.py 36.36% <0.00%> (-21.82%) ⬇️
...em_wise_sales_register/item_wise_sales_register.py 51.36% <0.00%> (-9.55%) ⬇️
...pnext/accounts/report/gross_profit/gross_profit.py 75.27% <0.00%> (-6.21%) ⬇️
...unts/report/purchase_register/purchase_register.py 71.71% <0.00%> (-5.27%) ⬇️
erpnext/accounts/party.py 78.43% <0.00%> (-4.21%) ⬇️
...e_purchase_register/item_wise_purchase_register.py 74.25% <0.00%> (-2.98%) ⬇️
... and 27 more

@maharshivpatel maharshivpatel marked this pull request as ready for review May 26, 2022 12:37
@maharshivpatel
Copy link
Contributor Author

@nextchamp-saqib hope you are doing well, are there any issues/improvements that I can solve to make this PR merge faster?

Copy link
Member

@nextchamp-saqib nextchamp-saqib left a comment

Choose a reason for hiding this comment

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

Minor changes

erpnext/regional/india/e_invoice/utils.py Outdated Show resolved Hide resolved
erpnext/regional/india/e_invoice/utils.py Outdated Show resolved Hide resolved
erpnext/regional/india/e_invoice/utils.py Outdated Show resolved Hide resolved
erpnext/regional/india/e_invoice/utils.py Outdated Show resolved Hide resolved
erpnext/regional/india/e_invoice/utils.py Outdated Show resolved Hide resolved
Co-authored-by: Saqib Ansari <nextchamp.saqib@gmail.com>
I have refactored code using guard clauses instead of if-else and separated method for parsing "info" in response.
@stale
Copy link

stale bot commented Jun 29, 2022

This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.

@stale stale bot added the inactive label Jun 29, 2022
@stale stale bot closed this Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accounts inactive needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants