Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a6fbe7eb

Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt

  • ID a6fbe7eb6428672a902c46511b4c77c07c873604
  • Vorgänger 66631659
  • Nachfolger 80cf97a7

Mahnungen: Die Konfiguration so umgestellt, dass jetzt nicht mehr global entschieden wird, ob automatisch Rechnungen für die Mahngebühren und Zinsen erzeugt werden, sondern pro Mahnlevel. Die Dokumentation um die von Lx-Office erzeugten Namen für die Mahnungsvorlagen (auch für die Rechnung) erweitert.

Unterschiede anzeigen:

SL/DN.pm
61 61
  }
62 62

  
63 63
  $query =
64
    qq|SELECT
65
         dunning_create_invoices_for_fees, dunning_ar_amount_fee,
66
         dunning_ar_amount_interest,       dunning_ar
64
    qq|SELECT dunning_ar_amount_fee, dunning_ar_amount_interest, dunning_ar
67 65
       FROM defaults|;
68
  ($form->{create_invoices_for_fees}, $form->{AR_amount_fee},
69
   $form->{AR_amount_interest},       $form->{AR}           ) = selectrow_query($form, $dbh, $query);
66
  ($form->{AR_amount_fee}, $form->{AR_amount_interest}, $form->{AR}) = selectrow_query($form, $dbh, $query);
70 67

  
71 68
  $dbh->disconnect();
72 69

  
......
93 90
                 $form->{"email_subject_$i"}, $form->{"email_body_$i"},
94 91
                 $form->{"template_$i"}, $form->{"fee_$i"}, $form->{"interest_rate_$i"},
95 92
                 $form->{"active_$i"} ? 't' : 'f', $form->{"auto_$i"} ? 't' : 'f', $form->{"email_$i"} ? 't' : 'f',
96
                 $form->{"email_attachment_$i"} ? 't' : 'f', conv_i($form->{"payment_terms_$i"}), conv_i($form->{"terms_$i"}));
93
                 $form->{"email_attachment_$i"} ? 't' : 'f', conv_i($form->{"payment_terms_$i"}), conv_i($form->{"terms_$i"}),
94
                 $form->{"create_invoices_for_fees_$i"} ? 't' : 'f');
97 95
      if ($form->{"id_$i"}) {
98 96
        $query =
99 97
          qq|UPDATE dunning_config SET
......
101 99
               email_subject = ?, email_body = ?,
102 100
               template = ?, fee = ?, interest_rate = ?,
103 101
               active = ?, auto = ?, email = ?,
104
               email_attachment = ?, payment_terms = ?, terms = ?
102
               email_attachment = ?, payment_terms = ?, terms = ?,
103
               create_invoices_for_fees = ?
105 104
             WHERE id = ?|;
106 105
        push(@values, conv_i($form->{"id_$i"}));
107 106
      } else {
......
109 108
          qq|INSERT INTO dunning_config
110 109
               (dunning_level, dunning_description, email_subject, email_body,
111 110
                template, fee, interest_rate, active, auto, email,
112
                email_attachment, payment_terms, terms)
111
                email_attachment, payment_terms, terms, create_invoices_for_fees)
113 112
             VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)|;
114 113
      }
115 114
      do_query($form, $dbh, $query, @values);
......
121 120
    }
122 121
  }
123 122

  
124
  $query  = qq|UPDATE defaults SET dunning_create_invoices_for_fees = ?|;
125
  @values = ($form->{create_invoices_for_fees} ? 't' : 'f');
126

  
127
  if ($form->{create_invoices_for_fees}) {
128
    $query .= qq|, dunning_ar_amount_fee = ?, dunning_ar_amount_interest = ?, dunning_ar = ?|;
129
    push @values, conv_i($form->{AR_amount_fee}), conv_i($form->{AR_amount_interest}), conv_i($form->{AR});
130
  }
131

  
123
  $query  = qq|UPDATE defaults SET dunning_ar_amount_fee = ?, dunning_ar_amount_interest = ?, dunning_ar = ?|;
124
  @values = (conv_i($form->{AR_amount_fee}), conv_i($form->{AR_amount_interest}), conv_i($form->{AR}));
132 125
  do_query($form, $dbh, $query, @values);
133 126

  
134 127
  $dbh->commit();
......
144 137

  
145 138
  my ($query, @values, $sth, $ref);
146 139

  
147
  $query =
148
    qq|SELECT
149
         dunning_create_invoices_for_fees, dunning_ar_amount_fee,
150
         dunning_ar_amount_interest, dunning_ar
