Gutschrift und Zahlungsausgang vertauscht
[kivitendo-erp.git] / SL / IS.pm
index 266e052..616e2bf 100644 (file)
--- 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;
@@ -886,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;
       }
 
@@ -1076,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;
 
@@ -1157,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);
   }
 
@@ -2027,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;
@@ -2129,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};
           }