From 9035c75520b38a06de076b53689f82c228b3d22c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 23 Oct 2009 14:17:50 +0200 Subject: [PATCH] invoice_io strict --- bin/mozilla/invoice_io.pl | 54 +++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/bin/mozilla/invoice_io.pl b/bin/mozilla/invoice_io.pl index d947bae23..97bb8fdb8 100644 --- a/bin/mozilla/invoice_io.pl +++ b/bin/mozilla/invoice_io.pl @@ -43,12 +43,14 @@ use SL::IC; require "bin/mozilla/common.pl"; +use strict; + # any custom scripts for this one if (-f "bin/mozilla/custom_invoice_io.pl") { eval { require "bin/mozilla/custom_ivvoice_io.pl"; }; } -if (-f "bin/mozilla/$form->{login}_invoice_io.pl") { - eval { require "bin/mozilla/$form->{login}_invoice_io.pl"; }; +if (-f "bin/mozilla/$main::form->{login}_invoice_io.pl") { + eval { require "bin/mozilla/$main::form->{login}_invoice_io.pl"; }; } 1; @@ -91,7 +93,7 @@ use Data::Dumper; # neue Optik im Rechnungsformular # ######################################## #sub display_row { -# $lxdebug->enter_sub(); +# $main::lxdebug->enter_sub(); # my $numrows = shift; # # my $is_sales = @@ -400,7 +402,7 @@ use Data::Dumper; # # for last row # $column_data{sellprice_pg} = qq| |; # } -# +# # $column_data{sellprice} = # qq|{marge_percent} = ($form->{sellprice_total} - $form->{lastcost_total}) / $form->{sellprice_total} * 100; # } # -# $lxdebug->leave_sub(); +# $main::lxdebug->leave_sub(); #} sub set_pricegroup { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; + my $locale = $main::locale; + my $rowcount = shift; - for $j (1 .. $rowcount) { - my $pricegroup_old = $form->{"pricegroup_old_$i"}; + for my $j (1 .. $rowcount) { + my $pricegroup_old = $form->{"pricegroup_old_$j"}; if ($form->{PRICES}{$j}) { - $len = 0; - $prices = ''; - $price = 0; - foreach $item (@{ $form->{PRICES}{$j} }) { + my $len = 0; + my $prices = ''; + my $price = 0; + foreach my $item (@{ $form->{PRICES}{$j} }) { #$price = $form->round_amount($myconfig, $item->{price}, 5); #$price = $form->format_amount($myconfig, $item->{price}, 2); - $price = $item->{price}; - $pricegroup_id = $item->{pricegroup_id}; - $pricegroup = $item->{pricegroup}; + my $price = $item->{price}; + my $pricegroup_id = $item->{pricegroup_id}; + my $pricegroup = $item->{pricegroup}; # build drop down list for pricegroups $prices .= @@ -590,13 +597,16 @@ sub set_pricegroup { $form->{"prices_$j"} = $prices; } } - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } sub display_form { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; - $auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . + $main::auth->assert('part_service_assembly_edit | vendor_invoice_edit | sales_order_edit | invoice_edit |' . 'request_quotation_edit | sales_quotation_edit | purchase_order_edit | '. 'purchase_delivery_order_edit | sales_delivery_order_edit'); @@ -614,7 +624,7 @@ sub display_form { exit; } - Common::webdav_folder($form) if ($webdav); + Common::webdav_folder($form) if ($main::webdav); # if ( $form->{print_and_post} # && $form->{second_run} @@ -651,8 +661,8 @@ sub display_form { # } &form_header; - $numrows = ++$form->{rowcount}; - $subroutine = "display_row"; + my $numrows = ++$form->{rowcount}; + my $subroutine = "display_row"; if ($form->{item} eq 'part') { @@ -694,5 +704,5 @@ sub display_form { &form_footer; - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } -- 2.20.1