151
       FROM defaults|;
152
  ($form->{create_invoices_for_fees}, $form->{AR_amount_fee},
153
   $form->{AR_amount_interest},       $form->{AR}           ) = selectrow_query($form, $dbh, $query);
140
  $query = qq|SELECT dcfg.create_invoices_for_fees
141
              FROM dunning d
142
              LEFT JOIN dunning_config dcfg ON (d.dunning_config_id = dcfg.id)
143
              WHERE d.dunning_id = ?|;
144
  my ($create_invoices_for_fees) = selectrow_query($form, $dbh, $query, $dunning_id);
154 145

  
155
  if (!$form->{create_invoices_for_fees}) {
146
  if (!$create_invoices_for_fees) {
156 147
    $main::lxdebug->leave_sub();
157 148
    return;
158 149
  }
159 150

  
151
  $query = qq|SELECT dunning_ar_amount_fee, dunning_ar_amount_interest, dunning_ar FROM defaults|;
152
  ($form->{AR_amount_fee}, $form->{AR_amount_interest}, $form->{AR}) = selectrow_query($form, $dbh, $query);
153

  
160 154
  $query =
161 155
    qq|SELECT
162 156
         fee,
......
337 331
    $self->send_email($myconfig, $form, $dunning_id, $dbh);
338 332
  }
339 333

  
340
  $dbh->commit();
334
#   $dbh->commit();
341 335
  $dbh->disconnect();
342 336

  
343 337
  $main::lxdebug->leave_sub();
doc/dokumentenvorlagen-und-variablen.html
85 85
    Variablen in Mahnungen und Rechnungen &uuml;ber Mahngeb&uuml;hren</a>
86 86

  
87 87
   <ol>
88
    <li><a href="dokumentenvorlagen-und-variablen.html#dunning_vorlagennamen">
89
      Namen der Vorlagen</a></li>
90

  
88 91
    <li><a href="dokumentenvorlagen-und-variablen.html#dunning_allgemein">
89 92
      Allgemeine Variablen in Mahnungen</a></li>
90 93

  
......
775 778

  
776 779
 <h2><a name="dunning">Variablen in Mahnungen und Rechnungen &uuml;ber Mahngeb&uuml;hren</a></h2>
777 780

  
781
 <h3><a name="dunning_vorlagennamen">Namen der Vorlagen</a></h3>
782

  
783
 <p>Die Namen der Vorlagen werden im System-Men&uuml; vom Benutzer
784
  eingegeben. Wird f&uuml;r ein Mahnlevel die Option zur automatischen
785
  Erstellung einer Rechnung &uuml;ber die Mahngeb&uuml;hren und Zinsen
786
  aktiviert, so wird der Name der Vorlage f&uuml;r diese Rechnung aus
787
  dem Vorlagenname f&uuml;r diese Mahnstufe mit dem
788
  Zusatz <code>_invoice</code> gebildet. Weiterhin werden die
789
  K&uuml;rzel f&uuml;r die ausgew&auml;hlte Sprache und den
790
  ausgew&auml;hlten Drucker angeh&auml;ngt.</p>
791

  
778 792
 <h3><a name="dunning_allgemein">Allgemeine Variablen in Mahnungen:</a></h3>
779 793

  
780 794
 <p>Die Variablen des Verk?ufers stehen wie gewohnt
locale/de/all
166 166
  'Aug'                         => 'Aug',
167 167
  'August'                      => 'August',
168 168
  'Auto Send?'                  => 'Auto. Versand?',
169
  'Automatically create customer invoices for fees and interests' => 'Automatisches Erstellen von Debitorenrechnungen &uuml;ber Mahngeb&uuml;hren und Zinsen',
170 169
  'Automatically created invoice for fee and interest for dunning %s' => 'Automatisch erzeugte Rechnung f?r Geb?hren und Zinsen zu Mahnung %s',
171 170
  'BOM'                         => 'St?ckliste',
172 171
  'BWA'                         => 'BWA',
......
293 292
  'Create Buchungsgruppen'      => 'Buchungsgruppe erfassen',
294 293
  'Create Chart of Accounts'    => 'Kontenplan anlegen',
295 294
  'Create Dataset'              => 'Datenbank anlegen',
295
  'Create invoice?'             => 'Rechnung erstellen?',
296 296
  'Create new'                  => 'Neu erfassen',
297 297
  'Credit'                      => 'Haben',
298 298
  'Credit Account'              => 'Habenkonto',
......
551 551
  'II'                          => 'II',
552 552
  'III'                         => 'III',
