-
-
-
-$jsscript
-|;
+ $form->{jsscript} = 1;
- $amount = $locale->text('Amount');
- $project = $locale->text('Project');
+ my $follow_up_vc = $form->{vendor};
+ $follow_up_vc =~ s/--.*?//;
+ my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)";
- for $i (1 .. 1) {
+ $form->{javascript} .= qq||;
+ $form->{javascript} .= qq||;
+ $form->{javascript} .= qq||;
- # $form->{"selectAP_amount"} =~ s/ selected//;
- # $form->{"selectAP_amount"} =~ s/option>\Q$form->{"AP_amount_$i"}\E/option selected>$form->{"AP_amount_$i"}/;
+ $form->header();
+
+ for my $i (1 .. $form->{rowcount}) {
# format amounts
- $form->{"amount_$i"} =
- $form->format_amount(\%myconfig, $form->{"amount_$i"}, 2);
-
- print qq|
-
- $amount |
- {"amount_$i"} $readonly> |
- $project |
-
- {"project_id_$i"}>
- |
- |
-
-|;
- $amount = "";
- $project = "";
- }
+ $form->{"amount_$i"} = $form->format_amount(\%myconfig, $form->{"amount_$i"}, 2);
+ $form->{"tax_$i"} = $form->format_amount(\%myconfig, $form->{"tax_$i"}, 2);
+
+ my $selected_accno_full;
+ my ($accno_row) = split(/--/, $form->{"AP_amount_$i"});
+ my $item = $charts{$accno_row};
+ $selected_accno_full = "$item->{accno}--$item->{tax_id}";
+
+ my $selected_taxchart = $form->{"taxchart_$i"};
+ my ($selected_accno, $selected_tax_id) = split(/--/, $selected_accno_full);
+ my ($previous_accno, $previous_tax_id) = split(/--/, $form->{"previous_AP_amount_$i"});
+
+ if ($previous_accno &&
+ ($previous_accno eq $selected_accno) &&
+ ($previous_tax_id ne $selected_tax_id)) {
+ my $item = $taxcharts{$selected_tax_id};
+ $selected_taxchart = "$item->{id}--$item->{rate}";
+ }
- $taxlabel =
- ($form->{taxincluded})
- ? $locale->text('Tax Included')
- : $locale->text('Tax');
+ $selected_taxchart = $taxchart_init unless ($form->{"taxchart_$i"});
- # format and reverse tax
- $form->{"tax"} = $form->format_amount(\%myconfig, $form->{"tax"}, 2);
+ $form->{'selected_accno_full_'. $i} = $selected_accno_full;
- print qq|
-
- ${taxlabel} |
- {"tax"} $readonly> |
- |
- | . $locale->text('Correct Tax') . qq| |
- |
-
-|;
+ $form->{'selected_taxchart_'. $i} = $selected_taxchart;
+ }
+ $form->{AP_amount_value_title_sub} = sub {
+ my $item = shift;
+ return [
+ $item->{accno} .'--'. $item->{tax_id},
+ $item->{accno} .'--'. $item->{description},
+ ];
+ };
+
+ $form->{taxchart_value_title_sub} = sub {
+ my $item = shift;
+ return [
+ $item->{id} .'--'. $item->{rate},
+ $item->{taxdescription} .' '. ($item->{rate} * 100) .' %',
+ ];
+ };
+
+ $form->{AP_paid_value_title_sub} = sub {
+ my $item = shift;
+ return [
+ $item->{accno},
+ $item->{accno} .'--'. $item->{description}
+ ];
+ };
+
+ $form->{APselected_value_title_sub} = sub {
+ my $item = shift;
+ return [
+ $item->{accno},
+ $item->{accno} .'--'. $item->{description}
+ ];
+ };
+
+ $form->{invtotal_unformatted} = $form->{invtotal};
$form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2);
- print qq|
-
- | . $locale->text('Total') . qq| |
- $form->{invtotal} |
-
- {oldinvtotal}>
- {oldtotalpaid}>
-
-
-
- |
- |
-
-
-
-
- | . $locale->text('Notes') . qq| |
- $notes |
-
-
- |
-
-
-
-
- |
-
-