X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/4c6e9282cff83ba335a03e39536df3fa7b3b2101..76592c8a3:/bin/mozilla/ic.pl
diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl
index 140ed9349..e6b1ff33f 100644
--- a/bin/mozilla/ic.pl
+++ b/bin/mozilla/ic.pl
@@ -24,7 +24,8 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
#======================================================================
#
# Inventory Control module
@@ -74,23 +75,6 @@ require "bin/mozilla/reportgenerator.pl";
# end of main
-sub add {
- $lxdebug->enter_sub();
-
- $auth->assert('part_service_assembly_edit');
-
- 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;
- &display_form;
-
- $lxdebug->leave_sub();
-}
-
sub search {
$lxdebug->enter_sub();
@@ -258,9 +242,15 @@ sub generate_report {
my $cvar_configs = CVar->get_configs('module' => 'IC');
- $form->{title} = (ucfirst $form->{searchitems}) . "s";
- $form->{title} =~ s/ys$/ies/;
- $form->{title} = $locale->text($form->{title});
+ my %titles = (
+ '' => $locale->text('Articles'),
+ part => $locale->text('Parts'),
+ service => $locale->text('Services'),
+ assembly => $locale->text('Assemblies'),
+ assortment => $locale->text('Assortments'),
+ );
+
+ $form->{title} = $titles{$form->{searchitems}};
my %column_defs = (
'bin' => { 'text' => $locale->text('Bin'), },
@@ -282,7 +272,7 @@ sub generate_report {
'onhand' => { 'text' => $locale->text('Stocked Qty'), },
'ordnumber' => { 'text' => $locale->text('Order Number'), },
'partnumber' => { 'text' => $locale->text('Part Number'), },
- 'partsgroup' => { 'text' => $locale->text('Group'), },
+ 'partsgroup' => { 'text' => $locale->text('Partsgroup'), },
'priceupdate' => { 'text' => $locale->text('Updated'), },
'quonumber' => { 'text' => $locale->text('Quotation'), },
'rop' => { 'text' => $locale->text('ROP'), },
@@ -368,8 +358,8 @@ sub generate_report {
transdatefrom => $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1),
transdateto => $locale->text('To (time)') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1),
partnumber => $locale->text('Part Number') . ": '$form->{partnumber}'",
- partsgroup => $locale->text('Group') . ": '$form->{partsgroup}'",
- partsgroup_id => $locale->text('Group') . ": '$pg_name'",
+ partsgroup => $locale->text('Partsgroup') . ": '$form->{partsgroup}'",
+ partsgroup_id => $locale->text('Partsgroup') . ": '$pg_name'",
serialnumber => $locale->text('Serial Number') . ": '$form->{serialnumber}'",
description => $locale->text('Part Description') . ": '$form->{description}'",
make => $locale->text('Make') . ": '$form->{make}'",
@@ -384,7 +374,7 @@ sub generate_report {
my @itemstatus_keys = qw(active obsolete orphaned onhand short);
my @callback_keys = qw(onorder ordered rfq quoted bought sold partnumber partsgroup partsgroup_id serialnumber description make model
- drawing microfiche l_soldtotal l_deliverydate transdatefrom transdateto insertdatefrom insertdateto ean shop);
+ drawing microfiche l_soldtotal l_deliverydate transdatefrom transdateto insertdatefrom insertdateto ean shop all);
# calculate dependencies
for (@itemstatus_keys, @callback_keys) {
@@ -473,7 +463,7 @@ sub generate_report {
insertdate shop
);
- my $pricegroups = SL::DB::Manager::Pricegroup->get_all(sort => 'id');
+ my $pricegroups = SL::DB::Manager::Pricegroup->get_all_sorted;
my @pricegroup_columns;
my %column_defs_pricegroups;
if ($form->{l_pricegroups}) {
@@ -585,7 +575,7 @@ sub generate_report {
$soldtotal = 0 if ($form->{sold});
}
- my $edit_link = build_std_url('action=edit', 'id=' . E($ref->{id}), 'callback');
+ my $edit_link = build_std_url('script=controller.pl', 'action=Part/edit', 'part.id=' . E($ref->{id}), 'callback');
$row->{partnumber}->{link} = $edit_link;
$row->{description}->{link} = $edit_link;
@@ -681,671 +671,6 @@ sub generate_report {
$lxdebug->leave_sub();
} #end generate_report
-sub parts_subtotal {
- $lxdebug->enter_sub();
-
- $auth->assert('part_service_assembly_edit');
-
- my (%column_data);
- my ($column_index, $subtotalonhand, $subtotalsellprice, $subtotallastcost, $subtotallistprice) = @_;
-
- map { $column_data{$_} = "
| " } @{ $column_index };
- $$subtotalonhand = 0 if ($form->{searchitems} eq 'assembly' && $form->{bom});
-
- $column_data{onhand} =
- ""
- . $form->format_amount(\%myconfig, $$subtotalonhand)
- . " | ";
-
- $column_data{linetotalsellprice} =
- ""
- . $form->format_amount(\%myconfig, $$subtotalsellprice, 2)
- . " | ";
- $column_data{linetotallistprice} =
- ""
- . $form->format_amount(\%myconfig, $$subtotallistprice, 2)
- . " | ";
- $column_data{linetotallastcost} =
- ""
- . $form->format_amount(\%myconfig, $$subtotallastcost, 2)
- . " | ";
-
- $$subtotalonhand = 0;
- $$subtotalsellprice = 0;
- $$subtotallistprice = 0;
- $$subtotallastcost = 0;
-
- print "";
-
- map { print "\n$column_data{$_}" } @{ $column_index };
-
- print qq|
-
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub edit {
- $lxdebug->enter_sub();
-
- $auth->assert('part_service_assembly_details');
-
- # show history button
- $form->{javascript} = qq||;
- #/show hhistory button
- IC->get_part(\%myconfig, \%$form);
-
- $form->{"original_partnumber"} = $form->{"partnumber"};
-
- my $title = 'Edit ' . ucfirst $form->{item};
- $form->{title} = $locale->text($title);
-
- &link_part;
- &display_form;
-
- $lxdebug->leave_sub();
-}
-
-sub link_part {
- $lxdebug->enter_sub();
-
- $auth->assert('part_service_assembly_details');
-
- IC->create_links("IC", \%myconfig, \%$form);
-
- # currencies
- map({ $form->{selectcurrency} .= "