-
- $invoice |
-
+
+ $invoice |
+
|;
- $column_data{invnumber} = qq||.$locale->text('Invoice')." | ";
- $column_data{transdate} = qq||.$locale->text('Date')." | ";
- $column_data{amount} = qq||.$locale->text('Amount')." | ";
- $column_data{due} = qq||.$locale->text('Due')." | ";
- $column_data{paid} = qq||.$locale->text('Amount')." | ";
- $column_data{checked} = qq||.$locale->text('Select')." | ";
-
+ $column_data{invnumber} =
+ qq|| . $locale->text('Invoice') . " | ";
+ $column_data{transdate} =
+ qq|| . $locale->text('Date') . " | ";
+ $column_data{amount} =
+ qq|| . $locale->text('Amount') . " | ";
+ $column_data{due} =
+ qq|| . $locale->text('Due') . " | ";
+ $column_data{paid} =
+ qq|| . $locale->text('Amount') . " | ";
+ $column_data{checked} =
+ qq|| . $locale->text('Select') . " | ";
+
print qq|
|;
@@ -344,34 +378,46 @@ sub list_invoices {
|;
- for $i (1 .. $form->{rowcount}) {
+ for my $i (1 .. $form->{rowcount}) {
+
+ my $j = 0;
+
+ map {
+ $form->{"${_}_$i"} =
+ $form->parse_amount(\%myconfig, $form->{"${_}_$i"})
+ } qw(amount due paid);
- map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(amount due paid);
-
$totalamount += $form->{"amount_$i"};
- $totaldue += $form->{"due_$i"};
- $totalpaid += $form->{"paid_$i"};
+ $totaldue += $form->{"due_$i"};
+ $totalpaid += $form->{"paid_$i"};
- map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) } qw(amount due paid);
+ map {
+ $form->{"${_}_$i"} =
+ $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2)
+ } qw(amount due paid);
$column_data{invnumber} = qq|$form->{"invnumber_$i"} |
{"id_$i"}>|;
$column_data{transdate} = qq|$form->{"transdate_$i"} |
{"transdate_$i"}>|;
- $column_data{amount} = qq|$form->{"amount_$i"} |
+ $column_data{amount} =
+ qq|$form->{"amount_$i"} |
{"amount_$i"}>|;
$column_data{due} = qq|$form->{"due_$i"} |
{"due_$i"}>|;
- $column_data{paid} = qq|{"paid_$i"}> | |;
+ $column_data{paid} =
+ qq|{"paid_$i"}> | |;
$form->{"checked_$i"} = ($form->{"checked_$i"}) ? "checked" : "";
- $column_data{checked} = qq|{"checked_$i"}> | |;
+ $column_data{checked} =
+ qq|{"checked_$i"}> | |;
- $j++; $j %= 2;
+ $j++;
+ $j %= 2;
print qq|
-
+
|;
map { print "$column_data{$_}\n" } @column_index;
print qq|
@@ -381,9 +427,18 @@ sub list_invoices {
map { $column_data{$_} = " | " } @column_index;
- $column_data{amount} = qq||.$form->format_amount(\%myconfig, $totalamount, 2, " ").qq| | |;
- $column_data{due} = qq||.$form->format_amount(\%myconfig, $totaldue, 2, " ").qq| | |;
- $column_data{paid} = qq||.$form->format_amount(\%myconfig, $totalpaid, 2, " ").qq| | |;
+ $column_data{amount} =
+ qq||
+ . $form->format_amount(\%myconfig, $totalamount, 2, " ")
+ . qq| | |;
+ $column_data{due} =
+ qq||
+ . $form->format_amount(\%myconfig, $totaldue, 2, " ")
+ . qq| | |;
+ $column_data{paid} =
+ qq||
+ . $form->format_amount(\%myconfig, $totalpaid, 2, " ")
+ . qq| | |;
print qq|
@@ -399,30 +454,33 @@ sub list_invoices {
$lxdebug->leave_sub();
}
-
sub form_footer {
$lxdebug->enter_sub();
+ $auth->assert('cash');
+
+ my ($media, $format, $latex_templates);
+
+ $form->{DF}{ $form->{format} } = "selected";
+ $form->{OP}{ $form->{media} } = "selected";
- $form->{DF}{$form->{format}} = "selected";
- $form->{OP}{$form->{media}} = "selected";
-
$media = qq|
-
{rowcount}>
-{path}>
-{login}>
-{password}>
-
-
-|;
+
+|;
- if ($latex) {
+ if ($latex_templates) {
print qq|
-|;
+|;
}
print qq|
-|;
- if ($form->{menubar}) {
- require "$form->{path}/menu.pl";
- &menubar;
- }
-
- print qq|
@@ -463,13 +513,15 @@ sub form_footer {
$lxdebug->leave_sub();
}
-
sub update {
$lxdebug->enter_sub();
+ $auth->assert('cash');
+
my ($new_name_selected) = @_;
-
-
+
+ my ($buysell, $newvc, $updated, $exchangerate, $amount);
+
if ($form->{vc} eq 'customer') {
$buysell = "buy";
} else {
@@ -480,26 +532,33 @@ sub update {
if ($form->{all_vc} ne $form->{oldall_vc}) {
$form->{openinvoices} = ($form->{all_vc}) ? 0 : 1;
-
+
$form->{"select$form->{vc}"} = "";
if ($form->{all_vc}) {
$form->all_vc(\%myconfig, $form->{vc}, $form->{ARAP});
-
+
if ($form->{"all_$form->{vc}"}) {
- map { $form->{"select$form->{vc}"} .= " |