#SQL query that extracts data from production_status table, joining the sequence and production_status table in WP_id attribute, in order to retrieve that WIP
#check operation's name and if is one of the three in the list; create the actually non-existing dictionary that holds the WIP - buffered just before the PPASB assembly operation
#check capacity required for each task - if it's 0 then delete this task from WIP
ifdata['WIP'][task]['Capacity required']==0:
deldata['WIP'][task]
#if it's SMF and capacity finished then delete the fake dictionary created to hold the WIP just before WELD
ifind5.Operation_Name=='SMF':
deldata['WIP']['WELD_id'+orderID]
ifind5.Operation_Namenotinappended:
appended.append(ind5.Operation_Name)
#try syntax to check if the operation finished is one of the following three; if yes delete the fake dictionary created to hold the WIP just before PPASB assembly station
try:
if'CNC'and'WELD'and'MCH'inappended:
deldata['WIP']['PPASB_id'+orderID]
exceptKeyError:
continue
#for every line in production_status table
forxinrange(e.rowcount):
ind5=wipList[x]
orderID=ind5.Order_id
task=ind5.WP_id
operation=ind5.Operation_Name
#check ii operation is a not finished SMF then using the calculate using the relationship ratio between SMF and WELD the available capacity can start in WELD
#check and if operation is WELD calculate first the finished capacity and then based on the status of CNC and MCH operations, the capacity buffered before the assembly station PPASB
#check and if operation is CNC calculate first the finished capacity and then based on the status of WELD and MCH operations, the capacity buffered before the assembly station PPASB
#check and if operation is MCH calculate first the finished capacity and then based on the status of CNC and WELD operations, the capacity buffered before the assembly station PPASB