Merge von 833,836-838 aus unstable: Lieferdatum in Rechnungen
[kivitendo-erp.git] / SL / IS.pm
index 9c4f50b..a5b00f0 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -805,8 +805,9 @@ sub post_invoice {
   # set values which could be empty to 0
   $form->{terms}       *= 1;
   $form->{taxincluded} *= 1;
-  my $datepaid = ($form->{paid})    ? qq|'$form->{datepaid}'| : "NULL";
-  my $duedate  = ($form->{duedate}) ? qq|'$form->{duedate}'|  : "NULL";
+  my $datepaid     = ($form->{paid})         ? qq|'$form->{datepaid}'| : "NULL";
+  my $duedate      = ($form->{duedate})      ? qq|'$form->{duedate}'|  : "NULL";
+  my $deliverydate = ($form->{deliverydate}) ? qq|'$form->{deliverydate}'| : "NULL";
 
   # fill in subject if there is none
   $form->{subject} = qq|$form->{label} $form->{invnumber}|
@@ -839,6 +840,7 @@ Message: $form->{message}\r| if $form->{message};
               paid = $form->{paid},
              datepaid = $datepaid,
              duedate = $duedate,
+              deliverydate = $deliverydate,
              invoice = '1',
              shippingpoint = '$form->{shippingpoint}',
              shipvia = '$form->{shipvia}',
@@ -1164,7 +1166,7 @@ sub retrieve_invoice {
 
     # retrieve invoice
     $query = qq|SELECT a.invnumber, a.ordnumber, a.quonumber, a.cusordnumber,
-                a.transdate AS invdate, a.paid,
+                a.transdate AS invdate, a.deliverydate, a.paid,
                 a.shippingpoint, a.shipvia, a.terms, a.notes, a.intnotes,
                a.duedate, a.taxincluded, a.curr AS currency,
                a.employee_id, e.name AS employee