X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=616e2bf6ffec4193dd96762ddb0c7ba1bdad614b;hb=a6174079e9a61a4a66c12d81cf1f20a855d2fd81;hp=82226ee52bf1112dde317c7eee6d8030c3a747e7;hpb=3ff5da55d203a1ac5dbd269737577f0abeb424e0;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index 82226ee52..616e2bf6f 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -48,6 +48,7 @@ use SL::MoreCommon; use SL::IC; use SL::IO; use SL::TransNumber; +use SL::DB::Default; use Data::Dumper; use strict; @@ -258,8 +259,7 @@ sub invoice_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"}) { @@ -887,7 +887,7 @@ sub post_invoice { if ($form->{"acc_trans_id_$i"} && $payments_only - && ($::lx_office_conf{features}->{payments_changeable} == 0)) { + && (SL::DB::Default->get->payments_changeable == 0)) { next; } @@ -1077,7 +1077,7 @@ sub post_invoice { 'table' => 'ar',); # safety check datev export - if ($::lx_office_conf{datev_check}{check_on_sales_invoice}) { + if ($::instance_conf->get_datev_check_on_sales_invoice) { my $transdate = $::form->{invdate} ? DateTime->from_lxoffice($::form->{invdate}) : undef; $transdate ||= DateTime->today; @@ -1158,7 +1158,7 @@ sub post_payment { $old_form = save_form(); # Delete all entries in acc_trans from prior payments. - if ($::lx_office_conf{features}->{payments_changeable} != 0) { + if (SL::DB::Default->get->payments_changeable != 0) { $self->_delete_payments($form, $dbh); } @@ -2028,7 +2028,7 @@ sub get_pricegroups_for_parts { my $pricegroup_old = $form->{"pricegroup_old_$i"}; - # sellprice has format 13,0000 or 0,00000, can't check for 0 numerically + # sellprice has format 13,0000 or 0,00000, can't check for 0 numerically my $sellprice = $form->{"sellprice_$i"}; my $pricegroup_id = $form->{"pricegroup_id_$i"}; $form->{"new_pricegroup_$i"} = $selectedpricegroup_id; @@ -2130,14 +2130,12 @@ sub get_pricegroups_for_parts { $pkr->{selected} = ' selected'; # unless $form->{selected}; # no customer pricesgroup set - if ($pkr->{price_unfmt} == $pkr->{default_sellprice}) { + if ($pkr->{price_unfmt} == $pkr->{default_sellprice} || $form->{'sellprice_'.$i} * 1 > 1) { $pkr->{price} = $form->{"sellprice_$i"}; } else { -# this sub should not set anything and only return. --sschoeling, 20090506 -# is this correct? put in again... -- grichardson 20110119 $form->{"sellprice_$i"} = $pkr->{price}; }