X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/3649d1c496c1ab6a9959b51bc9a7ba406d1507c9..refs/heads/swiss:/bin/mozilla/oe.pl diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 97494cfb8..565a40310 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -535,9 +535,6 @@ sub form_footer { |; } } - -# $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0); # template does this - } else { foreach my $item (split / /, $form->{taxaccounts}) { if ($form->{"${item}_base"}) { @@ -559,7 +556,10 @@ sub form_footer { } } - $form->{oldinvtotal} = $form->{invtotal}; + # beware numeric effects + $form->{oldinvtotal} = $form->round_amount( $form->{invtotal},2,1 ); + $form->{rounding} = $form->round_amount( $form->{oldinvtotal}-$form->{invtotal}, 2 ); + $form->{invtotal} = $form->{oldinvtotal}; $TMPL_VAR{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted(); @@ -625,7 +625,7 @@ sub update { if ($form->{type} =~ /^sales/) { IS->retrieve_item(\%myconfig, \%$form); $mode = 'IS'; - } else { + } else { IR->retrieve_item(\%myconfig, \%$form); $mode = 'IR'; } @@ -1147,6 +1147,7 @@ sub save_and_close { my $locale = $main::locale; check_oe_access(); + $form->mtime_ischanged('oe'); $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); @@ -1253,6 +1254,7 @@ sub save { check_oe_access(); + $form->mtime_ischanged('oe'); $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); @@ -1404,6 +1406,8 @@ sub invoice { check_oe_access(); check_oe_conversion_to_sales_invoice_allowed(); + $form->mtime_ischanged('oe'); + $main::auth->assert($form->{type} eq 'purchase_order' || $form->{type} eq 'request_quotation' ? 'vendor_invoice_edit' : 'invoice_edit'); $form->{old_salesman_id} = $form->{salesman_id}; @@ -1751,6 +1755,8 @@ sub purchase_order { my $locale = $main::locale; check_oe_access(); + $form->mtime_ischanged('oe'); + $main::auth->assert('purchase_order_edit'); $form->{sales_order_to_purchase_order} = 0; @@ -1789,6 +1795,7 @@ sub sales_order { check_oe_access(); $main::auth->assert('sales_order_edit'); + $form->mtime_ischanged('oe'); if ($form->{type} eq "purchase_order") { delete($form->{ordnumber}); @@ -1878,6 +1885,8 @@ sub delivery_order { my $form = $main::form; my %myconfig = %main::myconfig; + $form->mtime_ischanged('oe'); + if ($form->{type} =~ /^sales/) { $main::auth->assert('sales_delivery_order_edit'); @@ -1937,6 +1946,7 @@ sub e_mail { check_oe_access(); + $form->mtime_ischanged('oe','mail'); $form->{print_and_save} = 1; my $saved_form = save_form();