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 overlap validation #38345

Conversation

rohitwaghchaure
Copy link
Collaborator

  1. Create Cutting Operation and Cutting Workstation with Production Capacity as 2
  2. Create 1st Job Card for the Cutting Operation at Cutting Workstation with Start Time 10:30:00 to 11:00:00
  3. Create 2nd Job Card for the Cutting Operation at Cutting Workstation with Start Time 11:00:00 to 11:30:00
  4. Create 3rd Job Card for the Cutting Operation at Cutting Workstation with Start Time 10:15:00 to 11:45:00
  5. System will throw overlap error while saving the 3rd Job Card even though Production Capacity is 2

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Nov 26, 2023
Copy link

codecov bot commented Nov 26, 2023

Codecov Report

Merging #38345 (82a53b9) into develop (7db1127) will decrease coverage by 0.03%.
Report is 104 commits behind head on develop.
The diff coverage is 71.42%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #38345      +/-   ##
===========================================
- Coverage    67.26%   67.23%   -0.03%     
===========================================
  Files          757      758       +1     
  Lines        60487    60619     +132     
===========================================
+ Hits         40684    40760      +76     
- Misses       19803    19859      +56     
Files Coverage Δ
...xt/accounts/doctype/payment_entry/payment_entry.py 83.66% <100.00%> (+0.05%) ⬆️
...t/manufacturing/doctype/bom_creator/bom_creator.py 80.18% <100.00%> (ø)
erpnext/selling/doctype/sales_order/sales_order.py 79.00% <50.00%> (ø)
erpnext/utilities/bulk_transaction.py 0.00% <0.00%> (ø)
erpnext/manufacturing/doctype/job_card/job_card.py 72.45% <60.00%> (-0.40%) ⬇️

... and 29 files with indirect coverage changes

@rohitwaghchaure rohitwaghchaure merged commit d8245ce into frappe:develop Nov 26, 2023
14 checks passed
mergify bot pushed a commit that referenced this pull request Nov 26, 2023
(cherry picked from commit d8245ce)

