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}>
|
Perltidy Lauf der Aenderungen zu Splittbuchungen