X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=c579aad8d831a49292104fd91e2538c40a0d41c4;hb=f9a93e326337ed219de49f575c02e5a8cb36a1b6;hp=a9a115de03b41233ed86d4048a74dbcbe3ca021a;hpb=2517d8406ff377726249e7e71c65d43f378510d4;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index a9a115de0..c579aad8d 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -519,16 +519,26 @@ 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}); + $form->set_payment_options($myconfig, $form->{invdate}, 'sales_invoice'); $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}; + 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->{username} = $myconfig->{name}; @@ -600,8 +610,8 @@ sub customer_details { $ref->{cp_gender} = $contact->cp_gender; } } - # remove id and taxincluded before copy back - delete @$ref{qw(id taxincluded)}; + # remove id,notes (double of customernotes) and taxincluded before copy back + delete @$ref{qw(id taxincluded notes)}; @wanted_vars = grep({ $_ } @wanted_vars); if (scalar(@wanted_vars) > 0) { @@ -1483,7 +1493,7 @@ sub _determine_wh_and_bin { parts_id => $part->id, bin_id => $bin_id); if ($error == 1) { - push @errors, $::locale->text('Part "#1" has chargenumber or best before date set. So it cannot be transfered automaticaly.', + push @errors, $::locale->text('Part "#1" has chargenumber or best before date set. So it cannot be transfered automatically.', $part->description); } my $form_unit_obj = SL::DB::Unit->new(name => $unit)->load;