X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Finvoice_io.pl;h=a4e50ff0cf7b15260a66fc40e04f26944de9e2c7;hb=cc6d0e60e203d7b7fab1e95908cbe4afca5e18a0;hp=c8097e325f1a16631211042edef6b5adb9b614a4;hpb=a99b261f6a4a4b1988ce2e0ad4c27ed579378cb9;p=kivitendo-erp.git diff --git a/bin/mozilla/invoice_io.pl b/bin/mozilla/invoice_io.pl index c8097e325..a4e50ff0c 100644 --- a/bin/mozilla/invoice_io.pl +++ b/bin/mozilla/invoice_io.pl @@ -34,7 +34,6 @@ ####################################################################### use CGI; -use CGI::Ajax; use List::Util qw(max); use SL::Common; @@ -49,8 +48,8 @@ use strict; if (-f "bin/mozilla/custom_invoice_io.pl") { eval { require "bin/mozilla/custom_invoice_io.pl"; }; } -if (-f "bin/mozilla/$main::form->{login}_invoice_io.pl") { - eval { require "bin/mozilla/$main::form->{login}_invoice_io.pl"; }; +if (-f "bin/mozilla/$::myconfig{login}_invoice_io.pl") { + eval { require "bin/mozilla/$::myconfig{login}_invoice_io.pl"; }; } 1; @@ -89,56 +88,6 @@ use SL::PE; use SL::AM; use Data::Dumper; -sub set_pricegroup { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - my $rowcount = shift; - for my $j (1 .. $rowcount) { - my $pricegroup_old = $form->{"pricegroup_old_$j"}; - if ($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); - my $price = $item->{price}; - my $pricegroup_id = $item->{pricegroup_id}; - my $pricegroup = $item->{pricegroup}; - - # build drop down list for pricegroups - $prices .= - qq|\n|; - - $len += 1; - - # map { - # $form->{"${_}_$j"} = - # $form->format_amount(\%myconfig, $form->{"${_}_$j"}) - # } qw(sellprice price_new price_old); - - # set new selectedpricegroup_id and prices for "Preis" - if ($item->{selected} && ($pricegroup_id != 0)) { - $form->{"pricegroup_old_$j"} = $pricegroup_id; - $form->{"price_new_$j"} = $price; - # edit: don't change the sellprice here - # $form->{"sellprice_$j"} = $price; # this must only be updated for existing articles, not new ones - } - if ($pricegroup_id == 0) { - $form->{"price_new_$j"} = $form->{"sellprice_$j"}; - } - } - $form->{"prices_$j"} = $prices; - } - } - $main::lxdebug->leave_sub(); -} - sub display_form { $main::lxdebug->enter_sub(); @@ -147,7 +96,7 @@ sub display_form { $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'); + 'purchase_delivery_order_edit | sales_delivery_order_edit | part_service_assembly_details'); relink_accounts(); retrieve_partunits() if ($form->{type} =~ /_delivery_order$/); @@ -189,12 +138,6 @@ sub display_form { # $form->{rowcount}--; # my $rowcount = $form->{rowcount}; # - # # get pricegroups for parts - # IS->get_pricegroups_for_parts(\%myconfig, \%$form); - # - # # build up html code for prices_$i - # set_pricegroup($rowcount); - # # $form->{resubmit} = 1; # # } @@ -206,8 +149,7 @@ sub display_form { my $numrows = ++$form->{rowcount}; my $subroutine = "display_row"; - if ($form->{item} eq 'part') { - + if ($form->{item} =~ /(part|service)/) { #set preisgruppenanzahl $numrows = $form->{price_rows}; $subroutine = "price_row"; @@ -226,20 +168,15 @@ sub display_form { $numrows = ++$form->{makemodel_rows}; $subroutine = "makemodel_row"; + # assemblies are built from components, they aren't purchased from a vendor + # also the lastcost_$i from makemodel conflicted with the component lastcost_$i + # so we don't need the makemodel rows for assemblies # create makemodel rows - &{$subroutine}($numrows); + # &{$subroutine}($numrows); $numrows = ++$form->{assembly_rows}; $subroutine = "assembly_row"; } - if ($form->{item} eq 'service') { - $numrows = $form->{price_rows}; - $subroutine = "price_row"; - - &{$subroutine}($numrows); - - $numrows = 0; - } # create rows &{$subroutine}($numrows) if $numrows;