Skip to content

Commit

Permalink
Bug Fix
Browse files Browse the repository at this point in the history
Version Using : 14.47.4
Bug found: False Job card overlap error.
Details: Consider the example below.
A job card with time log 2023-11-22 10:25:00 to 2023-11-22 11:40:00 is throwing error while saving. So as per the existing algorithm for job cards I found below time logs which are overlapping

    2023-11-22 10:20:00 to 2023-11-22 10:30:00
    2023-11-22 10:30:00 to 2023-11-22 10:40:00
    2023-11-22 10:40:00 to 2023-11-22 10:45:00
    2023-11-22 10:45:00 to 2023-11-22 11:00:00 and Production capacity is 3.
    Now if you observe closely only 1 job card is active at any instance of time. so technically all these 4 job cards we can grouped as single set (for overlapping findings not in real) and can have more job cards as we have capacity 3.

So we can see here that at any instance of time from 10:25:00 to 11:00:00 you will find only 2 Job cards running including (the Job card which I am trying save). And as the capacity is 3 this job card must be saved and should not throw any overlapping error.

So the changes we made as below:
we reach to the comparison point as per the previous algorithm and then we have introduced a new layer for finding set of job cards which are not overlapping(sequential). Considering those group job cards as single overlapping set for other job cards so comparison will be correct in this case.
  • Loading branch information
VihangT authored Nov 25, 2023
1 parent a1636bc commit d033870
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion erpnext/manufacturing/doctype/job_card/job_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def get_overlap_for(self, args, check_next_available_slot=False):
sequentialjc_list = [[]]
temp = existing.copy()
while len(temp) > 0:
[seqtemp,temp1] = groupingjc(temp)
[seqtemp,temp1] = self.groupingjc(temp)
sequentialjc_list.append(seqtemp)
temp = temp1
sequentialjc_list.pop(0)
Expand Down

0 comments on commit d033870

Please sign in to comment.