summaryrefslogtreecommitdiff
path: root/javascript_da
diff options
context:
space:
mode:
Diffstat (limited to 'javascript_da')
0 files changed, 0 insertions, 0 deletions
s="hl slc"># Contributors:
  • #
  • # This program is free software; you can redistribute it and/or modify
  • # it under the terms of the GNU General Public License as published by
  • # the Free Software Foundation; either version 2 of the License, or
  • # (at your option) any later version.
  • #
  • # This program is distributed in the hope that it will be useful,
  • # but WITHOUT ANY WARRANTY; without even the implied warranty of
  • # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  • # GNU General Public License for more details.
  • # You should have received a copy of the GNU General Public License
  • # along with this program; if not, write to the Free Software
  • # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  • #======================================================================
  • #
  • # AR / AP
  • #
  • #======================================================================
  • use LedgerSMB::Tax;
  • # any custom scripts for this one
  • if (-f "bin/custom/aa.pl") {
  • eval { require "bin/custom/aa.pl"; };
  • }
  • if (-f "bin/custom/$form->{login}_aa.pl") {
  • eval { require "bin/custom/$form->{login}_aa.pl"; };
  • }
  • 1;
  • # end of main
  • # this is for our long dates
  • # $locale->text('January')
  • # $locale->text('February')
  • # $locale->text('March')
  • # $locale->text('April')
  • # $locale->text('May ')
  • # $locale->text('June')
  • # $locale->text('July')
  • # $locale->text('August')
  • # $locale->text('September')
  • # $locale->text('October')
  • # $locale->text('November')
  • # $locale->text('December')
  • # this is for our short month
  • # $locale->text('Jan')
  • # $locale->text('Feb')
  • # $locale->text('Mar')
  • # $locale->text('Apr')
  • # $locale->text('May')
  • # $locale->text('Jun')
  • # $locale->text('Jul')
  • # $locale->text('Aug')
  • # $locale->text('Sep')
  • # $locale->text('Oct')
  • # $locale->text('Nov')
  • # $locale->text('Dec')
  • sub add {
  • $form->{title} = "Add";
  • $form->{callback} = "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}" unless $form->{callback};
  • &create_links;
  • $form->{focus} = "amount_1";
  • &display_form;
  • }
  • sub edit {
  • $form->{title} = "Edit";
  • &create_links;
  • &display_form;
  • }
  • sub display_form {
  • &form_header;
  • &form_footer;
  • }
  • sub create_links {
  • $form->create_links($form->{ARAP}, \%myconfig, $form->{vc});
  • $duedate = $form->{duedate};
  • $taxincluded = $form->{taxincluded};
  • $form->{formname} = "transaction";
  • $form->{format} = "postscript" if $myconfig{printer};
  • $form->{media} = $myconfig{printer};
  • $form->{selectformname} = qq|<option value="transaction">|.$locale->text('Transaction');
  • if (${LedgerSMB::Sysconfig::latex}) {
  • if ($form->{ARAP} eq 'AR') {
  • $form->{selectformname} .= qq|
  • <option value="receipt">|.$locale->text('Receipt');
  • } else {
  • $form->{selectformname} .= qq|
  • <option value="check">|.$locale->text('Check');
  • }
  • }
  • # currencies
  • @curr = split /:/, $form->{currencies};
  • $form->{defaultcurrency} = $curr[0];
  • chomp $form->{defaultcurrency};
  • for (@curr) { $form->{selectcurrency} .= "<option>$_\n" }
  • AA->get_name(\%myconfig, \%$form);
  • $form->{currency} =~ s/ //g;
  • $form->{duedate} = $duedate if $duedate;
  • $form->{taxincluded} = $taxincluded if $form->{id};
  • $form->{notes} = $form->{intnotes} if !$form->{id};
  • $form->{"old$form->{vc}"} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
  • $form->{oldtransdate} = $form->{transdate};
  • # customers/vendors
  • $form->{"select$form->{vc}"} = "";
  • if (@{ $form->{"all_$form->{vc}"} }) {
  • $form->{$form->{vc}} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|;
  • for (@{ $form->{"all_$form->{vc}"} }) { $form->{"select$form->{vc}"} .= qq|<option value="$_->{name}--$_->{id}">$_->{name}\n| }
  • }
  • # departments
  • if (@{ $form->{all_department} }) {
  • $form->{selectdepartment} = "<option>\n";
  • $form->{department} = "$form->{department}--$form->{department_id}" if $form->{department_id};
  • for (@{ $form->{all_department} }) { $form->{selectdepartment} .= qq|<option value="$_->{description}--$_->{id}">$_->{description}\n| }
  • }
  • $form->{employee} = "$form->{employee}--$form->{employee_id}";
  • # sales staff
  • if (@{ $form->{all_employee} }) {
  • $form->{selectemployee} = "";
  • for (@{ $form->{all_employee} }) { $form->{selectemployee} .= qq|<option value="$_->{name}--$_->{id}">$_->{name}\n| }
  • }
  • # projects
  • if (@{ $form->{all_project} }) {
  • $form->{selectprojectnumber} = "<option>\n";
  • for (@{ $form->{all_project} }) { $form->{selectprojectnumber} .= qq|<option value="$_->{projectnumber}--$_->{id}">$_->{projectnumber}\n| }
  • }
  • if (@{ $form->{all_language} }) {
  • $form->{selectlanguage} = "<option>\n";
  • for (@{ $form->{all_language} }) { $form->{selectlanguage} .= qq|<option value="$_->{code}">$_->{description}\n| }
  • }
  • # forex
  • $form->{forex} = $form->{exchangerate};
  • $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
  • $netamount = 0;
  • $tax = 0;
  • $taxrate = 0;
  • $ml = ($form->{ARAP} eq 'AR') ? 1 : -1;
  • foreach $key (keys %{ $form->{"$form->{ARAP}_links"} }) {
  • $form->{"select$key"} = "";
  • foreach $ref (@{ $form->{"$form->{ARAP}_links"}{$key} }) {
  • if ($key eq "$form->{ARAP}_tax") {
  • $form->{"select$form->{ARAP}_tax_$ref->{accno}"} = "<option>$ref->{accno}--$ref->{description}\n";
  • next;
  • }
  • $form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}\n";
  • }
  • # if there is a value we have an old entry
  • for $i (1 .. scalar @{ $form->{acc_trans}{$key} }) {
  • if ($key eq "$form->{ARAP}_paid") {
  • $form->{"$form->{ARAP}_paid_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
  • $form->{"paid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{amount} * -1 * $ml;
  • $form->{"datepaid_$i"} = $form->{acc_trans}{$key}->[$i-1]->{transdate};
  • $form->{"source_$i"} = $form->{acc_trans}{$key}->[$i-1]->{source};
  • $form->{"memo_$i"} = $form->{acc_trans}{$key}->[$i-1]->{memo};
  • $form->{"forex_$i"} = $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i-1]->{exchangerate};
  • $form->{paidaccounts}++;
  • } else {
  • $akey = $key;
  • $akey =~ s/$form->{ARAP}_//;
  • if ($key eq "$form->{ARAP}_tax") {
  • $form->{"${key}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
  • $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"} = $form->{acc_trans}{$key}->[$i-1]->{amount} * $ml;
  • $tax += $form->{"${akey}_$form->{acc_trans}{$key}->[$i-1]->{accno}"};
  • $taxrate += $form->{"$form->{acc_trans}{$key}->[$i-1]->{accno}_rate"};
  • } else {
  • $form->{"${akey}_$i"} = $form->{acc_trans}{$key}->[$i-1]->{amount} * $ml;
  • if ($akey eq 'amount') {
  • $form->{"description_$i"} = $form->{acc_trans}{$key}->[$i-1]->{memo};
  • $form->{rowcount}++;
  • $netamount += $form->{"${akey}_$i"};
  • $form->{"projectnumber_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{projectnumber}--$form->{acc_trans}{$key}->[$i-1]->{project_id}" if $form->{acc_trans}{$key}->[$i-1]->{project_id};
  • } else {
  • $form->{invtotal} = $form->{acc_trans}{$key}->[$i-1]->{amount} * -1 * $ml;
  • }
  • $form->{"${key}_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}";
  • }
  • }
  • }
  • }
  • $form->{paidaccounts} = 1 if not defined $form->{paidaccounts};
  • if ($form->{taxincluded}) {
  • $diff = 0;
  • # add tax to individual amounts
  • # XXX needs alteration for conditional taxes
  • for $i (1 .. $form->{rowcount}) {
  • if ($netamount) {
  • $amount = $form->{"amount_$i"} * (1 + $tax / $netamount);
  • $form->{"amount_$i"} = $form->round_amount($amount, 2);
  • }
  • }
  • }
  • $form->{invtotal} = $netamount + $tax;
  • # check if calculated is equal to stored
  • # taxincluded is terrible to calculate
  • # this works only if all taxes are checked
  • @taxaccounts = Tax::init_taxes($form, $form->{taxaccounts});
  • if ($form->{id}) {
  • if ($form->{taxincluded}) {
  • $amount = Tax::calculate_taxes(\@taxaccounts, $form,
  • $form->{invtotal}, 1);
  • $tax = $form->round_amount($amount, 2);
  • } else {
  • $tax = $form->round_amount(Tax::calculate_taxes(\@taxaccounts,
  • $form, $netamount, 0));
  • }
  • foreach $item (@taxaccounts) {
  • $tax{$item->account} = $form->round_amount($item->value, 2);
  • $form->{"calctax_".$item->account} = 1 if $item->value and (
  • $tax{$item->account} == $form->{"tax_".$item->account});
  • }
  • } else {
  • for (@taxaccounts) { $form->{"calctax_".$_->account} = 1 }
  • }
  • $form->{rowcount}++ if ($form->{id} || !$form->{rowcount});
  • $form->{$form->{ARAP}} = $form->{"$form->{ARAP}_1"};
  • $form->{rowcount} = 1 unless $form->{"$form->{ARAP}_amount_1"};
  • $form->{locked} = ($form->{revtrans}) ? '1' : ($form->datetonum(\%myconfig, $form->{transdate}) <= $form->datetonum(\%myconfig, $form->{closedto}));
  • # readonly
  • if (! $form->{readonly}) {
  • $form->{readonly} = 1 if $myconfig{acs} =~ /$form->{ARAP}--Add Transaction/;
  • }
  • }
  • sub form_header {
  • $title = $form->{title};
  • $form->{title} = $locale->text("$title $form->{ARAP} Transaction");
  • $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
  • # $locale->text('Add AR Transaction')
  • # $locale->text('Edit AR Transaction')
  • # $locale->text('Add AP Transaction')
  • # $locale->text('Edit AP Transaction')
  • # set option selected
  • for ("$form->{ARAP}", "currency") {
  • $form->{"select$_"} =~ s/ selected//;
  • $form->{"select$_"} =~ s/<option>\Q$form->{$_}\E/<option selected>$form->{$_}/;
  • }
  • for ("$form->{vc}", "department", "employee", "formname") {
  • $form->{"select$_"} = $form->unescape($form->{"select$_"});
  • $form->{"select$_"} =~ s/ selected//;
  • $form->{"select$_"} =~ s/(<option value="\Q$form->{$_}\E")/$1 selected/;
  • }
  • $form->{selectprojectnumber} = $form->unescape($form->{selectprojectnumber});
  • # format amounts
  • $form->{exchangerate} = $form->format_amount(\%myconfig, $form->{exchangerate});
  • $exchangerate = qq|<tr>|;
  • $exchangerate .= qq|
  • <th align=right nowrap>|.$locale->text('Currency').qq|</th>
  • <td><select name=currency>$form->{selectcurrency}</select></td> | if $form->{defaultcurrency};
  • $exchangerate .= qq|
  • <input type=hidden name=selectcurrency value="$form->{selectcurrency}">
  • <input type=hidden name=defaultcurrency value=$form->{defaultcurrency}>
  • |;
  • if ($form->{defaultcurrency} && $form->{currency} ne $form->{defaultcurrency}) {
  • if ($form->{forex}) {
  • $exchangerate .= qq|
  • <th align=right>|.$locale->text('Exchange Rate').qq|</th>
  • <td><input type=hidden name=exchangerate value=$form->{exchangerate}>$form->{exchangerate}</td>
  • |;
  • } else {
  • $exchangerate .= qq|
  • <th align=right>|.$locale->text('Exchange Rate').qq|</th>
  • <td><input name=exchangerate size=10 value=$form->{exchangerate}></td>
  • |;
  • }
  • }
  • $exchangerate .= qq|
  • <input type=hidden name=forex value=$form->{forex}>
  • </tr>
  • |;
  • $taxincluded = "";
  • if ($form->{taxaccounts}) {
  • $taxincluded = qq|
  • <tr>
  • <td align=right><input name=taxincluded class=checkbox type=checkbox value=1 $form->{taxincluded}></td>
  • <th align=left nowrap>|.$locale->text('Tax Included').qq|</th>
  • </tr>
  • |;
  • }
  • if (($rows = $form->numtextrows($form->{notes}, 50) - 1) < 2) {
  • $rows = 2;
  • }
  • $notes = qq|<textarea name=notes rows=$rows cols=50 wrap=soft>$form->{notes}</textarea>|;
  • $department = qq|
  • <tr>
  • <th align="right" nowrap>|.$locale->text('Department').qq|</th>
  • <td colspan=3><select name=department>$form->{selectdepartment}</select>
  • <input type=hidden name=selectdepartment value="|.$form->escape($form->{selectdepartment},1).qq|">
  • </td>
  • </tr>
  • | if $form->{selectdepartment};
  • $n = ($form->{creditremaining} < 0) ? "0" : "1";
  • $name = ($form->{"select$form->{vc}"}) ? qq|<select name="$form->{vc}">$form->{"select$form->{vc}"}</select>| : qq|<input name="$form->{vc}" value="$form->{$form->{vc}}" size=35>|;
  • $employee = qq|
  • <input type=hidden name=employee value="$form->{employee}">
  • |;
  • if ($form->{selectemployee}) {
  • $label = ($form->{ARAP} eq 'AR') ? $locale->text('Salesperson') : $locale->text('Employee');
  • $employee = qq|
  • <tr>
  • <th align=right nowrap>$label</th>
  • <td><select name=employee>$form->{selectemployee}</select></td>
  • <input type=hidden name=selectemployee value="|.$form->escape($form->{selectemployee},1).qq|">
  • </tr>
  • |;
  • }
  • $focus = ($form->{focus}) ? $form->{focus} : "amount_$form->{rowcount}";
  • $form->header;
  • print qq|
  • <body onload="document.forms[0].${focus}.focus()" />
  • <form method=post action=$form->{script}>
  • <input type=hidden name=type value="$form->{formname}">
  • <input type=hidden name=title value="$title">
  • |;
  • $form->hide_form(qw(id printed emailed sort closedto locked oldtransdate audittrail recurring checktax));
  • if ($form->{vc} eq 'customer') {
  • $label = $locale->text('Customer');
  • } else {
  • $label = $locale->text('Vendor');
  • }
  • $form->hide_form("old$form->{vc}", "$form->{vc}_id", "terms", "creditlimit", "creditremaining", "selectcurrency", "defaultcurrency", "select$form->{ARAP}_amount", "rowcount");
  • print qq|
  • <table width=100%>
  • <tr class=listtop>
  • <th class=listtop>$form->{title}</th>
  • </tr>
  • <tr height="5"></tr>
  • <tr valign=top>
  • <td>
  • <table width=100%>
  • <tr valign=top>
  • <td>
  • <table>
  • <tr>
  • <th align="right" nowrap>$label</th>
  • <td colspan=3>$name</td>
  • <input type=hidden name="select$form->{vc}" value="|.$form->escape($form->{"select$form->{vc}"},1).qq|">
  • </tr>
  • <tr>
  • <td></td>
  • <td colspan=3>
  • <table width=100%>
  • <tr>
  • <th align=left nowrap>|.$locale->text('Credit Limit').qq|</th>
  • <td>$form->{creditlimit}</td>
  • <th align=left nowrap>|.$locale->text('Remaining').qq|</th>
  • <td class="plus$n">|.$form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0").qq|</td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • $exchangerate
  • $department
  • $taxincluded
  • </table>
  • </td>
  • <td align=right>
  • <table>
  • $employee
  • <tr>
  • <th align=right nowrap>|.$locale->text('Invoice Number').qq|</th>
  • <td><input name=invnumber size=20 value="$form->{invnumber}"></td>
  • </tr>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Order Number').qq|</th>
  • <td><input name=ordnumber size=20 value="$form->{ordnumber}"></td>
  • </tr>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Invoice Date').qq|</th>
  • <td><input name=transdate size=11 title="($myconfig{'dateformat'})" value=$form->{transdate}></td>
  • </tr>
  • <tr>
  • <th align=right nowrap>|.$locale->text('Due Date').qq|</th>
  • <td><input name=duedate size=11 title="$myconfig{'dateformat'}" value=$form->{duedate}></td>
  • </tr>
  • <tr>
  • <th align=right nowrap>|.$locale->text('PO Number').qq|</th>
  • <td><input name=ponumber size=20 value="$form->{ponumber}"></td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • <input type=hidden name=selectprojectnumber value="|.$form->escape($form->{selectprojectnumber},1).qq|">
  • <tr>
  • <td>
  • <table>
  • |;
  • $project = qq|
  • <th>|.$locale->text('Project').qq|</th>
  • | if $form->{selectprojectnumber};
  • print qq|
  • <tr>
  • <th>|.$locale->text('Amount').qq|</th>
  • <th></th>
  • <th>|.$locale->text('Account').qq|</th>
  • <th>|.$locale->text('Description').qq|</th>
  • $project
  • </tr>
  • |;
  • for $i (1 .. $form->{rowcount}) {
  • $selectamount = $form->{"select$form->{ARAP}_amount"};
  • $selectamount =~ s/option>\Q$form->{"$form->{ARAP}_amount_$i"}\E/option selected>$form->{"$form->{ARAP}_amount_$i"}/;
  • $selectprojectnumber = $form->{selectprojectnumber};
  • $selectprojectnumber =~ s/(<option value="\Q$form->{"projectnumber_$i"}\E")/$1 selected/;
  • # format amounts
  • $form->{"amount_$i"} = $form->format_amount(\%myconfig, $form->{"amount_$i"}, 2);
  • $project = qq|
  • <td align=right><select name="projectnumber_$i">$selectprojectnumber</select></td>
  • | if $form->{selectprojectnumber};
  • if (($rows = $form->numtextrows($form->{"description_$i"}, 40)) > 1) {
  • $description = qq|<td><textarea name="description_$i" rows=$rows cols=40>$form->{"description_$i"}</textarea></td>|;
  • } else {
  • $description = qq|<td><input name="description_$i" size=40 value="$form->{"description_$i"}"></td>|;
  • }
  • print qq|
  • <tr valign=top>
  • <td><input name="amount_$i" size=10 value="$form->{"amount_$i"}" accesskey="$i"></td>
  • <td></td>
  • <td><select name="$form->{ARAP}_amount_$i">$selectamount</select></td>
  • $description
  • $project
  • </tr>
  • |;
  • }
  • foreach $item (split / /, $form->{taxaccounts}) {
  • $form->{"calctax_$item"} = ($form->{"calctax_$item"}) ? "checked" : "";
  • $form->{"tax_$item"} = $form->format_amount(\%myconfig, $form->{"tax_$item"}, 2);
  • print qq|
  • <tr>
  • <td><input name="tax_$item" size=10 value=$form->{"tax_$item"}></td>
  • <td align=right><input name="calctax_$item" class=checkbox type=checkbox value=1 $form->{"calctax_$item"}></td>
  • <td><select name="$form->{ARAP}_tax_$item">$form->{"select$form->{ARAP}_tax_$item"}</select></td>
  • </tr>
  • |;
  • $form->hide_form("${item}_rate", "${item}_description", "${item}_taxnumber", "select$form->{ARAP}_tax_$item");
  • }
  • $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2);
  • $form->hide_form("oldinvtotal", "oldtotalpaid", "taxaccounts", "select$form->{ARAP}");
  • print qq|
  • <tr>
  • <th align=left>$form->{invtotal}</th>
  • <td></td>
  • <td><select name=$form->{ARAP}>$form->{"select$form->{ARAP}"}</select></td>
  • </tr>
  • <tr>
  • <th align=right>|.$locale->text('Notes').qq|</th>
  • <td></td>
  • <td colspan=3>$notes</td>
  • </tr>
  • </table>
  • </td>
  • </tr>
  • <tr class=listheading>
  • <th class=listheading>|.$locale->text('Payments').qq|</th>
  • </tr>
  • <tr>
  • <td>
  • <table width=100%>
  • |;
  • if ($form->{currency} eq $form->{defaultcurrency}) {
  • @column_index = qw(datepaid source memo paid ARAP_paid);
  • } else {
  • @column_index = qw(datepaid source memo paid exchangerate ARAP_paid);
  • }
  • $column_data{datepaid} = "<th>".$locale->text('Date')."</th>";
  • $column_data{paid} = "<th>".$locale->text('Amount')."</th>";
  • $column_data{exchangerate} = "<th>".$locale->text('Exch')."</th>";
  • $column_data{ARAP_paid} = "<th>".$locale->text('Account')."</th>";
  • $column_data{source} = "<th>".$locale->text('Source')."</th>";
  • $column_data{memo} = "<th>".$locale->text('Memo')."</th>";
  • print "
  • <tr>
  • ";
  • for (@column_index) { print "$column_data{$_}\n" }
  • print "
  • </tr>
  • ";
  • $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"});
  • for $i (1 .. $form->{paidaccounts}) {
  • $form->hide_form("cleared_$i");
  • print "
  • <tr>
  • ";
  • $form->{"select$form->{ARAP}_paid_$i"} = $form->{"select$form->{ARAP}_paid"};
  • $form->{"select$form->{ARAP}_paid_$i"} =~ s/option>\Q$form->{"$form->{ARAP}_paid_$i"}\E/option selected>$form->{"$form->{ARAP}_paid_$i"}/;
  • # format amounts
  • $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2);
  • $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"});
  • $exchangerate = qq|&nbsp;|;
  • if ($form->{currency} ne $form->{defaultcurrency}) {
  • if ($form->{"forex_$i"}) {
  • $form->hide_form("exchangerate_$i");
  • $exchangerate = qq|$form->{"exchangerate_$i"}|;
  • } else {
  • $exchangerate = qq|<input name="exchangerate_$i" size=10 value=$form->{"exchangerate_$i"}>|;
  • }
  • }
  • $form->hide_form("forex_$i");
  • $column_data{paid} = qq|<td align=center><input name="paid_$i" size=11 value=$form->{"paid_$i"}></td>|;
  • $column_data{ARAP_paid} = qq|<td align=center><select name="$form->{ARAP}_paid_$i">$form->{"select$form->{ARAP}_paid_$i"}</select></td>|;
  • $column_data{exchangerate} = qq|<td align=center>$exchangerate</td>|;
  • $column_data{datepaid} = qq|<td align=center><input name="datepaid_$i" size=11 value=$form->{"datepaid_$i"}></td>|;
  • $column_data{source} = qq|<td align=center><input name="source_$i" size=11 value="$form->{"source_$i"}"></td>|;
  • $column_data{memo} = qq|<td align=center><input name="memo_$i" size=11 value="$form->{"memo_$i"}"></td>|;
  • for (@column_index) { print qq|$column_data{$_}\n| }
  • print "
  • </tr>
  • ";
  • }
  • $form->hide_form("paidaccounts", "select$form->{ARAP}_paid");
  • print qq|
  • </table>
  • </td>
  • </tr>
  • <tr>
  • <td><hr size=3 noshade></td>
  • </tr>
  • </table>
  • |;
  • }
  • sub form_footer {
  • $form->hide_form(qw(callback path login sessionid));
  • $transdate = $form->datetonum(\%myconfig, $form->{transdate});
  • $closedto = $form->datetonum(\%myconfig, $form->{closedto});
  • # type=submit $locale->text('Update')
  • # type=submit $locale->text('Print')
  • # type=submit $locale->text('Post')
  • # type=submit $locale->text('Print and Post')
  • # type=submit $locale->text('Schedule')
  • # type=submit $locale->text('Ship to')
  • # type=submit $locale->text('Post as new')
  • # type=submit $locale->text('Print and Post as new')
  • # type=submit $locale->text('Delete')
  • if (! $form->{readonly}) {
  • &print_options;
  • print "<br>";
  • %button = ('update' => { ndx => 1, key => 'U', value => $locale->text('Update') },
  • 'print' => { ndx => 2, key => 'P', value => $locale->text('Print') },
  • 'post' => { ndx => 3, key => 'O', value => $locale->text('Post') },
  • 'print_and_post' => { ndx => 4, key => 'R', value => $locale->text('Print and Post') },
  • 'post_as_new' => { ndx => 5, key => 'N', value => $locale->text('Post as new') },
  • 'print_and_post_as_new' => { ndx => 6, key => 'W', value => $locale->text('Print and Post as new') },
  • 'schedule' => { ndx => 7, key => 'H', value => $locale->text('Schedule') },
  • 'delete' => { ndx => 8, key => 'D', value => $locale->text('Delete') },
  • );
  • if ($form->{id}) {
  • if ($form->{locked} || $transdate <= $closedto) {
  • for ("post", "print_and_post", "delete") { delete $button{$_} }
  • }
  • if (!${LedgerSMB::Sysconfig::latex}) {
  • for ("print_and_post", "print_and_post_as_new") { delete $button{$_} }
  • }