553 553
  'IV'                          => 'IV',
554
  'If the automatic creation of invoices for fees and interest is switched on for a dunning level then the following accounts will be used for the invoice.' => 'Wenn das automatische Erstellen einer Rechnung &uuml;ber Mahngeb&uuml;hren und Zinsen f&uuml;r ein Mahnlevel aktiviert ist, so werden die folgenden Konten f&uuml;r die Rechnung benutzt.',
554 555
  'If you see this message, you most likely just setup your LX-Office and haven\'t added any entry types. If this is the case, the option is accessible for administrators in the System menu.' => 'Wenn Sie diese Meldung sehen haben Sie wahrscheinlich ein frisches LX-Office Setup und noch keine Buchungsgruppen eingerichtet. Ein Administrator kann dies im Systemmen&uuml; erledigen.',
555 556
  'If you want to delete such a dataset you have to edit the user(s) that are using the dataset in question and have them use another dataset.' => 'Wenn Sie eine solche Datenbank l&ouml;schen wollen, so m&uuml;ssen Sie zuerst die Benutzer bearbeiten, die die fragliche Datenbank benutzen, und sie so &auml;ndern, dass sie eine andere Datenbank benutzen.',
556 557
  'Image'                       => 'Grafik',
sql/Pg-upgrade2/dunning_invoices_per_dunning_level.sql
1
-- @tag: dunning_invoices_per_dunning_level
2
-- @description: Umstellung der Konfiguration f&uuml;r das automatische Erzeugen von Rechnungen &uuml;ber Mahngeb&uuml;hren von &quot;global&quot; auf &quot;pro Mahnlevel&quot;
3
-- @depends: dunning_invoices_for_fees
4
ALTER TABLE dunning_config ADD COLUMN create_invoices_for_fees boolean;
5
ALTER TABLE dunning_config ALTER COLUMN create_invoices_for_fees SET DEFAULT TRUE;
6
UPDATE dunning_config SET create_invoices_for_fees =
7
  (SELECT dunning_create_invoices_for_fees FROM defaults LIMIT 1);
8
ALTER TABLE defaults DROP COLUMN dunning_create_invoices_for_fees;
templates/webpages/dunning/edit_config_de.html
2 2
 <script type="text/javascript" src="js/common.js"></script>
3 3
 <script type="text/javascript" src="js/dunning.js"></script>
4 4

  
5
 <script type="text/javascript">
6
  <!--
7
      function enable_invoice_controls(enable) {
8
        document.Form.AR.disabled                 = !enable;
9
        document.Form.AR_amount_fee.disabled      = !enable;
10
        document.Form.AR_amount_interest.disabled = !enable;
11
      }
12
    -->
13
 </script>
14

  
15 5
 <div class="listtop" width="100%">[% title %]</div>
16 6

  
17 7
 <form method="post" action="dn.pl" name="Form">
......
22 12
    <th class="listheading">Mahnlevel</th>
23 13
    <th class="listheading">Mahnstufenbeschreibung</th>
24 14
    <th class="listheading">Aktiviert?</th>
25
    <th class="listheading">Auto. Versand?</th>
26 15
    <th class="listheading">eMail-Versand?</th>
16
<!--     <th class="listheading">Auto. Versand?</th>  -->
17
    <th class="listheading">Rechnung erstellen?</th>
27 18
    <th class="listheading">Fristsetzung</th>
28 19
    <th class="listheading">F?llikeitsdatum +Tage</th>
29 20
    <th class="listheading">Geb?hr</th>
......
51 42
      <input type="hidden" name="email_attachment_[% DUNNING_it.count %]" value="[% HTML.escape(row.email_attachment) %]">
52 43
     </td>
53 44

  
54
     <td><input type="checkbox" name="auto_[% DUNNING_it.count %]" value="1" [% IF row.auto %]checked[% END %]></td>
45
<!--      <td><input type="checkbox" name="auto_[% DUNNING_it.count %]" value="1" [% IF row.auto %]checked[% END %]></td> -->
46
     <td><input type="checkbox" name="create_invoices_for_fees_[% DUNNING_it.count %]" value="1" [% IF row.create_invoices_for_fees %]checked[% END %]></td>
55 47
     <td><input name="payment_terms_[% DUNNING_it.count %]" size="3" value="[% HTML.escape(row.payment_terms) %]"></td>
56 48
     <td><input name="terms_[% DUNNING_it.count %]" size="3" value="[% HTML.escape(row.terms) %]"></td>
