Debitorenbuchungen: aktuellen Mahnstatus anzeigen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 1 Oct 2015 11:36:06 +0000 (13:36 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 1 Oct 2015 11:38:05 +0000 (13:38 +0200)
Der Mahnstatus wird nun analog zu Verkaufsrechnungen angezeigt.

bin/mozilla/ar.pl
templates/webpages/ar/form_header.html

index b1421d6..e299d90 100644 (file)
@@ -40,6 +40,7 @@ use SL::FU;
 use SL::IS;
 use SL::PE;
 use SL::DB::Default;
+use SL::DB::Invoice;
 use SL::ReportGenerator;
 
 require "bin/mozilla/arap.pl";
@@ -149,6 +150,7 @@ sub create_links {
   my %myconfig = %main::myconfig;
 
   $form->create_links("AR", \%myconfig, "customer");
+  $form->{invoice_obj} = $form->{id} ? SL::DB::Invoice->new(id => $form->{id})->load : undef;
 
   my %saved;
   if (!$params{dont_save}) {
index ee3aa5c..03fb634 100644 (file)
                 [% L.hidden_tag('customer_id', customer_id) %]
                 [% L.hidden_tag('terms', terms) %]
               </tr>
+[%- IF max_dunning_level || invoice_obj.dunning_config_id  %]
+              <tr>
+                <th align="right" valign="top">[% LxERP.t8("Dunning status") %]</th>
+                <td valign="top">
+                 [% IF invoice_obj.dunning_config_id %]
+                  <span class="dunned_invoice">[% LxERP.t8("This invoice's dunning level: #1", invoice_obj.dunning_config.dunning_description) %]</span>
+                  [% IF max_dunning_level %]<br>[% END %]
+                 [% END %]
+                 [% IF max_dunning_level %]
+                  <span class="customer_dunning_level">
+                   [% LxERP.t8("Customer's current maximum dunning level: #1", max_dunning_level) %]
+                   <br>
+                   [% LxERP.t8("Dunned open amount: #1", LxERP.format_amount(dunning_amount, 2)) %]
+                  </span>
+                 [% END %]
+                </td>
+              </tr>
+[%- END %]
               <tr>
                 <td></td>
                 <td colspan=3>