behebt #243
authorJan Büren <jan@kivitendo-premium.de>
Fri, 19 May 2017 13:53:27 +0000 (15:53 +0200)
committerJan Büren <jan@kivitendo-premium.de>
Fri, 19 May 2017 14:02:13 +0000 (16:02 +0200)
Kontoauszug verbuchen: Buchung erstellen ist jetzt ein Schritt
Falls die Zahlung für die Buchung entsprechend passend ist, wird
diese automatisch im zweiten Schritt als Vorschlag angezeigt.
Entsprechende Info an den Benutzer.

SL/Controller/BankTransaction.pm
bin/mozilla/ap.pl
templates/webpages/ap/form_header.html

index 52d43e1..b4c7adc 100644 (file)
@@ -890,17 +890,16 @@ sub load_ap_record_template_url {
   my ($self, $template) = @_;
 
   return $self->url_for(
-    controller                 => 'ap.pl',
-    action                     => 'load_record_template',
-    id                         => $template->id,
-    'form_defaults.amount_1'   => $::form->format_amount(\%::myconfig, -1 * $self->transaction->amount, 2),
-    'form_defaults.transdate'  => $self->transaction->transdate_as_date,
-    'form_defaults.duedate'    => $self->transaction->transdate_as_date,
-    'form_defaults.datepaid_1' => $self->transaction->transdate_as_date,
-    'form_defaults.paid_1'     => $::form->format_amount(\%::myconfig, -1 * $self->transaction->amount, 2),
-    'form_defaults.currency'   => $self->transaction->currency->name,
-    'form_defaults.AP_paid_1'  => $self->transaction->local_bank_account->chart->accno,
-    'form_defaults.callback'   => $self->callback,
+    controller                           => 'ap.pl',
+    action                               => 'load_record_template',
+    id                                   => $template->id,
+    'form_defaults.amount_1'             => $::form->format_amount(\%::myconfig, -1 * $self->transaction->amount, 2),
+    'form_defaults.transdate'            => $self->transaction->transdate_as_date,
+    'form_defaults.duedate'              => $self->transaction->transdate_as_date,
+    'form_defaults.no_payment_bookings'  => 1,
+    'form_defaults.paid_1_suggestion'    => $::form->format_amount(\%::myconfig, -1 * $self->transaction->amount, 2),
+    'form_defaults.AP_paid_1_suggestion' => $self->transaction->local_bank_account->chart->accno,
+    'form_defaults.callback'             => $self->callback,
   );
 }
 
index a6e36da..0e7baf3 100644 (file)
@@ -154,6 +154,12 @@ sub load_record_template {
   $::form->{$_} = $form_defaults->{$_} for keys %{ $form_defaults // {} };
 
   flash('info', $::locale->text("The record template '#1' has been loaded.", $template->template_name));
+  flash('info', $::locale->text("Payment bookings disallowed. After the booking this record may be
+                                 suggested with the amount of '#1' or otherwise has to be choosen manually.
+                                 No automatic payment booking will be done to chart '#2'.",
+                                  $form_defaults->{paid_1_suggestion},
+                                  $form_defaults->{AP_paid_1_suggestion},
+                                )) if $::form->{no_payment_bookings};
 
   update(
     keep_rows_without_amount => 1,
index dc3f96f..66555bd 100644 (file)
   </tr>
   <tr>
     <td>
+      [% UNLESS no_payment_bookings %]
       <table width="100%">
         <tr class="listheading">
           <th class="listheading" colspan="7">[% 'Payments' | $T8 %]</th>
           <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td>
         </tr>
       </table>
+      [% END %]
     </td>
   </tr>
 </table>