| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773 |
- Listing:
- 1 IMPLEMENTATION MODULE PriceTable;
- 2 (*
- 3 * ModBase
- 4 * Release 3.0
- 5 * (c) Copyright 1986 - 1991 PMI
- 6 * P.O. Box 8402
- 7 * Green Bay Wi 53308
- 8 * All Rights Reserved
- 9 * by Ed Ross
- 10 *)
- 11
- 12 FROM NumTypes IMPORT Real8;
- 13 FROM Numbers IMPORT Max;
- 14 FROM Hash IMPORT HashTable,Define,Dispose,Insert,GetData,KeyFind;
- 15 FROM StrConv IMPORT RealToStr,CardinalToStr;
- 16 FROM ScrnUtl1 IMPORT GetFieldImageRec;
- 17 FROM Tables IMPORT Table,CellValue,GetCell,PutCell,BuildTable,
- 18 DefineTextCol,DefineIntegerCol,DefineRealCol,DefineTable,ControlTable,
- 19 DeleteTable,ShowTable,NumberOfRows;
- 20 FROM GenLists IMPORT GenList,ListLength,GetElmtAdr,BlockToList,
- 21 GetElmt, ListInsertAdr,NewList,DisposeList,ListInsert,ShellSortList;
- 22 FROM StringIO IMPORT ErrorMessage,NoError,WriteEol,WriteStr,outp;
- 23 FROM PosUtils IMPORT Equal,Present,Pos;
- 24 FROM Prompts IMPORT PromptStr,PromptYN;
- 25 FROM M2Strings IMPORT Length,CompareStr,Assign;
- 26 FROM StrEdit IMPORT CAPstr,CrunchBlanks,Append,SetLength,AssignStr,LowerStr,
- 27 DeleteRightJustified,CAPstr;
- ***** ^ duplicate identifier
- 28 FROM ControlUtils IMPORT AddMenuItem,ChangeField,ReadInput,Control;
- 29 FROM FramePainter IMPORT ShowDisplayFrame;
- 30 FROM InputManager IMPORT ControlFrame;
- 31 FROM ScrnTypes IMPORT InitDisplayFrame,DisplayFrame,AFrameName,ImageElement;
- 32 FROM ScrnUtl2 IMPORT CloseDisplayFrame;
- 33 FROM LowLevel IMPORT Fill;
- 34 FROM SYSTEM IMPORT TSIZE,ADR,ADDRESS;
- 35 IMPORT VWindows;
- 36 FROM VStorage IMPORT DosAlloc,DosDealloc;
- 37 IMPORT InitCompilerMods;
- 38 FROM HandleIO IMPORT FileExists, OpenFile,CreateFile,CloseHandle,
- 39 BlockRead,BlockWrite;
- 40
- 41 TYPE
- 42 PriceTblItem = RECORD
- 43 Quantity : ARRAY[1..4] OF CARDINAL;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 44 Price : ARRAY[1 ..4] OF Real8;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 45 Desc : ARRAY[0..30] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 46 END;
- ***** ^ not supported yet
- 47
- 48
- 49
- 50 VAR
- 51 DF : DisplayFrame;
- 52 Tab : Table;
- 53 Initialized : BOOLEAN;
- 54 SerList : GenList;
- 55 FileName : ARRAY[0..20] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 56 Card : CARDINAL;
- 57 EM : ErrorMessage;
- 58 Code,J : CARDINAL;
- 59 Bool : BOOLEAN;
- 60 PriceTbl : POINTER TO ARRAY[0..26] OF PriceTblItem;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 61
- 62 GroupCnt : POINTER TO ARRAY[1..20] OF CARDINAL;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 63 NxtGrp : CARDINAL; (* next assigned index into array *)
- 64 GrpTab : HashTable;
- 65
- 66 (* pricing is done on a sliding scale depending on the number of items
- 67 purchased. The item count is summed on the group level not the
- 68 SKU level at the inventory level *)
- 69
- 70
- 71
- 72 PROCEDURE ClearGrpCnt();
- 73 (* this procedure will clear out the group count table for a
- 74 recompute *)
- 75 BEGIN
- 76 Fill(GroupCnt,SIZE(GroupCnt^),0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 77
- 78 END ClearGrpCnt;
- ***** ^ not supported yet
- 79
- 80 PROCEDURE GrpTotal(Grp : ARRAY OF CHAR) : CARDINAL;
- ***** ^ not supported yet
- 81 VAR
- 82 Index : CARDINAL;
- 83 BEGIN
- 84 IF KeyFind(GrpTab,Grp)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 85 THEN
- 86 GetData(GrpTab,Index);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 87 RETURN GroupCnt^[Index];
- ***** ^ not supported yet
- ***** ^ not supported yet
- 88 ELSE
- 89 RETURN 0;
- 90 END;
- 91
- 92 END GrpTotal;
- ***** ^ not supported yet
- 93
- 94 PROCEDURE AddGrp(Grp : ARRAY OF CHAR; AddAmt : CARDINAL);
- ***** ^ not supported yet
- 95 VAR Index : CARDINAL;
- 96 BEGIN
- 97
- 98 IF KeyFind(GrpTab,Grp)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 99 THEN
- 100 GetData(GrpTab,Index);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 101 GroupCnt^[Index] := GroupCnt^[Index] + AddAmt;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 102 ELSE
- 103 Insert(GrpTab,Grp,NxtGrp);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 104 GroupCnt^[NxtGrp] := AddAmt;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 105 INC(NxtGrp);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 106 END;
- 107
- 108 END AddGrp;
- ***** ^ not supported yet
- 109
- 110 PROCEDURE InitGrp();
- 111 BEGIN
- 112 NxtGrp := 1;
- 113 Define(GrpTab,100,2);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 114 DosAlloc(GroupCnt,SIZE(GroupCnt^));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 115 ClearGrpCnt();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 116 END InitGrp;
- ***** ^ not supported yet
- 117
- 118 (* Table should look like this
- 119 1234567890123456789012345678901234567890123456789012345678901234567890123456
- 120 1 2 3 4 5 6 7
- 121 Nbr Min 1 Price 1 Min 2 Price 2 Min 3 Price 3 Min 4 Price 4 Desc
- 122 xx xxxxx xxxx.xx xxxxx xxxx.xx xxxxx xxxx.xx xxxxx xxxx.xx xxxxxxxxxxxxxxxxxxxxxx
- 123 *)
- 124
- 125
- 126 PROCEDURE SetupTable();
- 127 BEGIN
- 128
- 129 DefineTable(Tab,'Price Table');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 130 DefineTextCol(Tab,3,2,'Nbr',TRUE);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 131
- 132 DefineIntegerCol(Tab,7,6,'Min 1',0,9999);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 133 DefineRealCol(Tab,14,8,'Price 1',0.0,9999.99);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 134
- 135 DefineIntegerCol(Tab,23,6,'Min 2',0,99999);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 136 DefineRealCol(Tab,30,8,'Price 2',0.0,9999.99);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 137
- 138 DefineIntegerCol(Tab,39,6,'Min 3',0,99999);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 139 DefineRealCol(Tab,46,8,'Price 3',0.0,9999.99);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 140
- 141 DefineIntegerCol(Tab,55,6,'Min 4',0,99999);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 142 DefineRealCol(Tab,62,8,'Price 4',0.0,9999.99);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 143
- 144
- 145 DefineTextCol(Tab,71,20,'Desc',FALSE);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 146
- 147 END SetupTable;
- ***** ^ not supported yet
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155 PROCEDURE GetPriceTbl();
- 156
- 157 (* return a list of all products *)
- 158 VAR
- 159 H : CARDINAL;
- 160 EM : ErrorMessage;
- 161 Size : CARDINAL;
- 162 J : CARDINAL;
- 163 BEGIN
- 164
- 165 J := SIZE(PriceTbl^);
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 166 DosAlloc(PriceTbl,SIZE(PriceTbl^));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 167 IF FileExists('Price.tbl')
- ***** ^ not supported yet
- ***** ^ not supported yet
- 168 THEN
- 169 EM := OpenFile(H,'Price.Tbl');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 170 EM := BlockRead(H,PriceTbl,SIZE(PriceTbl^));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 171 EM := CloseHandle(H);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 172 ELSE
- 173 Fill(PriceTbl,SIZE(PriceTbl^),0);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- ***** ^ not supported yet
- 174
- 175 END;
- 176 END GetPriceTbl;
- ***** ^ not supported yet
- 177
- 178
- 179
- 180
- 181
- 182 PROCEDURE DefinePriceTbl();
- 183 VAR
- 184 H : CARDINAL;
- 185 EM : CARDINAL;
- 186 J : CARDINAL;
- 187 Cell : CellValue;
- 188 Row : CARDINAL;
- 189 Str : ARRAY [0..5] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 190 Nbr : ARRAY[0..4] OF CHAR;
- ***** ^ not supported yet
- ***** ^ not supported yet
- 191 Size,Code : CARDINAL;
- 192 BEGIN
- 193 IF NOT Initialized
- 194 THEN
- 195 InitGrp();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 196 GetPriceTbl();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 197 Initialized := TRUE;
- 198 END;
- 199 WriteEol(outp,'..This may take a few minutes .. standby..');
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 200 SetupTable();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 201 BuildTable(Tab,26); (* increase table size by *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 202 FOR Row := 1 TO 25 DO
- 203
- 204 CardinalToStr(Row,3,Nbr);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 205 Assign( Nbr,Cell.Str);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 206 PutCell(Tab,1,Row,Cell); (* indexed *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 207
- 208
- 209 Cell.I := PriceTbl^[Row].Quantity[1]; (* min 1 *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 210 PutCell(Tab,2,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 211 Cell.R := PriceTbl^[Row].Price[1]; (* min price *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 212 PutCell(Tab,3,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 213
- 214 Cell.I := PriceTbl^[Row].Quantity[2]; (* min 2 *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 215 PutCell(Tab,4,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 216 Cell.R := PriceTbl^[Row].Price[2]; (* min price *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 217 PutCell(Tab,5,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 218
- 219 Cell.I := PriceTbl^[Row].Quantity[3]; (* min 3 *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 220 PutCell(Tab,6,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 221 Cell.R := PriceTbl^[Row].Price[3]; (* min price *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 222 PutCell(Tab,7,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 223
- 224 Cell.I := PriceTbl^[Row].Quantity[4]; (* min 3 *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 225 PutCell(Tab,8,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 226 Cell.R := PriceTbl^[Row].Price[4]; (* min price *)
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 227 PutCell(Tab,9,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 228
- 229
- 230 Assign(PriceTbl^[Row].Desc,Cell.Str);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 231 PutCell(Tab,10,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 232
- 233
- 234 END;
- 235 ControlTable(Tab,2,5,79,20);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 236 (* now read the table in and save values *)
- 237 FOR Row := 1 TO 25 DO
- 238 GetCell(Tab,2,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 239 PriceTbl^[Row].Quantity[1] := Cell.I;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 240 GetCell(Tab,3,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 241 PriceTbl^[Row].Price[1] := Cell.R;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 242
- 243 GetCell(Tab,4,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 244 PriceTbl^[Row].Quantity[2] := Cell.I;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 245 GetCell(Tab,5,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 246 PriceTbl^[Row].Price[2] := Cell.R;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 247
- 248 GetCell(Tab,6,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 249 PriceTbl^[Row].Quantity[3] := Cell.I;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 250 GetCell(Tab,7,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 251 PriceTbl^[Row].Price[3] := Cell.R;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 252
- 253 GetCell(Tab,8,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 254 PriceTbl^[Row].Quantity[4] := Cell.I;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 255 GetCell(Tab,9,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 256 PriceTbl^[Row].Price[4] := Cell.R;
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 257
- 258
- 259 GetCell(Tab,10,Row,Cell);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 260 Assign( Cell.Str,PriceTbl^[Row].Desc);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 261 END;
- 262 (* now save the price table in the file *)
- 263 DeleteTable(Tab);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 264 IF NOT FileExists('Price.Tbl')
- ***** ^ not supported yet
- ***** ^ not supported yet
- 265 THEN EM := CreateFile(H,'Price.tbl');
- ***** ^ not supported yet
- ***** ^ not supported yet
- 266 ELSE EM := OpenFile(H,'Price.tbl');
- ***** ^ not supported yet
- ***** ^ not supported yet
- 267 END;
- 268 EM := BlockWrite(H,PriceTbl,SIZE(PriceTbl^));
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ undeclared identifier
- ***** ^ not supported yet
- 269 EM := CloseHandle(H);
- ***** ^ not supported yet
- ***** ^ not supported yet
- 270
- 271
- 272 END DefinePriceTbl;
- ***** ^ not supported yet
- 273
- 274 PROCEDURE GetPrice(Line : CARDINAL; Quantity : CARDINAL;
- 275 StartAtLvl : CARDINAL) : Real8;
- 276 VAR
- 277 ItemCnt : CARDINAL;
- 278 BEGIN
- 279 IF NOT Initialized
- 280 THEN
- 281 GetPriceTbl();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 282 Initialized := TRUE;
- 283 END;
- 284 IF ((Line = 0 ) OR (Line > 25))
- 285 THEN RETURN 0.0
- ***** ^ bad RETURN
- 286 END;
- 287 IF StartAtLvl < 1
- 288 THEN
- 289 StartAtLvl := 1;
- 290 END;
- 291 IF StartAtLvl > 4
- 292 THEN
- 293 StartAtLvl := 4;
- 294 END;
- 295 (* get either the actual count or the count for the quantity specified*)
- 296 ItemCnt := Max(Quantity,PriceTbl^[Line].Quantity[StartAtLvl]);
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 297 IF ItemCnt < PriceTbl^[Line].Quantity[2]
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 298 THEN RETURN PriceTbl^[Line].Price[1]
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 299 ELSIF ItemCnt < PriceTbl^[Line].Quantity[3]
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 300 THEN RETURN PriceTbl^[Line].Price[2]
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 301 ELSIF ItemCnt < PriceTbl^[Line].Quantity[4]
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 302 THEN RETURN PriceTbl^[Line].Price[3]
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 303 ELSE RETURN PriceTbl^[Line].Price[4];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 304 END;
- 305 END GetPrice;
- ***** ^ not supported yet
- 306
- 307 PROCEDURE GetPriceTable(TblNbr : CARDINAL;
- 308 VAR Q1,Q2,Q3,Q4 : CARDINAL;
- 309 VAR P1,P2,P3,P4 : Real8);
- 310
- 311 (* return the price table for a line
- 312 so the invoice routine can display *)
- 313 BEGIN
- 314 IF (TblNbr = 0) OR (TblNbr > 25)
- 315 THEN
- 316 P1 := 0.0;
- ***** ^ not supported yet
- 317 P2 := 0.0;
- ***** ^ not supported yet
- 318 P3 := 0.0;
- ***** ^ not supported yet
- 319 P4 := 0.0;
- ***** ^ not supported yet
- 320 Q1 := 0;
- 321 Q2 := 0;
- 322 Q3 := 0;
- 323 Q4 := 0;
- 324 RETURN;
- 325 END;
- 326 Q1 := PriceTbl^[TblNbr].Quantity[1];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 327 Q2 := PriceTbl^[TblNbr].Quantity[2];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 328 Q3 := PriceTbl^[TblNbr].Quantity[3];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 329 Q4 := PriceTbl^[TblNbr].Quantity[4];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 330 P1 := PriceTbl^[TblNbr].Price[1];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 331 P2 := PriceTbl^[TblNbr].Price[2];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 332 P3 := PriceTbl^[TblNbr].Price[3];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 333 P4 := PriceTbl^[TblNbr].Price[4];
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- ***** ^ not supported yet
- 334 END GetPriceTable;
- ***** ^ not supported yet
- 335
- 336 PROCEDURE InitializePrice();
- 337 BEGIN
- 338 GetPriceTbl();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 339 InitGrp();
- ***** ^ not supported yet
- ***** ^ not supported yet
- 340 Initialized := TRUE;
- 341 END InitializePrice;
- ***** ^ not supported yet
- 342
- 343
- 344
- 345 BEGIN
- 346
- 347 Initialized := FALSE;
- 348
- 349 END PriceTable.
- ***** ^ not supported yet
- 418 errors
|