]> wagnertech.de Git - mfinanz.git/blobdiff - SL/AR.pm
Merge branch 'master' of github.com:kivitendo/kivitendo-erp
[mfinanz.git] / SL / AR.pm
index b6a7376e1409740fb29e51a109aa642a0b9b88c2..80fc8ef7a8dddedf571f48d9113d10f83db06cdb 100644 (file)
--- a/SL/AR.pm
+++ b/SL/AR.pm
@@ -515,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});
@@ -633,7 +638,7 @@ sub setup_form {
   my ($self, $form, $for_post_payments) = @_;
 
   my ($exchangerate, $akey, $j, $k, $index, $taxamount, $totaltax, $taxrate, $diff, $totalwithholding, $withholdingrate,
-      $totalamount, $taxincluded, $tax);
+      $totalamount, $tax);
 
   # forex
   $form->{forex} = $form->{exchangerate};
@@ -717,7 +722,6 @@ sub setup_form {
     }
   }
 
-  $form->{taxincluded}  = $taxincluded if ($form->{id});
   $form->{paidaccounts} = 1            if not defined $form->{paidaccounts};
 
   if ($form->{taxincluded} && $form->{taxrate} && $totalamount) {