+{Page}OrderProc ! 5 Intializations !---------------------------------------- +{Object.1}CustomerArrival +{Trans} !A customer in this case is an order in the orders file call ReadOrder(21,bigSur,bigTkn) call date_and_time(&8.Date,&10.Time) -{Trans} -{Object.1}CustomerArrival !---------------------------------------- +{Object.3}PrintLabel +{Trans} write(&T.LabelFile,'(A)')"1" !Page ejection !----- write(&T.LabelFile,'(////)') !Skip lines !----- !Content to be printed on shipping label. Label is only 5.5 inches wide... !Labels are postitioned in the middle of a laser printer feed and so... !spaces must be printed from the left margin before printing label content write(&T.LabelFile,'(A,T43,A,I3)')repeat(" ",19)//"Pedal Magic Project", & trim(#7.OrdNumber)//trim(#20.BoxTypeDesc)//". Units:",#R.Units !----- write(&T.LabelFile,'(A,T43,A,2F7.2,A)')repeat(" ",19) & //"Ushar Enterprises Inc","Post",#S.Postage,#S.ShippingWt," lbs" !----- write(&T.LabelFile,'(A,T43,A)')repeat(" ",19)//"2250 Coldwater Lane", & #35.OrdDateTime !----- write(&T.LabelFile,'(A,T43,A)')repeat(" ",19)//"Frisco, TX 75034-5204", & "Proc: "//&8.Date(5:6)//"/"//&8.Date(7:8)//"/"//&8.Date(1:4)//" "// & &10.Time(1:2)//":"//&10.Time(3:4)//":"//&10.Time(5:6) !----- write(&T.LabelFile,'(///)') !----- write(&T.LabelFile,'(A)')repeat(" ",19)//#35.ShipName write(&T.LabelFile,'(A)')repeat(" ",19)//#35.ShipAddr1 write(&T.LabelFile,'(A)')repeat(" ",19)//#35.ShipAddr2 write(&T.LabelFile,'(A)')repeat(" ",19)//#35.ShipCityStateZip if(trim(#35.ShipCountry) /= "United States") & write(&T.LabelFile,'(A)')repeat(" ",19)//#35.ShipCountry -{Trans} -{Object.3}PrintLabel !---------------------------------------- +{Object.4}AddToShippedFile +{Trans} !This node is to be turned into a network node. The referenced network.. !will contain logic for adding the order to the shipped orders file -{Trans} -{Object.4}AddToShippedFile !---------------------------------------- +{Object.5}Intializations integer:: intFile,intIOerr +{Trans} &S.WeightPerItem = 7./16. !7 ounces converted to lbs !If capacity of a box is 10 items and only 8 items are shipped in it... !the void for the 2 items should be filled with packing paper. &S.PakPprWtPerLThanCapItems = 0.5/16.0 !Half an ounce converted to lbs !----- !Initialize shipping options in the current set of orders &R.Domestic = 0 &R.International = 0 &R.Overnight = 0 !----- !Get operational data open(21,file="PedMag.htm",status='old',action='read',iostat=intIOerr) if(intIOerr/=0)call ErrMsg(9,0,"Could not open PedMag.htm") call GetTable(21,{Table.D}ItemsVsBoxType) !Box type needed for a given # of items call GetTable(21,{Table.D}PriorityRates) !USPS Priority Mail postage rates close(21) !----- !File containing orders open(21,file="PedOrd.DAT",status='old',action='read',iostat=intIOerr) if(intIOerr/=0)call ErrMsg(9,0,"Could not open PedOrd.DAT") !----- &T.LabelFile = 22 open(&T.LabelFile,file="Labels.TXT",action='write') -{Trans} -{Object.5}Intializations !---------------------------------------- +{Object.8}CustomerArrival--->|PrintInvoice +{Branch} {nop.L}Branch={&L.NextExists}... !&L.NextExists is set in ReadAndChk called by ReadOrder, which is called... !in the CustomerArrival node -{Branch} -{Object.8}CustomerArrival--->|PrintInvoice !---------------------------------------- +{Object.9}CustomerArrival--->|PrintLabel +{Branch} {nop.L}Branch={&L.NextExists} -{Branch} -{Object.9}CustomerArrival--->|PrintLabel -{Page}OrderProc ////////////////////////////////////////// +{Page}PrintLabel ! 6 StartPrintLabel !---------------------------------------- +{Object.4}TallyShippingTypes +{Trans} if(trim(#35.ShipCountry) /= "United States")then &R.International = &R.International + 1 else &R.Domestic = &R.Domestic + 1 endif if(trim(#15.ShipOption) == "Overnight")&R.Overnight = &R.Overnight + 1 -{Trans} -{Object.4}TallyShippingTypes -{Page}PrintLabel ////////////////////////////////////////// +{Page}Postage ! 11 ItemsInTheOrder !---------------------------------------- +{Object.1}ShippingWeight +{Trans} #S.ShippingWt = #S.BoxAndPkgPprWt + #S.ContentWt write(9,*)"Shipping weight",#S.ShippingWt -{Trans} -{Object.1}ShippingWeight !---------------------------------------- +{Object.3}ItemsInTheOrder--->|Postage +{Branch} {nop.L}Branch={trim(#15.ShipOption) /= "Priority"} -{Branch} +{Trans} !Assumption: Overnight and international orders are single unit orders select case(trim(#15.ShipOption)) case("Overnight") #20.BoxTypeDesc = " Express Mail Pak" case("Global Priority 1","Global Priority 2") #20.BoxTypeDesc = " Global Pri Pak" end select #S.ShippingWt = 0.5 !lbs -{Trans} -{Object.3}ItemsInTheOrder--->|Postage !---------------------------------------- +{Object.4}Postage +{Trans} select case(trim(#15.ShipOption)) case("Priority") &D.ShippingWt = #S.ShippingWt #S.Postage = LookUp({t.D}PriorityRates,&D.ShippingWt,2) case("Overnight") #S.Postage = 12.45 case("Global Priority 1") #S.Postage = 4.50 case("Global Priority 2") #S.Postage = 5.00 end select -{Trans} -{Object.4}Postage !---------------------------------------- +{Object.6}BoxAndPackMatWeight +{Trans} &R.Capacity = {t.D}ItemsVsBoxType(#T.BoxType,1) &S.PkgPprWt = (&R.Capacity - #R.Units) * &S.PakPprWtPerLThanCapItems #S.BoxAndPkgPprWt = {t.D}ItemsVsBoxType(#T.BoxType,3) + &S.PkgPprWt write(9,*)"Box and packaging material weight",#S.BoxAndPkgPprWt -{Trans} -{Object.6}BoxAndPackMatWeight !---------------------------------------- +{Object.8}ContentWeight +{Trans} #S.ContentWt = &S.WeightPerItem * #R.Units write(9,*)"Content Weight",#S.ContentWt -{Trans} -{Object.8}ContentWeight !---------------------------------------- +{Object.10}BoxType +{Trans} &D.Units = #R.Units #T.BoxType = LookUp({t.D}ItemsVsBoxType,&D.Units,2,bigRow = &B.Ind, & logEqual = &L.Eq) IF(.NOT.&L.Eq)#T.BoxType = {t.D}ItemsVsBoxType(&B.Ind+1,2) write(#20.BoxTypeDesc,*)"Box",#T.BoxType -{Trans} -{Object.10}BoxType !---------------------------------------- +{Object.13}ItemsInTheOrder--->|ContentWeight +{Branch} {nop.L}Branch={trim(#15.ShipOption) == "Priority"} -{Branch} -{Object.13}ItemsInTheOrder--->|ContentWeight !---------------------------------------- +{Object.14}ItemsInTheOrder--->|BoxType +{Branch} {nop.L}Branch={trim(#15.ShipOption) == "Priority"} -{Branch} -{Object.14}ItemsInTheOrder--->|BoxType -{Page}Postage //////////////////////////////////////////