X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=d7ba6b563ce40ced435302b50c2e2618ac990f05;hb=d64013f4ba48d1f34e1d55f8c5f98d0ab2b5ed2b;hp=e32827f446096e98f0c17c1c6524177e6d8e4eec;hpb=c0ed7d2fa13650cc51cf3ed641aa5cc9afb41d7f;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index e32827f44..d7ba6b563 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -519,21 +519,23 @@ sub invoice_details { $form->{nodiscount} = $form->format_amount($myconfig, $nodiscount, 2); $form->{yesdiscount} = $form->format_amount($myconfig, $form->{nodiscount_total} - $nodiscount, 2); - $form->{invtotal} = ($form->{taxincluded}) ? $form->{total} : $form->{total} + $tax; - $form->{total} = $form->format_amount($myconfig, $form->{invtotal} - $form->{paid}, 2); + my $grossamount = ($form->{taxincluded}) ? $form->{total} : $form->{total} + $tax; + $form->{invtotal} = $form->round_amount($grossamount, 2, 1); + $form->{rounding} = $form->round_amount( + $form->{invtotal} - $form->round_amount($grossamount, 2), + 2 + ); + $form->{rounding} = $form->format_amount($myconfig, $form->{rounding}, 2); + $form->{total} = $form->format_amount($myconfig, $form->{invtotal} - $form->{paid}, 2); $form->{invtotal} = $form->format_amount($myconfig, $form->{invtotal}, 2); $form->{paid} = $form->format_amount($myconfig, $form->{paid}, 2); $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}; @@ -2110,7 +2112,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