-
-
-
-$jsscript
-|;
-
- $amount = $locale->text('Amount');
- $project = $locale->text('Project');
-
- for $i (1 .. 1) {
-
- # $form->{"selectAP_amount"} =~ s/ selected//;
- # $form->{"selectAP_amount"} =~ s/option>\Q$form->{"AP_amount_$i"}\E/option selected>$form->{"AP_amount_$i"}/;
+ foreach my $item (@{ $form->{ALL_CHARTS} }) {
+ if ( grep({ $_ eq 'AP_amount' } @{ $item->{link_split} }) ) {
+ $default_ap_amount_chart_id //= $item->{id};
- # 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 = "";
+ } elsif ( grep({ $_ eq 'AP_paid' } @{ $item->{link_split} }) ) {
+ push(@{ $form->{ALL_CHARTS_AP_paid} }, $item);
+ }
+
+ $charts{$item->{accno}} = $item;
}
- $taxlabel =
- ($form->{taxincluded})
- ? $locale->text('Tax Included')
- : $locale->text('Tax');
+ my $follow_up_vc = $form->{vendor_id} ? SL::DB::Vendor->load_cached($form->{vendor_id})->name : '';
+ my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)";
- # format and reverse tax
- $form->{"tax"} = $form->format_amount(\%myconfig, $form->{"tax"}, 2);
+ $::request->layout->add_javascripts("autocomplete_chart.js", "autocomplete_customer.js", "show_vc_details.js", "show_history.js", "follow_up.js", "kivi.Draft.js", "kivi.GL.js", "kivi.RecordTemplate.js", "kivi.File.js", "kivi.AP.js");
+ my $transdate = $::form->{transdate} ? DateTime->from_kivitendo($::form->{transdate}) : DateTime->today_local;
+ my $first_taxchart;
- print qq|
-
- | ${taxlabel} |
- {"tax"} $readonly> |
- |
- | . $locale->text('Correct Tax') . qq| |
- |
-
-|;
+ # $form->{totalpaid} is used by the action bar setup to determine
+ # whether or not canceling is allowed. Therefore it must be
+ # calculated prior to the action bar setup.
+ $form->{totalpaid} = sum map { $form->{"paid_${_}"} } (1..$form->{paidaccounts});
- $form->{invtotal} = $form->format_amount(\%myconfig, $form->{invtotal}, 2);
+ setup_ap_display_form_action_bar();
- print qq|
-
- | | . $locale->text('Total') . qq| |
- $form->{invtotal} |
-
- {oldinvtotal}>
- {oldtotalpaid}>
-
-
-
- |
- |
-
-
-
-
- | | . $locale->text('Notes') . qq| |
- $notes |
-
-
- |
-
-
- |
-
- |
-
-