# Conflicts:
#	erpnext/manufacturing/doctype/job_card/job_card.py
mergify bot pushed a commit that referenced this pull request Nov 26, 2023
rohitwaghchaure added a commit that referenced this pull request Nov 26, 2023
fix: job card overlap validation (#38345)

(cherry picked from commit d8245ce)

Co-authored-by: rohitwaghchaure <[email protected]>
rohitwaghchaure added a commit that referenced this pull request Nov 26, 2023
* fix: job card overlap validation (#38345)

(cherry picked from commit d8245ce)

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

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <[email protected]>
@VihangT
Copy link
Contributor

VihangT commented Nov 28, 2023

Hello Sir,
I found these following cases where it still fails to detect correct overlap
image

While testing I found following solutions for few cases:

Sorting of these time logs list based on from_time

replacing “and get_datetime(next_row.from_time) <= get_datetime(row.to_time)" with "and get_datetime(next_row.from_time) < get_datetime(row.to_time)"

replacing “get_datetime(next_row.to_time) >= get_datetime(row.from_time)" with "get_datetime(next_row.to_time) > get_datetime(row.from_time)"
After doing above three steps ,still this fails with last case as last case has 2 sets of overlapping job cards with 2job cards in each

frappe-pr-bot pushed a commit that referenced this pull request Nov 28, 2023
# [15.4.0](v15.3.0...v15.4.0) (2023-11-28)

### Bug Fixes

* allow on submit for child table fields ([ac7615a](ac7615a))
* annual income and expenses in digest ([ca2ad17](ca2ad17))
* check reposting settings before allowing editable si ([25bf475](25bf475))
* condition in other bundle utils ([e4d9ef1](e4d9ef1))
* create contact if existing customer doesn't have contact ([b1b065d](b1b065d))
* display all item rate stop messages (backport [#38289](#38289)) ([#38307](#38307)) ([99c1fbf](99c1fbf))
* do not set repost flag without validating voucher ([6a3c3b4](6a3c3b4))
* don't depreciate assets with no schedule on scrapping (backport [#38276](#38276)) ([#38293](#38293)) ([18613c5](18613c5))
* filter bundle items based on disabled check ([fb517e8](fb517e8))
* fiscal year using future date ([b9a1fac](b9a1fac))
* has_product_bundle util to only check for enabled bundles ([5c12872](5c12872))
* job card overlap validation (backport [#38345](#38345)) ([#38348](#38348)) ([d6fe7eb](d6fe7eb))
* make parameters of `create_subscription_process` optional (and other minor fixes) ([#38360](#38360)) ([721b429](721b429))
* Negative Qty and Rates in SO/PO (backport [#38252](#38252)) ([#38357](#38357)) ([14174df](14174df))
* no fstring in translation (backport [#38381](#38381)) ([#38387](#38387)) ([c101855](c101855))
* patch - Duplicate entry quality inspection parameter (backport [#38262](#38262)) ([#38264](#38264)) ([4c9890a](4c9890a))
* Payment Reco Issue and chart of account importer ([4699887](4699887))
* serial no status (backport [#38391](#38391)) ([#38397](#38397)) ([b65c225](b65c225))
* Server Error while creating Product Bundle (backport [#38377](#38377)) ([#38380](#38380)) ([922aef6](922aef6))
* skip disabled bundles for non-report utils ([3d46b32](3d46b32))
* skip fixed assets in parent ([314a91a](314a91a))
* Supplier `Primary Contact` (backport [#38268](#38268)) ([#38286](#38286)) ([37d1f1a](37d1f1a))
* **ux:** Sales Order Stock Reservation Dialog (backport [#38261](#38261)) ([#38344](#38344)) ([3cbe599](3cbe599))
* validation for existing bundles ([c0de9c0](c0de9c0))

### Features

* add Bank Transaction to connections in Journal and Payment Entry (backport [#38297](#38297)) ([#38301](#38301)) ([72647b8](72647b8))
* add disabled field in product bundle ([fcd53be](fcd53be))
* new Report "Lost Quotations" ([#38309](#38309)) ([ea2c348](ea2c348))

### Performance Improvements

* optimize total_purchase_cost update ([deed9f5](deed9f5))
frappe-pr-bot pushed a commit that referenced this pull request Nov 28, 2023
# [14.51.0](v14.50.0...v14.51.0) (2023-11-28)

### Bug Fixes

* Alert message and make sure invoice due dates are different for effective test ([0813f02](0813f02))
* allow on submit for child table fields ([d72fbe9](d72fbe9))
* annual income and expenses in digest ([7dce68b](7dce68b))
* check reposting settings before allowing editable si ([f777d24](f777d24))
* condition in other bundle utils ([e96ef73](e96ef73))
* create contact if existing customer doesn't have contact ([bb2aa90](bb2aa90))
* do not set repost flag without validating voucher ([3ad6d08](3ad6d08))
* filter bundle items based on disabled check ([8a3a068](8a3a068))
* fiscal year using future date ([b0aa4ef](b0aa4ef))
* has_product_bundle util to only check for enabled bundles ([fd19ac5](fd19ac5))
* job card overlap validation (backport [#38345](#38345)) ([#38347](#38347)) ([9cf8955](9cf8955))
* Merge conflicts ([e7183e3](e7183e3))
* Negative Qty and Rates in SO/PO ([#38253](#38253)) ([50f3b01](50f3b01))
* Payment Reco Issue and chart of account importer ([730a3bb](730a3bb))
* Re-add no.of rows split in alert message ([fb19e7f](fb19e7f))
* **regional:** item wise tax calc issue ([0448d56](0448d56))
* Server Error while creating Product Bundle (backport [#38377](#38377)) ([#38379](#38379)) ([ca6a788](ca6a788))
* skip disabled bundles for non-report utils ([445e9c9](445e9c9))
* skip fixed assets in parent ([5dcd806](5dcd806))
* stock availability not showing ([#38382](#38382)) ([3929cc3](3929cc3))
* validation for existing bundles ([ae960e7](ae960e7))

### Features

* add disabled field in product bundle ([8d5efc9](8d5efc9))
* new Report "Lost Quotations" ([#38309](#38309)) ([1773e31](1773e31))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2024
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 backport version-15-hotfix needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants