X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=sql-ledger%2Fbin%2Fmozilla%2Fic.pl;h=f643c1301fd7637f49f5831ca923db11485f1c75;hb=f7fd2a3e34da751cbc02bbf215e99c6dc89adc15;hp=797daee01eccf8da174da616d3e87f3d1d8a490a;hpb=0ebeec96313dd7edfca340f01f8fbbbac1f4aa1d;p=freeside.git diff --git a/sql-ledger/bin/mozilla/ic.pl b/sql-ledger/bin/mozilla/ic.pl index 797daee01..f643c1301 100644 --- a/sql-ledger/bin/mozilla/ic.pl +++ b/sql-ledger/bin/mozilla/ic.pl @@ -6,6 +6,7 @@ # Email: dsimader@sql-ledger.org # Web: http://www.sql-ledger.org # +# Contributors: # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,14 +38,28 @@ require "$form->{path}/io.pl"; sub add { - $form->{title} = $locale->text('Add ' . ucfirst $form->{item}); + %label = ( part => 'Part', + service => 'Service', + assembly => 'Assembly', + labor => 'Labor/Overhead' ); - $form->{callback} = "$form->{script}?action=add&item=$form->{item}&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; +# $locale->text('Add Part') +# $locale->text('Add Service') +# $locale->text('Add Assembly') +# $locale->text('Add Labor/Overhead') - $form->{unit} = ($form->{item} eq 'service') ? $locale->text('hr') : $locale->text('ea'); + $label = "Add $label{$form->{item}}"; + $form->{title} = $locale->text($label); + + $form->{callback} = "$form->{script}?action=add&item=$form->{item}&path=$form->{path}&login=$form->{login}&sessionid=$form->{sessionid}" unless $form->{callback}; + + $form->{orphaned} = 1; + + if ($form->{previousform}) { + $form->{callback} = ""; + } &link_part; - &display_form; } @@ -52,13 +67,55 @@ sub add { sub search { - $form->{title} = (ucfirst $form->{searchitems})."s"; - $form->{title} = $locale->text($form->{title}); - -# $locale->text('Parts') -# $locale->text('Services') + $form->get_partsgroup(\%myconfig, { all => 0, searchitems => $form->{searchitems}}); + + IC->get_warehouses(\%myconfig, \%$form) unless $form->{searchitems} =~ /(service|labor)/; + + if (@{ $form->{all_partsgroup} }) { + $partsgroup = qq|