X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAR.pm;h=2ca302258d9d0d0a2a17e382f875357d49b730d6;hb=075607c6877a1c42413803d3d8c3e07881523ad0;hp=4fea4afe9f7fc9d2dae6bb2b2ba9a6a3b1c02bf0;hpb=529e6bf96e1ad74ae2e770a9e74f29f26a28d3c8;p=kivitendo-erp.git diff --git a/SL/AR.pm b/SL/AR.pm index 4fea4afe9..2ca302258 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -38,6 +38,7 @@ package AR; use Data::Dumper; use SL::DATEV qw(:CONSTANTS); use SL::DBUtils; +use SL::DB::Draft; use SL::IO; use SL::MoreCommon; use SL::DB::Default; @@ -99,8 +100,6 @@ sub _post_transaction { } $form->{paid} = $form->round_amount($form->{paid} * ($form->{exchangerate} || 1), 2); - ($null, $form->{employee_id}) = split /--/, $form->{employee}; - $form->get_employee($dbh) unless $form->{employee_id}; # if we have an id delete old records else make one @@ -307,6 +306,10 @@ sub _post_transaction { IO->set_datepaid(table => 'ar', id => $form->{id}, dbh => $dbh); + if ($form->{draft_id}) { + SL::DB::Manager::Draft->delete_all(where => [ id => delete($form->{draft_id}) ]); + } + # safety check datev export if ($::instance_conf->get_datev_check_on_ar_transaction) { my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef; @@ -501,14 +504,7 @@ sub ar_transactions { $where .= " AND NOT invoice = 'f' "; # remove ar transactions from Sales -> Reports -> Invoices }; - if ($form->{customernumber}) { - $where .= " AND c.customernumber = ?"; - push(@values, trim($form->{customernumber})); - } - if ($form->{customer_id}) { - $where .= " AND a.customer_id = ?"; - push(@values, $form->{customer_id}); - } elsif ($form->{customer}) { + if ($form->{customer}) { $where .= " AND c.name ILIKE ?"; push(@values, like($form->{customer})); }