Dunning: Email und Zahlungsbedingung in Mahnlaufbericht aufgenommen
authorWerner Hahn <wh@futureworldsearch.net>
Tue, 22 Mar 2022 13:33:11 +0000 (14:33 +0100)
committerWerner Hahn <wh@futureworldsearch.net>
Fri, 20 May 2022 06:31:39 +0000 (08:31 +0200)
SL/DN.pm
templates/webpages/dunning/show_invoices.html

index 28eb6af..76ee1b8 100644 (file)
--- a/SL/DN.pm
+++ b/SL/DN.pm
@@ -657,8 +657,9 @@ sub get_invoices {
          ct.name AS customername, a.customer_id, a.duedate,
          a.amount - a.paid AS open_amount,
          a.direct_debit,
+         pt.description as payment_term,
          dep.description as departmentname,
-
+         ct.invoice_mail AS cv_email,
          cfg.dunning_description, cfg.dunning_level,
 
          d.transdate AS dunning_date, d.duedate AS dunning_duedate,
@@ -676,6 +677,7 @@ sub get_invoices {
 
        LEFT JOIN customer ct ON (a.customer_id = ct.id)
        LEFT JOIN department dep ON (a.department_id = dep.id)
+       LEFT JOIN payment_terms pt ON (a.payment_id = pt.id)
        LEFT JOIN dunning_config cfg ON (a.dunning_config_id = cfg.id)
        LEFT JOIN dunning_config nextcfg ON
          (nextcfg.id =
index bfa979d..949d060 100644 (file)
@@ -20,6 +20,7 @@
   <table width="100%" id="dunning_invoice_list">
    <th class="listheading" colspan="2">[% 'Current / Next Level' | $T8 %]</th>
 
+   <th class="listheading">[% 'Payment description' | $T8 %]</th>
    <th class="listheading">
     [% L.checkbox_tag('selectall_active', checkall='INPUT[name*=active_]', checked=all_active) %]
     <label for="selectall_active">[% 'Active?' | $T8 %]</label>
        [% FOREACH cfg_row = row.DUNNING_CONFIG %]<option value="[% HTML.escape(cfg_row.id) %]" [% IF cfg_row.SELECTED %]selected[% END %]>[% HTML.escape(cfg_row.dunning_description) %]</option>[% END %]
       </select>
      </td>
+     <td>[% HTML.escape(row.payment_term) %]</td>
 
      <td><input type="checkbox" name="active_[% loop.count %]" value="1" [% IF row.active %]checked[% END %]></td>
-     <td><input type="checkbox" name="email_[% loop.count %]" value="1" [% IF row.email %]checked[% END %]></td>
+     <td><input type="checkbox" name="email_[% loop.count %]" value="1" [% IF row.email && row.cv_email %]checked[% END %]>[% HTML.escape(row.cv_email) %]</td>
      <td><input type="checkbox" name="include_invoice_[% loop.count %]" value="1" [% IF row.print_original_invoice %]checked[% END %]></td>
      <td><input type="hidden" name="customername_[% loop.count %]" size="6" value="[% HTML.escape(row.customername) %]">[% HTML.escape(row.customername) %]</td>
      <td><input type="hidden" name="department_[% loop.count %]" size="6" value="[% HTML.escape(row.departmentname) %]">[% HTML.escape(row.departmentname) %]</td>