-
Notifications
You must be signed in to change notification settings - Fork 0
/
HGWTOLL.RPGLE
184 lines (184 loc) · 11.7 KB
/
HGWTOLL.RPGLE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
000100191120 FHGWTOLLDSPCF E WORKSTN
000101191120 /FREE
000102191120 EXFMT TOLLINFO;
000103191120 DOW NOT(*IN03);
000104191120 EXSR SetTollRate;
000105191120 *IN99 = *ON;
000106191120 WRITE TOLLINFO;
000107191120 IF KILOMETERS > 0;
000108191120 SELECT;
000109191120 WHEN VEHICLE = 'L';
000110191120 EXSR TollLogicLightVehicle;
000111191120 WHEN VEHICLE = 'H';
000112191120 EXSR TollLogicHeavyVehicle;
000113191120 WHEN VEHICLE = 'M';
000114191120 EXSR TollLogicHeavyMultipleVehicle;
000115191120 ENDSL;
000116191120 ENDIF;
000117191120 EXFMT SHOWTOLL;
000118191120 *IN99 = *OFF;
000119191120 IF *IN03 = *OFF;
000120191120 EXSR CLEAR;
000121191120 CLEAR TOLLINFO;
000122191120 EXFMT TOLLINFO;
000123191120 ENDIF;
000124191120 ENDDO;
000125191120 *INLR = *ON;
000126191120 RETURN;
000127191120
000128191120 BEGSR TollLogicLightVehicle;
000129191120 SELECT;
000130191120 WHEN AMPM = 'AM';
000131191120 SELECT;
000132191120 WHEN HOUR >= 1 AND HOUR < 6;
000133191120 TOLLRATE = 0.2162;
000134191120 WHEN HOUR >= 6 AND HOUR < 9;
000135191120 TOLLRATE = 0.3707;
000136191120 WHEN HOUR >= 9 AND HOUR < 10;
000137191120 TOLLRATE = 0.3259;
000138191120 WHEN HOUR >= 10 AND HOUR < 12;
000139191120 TOLLRATE = 0.2833;
000140191120 WHEN HOUR = 12;
000141191120 TOLLRATE = 0.2162;
000142191120 ENDSL;
000143191120 TOLLCHARGE = KILOMETERS * TOLLRATE;
000144191120 IF TRANSPDR = 'N';
000145191120 NOTRANSP = 4.07;
000146191120 TOTALDUE = TOLLCHARGE + NOTRANSP;
000147191120 ELSE;
000148191120 NOTRANSP = 0;
000149191120 TOTALDUE = TOLLCHARGE;
000150191120 ENDIF;
000151191120 ENDSL;
000152191120 SELECT;
000153191120 WHEN AMPM = 'PM';
000154191120 SELECT;
000155191120 WHEN HOUR >= 1 AND HOUR < 4;
000156191120 TOLLRATE = 0.2833;
000157191120 WHEN HOUR >= 4 AND HOUR < 7;
000158191120 TOLLRATE = 0.3842;
000159191120 WHEN HOUR >= 7 AND HOUR < 12;
000160191120 TOLLRATE = 0.2162;
000161191120 WHEN HOUR = 12;
000162191120 TOLLRATE = 0.2833;
000163191120 ENDSL;
000164191120 TOLLCHARGE = KILOMETERS * TOLLRATE;
000165191120 IF TRANSPDR = 'N';
000166191120 NOTRANSP = 4.07;
000167191120 TOTALDUE = TOLLCHARGE + NOTRANSP;
000168191120 ELSE;
000169191120 NOTRANSP = 0;
000170191120 TOTALDUE = TOLLCHARGE;
000171191120 ENDIF;
000172191120 ENDSL;
000173191120 ENDSR;
000174191120
000175191120 BEGSR TollLogicHeavyVehicle;
000176191120 SELECT;
000177191120 WHEN AMPM = 'AM';
000178191120 SELECT;
000179191120 WHEN HOUR >= 1 AND HOUR < 6;
000180191120 TOLLRATE = 0.4324;
000181191120 WHEN HOUR >= 6 AND HOUR < 9;
000182191120 TOLLRATE = 0.7418;
000183191120 WHEN HOUR >= 9 AND HOUR < 10;
000184191120 TOLLRATE = 0.6518;
000185191120 WHEN HOUR >= 10 AND HOUR < 12;
000186191120 TOLLRATE = 0.5666;
000187191120 WHEN HOUR = 12;
000188191120 TOLLRATE = 0.4324;
000189191120 ENDSL;
000190191120 TOLLCHARGE = KILOMETERS * TOLLRATE;
000191191120 IF TRANSPDR = 'N';
000192191120 NOTRANSP = 4.07;
000193191120 TOTALDUE = TOLLCHARGE + NOTRANSP;
000194191120 ELSE;
000195191120 NOTRANSP = 0;
000196191120 TOTALDUE = TOLLCHARGE;
000197191120 ENDIF;
000198191120 ENDSL;
000199191120 SELECT;
000200191120 WHEN AMPM = 'PM';
000201191120 SELECT;
000202191120 WHEN HOUR >= 1 AND HOUR < 4;
000203191120 TOLLRATE = 0.5666;
000204191120 WHEN HOUR >= 4 AND HOUR < 7;
000205191120 TOLLRATE = 0.7683;
000206191120 WHEN HOUR >= 7 AND HOUR < 12;
000207191120 TOLLRATE = 0.4324;
000208191120 WHEN HOUR = 12;
000209191120 TOLLRATE = 0.5666;
000210191120 ENDSL;
000211191120 TOLLCHARGE = KILOMETERS * TOLLRATE;
000212191120 IF TRANSPDR = 'N';
000213191120 NOTRANSP = 4.07;
000214191120 TOTALDUE = TOLLCHARGE + NOTRANSP;
000215191120 ELSE;
000216191120 NOTRANSP = 0;
000217191120 TOTALDUE = TOLLCHARGE;
000218191120 ENDIF;
000219191120 ENDSL;
000220191120 ENDSR;
000221191120
000222191120 BEGSR TollLogicHeavyMultipleVehicle;
000223191120 SELECT;
000224191120 WHEN AMPM = 'AM';
000225191120 SELECT;
000226191120 WHEN HOUR >= 1 AND HOUR < 6;
000227191120 TOLLRATE = 0.6486;
000228191120 WHEN HOUR >= 6 AND HOUR < 9;
000229191120 TOLLRATE = 1.1122;
000230191120 WHEN HOUR >= 9 AND HOUR < 10;
000231191120 TOLLRATE = 0.9778;
000232191120 WHEN HOUR >= 10 AND HOUR < 12;
000233191120 TOLLRATE = 0.8499;
000234191120 WHEN HOUR = 12;
000235191120 TOLLRATE = 0.6486;
000236191120 ENDSL;
000237191120 TOLLCHARGE = KILOMETERS * TOLLRATE;
000238191120 IF TRANSPDR = 'N';
000239191120 NOTRANSP = 4.07;
000240191120 TOTALDUE = TOLLCHARGE + NOTRANSP;
000241191120 ELSE;
000242191120 NOTRANSP = 0;
000243191120 TOTALDUE = TOLLCHARGE;
000244191120 ENDIF;
000245191120 ENDSL;
000246191120 SELECT;
000247191120 WHEN AMPM = 'PM';
000248191120 SELECT;
000249191120 WHEN HOUR >= 1 AND HOUR < 4;
000250191120 TOLLRATE = 0.8499;
000251191120 WHEN HOUR >= 4 AND HOUR < 7;
000252191120 TOLLRATE = 1.1525;
000253191120 WHEN HOUR >= 7 AND HOUR < 12;
000254191120 TOLLRATE = 0.6486;
000255191120 WHEN HOUR = 12;
000256191120 TOLLRATE = 0.8499;
000257191120 ENDSL;
000258191120 TOLLCHARGE = KILOMETERS * TOLLRATE;
000259191120 IF TRANSPDR = 'N';
000260191120 NOTRANSP = 4.07;
000261191120 TOTALDUE = TOLLCHARGE + NOTRANSP;
000262191120 ELSE;
000263191120 NOTRANSP = 0;
000264191120 TOTALDUE = TOLLCHARGE;
000265191120 ENDIF;
000266191120 ENDSL;
000267191120 ENDSR;
000268191120
000269191120
000270191120
000271191120 BEGSR SetTollRate;
000272191120 TOLLRATE = .9999;
000273191120 TOLLCHARGE = 99;
000274191120 NOTRANSP = 9.99;
000275191120 TOTALDUE = 999.99;
000276191120 ENDSR;
000277191120
000278191120 BEGSR CLEAR;
000279191120 TOLLRATE = 0;
000280191120 TOLLCHARGE = 0;
000281191120 NOTRANSP = 0;
000282191120 TOTALDUE = 0;
000283191120 ENDSR;