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 #======================================================================
 
  32 #======================================================================
 
  39 require "bin/mozilla/arap.pl";
 
  40 require "bin/mozilla/common.pl";
 
  47   $lxdebug->enter_sub();
 
  49   $form->{ARAP} = ($form->{type} eq 'receipt') ? "AR" : "AP";
 
  50   $form->{arap} = lc $form->{ARAP};
 
  52   # setup customer/vendor selection for open invoices
 
  53   if ($form->{all_vc}) {
 
  54     $form->all_vc(\%myconfig, $form->{vc}, $form->{ARAP});
 
  56     CP->get_openvc(\%myconfig, \%$form);
 
  59   $form->{"select$form->{vc}"} = "";
 
  61   if ($form->{"all_$form->{vc}"}) {
 
  62     $form->{"$form->{vc}_id"} = $form->{"all_$form->{vc}"}->[0]->{id};
 
  63     map { $form->{"select$form->{vc}"} .= "<option>$_->{name}--$_->{id}\n" }
 
  64       @{ $form->{"all_$form->{vc}"} };
 
  68   if (@{ $form->{all_departments} }) {
 
  69     $form->{selectdepartment} = "<option>\n";
 
  70     $form->{department}       = "$form->{department}--$form->{department_id}";
 
  73       $form->{selectdepartment} .=
 
  74         "<option>$_->{description}--$_->{id}\n"
 
  75     } (@{ $form->{all_departments} });
 
  78   CP->paymentaccounts(\%myconfig, \%$form);
 
  80   $form->{selectaccount} = "";
 
  81   $form->{"select$form->{ARAP}"} = "";
 
  83   map { $form->{selectaccount} .= "<option>$_->{accno}--$_->{description}\n" }
 
  84     @{ $form->{PR}{"$form->{ARAP}_paid"} };
 
  86     $form->{"select$form->{ARAP}"} .=
 
  87       "<option>$_->{accno}--$_->{description}\n"
 
  88   } @{ $form->{PR}{ $form->{ARAP} } };
 
  91   @curr = split(/:/, $form->{currencies});
 
  93   $form->{defaultcurrency} = $form->{currency} = $form->{oldcurrency} =
 
  96   $form->{selectcurrency} = "";
 
  97   map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
 
  99   $form->{media} = "screen";
 
 104   $lxdebug->leave_sub();
 
 108   $lxdebug->enter_sub();
 
 110   $vclabel = ucfirst $form->{vc};
 
 111   $vclabel = $locale->text($vclabel);
 
 113   if ($form->{type} eq 'receipt') {
 
 114     $form->{title}     = $locale->text('Receipt');
 
 115     $form->{origtitle} = "Receipt";
 
 117   if ($form->{type} eq 'check') {
 
 118     $form->{title}     = $locale->text('Payment');
 
 119     $form->{origtitle} = "Payment";
 
 122   # $locale->text('Customer')
 
 123   # $locale->text('Vendor')
 
 125   if ($form->{ $form->{vc} } eq "") {
 
 126     map { $form->{"addr$_"} = "" } (1 .. 4);
 
 129   if ($form->{currency} ne $form->{defaultcurrency}) {
 
 130     $form->{exchangerate} =
 
 131       $form->format_amount(\%myconfig, $form->{exchangerate});
 
 132     if ($form->{forex}) {
 
 135                 <th align=right nowrap>| . $locale->text('Exchangerate') . qq|</th>
 
 136                 <td colspan=3><input type=hidden name=exchangerate size=10 value=$form->{exchangerate}>$form->{exchangerate}</td>
 
 142                 <th align=right nowrap>| . $locale->text('Exchangerate') . qq|</th>
 
 143                 <td colspan=3><input name=exchangerate size=10 value=$form->{exchangerate}></td>
 
 149   foreach $item ($form->{vc}, account, currency, $form->{ARAP}, department) {
 
 150     $form->{"select$item"} =~ s/ selected//;
 
 151     $form->{"select$item"} =~
 
 152       s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
 
 156     ($form->{"select$form->{vc}"})
 
 157     ? qq|<select name=$form->{vc}>$form->{"select$form->{vc}"}\n</select>|
 
 158     : qq|<input name=$form->{vc} size=35 value="$form->{$form->{vc}}">|;
 
 160   if ($form->{all_vc}) {
 
 162     $form->{openinvoices} = "";
 
 165     $form->{openinvoices} = 1;
 
 168   # $locale->text('AR')
 
 169   # $locale->text('AP')
 
 173                 <th align="right" nowrap>| . $locale->text('Department') . qq|</th>
 
 174                 <td><select name=department>$form->{selectdepartment}</select>
 
 175                 <input type=hidden name=selectdepartment value="$form->{selectdepartment}">
 
 179 | if $form->{selectdepartment};
 
 181   $form->{jsscript} = $jscalendar;
 
 183   if ($form->{jsscript}) {
 
 185     # with JavaScript Calendar
 
 187        <td><input name=datepaid id=datepaid size=11 title="$myconfig{dateformat}" value="$form->{datepaid}" onBlur=\"check_right_date_format(this)\">
 
 188        <input type=button name=datepaid id="trigger1" value=|
 
 189       . $locale->text('button') . qq|></td>
 
 194       Form->write_trigger(\%myconfig, "1", "datepaid", "BL", "trigger1");
 
 197     # without JavaScript Calendar
 
 199                               <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\"></td>|;
 
 201   $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
 
 204   $arap = lc $form->{ARAP};
 
 205   $onload = qq|focus()|;
 
 206   $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
 
 207   $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
 
 209 <body onLoad="$onload">
 
 211 <form method=post action=$form->{script}>
 
 213 <input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
 
 214 <input type=hidden name=closedto value=$form->{closedto}>
 
 215 <input type=hidden name=vc value=$form->{vc}>
 
 216 <input type=hidden name=type value=$form->{type}>
 
 217 <input type=hidden name=formname value=$form->{type}>
 
 218 <input type=hidden name=queued value="$form->{queued}">
 
 219 <input type=hidden name=arap value=$arap>
 
 220 <input type=hidden name=ARAP value=$form->{ARAP}>
 
 221 <input type=hidden name=openinvoices value=$form->{openinvoices}>
 
 222 <input type=hidden name=title value="$form->{title}">
 
 223 <input type=hidden name=origtitle value="$form->{origtitle}">
 
 227     <th class=listtop>$form->{title}</th>
 
 238                 <input name=all_vc type=checkbox style=checkbox value=Y $allvc>
 
 239                 <input type=hidden name="oldall_vc" value="$form->{all_vc}"></td>
 
 240                 <th align=left>| . $locale->text('All') . qq|</th>
 
 243                 <th align=right>$vclabel</th>
 
 245                 <input type=hidden name="select$form->{vc}" value="$form->{"select$form->{vc}"}">
 
 246                 <input type=hidden name="$form->{vc}_id" value=$form->{"$form->{vc}_id"}>
 
 247                 <input type=hidden name="old$form->{vc}" value="$form->{"old$form->{vc}"}">
 
 250                 <th align=right nowrap>| . $locale->text('Address') . qq|</th>
 
 254                       <td>$form->{street}</td>
 
 257                       <td>$form->{zipcode}</td>
 
 260                       <td>$form->{city}</td>
 
 263                       <td>$form->{country}</td>
 
 267                 <input type=hidden name=street value="$form->{street}">
 
 268                 <input type=hidden name=zipcode value="$form->{zipcode}">
 
 269                 <input type=hidden name=city value="$form->{city}">
 
 270                 <input type=hidden name=country value="$form->{country}">
 
 273                 <th align=right>| . $locale->text('Memo') . qq|</th>
 
 274                 <td colspan=2><input name="memo" size=30 value="$form->{memo}"></td>
 
 282                 <th align=right nowrap>| . $locale->text($form->{ARAP}) . qq|</th>
 
 283                 <td colspan=3><select name=$form->{ARAP}>$form->{"select$form->{ARAP}"}</select>
 
 285                 <input type=hidden name="select$form->{ARAP}" value="$form->{"select$form->{ARAP}"}">
 
 288                 <th align=right nowrap>| . $locale->text('Account') . qq|</th>
 
 289                 <td colspan=3><select name=account>$form->{selectaccount}</select>
 
 290                 <input type=hidden name=selectaccount value="$form->{selectaccount}">
 
 294                 <th align=right nowrap>| . $locale->text('Date') . qq|</th>
 
 298                 <th align=right nowrap>| . $locale->text('Currency') . qq|</th>
 
 299                 <td><select name=currency>$form->{selectcurrency}</select></td>
 
 300                 <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
 
 301                 <input type=hidden name=oldcurrency value=$form->{oldcurrency}>
 
 305                 <th align=right nowrap>| . $locale->text('Source') . qq|</th>
 
 306                 <td colspan=3><input name=source value="$form->{source}" size=10></td>
 
 309                 <th align=right nowrap>| . $locale->text('Amount') . qq|</th>
 
 310                 <td colspan=3><input name=amount size=10 value=|
 
 311     . $form->format_amount(\%myconfig, $form->{amount}, 2) . qq| onBlur=\"check_right_number_format(this)\"></td>
 
 323   $lxdebug->leave_sub();
 
 327   $lxdebug->enter_sub();
 
 329   @column_index = qw(invnumber transdate amount due checked paid);
 
 331   $colspan = $#column_index + 1;
 
 333   $invoice = $locale->text('Invoices');
 
 336   <input type=hidden name=column_index value="id @column_index">
 
 341           <th class=listheading colspan=$colspan>$invoice</th>
 
 345   $column_data{invnumber} =
 
 346     qq|<th nowrap class=listheading>| . $locale->text('Invoice') . "</th>";
 
 347   $column_data{transdate} =
 
 348     qq|<th nowrap class=listheading>| . $locale->text('Date') . "</th>";
 
 349   $column_data{amount} =
 
 350     qq|<th nowrap class=listheading>| . $locale->text('Amount') . "</th>";
 
 352     qq|<th nowrap class=listheading>| . $locale->text('Due') . "</th>";
 
 354     qq|<th nowrap class=listheading>| . $locale->text('Amount') . "</th>";
 
 355   $column_data{checked} =
 
 356     qq|<th nowrap class=listheading>| . $locale->text('Select') . "</th>";
 
 361   map { print "$column_data{$_}\n" } @column_index;
 
 366   for $i (1 .. $form->{rowcount}) {
 
 370         $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
 
 371     } qw(amount due paid);
 
 373     $totalamount += $form->{"amount_$i"};
 
 374     $totaldue    += $form->{"due_$i"};
 
 375     $totalpaid   += $form->{"paid_$i"};
 
 379         $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2)
 
 380     } qw(amount due paid);
 
 382     $column_data{invnumber} = qq|<td>$form->{"invnumber_$i"}</td>
 
 383       <input type=hidden name="invnumber_$i" value="$form->{"invnumber_$i"}">
 
 384       <input type=hidden name="id_$i" value=$form->{"id_$i"}>|;
 
 385     $column_data{transdate} = qq|<td width=15%>$form->{"transdate_$i"}</td>
 
 386       <input type=hidden name="transdate_$i" value=$form->{"transdate_$i"}>|;
 
 387     $column_data{amount} =
 
 388       qq|<td align=right width=15%>$form->{"amount_$i"}</td>
 
 389       <input type=hidden name="amount_$i" value=$form->{"amount_$i"}>|;
 
 390     $column_data{due} = qq|<td align=right width=15%>$form->{"due_$i"}</td>
 
 391       <input type=hidden name="due_$i" value=$form->{"due_$i"}>|;
 
 394       qq|<td align=right width=15%><input name="paid_$i" size=10 value=$form->{"paid_$i"}></td>|;
 
 396     $form->{"checked_$i"} = ($form->{"checked_$i"}) ? "checked" : "";
 
 397     $column_data{checked} =
 
 398       qq|<td align=center width=10%><input name="checked_$i" type=checkbox style=checkbox $form->{"checked_$i"}></td>|;
 
 405     map { print "$column_data{$_}\n" } @column_index;
 
 411   map { $column_data{$_} = "<td> </td>" } @column_index;
 
 413   $column_data{amount} =
 
 414       qq|<th class=listtotal align=right>|
 
 415     . $form->format_amount(\%myconfig, $totalamount, 2, " ")
 
 418       qq|<th class=listtotal align=right>|
 
 419     . $form->format_amount(\%myconfig, $totaldue, 2, " ")
 
 422       qq|<th class=listtotal align=right>|
 
 423     . $form->format_amount(\%myconfig, $totalpaid, 2, " ")
 
 429   map { print "$column_data{$_}\n" } @column_index;
 
 437   $lxdebug->leave_sub();
 
 441   $lxdebug->enter_sub();
 
 443   $form->{DF}{ $form->{format} } = "selected";
 
 444   $form->{OP}{ $form->{media} }  = "selected";
 
 447           <option value=screen $form->{OP}{screen}>| . $locale->text('Screen');
 
 449   if ($myconfig{printer} && $latex_templates) {
 
 451           <option value=printer $form->{OP}{printer}>|
 
 452       . $locale->text('Printer');
 
 454   if ($latex_templates) {
 
 456           <option value=queue $form->{OP}{queue}>| . $locale->text('Queue');
 
 458             <option value=postscript $form->{DF}{postscript}>|
 
 459       . $locale->text('Postscript') . qq|
 
 460             <option value=pdf $form->{DF}{pdf}>| . $locale->text('PDF');
 
 465     <td><hr size=3 noshade></td>
 
 468 <input type=hidden name=rowcount value=$form->{rowcount}>
 
 470 <input type=hidden name=login value=$form->{login}>
 
 471 <input type=hidden name=password value=$form->{password}>
 
 474 <input class=submit type=submit name=action value="|
 
 475     . $locale->text('Update') . qq|">
 
 476 <input class=submit type=submit name=action value="|
 
 477     . $locale->text('Post') . qq|">|;
 
 479   if ($latex_templates) {
 
 481 <input class=submit type=submit name=action value="|
 
 482       . $locale->text('Print') . qq|">|;
 
 486 <select name=format>$format</select>
 
 487 <select name=media>$media</select>
 
 495   $lxdebug->leave_sub();
 
 499   $lxdebug->enter_sub();
 
 501   my ($new_name_selected) = @_;
 
 503   if ($form->{vc} eq 'customer') {
 
 509   # if we switched to all_vc
 
 510   if ($form->{all_vc} ne $form->{oldall_vc}) {
 
 512     $form->{openinvoices} = ($form->{all_vc}) ? 0 : 1;
 
 514     $form->{"select$form->{vc}"} = "";
 
 516     if ($form->{all_vc}) {
 
 517       $form->all_vc(\%myconfig, $form->{vc}, $form->{ARAP});
 
 519       if ($form->{"all_$form->{vc}"}) {
 
 521           $form->{"select$form->{vc}"} .=
 
 522             "<option>$_->{name}--$_->{id}\n"
 
 523         } @{ $form->{"all_$form->{vc}"} };
 
 526       CP->get_openvc(\%myconfig, \%$form);
 
 528       if ($form->{"all_$form->{vc}"}) {
 
 530           qq|$form->{"all_$form->{vc}"}[0]->{name}--$form->{"all_$form->{vc}"}[0]->{id}|;
 
 532           $form->{"select$form->{vc}"} .=
 
 533             "<option>$_->{name}--$_->{id}\n"
 
 534         } @{ $form->{"all_$form->{vc}"} };
 
 537       # if the name is not the same
 
 538       if ($form->{"select$form->{vc}"} !~ /$form->{$form->{vc}}/) {
 
 539         $form->{ $form->{vc} } = $newvc;
 
 544   # get customer and invoices
 
 545   $updated = &check_name($form->{vc});
 
 547   if ($new_name_selected || $updated) {
 
 548     CP->get_openinvoices(\%myconfig, \%$form);
 
 549     ($newvc) = split /--/, $form->{ $form->{vc} };
 
 550     $form->{"old$form->{vc}"} = qq|$newvc--$form->{"$form->{vc}_id"}|;
 
 554   if ($form->{currency} ne $form->{oldcurrency}) {
 
 555     $form->{oldcurrency} = $form->{currency};
 
 557       CP->get_openinvoices(\%myconfig, \%$form);
 
 562   $form->{exchangerate} = $exchangerate
 
 566                      $form->check_exchangerate(
 
 567                      \%myconfig, $form->{currency}, $form->{datepaid}, $buysell
 
 570   $amount = $form->{amount} = $form->parse_amount(\%myconfig, $form->{amount});
 
 573     $form->{rowcount} = 0;
 
 575     $form->{queued} = "";
 
 578     foreach $ref (@{ $form->{PR} }) {
 
 580       $form->{"id_$i"}        = $ref->{id};
 
 581       $form->{"invnumber_$i"} = $ref->{invnumber};
 
 582       $form->{"transdate_$i"} = $ref->{transdate};
 
 583       $ref->{exchangerate} = 1 unless $ref->{exchangerate};
 
 584       $form->{"amount_$i"} = $ref->{amount} / $ref->{exchangerate};
 
 586         ($ref->{amount} - $ref->{paid}) / $ref->{exchangerate};
 
 587       $form->{"checked_$i"} = "";
 
 588       $form->{"paid_$i"}    = "";
 
 593           $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2)
 
 597     $form->{rowcount} = $i;
 
 602   # Modified from $amount = $form->{amount} by J.Zach to update amount to total
 
 603   # payment amount in Zahlungsausgang
 
 605   for $i (1 .. $form->{rowcount}) {
 
 609         $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
 
 610     } qw(amount due paid);
 
 612     if ($form->{"checked_$i"}) {
 
 615       if (!$form->{"paid_$i"}) {
 
 616         $form->{"paid_$i"} = $form->{"due_$i"};
 
 619       # Modified by J.Zach, see abovev
 
 620       $amount += $form->{"paid_$i"}; 
 
 623       $form->{"paid_$i"} = "";
 
 628         $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2)
 
 629     } qw(amount due paid);
 
 633   # Line added by J.Zach, see above
 
 634   $form->{amount}=$amount; 
 
 640   $lxdebug->leave_sub();
 
 644   $lxdebug->enter_sub();
 
 648   if ($form->{currency} ne $form->{defaultcurrency}) {
 
 649     $form->error($locale->text('Exchangerate missing!'))
 
 650       unless $form->{exchangerate};
 
 653   $msg1 = "$form->{origtitle} posted!";
 
 654   $msg2 = "Cannot post $form->{origtitle}!";
 
 656   # $locale->text('Payment posted!')
 
 657   # $locale->text('Receipt posted!')
 
 658   # $locale->text('Cannot post Payment!')
 
 659   # $locale->text('Cannot post Receipt!')
 
 661   $form->redirect($locale->text($msg1))
 
 662     if (CP->process_payment(\%myconfig, \%$form));
 
 663   $form->error($locale->text($msg2));
 
 665   $lxdebug->leave_sub();
 
 669   $lxdebug->enter_sub();
 
 673   ($whole, $form->{decimal}) = split(/\./, $form->{amount});
 
 675   $form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2);
 
 677   $form->{decimal} .= "00";
 
 678   $form->{decimal} = substr($form->{decimal}, 0, 2);
 
 680   $check = new CP $myconfig{countrycode};
 
 682   $form->{text_amount} = $check->num2text($whole);
 
 684   call_sub("$form->{vc}_details");
 
 686   $form->{callback} = "";
 
 688   $form->{templates} = "$myconfig{templates}";
 
 689   $form->{IN}        = "$form->{formname}.tex";
 
 691   if ($form->{format} eq 'postscript') {
 
 692     $form->{postscript} = 1;
 
 694   if ($form->{format} eq 'pdf') {
 
 698   if ($form->{media} eq 'printer') {
 
 699     $form->{OUT} = "| $myconfig{printer}";
 
 701   if ($form->{media} eq 'queue') {
 
 702     %queued = split / /, $form->{queued};
 
 704     if ($filename = $queued{ $form->{formname} }) {
 
 705       unlink "$spool/$filename";
 
 706       $filename =~ s/\..*$//g;
 
 711     $filename .= ($form->{postscript}) ? '.ps' : '.pdf';
 
 712     $form->{queued} = "$form->{formname} $filename";
 
 713     $form->{OUT}    = ">$spool/$filename";
 
 715     $form->update_status(\%myconfig);
 
 719   $form->{company} = $myconfig{company};
 
 720   $form->{address} = $myconfig{address};
 
 722   $form->parse_template(\%myconfig, $userspath);
 
 724   if ($form->{media} ne 'screen') {
 
 726       "$form->{script}?action=payment&vc=$form->{vc}&login=$form->{login}&password=$form->{password}&all_vc=$form->{all_vc}";
 
 728     $form->redirect if (CP->process_payment(\%myconfig, \%$form));
 
 729     $form->error($locale->text('Cannot post payment!'));
 
 732   $lxdebug->leave_sub();
 
 735 sub customer_details { IS->customer_details(\%myconfig, \%$form) }
 
 736 sub vendor_details { IR->vendor_details(\%myconfig, \%$form) }
 
 739   $lxdebug->enter_sub();
 
 741   &check_name($form->{vc});
 
 743   if ($form->{currency} ne $form->{oldcurrency}) {
 
 748   $form->error($locale->text('Date missing!')) unless $form->{datepaid};
 
 750   $closedto = $form->datetonum($form->{closedto}, \%myconfig);
 
 751   $datepaid = $form->datetonum($form->{datepaid}, \%myconfig);
 
 753   $form->error($locale->text('Cannot process payment for a closed period!'))
 
 754     if ($datepaid <= $closedto);
 
 756   $amount = $form->parse_amount(\%myconfig, $form->{amount});
 
 757   $form->{amount} = $amount;
 
 759   for $i (1 .. $form->{rowcount}) {
 
 760     if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) {
 
 761       $amount -= $form->parse_amount($myconfig, $form->{"paid_$i"});
 
 763       push(@{ $form->{paid} },      $form->{"paid_$i"});
 
 764       push(@{ $form->{due} },       $form->{"due_$i"});
 
 765       push(@{ $form->{invnumber} }, $form->{"invnumber_$i"});
 
 766       push(@{ $form->{invdate} },   $form->{"transdate_$i"});
 
 770   if ($form->round_amount($amount, 2) != 0) {
 
 771     push(@{ $form->{paid} }, $form->format_amount(\%myconfig, $amount, 2));
 
 772     push(@{ $form->{due} }, $form->format_amount(\%myconfig, 0, "0"));
 
 773     push(@{ $form->{invnumber} },
 
 774          ($form->{ARAP} eq 'AR')
 
 775          ? $locale->text('Deposit')
 
 776          : $locale->text('Prepayment'));
 
 777     push(@{ $form->{invdate} }, $form->{datepaid});
 
 780   $lxdebug->leave_sub();