57 49
     <td><input name="fee_[% DUNNING_it.count %]" size="5" value="[% HTML.escape(row.fee) %]"></td>
......
80 72
     <input type="hidden" name="email_attachment_[% rowcount %]">
81 73
    </td>
82 74

  
83
    <td><input type="checkbox" name="auto_[% rowcount %]" value="1" checked></td>
75
<!--     <td><input type="checkbox" name="auto_[% rowcount %]" value="1" checked></td> -->
76
    <td><input type="checkbox" name="create_invoices_for_fees_[% rowcount %]" value="1" checked></td>
84 77
    <td><input name="payment_terms_[% rowcount %]" size="3"></td>
85 78
    <td><input name="terms_[% rowcount %]" size="3"></td>
86 79
    <td><input name="fee_[% rowcount %]" size="5"></td>
......
93 86

  
94 87
  <hr size="3" noshade>
95 88

  
96
  <p>
97
   <input type="checkbox" name="create_invoices_for_fees" id="create_invoices_for_fees"
98
          [% IF create_invoices_for_fees %]checked[% END %]
99
          value="1" onclick="enable_invoice_controls(this.checked);">
100
   <label for="create_invoices_for_fees">Automatisches Erstellen von Debitorenrechnungen &uuml;ber Mahngeb&uuml;hren und Zinsen</label>
101
  </p>
89
  <p>Wenn das automatische Erstellen einer Rechnung &uuml;ber Mahngeb&uuml;hren und Zinsen f&uuml;r ein Mahnlevel aktiviert ist, so werden die folgenden Konten f&uuml;r die Rechnung benutzt.</p>
102 90

  
103 91
  <table>
104 92
   <tr>
105 93
    <th align="right">Konto f&uuml;r Geb&uuml;hren</th>
106 94
    <td>
107
     <select name="AR_amount_fee" [% UNLESS create_invoices_for_fees %]disabled[% END %]>
95
     <select name="AR_amount_fee">
108 96
      [% FOREACH row = SELECT_AR_AMOUNT %]<option value="[% HTML.escape(row.id) %]" [% IF row.AR_amount_fee_selected %]selected[% END %]>[% HTML.escape(row.accno) %]--[% HTML.escape(row.description) %]</option>
109 97
      [% END %]
110 98
     </select>
......
114 102
   <tr>
115 103
    <th align="right">Konto f&uuml;r Zinsen</th>
116 104
    <td>
117
     <select name="AR_amount_interest" [% UNLESS create_invoices_for_fees %]disabled[% END %]>
105
     <select name="AR_amount_interest">
118 106
      [% FOREACH row = SELECT_AR_AMOUNT %]<option value="[% HTML.escape(row.id) %]" [% IF row.AR_amount_interest_selected %]selected[% END %]>[% HTML.escape(row.accno) %]--[% HTML.escape(row.description) %]</option>
119 107
      [% END %]
120 108
     </select>
......
124 112
   <tr>
125 113
    <th align="right">Buchen auf</th>
126 114
    <td>
127
     <select name="AR" [% UNLESS create_invoices_for_fees %]disabled[% END %]>
115
     <select name="AR">
128 116
      [% FOREACH row = SELECT_AR %]<option value="[% HTML.escape(row.id) %]" [% IF row.AR_selected %]selected[% END %]>[% HTML.escape(row.accno) %]--[% HTML.escape(row.description) %]</option>
129 117
      [% END %]
130 118
     </select>
templates/webpages/dunning/edit_config_master.html
2 2
 <script type="text/javascript" src="js/common.js"></script>
3 3
 <script type="text/javascript" src="js/dunning.js"></script>
4 4

  
5
 <script type="text/javascript">
6
  <!--
7
      function enable_invoice_controls(enable) {
8
        document.Form.AR.disabled                 = !enable;
9
        document.Form.AR_amount_fee.disabled      = !enable;
10
        document.Form.AR_amount_interest.disabled = !enable;
11
      }
12
    -->
13
 </script>
14

  
15 5
 <div class="listtop" width="100%">[% title %]</div>
16 6

  
17 7
 <form method="post" action="dn.pl" name="Form">
......
22 12
    <th class="listheading"><translate>Dunning Level</translate></th>
23 13
    <th class="listheading"><translate>Dunning Description</translate></th>
24 14
    <th class="listheading"><translate>Active?</translate></th>
25
    <th class="listheading"><translate>Auto Send?</translate></th>
26 15
    <th class="listheading"><translate>eMail Send?</translate></th>
16
<!--     <th class="listheading"><translate>Auto Send?</translate></th>  -->
17
    <th class="listheading"><translate>Create invoice?</translate></th>
