X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAP.pm;h=8c49bb35fd99157fdad14337af8e24c2f9422e22;hb=45659209a7151609c68e28281fe06407076cea5f;hp=7a148d6101e0ce3774de1dbfffd2d0d2228350ce;hpb=937e37ad007405c6a3a389ee18006379ffecc073;p=kivitendo-erp.git diff --git a/SL/AP.pm b/SL/AP.pm index 7a148d610..8c49bb35f 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -371,7 +371,7 @@ sub post_transaction { $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey, tax_id, chart_link) | . qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | . - qq| (SELECT taxkey_id FROM chart WHERE accno = ?)| . + qq| (SELECT taxkey_id FROM chart WHERE accno = ?),| . qq| (SELECT tax_id| . qq| FROM taxkeys| . qq| WHERE chart_id= (SELECT id | . @@ -491,6 +491,11 @@ sub ap_transactions { qq|LEFT JOIN payment_terms pt ON (pt.id = v.payment_id)|; my $where = ''; + + unless ( $::auth->assert('show_ap_transactions', 1) ) { + $where .= " AND NOT invoice = 'f' "; # remove ap transactions from Sales -> Reports -> Invoices + }; + my @values; if ($form->{vendor_id}) { @@ -698,7 +703,7 @@ sub setup_form { my ($self, $form, $for_post_payments) = @_; my ($exchangerate, $i, $j, $k, $key, $akey, $ref, $index, $taxamount, $totalamount, $totaltax, $totalwithholding, $withholdingrate, - $taxincluded, $tax, $diff); + $tax, $diff); # forex $form->{forex} = $form->{exchangerate}; @@ -802,7 +807,6 @@ sub setup_form { } } - $form->{taxincluded} = $taxincluded if ($form->{id}); $form->{paidaccounts} = 1 if not defined $form->{paidaccounts}; if ($form->{taxincluded} && $form->{taxrate} && $totalamount) { @@ -878,4 +882,3 @@ sub storno { } 1; -