Rose-Modell f. Buchungsgruppen: Relation zu Chart für inventory_account korrigiert.
[kivitendo-erp.git] / SL / AR.pm
index 212b2b8..adffeb6 100644 (file)
--- a/SL/AR.pm
+++ b/SL/AR.pm
@@ -330,6 +330,7 @@ sub post_transaction {
       dbh        => $dbh,
       from       => $transdate,
       to         => $transdate,
+      trans_id   => $form->{id},
     );
 
     $datev->export;
@@ -514,6 +515,11 @@ sub ar_transactions {
     qq|LEFT JOIN department d ON (d.id = a.department_id)|;
 
   my $where = "1 = 1";
+
+  unless ( $::auth->assert('show_ar_transactions', 1) ) {
+    $where .= " AND NOT invoice = 'f' ";  # remove ar transactions from Sales -> Reports -> Invoices
+  };
+
   if ($form->{customernumber}) {
     $where .= " AND c.customernumber = ?";
     push(@values, $form->{customernumber});