X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/4dbb09950c9f5596646537c12d991c99086fe7c1..0a3b8a76933a4be17675ed3de2186e5e4c8ede10:/bin/mozilla/ic.pl
diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl
index 3df2e51ed..aa83e5492 100644
--- a/bin/mozilla/ic.pl
+++ b/bin/mozilla/ic.pl
@@ -30,24 +30,52 @@
# Inventory Control module
#
#======================================================================
+#$locale->text('ea');
+use POSIX qw(strftime);
use SL::IC;
+use SL::ReportGenerator;
-require "$form->{path}/io.pl";
+#use SL::PE;
+
+# use strict;
+#use warnings;
+
+# global imports
+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')
+
# 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}&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
+ $form->{callback} =
+ "$form->{script}?action=add&item=$form->{item}"
+ unless $form->{callback};
- $form->{unit} = ($form->{item} eq 'service') ? $locale->text('hr') : $locale->text('ea');
+ $form->{"unit_changeable"} = 1;
+ IC->get_pricegroups(\%myconfig, \%$form);
&link_part;
&display_form;
@@ -57,484 +85,200 @@ sub add {
sub search {
$lxdebug->enter_sub();
- $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;
+
# 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| |
- |
-
-|;
+ # $locale->text('Parts')
+ # $locale->text('Services')
- $serialnumber = qq|
- |.$locale->text('Serial Number').qq| |
- |
-|;
+ my $is_service = $form->{searchitems} eq 'service';
+ my $is_assembly = $form->{searchitems} eq 'assembly';
- $l_serialnumber = qq|
- |.$locale->text('Serial Number').qq| |
-|;
+ $form->{title} = (ucfirst $form->{searchitems}) . "s";
+ $form->{title} = $locale->text($form->{title});
+ $form->{title} = $locale->text('Assemblies') if $is_assembly;
- }
+ $form->{jsscript} = 1;
- if ($form->{searchitems} eq 'assembly') {
+ $form->header;
- $form->{title} = $locale->text('Assemblies');
+ print $form->parse_html_template('ic/search', { is_assembly => $is_assembly,
+ is_service => $is_service,
+ dateformat => $myconfig{dateformat}, });
- $toplevel = qq|
-
- |
-
- |.$locale->text('Top Level').qq|
- |.$locale->text('Individual Items').qq|
- |
-
-|;
+ $lxdebug->leave_sub();
+} #end search()
- $bought = qq|
-
- |
-
-
-
-
-
- |
- |
- |.$locale->text('From').qq| |
- $button1
- |.$locale->text('To').qq| |
- $button2
-
-
- |
-
-|;
+sub search_update_prices {
+ $lxdebug->enter_sub();
- } else {
+ $auth->assert('part_service_assembly_edit');
- $bought = qq|
-
- |
-
-
-
-
-
- |
- |
-
-
-
- |.$locale->text('From').qq| |
- $button1
- |.$locale->text('To').qq| |
- $button2
-
-
- |
-
-
- |
-
-|;
- }
+ my $pricegroups = IC->get_pricegroups(\%myconfig, \%$form);
$form->header;
- print qq|
-
-
-
+ if (IC->update_prices(\%myconfig, \%$form)) {
+ $form->redirect($form->{update_count} . $locale->text('prices updated!'));
+ } else {
+ $form->error($locale->text('Could not update prices!'));
+ }
-
-