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();

Auch abrufbar als: Unified diff