11 lines
27 KiB
JSON
11 lines
27 KiB
JSON
{
|
|
"header": {
|
|
"version": 1,
|
|
"type": "record"
|
|
},
|
|
"body": {
|
|
"record1": {
|
|
"<1>": "declare function rowexists, msg, fieldcount, next_key, Get_Status, Test_Convert_PO\r\ndeclare subroutine forward_event, create_note, Set_Status,ErrMsg, obj_Annual_Contracts\r\n$insert logical\r\n$insert annual_contracts_equ\r\n$insert quote_equ\r\n$insert schedule_equ\r\n$insert quote_spec_equ\r\n$insert quote_sigs_equ\r\n$insert msg_equates\r\n$insert recipe_equ\r\n$insert prod_spec_equ\r\n$insert wafer_inv_equ\r\n$insert ORDER_EQU\r\n$INSERT WO_LOG_EQU\r\n\r\nequ CrLf$ to char(13):char(10)\r\n\r\nVoid = utility( 'CURSOR', 'H' )\r\nequ QuoteNo$ to 1\r\nequ PSN$ to 2\r\nequ SchedNo$ to 3\r\nequ Wo$ to 4\r\nequ PartNo$ to 5\r\nequ WafInv$ to 6\r\nequ SubPartNum$ to 7\r\nequ LotNo$ to 8\r\nequ Setup$ to 9\r\nequ Srp$ to 10\r\nequ Qty$ to 11\r\nequ Price$ to 12\r\nequ Amount$ to 13\r\n\r\nEQU ST$WO\t\t\t\tTO 1\r\nEQU ST$ORD_NO\t\t\tTO 2\r\nEQU ST$QUOTE_NO\t\t\tTO 3\r\nEQU ST$PRICE\t\t\tTO 4\r\nEQU ST$LOT_NOS\t\t\tTO 5\r\nEQU ST$LOT_QTYS\t\t\tTO 6\r\nEQU ST$PART_NOS\t\t\tTO 7\r\nEQU ST$SUB_PART_NOS\t\tTO 8\r\nEQU ST$WAF_INV_IDS\t\tTO 9\r\nEQU ST$SCHED_IDS\t\tTO 10\r\nEQU ST$ADD_CHG_DESCS\tTO 11\r\nEQU ST$ADD_CHG_AMTS\t\tTO 12\r\nEQU ST$CASS_CNT\t\t\tTO 13\r\nEQU ST$CASS_QTY\t\t\tTO 14\r\n\r\nQuoteErrors = ''\r\nLockMessage = ''\r\nNewRecord = false$\r\nSendTo = xlate( 'CONFIG', 'QUOTE_SIGS', OrderNotif$, 'X' )\r\nOrderNo = .order_no->text\r\n\r\nif rowexists( 'ORDER', OrderNo ) then\r\n if ( @@window->savewarn ) then\r\n create_note( SendTo, 'System', 'Changed Order', 'Order ':OrderNo:' changed on ':oconv( date(), 'D2/' ):' at ':oconv( time(), 'MTH' ):'.', 'ORDER', OrderNo )\r\n end\r\nend else\r\n NewRecord = true$\r\n .entry_id->text = @user4\r\n create_note( SendTo, 'System', 'New Order', 'Order ':OrderNo:' created on ':oconv( date(), 'D2/' ):' at ':oconv( time(), 'MTH' ):'.', 'ORDER', OrderNo )\t \r\nend\r\n\r\nopen 'WAFER_INV' to WafInvTable else\r\n msg( '', 'Unable to open WAFER_INV...' )\r\n return 0\r\nend\r\n\r\nInvUpdateMsg = ''\r\nPossibleWafInvUpdate = false$\r\n\r\nACID = .ac_id->text\r\nALineChanged = false$\r\n\r\nNoSave = false$\r\nOOrderDetail = get_property( @window, '@OrigOrderDetail' )\r\nOrderDetail = .order_detail->array\r\nOrigPo = get_property( @window, '@OrigPo' )\r\nOrigCustNo = get_property( @window, '@OrigCustNo' )\r\nScheduleNos = OrderDetail<SchedNo$>\r\nOrigScheduleNos = ScheduleNos\r\nCustNo\t= .cust_no->text\r\nPO\t\t= .po->text\r\n\r\nPOStuff = Test_Convert_PO(PO,CustNo)\t;* Pulls current PO field into three fields for coming upgrade\r\n\r\n.PO_NO->TEXT = POStuff<1,1>\r\n.PO_LINE->TEXT = POStuff<1,2>\r\n.PO_REL->TEXT = POStuff<1,3>\r\n\r\n*if ( OrderDetail <> OOrderDetail ) or ( PO <> OrigPo ) or ( CustNo <> OrigCustNo ) then\r\n\r\nSchedShipDate = ''\r\nif sum( OrderDetail<Qty$> ) > 0 and NewRecord then\r\n * ASK FOR WAFER SCHED SHIP DATE TO STAMP ON EACH SCHEDULE\r\n MsgInfo = ''\r\n MsgInfo<mtext$> = 'Enter the':CrLf$:' wafer scheduled':CrLf$:' shipment date.' \r\n MsgInfo<mtype$> = 'RCE'\r\n MsgInfo<mvalid$> = '(D)'\r\n MsgInfo<micon$> = '?'\r\n MsgInfo<mjust$> = 'C'\r\n MsgInfo<mcaption$> = 'Scheduled Ship Date???'\r\n SchedShipDate = msg( '', MsgInfo )\r\n convert char(27) to '' in SchedShipDate\r\nend\r\nRow = 1\r\nRcnt = fieldcount( OrderDetail<1>, @vm )\r\nForceUpdate = .force_update->check\r\n\r\nfor Row = 1 to Rcnt\r\n\tThisOrderLine = OrderDetail<QuoteNo$,Row>:@vm:OrderDetail<PSN$,Row>:@vm\r\n\tThisOrderLine:= OrderDetail<SchedNo$,Row>:@vm\r\n\tThisOrderLine:= OrderDetail<Wo$,Row>:@vm:OrderDetail<PartNo$,Row>:@vm\r\n\tThisOrderLine:= OrderDetail<WafInv$,Row>:@vm:OrderDetail<SubPartNum$,Row>:@vm\r\n\tThisOrderLine:= OrderDetail<LotNo$,Row>:@vm:OrderDetail<Setup$,Row>:@vm\r\n\tThisOrderLine:= OrderDetail<Srp$,Row>:@vm:OrderDetail<Qty$,Row>:@vm\r\n\tThisOOrderLine = OOrderDetail<QuoteNo$,Row>:@vm:OOrderDetail<PSN$,Row>:@vm\r\n\tThisOOrderLine:= OOrderDetail<SchedNo$,Row>:@vm\r\n\tThisOOrderLine:= OOrderDetail<Wo$,Row>:@vm:OOrderDetail<PartNo$,Row>:@vm\r\n\tThisOOrderLine:= OOrderDetail<WafInv$,Row>:@vm:OOrderDetail<SubPartNum$,Row>:@vm\r\n\tThisOOrderLine:= OOrderDetail<LotNo$,Row>:@vm:OOrderDetail<Setup$,Row>:@vm\r\n\tThisOOrderLine:= OOrderDetail<Srp$,Row>:@vm:OOrderDetail<Qty$,Row>:@vm\r\n\tThisOOrderLine:= OOrderDetail<Price$,Row>\r\n\tif ( ForceUpdate ) or ( ThisOrderLine <> ThisOOrderLine ) or ( ThisOrderLine <> str( @vm, 11 ) and ( ThisOrderLine<1,SchedNo$> = '' ) ) then\r\n\t\t* this row has been changed/added\r\n\t\t\r\n\t\tALineChanged = true$\r\n\t\tCurQuote = ThisOrderLine<1,QuoteNo$>\r\n\t\tCurPSN = ThisOrderLine<1,PSN$>\r\n\t\tCurPartNum = ThisOrderLine<1,PartNo$>\r\n\t\tCurLotNum = ThisOrderLine<1,LotNo$>\r\n\t\tCurWo = ThisOrderLine<1,Wo$>\r\n\t\tCurWafInv = ThisOrderLine<1,WafInv$>\r\n\t\tCurQty = ThisOrderLine<1,Qty$>\r\n\t\tif ThisOrderLine<1,QuoteNo$> then\r\n\t\t\t*was below line of code but Darla said if there is a quote then verify\r\n\t\t\t*if ThisOrderLine<1,Qty$> and ThisOrderLine<1,Price$> then \r\n\t\t\t* wafers ordered\r\n\t\t\t* removed this from next line and ( ThisOrderLine<1,LotNo$> )\r\n\t\t\t* removed this ThisOrderLine<1,PartNo$>\r\n\t\t\tif ( ThisOrderLine<1,Wo$> ) and ( ThisOrderLine<1,QuoteNo$> ) and ( ThisOrderLine<1,PartNo$> ) then\r\n\t\t\t\tQuoteRec = xlate( 'QUOTE', CurQuote, '', 'X' )\r\n\t\t\t\tPSNRec = xlate( 'PROD_SPEC', CurPSN, '', 'X' )\r\n\t\t\t\tSpecType = xlate( 'PROD_SPEC', CurPSN, 'SPEC_TYPE', 'X' )\r\n\t\t\t\tSpecSubstrate = PSNRec<prod_spec_spec_substrate$>\r\n\t\t\t\tEpiLayers = PSNRec<prod_spec_spec_epi$>\r\n\t\t\t\t* validate spec information\r\n\t\t\t\tErrMsg = ''\r\n\t\t\t\tSubErrMsg = ''\r\n\t\t\t\tEpiErrMsg = ''\r\n\t\t\t\tif PSNRec<prod_spec_status$> = 'A' else\r\n\t\t\t\t\tEpiErrMsg := 'PSN not active, '\r\n\t\t\t\tend\r\n\t\t\t\tProduct = SpecSubstrate<1,QSSubProduct$>\r\n\t\t\t\t* THE CHECK FOR 999 IS DOCUMENTED IN WIN_QUOTE_NUM_VALID\r\n\t\t\t\t* PLEASE CHECK THERE FOR INFORMATION\r\n\t\t\t\tif Product = 'SiEpi' and CurQuote <> 999 then\r\n\t\t\t\t\tif SpecSubstrate<1,QSSubOrientation$> <> '' else\r\n\t\t\t\t\t\tSubErrMsg := 'Orientation, '\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif SpecSubstrate<1,QSSubType$> <> '' else\r\n\t\t\t\t\t\tSubErrMsg := 'Type, '\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif SpecSubstrate<1,QSSubWaferSize$> <> '' else\r\n\t\t\t\t\t\tSubErrMsg := 'Wafer Size, '\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif SpecSubstrate<1,QSSubDopant$> <> '' else\r\n\t\t\t\t\t\tSubErrMsg := 'Dopant, '\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif SpecSubstrate<1,QSSubOxide$> <> '' else\r\n\t\t\t\t\t\tSubErrMsg := 'Oxide to be cleaned, '\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif SpecSubstrate<1,QSSubPreClean$> <> '' else\r\n\t\t\t\t\t\tSubErrMsg := 'Preclean, '\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif SpecType = 'U' or SpecType = '' then\r\n\t\t\t\t\t\tSubErrMsg := 'Spec Type not in runnable status, '\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif SubErrMsg then\r\n\t\t\t\t\t\tSubErrMsg[-2,2] = ''\r\n\t\t\t\t\t\tSubErrMsg := '. '\r\n\t\t\t\t\t\tSubErrMsg = 'The following substrate information ':SubErrMsg\r\n\t\t\t\t\tend\r\n\t\t\t\t\t* now each epi layer\r\n\t\t\t\t\tLayerType = ''\r\n\t\t\t\t\tconvert char(247) to @fm in EpiLayers ;* each seperate layer\r\n\t\t\t\t\tSepLayCnt = fieldcount( EpiLayers, @fm )\r\n\t\t\t\t\t************************THIS IS WHEN WE NEED SCHEDULE CREATED WHEN \r\n\t\t\t\t\t************************THERE IS NO QUOTE_SPEC INFO\r\n\t\t\t\t\tif ( SpecType <> 'Q' ) then ;* IF SPEC IS A MATRIX OR QUAL THEN DON'T CHECK EPI LAYERS\r\n\t\t\t\t\t\tfor i = 1 to SepLayCnt\r\n\t\t\t\t\t\t\tThisSepLayer = EpiLayers<i>\r\n\t\t\t\t\t\t\tLayerToUse = field( ThisSeplayer, char(248), 1 )\r\n\t\t\t\t\t\t\tLayerType = 'SEP'\r\n\t\t\t\t\t\t\tgosub CheckLayer\r\n\t\t\t\t\t\t\t* \r\n\t\t\t\t\t\t\tSameLayers = field( ThisSepLayer, char(248), 2, 9999 )\r\n\t\t\t\t\t\t\tconvert char(248) to @fm in SameLayers\r\n\t\t\t\t\t\t\tSameLayCnt = fieldcount( SameLayers, @fm )\r\n\t\t\t\t\t\t\t* does the recipe have the same amout of same reactor layers\r\n\t\t\t\t\t\t\tTRecipe = LayerToUse<1,QSEpiRecipe$>\r\n\t\t\t\t\t\t\tTRecipeStatus = xlate( 'RECIPE', TRecipe, recipe_status$, 'X' )\r\n\t\t\t\t\t\t\tif TRecipeStatus = 'I' then\r\n\t\t\t\t\t\t\t\tEpiErrMsg := 'Recipe ':Trecipe:' is inactive, '\t\t\t\t\t\t \r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tRecipeLayers = xlate( 'RECIPE', TRecipe, recipe_layer_info$, 'X' )\r\n\t\t\t\t\t\t\tTlCnt = fieldcount( RecipeLayers, char(248) )\r\n\t\t\t\t\t\t\tif TlCnt < SameLayCnt then\r\n\t\t\t\t\t\t\t\t* error recipe does not have as many same reactor layers\r\n\t\t\t\t\t\t\t\tEpiErrMsg := 'Recipe ':Trecipe:' must have ':SameLayCnt+1:' layers, as used by seperate reactor layer ':i:', '\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tfor j = 1 to SameLayCnt\r\n\t\t\t\t\t\t\tLayerToUse = SameLayers<j>\r\n\t\t\t\t\t\t\t\tLayerType = 'SAME'\r\n\t\t\t\t\t\t\t\tgosub CheckLayer\r\n\t\t\t\t\t\t\t next j\r\n\t\t\t\t\t\tnext i\r\n\t\t\t\t\tend\r\n\t\t\t\t\t********************************************** END\r\n\t\t\t\t\t*****************AND THIS IS THE END\r\n\t\t\t\t\tif EpiErrMsg then\r\n\t\t\t\t\t\tEpiErrMsg[-2,2] = ''\r\n\t\t\t\t\t\tEpiErrMsg := '. '\r\n\t\t\t\t\t\tEpiErrMsg = 'The following EPI information: ':EpiErrMsg\r\n\t\t\t\t\tend\r\n\t\t\t\t\tif EpiErrMsg or SubErrMsg then\r\n\t\t\t\t\t\tlocate CurQuote in QuoteErrors using @vm setting Fpos else\r\n\t\t\t\t\t\t\tQuoteErrors<1,-1> = CurQuote\r\n\t\t\t\t\t\t\tErrMsg = 'The following information is missing from quote ':CurQuote:'...PSN ':CurPSN:' ':SubErrMsg:EpiErrMsg\r\n\t\t\t\t\t\t\t* SEND MESSAGE TO THE APPROPRIATE GROUP, BASED ON PSN TYPE\r\n\t\t\t\t\t\t\tSendTo = ''\r\n\t\t\t\t\t\t\tQuoteSigInfo = xlate( 'CONFIG', 'QUOTE_SIGS', '', 'X' )\r\n\t\t\t\t\t\t\tbegin case\r\n\t\t\t\t\t\t\t\tcase SpecType = 'U'\r\n\t\t\t\t\t\t\t\t\tSendTo = QuoteSigInfo<PSNPreQualSigs$>\r\n\t\t\t\t\t\t\t\tcase SpecType = 'Q'\r\n\t\t\t\t\t\t\t\t\tSendTo = QuoteSigInfo<PSNQualSigs$>\r\n\t\t\t\t\t\t\t\tcase SpecType = 'E'\r\n\t\t\t\t\t\t\t\t\tSendTo = QuoteSigInfo<PSNPreProdSigs$>\r\n\t\t\t\t\t\t\t\tcase SpecType = 'P'\r\n\t\t\t\t\t\t\t\t\tSendTo = QuoteSigInfo<PSNProdSigs$>\r\n\t\t\t\t\t\t\tend case\r\n\t\t\t\t\t\t\tSendTo := @VM:'BRYCE_M':@VM:'ELIZABETH_G'\r\n\t\t\t\t\t\t\tcreate_note( SendTo, 'System', 'Incomplete Spec', ErrMsg, 'PROD_SPEC', CurPSN )\r\n\t\t\t\t\t\t\t* display message to dr\r\n\t\t\t\t\t\t\tMsgInfo = ''\r\n\t\t\t\t\t\t\tMsgInfo<mtext$> = 'Unable to create schedule for quote ':CurQuote:'. There is missing epi and/or substrate information. Message sent to ':oconv( SendTo, '[XLATE_CONV,LSL_USERS*FIRST_LAST]' ):'.'\r\n\t\t\t\t\t\t\tMsgInfo<micon$> = '!'\r\n\t\t\t\t\t\t\tVoid = msg( '', MsgInfo )\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend else\r\n\t\t\t\t\t\t* create the schedule\r\n\t\t\t\t\t\tgosub WriteSchedRec\r\n\t\t\t\t\tend\r\n\t\t\t\t\t* ADJUST INVENTORY TO INPROCESS IF APPLICABLE\r\n\t\t\t\t\tif ( CurWafInv <> '' ) then\r\n\t\t\t\t\t\tPossibleWafInvUpdate = true$\r\n\t\t\t\t\t\t* THERE IS AN INVENTORY NUMBER AND THE QUANTITY HAS EITHER CHANGED\r\n\t\t\t\t\t\t* OR THIS IS A NEW LINE\r\n\t\t\t\t\t\t* NOW LETS MAKE SURE THERE IS A QTY\r\n\t\t\t\t\t\tWIqty = ThisOrderLine<1,Qty$>\r\n\t\t\t\t\t\tif ( WIQty > 0 and ( WIQty <> ThisOOrderLine<1,Qty$> ) ) or ( ForceUpdate = true$ and WIQty > 0 ) or ( CurWafInv <> OOrderDetail<1,WafInv$> ) then\r\n\t\t\t\t\t\t\tlock WafInvTable, CurWafInv then\r\n\t\t\t\t\t\t\t\tWIRec = xlate( 'WAFER_INV', CurWafInv, '', 'X' )\r\n\t\t\t\t\t\t\t\tif CurLotNum <> '' then\r\n\t\t\t\t\t\t\t\t\tCurLotNum = trim( CurLotNum )\r\n\t\t\t\t\t\t\t\t\tInvLotNums = WIRec<wafer_inv_inventory_lot_num$>\r\n\t\t\t\t\t\t\t\t\tInvLotCnts = WIRec<wafer_inv_inventory_lot_num_qty$>\r\n\t\t\t\t\t\t\t\t\tlocate CurLotNum in InvLotNums using @vm setting WIpos then\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tMaxAllowed = InvLotCnts<1,WIpos>\r\n\r\n\t\t\t\t\t\t\t\t\t\tLotPart = CurLotNum\r\n\t\t\t\t\t\t\t\t\t\tTotLotPartCnt = 0\r\n\t\t\t\t\t\t\t\t\t\tOLCnt = fieldcount( WIRec<wafer_inv_order_no$>, @vm )\r\n\t\t\t\t\t\t\t\t\t\tLineFoundOn = 0\r\n\t\t\t\t\t\t\t\t\t\tfor Ww = 1 to OLCnt\r\n\t\t\t\t\t\t\t\t\t\t\tThisInvOrderNo = WIRec<wafer_inv_order_no$,Ww>\r\n\t\t\t\t\t\t\t\t\t\t\tThisInvOrderLine = WIRec<wafer_inv_order_line$,Ww>\r\n\t\t\t\t\t\t\t\t\t\t\tThisInvLotPart = WIRec<wafer_inv_mfg_lot_no$,Ww>\r\n\t\t\t\t\t\t\t\t\t\t\tThisInvInProc = WIRec<wafer_inv_in_process$,Ww>\r\n\t\t\t\t\t\t\t\t\t\t\tThisInvInvoiceNo = WIRec<wafer_inv_lsl_invoice_no$,Ww>\r\n\t\t\t\t\t\t\t\t\t\t\tif ThisInvLotPart = LotPart then\r\n\t\t\t\t\t\t\t\t\t\t\t\t* CHECKING BELOW THAT THE LSL INVOICE NO IS BLANK\r\n\t\t\t\t\t\t\t\t\t\t\t\t* CAUSE WE DO NOT WANT TO UPDATE AN INVOICE LINE\r\n\t\t\t\t\t\t\t\t\t\t\t\tif ( ThisInvInvoiceNo = '' ) and ( ThisInvOrderNo = OrderNo ) and ( ThisInvOrderLine = Row ) then\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tLineFoundOn = Ww\r\n\t\t\t\t\t\t\t\t\t\t\t\tend else\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tTotLotPartCnt += ThisInvInProc\r\n\t\t\t\t\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\t\t\t\tnext Ww\r\n \t\t\t\t\t\t\t\t\t* ACCOUNT FOR THE QTY THAT WE ARE ADDING\t\t\t\t\t \r\n \t\t\t\t\t\t\t\t\tTotLotPartCnt += ThisOrderLine<1,Qty$>\t\r\n\t\t\t\t\t\t\t\t\t\tif TotLotPartCnt > MaxAllowed then\r\n\t\t\t\t\t\t\t\t\t\t\t* ERROR MESSAGE\r\n\t\t\t\t\t\t\t\t\t\t\tMsgInfo = ''\r\n\t\t\t\t\t\t\t\t\t\t\tMsgInfo<mtext$> = 'No update on wafer inventory#':CurWafInv:' for order line ':Row:' due to alloted amount for lot number ':CurLotNum:' being ':MaxAllowed:', and this would put it at ':TotLotPartCnt\r\n\t\t\t\t\t\t\t\t\t\t\tMsgInfo<micon$> = '!'\r\n\t\t\t\t\t\t\t\t\t\t\tVoid = msg( '', MsgInfo )\r\n\t\t\t\t\t\t\t\t\t\tend else\r\n\t\t\t\t\t\t\t\t\t\t\t* UPDATE THE INVENTORY\r\n\t\t\t\t\t\t\t\t\t\t\tif LineFoundOn > 0 then\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_order_no$,LineFoundOn> = OrderNo \r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_order_line$,LineFoundOn> = Row \r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_lsl_po$,LineFoundOn> = .po->text\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_mfg_lot_no$,LineFoundOn> = LotPart\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_lsl_wo$,LineFoundOn> = CurWo\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_ship_date$,LineFoundOn> = date() \r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_in_process$,LineFoundOn> = WIQty\r\n\t\t\t\t\t\t\t\t\t\t\tend else\r\n\t\t\t\t\t\t\t\t\t\t\t\t* ADD TO THE BOTTOM\r\n\t\t\t\t\t\t\t\t\t\t\t\tNpos = OLCnt + 1\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_order_no$,Npos> = OrderNo\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_order_line$,Npos> = Row\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_lsl_po$,Npos> = .po->text\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_mfg_lot_no$,Npos> = LotPart\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_lsl_wo$,Npos> = CurWo\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_ship_date$,Npos> = date()\r\n\t\t\t\t\t\t\t\t\t\t\t\tWIRec<wafer_inv_in_process$,Npos> = WIQty\r\n\t\t\t\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\t\t\t\t\tif InvUpdateMsg = '' then\r\n\t\t\t\t\t\t\t\t\t\t\t\tInvUpdateMsg = 'The following wafer inventory records were updated: ':CrLf$\r\n\t\t\t\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\t\t\t\t\tInvUpdateMsg := 'Inventory#':CurWafInv:' from order line ':Row:CrLf$\r\n\t\t\t\t\t\t\t\t\t\t\twrite WIRec on WafInvTable, CurWafInv else\r\n\t\t\t\t\t\t\t\t\t\t\tVoid = msg( '', 'Unable to write ':CurWafInv:' on WAFER_INV...' )\r\n\t\t\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\t\tend else\r\n\t\t\t\t\t\t\t\t\tMsgInfo = ''\r\n\t\t\t\t\t\t\t\t\tMsgInfo<mtext$> = 'No update on wafer inventory#':CurWafInv:' for order line ':Row:' due to lot number ':CurLotNum:' not found in the lot number qty breakdown portion...'\r\n\t\t\t\t\t\t\t\t\tMsgInfo<micon$> = '!'\r\n\t\t\t\t\t\t\t\t\tVoid = msg( '', MsgInfo )\r\n\t\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tend else\r\n\t\t\t\t\t\t\t\tMsgInfo = ''\r\n\t\t\t\t\t\t\t\tMsgInfo<mtext$> = 'No update on wafer inventory#':CurWafInv:' for order line ':Row:' due to no Lot Number on row ':Row:'...'\r\n\t\t\t\t\t\t\t\tMsgInfo<micon$> = '!'\r\n\t\t\t\t\t\t\t\tVoid = msg( '', MsgInfo )\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\t\tunlock WafInvTable, CurWafInv else\r\n\t\t\t\t\t\t\t\tMsgInfo = ''\r\n\t\t\t\t\t\t\t\tMsgInfo<mtext$> = 'Unable to unlock wafer inventory#':CurWafInv\r\n\t\t\t\t\t\t\t\tMsgInfo<micon$> = '!'\r\n\t\t\t\t\t\t\t\tVoid = msg( '', MsgInfo )\r\n\t\t\t\t\t\t\tend\r\n\t\t\t\t\t\tend else\r\n\t\t\t\t\t\t\tMsgInfo = ''\r\n\t\t\t\t\t\t\tMsgInfo<mtext$> = 'Unable to update wafer inventory#':CurWafInv:' for order line ':Row:' due to it currently being in use. You will need to manually update this inventory...'\r\n\t\t\t\t\t\t\tMsgInfo<micon$> = '!'\r\n\t\t\t\t\t\t\tVoid = msg( '', MsgInfo )\r\n\t\t\t\t\t\tend\r\n\t\t\t\t\tend else\r\n\t\t\t\t\t\t* NO QUANTITY OR IT HAS NOT CHANGED SO NO UPDATE ON WAFER INVENTORY\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\tend else\r\n\t\t\t\tgosub WriteSchedRec\r\n\t\t\tend\r\n\t\tend else\r\n\t\t\tNoSave = true$\r\n\t\t\tMsgInfo = ''\r\n \t\t\tMsgInfo<micon$> = '!'\r\n \t\t\tMsgInfo<mtext$> = 'Order line ':Row:' must have a Quote Number, PSN, Part Number, and a Work Order. No schedule created for this line.'\r\n\t\t\tVoid = msg( '', MsgInfo )\r\n\t\tend\r\n\tend else\r\n \t\t* setup or srp charge\r\n\t\t\tif ( ThisOrderLine<1,Setup$> <> '' ) or ( ThisOrderLine<1,Srp$> <> '' ) and ( ThisOrderLine<1,QuoteNo$> ) then\r\n\t\t\t\t* create schedule\r\n \t\t\t\tgosub WriteSchedRec\r\n\t\t\tend else\r\n\t\t\t\tif ForceUpdate else\r\n\t\t\t\t\tNoSave = true$\r\n\t\t\t\t\tMsgInfo = ''\r\n\t\t\t\t\tMsgInfo<mtext$> = 'Order line ':Row:' has missing information. Each line must be either a Setup charge, SRP charge, or Wafers ordered and each line must have a quote number.'\r\n\t\t\t\t\tMsgInfo<micon$> = '!'\r\n\t\t\t\t\tVoid = msg( '', MsgInfo )\r\n\t\t\t\tend\r\n \t\t\tend\r\n\t\tend\r\n \tend \r\nnext Row\r\n* \r\nif ( PossibleWafInvUpdate = false$ ) then\r\n * DO NOT SEND A MESSAGE CAUSE NO ACTIVITY IN WAFER INVENTORY\r\nend else\r\n if InvUpdateMsg = '' then\r\n * POSSIBLE UPDATE BUT NOTHING CHANGED IN THE QUANTITY\r\n MsgInfo = ''\r\n MsgInfo<mtext$> = 'No wafer inventory updates...'\r\n MsgInfo<micon$> = '!'\r\n Void = msg( '', MsgInfo )\r\n end else\r\n * WE HAVE AN UPDATE SO DISPLAY TO USER\r\n MsgInfo = ''\r\n MsgInfo<mtext$> = InvUpdateMsg\r\n MsgInfo<micon$> = '!'\r\n Void = msg( '', MsgInfo )\r\n end\r\nend\r\n\r\n* Update Annual Contract\t;* Added obj_Annual_Contract routine 12/18/2003 John C. Henry, J.C. Henry & Co., Inc.\r\n\r\nif ( ACID <> '' ) and ( ALineChanged = true$ ) then\r\n\tOrderDetail = .order_detail->array \r\n\tQuotes\t\t= OrderDetail<QuoteNo$>\r\n\tWOs\t\t\t= OrderDetail<Wo$>\r\n\tSetupAmts\t= ICONV(OrderDetail<Setup$>,'MD2')\r\n\tSRPAmts\t\t= ICONV(OrderDetail<Srp$>,'MD2')\r\n\tQtys\t\t= ICONV(OrderDetail<Qty$>,'MD0')\r\n\tPrices\t\t= ICONV(OrderDetail<Price$>,'MD2')\r\n\t\r\n\tDetailCnt = Count( Quotes, @vm ) + (Quotes NE '')\r\n \r\n\t* Summarize detail on a WO basis\r\n \r\n\tOrderWOs \t= ''\r\n\tWOSetupAmts\t= ''\r\n\tWOQtys\t\t= ''\r\n\tWOPrices\t\t= ''\r\n \r\n\tFOR I = 1 TO DetailCnt\r\n\t\tThisWO = WOs<1,I>\r\n\t\tif ThisWO <> '' then\r\n\t\t\tLOCATE ThisWO IN OrderWOs BY 'AR' USING @vm SETTING WOPos THEN\r\n\t\t\t\t* Total Setup & SRP amounts and Quantities\r\n\t\t\t\tWOSetupAmts<1,WOPos> = WOSetupAmts<1,WOPos> + SetupAmts<1,I> + SRPAmts<1,I>\r\n\t\t\t\tWOQtys<1,WOPos>\t\t = WOQtys<1,WOPos> + Qtys<1,I>\r\n\t\t\tEND ELSE\r\n\t\t\t\tOrderWOs\t= insert( OrderWOs, 1, WOPos, 0, ThisWO )\r\n\t\t\t\tWOSetupAmts = insert( WOSetupAmts, 1, WOPos, 0, SetupAmts<1,I> + SRPAmts<1,I> )\r\n\t\t\t\tWOQtys \t= insert( WOQtys, 1, WOPos, 0, Qtys<1,i>)\r\n\t\t\t\tWOPrices\t= insert( WOPrices, 1, WOPos, 0, Prices<1,I>)\r\n\t\t\tEND\t;* End of locate by\r\n\t\tEND\t;* End of check for null WO (data comes from screen control and WILL have empty lines)\r\n\tNEXT I\r\n \r\n\tIF OrderWOs NE '' THEN\r\n\t\t\r\n * Update Annual Contract record with order information\r\n \r\n\t\tACPO = .po->text\r\n\t\tACRelNo = field( ACPO, '-', 2 )\r\n\t\tACRelDate = .entry_date->text\r\n\t\tWOSetupAmts = OCONV(WOSetupAmts,'MD2')\t;* OCONV before passing to obj_Annual_Contracts\r\n\t\tWOQtys\t\t= OCONV(WOQtys,'MD0')\r\n\t\tWOPrices\t= OCONV(WOPrices,'MD2')\r\n\r\n\t\tParms = OrderNo:@RM:ACID:@RM:ACPO:@RM:ACRelNo:@RM:ACRelDate:@RM:OrderWOs:@RM:WOSetupAmts:@RM:WOQtys:@RM:WOPrices \r\n \r\n Set_Status(0)\r\n obj_Annual_Contracts('AddOrder',Parms)\r\n\t\tIF Get_Status(errCode) THEN\r\n\t\t\tErrMsg(errCode)\r\n\t\t\tErrorMsg = 'Unable to update Annual Contract# ':ACID:CrLf$:CrLf$\r\n\t\t\tErrorMsg := 'You will have to update manually or try again later using force update.'\r\n\t\t\tErrMsg(ErrorMsg)\r\n\t\tEND ELSE\r\n\t\t\tMsgInfo = ''\r\n\t\t\tMsgInfo<mtype$> = 'T1'\r\n\t\t\tMsgInfo<mtext$> = 'Annual Contract# ':ACID:' has been updated.'\r\n\t\t\tMsgInfo<micon$> = '!'\r\n\t\t\tVoid = msg( '', MsgInfo )\r\n\t\tEND\t\r\n\tEND\t;* End of check for OrderWOs\r\nend\r\n\r\n*\tEnd of mods by JCH\t12/18/2003\r\n\r\nif ScheduleNos <> OrigScheduleNos then\r\n OrderDetail = .order_detail->array\r\n OrderDetail<SchedNo$> = ScheduleNos\r\n .order_detail->array = OrderDetail\r\nend\r\nVoid = utility( 'CURSOR', 'A' )\r\n\r\nIF NoSave ELSE\r\n Forward_Event()\r\n \r\n\t* Added on 1/10/2005 by JCH for conversion project ***************************************************\r\n\t\r\n\t*Set_Status(0)\r\n\t*obj_Order('Ord_WOLog',OrderNo)\r\n\t\r\n\t*IF Get_Status(errCode) THEN\r\n\t*\tErrMsg(errCode)\r\n\t*END\r\n\t\t\t\r\n\t*Set_Status(0)\r\n\t\r\n\t*obj_Order('OrderDet',OrderNo)\r\n\t\r\n\t*IF Get_Status(errCode) THEN\r\n\t*\tErrMsg(errCode)\r\n\t*END\t\t\t\r\nend\r\n\r\nif LockMessage then\r\n LockMessage[-2,2] = ''\r\n MsgInfo = ''\r\n MsgInfo<mtext$> = LockMessage\r\n MsgInfo<micon$> = '!'\r\n Void = msg( '', MsgInfo )\r\nend\r\nif ScheduleNos and NewRecord then\r\n Tsched = ScheduleNos\r\n TTSched = Tsched\r\n convert @vm to '' in TTSched\r\n if TTSched <> '' then\r\n\t swap @vm:@vm with '' in Tsched\r\n\t if Tsched[-1,1] = @vm then Tsched[-1,1] = ''\r\n\t swap @vm with ', ' in Tsched\r\n\t Tsched := '.'\r\n\t MsgInfo = ''\r\n\t MsgInfo<micon$> = '!'\r\n\t MsgInfo<mtext$> = 'The following schedules were created ':Tsched\r\n\t Void = msg( '', MsgInfo )\r\n\tend\r\nend\r\nreturn 0\r\n*===========================================================================*\r\nCheckLayer:\r\n if LayerType = 'SEP' then\r\n LayerStatment= 'for reactor seperate layer ':i\r\n end\r\n if LayerType = 'SAME' then\r\n LayerStatment = ' for same reactor layer ':j:' of seperate reactor layer ':i\r\n end\r\n ConcMinThick = LayerToUse<1,QSEpiConcMinThick$,1> ;* could have @svm\r\n ConcMaxThick = LayerToUse<1,QSEpiConcMaxThick$,1> ;* could have @svm\r\n ConcUnits = LayerToUse<1,QSEpiConcUnits$> \r\n\tResMinThick = LayerToUse<1,QSEpiResMinThick$> \r\n\tResMaxThick = LayerToUse<1,QSEpiResMaxThick$> \r\n\tResUnits = LayerToUse<1,QSEpiResUnits$> \r\n\tMinThick = LayerToUse<1,QSEpiMinThick$> \r\n\tMaxThick = LayerToUse<1,QSEpiMaxThick$> \r\n\tThickUnits = LayerToUse<1,QSEpiThickUnits$> \r\n\tLDopant = LayerToUse<1,QSEpiDopant$> \r\n\tRecipe = LayerToUse<1,QSEpiRecipe$>\r\n ThickMeasure = LayerToUse<1,QSEpiThickMeasure$>\r\n ResMeasure = LayerToUse<1,QSEpiResMeasure$>\r\n\tif ( MinThick <> '' ) and ( MaxThick <> '' ) and ( ThickUnits <> '' ) else\r\n\t EpiErrMsg := 'Thickness information ':LayerStatment:', '\r\n\tend\r\n\tif ( ResMinThick <> '' ) and ( ResMaxThick <> '' ) and ( ResUnits <> '' ) else\r\n\t * need to see if concentration is stored as @svm@svm\r\n\t if ( ConcMinThick <> '' ) and ( ConcMaxThick <> '' ) and ( ConcUnits <> '' ) else\r\n\t if ConcMinThick:ConcMaxThick:ConcUnits = '' then\r\n\t EpiErrMsg := 'Resistivity information ':LayerStatment:', '\r\n\t end else\r\n\t if ResMinThick:ResMaxThick:ResUnits = '' then\r\n\t EpiErrMsg := 'Concentration information ':LayerStatment:', '\r\n\t end else\r\n\t EpiErrMsg := 'Resistivity or Concentration information and should use either or ':LayerStatment:', '\r\n\t end\r\n\t end\r\n\t end\r\n\tend \r\n\tif LDopant <> '' else\r\n\t EpiErrMsg := 'Dopant ':LayerStatment:', '\r\n\tend\r\n\tif LayerType = 'SEP' then\r\n\t\tif Recipe <> '' else\r\n\t\t EpiErrMsg := 'Recipe ':LayerStatment:', '\r\n\t\tend\r\n\tend\r\n if ThickMeasure <> '' else\r\n EpiErrMsg := 'Thickness measured by ':LayerStatment:', '\r\n end\r\n if ResMeasure <> '' else\r\n EpiErrMsg := 'Resistivity measured by ':LayerStatment:', '\r\n end\r\nreturn\r\n*===========================================================================*\r\nWriteSchedRec:\r\n open 'SCHEDULE' to SchedTable else\r\n\t Void = msg( '', 'Unable to open SCHEDULE...' )\r\n\t\treturn 0\r\n end\r\n KeyToUse = ScheduleNos<1,Row>\r\n Update = true$\r\n if KeyToUse then\r\n Exists = true$\r\n lock SchedTable, KeyToUse then\r\n ScheduleRec = xlate( 'SCHEDULE', KeyToUse, '', 'X' )\r\n end else\r\n if LockMessage else\r\n LockMessage = 'Unable to lock schedule no(s). Try at a later point. '\r\n end\r\n LockMessage := KeyToUse :', '\r\n Update = false$\r\n end \r\n end else\r\n Exists = false$\r\n KeyToUse = next_key( 'SCHEDULE', SchedTable, 'NEXT', '' )\r\n ScheduleRec = ''\r\n ScheduleRec<schedule_entry_id$> = @user4\r\n\t ScheduleRec<schedule_entry_date$> = date() \r\n\t ScheduleRec<schedule_status$> = 'O'\r\n end\r\n if Update then\r\n ScheduleRec<schedule_po$> = .po->text\r\n ScheduleRec<schedule_order_no$> = OrderNo\r\n ScheduleRec<schedule_cust_no$> = .cust_no->text\r\n\t ScheduleRec<schedule_order_line$> = Row\r\n\t ScheduleRec<schedule_part_num$> = CurPartNum\r\n\t ScheduleRec<schedule_lot_num$> = CurLotNum\r\n\t ScheduleRec<schedule_wo$> = CurWo\r\n\t ScheduleRec<schedule_quote_num$> = CurQuote\r\n ScheduleRec<schedule_prod_spec_id$> = CurPSN\r\n\t if SchedShipDate <> '' then\r\n\t * this will not be set unless it is a new order\r\n\t ScheduleRec<schedule_sched_date$> = SchedShipDate\r\n\t end\r\n\t write ScheduleRec on SchedTable, KeyToUse else\r\n\t Void = msg( '', 'Unable to write ':KeyToUse:' on SCHEDULE...' )\r\n\t\t return 0\r\n\t end\r\n\t unlock SchedTable, KeyToUse else\r\n\t Void = msg( '', 'Unable to unlock SCHEDULE ':KeyToUse:'...' )\r\n\t return 0\r\n\t end\r\n\t if Exists else\r\n\t Void = next_key( 'SCHEDULE', SchedTable, 'UPDATE', KeyToUse )\r\n\t end\r\n\tend\r\n\tScheduleNos<1,Row> = KeyToUse\r\nreturn"
|
|
}
|
|
}
|
|
} |