Verkaufsrechnungen: Checkbox für "Lastschrifteinzug"; Vorbelegung aus Stammdaten
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 10 Jan 2013 12:03:34 +0000 (13:03 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 10 Jan 2013 13:03:10 +0000 (14:03 +0100)
SL/DB/MetaSetup/Invoice.pm
SL/IS.pm
locale/de/all
sql/Pg-upgrade2/ar_add_direct_debit.sql [new file with mode: 0644]
templates/webpages/is/form_footer.html

index 854b9c7..839c67b 100644 (file)
@@ -56,6 +56,7 @@ __PACKAGE__->meta->setup(
     marge_percent             => { type => 'numeric', precision => 5, scale => 15 },
     donumber                  => { type => 'text' },
     invnumber_for_credit_note => { type => 'text' },
+    direct_debit              => { type => 'boolean', default => 'false' },
   ],
 
   primary_key_columns => [ 'id' ],
index 13b86fb..b8dd8ee 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -1017,7 +1017,7 @@ sub post_invoice {
                 cp_id       = ?, marge_total   = ?, marge_percent = ?,
                 globalproject_id               = ?, delivery_customer_id             = ?,
                 transaction_description        = ?, delivery_vendor_id               = ?,
-                donumber    = ?, invnumber_for_credit_note = ?
+                donumber    = ?, invnumber_for_credit_note = ?,        direct_debit  = ?
               WHERE id = ?|;
   @values = (          $form->{"invnumber"},           $form->{"ordnumber"},             $form->{"quonumber"},          $form->{"cusordnumber"},
              conv_date($form->{"invdate"}),  conv_date($form->{"orddate"}),    conv_date($form->{"quodate"}),    conv_i($form->{"customer_id"}),
@@ -1030,7 +1030,7 @@ sub post_invoice {
                 conv_i($form->{"cp_id"}),            1 * $form->{marge_total} ,      1 * $form->{marge_percent},
                 conv_i($form->{"globalproject_id"}),                              conv_i($form->{"delivery_customer_id"}),
                        $form->{transaction_description},                          conv_i($form->{"delivery_vendor_id"}),
-                       $form->{"donumber"}, $form->{"invnumber_for_credit_note"},
+                       $form->{"donumber"}, $form->{"invnumber_for_credit_note"},        $form->{direct_debit} ? 't' : 'f',
                 conv_i($form->{"id"}));
   do_query($form, $dbh, $query, @values);
 
@@ -1508,7 +1508,7 @@ sub retrieve_invoice {
            a.employee_id, a.salesman_id, a.payment_id,
            a.language_id, a.delivery_customer_id, a.delivery_vendor_id, a.type,
            a.transaction_description, a.donumber, a.invnumber_for_credit_note,
-           a.marge_total, a.marge_percent,
+           a.marge_total, a.marge_percent, a.direct_debit,
            e.name AS employee
          FROM ar a
          LEFT JOIN employee e ON (e.id = a.employee_id)
@@ -1684,7 +1684,7 @@ sub get_customer {
          c.email, c.cc, c.bcc, c.language_id, c.payment_id,
          c.street, c.zipcode, c.city, c.country,
          c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, c.curr,
-         c.taxincluded_checked,
+         c.taxincluded_checked, c.direct_debit,
          $duedate + COALESCE(pt.terms_netto, 0) AS duedate,
          b.discount AS tradediscount, b.description AS business
        FROM customer c
index ce6525e..cf6eafc 100644 (file)
@@ -2333,7 +2333,7 @@ $self->{texts} = {
   'delete'                      => 'Löschen',
   'delivered'                   => 'geliefert',
   'deliverydate'                => 'Lieferdatum',
-  'direct debit'                => 'Lastschrift',
+  'direct debit'                => 'Lastschrifteinzug',
   'disposed'                    => 'Entsorgung',
   'do not include'              => 'Nicht aufnehmen',
   'done'                        => 'erledigt',
diff --git a/sql/Pg-upgrade2/ar_add_direct_debit.sql b/sql/Pg-upgrade2/ar_add_direct_debit.sql
new file mode 100644 (file)
index 0000000..c4b4842
--- /dev/null
@@ -0,0 +1,7 @@
+-- @tag: ar_add_direct_debit
+-- @description: Spalte für Bankeinzug bei Verkaufsrechnungen
+-- @depends: release_3_0_0
+-- @charset: utf-8
+ALTER TABLE ar ADD COLUMN direct_debit boolean;
+ALTER TABLE ar ALTER COLUMN direct_debit SET DEFAULT FALSE;
+UPDATE ar SET direct_debit = FALSE;
index deccd79..79bbdb1 100644 (file)
@@ -1,6 +1,7 @@
 [%- USE T8 %]
 [%- USE HTML %]
 [%- USE LxERP %]
+[%- USE L %]
   <tr>
    <td>
     <table width="100%">
@@ -29,6 +30,8 @@
                  show_empty    = 1
                  allow_textbox = 0 -%]
           <script type='text/javascript'>$('#payment_id').change(function(){ if (this.value) set_duedate()})</script>
+          <br>
+          [%- L.checkbox_tag('direct_debit', 'checked', direct_debit, 'label', LxERP.t8('direct debit')) %]
          </td>
         </tr>
 [%- IF id && follow_ups.size %]