]> wagnertech.de Git - mfinanz.git/blobdiff - SL/AR.pm
Merge branch 'kunden-lieferantennummernkreise-in-transnumbergenerator-2138'
[mfinanz.git] / SL / AR.pm
index d97c443d17dd9c0a6d934189cd2d14365123fa7d..c52a00fd5de091d0bc794de6f82c07c55c8f61a4 100644 (file)
--- a/SL/AR.pm
+++ b/SL/AR.pm
@@ -509,14 +509,14 @@ sub ar_transactions {
     qq|LEFT JOIN employee e ON (a.employee_id = e.id) | .
     qq|LEFT JOIN employee e2 ON (a.salesman_id = e2.id) | .
     qq|LEFT JOIN project pr ON (a.globalproject_id = pr.id)| .
-    qq|LEFT JOIN tax_zones tz ON (tz.id = c.taxzone_id)| .
-    qq|LEFT JOIN payment_terms pt ON (pt.id = c.payment_id)| .
+    qq|LEFT JOIN tax_zones tz ON (tz.id = a.taxzone_id)| .
+    qq|LEFT JOIN payment_terms pt ON (pt.id = a.payment_id)| .
     qq|LEFT JOIN business b ON (b.id = c.business_id)| .
     qq|LEFT JOIN department d ON (d.id = a.department_id)|;
 
   my $where = "1 = 1";
 
-  unless ( $main::auth->check_right($form->{login}, 'show_ar_transactions') ) { 
+  unless ( $::auth->assert('show_ar_transactions', 1) ) {
     $where .= " AND NOT invoice = 'f' ";  # remove ar transactions from Sales -> Reports -> Invoices
   };
 
@@ -638,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};
@@ -722,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) {