X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FOE.pm;h=6648e22428b36433bc7ff2b4989811a993f0ae00;hb=83542c806dc5c249bf640e344eaf3831cdf2f2ea;hp=5bf2a3da969c5e318eb6f1f6b1571df3b5607c89;hpb=80b36869dd9b1ff2ed9063fabe79ca5001dc276e;p=kivitendo-erp.git diff --git a/SL/OE.pm b/SL/OE.pm index 5bf2a3da9..6648e2242 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -78,7 +78,7 @@ sub transactions { $query = qq|SELECT o.id, o.ordnumber, o.transdate, o.reqdate, | . - qq| o.amount, ct.name, o.netamount, o.${vc}_id, o.globalproject_id, | . + qq| o.amount, ct.${vc}number, ct.name, o.netamount, o.${vc}_id, o.globalproject_id, | . qq| o.closed, o.delivered, o.quonumber, o.shippingpoint, o.shipvia, | . qq| o.transaction_description, | . qq| o.marge_total, o.marge_percent, | . @@ -190,7 +190,7 @@ SQL } if ($form->{periodic_invoices_active} ne $form->{periodic_invoices_inactive}) { - my $not = 'NOT' if ($form->{periodic_invoices_inactive}); + my $not = $form->{periodic_invoices_inactive} ? 'NOT' : ''; $query .= qq| AND ${not} COALESCE(pcfg.active, 'f')|; } @@ -725,9 +725,6 @@ sub retrieve { my ($query, $query_add, @values, @ids, $sth); - my $ic_cvar_configs = CVar->get_configs(module => 'IC', - dbh => $dbh); - # translate the ids (given by id_# and trans_id_#) into one array of ids, so we can join them later map { push @ids, $form->{"trans_id_$_"} @@ -1221,8 +1218,7 @@ sub order_details { $subtotal_header = 0; } else { - push @{ $form->{TEMPLATE_ARRAYS}->{discount_sub} }, ""; - push @{ $form->{TEMPLATE_ARRAYS}->{nodiscount_sub} }, ""; + push @{ $form->{TEMPLATE_ARRAYS}->{$_} }, "" for qw(discount_sub nodiscount_sub discount_sub_nofmt nodiscount_sub_nofmt); } if (!$form->{"discount_$i"}) { @@ -1296,7 +1292,9 @@ sub order_details { $sth->finish; } - map { push @{ $form->{TEMPLATE_ARRAYS}->{"ic_cvar_$_->{name}"} }, $form->{"ic_cvar_$_->{name}_$i"} } @{ $ic_cvar_configs }; + push @{ $form->{TEMPLATE_ARRAYS}->{"ic_cvar_$_->{name}"} }, + CVar->format_to_template(CVar->parse($form->{"ic_cvar_$_->{name}_$i"}, $_), $_) + for @{ $ic_cvar_configs }; } }