X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fic.pl;h=4b09b5ac8c323a2c80612d3ad6df1e524daa4e69;hb=a4551dbafb54620a87faedac6b0970ca9cb78979;hp=a60baeb704f308a217baa4f7fc78805d9072db8e;hpb=63024c9f98f172ec904324fd0b6f9cc819ce7600;p=kivitendo-erp.git
diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl
index a60baeb70..4b09b5ac8 100644
--- a/bin/mozilla/ic.pl
+++ b/bin/mozilla/ic.pl
@@ -30,29 +30,58 @@
# Inventory Control module
#
#======================================================================
-#$locale->text('ea');
+use POSIX qw(strftime);
+use List::Util qw(max);
+use List::MoreUtils qw(any);
+
+use SL::AM;
+use SL::CVar;
use SL::IC;
+use SL::ReportGenerator;
#use SL::PE;
+use strict;
+#use warnings;
+
+# global imports
+our ($form, $locale, %myconfig, $lxdebug, $auth);
+
require "bin/mozilla/io.pl";
+require "bin/mozilla/invoice_io.pl";
require "bin/mozilla/common.pl";
+require "bin/mozilla/reportgenerator.pl";
1;
+# Parserhappy(R):
+# type=submit $locale->text('Add Part')
+# type=submit $locale->text('Add Service')
+# type=submit $locale->text('Add Assembly')
+# type=submit $locale->text('Edit Part')
+# type=submit $locale->text('Edit Service')
+# type=submit $locale->text('Edit Assembly')
+# $locale->text('Parts')
+# $locale->text('Services')
+# $locale->text('Inventory quantity must be zero before you can set this part obsolete!')
+# $locale->text('Inventory quantity must be zero before you can set this assembly obsolete!')
+# $locale->text('Part Number missing!')
+# $locale->text('Service Number missing!')
+# $locale->text('Assembly Number missing!')
+# $locale->text('ea');
+
# end of main
sub add {
$lxdebug->enter_sub();
- $form->{title} = $locale->text('Add ' . ucfirst $form->{item});
+ $auth->assert('part_service_assembly_edit');
- $form->{callback} =
- "$form->{script}?action=add&item=$form->{item}&login=$form->{login}&password=$form->{password}"
- unless $form->{callback};
-
- $form->{"unit_changeable"} = 1;
+ my $title = 'Add ' . ucfirst $form->{item};
+ $form->{title} = $locale->text($title);
+ $form->{callback} = "$form->{script}?action=add&item=$form->{item}" unless $form->{callback};
+ $form->{unit_changeable} = 1;
IC->get_pricegroups(\%myconfig, \%$form);
&link_part;
@@ -64,547 +93,91 @@ sub add {
sub search {
$lxdebug->enter_sub();
- $form->{title} = (ucfirst $form->{searchitems}) . "s";
- $form->{title} = $locale->text($form->{title});
-
- # switch for backward sorting
- $form->{revers} = 0;
-
- # memory for which table was sort at last time
- $form->{lastsort} = "";
-
- # counter for added entries to top100
- $form->{ndxs_counter} = 0;
-
- # $locale->text('Parts')
- # $locale->text('Services')
-
- # use JavaScript Calendar or not
- $form->{jsscript} = $jscalendar;
- $jsscript = "";
- if ($form->{jsscript}) {
-
- # with JavaScript Calendar
- $button1 = qq|
-
|
- text('button') . qq|> |
- |;
- $button2 = qq|
- |
- text('button') . qq|> |
- |;
-
- #write Trigger
- $jsscript =
- Form->write_trigger(\%myconfig, "2", "transdatefrom", "BL", "trigger1",
- "transdateto", "BL", "trigger2");
- } else {
-
- # without JavaScript Calendar
- $button1 = qq|
- | |;
- $button2 = qq|
- | |;
- }
-
- unless ($form->{searchitems} eq 'service') {
-
- $onhand = qq|
- |
- . $locale->text('On Hand') . qq|
- |
- . $locale->text('Short') . qq|
-|;
-
- $makemodel = qq|
-
- | . $locale->text('Make') . qq| |
- |
- | . $locale->text('Model') . qq| |
- |
-
-|;
-
- $serialnumber = qq|
- | . $locale->text('Serial Number') . qq| |
- |
-|;
+ $auth->assert('part_service_assembly_edit');
- $l_serialnumber = qq|
- |
- . $locale->text('Serial Number') . qq| |
-|;
-
- }
-
- if ($form->{searchitems} eq 'assembly') {
+ $form->{revers} = 0; # switch for backward sorting
+ $form->{lastsort} = ""; # memory for which table was sort at last time
+ $form->{ndxs_counter} = 0; # counter for added entries to top100
- $form->{title} = $locale->text('Assemblies');
+ my %is_xyz = map { +"is_$_" => ($form->{searchitems} eq $_) } qw(part service assembly);
- $toplevel = qq|
-
- |
-
- |
- . $locale->text('Top Level') . qq|
- |
- . $locale->text('Individual Items') . qq|
- |
-
-|;
-
- $bought = qq|
-
- |
-
-
-
-
-
- |
- |
- | . $locale->text('From') . qq| |
- $button1
- | . $locale->text('To (time)') . qq| |
- $button2
-
-
- |
-
-|;
+ $form->{title} = (ucfirst $form->{searchitems}) . "s";
+ $form->{title} = $locale->text($form->{title});
+ $form->{title} = $locale->text('Assemblies') if ($is_xyz{is_assembly});
- } else {
+ $form->{jsscript} = 1;
- $bought = qq|
-
- |
-
-
-
-
-
- |
- |
-
-
-
- | . $locale->text('From') . qq| |
- $button1
- | . $locale->text('To (time)') . qq| |
- $button2
-
-
- |
-
-
- |
-
-|;
- }
+ $form->{CUSTOM_VARIABLES} = CVar->get_configs('module' => 'IC');
+ ($form->{CUSTOM_VARIABLES_FILTER_CODE},
+ $form->{CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables' => $form->{CUSTOM_VARIABLES},
+ 'include_prefix' => 'l_',
+ 'include_value' => 'Y');
$form->header;
- print qq|
-
-
-
+ print $form->parse_html_template('ic/search', { %is_xyz,
+ dateformat => $myconfig{dateformat}, });
-
-