X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=913c92d2ca9a0ffb6448c42c253080698551ea0c;hb=3f4a45a96efc9e44bc3cd58874128dc36cc667cf;hp=df330d3ac58e86fa7484ad8136f4d9dd66f0ee44;hpb=88583bb350e24b54422269fc36d6fd740c9c0b98;p=kivitendo-erp.git diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index df330d3ac..913c92d2c 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -32,11 +32,22 @@ #====================================================================== #$locale->text('ea'); +use POSIX qw(strftime); + use SL::IC; +use SL::ReportGenerator; #use SL::PE; -require "$form->{path}/io.pl"; +# use strict; +#use warnings; + +# global imports +our ($form, $locale, %myconfig, $lxdebug); + +require "bin/mozilla/io.pl"; +require "bin/mozilla/common.pl"; +require "bin/mozilla/reportgenerator.pl"; 1; @@ -48,7 +59,7 @@ sub add { $form->{title} = $locale->text('Add ' . ucfirst $form->{item}); $form->{callback} = - "$form->{script}?action=add&item=$form->{item}&path=$form->{path}&login=$form->{login}&password=$form->{password}" + "$form->{script}?action=add&item=$form->{item}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; $form->{"unit_changeable"} = 1; @@ -63,6 +74,8 @@ sub add { sub search { $lxdebug->enter_sub(); + my ($button1, $button2, $onhand, $makemodel, $serialnumber, $l_serialnumber, $toplevel, $bought); + $form->{title} = (ucfirst $form->{searchitems}) . "s"; $form->{title} = $locale->text($form->{title}); @@ -79,8 +92,8 @@ sub search { # $locale->text('Services') # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; - $jsscript = ""; + $form->{jsscript} = 1; + my $jsscript = ""; if ($form->{jsscript}) { # with JavaScript Calendar @@ -374,7 +387,6 @@ $jsscript -{path}> {login}> {password}> @@ -397,15 +409,16 @@ $jsscript $lxdebug->leave_sub(); } #end search() - sub search_update_prices { $lxdebug->enter_sub(); + my ($onhand, $makemodel, $serialnumber, $l_serialnumber, $toplevel, $bought); + $form->{title} = $locale->text('Update prices'); IC->get_pricegroups(\%myconfig, \%$form); # use JavaScript Calendar or not -# $form->{jsscript} = $jscalendar; +# $form->{jsscript} = 1; # $jsscript = ""; # if ($form->{jsscript}) { # @@ -538,7 +551,7 @@ sub search_update_prices {
| - . $locale->text('Part Number') . qq| | -| - . $locale->text('Part Description') . qq| | +| . $locale->text('Part Number') . qq| | +| . $locale->text('Part Description') . qq| | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
@@ -658,7 +671,6 @@ sub choice { print qq| -{path}> {login}> {password}> @@ -690,9 +702,10 @@ sub choice { {extras}>|; + my ($partnumber, $description, $unit, $sellprice, $soldtotal); # if choice set data if ($form->{ndx}) { - for ($i = 0; $i < $form->{ndxs_counter}; $i++) { + for (my $i = 0; $i < $form->{ndxs_counter}; $i++) { # prepeare data $partnumber = $form->{"totop100_partnumber_$j"}; @@ -716,7 +729,7 @@ sub choice { # set data for next page if (($form->{ndxs_counter}) > 0) { - for ($i = 1; ($i < $form->{ndxs_counter} + 1); $i++) { + for (my $i = 1; ($i < $form->{ndxs_counter} + 1); $i++) { $partnumber = $form->{"totop100_partnumber_$i"}; $description = $form->{"totop100_description_$i"}; $unit = $form->{"totop100_unit_$i"}; @@ -748,20 +761,12 @@ sub choice { sub list { $lxdebug->enter_sub(); - # get parts for - if (($form->{partnumber} eq "") and ($form->{description} eq "")) { - IC->get_parts(\%myconfig, \%$form, ""); - } else { - if ((!($form->{partnumber} eq "")) and ($form->{description} eq "")) { - IC->get_parts(\%myconfig, \%$form, "partnumber"); - } else { - if (($form->{partnumber} eq "") and (!($form->{description} eq ""))) { - IC->get_parts(\%myconfig, \%$form, "description"); - } else { - IC->get_parts(\%myconfig, \%$form, "all"); - } #fi - } #fi - } #fi + our ($lastndx); + our ($partnumber, $description, $unit, $sellprice, $soldtotal); + + my @sortorders = ("", "partnumber", "description", "all"); + my $sortorder = $sortorders[($form->{description} ? 2 : 0) + ($form->{partnumber} ? 1 : 0)]; + IC->get_parts(\%myconfig, \%$form, $sortorder); $form->{title} = $locale->text('Top 100 hinzufuegen'); @@ -816,7 +821,6 @@ sub list { | {module}.pl?action=edit&type=invoice&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{invnumber} | " + ? "{module}.pl?action=edit&type=invoice&id=$ref->{trans_id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{invnumber} | " : "$ref->{invnumber} | "; $column_data{ordnumber} = ($ref->{module} eq 'oe') - ? "{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{ordnumber} | " + ? "{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{ordnumber} | " : "$ref->{ordnumber} | "; $column_data{quonumber} = ($ref->{module} eq 'oe' && !$ref->{ordnumber}) - ? "{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{quonumber} | " + ? "{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{quonumber} | " : "$ref->{quonumber} | "; $column_data{name} = "$ref->{name} | "; @@ -1447,7 +1446,6 @@ sub addtop100 { - - - -|; + $report->generate_with_headers(); $lxdebug->leave_sub(); } #end generate_report sub parts_subtotal { $lxdebug->enter_sub(); + + # imports + our (%column_data, @column_index); + our ($subtotalonhand, $totalsellprice, $totallastcost, $totallistprice, $subtotalsellprice, $subtotallastcost, $subtotallistprice); map { $column_data{$_} = "" } @column_index; $subtotalonhand = 0 if ($form->{searchitems} eq 'assembly' && $form->{bom}); @@ -2056,7 +1866,9 @@ sub parts_subtotal { sub edit { $lxdebug->enter_sub(); - + # show history button + $form->{javascript} = qq||; + #/show hhistory button IC->get_part(\%myconfig, \%$form); $form->{"original_partnumber"} = $form->{"partnumber"}; @@ -2079,15 +1891,15 @@ sub link_part { split(/:/, $form->{currencies})); # parts and assemblies have the same links - $item = $form->{item}; + my $item = $form->{item}; if ($form->{item} eq 'assembly') { $item = 'part'; } # build the popup menus $form->{taxaccounts} = ""; - foreach $key (keys %{ $form->{IC_links} }) { - foreach $ref (@{ $form->{IC_links}{$key} }) { + foreach my $key (keys %{ $form->{IC_links} }) { + foreach my $ref (@{ $form->{IC_links}{$key} }) { # if this is a tax field if ($key =~ /IC_tax/) { @@ -2141,7 +1953,7 @@ sub link_part { if ($form->{item} eq 'assembly') { - foreach $i (1 .. $form->{assembly_rows}) { + foreach my $i (1 .. $form->{assembly_rows}) { if ($form->{"partsgroup_id_$i"}) { $form->{"partsgroup_$i"} = qq|$form->{"partsgroup_$i"}--$form->{"partsgroup_id_$i"}|; @@ -2164,18 +1976,23 @@ sub link_part { sub form_header { $lxdebug->enter_sub(); + my ($payment, $rows, $notes, $description, $ean, $buchungsgruppe, $partsgroup, $group, $tax, $lastcost, $eur, $linkaccounts, $weight, $n, $rop, $bin, $vegv); + my ($notdiscountableok, $notdiscountable); + my ($formula, $formula_label, $imagelinks, $obsolete, $shopok, $shop); + + map({ $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, -2) } qw(sellprice listprice lastcost gv)); map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}) } qw(weight rop stock); - foreach $item (qw(partnumber description unit notes)) { + foreach my $item (qw(partnumber description unit notes)) { $form->{$item} =~ s/\"/"/g; } $payment = qq||; - foreach $item (@{ $form->{payment_terms} }) { + foreach my $item (@{ $form->{payment_terms} }) { if ($form->{payment_id} eq $item->{id}) { $payment .= qq||; } else { @@ -2200,13 +2017,13 @@ sub form_header { $ean = qq||; - foreach $item (split / /, $form->{taxaccounts}) { + foreach my $item (split / /, $form->{taxaccounts}) { $form->{"IC_tax_$item"} = ($form->{"IC_tax_$item"}) ? "checked" : ""; } IC->retrieve_buchungsgruppen(\%myconfig, $form); if (@{ $form->{BUCHUNGSGRUPPEN} }) { - foreach $item (@{ $form->{BUCHUNGSGRUPPEN} }) { + foreach my $item (@{ $form->{BUCHUNGSGRUPPEN} }) { if ($item->{id} == $form->{buchungsgruppen_id}) { $form->{selectbuchungsgruppe} .= " |
| - . $locale->text('Geschäftsvolumen') . qq| | + . $locale->text('Business Volume') . qq|{gv}> | ||||||||||
@@ -2470,7 +2290,8 @@ sub form_header { # type=submit $locale->text('Edit Service') # type=submit $locale->text('Edit Assembly') # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + my ($jsscript, $button1); + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { @@ -2562,14 +2383,14 @@ sub form_header { | |||||||||||
| . $locale->text('Notes') . qq| | -| . $locale->text('Formula') . qq| | +$formula_label | |||||||||
$notes | - $formel + $formula | ||||||||||