X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fic.pl;h=dde593feb69454cebc6beef603f0604dbcbf51f6;hb=cd16e60235994b69cdff63da70f73eb284fdf4a7;hp=bccac308a16fbb2b3cef1ed5a872d78b4a30659f;hpb=d467f40de696218e7cde1b78704c32443fa5b986;p=kivitendo-erp.git
diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl
index bccac308a..dde593feb 100644
--- a/bin/mozilla/ic.pl
+++ b/bin/mozilla/ic.pl
@@ -30,9 +30,12 @@
# Inventory Control module
#
#======================================================================
-#$locale->text('ea');
+
+use POSIX qw(strftime);
+use List::Util qw(max);
use SL::IC;
+use SL::ReportGenerator;
#use SL::PE;
@@ -43,19 +46,38 @@ use SL::IC;
our ($form, $locale, %myconfig, $lxdebug);
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();
+ $auth->assert('part_service_assembly_edit');
+
$form->{title} = $locale->text('Add ' . ucfirst $form->{item});
- $form->{callback} =
- "$form->{script}?action=add&item=$form->{item}&login=$form->{login}&password=$form->{password}"
+ $form->{callback} = "$form->{script}?action=add&item=$form->{item}"
unless $form->{callback};
$form->{"unit_changeable"} = 1;
@@ -70,551 +92,55 @@ 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});
+ $auth->assert('part_service_assembly_edit');
- # switch for backward sorting
- $form->{revers} = 0;
+ $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
- # memory for which table was sort at last time
- $form->{lastsort} = "";
+ my $is_service = $form->{searchitems} eq 'service';
+ my $is_assembly = $form->{searchitems} eq 'assembly';
- # counter for added entries to top100
- $form->{ndxs_counter} = 0;
-
- # $locale->text('Parts')
- # $locale->text('Services')
+ $form->{title} = (ucfirst $form->{searchitems}) . "s";
+ $form->{title} = $locale->text($form->{title});
+ $form->{title} = $locale->text('Assemblies') if $is_assembly;
- # use JavaScript Calendar or not
$form->{jsscript} = 1;
- my $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| |
- |
-|;
-
- $l_serialnumber = qq|
- |
- . $locale->text('Serial Number') . qq| |
-|;
-
- }
-
- if ($form->{searchitems} eq 'assembly') {
-
- $form->{title} = $locale->text('Assemblies');
-
- $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
-
-
- |
-
-|;
-
- } else {
-
- $bought = qq|
-
- |
-
-
-
-
-
- |
- |
-
-
-
- | . $locale->text('From') . qq| |
- $button1
- | . $locale->text('To (time)') . qq| |
- $button2
-
-
- |
-
-
- |
-
-|;
- }
$form->header;
- print qq|
-
-
-
-
-
-