westermm hat völlig zu Recht auf die Änderungen in Revision 3512 hingewiesen. Das...
[kivitendo-erp.git] / SL / IR.pm
index f1c9197..72a36ae 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -35,6 +35,7 @@
 package IR;
 
 use SL::AM;
+use SL::ARAP;
 use SL::Common;
 use SL::DBUtils;
 use SL::DO;
@@ -562,6 +563,11 @@ sub post_invoice {
                               'to_id'      => $form->{id},
       );
   }
+  delete $form->{convert_from_do_ids};
+
+  ARAP->close_orders_if_billed('dbh'     => $dbh,
+                               'arap_id' => $form->{id},
+                               'table'   => 'ap',);
 
   my $rc = 1;
   if (!$provided_dbh) {
@@ -860,7 +866,7 @@ sub get_vendor {
   }
   my $query =
     qq|SELECT
-         v.name AS vendor, v.creditlimit, v.terms, v.notes AS intnotes,
+         v.id AS vendor_id, v.name AS vendor, v.creditlimit, v.terms, v.notes AS intnotes,
          v.email, v.cc, v.bcc, v.language_id, v.payment_id,
          v.street, v.zipcode, v.city, v.country, v.taxzone_id,
          $duedate + COALESCE(pt.terms_netto, 0) AS duedate,