X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FAR.pm;h=2ca302258d9d0d0a2a17e382f875357d49b730d6;hb=43d9aa7bb5be1705c8431f2298b4217ac2609e33;hp=079e9e889ab92b64ce04229b980d4bfe0066adce;hpb=515028812cc3764b1f5c44a01739e07658041028;p=kivitendo-erp.git diff --git a/SL/AR.pm b/SL/AR.pm index 079e9e889..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; @@ -305,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; @@ -499,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})); }