Revision b1253e4f
Von Philip Reetz vor fast 19 Jahren hinzugefügt
bin/mozilla/gl.pl | ||
---|---|---|
31 | 31 |
# |
32 | 32 |
#====================================================================== |
33 | 33 |
|
34 |
|
|
35 | 34 |
use SL::GL; |
36 | 35 |
use SL::PE; |
37 | 36 |
|
38 | 37 |
require "$form->{path}/arap.pl"; |
39 | 38 |
|
40 | 39 |
1; |
41 |
# end of main |
|
42 | 40 |
|
41 |
# end of main |
|
43 | 42 |
|
44 | 43 |
# this is for our long dates |
45 | 44 |
# $locale->text('January') |
... | ... | |
69 | 68 |
# $locale->text('Nov') |
70 | 69 |
# $locale->text('Dec') |
71 | 70 |
|
72 |
|
|
73 | 71 |
sub add { |
72 |
$lxdebug->enter_sub(); |
|
74 | 73 |
|
75 | 74 |
$form->{title} = "Add"; |
76 |
|
|
77 |
$form->{callback} = "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; |
|
75 |
|
|
76 |
$form->{callback} = |
|
77 |
"$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" |
|
78 |
unless $form->{callback}; |
|
78 | 79 |
|
79 | 80 |
# we use this only to set a default date |
80 | 81 |
GL->transaction(\%myconfig, \%$form); |
81 | 82 |
|
82 |
map { $chart .= "<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}</option>" } @{ $form->{chart} }; |
|
83 |
map { $tax .= qq|<option value="$_->{taxkey}--$_->{rate}">$_->{taxdescription} |.($_->{rate} * 100).qq| %|} @{ $form->{TAX} }; |
|
84 |
|
|
85 |
$form->{chart} = $chart; |
|
83 |
map { |
|
84 |
$chart .= |
|
85 |
"<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}</option>" |
|
86 |
} @{ $form->{chart} }; |
|
87 |
map { |
|
88 |
$tax .= |
|
89 |
qq|<option value="$_->{taxkey}--$_->{rate}">$_->{taxdescription} | |
|
90 |
. ($_->{rate} * 100) . qq| %| |
|
91 |
} @{ $form->{TAX} }; |
|
92 |
|
|
93 |
$form->{chart} = $chart; |
|
86 | 94 |
$form->{chartinit} = $chart; |
87 |
$form->{rowcount} = 2; |
|
95 |
$form->{rowcount} = 2;
|
|
88 | 96 |
|
89 |
$form->{debitchart} = $chart; |
|
97 |
$form->{debitchart} = $chart;
|
|
90 | 98 |
$form->{creditchart} = $chart; |
91 |
$form->{taxchart} = $tax; |
|
92 |
|
|
93 |
$form->{debit} = 0; |
|
99 |
$form->{taxchart} = $tax;
|
|
100 |
|
|
101 |
$form->{debit} = 0;
|
|
94 | 102 |
$form->{credit} = 0; |
95 |
$form->{tax} = 0; |
|
96 |
|
|
103 |
$form->{tax} = 0; |
|
97 | 104 |
|
98 | 105 |
# departments |
99 | 106 |
$form->all_departments(\%myconfig); |
100 | 107 |
if (@{ $form->{all_departments} }) { |
101 | 108 |
$form->{selectdepartment} = "<option>\n"; |
102 | 109 |
|
103 |
map { $form->{selectdepartment} .= "<option>$_->{description}--$_->{id}\n" } (@{ $form->{all_departments} }); |
|
110 |
map { |
|
111 |
$form->{selectdepartment} .= |
|
112 |
"<option>$_->{description}--$_->{id}\n" |
|
113 |
} (@{ $form->{all_departments} }); |
|
104 | 114 |
} |
105 |
|
|
115 |
|
|
106 | 116 |
&display_form(1); |
107 |
|
|
108 |
} |
|
117 |
$lxdebug->leave_sub(); |
|
109 | 118 |
|
119 |
} |
|
110 | 120 |
|
111 | 121 |
sub edit { |
122 |
$lxdebug->enter_sub(); |
|
112 | 123 |
|
113 | 124 |
GL->transaction(\%myconfig, \%$form); |
114 | 125 |
|
115 |
map { if ($form->{debitaccno} eq $_->{accno}) {$form->{debitchart} .= "<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}"} } @{ $form->{chart} }; |
|
116 |
map { if ($form->{creditaccno} eq $_->{accno}) {$form->{creditchart} .= "<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}"} } @{ $form->{chart} }; |
|
117 |
map { $tax .= qq|<option value="$_->{taxkey}--$_->{rate}">$_->{taxdescription} |.($_->{rate} * 100).qq| %|} @{ $form->{TAX} }; |
|
118 |
|
|
126 |
map { |
|
127 |
if ($form->{debitaccno} eq $_->{accno}) { |
|
128 |
$form->{debitchart} .= |
|
129 |
"<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}"; |
|
130 |
} |
|
131 |
} @{ $form->{chart} }; |
|
132 |
map { |
|
133 |
if ($form->{creditaccno} eq $_->{accno}) { |
|
134 |
$form->{creditchart} .= |
|
135 |
"<option value=\"$_->{accno}--$_->{taxkey_id}\">$_->{accno}--$_->{description}"; |
|
136 |
} |
|
137 |
} @{ $form->{chart} }; |
|
138 |
map { |
|
139 |
$tax .= |
|
140 |
qq|<option value="$_->{taxkey}--$_->{rate}">$_->{taxdescription} | |
|
141 |
. ($_->{rate} * 100) . qq| %| |
|
142 |
} @{ $form->{TAX} }; |
|
143 |
|
|
119 | 144 |
$form->{chart} = $chart; |
120 | 145 |
|
121 | 146 |
$form->{taxchart} = $tax; |
122 |
|
|
147 |
|
|
123 | 148 |
if ($form->{tax} < 0) { |
124 | 149 |
$form->{tax} = $form->{tax} * (-1); |
125 | 150 |
} |
126 |
|
|
127 |
$form->{amount}=$form->format_amount(\%myconfig, $form->{amount}, 2);
|
|
128 |
|
|
151 |
|
|
152 |
$form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2);
|
|
153 |
|
|
129 | 154 |
# departments |
130 | 155 |
$form->all_departments(\%myconfig); |
131 | 156 |
if (@{ $form->{all_departments} }) { |
132 | 157 |
$form->{selectdepartment} = "<option>\n"; |
133 | 158 |
|
134 |
map { $form->{selectdepartment} .= "<option>$_->{description}--$_->{id}\n" } (@{ $form->{all_departments} }); |
|
159 |
map { |
|
160 |
$form->{selectdepartment} .= |
|
161 |
"<option>$_->{description}--$_->{id}\n" |
|
162 |
} (@{ $form->{all_departments} }); |
|
135 | 163 |
} |
136 | 164 |
|
137 |
$i = 1;
|
|
165 |
$i = 1; |
|
138 | 166 |
foreach $ref (@{ $form->{GL} }) { |
139 | 167 |
$form->{"accno_$i"} = "$ref->{accno}--$ref->{description}"; |
140 | 168 |
|
141 | 169 |
$form->{"projectnumber_$i"} = "$ref->{projectnumber}--$ref->{project_id}"; |
142 | 170 |
for (qw(fx_transaction source memo)) { $form->{"${_}_$i"} = $ref->{$_} } |
143 |
|
|
171 |
|
|
144 | 172 |
if ($ref->{amount} < 0) { |
145 | 173 |
$form->{totaldebit} -= $ref->{amount}; |
146 | 174 |
$form->{"debit_$i"} = $ref->{amount} * -1; |
... | ... | |
153 | 181 |
} |
154 | 182 |
|
155 | 183 |
$form->{rowcount} = $i; |
156 |
$form->{locked} = ($form->datetonum($form->{transdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig)); |
|
184 |
$form->{locked} = |
|
185 |
($form->datetonum($form->{transdate}, \%myconfig) <= |
|
186 |
$form->datetonum($form->{closedto}, \%myconfig)); |
|
157 | 187 |
|
158 | 188 |
$form->{title} = "Edit"; |
159 |
|
|
189 |
|
|
160 | 190 |
&form_header; |
161 | 191 |
&display_rows; |
162 | 192 |
&form_footer; |
163 |
|
|
164 |
} |
|
165 |
|
|
193 |
$lxdebug->leave_sub(); |
|
166 | 194 |
|
195 |
} |
|
167 | 196 |
|
168 | 197 |
sub search { |
198 |
$lxdebug->enter_sub(); |
|
169 | 199 |
|
170 | 200 |
$form->{title} = $locale->text('Buchungsjournal'); |
171 |
|
|
201 |
|
|
172 | 202 |
$form->all_departments(\%myconfig); |
203 |
|
|
173 | 204 |
# departments |
174 | 205 |
if (@{ $form->{all_departments} }) { |
175 | 206 |
$form->{selectdepartment} = "<option>\n"; |
176 | 207 |
|
177 |
map { $form->{selectdepartment} .= "<option>$_->{description}--$_->{id}\n" } (@{ $form->{all_departments} }); |
|
208 |
map { |
|
209 |
$form->{selectdepartment} .= |
|
210 |
"<option>$_->{description}--$_->{id}\n" |
|
211 |
} (@{ $form->{all_departments} }); |
|
178 | 212 |
} |
179 |
|
|
213 |
|
|
180 | 214 |
$department = qq| |
181 | 215 |
<tr> |
182 |
<th align=right nowrap>|.$locale->text('Department').qq|</th>
|
|
216 |
<th align=right nowrap>| . $locale->text('Department') . qq|</th>
|
|
183 | 217 |
<td colspan=3><select name=department>$form->{selectdepartment}</select></td> |
184 | 218 |
</tr> |
185 | 219 |
| if $form->{selectdepartment}; |
186 |
|
|
220 |
|
|
187 | 221 |
# use JavaScript Calendar or not |
188 | 222 |
$form->{jsscript} = $jscalendar; |
189 | 223 |
$jsscript = ""; |
190 |
if ($form->{jsscript}) |
|
191 |
{ |
|
224 |
if ($form->{jsscript}) {
|
|
225 |
|
|
192 | 226 |
# with JavaScript Calendar |
193 | 227 |
$button1 = qq| |
194 | 228 |
<td><input name=datefrom id=datefrom size=11 title="$myconfig{dateformat}"> |
195 |
<input type=button name=datefrom id="trigger1" value=|.$locale->text('button').qq|></td> |
|
229 |
<input type=button name=datefrom id="trigger1" value=| |
|
230 |
. $locale->text('button') |
|
231 |
. qq|></td> |
|
196 | 232 |
|; |
197 |
$button2 = qq|
|
|
233 |
$button2 = qq| |
|
198 | 234 |
<td><input name=dateto id=dateto size=11 title="$myconfig{dateformat}"> |
199 |
<input type=button name=dateto id="trigger2" value=|.$locale->text('button').qq|></td> |
|
235 |
<input type=button name=dateto id="trigger2" value=| |
|
236 |
. $locale->text('button') |
|
237 |
. qq|></td> |
|
200 | 238 |
|; |
201 |
#write Trigger |
|
202 |
$jsscript = Form->write_trigger(\%myconfig,"2","datefrom","BR","trigger1","dateto","BL","trigger2"); |
|
203 |
} |
|
204 |
else |
|
205 |
{ |
|
206 |
# without JavaScript Calendar |
|
207 |
$button1 = qq|<td><input name=datefrom id=datefrom size=11 title="$myconfig{dateformat}"></td>|; |
|
208 |
$button2 = qq|<td><input name=dateto id=dateto size=11 title="$myconfig{dateformat}"></td>|; |
|
209 |
} |
|
239 |
|
|
240 |
#write Trigger |
|
241 |
$jsscript = |
|
242 |
Form->write_trigger(\%myconfig, "2", "datefrom", "BR", "trigger1", |
|
243 |
"dateto", "BL", "trigger2"); |
|
244 |
} else { |
|
245 |
|
|
246 |
# without JavaScript Calendar |
|
247 |
$button1 = |
|
248 |
qq|<td><input name=datefrom id=datefrom size=11 title="$myconfig{dateformat}"></td>|; |
|
249 |
$button2 = |
|
250 |
qq|<td><input name=dateto id=dateto size=11 title="$myconfig{dateformat}"></td>|; |
|
251 |
} |
|
210 | 252 |
|
211 | 253 |
$form->header; |
212 | 254 |
|
... | ... | |
226 | 268 |
<td> |
227 | 269 |
<table> |
228 | 270 |
<tr> |
229 |
<th align=right>|.$locale->text('Reference').qq|</th>
|
|
271 |
<th align=right>| . $locale->text('Reference') . qq|</th>
|
|
230 | 272 |
<td><input name=reference size=20></td> |
231 |
<th align=right>|.$locale->text('Source').qq|</th>
|
|
273 |
<th align=right>| . $locale->text('Source') . qq|</th>
|
|
232 | 274 |
<td><input name=source size=20></td> |
233 | 275 |
</tr> |
234 | 276 |
$department |
235 | 277 |
<tr> |
236 |
<th align=right>|.$locale->text('Description').qq|</th>
|
|
278 |
<th align=right>| . $locale->text('Description') . qq|</th>
|
|
237 | 279 |
<td colspan=3><input name=description size=40></td> |
238 | 280 |
</tr> |
239 | 281 |
<tr> |
240 |
<th align=right>|.$locale->text('Notes').qq|</th>
|
|
282 |
<th align=right>| . $locale->text('Notes') . qq|</th>
|
|
241 | 283 |
<td colspan=3><input name=notes size=40></td> |
242 | 284 |
</tr> |
243 | 285 |
<tr> |
244 |
<th align=right>|.$locale->text('From').qq|</th>
|
|
286 |
<th align=right>| . $locale->text('From') . qq|</th>
|
|
245 | 287 |
$button1 |
246 | 288 |
$button2 |
247 | 289 |
</tr> |
248 | 290 |
<tr> |
249 |
<th align=right>|.$locale->text('Include in Report').qq|</th>
|
|
291 |
<th align=right>| . $locale->text('Include in Report') . qq|</th>
|
|
250 | 292 |
<td colspan=3> |
251 | 293 |
<table> |
252 | 294 |
<tr> |
253 | 295 |
<td> |
254 |
<input name="category" class=radio type=radio value=X checked> |.$locale->text('All').qq| |
|
255 |
<input name="category" class=radio type=radio value=A> |.$locale->text('Asset').qq| |
|
256 |
<input name="category" class=radio type=radio value=C> |.$locale->text('Contra').qq| |
|
257 |
<input name="category" class=radio type=radio value=L> |.$locale->text('Liability').qq| |
|
258 |
<input name="category" class=radio type=radio value=Q> |.$locale->text('Equity').qq| |
|
259 |
<input name="category" class=radio type=radio value=I> |.$locale->text('Revenue').qq| |
|
260 |
<input name="category" class=radio type=radio value=E> |.$locale->text('Expense').qq| |
|
296 |
<input name="category" class=radio type=radio value=X checked> | |
|
297 |
. $locale->text('All') . qq| |
|
298 |
<input name="category" class=radio type=radio value=A> | |
|
299 |
. $locale->text('Asset') . qq| |
|
300 |
<input name="category" class=radio type=radio value=C> | |
|
301 |
. $locale->text('Contra') . qq| |
|
302 |
<input name="category" class=radio type=radio value=L> | |
|
303 |
. $locale->text('Liability') . qq| |
|
304 |
<input name="category" class=radio type=radio value=Q> | |
|
305 |
. $locale->text('Equity') . qq| |
|
306 |
<input name="category" class=radio type=radio value=I> | |
|
307 |
. $locale->text('Revenue') . qq| |
|
308 |
<input name="category" class=radio type=radio value=E> | |
|
309 |
. $locale->text('Expense') . qq| |
|
261 | 310 |
</td> |
262 | 311 |
</tr> |
263 | 312 |
<tr> |
264 | 313 |
<table> |
265 | 314 |
<tr> |
266 | 315 |
<td align=right><input name="l_id" class=checkbox type=checkbox value=Y></td> |
267 |
<td>|.$locale->text('ID').qq|</td>
|
|
316 |
<td>| . $locale->text('ID') . qq|</td>
|
|
268 | 317 |
<td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td> |
269 |
<td>|.$locale->text('Date').qq|</td>
|
|
318 |
<td>| . $locale->text('Date') . qq|</td>
|
|
270 | 319 |
<td align=right><input name="l_reference" class=checkbox type=checkbox value=Y checked></td> |
271 |
<td>|.$locale->text('Reference').qq|</td>
|
|
320 |
<td>| . $locale->text('Reference') . qq|</td>
|
|
272 | 321 |
<td align=right><input name="l_description" class=checkbox type=checkbox value=Y checked></td> |
273 |
<td>|.$locale->text('Description').qq|</td>
|
|
322 |
<td>| . $locale->text('Description') . qq|</td>
|
|
274 | 323 |
<td align=right><input name="l_notes" class=checkbox type=checkbox value=Y></td> |
275 |
<td>|.$locale->text('Notes').qq|</td>
|
|
324 |
<td>| . $locale->text('Notes') . qq|</td>
|
|
276 | 325 |
</tr> |
277 | 326 |
<tr> |
278 | 327 |
<td align=right><input name="l_debit" class=checkbox type=checkbox value=Y checked></td> |
279 |
<td>|.$locale->text('Debit').qq|</td>
|
|
328 |
<td>| . $locale->text('Debit') . qq|</td>
|
|
280 | 329 |
<td align=right><input name="l_credit" class=checkbox type=checkbox value=Y checked></td> |
281 |
<td>|.$locale->text('Credit').qq|</td>
|
|
330 |
<td>| . $locale->text('Credit') . qq|</td>
|
|
282 | 331 |
<td align=right><input name="l_source" class=checkbox type=checkbox value=Y checked></td> |
283 |
<td>|.$locale->text('Source').qq|</td>
|
|
332 |
<td>| . $locale->text('Source') . qq|</td>
|
|
284 | 333 |
<td align=right><input name="l_accno" class=checkbox type=checkbox value=Y checked></td> |
285 |
<td>|.$locale->text('Account').qq|</td>
|
|
334 |
<td>| . $locale->text('Account') . qq|</td>
|
|
286 | 335 |
<td align=right><input name="l_gifi_accno" class=checkbox type=checkbox value=Y></td> |
287 |
<td>|.$locale->text('GIFI').qq|</td>
|
|
336 |
<td>| . $locale->text('GIFI') . qq|</td>
|
|
288 | 337 |
</tr> |
289 | 338 |
<tr> |
290 | 339 |
<td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td> |
291 |
<td>|.$locale->text('Subtotal').qq|</td>
|
|
340 |
<td>| . $locale->text('Subtotal') . qq|</td>
|
|
292 | 341 |
</tr> |
293 | 342 |
</table> |
294 | 343 |
</tr> |
... | ... | |
311 | 360 |
<input type=hidden name=password value=$form->{password}> |
312 | 361 |
|
313 | 362 |
<br> |
314 |
<input class=submit type=submit name=action value="|.$locale->text('Continue').qq|"> |
|
363 |
<input class=submit type=submit name=action value="| |
|
364 |
. $locale->text('Continue') . qq|"> |
|
315 | 365 |
</form> |
316 | 366 |
|
317 | 367 |
</body> |
318 | 368 |
</html> |
319 | 369 |
|; |
370 |
$lxdebug->leave_sub(); |
|
320 | 371 |
} |
321 | 372 |
|
322 |
|
|
323 | 373 |
sub generate_report { |
374 |
$lxdebug->enter_sub(); |
|
324 | 375 |
|
325 | 376 |
$form->{sort} = "transdate" unless $form->{sort}; |
326 | 377 |
|
327 | 378 |
GL->all_transactions(\%myconfig, \%$form); |
328 |
|
|
329 |
$callback = "$form->{script}?action=generate_report&path=$form->{path}&login=$form->{login}&password=$form->{password}"; |
|
379 |
|
|
380 |
$callback = |
|
381 |
"$form->{script}?action=generate_report&path=$form->{path}&login=$form->{login}&password=$form->{password}"; |
|
330 | 382 |
|
331 | 383 |
$href = $callback; |
332 |
|
|
333 |
%acctype = ( 'A' => $locale->text('Asset'), |
|
334 |
'C' => $locale->text('Contra'), |
|
335 |
'L' => $locale->text('Liability'), |
|
336 |
'Q' => $locale->text('Equity'), |
|
337 |
'I' => $locale->text('Revenue'), |
|
338 |
'E' => $locale->text('Expense'), |
|
339 |
); |
|
340 |
|
|
384 |
|
|
385 |
%acctype = ('A' => $locale->text('Asset'), |
|
386 |
'C' => $locale->text('Contra'), |
|
387 |
'L' => $locale->text('Liability'), |
|
388 |
'Q' => $locale->text('Equity'), |
|
389 |
'I' => $locale->text('Revenue'), |
|
390 |
'E' => $locale->text('Expense'),); |
|
391 |
|
|
341 | 392 |
$form->{title} = $locale->text('General Ledger'); |
342 |
|
|
393 |
|
|
343 | 394 |
$ml = ($form->{ml} =~ /(A|E)/) ? -1 : 1; |
344 | 395 |
|
345 | 396 |
unless ($form->{category} eq 'X') { |
346 |
$form->{title} .= " : ".$locale->text($acctype{$form->{category}});
|
|
397 |
$form->{title} .= " : " . $locale->text($acctype{ $form->{category} });
|
|
347 | 398 |
} |
348 | 399 |
if ($form->{accno}) { |
349 |
$href .= "&accno=".$form->escape($form->{accno}); |
|
350 |
$callback .= "&accno=".$form->escape($form->{accno},1); |
|
351 |
$option = $locale->text('Account')." : $form->{accno} $form->{account_description}"; |
|
400 |
$href .= "&accno=" . $form->escape($form->{accno}); |
|
401 |
$callback .= "&accno=" . $form->escape($form->{accno}, 1); |
|
402 |
$option = |
|
403 |
$locale->text('Account') |
|
404 |
. " : $form->{accno} $form->{account_description}"; |
|
352 | 405 |
} |
353 | 406 |
if ($form->{gifi_accno}) { |
354 |
$href .= "&gifi_accno=".$form->escape($form->{gifi_accno}); |
|
355 |
$callback .= "&gifi_accno=".$form->escape($form->{gifi_accno},1); |
|
356 |
$option .= "\n<br>" if $option; |
|
357 |
$option .= $locale->text('GIFI')." : $form->{gifi_accno} $form->{gifi_account_description}"; |
|
407 |
$href .= "&gifi_accno=" . $form->escape($form->{gifi_accno}); |
|
408 |
$callback .= "&gifi_accno=" . $form->escape($form->{gifi_accno}, 1); |
|
409 |
$option .= "\n<br>" if $option; |
|
410 |
$option .= |
|
411 |
$locale->text('GIFI') |
|
412 |
. " : $form->{gifi_accno} $form->{gifi_account_description}"; |
|
358 | 413 |
} |
359 | 414 |
if ($form->{source}) { |
360 |
$href .= "&source=".$form->escape($form->{source});
|
|
361 |
$callback .= "&source=".$form->escape($form->{source},1);
|
|
362 |
$option .= "\n<br>" if $option; |
|
363 |
$option .= $locale->text('Source')." : $form->{source}";
|
|
415 |
$href .= "&source=" . $form->escape($form->{source});
|
|
416 |
$callback .= "&source=" . $form->escape($form->{source}, 1);
|
|
417 |
$option .= "\n<br>" if $option;
|
|
418 |
$option .= $locale->text('Source') . " : $form->{source}";
|
|
364 | 419 |
} |
365 | 420 |
if ($form->{reference}) { |
366 |
$href .= "&reference=".$form->escape($form->{reference});
|
|
367 |
$callback .= "&reference=".$form->escape($form->{reference},1);
|
|
368 |
$option .= "\n<br>" if $option; |
|
369 |
$option .= $locale->text('Reference')." : $form->{reference}";
|
|
421 |
$href .= "&reference=" . $form->escape($form->{reference});
|
|
422 |
$callback .= "&reference=" . $form->escape($form->{reference}, 1);
|
|
423 |
$option .= "\n<br>" if $option;
|
|
424 |
$option .= $locale->text('Reference') . " : $form->{reference}";
|
|
370 | 425 |
} |
371 | 426 |
if ($form->{department}) { |
372 |
$href .= "&department=".$form->escape($form->{department});
|
|
373 |
$callback .= "&department=".$form->escape($form->{department},1);
|
|
427 |
$href .= "&department=" . $form->escape($form->{department});
|
|
428 |
$callback .= "&department=" . $form->escape($form->{department}, 1);
|
|
374 | 429 |
($department) = split /--/, $form->{department}; |
375 | 430 |
$option .= "\n<br>" if $option; |
376 |
$option .= $locale->text('Department')." : $department";
|
|
431 |
$option .= $locale->text('Department') . " : $department";
|
|
377 | 432 |
} |
378 | 433 |
|
379 | 434 |
if ($form->{description}) { |
380 |
$href .= "&description=".$form->escape($form->{description});
|
|
381 |
$callback .= "&description=".$form->escape($form->{description},1);
|
|
382 |
$option .= "\n<br>" if $option; |
|
383 |
$option .= $locale->text('Description')." : $form->{description}";
|
|
435 |
$href .= "&description=" . $form->escape($form->{description});
|
|
436 |
$callback .= "&description=" . $form->escape($form->{description}, 1);
|
|
437 |
$option .= "\n<br>" if $option;
|
|
438 |
$option .= $locale->text('Description') . " : $form->{description}";
|
|
384 | 439 |
} |
385 | 440 |
if ($form->{notes}) { |
386 |
$href .= "¬es=".$form->escape($form->{notes});
|
|
387 |
$callback .= "¬es=".$form->escape($form->{notes},1);
|
|
388 |
$option .= "\n<br>" if $option; |
|
389 |
$option .= $locale->text('Notes')." : $form->{notes}";
|
|
441 |
$href .= "¬es=" . $form->escape($form->{notes});
|
|
442 |
$callback .= "¬es=" . $form->escape($form->{notes}, 1);
|
|
443 |
$option .= "\n<br>" if $option;
|
|
444 |
$option .= $locale->text('Notes') . " : $form->{notes}";
|
|
390 | 445 |
} |
391 |
|
|
446 |
|
|
392 | 447 |
if ($form->{datefrom}) { |
393 |
$href .= "&datefrom=$form->{datefrom}"; |
|
448 |
$href .= "&datefrom=$form->{datefrom}";
|
|
394 | 449 |
$callback .= "&datefrom=$form->{datefrom}"; |
395 |
$option .= "\n<br>" if $option; |
|
396 |
$option .= $locale->text('From')." ".$locale->date(\%myconfig, $form->{datefrom}, 1); |
|
450 |
$option .= "\n<br>" if $option; |
|
451 |
$option .= |
|
452 |
$locale->text('From') . " " |
|
453 |
. $locale->date(\%myconfig, $form->{datefrom}, 1); |
|
397 | 454 |
} |
398 | 455 |
if ($form->{dateto}) { |
399 |
$href .= "&dateto=$form->{dateto}"; |
|
456 |
$href .= "&dateto=$form->{dateto}";
|
|
400 | 457 |
$callback .= "&dateto=$form->{dateto}"; |
401 | 458 |
if ($form->{datefrom}) { |
402 | 459 |
$option .= " "; |
403 | 460 |
} else { |
404 | 461 |
$option .= "\n<br>" if $option; |
405 | 462 |
} |
406 |
$option .= $locale->text('Bis')." ".$locale->date(\%myconfig, $form->{dateto}, 1); |
|
463 |
$option .= |
|
464 |
$locale->text('Bis') . " " |
|
465 |
. $locale->date(\%myconfig, $form->{dateto}, 1); |
|
407 | 466 |
} |
408 | 467 |
|
409 |
|
|
410 |
@columns = $form->sort_columns(qw(transdate id reference description notes source debit debit_accno credit credit_accno debit_tax debit_tax_accno credit_tax credit_tax_accno accno gifi_accno)); |
|
468 |
@columns = |
|
469 |
$form->sort_columns( |
|
470 |
qw(transdate id reference description notes source debit debit_accno credit credit_accno debit_tax debit_tax_accno credit_tax credit_tax_accno accno gifi_accno) |
|
471 |
); |
|
411 | 472 |
|
412 | 473 |
if ($form->{accno} || $form->{gifi_accno}) { |
413 | 474 |
@columns = grep !/(accno|gifi_accno)/, @columns; |
414 | 475 |
push @columns, "balance"; |
415 | 476 |
$form->{l_balance} = "Y"; |
416 |
|
|
417 |
} |
|
418 |
|
|
419 |
$form->{l_credit_accno} = "Y"; |
|
420 |
$form->{l_debit_accno} = "Y"; |
|
421 |
$form->{l_credit_tax} = "Y"; |
|
422 |
$form->{l_debit_tax} = "Y"; |
|
477 |
|
|
478 |
}
|
|
479 |
|
|
480 |
$form->{l_credit_accno} = "Y";
|
|
481 |
$form->{l_debit_accno} = "Y";
|
|
482 |
$form->{l_credit_tax} = "Y";
|
|
483 |
$form->{l_debit_tax} = "Y";
|
|
423 | 484 |
$form->{l_credit_tax_accno} = "Y"; |
424 |
$form->{l_debit_tax_accno} = "Y"; |
|
425 |
$form->{l_accno} = "N"; |
|
485 |
$form->{l_debit_tax_accno} = "Y";
|
|
486 |
$form->{l_accno} = "N";
|
|
426 | 487 |
foreach $item (@columns) { |
427 | 488 |
if ($form->{"l_$item"} eq "Y") { |
428 | 489 |
push @column_index, $item; |
429 | 490 |
|
430 | 491 |
# add column to href and callback |
431 | 492 |
$callback .= "&l_$item=Y"; |
432 |
$href .= "&l_$item=Y"; |
|
493 |
$href .= "&l_$item=Y";
|
|
433 | 494 |
} |
434 | 495 |
} |
435 | 496 |
|
436 | 497 |
if ($form->{l_subtotal} eq 'Y') { |
437 | 498 |
$callback .= "&l_subtotal=Y"; |
438 |
$href .= "&l_subtotal=Y"; |
|
499 |
$href .= "&l_subtotal=Y";
|
|
439 | 500 |
} |
440 | 501 |
|
441 | 502 |
$callback .= "&category=$form->{category}"; |
442 |
$href .= "&category=$form->{category}"; |
|
443 |
|
|
444 |
$column_header{id} = "<th><a class=listheading href=$href&sort=id>".$locale->text('ID')."</a></th>"; |
|
445 |
$column_header{transdate} = "<th><a class=listheading href=$href&sort=transdate>".$locale->text('Date')."</a></th>"; |
|
446 |
$column_header{reference} = "<th><a class=listheading href=$href&sort=reference>".$locale->text('Reference')."</a></th>"; |
|
447 |
$column_header{source} = "<th><a class=listheading href=$href&sort=source>".$locale->text('Source')."</a></th>"; |
|
448 |
$column_header{description} = "<th><a class=listheading href=$href&sort=description>".$locale->text('Description')."</a></th>"; |
|
449 |
$column_header{notes} = "<th class=listheading>".$locale->text('Notes')."</th>"; |
|
450 |
$column_header{debit} = "<th class=listheading>".$locale->text('Debit')."</th>"; |
|
451 |
$column_header{debit_accno} = "<th><a class=listheading href=$href&sort=accno>".$locale->text('Debit Account')."</a></th>"; |
|
452 |
$column_header{credit} = "<th class=listheading>".$locale->text('Credit')."</th>"; |
|
453 |
$column_header{credit_accno} = "<th><a class=listheading href=$href&sort=accno>".$locale->text('Credit Account')."</a></th>"; |
|
454 |
$column_header{debit_tax} = "<th><a class=listheading href=$href&sort=accno>".$locale->text('Debit Tax')."</a></th>"; |
|
455 |
$column_header{debit_tax_accno} = "<th><a class=listheading href=$href&sort=accno>".$locale->text('Debit Tax Account')."</a></th>"; |
|
456 |
$column_header{credit_tax} = "<th><a class=listheading href=$href&sort=accno>".$locale->text('Credit Tax')."</a></th>"; |
|
457 |
$column_header{credit_tax_accno} = "<th><a class=listheading href=$href&sort=accno>".$locale->text('Credit Tax Account')."</a></th>"; |
|
458 |
$column_header{gifi_accno} = "<th><a class=listheading href=$href&sort=gifi_accno>".$locale->text('GIFI')."</a></th>"; |
|
459 |
$column_header{balance} = "<th>".$locale->text('Balance')."</th>"; |
|
460 |
|
|
503 |
$href .= "&category=$form->{category}"; |
|
504 |
|
|
505 |
$column_header{id} = |
|
506 |
"<th><a class=listheading href=$href&sort=id>" |
|
507 |
. $locale->text('ID') |
|
508 |
. "</a></th>"; |
|
509 |
$column_header{transdate} = |
|
510 |
"<th><a class=listheading href=$href&sort=transdate>" |
|
511 |
. $locale->text('Date') |
|
512 |
. "</a></th>"; |
|
513 |
$column_header{reference} = |
|
514 |
"<th><a class=listheading href=$href&sort=reference>" |
|
515 |
. $locale->text('Reference') |
|
516 |
. "</a></th>"; |
|
517 |
$column_header{source} = |
|
518 |
"<th><a class=listheading href=$href&sort=source>" |
|
519 |
. $locale->text('Source') |
|
520 |
. "</a></th>"; |
|
521 |
$column_header{description} = |
|
522 |
"<th><a class=listheading href=$href&sort=description>" |
|
523 |
. $locale->text('Description') |
|
524 |
. "</a></th>"; |
|
525 |
$column_header{notes} = |
|
526 |
"<th class=listheading>" . $locale->text('Notes') . "</th>"; |
|
527 |
$column_header{debit} = |
|
528 |
"<th class=listheading>" . $locale->text('Debit') . "</th>"; |
|
529 |
$column_header{debit_accno} = |
|
530 |
"<th><a class=listheading href=$href&sort=accno>" |
|
531 |
. $locale->text('Debit Account') |
|
532 |
. "</a></th>"; |
|
533 |
$column_header{credit} = |
|
534 |
"<th class=listheading>" . $locale->text('Credit') . "</th>"; |
|
535 |
$column_header{credit_accno} = |
|
536 |
"<th><a class=listheading href=$href&sort=accno>" |
|
537 |
. $locale->text('Credit Account') |
|
538 |
. "</a></th>"; |
|
539 |
$column_header{debit_tax} = |
|
540 |
"<th><a class=listheading href=$href&sort=accno>" |
|
541 |
. $locale->text('Debit Tax') |
|
542 |
. "</a></th>"; |
|
543 |
$column_header{debit_tax_accno} = |
|
544 |
"<th><a class=listheading href=$href&sort=accno>" |
|
545 |
. $locale->text('Debit Tax Account') |
|
546 |
. "</a></th>"; |
|
547 |
$column_header{credit_tax} = |
|
548 |
"<th><a class=listheading href=$href&sort=accno>" |
|
549 |
. $locale->text('Credit Tax') |
|
550 |
. "</a></th>"; |
|
551 |
$column_header{credit_tax_accno} = |
|
552 |
"<th><a class=listheading href=$href&sort=accno>" |
|
553 |
. $locale->text('Credit Tax Account') |
|
554 |
. "</a></th>"; |
|
555 |
$column_header{gifi_accno} = |
|
556 |
"<th><a class=listheading href=$href&sort=gifi_accno>" |
|
557 |
. $locale->text('GIFI') |
|
558 |
. "</a></th>"; |
|
559 |
$column_header{balance} = "<th>" . $locale->text('Balance') . "</th>"; |
|
560 |
|
|
461 | 561 |
$form->{landscape} = 1; |
462 |
|
|
562 |
|
|
463 | 563 |
$form->header; |
464 | 564 |
|
465 | 565 |
print qq| |
... | ... | |
480 | 580 |
<tr class=listheading> |
481 | 581 |
|; |
482 | 582 |
|
483 |
map { print "$column_header{$_}\n" } @column_index; |
|
583 |
map { print "$column_header{$_}\n" } @column_index;
|
|
484 | 584 |
|
485 |
print " |
|
585 |
print "
|
|
486 | 586 |
</tr> |
487 | 587 |
</thead> |
488 | 588 |
</tfoot> |
489 | 589 |
<tbody> |
490 | 590 |
"; |
491 |
|
|
591 |
|
|
492 | 592 |
# add sort to callback |
493 | 593 |
$form->{callback} = "$callback&sort=$form->{sort}"; |
494 | 594 |
$callback = $form->escape($form->{callback}); |
495 |
|
|
595 |
|
|
496 | 596 |
# initial item for subtotals |
497 | 597 |
if (@{ $form->{GL} }) { |
498 |
$sameitem = $form->{GL}->[0]->{$form->{sort}};
|
|
598 |
$sameitem = $form->{GL}->[0]->{ $form->{sort} };
|
|
499 | 599 |
} |
500 |
|
|
600 |
|
|
501 | 601 |
if (($form->{accno} || $form->{gifi_accno}) && $form->{balance}) { |
502 | 602 |
|
503 | 603 |
map { $column_data{$_} = "<td> </td>" } @column_index; |
504 |
$column_data{balance} = "<td align=right>".$form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0)."</td>"; |
|
505 |
|
|
506 |
$i++; $i %= 2; |
|
604 |
$column_data{balance} = |
|
605 |
"<td align=right>" |
|
606 |
. $form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0) |
|
607 |
. "</td>"; |
|
608 |
|
|
609 |
$i++; |
|
610 |
$i %= 2; |
|
507 | 611 |
print qq| |
508 | 612 |
<tr class=listrow$i> |
509 | 613 |
|; |
510 | 614 |
map { print "$column_data{$_}\n" } @column_index; |
511 |
|
|
615 |
|
|
512 | 616 |
print qq| |
513 | 617 |
</tr> |
514 | 618 |
|; |
515 | 619 |
} |
516 |
|
|
620 |
|
|
517 | 621 |
foreach $ref (@{ $form->{GL} }) { |
518 | 622 |
|
519 | 623 |
# if item ne sort print subtotal |
520 | 624 |
if ($form->{l_subtotal} eq 'Y') { |
521 |
if ($sameitem ne $ref->{$form->{sort}}) {
|
|
522 |
&gl_subtotal;
|
|
625 |
if ($sameitem ne $ref->{ $form->{sort} }) {
|
|
626 |
&gl_subtotal;
|
|
523 | 627 |
} |
524 | 628 |
} |
525 |
foreach $key (sort keys (%{$ref->{amount}})) {
|
|
629 |
foreach $key (sort keys(%{ $ref->{amount} })) {
|
|
526 | 630 |
$form->{balance} += $ref->{amount}{$key}; |
527 | 631 |
} |
528 |
|
|
632 |
|
|
529 | 633 |
$debit = ""; |
530 |
foreach $key (sort keys (%{$ref->{debit}})) {
|
|
634 |
foreach $key (sort keys(%{ $ref->{debit} })) {
|
|
531 | 635 |
$subtotaldebit += $ref->{debit}{$key}; |
532 |
$totaldebit += $ref->{debit}{$key}; |
|
636 |
$totaldebit += $ref->{debit}{$key};
|
|
533 | 637 |
if ($key == 0) { |
534 |
$debit = $form->format_amount(\%myconfig, $ref->{debit}{$key} , 2, 0);
|
|
638 |
$debit = $form->format_amount(\%myconfig, $ref->{debit}{$key}, 2, 0); |
|
535 | 639 |
} else { |
536 |
$debit .= "<br>".$form->format_amount(\%myconfig, $ref->{debit}{$key} , 2, 0); |
|
640 |
$debit .= |
|
641 |
"<br>" . $form->format_amount(\%myconfig, $ref->{debit}{$key}, 2, 0); |
|
537 | 642 |
} |
538 | 643 |
} |
539 |
|
|
644 |
|
|
540 | 645 |
$credit = ""; |
541 |
foreach $key (sort keys (%{$ref->{credit}})) {
|
|
646 |
foreach $key (sort keys(%{ $ref->{credit} })) {
|
|
542 | 647 |
$subtotalcredit += $ref->{credit}{$key}; |
543 |
$totalcredit += $ref->{credit}{$key}; |
|
648 |
$totalcredit += $ref->{credit}{$key};
|
|
544 | 649 |
if ($key == 0) { |
545 |
$credit = $form->format_amount(\%myconfig, $ref->{credit}{$key} , 2, 0);
|
|
650 |
$credit = $form->format_amount(\%myconfig, $ref->{credit}{$key}, 2, 0); |
|
546 | 651 |
} else { |
547 |
$credit .= "<br>".$form->format_amount(\%myconfig, $ref->{credit}{$key} , 2, 0); |
|
548 |
} |
|
652 |
$credit .= "<br>" |
|
653 |
. $form->format_amount(\%myconfig, $ref->{credit}{$key}, 2, 0); |
|
654 |
} |
|
549 | 655 |
} |
550 |
|
|
656 |
|
|
551 | 657 |
$debittax = ""; |
552 |
foreach $key (sort keys (%{$ref->{debit_tax}})) {
|
|
658 |
foreach $key (sort keys(%{ $ref->{debit_tax} })) {
|
|
553 | 659 |
$subtotaldebittax += $ref->{debit_tax}{$key}; |
554 |
$totaldebittax += $ref->{debit_tax}{$key}; |
|
660 |
$totaldebittax += $ref->{debit_tax}{$key};
|
|
555 | 661 |
if ($key == 0) { |
556 |
$debittax = $form->format_amount(\%myconfig, $ref->{debit_tax}{$key} , 2, 0); |
|
662 |
$debittax = |
|
663 |
$form->format_amount(\%myconfig, $ref->{debit_tax}{$key}, 2, 0); |
|
557 | 664 |
} else { |
558 |
$debittax .= "<br>".$form->format_amount(\%myconfig, $ref->{debit_tax}{$key} , 2, 0); |
|
665 |
$debittax .= "<br>" |
|
666 |
. $form->format_amount(\%myconfig, $ref->{debit_tax}{$key}, 2, 0); |
|
559 | 667 |
} |
560 | 668 |
} |
561 |
|
|
669 |
|
|
562 | 670 |
$credittax = ""; |
563 |
foreach $key (sort keys (%{$ref->{credit_tax}})) {
|
|
671 |
foreach $key (sort keys(%{ $ref->{credit_tax} })) {
|
|
564 | 672 |
$subtotalcredittax += $ref->{credit_tax}{$key}; |
565 |
$totalcredittax += $ref->{credit_tax}{$key}; |
|
673 |
$totalcredittax += $ref->{credit_tax}{$key};
|
|
566 | 674 |
if ($key == 0) { |
567 |
$credittax = $form->format_amount(\%myconfig, $ref->{credit_tax}{$key} , 2, 0); |
|
675 |
$credittax = |
|
676 |
$form->format_amount(\%myconfig, $ref->{credit_tax}{$key}, 2, 0); |
|
568 | 677 |
} else { |
569 |
$credittax .= "<br>".$form->format_amount(\%myconfig, $ref->{credit_tax}{$key} , 2, 0); |
|
678 |
$credittax .= "<br>" |
|
679 |
. $form->format_amount(\%myconfig, $ref->{credit_tax}{$key}, 2, 0); |
|
570 | 680 |
} |
571 | 681 |
} |
572 |
|
|
573 |
$debitaccno = ""; |
|
682 |
|
|
683 |
$debitaccno = "";
|
|
574 | 684 |
$debittaxkey = ""; |
575 |
$taxaccno = ""; |
|
576 |
foreach $key (sort keys (%{$ref->{debit_accno}})) {
|
|
685 |
$taxaccno = "";
|
|
686 |
foreach $key (sort keys(%{ $ref->{debit_accno} })) {
|
|
577 | 687 |
if ($key == 0) { |
578 |
$debitaccno = "<a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{debit_accno}{$key}</a>"; |
|
688 |
$debitaccno = |
|
689 |
"<a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{debit_accno}{$key}</a>"; |
|
579 | 690 |
} else { |
580 |
$debitaccno .= "<br><a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{debit_accno}{$key}</a>"; |
|
691 |
$debitaccno .= |
|
692 |
"<br><a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{debit_accno}{$key}</a>"; |
|
581 | 693 |
} |
582 | 694 |
if ($ref->{debit_taxkey}{$key} eq $debittaxkey) { |
583 | 695 |
$ref->{debit_tax_accno}{$key} = $taxaccno; |
584 |
}
|
|
585 |
$taxaccno = $ref->{debit_tax_accno}{$key}; |
|
696 |
} |
|
697 |
$taxaccno = $ref->{debit_tax_accno}{$key};
|
|
586 | 698 |
$debittaxkey = $ref->{debit_taxkey}{$key}; |
587 | 699 |
} |
588 |
|
|
589 |
$creditaccno = ""; |
|
700 |
|
|
701 |
$creditaccno = "";
|
|
590 | 702 |
$credittaxkey = ""; |
591 |
$taxaccno = ""; |
|
592 |
foreach $key (sort keys (%{$ref->{credit_accno}})) {
|
|
703 |
$taxaccno = "";
|
|
704 |
foreach $key (sort keys(%{ $ref->{credit_accno} })) {
|
|
593 | 705 |
if ($key == 0) { |
594 |
$creditaccno = "<a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{credit_accno}{$key}</a>"; |
|
706 |
$creditaccno = |
|
707 |
"<a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{credit_accno}{$key}</a>"; |
|
595 | 708 |
} else { |
596 |
$creditaccno .= "<br><a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{credit_accno}{$key}</a>"; |
|
709 |
$creditaccno .= |
|
710 |
"<br><a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{credit_accno}{$key}</a>"; |
|
597 | 711 |
} |
598 | 712 |
if ($ref->{credit_taxkey}{$key} eq $credittaxkey) { |
599 | 713 |
$ref->{credit_tax_accno}{$key} = $taxaccno; |
600 | 714 |
} |
601 |
$taxaccno = $ref->{credit_tax_accno}{$key}; |
|
715 |
$taxaccno = $ref->{credit_tax_accno}{$key};
|
|
602 | 716 |
$credittaxkey = $ref->{credit_taxkey}{$key}; |
603 |
}
|
|
604 |
|
|
717 |
} |
|
718 |
|
|
605 | 719 |
$debittaxaccno = ""; |
606 |
foreach $key (sort keys (%{$ref->{debit_tax_accno}})) {
|
|
720 |
foreach $key (sort keys(%{ $ref->{debit_tax_accno} })) {
|
|
607 | 721 |
if ($key == 0) { |
608 |
$debittaxaccno = "<a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{debit_tax_accno}{$key}</a>"; |
|
722 |
$debittaxaccno = |
|
723 |
"<a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{debit_tax_accno}{$key}</a>"; |
|
609 | 724 |
} else { |
610 |
$debittaxaccno .= "<br><a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{debit_tax_accno}{$key}</a>"; |
|
725 |
$debittaxaccno .= |
|
726 |
"<br><a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{debit_tax_accno}{$key}</a>"; |
|
611 | 727 |
} |
612 | 728 |
} |
613 |
|
|
729 |
|
|
614 | 730 |
$credittaxaccno = ""; |
615 |
foreach $key (sort keys (%{$ref->{credit_tax_accno}})) {
|
|
731 |
foreach $key (sort keys(%{ $ref->{credit_tax_accno} })) {
|
|
616 | 732 |
if ($key == 0) { |
617 |
$credittaxaccno = "<a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{credit_tax_accno}{$key}</a>"; |
|
733 |
$credittaxaccno = |
|
734 |
"<a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{credit_tax_accno}{$key}</a>"; |
|
618 | 735 |
} else { |
619 |
$credittaxaccno .= "<br><a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{credit_tax_accno}{$key}</a>"; |
|
736 |
$credittaxaccno .= |
|
737 |
"<br><a href=$href&accno=$ref->{accno}&callback=$callback>$ref->{credit_tax_accno}{$key}</a>"; |
|
620 | 738 |
} |
621 |
} |
|
622 |
# $ref->{debit} = $form->format_amount(\%myconfig, $ref->{debit}, 2, " "); |
|
623 |
# $ref->{credit} = $form->format_amount(\%myconfig, $ref->{credit}, 2, " "); |
|
624 |
|
|
625 |
$column_data{id} = "<td align=right> $ref->{id} </td>"; |
|
626 |
$column_data{transdate} = "<td align=center> $ref->{transdate} </td>"; |
|
627 |
$column_data{reference} = "<td align=center><a href=$ref->{module}.pl?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{reference}</td>"; |
|
628 |
$column_data{description} = "<td align=center>$ref->{description} </td>"; |
|
629 |
$column_data{source} = "<td align=center>$ref->{source} </td>"; |
|
630 |
$column_data{notes} = "<td align=center>$ref->{notes} </td>"; |
|
631 |
$column_data{debit} = "<td align=right>$debit</td>"; |
|
632 |
$column_data{debit_accno} = "<td align=center>$debitaccno</td>"; |
|
633 |
$column_data{credit} = "<td align=right>$credit</td>"; |
|
739 |
} |
|
740 |
|
|
741 |
# $ref->{debit} = $form->format_amount(\%myconfig, $ref->{debit}, 2, " "); |
|
742 |
# $ref->{credit} = $form->format_amount(\%myconfig, $ref->{credit}, 2, " "); |
|
743 |
|
|
744 |
$column_data{id} = "<td align=right> $ref->{id} </td>"; |
|
745 |
$column_data{transdate} = |
|
746 |
"<td align=center> $ref->{transdate} </td>"; |
|
747 |
$column_data{reference} = |
|
748 |
"<td align=center><a href=$ref->{module}.pl?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{reference}</td>"; |
|
749 |
$column_data{description} = |
|
750 |
"<td align=center>$ref->{description} </td>"; |
|
751 |
$column_data{source} = "<td align=center>$ref->{source} </td>"; |
|
752 |
$column_data{notes} = "<td align=center>$ref->{notes} </td>"; |
|
753 |
$column_data{debit} = "<td align=right>$debit</td>"; |
|
754 |
$column_data{debit_accno} = "<td align=center>$debitaccno</td>"; |
|
755 |
$column_data{credit} = "<td align=right>$credit</td>"; |
|
634 | 756 |
$column_data{credit_accno} = "<td align=center>$creditaccno</td>"; |
635 |
$column_data{debit_tax} = ($ref->{debit_tax_accno} ne "") ? "<td align=right>$debittax</td>" : "<td></td>"; |
|
757 |
$column_data{debit_tax} = |
|
758 |
($ref->{debit_tax_accno} ne "") |
|
759 |
? "<td align=right>$debittax</td>" |
|
760 |
: "<td></td>"; |
|
636 | 761 |
$column_data{debit_tax_accno} = "<td align=center>$debittaxaccno</td>"; |
637 |
$column_data{gifi_accno} = "<td><a href=$href&gifi_accno=$ref->{gifi_accno}&callback=$callback>$ref->{gifi_accno}</a> </td>"; |
|
638 |
$column_data{credit_tax} = ($ref->{credit_tax_accno} ne "") ? "<td align=right>$credittax</td>" : "<td></td>"; |
|
762 |
$column_data{gifi_accno} = |
|
763 |
"<td><a href=$href&gifi_accno=$ref->{gifi_accno}&callback=$callback>$ref->{gifi_accno}</a> </td>"; |
|
764 |
$column_data{credit_tax} = |
|
765 |
($ref->{credit_tax_accno} ne "") |
|
766 |
? "<td align=right>$credittax</td>" |
|
767 |
: "<td></td>"; |
|
639 | 768 |
$column_data{credit_tax_accno} = "<td align=center>$credittaxaccno</td>"; |
640 |
$column_data{gifi_accno} = "<td><a href=$href&gifi_accno=$ref->{gifi_accno}&callback=$callback>$ref->{gifi_accno}</a> </td>"; |
|
641 |
$column_data{balance} = "<td align=right>".$form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0)."</td>"; |
|
769 |
$column_data{gifi_accno} = |
|
770 |
"<td><a href=$href&gifi_accno=$ref->{gifi_accno}&callback=$callback>$ref->{gifi_accno}</a> </td>"; |
|
771 |
$column_data{balance} = |
|
772 |
"<td align=right>" |
|
773 |
. $form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0) |
|
774 |
. "</td>"; |
|
642 | 775 |
|
643 |
$i++; $i %= 2; |
|
776 |
$i++; |
|
777 |
$i %= 2; |
|
644 | 778 |
print " |
645 | 779 |
<tr class=listrow$i>"; |
646 | 780 |
map { print "$column_data{$_}\n" } @column_index; |
647 | 781 |
print "</tr>"; |
648 |
|
|
649 |
} |
|
650 | 782 |
|
783 |
} |
|
651 | 784 |
|
652 | 785 |
&gl_subtotal if ($form->{l_subtotal} eq 'Y'); |
653 | 786 |
|
654 |
|
|
655 | 787 |
map { $column_data{$_} = "<td> </td>" } @column_index; |
656 |
|
|
657 |
$column_data{debit} = "<th align=right class=listtotal>".$form->format_amount(\%myconfig, $totaldebit, 2, " ")."</th>"; |
|
658 |
$column_data{credit} = "<th align=right class=listtotal>".$form->format_amount(\%myconfig, $totalcredit, 2, " ")."</th>"; |
|
659 |
$column_data{debit_tax} = "<th align=right class=listtotal>".$form->format_amount(\%myconfig, $totaldebittax, 2, " ")."</th>"; |
|
660 |
$column_data{credit_tax} = "<th align=right class=listtotal>".$form->format_amount(\%myconfig, $totalcredittax, 2, " ")."</th>"; |
|
661 |
$column_data{balance} = "<th align=right class=listtotal>".$form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0)."</th>"; |
|
662 |
|
|
788 |
|
|
789 |
$column_data{debit} = |
|
790 |
"<th align=right class=listtotal>" |
|
791 |
. $form->format_amount(\%myconfig, $totaldebit, 2, " ") . "</th>"; |
|
792 |
$column_data{credit} = |
|
793 |
"<th align=right class=listtotal>" |
|
794 |
. $form->format_amount(\%myconfig, $totalcredit, 2, " ") . "</th>"; |
|
795 |
$column_data{debit_tax} = |
|
796 |
"<th align=right class=listtotal>" |
|
797 |
. $form->format_amount(\%myconfig, $totaldebittax, 2, " ") . "</th>"; |
|
798 |
$column_data{credit_tax} = |
|
799 |
"<th align=right class=listtotal>" |
|
800 |
. $form->format_amount(\%myconfig, $totalcredittax, 2, " ") . "</th>"; |
|
801 |
$column_data{balance} = |
|
802 |
"<th align=right class=listtotal>" |
|
803 |
. $form->format_amount(\%myconfig, $form->{balance} * $ml, 2, 0) . "</th>"; |
|
804 |
|
|
663 | 805 |
print qq| |
664 | 806 |
<tr class=listtotal> |
665 | 807 |
|; |
... | ... | |
687 | 829 |
<input type=hidden name=login value=$form->{login}> |
688 | 830 |
<input type=hidden name=password value=$form->{password}> |
689 | 831 |
|
690 |
<input class=submit type=submit name=action value="|.$locale->text('GL Transaction').qq|"> |
|
691 |
<input class=submit type=submit name=action value="|.$locale->text('AR Transaction').qq|"> |
|
692 |
<input class=submit type=submit name=action value="|.$locale->text('AP Transaction').qq|"> |
|
693 |
<input class=submit type=submit name=action value="|.$locale->text('Sales Invoice').qq|"> |
|
694 |
<input class=submit type=submit name=action value="|.$locale->text('Vendor Invoice').qq|">|; |
|
695 |
|
|
832 |
<input class=submit type=submit name=action value="| |
|
833 |
. $locale->text('GL Transaction') . qq|"> |
|
834 |
<input class=submit type=submit name=action value="| |
|
835 |
. $locale->text('AR Transaction') . qq|"> |
|
836 |
<input class=submit type=submit name=action value="| |
|
837 |
. $locale->text('AP Transaction') . qq|"> |
|
838 |
<input class=submit type=submit name=action value="| |
|
839 |
. $locale->text('Sales Invoice') . qq|"> |
|
840 |
<input class=submit type=submit name=action value="| |
|
841 |
. $locale->text('Vendor Invoice') . qq|">|; |
|
696 | 842 |
|
697 | 843 |
if ($form->{menubar}) { |
698 | 844 |
require "$form->{path}/menu.pl"; |
... | ... | |
706 | 852 |
</body> |
707 | 853 |
</html> |
708 | 854 |
|; |
855 |
$lxdebug->leave_sub(); |
|
709 | 856 |
|
710 | 857 |
} |
711 | 858 |
|
712 |
|
|
713 | 859 |
sub gl_subtotal { |
714 |
|
|
715 |
$subtotaldebit = $form->format_amount(\%myconfig, $subtotaldebit, 2, " "); |
|
716 |
$subtotalcredit = $form->format_amount(\%myconfig, $subtotalcredit, 2, " "); |
|
717 |
|
|
718 |
map { $column_data{$_} = "<td> </td>" } qw(transdate id reference source description accno); |
|
719 |
$column_data{debit} = "<th align=right>$subtotaldebit</td>"; |
|
860 |
$lxdebug->enter_sub(); |
|
861 |
|
|
862 |
$subtotaldebit = |
|
863 |
$form->format_amount(\%myconfig, $subtotaldebit, 2, " "); |
|
864 |
$subtotalcredit = |
|
865 |
$form->format_amount(\%myconfig, $subtotalcredit, 2, " "); |
|
866 |
|
|
867 |
map { $column_data{$_} = "<td> </td>" } |
|
868 |
qw(transdate id reference source description accno); |
|
869 |
$column_data{debit} = "<th align=right>$subtotaldebit</td>"; |
|
720 | 870 |
$column_data{credit} = "<th align=right>$subtotalcredit</td>"; |
721 | 871 |
|
722 |
|
|
723 | 872 |
print "<tr class=listsubtotal>"; |
724 | 873 |
map { print "$column_data{$_}\n" } @column_index; |
725 | 874 |
print "</tr>"; |
726 | 875 |
|
727 |
$subtotaldebit = 0; |
|
876 |
$subtotaldebit = 0;
|
|
728 | 877 |
$subtotalcredit = 0; |
729 | 878 |
|
730 |
$sameitem = $ref->{$form->{sort}}; |
|
879 |
$sameitem = $ref->{ $form->{sort} }; |
|
880 |
$lxdebug->leave_sub(); |
|
731 | 881 |
|
732 | 882 |
} |
733 | 883 |
|
734 |
|
|
735 | 884 |
sub update { |
885 |
$lxdebug->enter_sub(); |
|
736 | 886 |
|
737 | 887 |
if ($form->{transdate} ne $form->{oldtransdate}) { |
738 | 888 |
if ($form->{selectprojectnumber}) { |
739 | 889 |
$form->all_projects(\%myconfig, undef, $form->{transdate}); |
740 | 890 |
if (@{ $form->{all_project} }) { |
741 |
$form->{selectprojectnumber} = "<option>\n"; |
|
742 |
for (@{ $form->{all_project} }) { $form->{selectprojectnumber} .= qq|<option value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n| } |
|
743 |
$form->{selectprojectnumber} = $form->escape($form->{selectprojectnumber},1); |
|
891 |
$form->{selectprojectnumber} = "<option>\n"; |
|
892 |
for (@{ $form->{all_project} }) { |
|
893 |
$form->{selectprojectnumber} .= |
|
894 |
qq|<option value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n|; |
|
895 |
} |
|
896 |
$form->{selectprojectnumber} = |
|
897 |
$form->escape($form->{selectprojectnumber}, 1); |
|
744 | 898 |
} |
745 | 899 |
} |
746 | 900 |
$form->{oldtransdate} = $form->{transdate}; |
747 | 901 |
} |
748 |
|
|
749 |
my @a = (); |
|
750 |
my $count = 0; |
|
751 |
my $debittax = 0; |
|
902 |
|
|
903 |
my @a = ();
|
|
904 |
my $count = 0;
|
|
905 |
my $debittax = 0;
|
|
752 | 906 |
my $credittax = 0; |
753 |
my @flds = qw(accno debit credit projectnumber fx_transaction source memo tax taxchart); |
|
907 |
my @flds = |
|
908 |
qw(accno debit credit projectnumber fx_transaction source memo tax taxchart); |
|
754 | 909 |
|
755 | 910 |
for my $i (1 .. $form->{rowcount}) { |
756 | 911 |
|
757 | 912 |
unless (($form->{"debit_$i"} eq "") && ($form->{"credit_$i"} eq "")) { |
758 |
for (qw(debit credit tax)) { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } |
|
759 |
|
|
913 |
for (qw(debit credit tax)) { |
|
914 |
$form->{"${_}_$i"} = |
|
915 |
$form->parse_amount(\%myconfig, $form->{"${_}_$i"}); |
|
916 |
} |
|
917 |
|
|
760 | 918 |
push @a, {}; |
761 | 919 |
$debitcredit = ($form->{"debit_$i"} == 0) ? "0" : "1"; |
762 |
$amount = ($form->{"debit_$i"} == 0) ? $form->{"credit_$i"} : $form->{"debit_$i"}; |
|
920 |
$amount = |
|
921 |
($form->{"debit_$i"} == 0) |
|
922 |
? $form->{"credit_$i"} |
|
923 |
: $form->{"debit_$i"}; |
|
763 | 924 |
$j = $#a; |
764 | 925 |
if (($debitcredit && $credittax) || (!$debitcredit && $debittax)) { |
765 | 926 |
$form->{"taxchart_$i"} = "0--"; |
766 |
$form->{"tax_$i"} = 0; |
|
927 |
$form->{"tax_$i"} = 0;
|
|
767 | 928 |
} |
768 | 929 |
if (!$form->{"korrektur_$i"}) { |
769 | 930 |
($taxkey, $rate) = split(/--/, $form->{"taxchart_$i"}); |
... | ... | |
782 | 943 |
$form->{"tax_$i"} = 0; |
783 | 944 |
} |
784 | 945 |
} |
785 |
|
|
946 |
|
|
786 | 947 |
for (@flds) { $a[$j]->{$_} = $form->{"${_}_$i"} } |
787 | 948 |
$count++; |
788 | 949 |
} |
789 | 950 |
} |
790 | 951 |
|
791 |
|
|
792 | 952 |
for $i (1 .. $count) { |
793 | 953 |
$j = $i - 1; |
794 | 954 |
for (@flds) { $form->{"${_}_$i"} = $a[$j]->{$_} } |
... | ... | |
801 | 961 |
$form->{rowcount} = $count + 1; |
802 | 962 |
|
803 | 963 |
&display_form; |
804 |
|
|
805 |
} |
|
964 |
$lxdebug->leave_sub(); |
|
806 | 965 |
|
966 |
} |
|
807 | 967 |
|
808 | 968 |
sub display_form { |
809 | 969 |
my ($init) = @_; |
970 |
$lxdebug->enter_sub(); |
|
810 | 971 |
|
811 | 972 |
&form_header($init); |
812 |
# for $i (1 .. $form->{rowcount}) { |
|
813 |
# $form->{totaldebit} += $form->parse_amount(\%myconfig, $form->{"debit_$i"}); |
|
814 |
# $form->{totalcredit} += $form->parse_amount(\%myconfig, $form->{"credit_$i"}); |
|
815 |
# |
|
816 |
# &form_row($i); |
|
817 |
# } |
|
973 |
|
|
974 |
# for $i (1 .. $form->{rowcount}) { |
|
975 |
# $form->{totaldebit} += $form->parse_amount(\%myconfig, $form->{"debit_$i"}); |
|
976 |
# $form->{totalcredit} += $form->parse_amount(\%myconfig, $form->{"credit_$i"}); |
|
977 |
# |
|
978 |
# &form_row($i); |
|
979 |
# } |
|
818 | 980 |
&display_rows($init); |
819 | 981 |
&form_footer; |
982 |
$lxdebug->leave_sub(); |
|
820 | 983 |
|
821 | 984 |
} |
822 | 985 |
|
823 |
|
|
824 | 986 |
sub display_rows { |
825 | 987 |
my ($init) = @_; |
988 |
$lxdebug->enter_sub(); |
|
826 | 989 |
|
827 |
$form->{selectprojectnumber} = $form->unescape($form->{selectprojectnumber}) if $form->{selectprojectnumber}; |
|
828 |
|
|
829 |
$form->{totaldebit} = 0; |
|
990 |
$form->{selectprojectnumber} = $form->unescape($form->{selectprojectnumber}) |
|
991 |
if $form->{selectprojectnumber}; |
|
992 |
|
|
993 |
$form->{totaldebit} = 0; |
|
830 | 994 |
$form->{totalcredit} = 0; |
831 |
my $chart= $form->{chart}; |
|
832 |
$chart = $form->unquote($chart); |
|
995 |
my $chart = $form->{chart};
|
|
996 |
$chart = $form->unquote($chart);
|
|
833 | 997 |
$form->{taxchart} = $form->unquote($form->{taxchart}); |
834 |
$taxchart = $form->{taxchart}; |
|
998 |
$taxchart = $form->{taxchart};
|
|
835 | 999 |
for $i (1 .. $form->{rowcount}) { |
836 | 1000 |
|
837 | 1001 |
$source = qq| |
838 |
<td><input name="source_$i" value="$form->{"source_$i"}" tabindex=|.($i+11+(($i-1)*8)).qq|></td>|; |
|
1002 |
<td><input name="source_$i" value="$form->{"source_$i"}" tabindex=| |
|
1003 |
. ($i + 11 + (($i - 1) * 8)) |
|
1004 |
. qq|></td>|; |
|
839 | 1005 |
$memo = qq| |
840 |
<td><input name="memo_$i" value="$form->{"memo_$i"}" tabindex=|.($i+12+(($i-1)*8)).qq|></td>|; |
|
1006 |
<td><input name="memo_$i" value="$form->{"memo_$i"}" tabindex=| |
|
1007 |
. ($i + 12 + (($i - 1) * 8)) |
|
1008 |
. qq|></td>|; |
|
841 | 1009 |
|
842 | 1010 |
if ($init) { |
843 | 1011 |
$accno = qq| |
844 |
<td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:300px" tabindex=|.($i+5+(($i-1)*8)).qq|>$form->{chartinit}</select></td>|; |
|
845 |
$tax = qq|<td><select id="taxchart_$i" name="taxchart_$i" tabindex=|.($i+10+(($i-1)*8)).qq|>$form->{taxchart}</select></td>|; |
|
1012 |
<td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:300px" tabindex=| |
|
1013 |
. ($i + 5 + (($i - 1) * 8)) |
|
1014 |
. qq|>$form->{chartinit}</select></td>|; |
|
1015 |
$tax = |
|
1016 |
qq|<td><select id="taxchart_$i" name="taxchart_$i" tabindex=| |
|
1017 |
. ($i + 10 + (($i - 1) * 8)) |
|
1018 |
. qq|>$form->{taxchart}</select></td>|; |
|
846 | 1019 |
if ($form->{selectprojectnumber}) { |
847 |
$project = qq|
|
|
1020 |
$project = qq|
|
|
848 | 1021 |
<td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|; |
849 | 1022 |
} |
850 |
$korrektur = qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=|.($i+9+(($i-1)*8)).qq|></td>|; |
|
1023 |
$korrektur = |
|
1024 |
qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=| |
|
1025 |
. ($i + 9 + (($i - 1) * 8)) |
|
1026 |
. qq|></td>|; |
|
851 | 1027 |
if ($form->{transfer}) { |
852 |
$fx_transaction = qq|
|
|
1028 |
$fx_transaction = qq|
|
|
853 | 1029 |
<td><input name="fx_transaction_$i" class=checkbox type=checkbox value=1></td> |
854 | 1030 |
|; |
855 |
}
|
|
1031 |
}
|
|
856 | 1032 |
|
857 | 1033 |
} else { |
858 |
|
|
859 |
$form->{totaldebit} += $form->{"debit_$i"}; |
|
1034 |
|
|
1035 |
$form->{totaldebit} += $form->{"debit_$i"};
|
|
860 | 1036 |
$form->{totalcredit} += $form->{"credit_$i"}; |
861 | 1037 |
|
862 |
for (qw(debit credit tax)) { $form->{"${_}_$i"} = ($form->{"${_}_$i"}) ? $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) : "" } |
|
1038 |
for (qw(debit credit tax)) { |
|
1039 |
$form->{"${_}_$i"} = |
|
1040 |
($form->{"${_}_$i"}) |
|
1041 |
? $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) |
|
1042 |
: ""; |
|
1043 |
} |
|
863 | 1044 |
|
864 | 1045 |
if ($i < $form->{rowcount}) { |
865 |
|
|
866 |
$accno = $chart; |
|
1046 |
|
|
1047 |
$accno = $chart;
|
|
867 | 1048 |
$chart_selected = $form->{"accno_$i"}; |
868 |
$accno =~ s/value=\"$chart_selected\"/value=\"$chart_selected\" selected/; |
|
869 |
$accno = qq|<td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:300px" tabindex=|.($i+5+(($i-1)*8)).qq|>$accno</select></td>|; |
|
870 |
$tax = $taxchart; |
|
1049 |
$accno =~ |
|
1050 |
s/value=\"$chart_selected\"/value=\"$chart_selected\" selected/; |
|
1051 |
$accno = |
|
1052 |
qq|<td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:300px" tabindex=| |
|
1053 |
. ($i + 5 + (($i - 1) * 8)) |
|
1054 |
. qq|>$accno</select></td>|; |
|
1055 |
$tax = $taxchart; |
|
871 | 1056 |
$tax_selected = $form->{"taxchart_$i"}; |
872 |
$tax =~ s/value=\"$tax_selected\"/value=\"$tax_selected\" selected/; |
|
873 |
$tax = qq|<td><select id="taxchart_$i" name="taxchart_$i" tabindex=|.($i+10+(($i-1)*8)).qq|>$tax</select></td>|; |
|
874 |
if ($form->{selectprojectnumber}) { |
|
875 |
$form->{"projectnumber_$i"} = "" if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/; |
|
876 |
|
|
877 |
$project = $form->{"projectnumber_$i"}; |
|
878 |
$project =~ s/--.*//; |
|
879 |
$project = qq|<td>$project</td>|; |
|
880 |
} |
|
881 |
|
|
882 |
if ($form->{transfer}) { |
|
883 |
$checked = ($form->{"fx_transaction_$i"}) ? "1" : ""; |
|
884 |
$x = ($checked) ? "x" : ""; |
|
885 |
$fx_transaction = qq| |
|
1057 |
$tax =~ s/value=\"$tax_selected\"/value=\"$tax_selected\" selected/; |
|
1058 |
$tax = |
|
1059 |
qq|<td><select id="taxchart_$i" name="taxchart_$i" tabindex=| |
|
1060 |
. ($i + 10 + (($i - 1) * 8)) |
|
1061 |
. qq|>$tax</select></td>|; |
|
1062 |
|
|
1063 |
if ($form->{selectprojectnumber}) { |
|
1064 |
$form->{"projectnumber_$i"} = "" |
|
1065 |
if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/; |
|
1066 |
|
|
1067 |
$project = $form->{"projectnumber_$i"}; |
|
1068 |
$project =~ s/--.*//; |
|
1069 |
$project = qq|<td>$project</td>|; |
|
1070 |
} |
|
1071 |
|
|
1072 |
if ($form->{transfer}) { |
|
1073 |
$checked = ($form->{"fx_transaction_$i"}) ? "1" : ""; |
|
1074 |
$x = ($checked) ? "x" : ""; |
|
1075 |
$fx_transaction = qq| |
|
886 | 1076 |
<td><input type=hidden name="fx_transaction_$i" value="$checked">$x</td> |
887 | 1077 |
|; |
888 |
}
|
|
1078 |
}
|
|
889 | 1079 |
$checked = ($form->{"korrektur_$i"}) ? "checked" : ""; |
890 |
$korrektur = qq|<td><input type="checkbox" name="korrektur_$i" value="1" $checked tabindex=|.($i+9+(($i-1)*8)).qq|></td>|; |
|
891 |
$form->hide_form("accno_$i", "projectnumber_$i"); |
|
892 |
|
|
1080 |
$korrektur = |
|
1081 |
qq|<td><input type="checkbox" name="korrektur_$i" value="1" $checked tabindex=| |
|
1082 |
. ($i + 9 + (($i - 1) * 8)) |
|
1083 |
. qq|></td>|; |
|
1084 |
$form->hide_form("accno_$i", "projectnumber_$i"); |
|
1085 |
|
|
893 | 1086 |
} else { |
894 |
|
|
895 |
$accno = qq| |
|
896 |
<td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:300px" tabindex=|.($i+5+(($i-1)*8)).qq|>$chart</select></td>|; |
|
897 |
$tax = qq| |
|
898 |
<td><select id="taxchart_$i" name="taxchart_$i" tabindex=|.($i+10+(($i-1)*8)).qq|>$taxchart</select></td>|; |
|
899 |
if ($form->{selectprojectnumber}) { |
|
900 |
$project = qq| |
|
1087 |
|
|
1088 |
$accno = qq| |
|
1089 |
<td><select name="accno_$i" onChange="setTaxkey(this, $i)" style="width:300px" tabindex=| |
|
1090 |
. ($i + 5 + (($i - 1) * 8)) |
|
1091 |
. qq|>$chart</select></td>|; |
|
1092 |
$tax = qq| |
|
1093 |
<td><select id="taxchart_$i" name="taxchart_$i" tabindex=| |
|
1094 |
. ($i + 10 + (($i - 1) * 8)) |
|
1095 |
. qq|>$taxchart</select></td>|; |
|
1096 |
if ($form->{selectprojectnumber}) { |
|
1097 |
$project = qq| |
|
901 | 1098 |
<td><select name="projectnumber_$i">$form->{selectprojectnumber}</select></td>|; |
902 |
} |
|
903 |
$korrektur = qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=|.($i+9+(($i-1)*8)).qq|></td>|; |
|
904 |
if ($form->{transfer}) { |
|
905 |
$fx_transaction = qq| |
|
1099 |
} |
|
1100 |
$korrektur = |
|
1101 |
qq|<td><input type="checkbox" name="korrektur_$i" value="1" tabindex=| |
|
1102 |
. ($i + 9 + (($i - 1) * 8)) |
|
1103 |
. qq|></td>|; |
|
1104 |
if ($form->{transfer}) { |
|
1105 |
$fx_transaction = qq| |
|
906 | 1106 |
<td><input name="fx_transaction_$i" class=checkbox type=checkbox value=1></td> |
907 | 1107 |
|; |
908 |
}
|
|
1108 |
}
|
|
909 | 1109 |
} |
910 | 1110 |
} |
911 |
|
|
1111 |
|
|
912 | 1112 |
print qq|<tr valign=top> |
913 | 1113 |
$accno |
914 | 1114 |
$fx_transaction |
915 |
<td><input name="debit_$i" size=10 value="$form->{"debit_$i"}" accesskey=$i tabindex=|.($i+6+(($i-1)*8)).qq|></td> |
|
916 |
<td><input name="credit_$i" size=10 value="$form->{"credit_$i"}" tabindex=|.($i+7+(($i-1)*8)).qq|></td> |
|
917 |
<td><input name="tax_$i" size=8 value="$form->{"tax_$i"}" tabindex=|.($i+8+(($i-1)*8)).qq|></td> |
|
1115 |
<td><input name="debit_$i" size=10 value="$form->{"debit_$i"}" accesskey=$i tabindex=| |
|
1116 |
. ($i + 6 + (($i - 1) * 8)) |
|
1117 |
. qq|></td> |
|
1118 |
<td><input name="credit_$i" size=10 value="$form->{"credit_$i"}" tabindex=| |
|
1119 |
. ($i + 7 + (($i - 1) * 8)) |
|
1120 |
. qq|></td> |
|
1121 |
<td><input name="tax_$i" size=8 value="$form->{"tax_$i"}" tabindex=| |
|
1122 |
. ($i + 8 + (($i - 1) * 8)) |
|
1123 |
. qq|></td> |
|
918 | 1124 |
$korrektur |
919 | 1125 |
$tax |
920 | 1126 |
$source |
... | ... | |
927 | 1133 |
|
928 | 1134 |
$form->hide_form(qw(rowcount selectaccno)); |
929 | 1135 |
print qq| |
930 |
<input type=hidden name=selectprojectnumber value="|.$form->escape($form->{selectprojectnumber},1).qq|">|; |
|
1136 |
<input type=hidden name=selectprojectnumber value="| |
|
1137 |
. $form->escape($form->{selectprojectnumber}, 1) . qq|">|; |
|
1138 |
$lxdebug->leave_sub(); |
|
931 | 1139 |
|
932 | 1140 |
} |
933 | 1141 |
|
934 | 1142 |
sub form_header { |
935 | 1143 |
my ($init) = @_; |
936 |
$title = $form->{title}; |
|
1144 |
$lxdebug->enter_sub(); |
|
1145 |
$title = $form->{title}; |
|
937 | 1146 |
$form->{title} = $locale->text("$title General Ledger Transaction"); |
938 |
$readonly = ($form->{id}) ? "readonly" : ""; |
|
939 |
|
|
940 |
|
|
941 |
# $locale->text('Add General Ledger Transaction') |
|
942 |
# $locale->text('Edit General Ledger Transaction') |
|
1147 |
$readonly = ($form->{id}) ? "readonly" : ""; |
|
1148 |
|
|
1149 |
# $locale->text('Add General Ledger Transaction') |
|
1150 |
# $locale->text('Edit General Ledger Transaction') |
|
943 | 1151 |
|
944 |
map { $form->{$_} =~ s/\"/"/g } qw(reference description chart taxchart); |
|
1152 |
map { $form->{$_} =~ s/\"/"/g } |
|
1153 |
qw(reference description chart taxchart); |
|
945 | 1154 |
$form->{javascript} = qq|<script type="text/javascript"> |
946 | 1155 |
<!-- |
947 | 1156 |
function setTaxkey(accno, row) { |
... | ... | |
963 | 1172 |
</script>|; |
964 | 1173 |
|
965 | 1174 |
$form->{selectdepartment} =~ s/ selected//; |
966 |
$form->{selectdepartment} =~ s/option>\Q$form->{department}\E/option selected>$form->{department}/; |
|
1175 |
$form->{selectdepartment} =~ |
|
1176 |
s/option>\Q$form->{department}\E/option selected>$form->{department}/; |
|
967 | 1177 |
|
968 | 1178 |
if (($rows = $form->numtextrows($form->{description}, 50)) > 1) { |
969 |
$description = qq|<textarea name=description rows=$rows cols=50 wrap=soft $readonly >$form->{description}</textarea>|; |
|
1179 |
$description = |
|
1180 |
qq|<textarea name=description rows=$rows cols=50 wrap=soft $readonly >$form->{description}</textarea>|; |
|
970 | 1181 |
} else { |
971 |
$description = qq|<input name=description size=50 value="$form->{description}" tabindex="3" $readonly>|; |
|
1182 |
$description = |
|
1183 |
qq|<input name=description size=50 value="$form->{description}" tabindex="3" $readonly>|; |
|
972 | 1184 |
} |
973 |
|
|
1185 |
|
|
974 | 1186 |
$taxincluded = ($form->{taxincluded}) ? "checked" : ""; |
975 |
|
|
1187 |
|
|
976 | 1188 |
if ($init) { |
977 |
$taxincluded = "checked";
|
|
1189 |
$taxincluded = "checked";
|
|
978 | 1190 |
} |
979 |
|
|
980 |
$amount = qq|<input name=amount size=20 value="$form->{amount}" tabindex="4" $readonly>|;
|
|
981 |
|
|
982 |
|
|
1191 |
|
|
1192 |
$amount = |
|
1193 |
qq|<input name=amount size=20 value="$form->{amount}" tabindex="4" $readonly>|; |
|
1194 |
|
|
983 | 1195 |
$department = qq| |
984 | 1196 |
<tr> |
985 |
<th align=right nowrap>|.$locale->text('Department').qq|</th>
|
|
1197 |
<th align=right nowrap>| . $locale->text('Department') . qq|</th>
|
|
986 | 1198 |
<td colspan=3><select name=department>$form->{selectdepartment}</select></td> |
987 | 1199 |
<input type=hidden name=selectdepartment value="$form->{selectdepartment}"> |
988 | 1200 |
</tr> |
... | ... | |
992 | 1204 |
} else { |
993 | 1205 |
$form->{fokus} = qq|gl.accno_$form->{rowcount}|; |
994 | 1206 |
} |
995 |
|
|
1207 |
|
|
996 | 1208 |
# use JavaScript Calendar or not |
997 | 1209 |
$form->{jsscript} = $jscalendar; |
998 | 1210 |
$jsscript = ""; |
999 |
if ($form->{jsscript}) |
|
1000 |
{ |
|
1211 |
if ($form->{jsscript}) {
|
|
1212 |
|
|
1001 | 1213 |
# with JavaScript Calendar |
1002 | 1214 |
$button1 = qq| |
1003 | 1215 |
<td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate} tabindex="2" $readonly> |
1004 |
<input type=button name=transdate id="trigger1" value=|.$locale->text('button').qq|></td> |
|
1216 |
<input type=button name=transdate id="trigger1" value=| |
|
1217 |
. $locale->text('button') |
|
1218 |
. qq|></td> |
|
1005 | 1219 |
|; |
1006 |
#write Trigger |
|
1007 |
$jsscript = Form->write_trigger(\%myconfig,"1","transdate","BL","trigger1","","",""); |
|
1008 |
} |
|
1009 |
else |
|
1010 |
{ |
|
1011 |
# without JavaScript Calendar |
|
1012 |
$button1 = qq|<td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate} tabindex="2" $readonly></td>|; |
|
1013 |
} |
|
1014 |
|
|
1220 |
|
|
1221 |
#write Trigger |
|
1222 |
$jsscript = |
|
1223 |
Form->write_trigger(\%myconfig, "1", "transdate", "BL", "trigger1", "", |
|
1224 |
"", ""); |
|
1225 |
} else { |
|
1226 |
|
|
1227 |
# without JavaScript Calendar |
|
1228 |
$button1 = |
|
1229 |
qq|<td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate} tabindex="2" $readonly></td>|; |
|
1230 |
} |
|
1231 |
|
|
1015 | 1232 |
$form->header; |
1016 | 1233 |
|
1017 |
|
|
1018 | 1234 |
print qq| |
1019 | 1235 |
<body onLoad="fokus()"> |
1020 | 1236 |
|
... | ... | |
1038 | 1254 |
<td> |
1039 | 1255 |
<table width=100%> |
1040 | 1256 |
<tr> |
1041 |
<th align=right>|.$locale->text('Reference').qq|</th>
|
|
1257 |
<th align=right>| . $locale->text('Reference') . qq|</th>
|
|
1042 | 1258 |
<td><input name=reference size=20 value="$form->{reference}" tabindex="1" $readonly></td> |
1043 | 1259 |
<td align=left> |
1044 | 1260 |
<table width=100%> |
1045 | 1261 |
<tr> |
1046 |
<th align=right nowrap>|.$locale->text('Date').qq|</th>
|
|
1262 |
<th align=right nowrap>| . $locale->text('Date') . qq|</th>
|
|
1047 | 1263 |
$button1 |
1048 | 1264 |
</tr> |
1049 | 1265 |
</table> |
1050 | 1266 |
</td> |
1051 | 1267 |
</tr>|; |
1052 |
if ($form->{id}) { |
|
1053 |
print qq|
|
|
1268 |
if ($form->{id}) {
|
|
1269 |
print qq|
|
|
1054 | 1270 |
<tr> |
1055 |
<th align=right>|.$locale->text('Belegnummer').qq|</th>
|
|
1271 |
<th align=right>| . $locale->text('Belegnummer') . qq|</th>
|
|
1056 | 1272 |
<td><input name=id size=20 value="$form->{id}" $readonly></td> |
1057 | 1273 |
<td align=left> |
1058 | 1274 |
<table width=100%> |
1059 | 1275 |
<tr> |
1060 |
<th align=right width=50%>|.$locale->text('Buchungsdatum').qq|</th>
|
|
1276 |
<th align=right width=50%>| . $locale->text('Buchungsdatum') . qq|</th>
|
|
1061 | 1277 |
<td align=left><input name=gldate size=11 title="$myconfig{dateformat}" value=$form->{gldate} $readonly></td> |
1062 | 1278 |
</tr> |
1063 | 1279 |
</table> |
1064 | 1280 |
</td> |
1065 | 1281 |
</tr>|; |
1066 |
} |
|
1067 |
print qq| |
|
1282 |
} |
Auch abrufbar als: Unified diff
Perltidy Lauf der Aenderungen zu Splittbuchungen