27 18
    <th class="listheading"><translate>Fristsetzung</translate></th>
28 19
    <th class="listheading"><translate>Duedate +Days</translate></th>
29 20
    <th class="listheading"><translate>Fee</translate></th>
......
51 42
      <input type="hidden" name="email_attachment_[% DUNNING_it.count %]" value="[% HTML.escape(row.email_attachment) %]">
52 43
     </td>
53 44

  
54
     <td><input type="checkbox" name="auto_[% DUNNING_it.count %]" value="1" [% IF row.auto %]checked[% END %]></td>
45
<!--      <td><input type="checkbox" name="auto_[% DUNNING_it.count %]" value="1" [% IF row.auto %]checked[% END %]></td> -->
46
     <td><input type="checkbox" name="create_invoices_for_fees_[% DUNNING_it.count %]" value="1" [% IF row.create_invoices_for_fees %]checked[% END %]></td>
55 47
     <td><input name="payment_terms_[% DUNNING_it.count %]" size="3" value="[% HTML.escape(row.payment_terms) %]"></td>
56 48
     <td><input name="terms_[% DUNNING_it.count %]" size="3" value="[% HTML.escape(row.terms) %]"></td>
57 49
     <td><input name="fee_[% DUNNING_it.count %]" size="5" value="[% HTML.escape(row.fee) %]"></td>
......
80 72
     <input type="hidden" name="email_attachment_[% rowcount %]">
81 73
    </td>
82 74

  
83
    <td><input type="checkbox" name="auto_[% rowcount %]" value="1" checked></td>
75
<!--     <td><input type="checkbox" name="auto_[% rowcount %]" value="1" checked></td> -->
76
    <td><input type="checkbox" name="create_invoices_for_fees_[% rowcount %]" value="1" checked></td>
84 77
    <td><input name="payment_terms_[% rowcount %]" size="3"></td>
85 78
    <td><input name="terms_[% rowcount %]" size="3"></td>
86 79
    <td><input name="fee_[% rowcount %]" size="5"></td>
......
93 86

  
94 87
  <hr size="3" noshade>
95 88

  
96
  <p>
97
   <input type="checkbox" name="create_invoices_for_fees" id="create_invoices_for_fees"
98
          [% IF create_invoices_for_fees %]checked[% END %]
99
          value="1" onclick="enable_invoice_controls(this.checked);">
100
   <label for="create_invoices_for_fees"><translate>Automatically create customer invoices for fees and interests</translate></label>
101
  </p>
89
  <p><translate>If the automatic creation of invoices for fees and
90
    interest is switched on for a dunning level then the following
91
    accounts will be used for the invoice.</translate></p>
102 92

  
103 93
  <table>
104 94
   <tr>
105 95
    <th align="right"><translate>Account for fees</translate></th>
106 96
    <td>
107
     <select name="AR_amount_fee" [% UNLESS create_invoices_for_fees %]disabled[% END %]>
97
     <select name="AR_amount_fee">
108 98
      [% FOREACH row = SELECT_AR_AMOUNT %]<option value="[% HTML.escape(row.id) %]" [% IF row.AR_amount_fee_selected %]selected[% END %]>[% HTML.escape(row.accno) %]--[% HTML.escape(row.description) %]</option>
109 99
      [% END %]
110 100
     </select>
......
114 104
   <tr>
115 105
    <th align="right"><translate>Account for interest</translate></th>
116 106
    <td>
117
     <select name="AR_amount_interest" [% UNLESS create_invoices_for_fees %]disabled[% END %]>
107
     <select name="AR_amount_interest">
118 108
      [% FOREACH row = SELECT_AR_AMOUNT %]<option value="[% HTML.escape(row.id) %]" [% IF row.AR_amount_interest_selected %]selected[% END %]>[% HTML.escape(row.accno) %]--[% HTML.escape(row.description) %]</option>
119 109
      [% END %]
120 110
     </select>
......
124 114
   <tr>
125 115
    <th align="right"><translate>Record in</translate></th>
126 116
    <td>
127
     <select name="AR" [% UNLESS create_invoices_for_fees %]disabled[% END %]>
117
     <select name="AR">
128 118
      [% FOREACH row = SELECT_AR %]<option value="[% HTML.escape(row.id) %]" [% IF row.AR_selected %]selected[% END %]>[% HTML.escape(row.accno) %]--[% HTML.escape(row.description) %]</option>
129 119
      [% END %]
130 120
     </select>

Auch abrufbar als: Unified diff