+ |.$locale->text('Include in Report').qq| |
+
+
+
+ |
+ |.$locale->text('ID').qq| |
+ |
+ |.$locale->text('Invoice').qq| |
+ |
+ |.$locale->text('Date').qq| |
+
+
+ |
+|;
+
+ if ($form->{db} eq 'ar') {
+ print qq||.$locale->text('Customer').qq| | |;
+ }
+ if ($form->{db} eq 'ap') {
+ print qq||.$locale->text('Vendor').qq| | |;
+ }
+
+ print qq|
+ |
+ |.$locale->text('Description').qq| |
+ |
+ |.$locale->text('Amount').qq| |
+
+
|
|.$locale->text('Subtotal').qq| |
@@ -336,37 +562,41 @@ print qq|
$nextsub = "generate_$form->{report}";
# setup vc selection
- $form->all_vc(\%myconfig, $form->{vc});
+ $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP");
- map { $vc .= "\n|;
+ map { $form->{selectlanguage} .= qq|$_->{description}\n| } @{ $form->{all_language} };
+ }
+ if ($form->{summary}) {
+ push @column_index, qw(c0 c30 c60 c90);
+ } else {
+ push @column_index, qw(invnumber ordnumber transdate duedate c0 c30 c60 c90);
+ }
+
+ if ($form->{department}) {
+ $option .= "\n " if $option;
+ ($department) = split /--/, $form->{department};
+ $option .= $locale->text('Department')." : $department";
+ $department = $form->escape($form->{department},1);
+ $form->{callback} .= "&department=$department";
+ }
+
if ($form->{arap} eq 'ar') {
if ($form->{customer}) {
$option .= "\n " if $option;
@@ -817,10 +1136,10 @@ sub aging {
$option .= $form->{vendor};
}
}
-
+
$todate = $locale->date(\%myconfig, $form->{todate}, 1);
$option .= "\n " if $option;
- $option .= $locale->text('for Period')." ".$locale->text('to')." $todate";
+ $option .= $locale->text('for Period')." ".$locale->text('To')." $todate";
print qq|
@@ -849,58 +1168,33 @@ sub aging {
$ctid = 0;
- $subtotal = 0;
$i = 0;
+ $k = 0;
+ $l = $#{ $form->{AG} };
foreach $ref (@{ $form->{AG} }) {
+ $k++;
+
if ($ctid != $ref->{ctid}) {
$i++;
- if ($subtotal) {
- $c0subtotal = $form->format_amount(\%myconfig, $c0subtotal, 2, " ");
- $c30subtotal = $form->format_amount(\%myconfig, $c30subtotal, 2, " ");
- $c60subtotal = $form->format_amount(\%myconfig, $c60subtotal, 2, " ");
- $c90subtotal = $form->format_amount(\%myconfig, $c90subtotal, 2, " ");
- }
+ $column_data{ct} = qq|$ref->{name} | |;
- $column_data{ct} = qq| | |;
- $column_data{invnumber} = qq| | |;
- $column_data{transdate} = qq| | |;
- $column_data{duedate} = qq| | |;
- $column_data{c0} = qq|$c0subtotal | |;
- $column_data{c30} = qq|$c30subtotal | |;
- $column_data{c60} = qq|$c60subtotal | |;
- $column_data{c90} = qq|$c90subtotal | |;
-
- if ($subtotal) {
- # print subtotals
- print qq|
-
-|;
-
- map { print "$column_data{$_}\n" } @column_index;
-
- $column_data{statement} = qq| | |;
-
- print qq|
-
-|;
+ if ($form->{selectlanguage}) {
+ $form->{"selectlanguage_$i"} = $form->{selectlanguage};
+ $form->{"selectlanguage_$i"} =~ s/(|;
}
-
- $subtotal = 1;
-
- $c0subtotal = 0;
- $c30subtotal = 0;
- $c60subtotal = 0;
- $c90subtotal = 0;
-
- $column_data{ct} = qq|$ref->{name} | |;
+
$column_data{statement} = qq|{checked}>
{ctid}>
| |;
+
}
+
+ $ctid = $ref->{ctid};
$c0subtotal += $ref->{c0};
$c30subtotal += $ref->{c30};
@@ -916,73 +1210,103 @@ sub aging {
$ref->{c30} = $form->format_amount(\%myconfig, $ref->{c30}, 2, " ");
$ref->{c60} = $form->format_amount(\%myconfig, $ref->{c60}, 2, " ");
$ref->{c90} = $form->format_amount(\%myconfig, $ref->{c90}, 2, " ");
-
- $href = qq|$ref->{module}.pl?path=$form->{path}&action=edit&id=$ref->{id}&login=$form->{login}&password=$form->{password}&callback=|.$form->escape($form->{callback});
+
+ $href = qq|$ref->{module}.pl?path=$form->{path}&action=edit&id=$ref->{id}&login=$form->{login}&sessionid=$form->{sessionid}&callback=|.$form->escape($form->{callback});
$column_data{invnumber} = qq|$ref->{invnumber} | |;
- $column_data{transdate} = qq|$ref->{transdate} | |;
- $column_data{duedate} = qq|$ref->{duedate} | |;
- $column_data{c0} = qq|$ref->{c0} | |;
- $column_data{c30} = qq|$ref->{c30} | |;
- $column_data{c60} = qq|$ref->{c60} | |;
- $column_data{c90} = qq|$ref->{c90} | |;
+ map { $column_data{$_} = qq|$ref->{$_} | | } qw(ordnumber transdate duedate);
+ map { $column_data{$_} = qq|$ref->{$_} | | } qw(c0 c30 c60 c90);
- $j++; $j %= 2;
- print qq|
-
+ if (!$form->{summary}) {
+
+ $j++; $j %= 2;
+ print qq|
+
|;
- map { print "$column_data{$_}\n" } @column_index;
+ map { print "$column_data{$_}\n" } @column_index;
- print qq|
+ print qq|
|;
-
- $column_data{ct} = qq| | |;
- $column_data{statement} = qq| | |;
- $ctid = $ref->{ctid};
+ map { $column_data{$_} = qq| | | } qw(ct statement language);
+
+ }
+
+ # print subtotal
+ $nextid = ($k <= $l) ? $form->{AG}->[$k]->{ctid} : 0;
+ if ($ctid != $nextid) {
+
+ $c0subtotal = $form->format_amount(\%myconfig, $c0subtotal, 2, " ");
+ $c30subtotal = $form->format_amount(\%myconfig, $c30subtotal, 2, " ");
+ $c60subtotal = $form->format_amount(\%myconfig, $c60subtotal, 2, " ");
+ $c90subtotal = $form->format_amount(\%myconfig, $c90subtotal, 2, " ");
+
+ if ($form->{summary}) {
+ $column_data{c0} = qq|$c0subtotal|;
+ $column_data{c30} = qq| | $c30subtotal|;
+ $column_data{c60} = qq| | $c60subtotal|;
+ $column_data{c90} = qq| | $c90subtotal|;
- }
-
- # print subtotals
- $c0subtotal = $form->format_amount(\%myconfig, $c0subtotal, 2, " ");
- $c30subtotal = $form->format_amount(\%myconfig, $c30subtotal, 2, " ");
- $c60subtotal = $form->format_amount(\%myconfig, $c60subtotal, 2, " ");
- $c90subtotal = $form->format_amount(\%myconfig, $c90subtotal, 2, " ");
-
- print qq|
- |
+ $j++; $j %= 2;
+ print qq|
+
|;
- map { $column_data{$_} = qq| | | } @column_index;
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+
+|;
- $column_data{c0} = qq|$c0subtotal | |;
- $column_data{c30} = qq|$c30subtotal | |;
- $column_data{c60} = qq|$c60subtotal | |;
- $column_data{c90} = qq|$c90subtotal | |;
+ } else {
- map { print "$column_data{$_}\n" } @column_index;
-
+ map { $column_data{$_} = qq| | | } @column_index;
+
+ $column_data{c0} = qq|$c0subtotal | |;
+ $column_data{c30} = qq|$c30subtotal | |;
+ $column_data{c60} = qq|$c60subtotal | |;
+ $column_data{c90} = qq|$c90subtotal | |;
+
+ # print subtotals
+ print qq|
+
+|;
+ map { print "$column_data{$_}\n" } @column_index;
+
+ print qq|
+
+|;
+
+ }
+
+ $c0subtotal = 0;
+ $c30subtotal = 0;
+ $c60subtotal = 0;
+ $c90subtotal = 0;
+
+ }
+ }
print qq|
|;
+ map { $column_data{$_} = qq| | | } @column_index;
+
$c0total = $form->format_amount(\%myconfig, $c0total, 2, " ");
$c30total = $form->format_amount(\%myconfig, $c30total, 2, " ");
$c60total = $form->format_amount(\%myconfig, $c60total, 2, " ");
$c90total = $form->format_amount(\%myconfig, $c90total, 2, " ");
- $column_data{c0} = qq|$c0total | |;
- $column_data{c30} = qq|$c30total | |;
- $column_data{c60} = qq|$c60total | |;
- $column_data{c90} = qq|$c90total | |;
+ $column_data{c0} = qq|$c0total | |;
+ $column_data{c30} = qq|$c30total | |;
+ $column_data{c60} = qq|$c60total | |;
+ $column_data{c90} = qq|$c90total | |;
-
map { print "$column_data{$_}\n" } @column_index;
-
print qq|
@@ -1010,14 +1334,19 @@ sub aging {
{todate}>
+{summary}>
+
+{callback}>
{arap}>
{ct}>
{ct} value="$form->{$form->{ct}}">
+
+
{path}>
{login}>
-{password}>
+{sessionid}>
@@ -1026,6 +1355,11 @@ sub aging {
|;
}
+ if ($form->{menubar}) {
+ require "$form->{path}/menu.pl";
+ &menubar;
+ }
+
print qq|
@@ -1050,60 +1384,59 @@ sub select_all {
sub print_options {
$form->{sendmode} = "attachment";
- $form->{copies} = 2 unless $form->{copies};
+ $form->{copies} = 1 unless $form->{copies};
- $form->{PD}{$form->{type}} = "checked";
- $form->{DF}{$form->{format}} = "checked";
- $form->{OP}{$form->{media}} = "checked";
- $form->{SM}{$form->{sendmode}} = "checked";
+ $form->{PD}{$form->{type}} = "selected";
+ $form->{DF}{$form->{format}} = "selected";
+ $form->{SM}{$form->{sendmode}} = "selected";
+ $format = qq|
+ {PD}{format}>html|;
+
+ $type = qq|
+ {PD}{statement}>|.$locale->text('Statement');
+
if ($form->{media} eq 'email') {
- $email = qq|
- {SM}{attachment}> |.$locale->text('Attachment')
- .qq| {SM}{inline}> |.$locale->text('In-line').qq| |
-|;
+ $media = qq|
+ | |