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

fix: Job Card excess transfer behaviour #31054

Merged
merged 3 commits into from
May 23, 2022

Conversation

marination
Copy link
Collaborator

Issue:

TLDR: You can transfer as much excess against a Job Card (no way to restrict), which is also inconsistent with the front end's Material Transfer button

  • Make sure Allow Excess Material Transfer in Mfg Settings is disabled
  • Make a Work Order with Transfer Against: Job Card (operations and items) > Submit
  • Go to one of the Job Cards (must have items) > Create two Material Transfer entries in Draft state
  • Submit them one by one. You can submit both and the transferred_qty in the Job Card is double the required qty
  • This is wrong since there's no way to control accidental over transfer
  • Also inconsistent with the front end. We hide Material Transfer button if no pending qty to transfer and Allow Excess Material Transfer in Mfg Settings is disabled. Server side should also respect that

Fix:

  • Block excess transfer of items if not allowed in settings.
  • Behaviour made consistent with js behaviour (button disappears if not pending and not allowed in settings)
  • Test for same case
    Screenshot 2022-05-17 at 5 35 24 PM

Check is done item wise since total transferred qty in Job Card is not reliable

- Block excess transfer of items if not allowed in settings
- Behaviour made consistent with js behaviour (button disappears if not pending and not allowed in settings)
- Test for same case
@codecov
Copy link

codecov bot commented May 18, 2022

Codecov Report

Merging #31054 (9f6e106) into develop (3019f93) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop   #31054      +/-   ##
===========================================
- Coverage    63.04%   63.04%   -0.01%     
===========================================
  Files          986      986              
  Lines        67343    67358      +15     
===========================================
+ Hits         42457    42465       +8     
- Misses       24886    24893       +7     
Impacted Files Coverage Δ
erpnext/manufacturing/doctype/job_card/job_card.py 71.02% <100.00%> (+0.90%) ⬆️
erpnext/stock/doctype/stock_entry/stock_entry.py 81.17% <100.00%> (ø)
...rial_no_valuation/incorrect_serial_no_valuation.py 59.64% <0.00%> (-26.32%) ⬇️
...saction/incorrect_balance_qty_after_transaction.py 88.37% <0.00%> (-9.31%) ⬇️
...ck/report/cogs_by_item_group/cogs_by_item_group.py 89.74% <0.00%> (-7.70%) ⬇️
...t/accounts/report/sales_register/sales_register.py 70.76% <0.00%> (-7.02%) ⬇️
.../fifo_queue_vs_qty_after_transaction_comparison.py 86.20% <0.00%> (-6.90%) ⬇️
...urity_shortfall/process_loan_security_shortfall.py 93.75% <0.00%> (-6.25%) ⬇️
erpnext/stock/report/stock_ageing/stock_ageing.py 91.34% <0.00%> (-4.33%) ⬇️
...em_wise_sales_register/item_wise_sales_register.py 61.08% <0.00%> (-2.27%) ⬇️
... and 20 more

@ankush ankush self-assigned this May 18, 2022
@ankush ankush merged commit fa039b2 into frappe:develop May 23, 2022
ankush added a commit that referenced this pull request May 23, 2022
* fix: Job Card excess transfer behaviour

- Block excess transfer of items if not allowed in settings
- Behaviour made consistent with js behaviour (button disappears if not pending and not allowed in settings)
- Test for same case

(cherry picked from commit e07ce6e)

# Conflicts:
#	erpnext/manufacturing/doctype/job_card/test_job_card.py

* chore: Run `_validate_over_transfer` only if excess transfer is blocked in settings

(cherry picked from commit 9f6e106)

* chore: conflicts

* chore: missing conflict resolution changes

Co-authored-by: marination <maricadsouza221197@gmail.com>
Co-authored-by: Ankush Menat <ankush@frappe.io>
frappe-pr-bot pushed a commit that referenced this pull request May 26, 2022
# [13.31.0](v13.30.0...v13.31.0) (2022-05-26)

### Bug Fixes

* Account currency validation for first transaction ([228f10b](228f10b))
* Add party account validation for journal entry ([7f853b1](7f853b1))
* always update item_name for stock entry (backport [#31068](#31068)) ([#31071](#31071)) ([f519dc6](f519dc6))
* change project's actual_start_date fieldtype from Data to Date (backport [#31085](#31085)) ([#31135](#31135)) ([8c2f203](8c2f203))
* Chart data for monthly periodicity in Cash Flow report ([#31039](#31039)) ([f14e9b7](f14e9b7))
* corrective job card creation (backport [#31083](#31083)) ([#31084](#31084)) ([c17c260](c17c260))
* don't capture payments with invoice_id as donations ([168a9d4](168a9d4))
* employee advance status update on return via additional salary ([d59c3d2](d59c3d2))
* Handle missing HSN Codes ([ce3a21e](ce3a21e))
* Healthcare module accounting test cases ([09a42a1](09a42a1))
* **India:** Async issue in company address trigger ([2ea3318](2ea3318))
* **india:** error while parsing e-invoice ([#31061](#31061)) ([1461d66](1461d66))
* **india:** eway bill cancel api is disabled ([#31060](#31060)) ([95491e1](95491e1))
* Job Card excess transfer behaviour (backport [#31054](#31054)) ([#31096](#31096)) ([3984f04](3984f04))
* Leave Encashment calculations (backport [#31062](#31062)) ([#31091](#31091)) ([ba76b64](ba76b64))
* Loan Doc query in Bank Reconciliation Statement ([611d1af](611d1af))
* Loan repayment entries for payroll payable account ([ea6d754](ea6d754))
* multiple entries for same payment term ([90b1147](90b1147))
* Party account validation in JV ([d10c2e5](d10c2e5))
* payments duplicate on pos closing entry (backport [#30976](#30976)) ([#31005](#31005)) ([0efbabe](0efbabe))
* **pos:** paid amount calculation for multicurrency invoice ([#31122](#31122)) ([98eb7da](98eb7da))
* remove bad default for Membership From Date ([34928d2](34928d2))
* Remove validation from Journal Entry ([4ca6cdc](4ca6cdc))
* replace document states with list settings ([78e9e66](78e9e66))
* timesheet fetching in sales invoice ([216c32f](216c32f))
* Use directly <a> and style it as button instead of using button ([0ab9fc0](0ab9fc0))

### Features

* **Employee Advance:** add 'Returned' and 'Partly Claimed and Returned' status ([42e7a86](42e7a86))

### Reverts

* Revert "fix: Add party account validation for journal entry" ([9d43a90](9d43a90))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants