Beim Speichern/Anlegen von Mahstufen müssen die Kundendaten vor dem Generieren der...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 2 May 2007 11:00:08 +0000 (11:00 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 2 May 2007 11:00:08 +0000 (11:00 +0000)
SL/DN.pm

index 9288156..008a538 100644 (file)
--- a/SL/DN.pm
+++ b/SL/DN.pm
@@ -159,9 +159,12 @@ sub save_dunning {
          ar.transdate, ar.duedate, paid, amount - paid AS open_amount,
          template AS formname, email_subject, email_body, email_attachment,
          da.fee, da.interest, da.transdate AS dunning_date,
-         da.duedate AS dunning_duedate
-       FROM ar LEFT JOIN dunning_config ON (dunning_config.id = ar.dunning_config_id)
+         da.duedate AS dunning_duedate,
+         c.name, c.street, c.zipcode, c.city, c.country, c.department_1, c.department_2
+       FROM ar
+       LEFT JOIN dunning_config ON (dunning_config.id = ar.dunning_config_id)
        LEFT JOIN dunning da ON (ar.id = da.trans_id AND dunning_config.dunning_level = da.dunning_level)
+       LEFT JOIN customer c ON (ar.customer_id = c.id)
        WHERE ar.id IN (|
        . join(", ", map("?", @{ $form->{"inv_ids"} })) . qq|)|;