X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=a05f25e3d11a123f53bc5c982d5a2cbbb8a906ce;hb=8e0f6e70;hp=c579aad8d831a49292104fd91e2538c40a0d41c4;hpb=c0cc8bb220b76219934bee9ac5dd5e8e971ddc65;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index c579aad8d..a05f25e3d 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -533,13 +533,9 @@ sub invoice_details { $form->set_payment_options($myconfig, $form->{invdate}, 'sales_invoice'); - $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef); - if ($form->{delivery_term} && $form->{language_id}) { - $form->{delivery_term}->description_long( $form->{delivery_term}->translated_attribute('description_long', $form->{language_id})); - $form->{delivery_term}->description_long_invoice($form->{delivery_term}->translated_attribute('description_long_invoice', $form->{language_id})); - } - $form->{department} = SL::DB::Manager::Department->find_by(id => $form->{department_id})->description if $form->{department_id}; + $form->{delivery_term} = SL::DB::Manager::DeliveryTerm->find_by(id => $form->{delivery_term_id} || undef); + $form->{delivery_term}->description_long($form->{delivery_term}->translated_attribute('description_long', $form->{language_id})) if $form->{delivery_term} && $form->{language_id}; $form->{username} = $myconfig->{name}; @@ -1316,7 +1312,10 @@ SQL do_query($form, $dbh, qq|UPDATE ar SET paid = amount WHERE id = ?|, conv_i($form->{"id"})); } - $form->new_lastmtime('ar'); + # maybe we are in a larger transaction and the current + # object is not yet persistent in the db, therefore we + # need the current dbh to get the not yet committed mtime + $form->new_lastmtime('ar', $provided_dbh); $form->{name} = $form->{customer}; $form->{name} =~ s/--\Q$form->{customer_id}\E//; @@ -2116,7 +2115,7 @@ sub get_customer { c.id AS customer_id, c.name AS customer, c.discount as customer_discount, c.creditlimit, c.email, c.cc, c.bcc, c.language_id, c.payment_id, c.delivery_term_id, c.street, c.zipcode, c.city, c.country, - c.notes AS intnotes, c.klass as customer_klass, c.taxzone_id, c.salesman_id, cu.name AS curr, + c.notes AS intnotes, c.pricegroup_id as customer_pricegroup_id, c.taxzone_id, c.salesman_id, cu.name AS curr, c.taxincluded_checked, c.direct_debit, b.discount AS tradediscount, b.description AS business FROM customer c