1 #=====================================================================
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
7 #=====================================================================
8 # SQL-Ledger Accounting
11 # Author: Dieter Simader
12 # Email: dsimader@sql-ledger.org
13 # Web: http://www.sql-ledger.org
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #======================================================================
30 # Accounts Receivables
32 #======================================================================
39 require "$form->{path}/arap.pl";
45 # this is for our long dates
46 # $locale->text('January')
47 # $locale->text('February')
48 # $locale->text('March')
49 # $locale->text('April')
50 # $locale->text('May ')
51 # $locale->text('June')
52 # $locale->text('July')
53 # $locale->text('August')
54 # $locale->text('September')
55 # $locale->text('October')
56 # $locale->text('November')
57 # $locale->text('December')
59 # this is for our short month
60 # $locale->text('Jan')
61 # $locale->text('Feb')
62 # $locale->text('Mar')
63 # $locale->text('Apr')
64 # $locale->text('May')
65 # $locale->text('Jun')
66 # $locale->text('Jul')
67 # $locale->text('Aug')
68 # $locale->text('Sep')
69 # $locale->text('Oct')
70 # $locale->text('Nov')
71 # $locale->text('Dec')
74 $lxdebug->enter_sub();
76 $form->{title} = "Add";
78 "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}"
79 unless $form->{callback};
84 $lxdebug->leave_sub();
88 $lxdebug->enter_sub();
90 $form->{title} = "Edit";
95 $lxdebug->leave_sub();
99 $lxdebug->enter_sub();
104 $lxdebug->leave_sub();
108 $lxdebug->enter_sub();
110 $form->create_links("AR", \%myconfig, "customer");
111 $duedate = $form->{duedate};
113 $taxincluded = $form->{taxincluded};
115 IS->get_customer(\%myconfig, \%$form);
117 $form->{duedate} = $duedate if $duedate;
118 $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
119 $form->{rowcount} = 1;
121 @curr = split /:/, $form->{currencies};
123 $form->{defaultcurrency} = $curr[0];
125 map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
128 if (@{ $form->{all_customer} }) {
129 $form->{customer} = "$form->{customer}--$form->{customer_id}";
130 map { $form->{selectcustomer} .= "<option>$_->{name}--$_->{id}\n" }
131 (@{ $form->{all_customer} });
135 if (@{ $form->{all_departments} }) {
136 $form->{selectdepartment} = "<option>\n";
137 $form->{department} = "$form->{department}--$form->{department_id}";
140 $form->{selectdepartment} .=
141 "<option>$_->{description}--$_->{id}\n"
142 } (@{ $form->{all_departments} });
145 $form->{employee} = "$form->{employee}--$form->{employee_id}";
148 if (@{ $form->{all_employees} }) {
149 $form->{selectemployee} = "";
150 map { $form->{selectemployee} .= "<option>$_->{name}--$_->{id}\n" }
151 (@{ $form->{all_employees} });
154 # build the popup menus
155 $form->{taxincluded} = ($form->{id}) ? $form->{taxincluded} : "checked";
159 qq|<option value=\"$_->{taxkey}--$_->{rate}\">$_->{taxdescription} |
160 . ($_->{rate} * 100) . qq| %|
162 $form->{taxchart} = $tax;
163 $form->{selecttaxchart} = $tax;
166 $form->{forex} = $form->{exchangerate};
167 $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
168 foreach $key (keys %{ $form->{AR_links} }) {
170 foreach $ref (@{ $form->{AR_links}{$key} }) {
171 if ($key eq "AR_paid") {
172 $form->{"select$key"} .=
173 "<option value=\"$ref->{accno}\">$ref->{accno}--$ref->{description}</option>\n";
175 $form->{"select$key"} .=
176 "<option value=\"$ref->{accno}--$ref->{taxkey}\">$ref->{accno}--$ref->{description}</option>\n";
180 $form->{$key} = $form->{"select$key"};
182 # if there is a value we have an old entry
185 print(STDERR Dumper($form->{acc_trans}));
186 for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
187 if ($key eq "AR_paid") {
189 $form->{"AR_paid_$j"} =
190 "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
193 $form->{"paid_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{amount} * -1;
194 $form->{"datepaid_$j"} =
195 $form->{acc_trans}{$key}->[$i - 1]->{transdate};
196 $form->{"source_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{source};
197 $form->{"memo_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{memo};
199 $form->{"forex_$j"} = $form->{"exchangerate_$i"} =
200 $form->{acc_trans}{$key}->[$i - 1]->{exchangerate};
201 $form->{"AR_paid_$j"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}";
202 $form->{paidaccounts}++;
208 if ($key eq "AR_tax") {
209 $form->{"${key}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} =
210 "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
211 $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} =
213 $form->{acc_trans}{$key}->[$i - 1]->{amount} / $exchangerate,
216 if ($form->{"$form->{acc_trans}{$key}->[$i-1]->{accno}_rate"} > 0) {
218 $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"};
220 $form->{"$form->{acc_trans}{$key}->[$i-1]->{accno}_rate"};
223 $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"};
225 $form->{"$form->{acc_trans}{$key}->[$i-1]->{accno}_rate"};
227 print(STDERR $form->{acc_trans}{$key}->[$i - 1]->{amount}, " ACC_TRANS\n");
228 print(STDERR "$key KEY, $k Zeile\n");
229 $index = $form->{acc_trans}{$key}->[$i - 1]->{index};
230 $form->{"tax_$index"} = $form->{acc_trans}{$key}->[$i - 1]->{amount};
234 $form->{"${akey}_$k"} =
236 $form->{acc_trans}{$key}->[$i - 1]->{amount} / $exchangerate,
238 if ($akey eq 'amount') {
240 $totalamount += $form->{"${akey}_$i"};
242 $form->{"oldprojectnumber_$k"} = $form->{"projectnumber_$k"} =
243 "$form->{acc_trans}{$key}->[$i-1]->{projectnumber}";
244 $form->{taxrate} = $form->{acc_trans}{$key}->[$i - 1]->{rate};
245 $form->{"project_id_$k"} =
246 "$form->{acc_trans}{$key}->[$i-1]->{project_id}";
248 $form->{"${key}_$k"} =
249 "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
250 $form->{"${key}_$i"} =
251 "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
252 $form->{"select${key}"} =~
253 /<option value=\"($form->{acc_trans}{$key}->[$i-1]->{accno}--[^\"]*)\">$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}<\/option>\n/;
255 $form->{"${key}_$k"} = $1;
256 if ($akey eq 'amount') {
257 $form->{"taxchart_$k"} = $form->{taxchart};
258 $form->{"taxchart_$k"} =~
259 /<option value=\"($form->{acc_trans}{$key}->[$i-1]->{taxkey}--[^\"]*)/;
260 $form->{"taxchart_$k"} = $1;
267 $form->{taxincluded} = $taxincluded if ($form->{id});
268 $form->{paidaccounts} = 1 if not defined $form->{paidaccounts};
270 if ($form->{taxincluded} && $form->{taxrate} && $totalamount) {
272 # add tax to amounts and invtotal
273 for $i (1 .. $form->{rowcount}) {
275 ($totaltax + $totalwithholding) * $form->{"amount_$i"} / $totalamount;
276 $tax = $form->round_amount($taxamount, 2);
277 $diff += ($taxamount - $tax);
278 $form->{"amount_$i"} += $tax;
280 $form->{amount_1} += $form->round_amount($diff, 2);
283 # check if calculated is equal to stored
284 if ($form->{taxincluded} && $form->{taxrate} && $withholdingrate) {
285 if ($form->{"taxrate"} > 0) {
288 ($form->{amount_1} - ($form->{amount_1} / ($form->{taxrate} + 1))),
293 ($totalamount + $totaltax + $totalwithholding) * $withholdingrate /
294 (1 - $withholdingrate),
296 ) * $form->{"taxrate"} / $withholdingrate;
299 $taxamount = $totalamount * $form->{"taxrate"};
301 $taxamount = $form->round_amount($taxamount, 2);
302 $form->{tax} = $taxamount;
304 $form->{invtotal} = $totalamount + $totaltax + $totalwithholding;
307 ($form->datetonum($form->{transdate}, \%myconfig) <=
308 $form->datetonum($form->{closedto}, \%myconfig));
310 $lxdebug->leave_sub();
314 $lxdebug->enter_sub();
316 $title = $form->{title};
317 $form->{title} = $locale->text("$title Accounts Receivables Transaction");
319 $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
321 # $locale->text('Add Accounts Receivables Transaction')
322 # $locale->text('Edit Accounts Receivables Transaction')
323 $form->{javascript} = qq|<script type="text/javascript">
325 function setTaxkey(accno, row) {
326 var taxkey = accno.options[accno.selectedIndex].value;
327 var reg = /--([0-9])*/;
328 var found = reg.exec(taxkey);
329 var index = found[1];
330 index = parseInt(index);
331 var tax = 'taxchart_' + row;
332 for (var i = 0; i < document.getElementById(tax).options.length; ++i) {
333 var reg2 = new RegExp("^"+ index, "");
334 if (reg2.exec(document.getElementById(tax).options[i].value)) {
335 document.getElementById(tax).options[i].selected = true;
343 $readonly = ($form->{id}) ? "readonly" : "";
346 ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
347 $readonly = ($form->{radier}) ? "" : $readonly;
349 # set option selected
350 foreach $item (qw(customer currency department employee)) {
351 $form->{"select$item"} =~ s/ selected//;
352 $form->{"select$item"} =~
353 s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
355 $selectAR_amount_unquoted = $form->{selectAR_amount};
356 $taxchart = $form->{taxchart};
357 map { $form->{$_} =~ s/\"/"/g } qw(AR_amount selectAR_amount AR taxchart);
360 $form->{exchangerate} =
361 $form->format_amount(\%myconfig, $form->{exchangerate});
363 $form->{creditlimit} =
364 $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
365 $form->{creditremaining} =
366 $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
369 <input type=hidden name=forex value=$form->{forex}>
371 if ($form->{currency} ne $form->{defaultcurrency}) {
372 if ($form->{forex}) {
374 <th align=right>| . $locale->text('Exchangerate') . qq|</th>
375 <td><input type=hidden name=exchangerate value=$form->{exchangerate}>$form->{exchangerate}</td>
379 <th align=right>| . $locale->text('Exchangerate') . qq|</th>
380 <td><input name=exchangerate size=10 value=$form->{exchangerate}></td>
389 <td align=right><input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}></td>
390 <th align=left nowrap>| . $locale->text('Tax Included') . qq|</th>
394 if (($rows = $form->numtextrows($form->{notes}, 50)) < 2) {
398 qq|<textarea name=notes rows=$rows cols=50 wrap=soft>$form->{notes}</textarea>|;
402 <th align="right" nowrap>| . $locale->text('Department') . qq|</th>
403 <td colspan=3><select name=department>$form->{selectdepartment}</select>
404 <input type=hidden name=selectdepartment value="$form->{selectdepartment}">
407 | if $form->{selectdepartment};
409 $n = ($form->{creditremaining} =~ /-/) ? "0" : "1";
412 ($form->{selectcustomer})
413 ? qq|<select name=customer>$form->{selectcustomer}</select>|
414 : qq|<input name=customer value="$form->{customer}" size=35>|;
417 <input type=hidden name=employee value="$form->{employee}">
420 if ($form->{selectemployee}) {
423 <th align=right nowrap>| . $locale->text('Salesperson') . qq|</th>
424 <td colspan=2><select name=employee>$form->{selectemployee}</select></td>
425 <input type=hidden name=selectemployee value="$form->{selectemployee}">
430 $form->{fokus} = "arledger.customer";
432 # use JavaScript Calendar or not
433 $form->{jsscript} = $jscalendar;
435 if ($form->{jsscript}) {
437 # with JavaScript Calendar
439 <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate}></td>
440 <td><input type=button name=transdate id="trigger1" value=|
441 . $locale->text('button')
445 <td><input name=duedate id=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>
446 <td><input type=button name=duedate id="trigger2" value=|
447 . $locale->text('button')
453 Form->write_trigger(\%myconfig, "2", "transdate", "BL", "trigger1",
454 "duedate", "BL", "trigger2");
457 # without JavaScript Calendar
459 qq|<td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value=$form->{transdate}></td>|;
461 qq|<td><input name=duedate id=duedate size=11 title="$myconfig{dateformat}" value=$form->{duedate}></td>|;
467 <body onLoad="fokus()">
469 <form method=post name="arledger" action=$form->{script}>
471 <input type=hidden name=id value=$form->{id}>
472 <input type=hidden name=sort value=$form->{sort}>
473 <input type=hidden name=closedto value=$form->{closedto}>
474 <input type=hidden name=locked value=$form->{locked}>
475 <input type=hidden name=title value="$title">
479 <th class=listtop>$form->{title}</th>
489 <th align="right" nowrap>| . $locale->text('Customer') . qq|</th>
490 <td colspan=3>$customer</td>
491 <input type=hidden name=selectcustomer value="$form->{selectcustomer}">
492 <input type=hidden name=oldcustomer value="$form->{oldcustomer}">
493 <input type=hidden name=customer_id value="$form->{customer_id}">
494 <input type=hidden name=terms value=$form->{terms}>
501 <th align=left nowrap>| . $locale->text('Credit Limit') . qq|</th>
502 <td>$form->{creditlimit}</td>
503 <th align=left nowrap>| . $locale->text('Remaining') . qq|</th>
504 <td class="plus$n">$form->{creditremaining}</td>
505 <input type=hidden name=creditlimit value=$form->{creditlimit}>
506 <input type=hidden name=creditremaining value=$form->{creditremaining}>
512 <th align=right>| . $locale->text('Currency') . qq|</th>
513 <td><select name=currency>$form->{selectcurrency}</select></td>
514 <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
515 <input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
516 <input type=hidden name=fxgain_accno value=$form->{fxgain_accno}>
517 <input type=hidden name=fxloss_accno value=$form->{fxloss_accno}>
528 <th align=right nowrap>| . $locale->text('Invoice Number') . qq|</th>
529 <td><input name=invnumber size=11 value="$form->{invnumber}"></td>
532 <th align=right nowrap>| . $locale->text('Order Number') . qq|</th>
533 <td><input name=ordnumber size=11 value="$form->{ordnumber}"></td>
536 <th align=right nowrap>| . $locale->text('Invoice Date') . qq|</th>
540 <th align=right nowrap>| . $locale->text('Due Date') . qq|</th>
551 <input type=hidden name=selectAR_amount value="$form->{selectAR_amount}">
552 <input type=hidden name=AR_amount value="$form->{AR_amount}">
553 <input type=hidden name=taxchart value="$form->{taxchart}">
554 <input type=hidden name=rowcount value=$form->{rowcount}>
558 <tr class=listheading>
559 <th class=listheading style="width:15%">|
560 . $locale->text('Account') . qq|</th>
561 <th class=listheading style="width:10%">|
562 . $locale->text('Amount') . qq|</th>
563 <th class=listheading style="width:10%">|
564 . $locale->text('Tax') . qq|</th>
565 <th class=listheading style="width:5%">|
566 . $locale->text('Korrektur') . qq|</th>
567 <th class=listheading style="width:10%">|
568 . $locale->text('Taxkey') . qq|</th>
569 <th class=listheading style="width:10%">|
570 . $locale->text('Project') . qq|</th>
576 $amount = $locale->text('Amount');
577 $project = $locale->text('Project');
579 for $i (1 .. $form->{rowcount}) {
582 $form->{"amount_$i"} = $form->format_amount(\%myconfig, $form->{"amount_$i"}, 2);
583 $form->{"tax_$i"} = $form->format_amount(\%myconfig, $form->{"tax_$i"}, 2);
584 $selectAR_amount = $selectAR_amount_unquoted;
585 $selectAR_amount =~ s/option value=\"$form->{"AR_amount_$i"}\"/option value=\"$form->{"AR_amount_$i"}\" selected/;
587 $tax_selected = $form->{"taxchart_$i"};
588 $tax =~ s/value=\"$tax_selected\"/value=\"$tax_selected\" selected/;
590 qq|<td><select id="taxchart_$i" name="taxchart_$i">$tax</select></td>|;
594 <td width=50%><select name="AR_amount_$i">$selectAR_amount</select></td>
595 <td><input name="amount_$i" onChange="setTaxkey(this, $i)" size=10 value=$form->{"amount_$i"}></td>
596 <td><input name="tax_$i" size=10 value=$form->{"tax_$i"}></td>
597 <td><input type="checkbox" name="korrektur_$i" value="1"></td>
599 <td><input name="projectnumber_$i" size=20 value="$form->{"projectnumber_$i"}">
600 <input type=hidden name="project_id_$i" value=$form->{"project_id_$i"}>
601 <input type=hidden name="oldprojectnumber_$i" value="$form->{"oldprojectnumber_$i"}"></td>
611 $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2);
620 <td><select name=ARselected>$form->{selectAR}</select></td>
621 <input type=hidden name=AR value="$form->{AR}">
622 <th align=left>$form->{invtotal}</th>
624 <input type=hidden name=oldinvtotal value=$form->{oldinvtotal}>
625 <input type=hidden name=oldtotalpaid value=$form->{oldtotalpaid}>
627 <input type=hidden name=taxaccounts value="$form->{taxaccounts}">
640 <th align=left width=1%>| . $locale->text('Notes') . qq|</th>
641 <td align=left>$notes</td>
649 <tr class=listheading>
650 <th colspan=6 class=listheading>|
651 . $locale->text('Incoming Payments')
656 if ($form->{currency} eq $form->{defaultcurrency}) {
657 @column_index = qw(datepaid source memo paid AR_paid);
659 @column_index = qw(datepaid source memo paid exchangerate AR_paid);
662 $column_data{datepaid} = "<th>" . $locale->text('Date') . "</th>";
663 $column_data{paid} = "<th>" . $locale->text('Amount') . "</th>";
664 $column_data{exchangerate} = "<th>" . $locale->text('Exch') . "</th>";
665 $column_data{AR_paid} = "<th>" . $locale->text('Account') . "</th>";
666 $column_data{source} = "<th>" . $locale->text('Source') . "</th>";
667 $column_data{memo} = "<th>" . $locale->text('Memo') . "</th>";
672 map { print "$column_data{$_}\n" } @column_index;
677 $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
678 for $i (1 .. $form->{paidaccounts}) {
683 $form->{"selectAR_paid_$i"} = $form->{selectAR_paid};
684 $form->{"selectAR_paid_$i"} =~
685 s/option value=\"$form->{"AR_paid_$i"}\">/option value=\"$form->{"AR_paid_$i"}\" selected>/;
689 $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
690 $form->{"exchangerate_$i"} =
691 $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
693 $exchangerate = qq| |;
694 if ($form->{currency} ne $form->{defaultcurrency}) {
695 if ($form->{"forex_$i"}) {
697 qq|<input type=hidden name="exchangerate_$i" value=$form->{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
700 qq|<input name="exchangerate_$i" size=10 value=$form->{"exchangerate_$i"}>|;
705 <input type=hidden name="forex_$i" value=$form->{"forex_$i"}>
709 qq|<td align=center><input name="paid_$i" size=11 value=$form->{"paid_$i"}></td>|;
710 $column_data{AR_paid} =
711 qq|<td align=center><select name="AR_paid_$i">$form->{"selectAR_paid_$i"}</select></td>|;
712 $column_data{exchangerate} = qq|<td align=center>$exchangerate</td>|;
713 $column_data{datepaid} =
714 qq|<td align=center><input name="datepaid_$i" size=11 value=$form->{"datepaid_$i"}></td>|;
715 $column_data{source} =
716 qq|<td align=center><input name="source_$i" size=11 value="$form->{"source_$i"}"></td>|;
718 qq|<td align=center><input name="memo_$i" size=11 value="$form->{"memo_$i"}"></td>|;
720 map { print qq|$column_data{$_}\n| } @column_index;
726 map { $form->{$_} =~ s/\"/"/g } qw(selectAR_paid);
728 <input type=hidden name=paidaccounts value=$form->{paidaccounts}>
729 <input type=hidden name=selectAR_paid value="$form->{selectAR_paid}">
735 <td><hr size=3 noshade></td>
740 $lxdebug->leave_sub();
744 $lxdebug->enter_sub();
748 <input name=callback type=hidden value="$form->{callback}">
750 <input type=hidden name=path value=$form->{path}>
751 <input type=hidden name=login value=$form->{login}>
752 <input type=hidden name=password value=$form->{password}>
757 $transdate = $form->datetonum($form->{transdate}, \%myconfig);
758 $closedto = $form->datetonum($form->{closedto}, \%myconfig);
760 if ($form->{id} && $form->{radier}) {
762 print qq|<input class=submit type=submit name=action value="|
763 . $locale->text('Update') . qq|">
766 if (!$form->{revtrans}) {
767 if (!$form->{locked}) {
769 <input class=submit type=submit name=action value="|
770 . $locale->text('Post') . qq|">
771 <input class=submit type=submit name=action value="|
772 . $locale->text('Delete') . qq|">
777 if ($transdate > $closedto) {
779 <input class=submit type=submit name=action value="|
780 . $locale->text('Post as new') . qq|">
785 if ($transdate > $closedto) {
786 print qq|<input class=submit type=submit name=action value="|
787 . $locale->text('Update') . qq|">
788 <input class=submit type=submit name=action value="|
789 . $locale->text('Post') . qq|">|;
793 if ($form->{menubar}) {
794 require "$form->{path}/menu.pl";
805 $lxdebug->leave_sub();
809 $lxdebug->enter_sub();
817 $form->{invtotal} = 0;
819 # $form->{selectAR_amount} = $form->{AR_amount};
820 # $form->{selectAR_amount} =~
821 # s/value=\"$form->{AR_amountselected}\"/value=\"$form->{AR_amountselected}\" selected/;
823 $form->{selectAR} = $form->{AR};
826 s/value=\"$form->{ARselected}\"/value=\"$form->{ARselected}\" selected/;
828 ($AR_amountaccno, $AR_amounttaxkey) =
829 split(/--/, $form->{AR_amountselected});
830 $form->{selecttaxchart} = $form->{taxchart};
831 $form->{selecttaxchart} =~
832 s/value=\"$AR_amounttaxkey--([^\"]*)\"/value=\"$AR_amounttaxkey--$1\" selected/;
836 map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
837 qw(exchangerate creditlimit creditremaining);
839 @flds = qw(amount AR_amount projectnumber oldprojectnumber project_id);
843 for $i (1 .. $form->{rowcount}) {
844 $form->{"amount_$i"} =
845 $form->parse_amount(\%myconfig, $form->{"amount_$i"});
847 $form->parse_amount(\%myconfig, $form->{"tax_$i"});
848 if ($form->{"amount_$i"}) {
851 if (!$form->{"korrektur_$i"}) {
852 ($taxkey, $rate) = split(/--/, $form->{"taxchart_$i"});
854 if ($form->{taxincluded}) {
855 $form->{"tax_$i"} = $form->{"amount_$i"} / ($rate + 1) * $rate;
857 $form->{"tax_$i"} = $form->{"amount_$i"} * $rate;
860 $form->{"tax_$i"} = 0;
863 $form->{"tax_$i"} = $form->round_amount($form->{"tax_$i"}, 2);
865 $totaltax += $form->{"tax_$i"};
866 map { $a[$j]->{$_} = $form->{"${_}_$i"} } @flds;
871 $form->redo_rows(\@flds, \@a, $count, $form->{rowcount});
872 $form->{rowcount} = $count + 1;
873 map { $form->{invtotal} += $form->{"amount_$_"} } (1 .. $form->{rowcount});
875 $form->{exchangerate} = $exchangerate
879 $form->check_exchangerate(
880 \%myconfig, $form->{currency}, $form->{transdate}, 'buy'
883 $form->{invdate} = $form->{transdate};
884 $save_AR = $form->{AR};
885 &check_name(customer);
886 $form->{AR} = $save_AR;
892 ($form->{taxincluded}) ? $form->{invtotal} : $form->{invtotal} + $totaltax;
894 for $i (1 .. $form->{paidaccounts}) {
895 if ($form->{"paid_$i"}) {
898 $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
899 } qw(paid exchangerate);
901 $totalpaid += $form->{"paid_$i"};
903 $form->{"exchangerate_$i"} = $exchangerate
905 $form->{"forex_$i"} = (
907 $form->check_exchangerate(
908 \%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy'
913 $form->{creditremaining} -=
914 ($form->{invtotal} - $totalpaid + $form->{oldtotalpaid} -
915 $form->{oldinvtotal});
916 $form->{oldinvtotal} = $form->{invtotal};
917 $form->{oldtotalpaid} = $totalpaid;
921 $lxdebug->leave_sub();
925 $lxdebug->enter_sub();
927 # check if there is an invoice number, invoice and due date
928 $form->isblank("transdate", $locale->text('Invoice Date missing!'));
929 $form->isblank("duedate", $locale->text('Due Date missing!'));
930 $form->isblank("customer", $locale->text('Customer missing!'));
932 $closedto = $form->datetonum($form->{closedto}, \%myconfig);
933 $transdate = $form->datetonum($form->{transdate}, \%myconfig);
935 $form->error($locale->text('Cannot post transaction for a closed period!'))
936 if ($transdate <= $closedto);
938 $form->isblank("exchangerate", $locale->text('Exchangerate missing!'))
939 if ($form->{currency} ne $form->{defaultcurrency});
943 for $i (1 .. $form->{paidaccounts}) {
944 if ($form->{"paid_$i"}) {
945 $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig);
947 $form->isblank("datepaid_$i", $locale->text('Payment date missing!'));
949 $form->error($locale->text('Cannot post payment for a closed period!'))
950 if ($datepaid <= $closedto);
952 if ($form->{currency} ne $form->{defaultcurrency}) {
953 $form->{"exchangerate_$i"} = $form->{exchangerate}
954 if ($transdate == $datepaid);
955 $form->isblank("exchangerate_$i",
956 $locale->text('Exchangerate for payment missing!'));
961 # if oldcustomer ne customer redo form
962 ($customer) = split /--/, $form->{customer};
963 if ($form->{oldcustomer} ne "$customer--$form->{customer_id}") {
968 ($creditaccno, $credittaxkey) = split /--/, $form->{AR_amountselected};
969 ($taxkey, $NULL) = split /--/, $form->{taxchartselected};
970 ($receivablesaccno, $payablestaxkey) = split /--/, $form->{ARselected};
971 $form->{AR}{amount_1} = $creditaccno;
972 $form->{AR}{receivables} = $receivablesaccno;
973 $form->{taxkey} = $taxkey;
975 $form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber")
976 unless $form->{invnumber};
978 $form->{id} = 0 if $form->{postasnew};
980 $form->redirect($locale->text('Transaction posted!'))
981 if (AR->post_transaction(\%myconfig, \%$form));
982 $form->error($locale->text('Cannot post transaction!'));
984 $lxdebug->leave_sub();
988 $lxdebug->enter_sub();
990 $form->{postasnew} = 1;
993 $lxdebug->leave_sub();
997 $lxdebug->enter_sub();
999 $form->{title} = $locale->text('Confirm!');
1003 delete $form->{header};
1008 <form method=post action=$form->{script}>
1011 foreach $key (keys %$form) {
1012 $form->{$key} =~ s/\"/"/g;
1013 print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
1017 <h2 class=confirm>$form->{title}</h2>
1020 . $locale->text('Are you sure you want to delete Transaction')
1021 . qq| $form->{invnumber}</h4>
1023 <input name=action class=submit type=submit value="|
1024 . $locale->text('Yes') . qq|">
1031 $lxdebug->leave_sub();
1035 $lxdebug->enter_sub();
1037 $form->redirect($locale->text('Transaction deleted!'))
1038 if (AR->delete_transaction(\%myconfig, \%$form, $spool));
1039 $form->error($locale->text('Cannot delete transaction!'));
1041 $lxdebug->leave_sub();
1045 $lxdebug->enter_sub();
1047 # setup customer selection
1048 $form->all_vc(\%myconfig, "customer", "AR");
1050 if (@{ $form->{all_customer} }) {
1051 map { $customer .= "<option>$_->{name}--$_->{id}\n" }
1052 @{ $form->{all_customer} };
1053 $customer = qq|<select name=customer><option>\n$customer</select>|;
1055 $customer = qq|<input name=customer size=35>|;
1059 if (@{ $form->{all_departments} }) {
1060 $form->{selectdepartment} = "<option>\n";
1063 $form->{selectdepartment} .=
1064 "<option>$_->{description}--$_->{id}\n"
1065 } (@{ $form->{all_departments} });
1070 <th align=right nowrap>| . $locale->text('Department') . qq|</th>
1071 <td colspan=3><select name=department>$form->{selectdepartment}</select></td>
1073 | if $form->{selectdepartment};
1075 $form->{title} = $locale->text('AR Transactions');
1077 # use JavaScript Calendar or not
1078 $form->{jsscript} = $jscalendar;
1080 if ($form->{jsscript}) {
1082 # with JavaScript Calendar
1084 <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}">
1085 <input type=button name=transdatefrom id="trigger1" value=|
1086 . $locale->text('button')
1090 <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}">
1091 <input type=button name=transdateto name=transdateto id="trigger2" value=|
1092 . $locale->text('button')
1098 Form->write_trigger(\%myconfig, "2", "transdatefrom", "BR", "trigger1",
1099 "transdateto", "BL", "trigger2");
1102 # without JavaScript Calendar
1104 <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>|;
1106 <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>|;
1109 $form->{fokus} = "search.customer";
1113 <body onLoad="fokus()">
1115 <form method=post name="search" action=$form->{script}>
1118 <tr><th class=listtop>$form->{title}</th></tr>
1119 <tr height="5"></tr>
1124 <th align=right>| . $locale->text('Customer') . qq|</th>
1125 <td colspan=3>$customer</td>
1129 <th align=right nowrap>| . $locale->text('Invoice Number') . qq|</th>
1130 <td colspan=3><input name=invnumber size=20></td>
1133 <th align=right nowrap>| . $locale->text('Order Number') . qq|</th>
1134 <td colspan=3><input name=ordnumber size=20></td>
1137 <th align=right nowrap>| . $locale->text('Notes') . qq|</th>
1138 <td colspan=3><input name=notes size=40></td>
1141 <th align=right nowrap>| . $locale->text('From') . qq|</th>
1143 <th align=right>| . $locale->text('Bis') . qq|</th>
1146 <input type=hidden name=sort value=transdate>
1154 <th align=right nowrap>| . $locale->text('Include in Report') . qq|</th>
1158 <td align=right><input name=open class=checkbox type=checkbox value=Y checked></td>
1159 <td nowrap>| . $locale->text('Open') . qq|</td>
1160 <td align=right><input name=closed class=checkbox type=checkbox value=Y></td>
1161 <td nowrap>| . $locale->text('Closed') . qq|</td>
1164 <td align=right><input name="l_id" class=checkbox type=checkbox value=Y></td>
1165 <td nowrap>| . $locale->text('ID') . qq|</td>
1166 <td align=right><input name="l_invnumber" class=checkbox type=checkbox value=Y checked></td>
1167 <td nowrap>| . $locale->text('Invoice Number') . qq|</td>
1168 <td align=right><input name="l_ordnumber" class=checkbox type=checkbox value=Y></td>
1169 <td nowrap>| . $locale->text('Order Number') . qq|</td>
1170 <td align=right><input name="l_transdate" class=checkbox type=checkbox value=Y checked></td>
1171 <td nowrap>| . $locale->text('Invoice Date') . qq|</td>
1174 <td align=right><input name="l_name" class=checkbox type=checkbox value=Y checked></td>
1175 <td nowrap>| . $locale->text('Customer') . qq|</td>
1176 <td align=right><input name="l_netamount" class=checkbox type=checkbox value=Y></td>
1177 <td nowrap>| . $locale->text('Amount') . qq|</td>
1178 <td align=right><input name="l_tax" class=checkbox type=checkbox value=Y></td>
1179 <td nowrap>| . $locale->text('Tax') . qq|</td>
1180 <td align=right><input name="l_amount" class=checkbox type=checkbox value=Y checked></td>
1181 <td nowrap>| . $locale->text('Total') . qq|</td>
1184 <td align=right><input name="l_datepaid" class=checkbox type=checkbox value=Y></td>
1185 <td nowrap>| . $locale->text('Date Paid') . qq|</td>
1186 <td align=right><input name="l_paid" class=checkbox type=checkbox value=Y checked></td>
1187 <td nowrap>| . $locale->text('Paid') . qq|</td>
1188 <td align=right><input name="l_duedate" class=checkbox type=checkbox value=Y></td>
1189 <td nowrap>| . $locale->text('Due Date') . qq|</td>
1190 <td align=right><input name="l_due" class=checkbox type=checkbox value=Y></td>
1191 <td nowrap>| . $locale->text('Amount Due') . qq|</td>
1194 <td align=right><input name="l_notes" class=checkbox type=checkbox value=Y></td>
1195 <td nowrap>| . $locale->text('Notes') . qq|</td>
1196 <td align=right><input name="l_employee" class=checkbox type=checkbox value=Y></td>
1197 <td nowrap>| . $locale->text('Salesperson') . qq|</td>
1198 <td align=right><input name="l_shippingpoint" class=checkbox type=checkbox value=Y></td>
1199 <td nowrap>| . $locale->text('Shipping Point') . qq|</td>
1200 <td align=right><input name="l_shipvia" class=checkbox type=checkbox value=Y></td>
1201 <td nowrap>| . $locale->text('Ship via') . qq|</td>
1204 <td align=right><input name="l_subtotal" class=checkbox type=checkbox value=Y></td>
1205 <td nowrap>| . $locale->text('Subtotal') . qq|</td>
1214 <td><hr size=3 noshade></td>
1218 <input type=hidden name=nextsub value=$form->{nextsub}>
1220 <input type=hidden name=path value=$form->{path}>
1221 <input type=hidden name=login value=$form->{login}>
1222 <input type=hidden name=password value=$form->{password}>
1225 <input class=submit type=submit name=action value="|
1226 . $locale->text('Continue') . qq|">
1237 $lxdebug->leave_sub();
1240 sub ar_transactions {
1241 $lxdebug->enter_sub();
1243 $form->{customer} = $form->unescape($form->{customer});
1244 ($form->{customer}, $form->{customer_id}) = split(/--/, $form->{customer});
1246 AR->ar_transactions(\%myconfig, \%$form);
1249 "$form->{script}?action=ar_transactions&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1252 if ($form->{customer}) {
1253 $callback .= "&customer=" . $form->escape($form->{customer}, 1);
1254 $href .= "&customer=" . $form->escape($form->{customer});
1255 $option = $locale->text('Customer') . " : $form->{customer}";
1257 if ($form->{department}) {
1258 $callback .= "&department=" . $form->escape($form->{department}, 1);
1259 $href .= "&department=" . $form->escape($form->{department});
1260 ($department) = split /--/, $form->{department};
1261 $option .= "\n<br>" if ($option);
1262 $option .= $locale->text('Department') . " : $department";
1264 if ($form->{invnumber}) {
1265 $callback .= "&invnumber=" . $form->escape($form->{invnumber}, 1);
1266 $href .= "&invnumber=" . $form->escape($form->{invnumber});
1267 $option .= "\n<br>" if ($option);
1268 $option .= $locale->text('Invoice Number') . " : $form->{invnumber}";
1270 if ($form->{ordnumber}) {
1271 $callback .= "&ordnumber=" . $form->escape($form->{ordnumber}, 1);
1272 $href .= "&ordnumber=" . $form->escape($form->{ordnumber});
1273 $option .= "\n<br>" if ($option);
1274 $option .= $locale->text('Order Number') . " : $form->{ordnumber}";
1276 if ($form->{notes}) {
1277 $callback .= "¬es=" . $form->escape($form->{notes}, 1);
1278 $href .= "¬es=" . $form->escape($form->{notes});
1279 $option .= "\n<br>" if $option;
1280 $option .= $locale->text('Notes') . " : $form->{notes}";
1283 if ($form->{transdatefrom}) {
1284 $callback .= "&transdatefrom=$form->{transdatefrom}";
1285 $href .= "&transdatefrom=$form->{transdatefrom}";
1286 $option .= "\n<br>" if ($option);
1288 $locale->text('From') . " "
1289 . $locale->date(\%myconfig, $form->{transdatefrom}, 1);
1291 if ($form->{transdateto}) {
1292 $callback .= "&transdateto=$form->{transdateto}";
1293 $href .= "&transdateto=$form->{transdateto}";
1294 $option .= "\n<br>" if ($option);
1296 $locale->text('Bis') . " "
1297 . $locale->date(\%myconfig, $form->{transdateto}, 1);
1299 if ($form->{open}) {
1300 $callback .= "&open=$form->{open}";
1301 $href .= "&open=$form->{open}";
1302 $option .= "\n<br>" if ($option);
1303 $option .= $locale->text('Open');
1305 if ($form->{closed}) {
1306 $callback .= "&closed=$form->{closed}";
1307 $href .= "&closed=$form->{closed}";
1308 $option .= "\n<br>" if ($option);
1309 $option .= $locale->text('Closed');
1313 $form->sort_columns(
1314 qw(transdate id invnumber ordnumber name netamount tax amount paid datepaid due duedate notes employee shippingpoint shipvia)
1317 foreach $item (@columns) {
1318 if ($form->{"l_$item"} eq "Y") {
1319 push @column_index, $item;
1321 # add column to href and callback
1322 $callback .= "&l_$item=Y";
1323 $href .= "&l_$item=Y";
1327 if ($form->{l_subtotal} eq 'Y') {
1328 $callback .= "&l_subtotal=Y";
1329 $href .= "&l_subtotal=Y";
1332 $column_header{id} =
1333 "<th><a class=listheading href=$href&sort=id>"
1334 . $locale->text('ID')
1336 $column_header{transdate} =
1337 "<th><a class=listheading href=$href&sort=transdate>"
1338 . $locale->text('Date')
1340 $column_header{duedate} =
1341 "<th><a class=listheading href=$href&sort=duedate>"
1342 . $locale->text('Due Date')
1344 $column_header{invnumber} =
1345 "<th><a class=listheading href=$href&sort=invnumber>"
1346 . $locale->text('Invoice')
1348 $column_header{ordnumber} =
1349 "<th><a class=listheading href=$href&sort=ordnumber>"
1350 . $locale->text('Order')
1352 $column_header{name} =
1353 "<th><a class=listheading href=$href&sort=name>"
1354 . $locale->text('Customer')
1356 $column_header{netamount} =
1357 "<th class=listheading>" . $locale->text('Amount') . "</th>";
1358 $column_header{tax} =
1359 "<th class=listheading>" . $locale->text('Tax') . "</th>";
1360 $column_header{amount} =
1361 "<th class=listheading>" . $locale->text('Total') . "</th>";
1362 $column_header{paid} =
1363 "<th class=listheading>" . $locale->text('Paid') . "</th>";
1364 $column_header{datepaid} =
1365 "<th><a class=listheading href=$href&sort=datepaid>"
1366 . $locale->text('Date Paid')
1368 $column_header{due} =
1369 "<th class=listheading>" . $locale->text('Amount Due') . "</th>";
1370 $column_header{notes} =
1371 "<th class=listheading>" . $locale->text('Notes') . "</th>";
1372 $column_header{employee} =
1373 "<th><a class=listheading href=$href&sort=employee>"
1374 . $locale->text('Salesperson') . "</th>";
1376 $column_header{shippingpoint} =
1377 "<th><a class=listheading href=$href&sort=shippingpoint>"
1378 . $locale->text('Shipping Point')
1380 $column_header{shipvia} =
1381 "<th><a class=listheading href=$href&sort=shipvia>"
1382 . $locale->text('Ship via')
1385 $form->{title} = $locale->text('AR Transactions');
1394 <th class=listtop>$form->{title}</th>
1396 <tr height="5"></tr>
1403 <tr class=listheading>
1406 map { print "\n$column_header{$_}" } @column_index;
1412 # add sort and escape callback, this one we use for the add sub
1413 $form->{callback} = $callback .= "&sort=$form->{sort}";
1415 # escape callback for href
1416 $callback = $form->escape($callback);
1418 if (@{ $form->{AR} }) {
1419 $sameitem = $form->{AR}->[0]->{ $form->{sort} };
1422 # sums and tax on reports by Antonio Gallardo
1424 foreach $ar (@{ $form->{AR} }) {
1426 if ($form->{l_subtotal} eq 'Y') {
1427 if ($sameitem ne $ar->{ $form->{sort} }) {
1432 $column_data{netamount} =
1434 . $form->format_amount(\%myconfig, $ar->{netamount}, 2, " ")
1436 $column_data{tax} = "<td align=right>"
1437 . $form->format_amount(\%myconfig, $ar->{amount} - $ar->{netamount},
1440 $column_data{amount} =
1442 . $form->format_amount(\%myconfig, $ar->{amount}, 2, " ") . "</td>";
1443 $column_data{paid} =
1445 . $form->format_amount(\%myconfig, $ar->{paid}, 2, " ") . "</td>";
1446 $column_data{due} = "<td align=right>"
1447 . $form->format_amount(\%myconfig, $ar->{amount} - $ar->{paid},
1451 $subtotalnetamount += $ar->{netamount};
1452 $subtotalamount += $ar->{amount};
1453 $subtotalpaid += $ar->{paid};
1454 $subtotaldue += $ar->{amount} - $ar->{paid};
1456 $totalnetamount += $ar->{netamount};
1457 $totalamount += $ar->{amount};
1458 $totalpaid += $ar->{paid};
1459 $totaldue += ($ar->{amount} - $ar->{paid});
1461 $column_data{transdate} = "<td>$ar->{transdate} </td>";
1462 $column_data{id} = "<td>$ar->{id}</td>";
1463 $column_data{datepaid} = "<td>$ar->{datepaid} </td>";
1464 $column_data{duedate} = "<td>$ar->{duedate} </td>";
1466 $module = ($ar->{invoice}) ? "is.pl" : $form->{script};
1468 $column_data{invnumber} =
1469 "<td><a href=$module?action=edit&id=$ar->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ar->{invnumber}</a></td>";
1470 $column_data{ordnumber} = "<td>$ar->{ordnumber} </td>";
1471 $column_data{name} = "<td>$ar->{name}</td>";
1472 $ar->{notes} =~ s/\r\n/<br>/g;
1473 $column_data{notes} = "<td>$ar->{notes} </td>";
1474 $column_data{shippingpoint} = "<td>$ar->{shippingpoint} </td>";
1475 $column_data{shipvia} = "<td>$ar->{shipvia} </td>";
1476 $column_data{employee} = "<td>$ar->{employee} </td>";
1481 <tr class=listrow$i>
1484 map { print "\n$column_data{$_}" } @column_index;
1492 if ($form->{l_subtotal} eq 'Y') {
1498 <tr class=listtotal>
1501 map { $column_data{$_} = "<td> </td>" } @column_index;
1503 $column_data{netamount} =
1504 "<th class=listtotal align=right>"
1505 . $form->format_amount(\%myconfig, $totalnetamount, 2, " ") . "</th>";
1506 $column_data{tax} = "<th class=listtotal align=right>"
1507 . $form->format_amount(\%myconfig, $totalamount - $totalnetamount,
1510 $column_data{amount} =
1511 "<th class=listtotal align=right>"
1512 . $form->format_amount(\%myconfig, $totalamount, 2, " ") . "</th>";
1513 $column_data{paid} =
1514 "<th class=listtotal align=right>"
1515 . $form->format_amount(\%myconfig, $totalpaid, 2, " ") . "</th>";
1517 "<th class=listtotal align=right>"
1518 . $form->format_amount(\%myconfig, $totaldue, 2, " ") . "</th>";
1520 map { print "\n$column_data{$_}" } @column_index;
1528 <td><hr size=3 noshade></td>
1533 <form method=post action=$form->{script}>
1535 <input name=callback type=hidden value="$form->{callback}">
1537 <input type=hidden name=path value=$form->{path}>
1538 <input type=hidden name=login value=$form->{login}>
1539 <input type=hidden name=password value=$form->{password}>
1541 <input class=submit type=submit name=action value="|
1542 . $locale->text('AR Transaction') . qq|">
1543 <input class=submit type=submit name=action value="|
1544 . $locale->text('Sales Invoice') . qq|">|;
1546 if ($form->{menubar}) {
1547 require "$form->{path}/menu.pl";
1558 $lxdebug->leave_sub();
1562 $lxdebug->enter_sub();
1564 map { $column_data{$_} = "<td> </td>" } @column_index;
1566 $column_data{tax} = "<th class=listsubtotal align=right>"
1567 . $form->format_amount(\%myconfig, $subtotalamount - $subtotalnetamount,
1570 $column_data{amount} =
1571 "<th class=listsubtotal align=right>"
1572 . $form->format_amount(\%myconfig, $subtotalamount, 2, " ") . "</th>";
1573 $column_data{paid} =
1574 "<th class=listsubtotal align=right>"
1575 . $form->format_amount(\%myconfig, $subtotalpaid, 2, " ") . "</th>";
1577 "<th class=listsubtotal align=right>"
1578 . $form->format_amount(\%myconfig, $subtotaldue, 2, " ") . "</th>";
1580 $subtotalnetamount = 0;
1581 $subtotalamount = 0;
1585 $sameitem = $ar->{ $form->{sort} };
1587 print "<tr class=listsubtotal>";
1589 map { print "\n$column_data{$_}" } @column_index;
1595 $lxdebug->leave_sub();