V16UEf A42: single-step off@43: file unload all!A 44: quiet off B46: existappt = "n"nՂ9L 47: if entry <> "NEW"Ԇ NEW zBj;48: progress(fgp,bgp," Preparing files ... please wait ",0)ԆԆ Preparing files ... please wait .pG 49: elseZAD.50: screen clear box 1 1 sch scw 0 0 no-borderԆԆA51: repaint offB.)56: Choice() ' CH L.149pB$58: ReturnToMenu() ' RTMp 0lA63: repaint offL 64: if entry == "RWA"Ԇ RWAB8/65: slotnr = getrec ' needed in ReserveAppt()Ԇ Ղ9B9066: ftrname = getftr ' needed in ReserveAppt()ԆՄ9B67: viewdate = getdayԆՄ 9B68: entry = "NEW"NEWՆ 9B 71: z = ""Ղ9B72: jobnr = ""Ն9B73: $datelist = ""Ղ9B74: changeftr = "n"nՂ9L77: while true8B8!78: vloadif(dpath|"ftr_list.vws")Ԇftr_list.vws pBa:79: ftrcode = filelookup([Nickname],[Fitter_Code],ftrname)&[Nickname]&[Fitter_Code]ԄՄ9B6 81: vloadif(dpath|"listappt.vw")Ԇlistappt.vw p@82: order change physical&APF84: smartpeek $_lastkey z ' see if the loop started from 1ՂLG>85: if changeftr == "n" ' = fitters in bpopdb()ԂnB!86: startdate = viewdateԄ Ղ9B5&87: enddate = date2(date(startdate)+1)Ԃz/xՂ9@M189: data find "[Date]" equal startdate options ""# [Date]ԂL 90: if cerrorBwA91: messbox(" Appointments not yet created for this date ",0,0,1) Appointments not yet created for this date ../pK92: return (-2)0(B94: x = precordՄ9@K/96: data find "[Date]" equal enddate options ""# [Date]ԂB97: y = precordՂ9B99: $span = y - xԂԄՂ9A)101: redimension ptary[$span] ԂՕJ102: for i = 1 to $span/ Ԃ ՂKB+103: ptary[i] = x 'str(precord)ԄԂՕ9B104: x = x + 1Ԅ/Մ9^B$107: x = arytostr($span)Ԃp Մ9L 108: if x = 0Ԅ.-B109: $appts = ptstrԄՂ9G 110: else2A0111: message "x is:"&str(x)x is:Ԅ B.114: remove("day_ftrs.idx")day_ftrs.idxpBQ0116: makeidx("appntmnt","day_ftrs.idx",$appts,1)appntmntday_ftrs.idxԂ/p A117: repaint off@;&120: order change index "day_ftrs.idx"&day_ftrs.idx@c;121: data query execute "list_ftr.dfq" index "findappt.idx"list_ftr.dfqfindappt.idxL125: if cerror-A+126: message "Bad query"Bad queryB:1128: x = ReserveAppt() ' 0=ALL appts bkd; -1=Esc;pՄ9L129: if x = -1Ԅ/(|B/130: vunloadif("listappt.vw")listappt.vwpB1131: vunloadif("ftr_list.vws")ftr_list.vwspK132: return (-1)/(5 yprepareapptB140: CurrentLastDay()pB141: existappt = "n"nՂ9L,!142: if entry = "RFA" 'Ԇ RFAkB143: entry = "NEW"NEWՆ 9GJF144: elseif entry = "RWA" ' no redirection necessary as it start Ԇ RWABNE145: x = PrepareAppt() ' specific return with appt date & timepՄ9L146: if x = -2Ԅ0(K147: return (-1)/(G 151: elseNB152: getrec = ""Ն 9B153: getday = ""Ն9B154: getrec = ""Ն 9L157: while true8AE/158: screen clear box 1 1 sch scw 0 0 no-borderԆԆA159: repaint offB8161: y1="BROWSEappointments"BROWSEappointmentsՀ9BL'162: y2="FirstappointmentALLfitters"FirstappointmentALLfittersՀ9BP)163: y3="FirstappointmentSELECTfitter"FirstappointmentSELECTfitterՀ9B:164: y4="WHOLEdayONEfitter"WHOLEdayONEfitterՀ9BL'165: y5="ChangeorDeleteappointments"ChangeorDeleteappointmentsՀ9B`6167: y6=" Appointments created to"&date2(lastdate)|" " Appointments created toԂx  Հ9B4168: $list = y1&y2&y3&y4&y5ԀԀ Ԁ Ԁ Ԁ Հ9BB(170: x = popuplist(8,24,14,$list,y6,1,0)MMMԀԀ/.pՄ9A&171: screen shortrestore dsa Ն L 172: if x = 0Ԅ.L173: if ptstr == y1ԄԀA&174: screen shortrestore dsa Ն A:%175: execute "nav_appt.rf3" in-memorynav_appt.rf3G177: elseif ptstr == y2 ԄԀ7B178: FirstApptAny()pG180: elseif ptstr == y3 ԄԀ:B181: FirstApptChoose()pG183: elseif ptstr == y4 ԄԀGB(#184: ChooseDayAndFitter() ' CDFpG186: elseif ptstr == y5- ԄԀB187: ChangeDeleteAppt()pG 189: elseB190: ReturnToMenu()p  bchoicey1y2y3y4y5y6$listL197: while true8AE/198: screen clear box 1 1 sch scw 0 0 no-borderԆԆA199: repaint offB|F200: x = fentrybox(" Enter Job Nr for Appointment(s) ",6,shopmask,"" Enter Job Nr for Appointment(s) MԆpՄ9L 201: if x = 0Ԅ.5B202: jobnr = ptstrԄՆ9G203: elseif x = -1 Ԅ/( Ar<206: message "!!! Function failed !!! - ALT_APPT/l81"&str(x)1!!! Function failed !!! - ALT_APPT/l81Ԅ E207: continue whileB9"210: vloadif(dpath|"cust_ord.vws")Ԇcust_ord.vws pL211: if cerrorRBP.212: messbox("CUST_ORD file not loaded",0,0,1)CUST_ORD file not loaded../p@1 215: order change key "[Job_Nr]"& [Job_Nr]@N0216: data find "[Job_Nr]" equal jobnr options ""# [Job_Nr]ԆLIF217: if cerror ' if none - then returnKBT0218: x = messbox(" Job Number not found ",0,0,1) Job Number not found ../pՄ9L 219: if x = 0Ԅ.A?/220: screen clear box 17 1 18 scw 0 0 no-borderԆB7!221: vloadif(dpath|"listappt.vw")Ԇlistappt.vw pA222: repaint onA 223: repaintB 224: Titles()pE225: continue whileG 227: elseaB0228: maxslots = [Appt_Slots][Appt_Slots]Ղ9B/229: #slotsrem = [Slots_Rem][Slots_Rem]Ղ 9B6230: custcode = [Customer_Code][Customer_Code]Ղ 9B@$231: deladdr1 = [Delivery_Address_1][Delivery_Address_1]Ղ9B7!232: delpostcode = [Del_Postcode][Del_Postcode]Ղ9B4233: custname = [CustOrd_Name][CustOrd_Name]Ղ9G234: exit whileG236: exit whileB7!240: vloadif(dpath|"findapp1.vw")Ԇfindapp1.vw pB[F248: jobidx = "r_"|jobnr|".idx" ' message "jobidx is:"&str(jobr_Ԇ .idx Ղ9A249: error offL*250: if file(dpath|jobidx) = 1ԆԂ /C@2$251: order change index dpath|jobidx& ԆԂ G 252: elseBe:253: progress(15,12," Creating new index for"&jobnr|" ",0)M3 Creating new index forԆ  .p@1 254: order change key "[Job_Nr]"& [Job_Nr]@Z9255: data query execute "job_reqn.dfq" index dpath|jobidxjob_reqn.dfq ԆԂ L261: if cerrorwBA)262: makeidx("requsn",dpath|jobidx,"0",1)requsnԆԂ 0/p @2$263: order change index dpath|jobidx& ԆԂ L268: if cerrorfB`7269: messbox(" No appointments listed for"&jobnr,0,0,1) No appointments listed forԆ ../p L272: if #slotsrem > 1Ԃ /]BL-273: z = (str(#slotsrem)&"more appointments")Ԃ more appointments Ղ9G 274: elseBF275: z = case #slotsrem(1,"One more appointment")(0,"No more appointme))GԂ */+One more appointment)*.+No more appointments)+,Ղ9A278: repaint onA 279: repaintAvC280: screen print 7 26 bgs fgs (format("Fittings for"&jobnr,"M31"))Ԇ Ԇ Fittings forԆ M31A{E281: screen print 15 26 bgs fgs (format("{E}rase appointment","M31"))Ԇ Ԇ {E}rase appointmentM31A282: repaint offB/(283: ptval=0 ' show navrec() to select.Մ9L284: while true8< B285: ptval = navrecs()p Մ9L3"286: if ptval = {E} or ptval = {e}ԄMEԄMe L-287: if [Job_Nr] == "None"[Job_Nr]NoneD288: continue whileB(290: deljobnr = [Job_Nr][Job_Nr]Ղ9B$291: viewdate = [Date][Date]Մ 9BB.301: [Job_Nr] = "SUNDAY"SUNDAY [job_nr]9B.302: [DelAddr&Code] = "" [deladdr&code]9B/303: [Entered_By] = useridԆ [entered_by]9B1304: [Date_Altered] = todayo [date_altered]9B305: [Time] = now [time]9B"306: [N_name] = "" [n_name]9@307: write-record@G 308: else-@309: lock-record>B*310: [Job_Nr] = "None"None [job_nr]9B.311: [DelAddr&Code] = "" [deladdr&code]9B/312: [Entered_By] = useridԆ [entered_by]9B1313: [Date_Altered] = todayo [date_altered]9B314: [Time] = now [time]9B"315: [N_name] = "" [n_name]9@316: write-record@B9"319: vloadif(dpath|"cust_ord.vws")Ԇcust_ord.vws p@1 320: order change key "[Job_Nr]"& [Job_Nr]@Q3321: data find "[Job_Nr]" equal deljobnr options ""# [Job_Nr]Ԃ@322: lock-record>BfF323: [Slots_Rem] = [Slots_Rem] + 1 'increase slots remaining in CUST_O[Slots_Rem]/ [slots_rem]9@324: write-record@B/325: #slotsrem = [Slots_Rem][Slots_Rem]Ղ 9B7!327: vloadif(dpath|"findapp1.vw")Ԇfindapp1.vw p@1 329: order change key "[Job_Nr]"& [Job_Nr]@c;330: data query execute "findappt.dfq" index "chngappt.idx"findappt.dfqchngappt.idxL-*334: if cerror ' no more apptsXA335: repaint offB9"336: vloadif(dpath|"cust_ord.vws")Ԇcust_ord.vws p@1 337: order change key "[Job_Nr]"& [Job_Nr]@N0338: data find "[Job_Nr]" equal jobnr options ""# [Job_Nr]Ԇ@339: lock-record>BU?340: [Fitting_Date] = blank ' remove Fitting_Date from CUST_ORD [fitting_date]9@341: write-record@BR=344: vloadif(dpath|"REQUSN.vws") ' load requsn fileԆREQUSN.vws pA345: repaint off@1 347: order change key "[Job_Nr]"& [Job_Nr]@<&348: data query execute "delapreq.dfq"delapreq.dfqK'$352: return (0) ' all appts deleted.B7!369: vloadif(dpath|"findapp1.vw")Ԇfindapp1.vw p@;&370: order change index "chngappt.idx"&chngappt.idxA371: repaint onA 372: repaintAvC373: screen print 7 26 bgs fgs (format("Fittings for"&jobnr,"M31"))Ԇ Ԇ Fittings forԆ M31A{E374: screen print 15 26 bgs fgs (format("{E}rase appointment","M31"))Ԇ Ԇ {E}rase appointmentM31A375: repaint offU  changedeleteappty2slotnrAE/381: screen clear box 1 1 sch scw 0 0 no-borderԆԆA382: repaint off@383: data goto window 2$B/384: vunloadif("ord_dets.vw")ord_dets.vwp@385: data goto window 1$B/386: vunloadif("view_app.vw")view_app.vwp@387: window close- (GunloadscreensBXB393: vloadif(dpath|"ftrlist1.vw") ' show list of fittersԆftrlist1.vw p@394: order change physical&B395: bline = recordsՂ9L396: if bline > 12Ԃ3)B397: bline = 22MՂ9G 398: else)B'399: bline = 5 + bline + 51Ԃ1Ղ9AE/402: screen clear box 1 1 sch scw 0 0 no-borderԆԆAn>403: screen print 6 29 bgs fgs (format("Choose Fitter","M24"))Ԇ Ԇ Choose FitterM24AvB404: screen print 7 29 bgs fgs (format("{Enter} to select","M24"))Ԇ Ԇ {Enter} to selectM24AxB405: screen print bline 29 bgs fgs (format("{Esc} to exit","M24"))ԂԆ Ԇ {Esc} to exitM24BF407: bpop_ret = bpopdb("ftrlist1",6,"","[Fitter Name]","l40","[Fitter_ftrlist1M[Fitter Name]l40[Fitter_Code]L0[Fitter_Code]MMMM4/pՂ9AE/408: screen clear box 1 1 sch scw 0 0 no-borderԆԆL409: if bpop_ret = -1Ԃ/( B412: ftrcode = ptstrԄՄ9B+413: ftrname = [Nickname][Nickname]Մ9L416: while TRUE8Bo?417: x = fentrybox(" Enter Date to View ",8,"##\/##\/##",today) Enter Date to View M##\/##\/##opՄ9L 418: if x = 0Ԅ.B419: viewdate = ptstrԄՄ 9L, 420: if chkdate(viewdate,1) = -1Ԅ /p/(pBV1421: messbox(" Incorrect date - re-enter ",0,0,1) Incorrect date - re-enter ../pE422: continue whilehL5%425: if dayname(viewdate) == "Sunday"Ԅ uSunday<L426: if relperf() = 0p .B427: $perf = ptvalԄՂ 9BF429: x=scrollbox(fge,bge," Are you really going to send"&ftrname&"to wԆԆ Are you really going to sendԄ to work on Sunday? Ԃ p Մ9L430: if x <> 0Ԅ. HAF&431: message "scrollbox error:"&str(x)scrollbox error:Ԅ AE/433: screen clear box 1 1 sch scw 0 0 no-borderԆԆBlF435: messbox(" View"&dayname(viewdate)&date3(viewdate)|"? (y/n) ",1,0, ViewԄ u Ԅ y ? (y/n) /./pL436: if ptstr == "y"ԄyG437: exit while1E439: continue whileG442: exit whileB445: PrepareAppt()p  )+choosedayandfitterBXB453: vloadif(dpath|"ftrlist1.vw") ' show list of fittersԆftrlist1.vw p@454: order change physical&@oF455: order sort now dictionary "ftrname.idx" fields "[Fitter Name]" asftrname.idx[Fitter Name]B456: bline = recordsՂ9L457: if bline > 12Ԃ3)B458: bline = 22MՂ9G 459: else)B'460: bline = 5 + bline + 51Ԃ1Ղ9AE/463: screen clear box 1 1 sch scw 0 0 no-borderԆԆA464: repaint offAn>465: screen print 6 29 bgs fgs (format("Choose Fitter","M24"))Ԇ Ԇ Choose FitterM24AvB466: screen print 7 29 bgs fgs (format("{Enter} to select","M24"))Ԇ Ԇ {Enter} to selectM24AxB467: screen print bline 29 bgs fgs (format("{Esc} to exit","M24"))ԂԆ Ԇ {Esc} to exitM24BF469: bpop_ret = bpopdb("ftrlist1",6,"","[Fitter Name]","l40","[Fitter_ftrlist1M[Fitter Name]l40[Fitter_Code]L0[Fitter_Code]MMMM4/pՂ9A&470: screen shortrestore dsa Ն A471: repaint offL472: if bpop_ret = -1Ԃ/(KAE/473: screen clear box 1 1 sch scw 0 0 no-borderԆԆ B477: ftrcode = ptstrԄՄ9B+478: ftrname = [Nickname][Nickname]Մ9B7!480: vloadif(dpath|"findappt.vw")Ԇfindappt.vw p@484: order change physical&@7#485: order change key "[Date_Code]"&[Date_Code]@c;487: data query execute "firstftg.dfq" index "#frstftg.idx"firstftg.dfq#frstftg.idxL491: if cerrorvBp>492: Messbox(" No appointments found in current diary ",0,0,1) No appointments found in current diary ../p B,501: remove("findftr.idx")findftr.idxp@a:502: data query execute "list_ftr.dfq" index "findftr.idx"list_ftr.dfqfindftr.idxL506: while true8AE/507: screen clear box 1 1 sch scw 0 0 no-borderԆԆA508: repaint off@lE509: order sort execute dictionary "firstftg.dfs" index "sortftg.idx"firstftg.dfssortftg.idxAF510: screen print 6 20 bgs fgs (format("Vacant First Appointments","M4Ԇ Ԇ %Vacant First AppointmentsM41AF511: screen print 7 20 bgs fgs (format("Press {Enter} to view whole daԆ Ԇ +Press {Enter} to view whole dayM41A{E512: screen print 19 20 bgs fgs (format("Press {Esc} to exit","M41"))Ԇ Ԇ Press {Esc} to exitM41BF513: bpop_ret = bpopdb("findappt",6,"","[Date_Name]","L40","[Fitter_NafindapptM[Date_Name]L40[Fitter_Name]L25[Date_Code]MMMM<.pՂ9A&514: screen shortrestore dsa Ն L516: if bpop_ret = -1Ԃ/( B519: datecode = ptstrԄՄ9B,520: ftrname = [Nickname][Nickname]Մ9B-522: viewdate = date2([Date])[Date]xՄ 9A523: repaint offB525: PrepareAppt()p  ?2 firstapptchooseB7!531: vloadif(dpath|"findappt.vw")Ԇfindappt.vw p@537: order change physical&@7#538: order change key "[Date_Code]"&[Date_Code]@c;540: data query execute "firstftg.dfq" index "#frstftg.idx"firstftg.dfq#frstftg.idxL544: if cerrorvBp>545: Messbox(" No appointments found in current diary ",0,0,1) No appointments found in current diary ../p L549: while true8@lE550: order sort execute dictionary "firstftg.dfs" index "sortftg.idx"firstftg.dfssortftg.idxAF551: screen print 6 20 bgs fgs (format("Vacant First Appointments","M4Ԇ Ԇ %Vacant First AppointmentsM41AF552: screen print 7 20 bgs fgs (format("Press {Enter} to view whole daԆ Ԇ +Press {Enter} to view whole dayM41A{E553: screen print 19 20 bgs fgs (format("Press {Esc} to exit","M41"))Ԇ Ԇ Press {Esc} to exitM41BF554: bpop_ret = bpopdb("findappt",6,"","[Date_Name]","L40","[Fitter_NafindapptM[Date_Name]L40[Fitter_Name]L25[Date_Code]MMMM<.pՂ9A&555: screen shortrestore dsa Ն L556: if bpop_ret = -1Ԃ/( B559: datecode = ptstrԄՄ9B,560: ftrname = [Nickname][Nickname]Մ9B-561: viewdate = date2([Date])[Date]xՄ 9A562: repaint offB564: PrepareAppt()p  a=?firstapptanyAE/570: screen clear box 1 1 sch scw 0 0 no-borderԆԆ@571: file unload all! BdGreturntomenuA576: repaint offB577: apptcmmt = ""Ղ9B578: apptstatus = ""Մ9B579: jobnr = ""Ն9B580: requsnnr = ""Մ9B581: ftrcode = ""Մ9B5 583: vloadif(dpath|"REQUSN.vws")ԆREQUSN.vws pL584: if cerrorNBL,585: messbox("REQUSN file not loaded",0,0,1)REQUSN file not loaded../pB7!588: vloadif(dpath|"findappt.vw")Ԇfindappt.vw pL589: if cerrorRBP.590: messbox("FINDAPPT file not loaded",0,0,1)FINDAPPT file not loaded../pB9"593: vloadif(dpath|"FTR_LIST.vws")ԆFTR_LIST.vws pL594: if cerrorRBP.595: messbox("FITTER's file not loaded",0,0,1)FITTER's file not loaded../pB9"598: vloadif(dpath|"CUST_ORD.vws")ԆCUST_ORD.vws pL599: if cerrorRBP.600: messbox("CUST_ORD file not loaded",0,0,1)CUST_ORD file not loaded../pB7!603: vloadif(dpath|"viewdate.vw")Ԇviewdate.vw pL604: if cerrorRBP.605: messbox("VIEWDATE view not loaded",0,0,1)VIEWDATE view not loaded../p BCRloadfilesJɦ: for i = 1 to (value(slotnr)-1)/ Ԃ/ Ղ"@615: data goto record next$8A617: repaint offB618: daysshown = 20MՀ9B619: lastact = ""Հ9L620: while true8>A621: repaint onA 622: repaintB 623: Titles()pB 624: ptval=0.Մ9L"625: while ptval <> {Esc}ԄM %>B626: ptval = navrecs()p Մ9L@/627: if ptval = {B} or ptval = {b} ' {R} @ 747ԄMBԄMbA?/628: screen clear box 17 1 18 scw 0 0 no-borderԆB629: lastact = "b"bՀ9LF630: if [Job_Nr] ! "None" or [Job_Nr] ! "SUNDAY" or [Job_Nr] ! "BNKHOL[Job_Nr]None[Job_Nr]SUNDAY[Job_Nr]BNKHOLA631: repaint offBF632: x = entryline(" Enter Job Nr for Appointment(s) ",6,shopmask, Enter Job Nr for Appointment(s) MԆMMM)pՄ9L 633: if x = 0Ԅ.5B634: jobnr = ptstrԄՆ9G635: elseif x = -1 Ԅ/(E636: continue whileAr<638: message "!!! Function failed !!! - ALT_APPT/l81"&str(x)1!!! Function failed !!! - ALT_APPT/l81Ԅ E639: continue whileB9"641: vloadif(dpath|"cust_ord.vws")Ԇcust_ord.vws pL642: if cerrorRBP.643: messbox("CUST_ORD file not loaded",0,0,1)CUST_ORD file not loaded../p@1 645: order change key "[Job_Nr]"& [Job_Nr]@N0646: data find "[Job_Nr]" equal jobnr options ""# [Job_Nr]ԆLIF647: if cerror ' if none - then returnWB`6648: x = messbox(" Job Number not yet entered ",0,0,1) Job Number not yet entered ../pՄ9L 649: if x = 0Ԅ.A?/650: screen clear box 17 1 18 scw 0 0 no-borderԆB7!651: vloadif(dpath|"listappt.vw")Ԇlistappt.vw pA652: repaint onA 653: repaintB 654: Titles()pE655: continue whileG 657: elseB5658: $instruct = [Instructions][Instructions]Ղ9B0659: maxslots = [Appt_Slots][Appt_Slots]Ղ9B/660: #slotsrem = [Slots_Rem][Slots_Rem]Ղ 9B5661: reqd_date = [Fitting_Date][Fitting_Date]Ղ 9B6662: custcode = [Customer_Code][Customer_Code]Ղ 9B@$663: deladdr1 = [Delivery_Address_1][Delivery_Address_1]Ղ9B7!664: delpostcode = [Del_Postcode][Del_Postcode]Ղ9B4665: custname = [CustOrd_Name][CustOrd_Name]Ղ9L668: if #slotsrem > 1Ԃ /mBL-669: z = (str(#slotsrem)&"more appointments")Ԃ more appointments Ղ9G670: elseif #slotsrem = 1- Ԃ /B;671: z = "One more appointment"One more appointmentՂ9GJF672: elseif #slotsrem = 0 ' check that all appt slots for job have bee Ԃ .Br@673: messbox(" No more appointments needed for"&jobnr|" ",0,0,1) No more appointments needed forԆ  ../pK674: return (0).B7!677: vloadif(dpath|"listappt.vw")Ԇlistappt.vw pB 678: Titles()pAF679: screen print 17 5 bgs fgs (format(left(z&"needed for"&jobnr&"@"&dԆ Ԇ .Ԃneeded for Ԇ @ Ԃ Ԃ MFM70A[?680: screen print 18 5 15 12 (format(left($instruct,70),"M70"))ԂMFM70BO?682: apptnr = [Job_Nr] 'check that APPNTMNT record is available[Job_Nr]Ղ 9LgA683: if apptnr ! "None" or apptnr ! "SUNDAY" or apptnr ! "BNKHOL"Ԃ NoneԂ SUNDAYԂ BNKHOL$@684: lock-record>B&685: [Job_Nr] = jobnrԆ [job_nr]9BZ7686: [DelAddr&Code] = left(deladdr1|","&delpostcode,30)Ԃ, Ԃ M [deladdr&code]9B/687: [Entered_By] = useridԆ [entered_by]9B1688: [Date_Altered] = todayo [date_altered]9B689: [Time] = now [time]9B(690: [N_name] = ftrnameԄ [n_name]9@691: write-record@B692: #rec = recordՂ9B693: #nextrec = recordՂ9A697: repaint offB9"698: vloadif(dpath|"cust_ord.vws")Ԇcust_ord.vws p@/-699: lock-record ' update CUST_ORD record>BB"700: [Slots_Rem] = [Slots_Rem] - 1[Slots_Rem]/ [slots_rem]9@701: write-record@B/702: #slotsrem = [Slots_Rem][Slots_Rem]Ղ 9BN8704: vloadif(dpath|"listappt.vw") ' return to LISTAPPTԆlistappt.vw pA705: repaint onA 706: repaintG 707: else=A708: repaint onA 709: repaintE710: continue whileL713: if #slotsrem > 1Ԃ /mBL-714: z = (str(#slotsrem)&"more appointments")Ԃ more appointments Ղ9G715: elseif #slotsrem = 1 Ԃ /B;716: z = "One more appointment"One more appointmentՂ9GJF717: elseif #slotsrem = 0 ' check that all appt slots for job have beee Ԃ .XL718: while true8'A?/719: screen clear box 17 1 18 scw 0 0 no-borderԆB 720: Titles()pBF721: messline(" Confirm"&date2(viewdate)&"as Fitting Date? (y/n)",1,1, ConfirmԄ x as Fitting Date? (y/n) ///MMM(pA722: repaint offL723: if ptstr == "y"Ԅy(B9"724: vloadif(dpath|"cust_ord.vws")Ԇcust_ord.vws p@1 725: order change key "[Job_Nr]"& [Job_Nr]@N0726: data find "[Job_Nr]" equal jobnr options ""# [Job_Nr]Ԇ@727: lock-record>B>%728: [Fitting_Date] = date2(viewdate)Ԅ x [fitting_date]9@729: write-record@BR=732: vloadif(dpath|"REQUSN.vws") ' load requsn fileԆREQUSN.vws p@1 734: order change key "[Job_Nr]"& [Job_Nr]@<&735: data query execute "chngdate.dfq"chngdate.dfqK84739: return (-1) ' Esc was pressed/(BF741: messbox(" Fitting Date must be same as Appts - erase bookings and Fitting Date must be same as Appts - erase bookings and re-book? (y/n) ///pL742: if ptstr == "y"ԄyG743: exit whileE745: continue while<@E749: continue while?B 751: Titles()pAF752: screen print 17 5 bgs fgs (format(z&"needed for"&jobnr&"@"&deladdԆ Ԇ *Ԃneeded for Ԇ @ Ԃ Ԃ M70A[?753: screen print 18 5 15 12 (format(left($instruct,70),"M70"))ԂMFM70G 754: elseE755: continue while`G*&758: elseif ptval = {R} or ptval = {r}( ԄMRԄMrL759: if lastact = "b"ԀbL-760: if [Job_Nr] == "None"[Job_Nr]NoneE761: continue while@764: data goto record next$LF765: if [Job_Nr] ! "None" or [Job_Nr] ! "SUNDAY" or [Job_Nr] ! "BNKHOL[Job_Nr]None[Job_Nr]SUNDAY[Job_Nr]BNKHOL A766: repaint offL767: if #slotsrem > 1Ԃ /mBL-768: z = (str(#slotsrem)&"more appointments")Ԃ more appointments Ղ9G769: elseif #slotsrem = 1- Ԃ /B;770: z = "One more appointment"One more appointmentՂ9GJF771: elseif #slotsrem = 0 ' check that all appt slots for job have bee Ԃ .Br@772: messbox(" No more appointments needed for"&jobnr|" ",0,0,1) No more appointments needed forԆ  ../pK773: return (0).B7!776: vloadif(dpath|"listappt.vw")Ԇlistappt.vw pB 777: Titles()pAF778: screen print 17 5 bgs fgs (format(left(z&"needed for"&jobnr&"@"&dԆ Ԇ .Ԃneeded for Ԇ @ Ԃ Ԃ MFM70A[?779: screen print 18 5 15 12 (format(left($instruct,70),"M70"))ԂMFM70B&781: apptnr = [Job_Nr][Job_Nr]Ղ 9LgA783: if apptnr ! "None" or apptnr ! "SUNDAY" or apptnr ! "BNKHOL"Ԃ NoneԂ SUNDAYԂ BNKHOL%@784: lock-record>B&785: [Job_Nr] = jobnrԆ [job_nr]9BZ7786: [DelAddr&Code] = left(deladdr1|","&delpostcode,30)Ԃ, Ԃ M [deladdr&code]9B/787: [Entered_By] = useridԆ [entered_by]9B1788: [Date_Altered] = todayo [date_altered]9B789: [Time] = now [time]9B(790: [N_name] = ftrnameԄ [n_name]9@791: write-record@B792: #rec = recordՂ9B793: #nextrec = recordՂ9A796: repaint offBU>797: vloadif(dpath|"cust_ord.vws") ' update CUST_ORD recordԆcust_ord.vws p@798: lock-record>BB"799: [Slots_Rem] = [Slots_Rem] - 1[Slots_Rem]/ [slots_rem]9@800: write-record@B/801: #slotsrem = [Slots_Rem][Slots_Rem]Ղ 9BP:803: vloadif(dpath|"listappt.vw") ' return to LISTAPPTԆlistappt.vw pA804: repaint onA 805: repaintG 806: else=A807: repaint onA 808: repaintE809: continue whileL812: if #slotsrem > 1Ԃ /mBL-813: z = (str(#slotsrem)&"more appointments")Ԃ more appointments Ղ9G814: elseif #slotsrem = 1 Ԃ /B;815: z = "One more appointment"One more appointmentՂ9GJF816: elseif #slotsrem = 0 ' check that all appt slots for job have beee Ԃ .XL817: while true8'A?/818: screen clear box 17 1 18 scw 0 0 no-borderԆB 819: Titles()pBF820: messline(" Confirm"&date2(viewdate)&"as Fitting Date? (y/n)",1,1, ConfirmԄ x as Fitting Date? (y/n) ///MMM(pA821: repaint offL822: if ptstr == "y"Ԅy(B9"823: vloadif(dpath|"cust_ord.vws")Ԇcust_ord.vws p@1 824: order change key "[Job_Nr]"& [Job_Nr]@N0825: data find "[Job_Nr]" equal jobnr options ""# [Job_Nr]Ԇ@826: lock-record>B>%827: [Fitting_Date] = date2(viewdate)Ԅ x [fitting_date]9@828: write-record@BR=831: vloadif(dpath|"REQUSN.vws") ' load requsn fileԆREQUSN.vws p@1 833: order change key "[Job_Nr]"& [Job_Nr]@<&834: data query execute "chngdate.dfq"chngdate.dfqK84838: return (-1) ' Esc was pressed/(BF840: messbox(" Fitting Date must be same as Appts - erase bookings and Fitting Date must be same as Appts - erase bookings and re-book? (y/n) ///pL841: if ptstr == "y"ԄyG842: exit whileE844: continue while<@E848: continue whileG#B 850: Titles()pAF851: screen print 17 5 bgs fgs (format(z&"needed for"&jobnr&"@"&deladdԆ Ԇ *Ԃneeded for Ԇ @ Ԃ Ԃ M70A[?852: screen print 18 5 15 12 (format(left($instruct,70),"M70"))ԂMFM70G 853: elseE854: continue whileh$G857: elseif lastact = "e" Ԁe@858: data goto record next$L-859: if [Job_Nr] == "None"[Job_Nr]NoneE860: continue while%B(862: deljobnr = [Job_Nr][Job_Nr]Ղ9B~F863: messbox(" Delete appointment for"&deljobnr&"on"&viewdate|"? (y/n) Delete appointment forԂ on Ԅ ? (y/n) /./pL864: if ptstr == "n"ԄnE865: continue while%L8#867: if dayname([Date]) == "SUNDAY"[Date]uSUNDAY@@868: lock-record>B.869: [Job_Nr] = "SUNDAY"SUNDAY [job_nr]9B.870: [DelAddr&Code] = "" [deladdr&code]9B/871: [Entered_By] = useridԆ [entered_by]9B1872: [Date_Altered] = todayo [date_altered]9B873: [Time] = now [time]9B"874: [N_name] = "" [n_name]9@875: write-record@G 876: else-@877: lock-record>B*878: [Job_Nr] = "None"None [job_nr]9B.879: [DelAddr&Code] = "" [deladdr&code]9B/880: [Entered_By] = useridԆ [entered_by]9B1881: [Date_Altered] = todayo [date_altered]9B882: [Time] = now [time]9B"883: [N_name] = "" [n_name]9@884: write-record@A897: repaint offB9"898: vloadif(dpath|"cust_ord.vws")Ԇcust_ord.vws p@1 899: order change key "[Job_Nr]"& [Job_Nr]@Q3900: data find "[Job_Nr]" equal deljobnr options ""# [Job_Nr]Ԃ@901: lock-record>B_?902: [Slots_Rem] = [Slots_Rem] + 1 'increase slots in CUST_ORD[Slots_Rem]/ [slots_rem]9@903: write-record@B0904: maxslots = [Appt_Slots][Appt_Slots]Ղ9B/905: #slotsrem = [Slots_Rem][Slots_Rem]Ղ 9B@$906: deladdr1 = [Delivery_Address_1][Delivery_Address_1]Ղ9B7!907: delpostcode = [Del_Postcode][Del_Postcode]Ղ9B5908: $instruct = [Instructions][Instructions]Ղ9B7!910: vloadif(dpath|"listappt.vw")Ԇlistappt.vw pL911: if #slotsrem > 1Ԃ /]BL-912: z = (str(#slotsrem)&"more appointments")Ԃ more appointments Ղ9G 913: elseBF914: z = case #slotsrem(1,"One more appointment")(0,"No more appointme))GԂ */+One more appointment)*.+No more appointments)+,Ղ9A917: repaint onA 918: repaintB 919: Titles()pAF920: screen print 17 5 bgs fgs (format(z&"needed for"&jobnr&"@"&deladdԆ Ԇ *Ԃneeded for Ԇ @ Ԃ Ԃ M70A[?921: screen print 18 5 15 12 (format(left($instruct,70),"M70"))ԂMFM70G*&924: elseif ptval = {E} or ptval = {e} ԄMEԄMe B925: lastact = "e"eՀ9LYF926: if [Job_Nr] == "None" 'check that APPNTMNT record is available[Job_Nr]NoneE927: continue whileQ.B(930: deljobnr = [Job_Nr][Job_Nr]Ղ9B~F931: messbox(" Delete appointment for"&deljobnr&"on"&viewdate|"? (y/n) Delete appointment forԂ on Ԅ ? (y/n) /./pL90932: if ptstr == "n" ' confirm deletion?ԄnE933: continue whileS/L8#935: if dayname([Date]) == "SUNDAY"[Date]uSUNDAY@@936: lock-record>B.937: [Job_Nr] = "SUNDAY"SUNDAY [job_nr]9B.938: [DelAddr&Code] = "" [deladdr&code]9B/939: [Entered_By] = useridԆ [entered_by]9B1940: [Date_Altered] = todayo [date_altered]9B941: [Time] = now [time]9B"942: [N_name] = "" [n_name]9@943: write-record@G 944: else-@945: lock-record>B*946: [Job_Nr] = "None"None [job_nr]9B.947: [DelAddr&Code] = "" [deladdr&code]9B/948: [Entered_By] = useridԆ [entered_by]9B1949: [Date_Altered] = todayo [date_altered]9B950: [Time] = now [time]9B"951: [N_name] = "" [n_name]9@952: write-record@A965: repaint offB9"966: vloadif(dpath|"cust_ord.vws")Ԇcust_ord.vws p@1 967: order change key "[Job_Nr]"& [Job_Nr]@Q3968: data find "[Job_Nr]" equal deljobnr options ""# [Job_Nr]Ԃ@969: lock-record>BB"970: [Slots_Rem] = [Slots_Rem] + 1[Slots_Rem]/ [slots_rem]9@971: write-record@B0972: maxslots = [Appt_Slots][Appt_Slots]Ղ9B/973: #slotsrem = [Slots_Rem][Slots_Rem]Ղ 9B@$974: deladdr1 = [Delivery_Address_1][Delivery_Address_1]Ղ9B7!975: delpostcode = [Del_Postcode][Del_Postcode]Ղ9B5976: $instruct = [Instructions][Instructions]Ղ9B7!978: vloadif(dpath|"listappt.vw")Ԇlistappt.vw pA980: repaint offLOF982: if #slotsrem = maxslots ' remove Fitting_Date from CUST_ORD & REQԂ ԂpA?/983: screen clear box 17 1 18 scw 0 0 no-borderԆB9"984: vloadif(dpath|"cust_ord.vws")Ԇcust_ord.vws p@1 985: order change key "[Job_Nr]"& [Job_Nr]@N0986: data find "[Job_Nr]" equal jobnr options ""# [Job_Nr]Ԇ@987: lock-record>BS=988: [Fitting_Date] = "" ' remove Fitting_Date from CUST_ORD [fitting_date]9@989: write-record@BR=992: vloadif(dpath|"REQUSN.vws") ' load requsn fileԆREQUSN.vws pA993: repaint off@1 995: order change key "[Job_Nr]"& [Job_Nr]@<&996: data query execute "delapreq.dfq"delapreq.dfqK1000: return (-1)/(L!1001: elseif #slotsrem > 1Ԃ /oBM.1002: z = (str(#slotsrem)&"more appointments")Ԃ more appointments Ղ9G1003: elseif #slotsrem = 1d Ԃ /WB< 1004: z = "One more appointment"One more appointmentՂ9E1005: continue whilef8A1008: repaint onA 1009: repaintB1010: Titles()pAF1011: screen print 17 5 bgs fgs (format(z&"needed for"&jobnr&"@"&deladԆ Ԇ *Ԃneeded for Ԇ @ Ԃ Ԃ M70A\@1012: screen print 18 5 15 12 (format(left($instruct,70),"M70"))ԂMFM70G+'1014: elseif ptval = {F} or ptval = {f} ԄMFԄMfA1015: repaint offB1016: changeftr = "y"yՂ9B8"1017: vloadif(dpath|"ftrlist1.vw")Ԇftrlist1.vw pBF1018: bpop_ret = bpopdb("ftrlist1",6,"","[Fitter Name]","L17","[Fitterftrlist1M[Fitter Name]L17[Fitter_Code]L0[Fitter_Code]MM=MMP.pՂ9L1019: if bpop_ret = -1Ԃ/(SB8"1020: vloadif(dpath|"listappt.vw")Ԇlistappt.vw pE1021: continue whileZ;B1023: ftrcode = ptstrԄՄ9B,1024: ftrname = [Nickname][Nickname]Մ9A1025: repaint off L6'1027: elseif ptval = {D} or ptval = {d}ԄMDԄ4KA1029: repaint offB:#1030: vloadif(dpath|"minidate.vws")Ԇminidate.vws p@_=1031: data find "[Ftg_Date]" equal date2(viewdate) options ""#[Ftg_Date]Ԅ xBF1032: x = bpopdb("minidate",8,"","[Ftg_date]","D2","[Ftg_Date]","L0","minidateM[Ftg_date]D2[Ftg_Date]L0[Ftg_Date]MM MM.pՄ9L1033: if x = 0Ԅ.CB(1034: viewdate = date2(ptstr)ԄxՄ 9G1035: elseif x = -1 Ԅ/(SB8"1036: vloadif(dpath|"listappt.vw")Ԇlistappt.vw pE1037: continue while >A!1039: message str(x)ԄA1041: repaint off N>K1045: return (-1)/(> .G?reserveappt slotsavail daysshownlastactAF01051: screen clear box 1 1 sch scw 0 0 no-borderԆԆA1052: repaint offBC-1053: vloadif(dpath|"creatapp.vw") 'Ԇcreatapp.vw pL1054: if precords = 0.mB[41055: messbox(" No appointments yet created ",0,0,1) No appointments yet created ../pG 1056: elsev@1057: data goto record last$BTF1058: lastdate = [Date] ' find latest date in exis[Date]Ղ9 ]currentlastdayAyF1063: screen print 6 20 bgs fgs (format("Fittings for"&ftrname,"M41"))Ԇ Ԇ Fittings forԄ M41A{F1064: screen print 7 20 bgs fgs (format("On"&dayname(viewdate)|","&datԆ Ԇ OnԄ u , Ԅ y M41AF1065: screen print 15 20 bgs fgs (format("{B}ook / {R}epeat / {E}rase Ԇ Ԇ 4{B}ook / {R}epeat / {E}rase appointmentsM41AF1066: screen print 16 20 bgs fgs (format("Change {F}itter or {D}ate - Ԇ Ԇ 3Change {F}itter or {D}ate - {Esc} exitsM41 !titlesmessboxfentryboxvloadifvunloadifprogressbpopdbchkdatenavrecsscrollboxrelperfmakeidxarytostrpopuplistaddidxrecremoveentrylinemesslineapptcmmtdeljobnr existapptslotnrbpop_ret#recblinez #slotsrem$perfapptnr reqd_datecustcodedeladdr1custname delpostcodey$appts$spani startdateenddatelastdate $instruct $datelist changeftr#nextrecmaxslotsjobidxftrcode apptstatusftrnamexptstrptvaldatecoderequsnnrviewdateptarydpathcpathschscwshopmaskfgpbgpscrentryfgsbgsgetrecdsauseridfgebgegetdaygetftrjobnr*D`{ȋ3OkNG#C(#2%?="B) ۊ!