X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FSEPA.pm;h=3231ac9e96e8d3da8cd104eaab28d7d45f85cd89;hb=e2332bfd203a5d9925034dfdd90a15b3c9c66044;hp=a9ba2f3dadf508a9791290b6b1dff1bd2e6e9424;hpb=88d162cc5e8e8d3810059d918a1eef6a2b205984;p=kivitendo-erp.git diff --git a/SL/SEPA.pm b/SL/SEPA.pm index a9ba2f3da..3231ac9e9 100644 --- a/SL/SEPA.pm +++ b/SL/SEPA.pm @@ -24,6 +24,7 @@ sub retrieve_open_invoices { my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); my $arap = $params{vc} eq 'customer' ? 'ar' : 'ap'; my $vc = $params{vc} eq 'customer' ? 'customer' : 'vendor'; + my $vc_vc_id = $params{vc} eq 'customer' ? 'c_vendor_id' : 'v_customer_id'; my $mandate = $params{vc} eq 'customer' ? " AND COALESCE(vc.mandator_id, '') <> '' AND vc.mandate_date_of_signature IS NOT NULL " : ''; @@ -43,6 +44,7 @@ sub retrieve_open_invoices { (${arap}.amount - (${arap}.amount * pt.percent_skonto)) as amount_less_skonto, (${arap}.amount * pt.percent_skonto) as skonto_amount, vc.name AS vcname, vc.language_id, ${arap}.duedate as duedate, ${arap}.direct_debit, + vc.${vc_vc_id} as vc_vc_id, COALESCE(vc.iban, '') <> '' AND COALESCE(vc.bic, '') <> '' ${mandate} AS vc_bank_info_ok, @@ -166,7 +168,7 @@ sub _create_export { $transfer->{reference} = "${invnumber}-${num_payments}"; } - $h_item_id->execute(); + $h_item_id->execute() || $::form->dberror($q_item_id); my ($item_id) = $h_item_id->fetchrow_array(); my $end_to_end_id = strftime "LXO%Y%m%d%H%M%S", localtime;