1 #=====================================================================
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
7 #=====================================================================
8 # SQL-Ledger, Accounting
11 # Author: Dieter Simader
12 # Email: dsimader@sql-ledger.org
13 # Web: http://www.sql-ledger.org
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #======================================================================
30 # Inventory Control module
32 #======================================================================
35 use POSIX qw(strftime);
38 use SL::ReportGenerator;
46 our ($form, $locale, %myconfig, $lxdebug);
48 require "bin/mozilla/io.pl";
49 require "bin/mozilla/common.pl";
50 require "bin/mozilla/reportgenerator.pl";
57 $lxdebug->enter_sub();
59 $form->{title} = $locale->text('Add ' . ucfirst $form->{item});
62 "$form->{script}?action=add&item=$form->{item}&login=$form->{login}&password=$form->{password}"
63 unless $form->{callback};
65 $form->{"unit_changeable"} = 1;
67 IC->get_pricegroups(\%myconfig, \%$form);
71 $lxdebug->leave_sub();
75 $lxdebug->enter_sub();
77 my ($button1, $button2, $onhand, $makemodel, $serialnumber, $l_serialnumber, $toplevel, $bought);
79 $form->{title} = (ucfirst $form->{searchitems}) . "s";
80 $form->{title} = $locale->text($form->{title});
82 # switch for backward sorting
85 # memory for which table was sort at last time
86 $form->{lastsort} = "";
88 # counter for added entries to top100
89 $form->{ndxs_counter} = 0;
91 # $locale->text('Parts')
92 # $locale->text('Services')
94 # use JavaScript Calendar or not
95 $form->{jsscript} = 1;
97 if ($form->{jsscript}) {
99 # with JavaScript Calendar
101 <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>
102 <td><input type=button name=transdatefrom id="trigger1" value=|
103 . $locale->text('button') . qq|></td>
106 <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>
107 <td><input type=button name=transdateto name=transdateto id="trigger2" value=|
108 . $locale->text('button') . qq|></td>
113 Form->write_trigger(\%myconfig, "2", "transdatefrom", "BL", "trigger1",
114 "transdateto", "BL", "trigger2");
117 # without JavaScript Calendar
119 <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>|;
121 <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>|;
124 unless ($form->{searchitems} eq 'service') {
127 <input name=itemstatus class=radio type=radio value=onhand> |
128 . $locale->text('On Hand') . qq|
129 <input name=itemstatus class=radio type=radio value=short> |
130 . $locale->text('Short') . qq|
135 <th align=right nowrap>| . $locale->text('Make') . qq|</th>
136 <td><input name=make size=20></td>
137 <th align=right nowrap>| . $locale->text('Model') . qq|</th>
138 <td><input name=model size=20></td>
143 <th align=right nowrap>| . $locale->text('Serial Number') . qq|</th>
144 <td><input name=serialnumber size=20></td>
147 $l_serialnumber = qq|
148 <td><input name=l_serialnumber class=checkbox type=checkbox value=Y> |
149 . $locale->text('Serial Number') . qq|</td>
154 if ($form->{searchitems} eq 'assembly') {
156 $form->{title} = $locale->text('Assemblies');
162 <input name=null class=radio type=radio value=1 checked> |
163 . $locale->text('Top Level') . qq|
164 <input name=bom class=checkbox type=checkbox value=1> |
165 . $locale->text('Individual Items') . qq|
179 <td><input name=sold class=checkbox type=checkbox value=1></td>
180 <td nowrap>| . $locale->text('Sold') . qq|</td>
183 <td colspan=2><hr size=1 noshade></td>
186 <td><input name=ordered class=checkbox type=checkbox value=1></td>
187 <td nowrap>| . $locale->text('Ordered') . qq|</td>
190 <td colspan=4><hr size=1 noshade></td>
193 <td><input name=quoted class=checkbox type=checkbox value=1></td>
194 <td nowrap>| . $locale->text('Quoted') . qq|</td>
198 <td width=5%> </td>
199 <th>| . $locale->text('From') . qq|</th>
201 <th>| . $locale->text('To (time)') . qq|</th>
220 <td><input name=bought class=checkbox type=checkbox value=1></td>
221 <td nowrap>| . $locale->text('Bought') . qq|</td>
222 <td><input name=sold class=checkbox type=checkbox value=1></td>
223 <td nowrap>| . $locale->text('Sold') . qq|</td>
226 <td colspan=4><hr size=1 noshade></td>
229 <td><input name=onorder class=checkbox type=checkbox value=1></td>
230 <td nowrap>| . $locale->text('On Order') . qq|</td>
231 <td><input name=ordered class=checkbox type=checkbox value=1></td>
232 <td nowrap>| . $locale->text('Ordered') . qq|</td>
235 <td colspan=4><hr size=1 noshade></td>
238 <td><input name=rfq class=checkbox type=checkbox value=1></td>
239 <td nowrap>| . $locale->text('RFQ') . qq|</td>
240 <td><input name=quoted class=checkbox type=checkbox value=1></td>
241 <td nowrap>| . $locale->text('Quoted') . qq|</td>
245 <td width=5%> </td>
249 <th>| . $locale->text('From') . qq|</th>
251 <th>| . $locale->text('To (time)') . qq|</th>
268 <form method=post action=$form->{script}>
270 <input type=hidden name=searchitems value=$form->{searchitems}>
271 <input type=hidden name=title value="$form->{title}">
273 <input type=hidden name=revers value="$form->{revers}">
274 <input type=hidden name=lastsort value="$form->{lastsort}">
277 <tr><th class=listtop>$form->{title}</th></tr>
283 <th align=right nowrap>| . $locale->text('Part Number') . qq|</th>
284 <td><input name=partnumber size=20></td>
285 <th align=right nowrap>| . $locale->text('EAN') . qq|</th>
286 <td><input name=ean size=20></td>
289 <th align=right nowrap>|
290 . $locale->text('Part Description') . qq|</th>
291 <td colspan=3><input name=description size=40></td>
294 <th align=right nowrap>| . $locale->text('Group') . qq|</th>
295 <td><input name=partsgroup size=20></td>
300 <th align=right nowrap>| . $locale->text('Drawing') . qq|</th>
301 <td><input name=drawing size=20></td>
302 <th align=right nowrap>| . $locale->text('Microfiche') . qq|</th>
303 <td><input name=microfiche size=20></td>
309 <input name=itemstatus class=radio type=radio value=active checked> |
310 . $locale->text('Active') . qq|
312 <input name=itemstatus class=radio type=radio value=obsolete> |
313 . $locale->text('Obsolete') . qq|
314 <input name=itemstatus class=radio type=radio value=orphaned> |
315 . $locale->text('Orphaned') . qq|
326 <th align=right nowrap>|
327 . $locale->text('Include in Report') . qq|</th>
331 <td><input name=l_partnumber class=checkbox type=checkbox value=Y checked> |
332 . $locale->text('Part Number') . qq|</td>
333 <td><input name=l_description class=checkbox type=checkbox value=Y checked> |
334 . $locale->text('Part Description') . qq|</td>
336 <td><input name=l_unit class=checkbox type=checkbox value=Y checked> |
337 . $locale->text('Unit of measure') . qq|</td>
340 <td><input name=l_listprice class=checkbox type=checkbox value=Y> |
341 . $locale->text('List Price') . qq|</td>
342 <td><input name=l_sellprice class=checkbox type=checkbox value=Y checked> |
343 . $locale->text('Sell Price') . qq|</td>
344 <td><input name=l_lastcost class=checkbox type=checkbox value=Y checked> |
345 . $locale->text('Last Cost') . qq|</td>
346 <td><input name=l_linetotal class=checkbox type=checkbox value=Y checked> |
347 . $locale->text('Line Total') . qq|</td>
350 <td><input name=l_priceupdate class=checkbox type=checkbox value=Y> |
351 . $locale->text('Updated') . qq|</td>
352 <td><input name=l_bin class=checkbox type=checkbox value=Y> |
353 . $locale->text('Bin') . qq|</td>
354 <td><input name=l_rop class=checkbox type=checkbox value=Y> |
355 . $locale->text('ROP') . qq|</td>
356 <td><input name=l_weight class=checkbox type=checkbox value=Y> |
357 . $locale->text('Weight') . qq|</td>
360 <td><input name=l_image class=checkbox type=checkbox value=Y> |
361 . $locale->text('Image') . qq|</td>
362 <td><input name=l_drawing class=checkbox type=checkbox value=Y> |
363 . $locale->text('Drawing') . qq|</td>
364 <td><input name=l_microfiche class=checkbox type=checkbox value=Y> |
365 . $locale->text('Microfiche') . qq|</td>
366 <td><input name=l_partsgroup class=checkbox type=checkbox value=Y> |
367 . $locale->text('Group') . qq|</td>
370 <td><input name=l_subtotal class=checkbox type=checkbox value=Y> |
371 . $locale->text('Subtotal') . qq|</td>
372 <td><input name=l_soldtotal class=checkbox type=checkbox value=Y> |
373 . $locale->text('soldtotal') . qq|</td>
374 <td><input name=l_deliverydate class=checkbox type=checkbox value=Y> |
375 . $locale->text('deliverydate') . qq|</td>
383 <tr><td colspan=4><hr size=3 noshade></td></tr>
388 <input type=hidden name=nextsub value=generate_report>
390 <input type=hidden name=login value=$form->{login}>
391 <input type=hidden name=password value=$form->{password}>
393 <input type=hidden name=revers value="$form->{revers}">
394 <input type=hidden name=lastsort value="$form->{lastsort}">
395 <input type=hidden name=sort value="description">
397 <input type=hidden name=ndxs_counter value="$form->{ndxs_counter}">
400 <input class=submit type=submit name=action value="|
401 . $locale->text('Continue') . qq|">
402 <input class=submit type=submit name=action value="|
403 . $locale->text('TOP100') . qq|">
409 $lxdebug->leave_sub();
412 sub search_update_prices {
413 $lxdebug->enter_sub();
415 my ($onhand, $makemodel, $serialnumber, $l_serialnumber, $toplevel, $bought);
417 $form->{title} = $locale->text('Update prices');
418 IC->get_pricegroups(\%myconfig, \%$form);
420 # use JavaScript Calendar or not
421 # $form->{jsscript} = 1;
423 # if ($form->{jsscript}) {
425 # # with JavaScript Calendar
427 # <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>
428 # <td><input type=button name=transdatefrom id="trigger1" value=|
429 # . $locale->text('button') . qq|></td>
432 # <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>
433 # <td><input type=button name=transdateto name=transdateto id="trigger2" value=|
434 # . $locale->text('button') . qq|></td>
439 # Form->write_trigger(\%myconfig, "2", "transdatefrom", "BL", "trigger1",
440 # "transdateto", "BL", "trigger2");
443 # # without JavaScript Calendar
445 # <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>|;
447 # <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>|;
451 <input name=itemstatus class=radio type=radio value=onhand> |
452 . $locale->text('On Hand') . qq|
453 <input name=itemstatus class=radio type=radio value=short> |
454 . $locale->text('Short') . qq|
459 <th align=right nowrap>| . $locale->text('Make') . qq|</th>
460 <td><input name=make size=20></td>
461 <th align=right nowrap>| . $locale->text('Model') . qq|</th>
462 <td><input name=model size=20></td>
467 <th align=right nowrap>| . $locale->text('Serial Number') . qq|</th>
468 <td><input name=serialnumber size=20></td>
471 $l_serialnumber = qq|
472 <td><input name=l_serialnumber class=checkbox type=checkbox value=Y> |
473 . $locale->text('Serial Number') . qq|</td>
483 <form method=post action=$form->{script}>
485 <input type=hidden name=title value="$form->{title}">
488 <tr><th class=listtop>$form->{title}</th></tr>
494 <th align=right nowrap>| . $locale->text('Part Number') . qq|</th>
495 <td><input name=partnumber size=20></td>
498 <th align=right nowrap>|
499 . $locale->text('Part Description') . qq|</th>
500 <td colspan=3><input name=description size=40></td>
503 <th align=right nowrap>| . $locale->text('Group') . qq|</th>
504 <td><input name=partsgroup size=20></td>
509 <th align=right nowrap>| . $locale->text('Drawing') . qq|</th>
510 <td><input name=drawing size=20></td>
511 <th align=right nowrap>| . $locale->text('Microfiche') . qq|</th>
512 <td><input name=microfiche size=20></td>
518 <input name=itemstatus class=radio type=radio value=active checked> |
519 . $locale->text('Active') . qq|
521 <input name=itemstatus class=radio type=radio value=obsolete> |
522 . $locale->text('Obsolete') . qq|
523 <input name=itemstatus class=radio type=radio value=orphaned> |
524 . $locale->text('Orphaned') . qq|
539 <th class="listheading">| . $locale->text('Preisklasse') . qq|</th>
540 <th class="listheading">| . $locale->text('Preis') . qq|</th>
541 <th class="listheading">| . $locale->text('Prozentual/Absolut') . qq|</th>
544 <td>| . $locale->text('Sell Price') . qq|</td>
545 <td><input name="sellprice" size=11 value="$form->{"sellprice"}"></td>
546 <td><input name="sellprice_type" class=radio type=radio value=percent checked>/<input name="sellprice_type" class=radio type=radio value=absolut></td>
549 <td>| . $locale->text('List Price') . qq|</td>
550 <td><input name="listprice" size=11 value="$form->{"listprice"}"></td>
551 <td><input name="listprice_type" class=radio type=radio value=percent checked>/<input name="listprice_type" class=radio type=radio value=absolut></td>
554 for my $i (1 .. $form->{price_rows}) {
557 <td width=50%><input type=hidden name="pricegroup_$i" size=30 value="$form->{"pricegroup_$i"}">$form->{"pricegroup_$i"}</td>
558 <td width=50%><input name="price_$i" size=11></td>
559 <input type=hidden name="pricegroup_id_$i" value="$form->{"pricegroup_id_$i"}">
560 <td><input name="pricegroup_type_$i" class=radio type=radio value=percent checked>/<input name="pricegroup_type_$i" class=radio type=radio value=absolut></td>
570 <tr><td colspan=4><hr size=3 noshade></td></tr>
572 <input type=hidden name=nextsub value=confirm_price_update>
573 <input type=hidden name=price_rows value=$form->{price_rows}>
575 <input type=hidden name=login value=$form->{login}>
576 <input type=hidden name=password value=$form->{password}>
579 <input class=submit type=submit name=action value="|
580 . $locale->text('Continue') . qq|">
586 $lxdebug->leave_sub();
589 sub confirm_price_update {
590 $lxdebug->enter_sub();
593 $form->{nextsub} = "update_prices";
599 <form method=post action=$form->{script}>
602 # delete action variable
603 map { delete $form->{$_} } qw(action header);
605 foreach my $key (keys %$form) {
606 $form->{$key} =~ s/\"/"/g;
607 print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
611 <h2 class=confirm>| . $locale->text('Confirm!') . qq|</h2>
614 . $locale->text('Are you sure you want to update the prices')
618 <input name=action class=submit type=submit value="|
619 . $locale->text('Continue') . qq|">
623 $lxdebug->leave_sub();
627 $lxdebug->enter_sub();
629 if (IC->update_prices(\%myconfig, \%$form)) {
630 $form->redirect($form->{update_count} . $locale->text('prices updated!'));
632 $form->error($locale->text('Could not update prices!'));
635 $lxdebug->leave_sub();
639 $lxdebug->enter_sub();
644 $form->{title} = $locale->text('Top 100 hinzufuegen');
651 <form method=post action=$form->{script}>
653 <input type=hidden name=searchitems value=$form->{searchitems}>
654 <input type=hidden name=title value="$form->{title}">
656 <input type=hidden name=revers value="$form->{revers}">
657 <input type=hidden name=lastsort value="$form->{lastsort}">|;
661 <tr class=listheading>
662 <th class=listheading nowrap>| . $locale->text('Part Number') . qq|</th>
663 <th class=listheading nowrap>| . $locale->text('Part Description') . qq|</th>
666 <td><input type=text name=partnumber size=20 value=></td>
667 <td><input type=text name=description size=30 value=></td>
674 <input type=hidden name=login value=$form->{login}>
675 <input type=hidden name=password value=$form->{password}>
677 <input type=hidden name=itemstatus value="$form->{itemstatus}">
678 <input type=hidden name=l_linetotal value="$form->{l_linetotal}">
679 <input type=hidden name=l_partnumber value="$form->{l_partnumber}">
680 <input type=hidden name=l_description value="$form->{l_description}">
681 <input type=hidden name=l_onhand value="$form->{l_onhand}">
682 <input type=hidden name=l_unit value="$form->{l_unit}">
683 <input type=hidden name=l_sellprice value="$form->{l_sellprice}">
684 <input type=hidden name=l_linetotalsellprice value="$form->{l_linetotalsellprice}">
685 <input type=hidden name=sort value="$form->{sort}">
686 <input type=hidden name=revers value="$form->{revers}">
687 <input type=hidden name=lastsort value="$form->{lastsort}">
689 <input type=hidden name=bom value="$form->{bom}">
690 <input type=hidden name=titel value="$form->{titel}">
691 <input type=hidden name=searchitems value="$form->{searchitems}">
693 <input type=hidden name=row value=$j>
695 <input type=hidden name=nextsub value=item_selected>
697 <input type=hidden name=test value=item_selected>
699 <input name=lastndx type=hidden value=$lastndx>
701 <input name=ndxs_counter type=hidden value=$form->{ndxs_counter}>
703 <input name=extras type=hidden value=$form->{extras}>|;
705 my ($partnumber, $description, $unit, $sellprice, $soldtotal);
708 for (my $i = 0; $i < $form->{ndxs_counter}; $i++) {
711 $partnumber = $form->{"totop100_partnumber_$j"};
712 $description = $form->{"totop100_description_$j"};
713 $unit = $form->{"totop100_unit_$j"};
714 $sellprice = $form->{"totop100_sellprice_$j"};
715 $soldtotal = $form->{"totop100_soldtotal_$j"};
717 # insert data into top100
718 push @{ $form->{parts} },
720 partnumber => "$partnumber",
721 description => "$description",
723 sellprice => "$sellprice",
724 soldtotal => "$soldtotal" };
730 # set data for next page
731 if (($form->{ndxs_counter}) > 0) {
732 for (my $i = 1; ($i < $form->{ndxs_counter} + 1); $i++) {
733 $partnumber = $form->{"totop100_partnumber_$i"};
734 $description = $form->{"totop100_description_$i"};
735 $unit = $form->{"totop100_unit_$i"};
736 $sellprice = $form->{"totop100_sellprice_$i"};
737 $soldtotal = $form->{"totop100_soldtotal_$i"};
740 <input type=hidden name=totop100_partnumber_$i value=$form->{"totop100_partnumber_$i"}>
741 <input type=hidden name=totop100_description_$i value=$form->{"totop100_description_$i"}>
742 <input type=hidden name=totop100_unit_$i value=$form->{"totop100_unit_$i"}>
743 <input type=hidden name=totop100_sellprice_$i value=$form->{"totop100_sellprice_$i"}>
744 <input type=hidden name=totop100_soldtotal_$i value=$form->{"totop100_soldtotal_$i"}>
752 <input class=submit type=submit name=action value="|
753 . $locale->text('list') . qq|">
758 $lxdebug->leave_sub();
762 $lxdebug->enter_sub();
765 our ($partnumber, $description, $unit, $sellprice, $soldtotal);
767 my @sortorders = ("", "partnumber", "description", "all");
768 my $sortorder = $sortorders[($form->{description} ? 2 : 0) + ($form->{partnumber} ? 1 : 0)];
769 IC->get_parts(\%myconfig, \%$form, $sortorder);
771 $form->{title} = $locale->text('Top 100 hinzufuegen');
777 <form method=post action=ic.pl>
780 <th class=listtop colspan=6>| . $locale->text('choice part') . qq|</th>
783 <tr class=listheading>
785 <th class=listheading>| . $locale->text('Part Number') . qq|</th>
786 <th class=listheading>| . $locale->text('Part Description') . qq|</th>
787 <th class=listheading>| . $locale->text('Unit of measure') . qq|</th>
788 <th class=listheading>| . $locale->text('Sell Price') . qq|</th>
789 <th class=listheading>| . $locale->text('soldtotal') . qq|</th>
793 my $i = $form->{rows};
795 for ($j = 1; $j <= $i; $j++) {
798 <tr class=listrow1>|;
801 <td><input name=ndx class=radio type=radio value=$j checked></td>|;
804 <td><input name=ndx class=radio type=radio value=$j></td>|;
807 <td><input name="new_partnumber_$j" type=hidden value="$form->{"partnumber_$j"}">$form->{"partnumber_$j"}</td>
808 <td><input name="new_description_$j" type=hidden value="$form->{"description_$j"}">$form->{"description_$j"}</td>
809 <td><input name="new_unit_$j" type=hidden value="$form->{"unit_$j"}">$form->{"unit_$j"}</td>
810 <td><input name="new_sellprice_$j" type=hidden value="$form->{"sellprice_$j"}">$form->{"sellprice_$j"}</td>
811 <td><input name="new_soldtotal_$j" type=hidden value="$form->{"soldtotal_$j"}">$form->{"soldtotal_$j"}</td>
814 <input name="new_id_$j" type=hidden value="$form->{"id_$j"}">|;
824 <input type=hidden name=login value=$form->{login}>
825 <input type=hidden name=password value=$form->{password}>
827 <input type=hidden name=itemstatus value="$form->{itemstatus}">
828 <input type=hidden name=l_linetotal value="$form->{l_linetotal}">
829 <input type=hidden name=l_partnumber value="$form->{l_partnumber}">
830 <input type=hidden name=l_description value="$form->{l_description}">
831 <input type=hidden name=l_onhand value="$form->{l_onhand}">
832 <input type=hidden name=l_unit value="$form->{l_unit}">
833 <input type=hidden name=l_sellprice value="$form->{l_sellprice}">
834 <input type=hidden name=l_linetotalsellprice value="$form->{l_linetotalsellprice}">
835 <input type=hidden name=sort value="$form->{sort}">
836 <input type=hidden name=revers value="$form->{revers}">
837 <input type=hidden name=lastsort value="$form->{lastsort}">
839 <input type=hidden name=bom value="$form->{bom}">
840 <input type=hidden name=titel value="$form->{titel}">
841 <input type=hidden name=searchitems value="$form->{searchitems}">
843 <input type=hidden name=row value=$j>
845 <input type=hidden name=nextsub value=item_selected>
847 <input name=lastndx type=hidden value=$lastndx>
849 <input name=ndxs_counter type=hidden value=$form->{ndxs_counter}>|;
853 if (($form->{ndxs_counter}) > 0) {
854 for ($i = 1; ($i < $form->{ndxs_counter} + 1); $i++) {
856 $partnumber = $form->{"totop100_partnumber_$i"};
857 $description = $form->{"totop100_description_$i"};
858 $unit = $form->{"totop100_unit_$i"};
859 $sellprice = $form->{"totop100_sellprice_$i"};
860 $soldtotal = $form->{"totop100_soldtotal_$i"};
863 <input type=hidden name=totop100_partnumber_$i value=$form->{"totop100_partnumber_$i"}>
864 <input type=hidden name=totop100_description_$i value=$form->{"totop100_description_$i"}>
865 <input type=hidden name=totop100_unit_$i value=$form->{"totop100_unit_$i"}>
866 <input type=hidden name=totop100_sellprice_$i value=$form->{"totop100_sellprice_$i"}>
867 <input type=hidden name=totop100_soldtotal_$i value=$form->{"totop100_soldtotal_$i"}>
875 <input class=submit type=submit name=action value="|
876 . $locale->text('TOP100') . qq|">
882 $lxdebug->leave_sub();
886 $lxdebug->enter_sub();
889 $form->{ndxs_counter}++;
891 if ($form->{ndxs_counter} > 0) {
893 my $index = $form->{ndx};
895 $form->{"totop100_partnumber_$form->{ndxs_counter}"} = $form->{"new_partnumber_$index"};
896 $form->{"totop100_description_$form->{ndxs_counter}"} = $form->{"new_description_$index"};
897 $form->{"totop100_unit_$form->{ndxs_counter}"} = $form->{"new_unit_$index"};
898 $form->{"totop100_sellprice_$form->{ndxs_counter}"} = $form->{"new_sellprice_$index"};
899 $form->{"totop100_soldtotal_$form->{ndxs_counter}"} = $form->{"new_soldtotal_$index"};
903 $lxdebug->leave_sub();
907 $lxdebug->enter_sub();
909 my ($revers, $lastsort, $callback, $option, $description, $sameitem,
910 $partnumber, $unit, $sellprice, $soldtotal, $totop100, $onhand, $align);
911 my (@column_index, %column_header, %column_data);
912 my ($totalsellprice, $totallastcost, $totallistprice, $subtotalonhand, $subtotalsellprice, $subtotallastcost, $subtotallistprice);
914 $form->{top100} = "top100";
915 $form->{l_soldtotal} = "Y";
916 $form->{soldtotal} = "soldtotal";
917 $form->{sort} = "soldtotal";
918 $form->{l_qty} = "N";
919 $form->{l_linetotal} = "";
921 $form->{number} = "position";
922 $form->{l_number} = "Y";
926 $form->{title} = $locale->text('Top 100');
928 $revers = $form->{revers};
929 $lastsort = $form->{lastsort};
931 if (($form->{lastsort} eq "") && ($form->{sort} eq undef)) {
933 $form->{lastsort} = "partnumber";
934 $form->{sort} = "partnumber";
938 "$form->{script}?action=top100&login=$form->{login}&password=$form->{password}&searchitems=$form->{searchitems}&itemstatus=$form->{itemstatus}&bom=$form->{bom}&l_linetotal=$form->{l_linetotal}&title="
939 . $form->escape($form->{title}, 1);
941 # if we have a serialnumber limit search
942 if ($form->{serialnumber} || $form->{l_serialnumber}) {
943 $form->{l_serialnumber} = "Y";
944 unless ( $form->{bought}
947 || $form->{quoted}) {
948 $form->{bought} = $form->{sold} = 1;
951 IC->all_parts(\%myconfig, \%$form);
953 if ($form->{itemstatus} eq 'active') {
954 $option .= $locale->text('Active') . " : ";
956 if ($form->{itemstatus} eq 'obsolete') {
957 $option .= $locale->text('Obsolete') . " : ";
959 if ($form->{itemstatus} eq 'orphaned') {
960 $option .= $locale->text('Orphaned') . " : ";
962 if ($form->{itemstatus} eq 'onhand') {
963 $option .= $locale->text('On Hand') . " : ";
964 $form->{l_onhand} = "Y";
966 if ($form->{itemstatus} eq 'short') {
967 $option .= $locale->text('Short') . " : ";
968 $form->{l_onhand} = "Y";
970 if ($form->{onorder}) {
971 $form->{l_ordnumber} = "Y";
972 $callback .= "&onorder=$form->{onorder}";
973 $option .= $locale->text('On Order') . " : ";
975 if ($form->{ordered}) {
976 $form->{l_ordnumber} = "Y";
977 $callback .= "&ordered=$form->{ordered}";
978 $option .= $locale->text('Ordered') . " : ";
981 $form->{l_quonumber} = "Y";
982 $callback .= "&rfq=$form->{rfq}";
983 $option .= $locale->text('RFQ') . " : ";
985 if ($form->{quoted}) {
986 $form->{l_quonumber} = "Y";
987 $callback .= ""ed=$form->{quoted}";
988 $option .= $locale->text('Quoted') . " : ";
990 if ($form->{bought}) {
991 $form->{l_invnumber} = "Y";
992 $callback .= "&bought=$form->{bought}";
993 $option .= $locale->text('Bought') . " : ";
996 $form->{l_invnumber} = "Y";
997 $callback .= "&sold=$form->{sold}";
998 $option .= $locale->text('Sold') . " : ";
1000 if ( $form->{bought}
1005 || $form->{quoted}) {
1007 $form->{l_lastcost} = "";
1008 $form->{l_name} = "Y";
1009 if ($form->{transdatefrom}) {
1010 $callback .= "&transdatefrom=$form->{transdatefrom}";
1012 . $locale->text('From')
1014 . $locale->date(\%myconfig, $form->{transdatefrom}, 1);
1016 if ($form->{transdateto}) {
1017 $callback .= "&transdateto=$form->{transdateto}";
1019 . $locale->text('To')
1021 . $locale->date(\%myconfig, $form->{transdateto}, 1);
1027 if ($form->{partnumber}) {
1028 $callback .= "&partnumber=$form->{partnumber}";
1029 $option .= $locale->text('Part Number') . qq| : $form->{partnumber}<br>|;
1032 $callback .= "&partnumber=$form->{ean}";
1033 $option .= $locale->text('EAN') . qq| : $form->{ean}<br>|;
1035 if ($form->{partsgroup}) {
1036 $callback .= "&partsgroup=$form->{partsgroup}";
1037 $option .= $locale->text('Group') . qq| : $form->{partsgroup}<br>|;
1039 if ($form->{serialnumber}) {
1040 $callback .= "&serialnumber=$form->{serialnumber}";
1042 $locale->text('Serial Number') . qq| : $form->{serialnumber}<br>|;
1044 if ($form->{description}) {
1045 $callback .= "&description=$form->{description}";
1046 $description = $form->{description};
1050 $locale->text('Part Description') . qq| : $form->{description}<br>|;
1052 if ($form->{make}) {
1053 $callback .= "&make=$form->{make}";
1054 $option .= $locale->text('Make') . qq| : $form->{make}<br>|;
1056 if ($form->{model}) {
1057 $callback .= "&model=$form->{model}";
1058 $option .= $locale->text('Model') . qq| : $form->{model}<br>|;
1060 if ($form->{drawing}) {
1061 $callback .= "&drawing=$form->{drawing}";
1062 $option .= $locale->text('Drawing') . qq| : $form->{drawing}<br>|;
1064 if ($form->{microfiche}) {
1065 $callback .= "µfiche=$form->{microfiche}";
1066 $option .= $locale->text('Microfiche') . qq| : $form->{microfiche}<br>|;
1068 if ($form->{l_soldtotal}) {
1069 $callback .= "&soldtotal=$form->{soldtotal}";
1070 $option .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|;
1073 my @columns = $form->sort_columns(
1074 qw(number partnumber ean description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal)
1077 if ($form->{l_linetotal}) {
1078 $form->{l_onhand} = "Y";
1079 $form->{l_linetotalsellprice} = "Y" if $form->{l_sellprice};
1080 if ($form->{l_lastcost}) {
1081 $form->{l_linetotallastcost} = "Y";
1082 if (($form->{searchitems} eq 'assembly') && !$form->{bom}) {
1083 $form->{l_linetotallastcost} = "";
1086 $form->{l_linetotallistprice} = "Y" if $form->{l_listprice};
1089 if ($form->{searchitems} eq 'service') {
1091 # remove bin, weight and rop from list
1092 map { $form->{"l_$_"} = "" } qw(bin weight rop);
1094 $form->{l_onhand} = "";
1096 # qty is irrelevant unless bought or sold
1097 if ( $form->{bought}
1102 || $form->{quoted}) {
1103 $form->{l_onhand} = "Y";
1105 $form->{l_linetotalsellprice} = "";
1106 $form->{l_linetotallastcost} = "";
1110 $form->{l_lastcost} = ""
1111 if ($form->{searchitems} eq 'assembly' && !$form->{bom});
1113 foreach my $item (@columns) {
1114 if ($form->{"l_$item"} eq "Y") {
1115 push @column_index, $item;
1117 # add column to callback
1118 $callback .= "&l_$item=Y";
1122 if ($form->{l_subtotal} eq 'Y') {
1123 $callback .= "&l_subtotal=Y";
1126 $column_header{number} =
1127 qq|<th class=listheading nowrap>| . $locale->text('number') . qq|</th>|;
1128 $column_header{partnumber} =
1129 qq|<th nowrap><a class=listheading href=$callback&sort=partnumber&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1130 . $locale->text('Part Number')
1132 $column_header{description} =
1133 qq|<th nowrap><a class=listheading href=$callback&sort=description&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1134 . $locale->text('Part Description')
1136 $column_header{partsgroup} =
1137 qq|<th nowrap><a class=listheading href=$callback&sort=partsgroup>|
1138 . $locale->text('Group')
1140 $column_header{bin} =
1141 qq|<th><a class=listheading href=$callback&sort=bin>|
1142 . $locale->text('Bin')
1144 $column_header{priceupdate} =
1145 qq|<th nowrap><a class=listheading href=$callback&sort=priceupdate>|
1146 . $locale->text('Updated')
1148 $column_header{onhand} =
1149 qq|<th nowrap><a class=listheading href=$callback&sort=onhand&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1150 . $locale->text('Qty')
1152 $column_header{unit} =
1153 qq|<th class=listheading nowrap>| . $locale->text('Unit') . qq|</th>|;
1154 $column_header{listprice} =
1155 qq|<th class=listheading nowrap>|
1156 . $locale->text('List Price')
1158 $column_header{lastcost} =
1159 qq|<th class=listheading nowrap>| . $locale->text('Last Cost') . qq|</th>|;
1160 $column_header{rop} =
1161 qq|<th class=listheading nowrap>| . $locale->text('ROP') . qq|</th>|;
1162 $column_header{weight} =
1163 qq|<th class=listheading nowrap>| . $locale->text('Weight') . qq|</th>|;
1165 $column_header{invnumber} =
1166 qq|<th nowrap><a class=listheading href=$callback&sort=invnumber>|
1167 . $locale->text('Invoice Number')
1169 $column_header{ordnumber} =
1170 qq|<th nowrap><a class=listheading href=$callback&sort=ordnumber>|
1171 . $locale->text('Order Number')
1173 $column_header{quonumber} =
1174 qq|<th nowrap><a class=listheading href=$callback&sort=quonumber>|
1175 . $locale->text('Quotation')
1178 $column_header{name} =
1179 qq|<th nowrap><a class=listheading href=$callback&sort=name>|
1180 . $locale->text('Name')
1183 $column_header{sellprice} =
1184 qq|<th class=listheading nowrap>|
1185 . $locale->text('Sell Price')
1187 $column_header{linetotalsellprice} =
1188 qq|<th class=listheading nowrap>| . $locale->text('Extended') . qq|</th>|;
1189 $column_header{linetotallastcost} =
1190 qq|<th class=listheading nowrap>| . $locale->text('Extended') . qq|</th>|;
1191 $column_header{linetotallistprice} =
1192 qq|<th class=listheading nowrap>| . $locale->text('Extended') . qq|</th>|;
1194 $column_header{image} =
1195 qq|<th class=listheading nowrap>| . $locale->text('Image') . qq|</a></th>|;
1196 $column_header{drawing} =
1197 qq|<th nowrap><a class=listheading href=$callback&sort=drawing>|
1198 . $locale->text('Drawing')
1200 $column_header{microfiche} =
1201 qq|<th nowrap><a class=listheading href=$callback&sort=microfiche>|
1202 . $locale->text('Microfiche')
1205 $column_header{serialnumber} =
1206 qq|<th nowrap><a class=listheading href=$callback&sort=serialnumber>|
1207 . $locale->text('Serial Number')
1209 $column_header{soldtotal} =
1210 qq|<th nowrap><a class=listheading href=$callback&sort=soldtotal&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1211 . $locale->text('soldtotal')
1215 my $colspan = $#column_index + 1;
1222 <th class=listtop colspan=$colspan>$form->{title}</th>
1224 <tr height="5"></tr>
1226 <tr><td colspan=$colspan>$option</td></tr>
1228 <tr class=listheading>
1231 map { print "\n$column_header{$_}" } @column_index;
1237 # add order to callback
1238 $form->{callback} = $callback .= "&sort=$form->{sort}";
1240 # escape callback for href
1241 $callback = $form->escape($callback);
1243 if (@{ $form->{parts} }) {
1244 $sameitem = $form->{parts}->[0]->{ $form->{sort} };
1247 # insert numbers for top100
1249 foreach my $ref (@{ $form->{parts} }) {
1251 $ref->{number} = $j;
1254 # if avaible -> insert choice here
1255 if (($form->{ndxs_counter}) > 0) {
1256 for (my $i = 1; ($i < $form->{ndxs_counter} + 1); $i++) {
1257 $partnumber = $form->{"totop100_partnumber_$i"};
1258 $description = $form->{"totop100_description_$i"};
1259 $unit = $form->{"totop100_unit_$i"};
1260 $sellprice = $form->{"totop100_sellprice_$i"};
1261 $soldtotal = $form->{"totop100_soldtotal_$i"};
1264 <input type=hidden name=totop100_partnumber_$i value=$form->{"totop100_partnumber_$i"}>
1265 <input type=hidden name=totop100_description_$i value=$form->{"totop100_description_$i"}>
1266 <input type=hidden name=totop100_unit_$i value=$form->{"totop100_unit_$i"}>
1267 <input type=hidden name=totop100_sellprice_$i value=$form->{"totop100_sellprice_$i"}>
1268 <input type=hidden name=totop100_soldtotal_$i value=$form->{"totop100_soldtotal_$i"}>
1272 push @{ $form->{parts} },
1274 partnumber => "$partnumber",
1275 description => "$description",
1277 sellprice => "$sellprice",
1278 soldtotal => "$soldtotal" };
1281 # build data for columns
1282 foreach my $ref (@{ $form->{parts} }) {
1285 if ($form->{l_subtotal} eq 'Y' && !$ref->{assemblyitem}) {
1286 if ($sameitem ne $ref->{ $form->{sort} }) {
1288 $sameitem = $ref->{ $form->{sort} };
1292 $ref->{exchangerate} = 1 unless $ref->{exchangerate};
1293 $ref->{sellprice} *= $ref->{exchangerate};
1294 $ref->{listprice} *= $ref->{exchangerate};
1295 $ref->{lastcost} *= $ref->{exchangerate};
1297 # use this for assemblies
1298 $onhand = $ref->{onhand};
1301 if ($ref->{assemblyitem}) {
1303 $onhand = 0 if ($form->{sold});
1306 $ref->{description} =~ s/
1309 $column_data{number} =
1311 . $form->format_amount(\%myconfig, $ref->{number})
1313 $column_data{partnumber} =
1314 "<td align=$align>$ref->{partnumber} </a></td>";
1315 $column_data{description} = "<td>$ref->{description} </td>";
1316 $column_data{partsgroup} = "<td>$ref->{partsgroup} </td>";
1318 $column_data{onhand} =
1320 . $form->format_amount(\%myconfig, $ref->{onhand})
1322 $column_data{sellprice} =
1324 . $form->format_amount(\%myconfig, $ref->{sellprice})
1326 $column_data{listprice} =
1328 . $form->format_amount(\%myconfig, $ref->{listprice})
1330 $column_data{lastcost} =
1332 . $form->format_amount(\%myconfig, $ref->{lastcost})
1335 $column_data{linetotalsellprice} = "<td align=right>"
1336 . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2)
1338 $column_data{linetotallastcost} = "<td align=right>"
1339 . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2)
1341 $column_data{linetotallistprice} = "<td align=right>"
1342 . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2)
1345 if (!$ref->{assemblyitem}) {
1346 $totalsellprice += $onhand * $ref->{sellprice};
1347 $totallastcost += $onhand * $ref->{lastcost};
1348 $totallistprice += $onhand * $ref->{listprice};
1350 $subtotalonhand += $onhand;
1351 $subtotalsellprice += $onhand * $ref->{sellprice};
1352 $subtotallastcost += $onhand * $ref->{lastcost};
1353 $subtotallistprice += $onhand * $ref->{listprice};
1358 . $form->format_amount(\%myconfig, $ref->{rop}) . "</td>";
1359 $column_data{weight} =
1361 . $form->format_amount(\%myconfig, $ref->{weight})
1363 $column_data{unit} = "<td>$ref->{unit} </td>";
1364 $column_data{bin} = "<td>$ref->{bin} </td>";
1365 $column_data{priceupdate} = "<td>$ref->{priceupdate} </td>";
1367 $column_data{invnumber} =
1368 ($ref->{module} ne 'oe')
1369 ? "<td><a href=$ref->{module}.pl?action=edit&type=invoice&id=$ref->{trans_id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{invnumber}</a></td>"
1370 : "<td>$ref->{invnumber}</td>";
1371 $column_data{ordnumber} =
1372 ($ref->{module} eq 'oe')
1373 ? "<td><a href=$ref->{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{ordnumber}</a></td>"
1374 : "<td>$ref->{ordnumber}</td>";
1375 $column_data{quonumber} =
1376 ($ref->{module} eq 'oe' && !$ref->{ordnumber})
1377 ? "<td><a href=$ref->{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{quonumber}</a></td>"
1378 : "<td>$ref->{quonumber}</td>";
1380 $column_data{name} = "<td>$ref->{name}</td>";
1382 $column_data{image} =
1384 ? "<td><a href=$ref->{image}><img src=$ref->{image} height=32 border=0></a></td>"
1385 : "<td> </td>";
1386 $column_data{drawing} =
1388 ? "<td><a href=$ref->{drawing}>$ref->{drawing}</a></td>"
1389 : "<td> </td>";
1390 $column_data{microfiche} =
1391 ($ref->{microfiche})
1392 ? "<td><a href=$ref->{microfiche}>$ref->{microfiche}</a></td>"
1393 : "<td> </td>";
1395 $column_data{serialnumber} = "<td>$ref->{serialnumber}</td>";
1397 $column_data{soldtotal} = "<td align=right>$ref->{soldtotal}</td>";
1401 print "<tr class=listrow$i>";
1403 map { print "\n$column_data{$_}" } @column_index;
1410 if ($form->{l_subtotal} eq 'Y') {
1414 if ($form->{"l_linetotal"}) {
1415 map { $column_data{$_} = "<td> </td>" } @column_index;
1416 $column_data{linetotalsellprice} =
1417 "<th class=listtotal align=right>"
1418 . $form->format_amount(\%myconfig, $totalsellprice, 2)
1420 $column_data{linetotallastcost} =
1421 "<th class=listtotal align=right>"
1422 . $form->format_amount(\%myconfig, $totallastcost, 2)
1424 $column_data{linetotallistprice} =
1425 "<th class=listtotal align=right>"
1426 . $form->format_amount(\%myconfig, $totallistprice, 2)
1429 print "<tr class=listtotal>";
1431 map { print "\n$column_data{$_}" } @column_index;
1438 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
1447 <form method=post action=$form->{script}>
1449 <input type=hidden name=login value=$form->{login}>
1450 <input type=hidden name=password value=$form->{password}>
1452 <input type=hidden name=itemstatus value="$form->{itemstatus}">
1453 <input type=hidden name=l_linetotal value="$form->{l_linetotal}">
1454 <input type=hidden name=l_partnumber value="$form->{l_partnumber}">
1455 <input type=hidden name=l_description value="$form->{l_description}">
1456 <input type=hidden name=l_onhand value="$form->{l_onhand}">
1457 <input type=hidden name=l_unit value="$form->{l_unit}">
1458 <input type=hidden name=l_sellprice value="$form->{l_sellprice}">
1459 <input type=hidden name=l_linetotalsellprice value="$form->{l_linetotalsellprice}">
1460 <input type=hidden name=sort value="$form->{sort}">
1461 <input type=hidden name=revers value="$form->{revers}">
1462 <input type=hidden name=lastsort value="$form->{lastsort}">
1463 <input type=hidden name=parts value="$form->{parts}">
1465 <input type=hidden name=bom value="$form->{bom}">
1466 <input type=hidden name=titel value="$form->{titel}">
1467 <input type=hidden name=searchitems value="$form->{searchitems}">|;
1472 <input type=hidden name=ndxs_counter value="$form->{ndxs_counter}">
1474 <input class=submit type=submit name=action value="|
1475 . $locale->text('choice') . qq|">
1483 $lxdebug->leave_sub();
1488 # Warning, deep magic ahead.
1489 # This function parses the requested details, sanity checks them, and converts them into a format thats usable for IC->all_parts
1491 # flags coming from the form:
1493 # searchitems=part revers=0 lastsort=''
1496 # partnumber ean description partsgroup serialnumber make model drawing microfiche
1497 # transdatefrom transdateto
1500 # itemstatus = active | onhand | short | obsolete | orphaned
1501 # action = continue | top100
1504 # bought sold onorder ordered rfq quoted
1505 # l_partnumber l_description l_serialnumber l_unit l_listprice l_sellprice l_lastcost
1506 # l_linetotal l_priceupdate l_bin l_rop l_weight l_image l_drawing l_microfiche
1507 # l_partsgroup l_subtotal l_soldtotal l_deliverydate
1510 # nextsub login password revers lastsort sort ndxs_counter
1512 sub generate_report {
1513 $lxdebug->enter_sub();
1515 my ($revers, $lastsort, $description);
1517 $form->{title} = (ucfirst $form->{searchitems}) . "s";
1518 $form->{title} = $locale->text($form->{title});
1520 my $revers = $form->{revers};
1521 my $lastsort = $form->{lastsort};
1523 # sorting and direction of sorting
1524 # ToDO: change this to the simpler field+direction method
1525 if (($form->{lastsort} eq "") && ($form->{sort} eq undef)) {
1526 $form->{revers} = 0;
1527 $form->{lastsort} = "partnumber";
1528 $form->{sort} = "partnumber";
1530 if ($form->{lastsort} eq $form->{sort}) {
1531 $form->{revers} = 1 - $form->{revers};
1533 $form->{revers} = 0;
1534 $form->{lastsort} = $form->{sort};
1538 # special case if we have a serialnumber limit search
1539 # serialnumbers are only given in invoices and orders,
1540 # so they can only pop up in bought, sold, rfq, and quoted stuff
1541 $form->{no_sn_joins} = 'Y' if ( !$form->{bought} && !$form->{sold}
1542 && !$form->{rfq} && !$form->{quoted}
1543 && ($form->{l_serialnumber} || $form->{serialnumber}));
1545 # special case for any checkbox of bought | sold | onorder | ordered | rfq | quoted.
1546 # if any of these are ticked the behavior changes slightly for lastcost
1547 # since all those are aggregation checks for the legder tables this is an internal switch
1548 # refered to as ledgerchecks
1549 $form->{ledgerchecks} = 'Y' if ( $form->{bought} || $form->{sold} || $form->{onorder}
1550 || $form->{ordered} || $form->{rfq} || $form->{quoted});
1552 # if something should be activated if something else is active, enter it here
1553 my %dependencies = (
1554 onhand => [ qw(l_onhand) ],
1555 short => [ qw(l_onhand) ],
1556 onorder => [ qw(l_ordnumber) ],
1557 ordered => [ qw(l_ordnumber) ],
1558 rfq => [ qw(l_quonumber) ],
1559 quoted => [ qw(l_quonumber) ],
1560 bought => [ qw(l_invnumber) ],
1561 sold => [ qw(l_invnumber) ],
1562 ledgerchecks => [ qw(l_name) ],
1563 serialnumber => [ qw(l_serialnumber) ],
1564 no_sn_joins => [ qw(bought sold) ],
1567 # these strings get displayed at the top of the results to indicate the user which switches were used
1569 active => $locale->text('Active'),
1570 obsolete => $locale->text('Obsolete'),
1571 orphaned => $locale->text('Orphaned'),
1572 onhand => $locale->text('On Hand'),
1573 short => $locale->text('Short'),
1574 onorder => $locale->text('On Order'),
1575 ordered => $locale->text('Ordered'),
1576 rfq => $locale->text('RFQ'),
1577 quoted => $locale->text('Quoted'),
1578 bought => $locale->text('Bought'),
1579 sold => $locale->text('Sold'),
1580 transdatefrom => $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1),
1581 transdateto => $locale->text('To (time)') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1),
1582 partnumber => $locale->text('Part Number') . ": '$form->{partnumber}'",
1583 partsgroup => $locale->text('Group') . ": '$form->{partsgroup}'",
1584 serialnumber => $locale->text('Serial Number') . ": '$form->{serialnumber}'",
1585 description => $locale->text('Part Description') . ": '$form->{description}'",
1586 make => $locale->text('Make') . ": '$form->{make}'",
1587 model => $locale->text('Model') . ": '$form->{model}'",
1588 drawing => $locale->text('Drawing') . ": '$form->{drawing}'",
1589 microfiche => $locale->text('Microfiche') . ": '$form->{microfiche}'",
1590 l_soldtotal => $locale->text('soldtotal'),
1593 my @itemstatus_keys = qw(active obsolete orphaned onhand short);
1594 my @callback_keys = qw(onorder ordered rfq quoted bought sold partnumber partsgroup serialnumber description make model
1595 drawing microfiche l_soldtotal l_deliverydate transdatefrom transdateto ean);
1597 # calculate dependencies
1598 for (@itemstatus_keys, @callback_keys) {
1599 next if ($form->{itemstatus} ne $_ && !$form->{$_});
1600 map { $form->{$_} = 'Y' } @{ $dependencies{$_} } if $dependencies{$_};
1603 # generate callback and optionstrings
1605 for my $key (@itemstatus_keys, @callback_keys) {
1606 next if ($form->{itemstatus} ne $key && !$form->{$key});
1607 push @options, $optiontexts{$key};
1610 IC->all_parts(\%myconfig, \%$form);
1612 # special case for lastcost
1613 $form->{l_lastcost} = "" if $form->{ledgerchecks};
1615 if ($form->{description}) {
1616 $description = $form->{description};
1617 $description =~ s/\n/<br>/g;
1620 if ($form->{l_linetotal}) {
1621 $form->{l_onhand} = "Y";
1622 $form->{l_linetotalsellprice} = "Y" if $form->{l_sellprice};
1623 if ($form->{l_lastcost}) {
1624 $form->{l_linetotallastcost} = "Y";
1625 if (($form->{searchitems} eq 'assembly') && !$form->{bom}) {
1626 $form->{l_linetotallastcost} = "";
1629 $form->{l_linetotallistprice} = "Y" if $form->{l_listprice};
1632 if ($form->{searchitems} eq 'service') {
1634 # remove bin, weight and rop from list
1635 map { $form->{"l_$_"} = "" } qw(bin weight rop);
1637 $form->{l_onhand} = "";
1639 # qty is irrelevant unless bought or sold
1640 if ( $form->{bought}
1645 || $form->{quoted}) {
1646 $form->{l_onhand} = "Y";
1648 $form->{l_linetotalsellprice} = "";
1649 $form->{l_linetotallastcost} = "";
1653 $form->{l_lastcost} = "" if ($form->{searchitems} eq 'assembly' && !$form->{bom});
1656 qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost
1657 priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal deliverydate);
1660 'bin' => { 'text' => $locale->text('Bin'), },
1661 'deliverydate' => { 'text' => $locale->text('deliverydate'), },
1662 'description' => { 'text' => $locale->text('Part Description'), },
1663 'drawing' => { 'text' => $locale->text('Drawing'), },
1664 'image' => { 'text' => $locale->text('Image'), },
1665 'invnumber' => { 'text' => $locale->text('Invoice Number'), },
1666 'lastcost' => { 'text' => $locale->text('Last Cost'), },
1667 'linetotallastcost' => { 'text' => $locale->text('Extended'), },
1668 'linetotallistprice' => { 'text' => $locale->text('Extended'), },
1669 'linetotalsellprice' => { 'text' => $locale->text('Extended'), },
1670 'listprice' => { 'text' => $locale->text('List Price'), },
1671 'microfiche' => { 'text' => $locale->text('Microfiche'), },
1672 'name' => { 'text' => $locale->text('Name'), },
1673 'onhand' => { 'text' => $locale->text('Qty'), },
1674 'ordnumber' => { 'text' => $locale->text('Order Number'), },
1675 'partnumber' => { 'text' => $locale->text('Part Number'), },
1676 'partsgroup' => { 'text' => $locale->text('Group'), },
1677 'priceupdate' => { 'text' => $locale->text('Updated'), },
1678 'quonumber' => { 'text' => $locale->text('Quotation'), },
1679 'rop' => { 'text' => $locale->text('ROP'), },
1680 'sellprice' => { 'text' => $locale->text('Sell Price'), },
1681 'serialnumber' => { 'text' => $locale->text('Serial Number'), },
1682 'soldtotal' => { 'text' => $locale->text('soldtotal'), },
1683 'unit' => { 'text' => $locale->text('Unit'), },
1684 'weight' => { 'text' => $locale->text('Weight'), },
1687 map { $column_defs{$_}->{visible} = $form->{"l_$_"} ? 1 : 0 } @columns;
1688 map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal);
1690 my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom), @itemstatus_keys, @callback_keys, map { "l_$_" } @columns);
1691 my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
1693 my @sort_full = qw(partnumber description onhand soldtotal deliverydate);
1694 my @sort_no_revers = qw(partsgroup bin priceupdate invnumber ordnumber quonumber name image drawing serialnumber);
1696 foreach my $col (@sort_full) {
1697 $column_defs{$col}->{link} = join '&', $callback, "sort=$col", map { "$_=" . E($form->{$_}) } qw(revers lastsort);
1699 map { $column_defs{$_}->{link} = "${callback}&sort=$_" } @sort_no_revers;
1701 # add order to callback
1702 $form->{callback} = join '&', ($callback, map { "${_}=" . E($form->{$_}) } qw(sort revers));
1704 my $report = SL::ReportGenerator->new(\%myconfig, $form);
1706 my %attachment_basenames = (
1707 'part' => $locale->text('part_list'),
1708 'service' => $locale->text('service_list'),
1709 'assembly' => $locale->text('assembly_list'),
1712 $report->set_options('top_info_text' => $locale->text('Options') . ': ' . join(', ', grep $_, @options),
1713 'raw_bottom_info_text' => $form->parse_html_template2('ic/generate_report_bottom'),
1714 'output_format' => 'HTML',
1715 'title' => $form->{title},
1716 'attachment_basename' => $attachment_basenames{$form->{searchitems}} . strftime('_%Y%m%d', localtime time),
1718 $report->set_options_from_form();
1720 $report->set_columns(%column_defs);
1721 $report->set_column_order(@columns);
1723 $report->set_export_options('generate_report', @hidden_variables, qw(sort revers));
1725 $report->set_sort_indicator($form->{sort}, $form->{revers} ? 0 : 1);
1727 my @subtotal_columns = qw(sellprice listprice lastcost);
1728 my %subtotals = map { $_ => 0 } ('onhand', @subtotal_columns);
1729 my %totals = map { $_ => 0 } @subtotal_columns;
1731 my $same_item = $form->{parts}[0]{ $form->{sort} } if (scalar @{ $form->{parts} });
1734 foreach my $ref (@{ $form->{parts} }) {
1736 # fresh row, for inserting later
1737 my $row = { map { $_ => { 'data' => $ref->{$_} } } @columns };
1739 $ref->{exchangerate} = 1 unless $ref->{exchangerate};
1740 $ref->{sellprice} *= $ref->{exchangerate};
1741 $ref->{listprice} *= $ref->{exchangerate};
1742 $ref->{lastcost} *= $ref->{exchangerate};
1744 # use this for assemblies
1745 my $onhand = $ref->{onhand};
1747 if ($ref->{assemblyitem}) {
1748 $row->{partnumber}{align} = 'right';
1749 $row->{onhand}{data} = 0;
1750 $onhand = 0 if ($form->{sold});
1753 my $edit_link = build_std_url('action=edit', 'id=' . E($ref->{id}), 'callback');
1754 $row->{partnumber}->{link} = $edit_link;
1755 $row->{description}->{link} = $edit_link;
1757 foreach (qw(sellprice listprice lastcost)) {
1758 $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}, -2);
1759 $row->{"linetotal$_"}{data} = $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{$_}, 2);
1762 map { $row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}); } qw(onhand rop weight soldtotal);
1764 if (!$ref->{assemblyitem}) {
1765 foreach my $col (@subtotal_columns) {
1766 $totals{$col} += $onhand * $ref->{$col};
1767 $subtotals{$col} += $onhand * $ref->{$col};
1770 $subtotals{onhand} += $onhand;
1774 if ($ref->{module} eq 'oe') {
1775 my $edit_oe_link = build_std_url("script=oe.pl", 'action=edit', 'type=' . E($ref->{type}), 'id=' . E($ref->{trans_id}), 'callback');
1776 $row->{ordnumber}{link} = $edit_oe_link;
1777 $row->{quonumber}{link} = $edit_oe_link if (!$ref->{ordnumber});
1780 $row->{invnumber}{link} = build_std_url("script=$ref->{module}.pl", 'action=edit', 'type=invoice', 'id=' . E($ref->{trans_id}), 'callback');
1783 # set properties of images
1784 if ($ref->{image} && (lc $report->{options}->{output_format} eq 'html')) {
1785 $row->{image}{data} = '';
1786 $row->{image}{raw_data} = '<a href="' . H($ref->{image}) . '"><img src="' . H($ref->{image}) . '" height="32" border="0"></a>';
1788 map { $row->{$_}{link} = $ref->{$_} } qw(drawing microfiche);
1790 $report->add_data($row);
1792 my $next_ref = $form->{parts}[$idx + 1];
1794 # insert subtotal rows
1795 if (($form->{l_subtotal} eq 'Y') &&
1797 (!$next_ref->{assemblyitem} && ($same_item ne $next_ref->{ $form->{sort} })))) {
1798 my $row = { map { $_ => { 'class' => 'listsubtotal', } } @columns };
1800 if (($form->{searchitems} ne 'assembly') || !$form->{bom}) {
1801 $row->{onhand}->{data} = $form->format_amount(\%myconfig, $subtotals{onhand});
1804 map { $row->{"linetotal$_"}->{data} = $form->format_amount(\%myconfig, $subtotals{$_}, 2) } @subtotal_columns;
1805 map { $subtotals{$_} = 0 } ('onhand', @subtotal_columns);
1807 $report->add_data($row);
1809 $same_item = $next_ref->{ $form->{sort} };
1815 if ($form->{"l_linetotal"}) {
1816 my $row = { map { $_ => { 'class' => 'listtotal', } } @columns };
1818 map { $row->{"linetotal$_"}->{data} = $form->format_amount(\%myconfig, $totals{$_}, 2) } @subtotal_columns;
1820 $report->add_separator();
1821 $report->add_data($row);
1824 $report->generate_with_headers();
1826 $lxdebug->leave_sub();
1827 } #end generate_report
1829 sub parts_subtotal {
1830 $lxdebug->enter_sub();
1833 our (%column_data, @column_index);
1834 our ($subtotalonhand, $totalsellprice, $totallastcost, $totallistprice, $subtotalsellprice, $subtotallastcost, $subtotallistprice);
1836 map { $column_data{$_} = "<td> </td>" } @column_index;
1837 $subtotalonhand = 0 if ($form->{searchitems} eq 'assembly' && $form->{bom});
1839 $column_data{onhand} =
1840 "<th class=listsubtotal align=right>"
1841 . $form->format_amount(\%myconfig, $subtotalonhand)
1844 $column_data{linetotalsellprice} =
1845 "<th class=listsubtotal align=right>"
1846 . $form->format_amount(\%myconfig, $subtotalsellprice, 2)
1848 $column_data{linetotallistprice} =
1849 "<th class=listsubtotal align=right>"
1850 . $form->format_amount(\%myconfig, $subtotallistprice, 2)
1852 $column_data{linetotallastcost} =
1853 "<th class=listsubtotal align=right>"
1854 . $form->format_amount(\%myconfig, $subtotallastcost, 2)
1857 $subtotalonhand = 0;
1858 $subtotalsellprice = 0;
1859 $subtotallistprice = 0;
1860 $subtotallastcost = 0;
1862 print "<tr class=listsubtotal>";
1864 map { print "\n$column_data{$_}" } @column_index;
1870 $lxdebug->leave_sub();
1874 $lxdebug->enter_sub();
1875 # show history button
1876 $form->{javascript} = qq|<script type="text/javascript" src="js/show_history.js"></script>|;
1877 #/show hhistory button
1878 IC->get_part(\%myconfig, \%$form);
1880 $form->{"original_partnumber"} = $form->{"partnumber"};
1882 $form->{title} = $locale->text('Edit ' . ucfirst $form->{item});
1887 $lxdebug->leave_sub();
1891 $lxdebug->enter_sub();
1893 IC->create_links("IC", \%myconfig, \%$form);
1896 map({ $form->{selectcurrency} .= "<option>$_\n" }
1897 split(/:/, $form->{currencies}));
1899 # parts and assemblies have the same links
1900 my $item = $form->{item};
1901 if ($form->{item} eq 'assembly') {
1905 # build the popup menus
1906 $form->{taxaccounts} = "";
1907 foreach my $key (keys %{ $form->{IC_links} }) {
1908 foreach my $ref (@{ $form->{IC_links}{$key} }) {
1910 # if this is a tax field
1911 if ($key =~ /IC_tax/) {
1912 if ($key =~ /$item/) {
1913 $form->{taxaccounts} .= "$ref->{accno} ";
1914 $form->{"IC_tax_$ref->{accno}_description"} =
1915 "$ref->{accno}--$ref->{description}";
1918 if ($form->{amount}{ $ref->{accno} }) {
1919 $form->{"IC_tax_$ref->{accno}"} = "checked";
1922 $form->{"IC_tax_$ref->{accno}"} = "checked";
1927 $form->{"select$key"} .=
1928 "<option $ref->{selected}>$ref->{accno}--$ref->{description}\n";
1929 if ($form->{amount}{$key} eq $ref->{accno}) {
1930 $form->{$key} = "$ref->{accno}--$ref->{description}";
1936 chop $form->{taxaccounts};
1938 if (($form->{item} eq "part") || ($form->{item} eq "assembly")) {
1939 $form->{selectIC_income} = $form->{selectIC_sale};
1940 $form->{selectIC_expense} = $form->{selectIC_cogs};
1941 $form->{IC_income} = $form->{IC_sale};
1942 $form->{IC_expense} = $form->{IC_cogs};
1945 delete $form->{IC_links};
1946 delete $form->{amount};
1948 $form->get_partsgroup(\%myconfig, { all => 1 });
1950 $form->{partsgroup} = "$form->{partsgroup}--$form->{partsgroup_id}";
1952 if (@{ $form->{all_partsgroup} }) {
1953 $form->{selectpartsgroup} = qq|<option>\n|;
1955 $form->{selectpartsgroup} .=
1956 qq|<option value="$_->{partsgroup}--$_->{id}">$_->{partsgroup}\n|
1957 } @{ $form->{all_partsgroup} };
1960 if ($form->{item} eq 'assembly') {
1962 foreach my $i (1 .. $form->{assembly_rows}) {
1963 if ($form->{"partsgroup_id_$i"}) {
1964 $form->{"partsgroup_$i"} =
1965 qq|$form->{"partsgroup_$i"}--$form->{"partsgroup_id_$i"}|;
1968 $form->get_partsgroup(\%myconfig);
1970 if (@{ $form->{all_partsgroup} }) {
1971 $form->{selectassemblypartsgroup} = qq|<option>\n|;
1974 $form->{selectassemblypartsgroup} .=
1975 qq|<option value="$_->{partsgroup}--$_->{id}">$_->{partsgroup}\n|
1976 } @{ $form->{all_partsgroup} };
1979 $lxdebug->leave_sub();
1983 $lxdebug->enter_sub();
1985 my ($payment, $rows, $notes, $description, $ean, $buchungsgruppe, $partsgroup, $group, $tax, $lastcost, $eur, $linkaccounts, $weight, $n, $rop, $bin, $vegv);
1986 my ($notdiscountableok, $notdiscountable);
1987 my ($formula, $formula_label, $imagelinks, $obsolete, $shopok, $shop);
1990 map({ $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, -2) }
1991 qw(sellprice listprice lastcost gv));
1993 map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}) }
1994 qw(weight rop stock);
1996 foreach my $item (qw(partnumber description unit notes)) {
1997 $form->{$item} =~ s/\"/"/g;
2000 $payment = qq|<option value=""></option>|;
2001 foreach my $item (@{ $form->{payment_terms} }) {
2002 if ($form->{payment_id} eq $item->{id}) {
2003 $payment .= qq|<option value="$item->{id}" selected>$item->{description}</option>|;
2005 $payment .= qq|<option value="$item->{id}">$item->{description}</option>|;
2010 if (($rows = $form->numtextrows($form->{notes}, 40)) < 2) {
2015 qq|<textarea name=notes rows=$rows cols=45 wrap=soft>$form->{notes}</textarea>|;
2016 if (($rows = $form->numtextrows($form->{description}, 40)) > 1) {
2018 qq|<textarea name="description" rows=$rows cols=40 wrap=soft>$form->{description}</textarea>|;
2021 qq|<input name=description size=40 value="$form->{description}">|;
2024 $ean = qq|<input name=ean size=40 value="$form->{ean}">|;
2026 foreach my $item (split / /, $form->{taxaccounts}) {
2027 $form->{"IC_tax_$item"} = ($form->{"IC_tax_$item"}) ? "checked" : "";
2030 IC->retrieve_buchungsgruppen(\%myconfig, $form);
2031 if (@{ $form->{BUCHUNGSGRUPPEN} }) {
2032 foreach my $item (@{ $form->{BUCHUNGSGRUPPEN} }) {
2033 if ($item->{id} == $form->{buchungsgruppen_id}) {
2034 $form->{selectbuchungsgruppe} .=
2035 "<option value=$item->{id} selected>$item->{description}\n";
2036 } elsif (($form->{id} && $form->{orphaned}) || (!$form->{id})) {
2037 $form->{selectbuchungsgruppe} .=
2038 "<option value=$item->{id}>$item->{description}\n";
2044 $buchungsgruppe = qq|
2046 <th align=right>| . $locale->text('Buchungsgruppe') . qq|</th>
2047 <td><select name=buchungsgruppen_id>$form->{selectbuchungsgruppe}</select></td>
2052 foreach my $item (qw(IC IC_income IC_expense)) {
2053 if ($form->{$item}) {
2054 if ($form->{id} && $form->{orphaned}) {
2055 $form->{"select$item"} =~ s/ selected//;
2056 $form->{"select$item"} =~
2057 s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
2059 $form->{"select$item"} = qq|<option selected>$form->{$item}|;
2064 if ($form->{selectpartsgroup}) {
2065 $form->{selectpartsgroup} = $form->unescape($form->{selectpartsgroup});
2067 qq|<input type=hidden name=selectpartsgroup value="|
2068 . $form->escape($form->{selectpartsgroup}, 1) . qq|">|;
2069 $form->{selectpartsgroup} =~
2070 s/(<option value="\Q$form->{partsgroup}\E")/$1 selected/;
2073 qq|<select name=partsgroup>$form->{selectpartsgroup}</select>|;
2074 $group = $locale->text('Group');
2078 foreach my $item (split / /, $form->{taxaccounts}) {
2080 <input class=checkbox type=checkbox name="IC_tax_$item" value=1 $form->{"IC_tax_$item"}> <b>$form->{"IC_tax_${item}_description"}</b>
2081 <br><input type=hidden name=IC_tax_${item}_description value="$form->{"IC_tax_${item}_description"}">
2085 $form->{obsolete} = "checked" if $form->{obsolete};
2089 <th align="right" nowrap="true">|
2090 . $locale->text('Last Cost') . qq|</th>
2091 <td><input name=lastcost size=11 value=$form->{lastcost}></td>
2097 <th align=right>| . $locale->text('Inventory') . qq|</th>
2098 <td><select name=IC>$form->{selectIC}</select></td>
2099 <input name=selectIC type=hidden value="$form->{selectIC}">
2103 if ($form->{item} eq "part") {
2105 $linkaccounts .= qq|
2107 <th align=right>| . $locale->text('Revenue') . qq|</th>
2108 <td><select name=IC_income>$form->{selectIC_income}</select></td>
2109 <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
2112 <th align=right>| . $locale->text('Expense') . qq|</th>
2113 <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
2114 <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
2120 <th align="right" nowrap="true">| . $locale->text('Weight') . qq|</th>
2125 <input name=weight size=10 value=$form->{weight}>
2135 if ($form->{item} eq "assembly") {
2141 <th align=right>| . $locale->text('Revenue') . qq|</th>
2142 <td><select name=IC_income>$form->{selectIC_income}</select></td>
2143 <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
2149 <th align="right" nowrap="true">| . $locale->text('Weight') . qq|</th>
2154 $form->{weight}
2155 <input type=hidden name=weight value=$form->{weight}>
2165 if ($form->{item} eq "service") {
2169 <th align=right>| . $locale->text('Revenue') . qq|</th>
2170 <td><select name=IC_income>$form->{selectIC_income}</select></td>
2171 <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
2174 <th align=right>| . $locale->text('Expense') . qq|</th>
2175 <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
2176 <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
2181 $linkaccounts = qq|<input type=hidden name=IC_income value="$form->{IC_income_default}">|;
2183 if ($form->{IC_cogs_default}) {
2184 $form->{IC_expense_default} = $form->{IC_cogs_default};
2187 if (($form->{item} eq "service") || ($form->{item} eq "part")) {
2188 $linkaccounts .= qq|<input type=hidden name=IC_expense value="$form->{IC_expense_default}">|;
2190 if ($form->{item} eq "part") {
2191 $linkaccounts .= qq|<input type=hidden name=IC value="$form->{IC_default}">|;
2194 if ($form->{item} ne 'service') {
2195 $n = ($form->{onhand} > 0) ? "1" : "0";
2198 <th align="right" nowrap>| . $locale->text('On Hand') . qq|</th>
2199 <th align=left nowrap class="plus$n"> |
2200 . $form->format_amount(\%myconfig, $form->{onhand}) . qq|</th>
2204 if ($form->{item} eq 'assembly') {
2207 <th align="right" nowrap>| . $locale->text('Stock') . qq|</th>
2208 <td><input name=stock size=10 value=$form->{stock}></td>
2215 <th align="right" nowrap="true">| . $locale->text('ROP') . qq|</th>
2216 <td><input name=rop size=10 value=$form->{rop}></td>
2222 <th align="right" nowrap="true">| . $locale->text('Bin') . qq|</th>
2223 <td><input name=bin size=10 value=$form->{bin}></td>
2228 <th align="right" nowrap="true">|
2229 . $locale->text('Verrechnungseinheit') . qq|</th>
2230 <td><input name=ve size=10 value=$form->{ve}></td>
2233 <th align="right" nowrap="true">|
2234 . $locale->text('Business Volume') . qq|</th>
2235 <td><input name=gv size=10 value=$form->{gv}></td>
2238 $notdiscountableok = ($form->{not_discountable}) == 1 ? "checked" : "";
2239 $notdiscountable .= qq|
2241 <th align=right nowrap>|
2242 . $locale->text('Not Discountable') . qq|</th>
2243 <td><input class=checkbox type=checkbox name=not_discountable value=1 $notdiscountableok></td>
2248 qq|<ilayer><layer onmouseover="this.T_STICKY=true;this.T_STATIC=true;return escape('| . $locale->text('The formula needs the following syntax:<br>For regular article:<br>Variablename= Variable Unit;<br>Variablename2= Variable2 Unit2;<br>...<br>###<br>Variable + ( Variable2 / Variable )<br><b>Please be beware of the spaces in the formula</b><br>') . qq|')"><textarea name=formel rows=4 cols=30 wrap=soft>$form->{formel}</textarea></layer><ilayer>|;
2250 $formula_label = $locale->text('Formula');
2257 <th align=right nowrap>| . $locale->text('Image') . qq|</th>
2258 <td><input name=image size=40 value="$form->{image}"></td>
2259 <th align=right nowrap>| . $locale->text('Microfiche') . qq|</th>
2260 <td><input name=microfiche size=20 value="$form->{microfiche}"></td>
2263 <th align=right nowrap>| . $locale->text('Drawing') . qq|</th>
2264 <td><input name=drawing size=40 value="$form->{drawing}"></td>
2276 <th align="right" nowrap="true">| . $locale->text('Obsolete') . qq|</th>
2277 <td><input name=obsolete type=checkbox class=checkbox value=1 $form->{obsolete}></td>
2281 $shopok = $form->{shop} == 1 ? "checked" : "";
2284 <th align=right nowrap>|
2285 . $locale->text('Shopartikel') . qq|</th>
2286 <td><input class=checkbox type=checkbox name=shop value=1 $shopok></td>
2291 # type=submit $locale->text('Add Part')
2292 # type=submit $locale->text('Add Service')
2293 # type=submit $locale->text('Add Assembly')
2295 # type=submit $locale->text('Edit Part')
2296 # type=submit $locale->text('Edit Service')
2297 # type=submit $locale->text('Edit Assembly')
2298 # use JavaScript Calendar or not
2299 my ($jsscript, $button1);
2300 $form->{jsscript} = 1;
2302 if ($form->{jsscript}) {
2304 # with JavaScript Calendar
2306 <td width="13"><input name=priceupdate id=priceupdate size=11 title="$myconfig{dateformat}" value="$form->{priceupdate}"></td>
2307 <td width="4" align="left"><input type=button name=priceupdate id="trigger1" value=|
2308 . $locale->text('button') . qq|></td>
2313 Form->write_trigger(\%myconfig, "1", "priceupdate", "BL", "trigger1");
2316 # without JavaScript Calendar
2318 <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>|;
2321 my $unit_select = '<input type="hidden" name="unit_changeable" value="' . $form->{"unit_changeable"} . '">';
2322 if (!$form->{"unit_changeable"}) {
2323 $unit_select .= '<input type="hidden" name="unit" value="' . $form->{"unit"} . '">' . $form->{"unit"};
2325 my $units = AM->retrieve_units(\%myconfig, $form, $form->{"item"} eq "service" ? "service" : "dimension");
2326 $unit_select .= AM->unit_select_html($units, "unit", $form->{"unit"});
2329 $form->{fokus} = "ic.partnumber";
2333 <body onLoad="fokus()">
2334 <script type="text/javascript" src="js/common.js"></script>
2335 <script type="text/javascript" src="js/parts_language_selection.js"></script>
2337 <form method=post name="ic" action=$form->{script}>
2339 <input name=id type=hidden value=$form->{id}>
2340 <input name=item type=hidden value=$form->{item}>
2341 <input name=title type=hidden value="$form->{title}">
2342 <input name=makemodel type=hidden value="$form->{makemodel}">
2343 <input name=alternate type=hidden value="$form->{alternate}">
2344 <input name=onhand type=hidden value=$form->{onhand}>
2345 <input name=orphaned type=hidden value=$form->{orphaned}>
2346 <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
2347 <input name=rowcount type=hidden value=$form->{rowcount}>
2348 <input name=eur type=hidden value=$eur>
2349 <input name=language_values type=hidden value="$form->{language_values}">
2350 <input name="original_partnumber" type="hidden" value="| . $form->quote($form->{"original_partnumber"}) . qq|">
2352 <table width="100%">
2354 <th class=listtop>$form->{title}</th>
2356 <tr height="5"></tr>
2359 <table width="100%">
2361 <th align=left>| . $locale->text('Part Number') . qq|</th>
2362 <th align=left>| . $locale->text('Part Description') . qq|</th>
2363 <th align=left>$group</th>
2366 <td><input name=partnumber value="$form->{partnumber}" size=20></td>
2367 <td>$description</td>
2368 <td>$partsgroup</td>
2369 <input type=hidden name=oldpartsgroup value="$form->{oldpartsgroup}">
2376 <table width="100%" height="100%">
2379 <table width="100%" height="100%">
2380 <tr class="listheading">
2381 <th class="listheading" align="center" colspan=2>|
2382 . $locale->text('') . qq|</th>
2391 <th align="left">| . $locale->text('Notes') . qq|</th>
2392 <th align="left">$formula_label</th>
2403 <th align="left"></th>
2404 <th align="left">| . $locale->text('EAN-Code') . qq|</th>
2408 <button type="button" onclick="parts_language_selection_window('language_values')">| . $locale->text('Set Language Values') . qq|</button>
2418 <th align=right>| . $locale->text('Payment Terms') . qq|</th>
2419 <td><select name=payment_id>$payment</select></td>
2427 <table width="100%">
2429 <th align="right" nowrap="true">|
2430 . $locale->text('Updated') . qq|</th>
2434 <th align="right" nowrap="true">| . $locale->text('List Price') . qq|</th>
2435 <td><input name=listprice size=11 value=$form->{listprice}></td>
2438 <th align="right" nowrap="true">| . $locale->text('Sell Price') . qq|</th>
2439 <td><input name=sellprice size=11 value=$form->{sellprice}></td>
2443 <th align="right" nowrap="true">| . $locale->text('Unit') . qq|</th>
2444 <td>$unit_select</td>
2463 $lxdebug->leave_sub();
2467 $lxdebug->enter_sub();
2469 if ($form->{item} eq "assembly") {
2474 <table width="100%">
2476 <th colspan=2 align=right>|
2477 . $locale->text('Total') . qq| </th>
2479 . $form->format_amount(\%myconfig, $form->{assemblytotal}, 2) . qq|</th>
2484 <input type=hidden name=assembly_rows value=$form->{assembly_rows}>
2489 <input type=hidden name=login value=$form->{login}>
2490 <input type=hidden name=password value=$form->{password}>
2491 <input type=hidden name=callback value="$form->{callback}">
2492 <input type=hidden name=previousform value="$form->{previousform}">
2493 <input type=hidden name=taxaccount2 value="$form->{taxaccount2}">
2494 <input type=hidden name=vc value=$form->{vc}>
2496 <td><hr size=3 noshade></td>
2501 <input class=submit type=submit name=action value="|
2502 . $locale->text('Update') . qq|">
2505 unless ($form->{item} eq "service") {
2507 <input type=hidden name=makemodel_rows value=$form->{makemodel_rows}>
2512 <input type=hidden name=price_rows value=$form->{price_rows}>|;
2515 <input class=submit type=submit name=action value="|
2516 . $locale->text('Save') . qq|">|;
2520 if (!$form->{previousform}) {
2522 <input class=submit type=submit name=action value="|
2523 . $locale->text('Save as new') . qq|">|;
2526 if ($form->{orphaned}) {
2527 if (!$form->{previousform}) {
2528 if ($form->{item} eq 'assembly') {
2529 if (!$form->{onhand}) {
2531 <input class=submit type=submit name=action value="|
2532 . $locale->text('Delete') . qq|">|;
2536 <input class=submit type=submit name=action value="|
2537 . $locale->text('Delete') . qq|">|;
2543 if (!$form->{previousform}) {
2544 if ($form->{menubar}) {
2545 require "bin/mozilla/menu.pl";
2549 # button for saving history
2550 if($form->{id} ne "") {
2552 <input type=button class=submit onclick=set_history_window(|
2554 . qq|); name=history id=history value=|
2555 . $locale->text('history')
2558 # /button for saving history
2563 <script type="text/javascript" src="js/wz_tooltip.js"></script>
2569 $lxdebug->leave_sub();
2573 $lxdebug->enter_sub();
2581 <th class="listheading">| . $locale->text('Make') . qq|</th>
2582 <th class="listheading">| . $locale->text('Model') . qq|</th>
2586 for my $i (1 .. $numrows) {
2587 $form->{"make_$i"} =~ s/\"/"/g;
2588 $form->{"model_$i"} =~ s/\"/"/g;
2591 <td width=50%><input name="make_$i" size=30 value="$form->{"make_$i"}"></td>
2592 <td width=50%><input name="model_$i" size=30 value="$form->{"model_$i"}"></td>
2603 $lxdebug->leave_sub();
2607 $lxdebug->enter_sub();
2609 my (@column_index, %column_data, %column_header);
2610 my ($nochange, $callback, $previousform, $linetotal, $href);
2612 our ($deliverydate); # ToDO: cjeck if this indeed comes from global context
2615 qw(runningnumber qty unit bom partnumber description partsgroup total);
2617 if ($form->{previousform}) {
2619 @column_index = qw(qty unit bom partnumber description partsgroup total);
2623 $form->{old_callback} = $form->{callback};
2624 $callback = $form->{callback};
2625 $form->{callback} = "$form->{script}?action=display_form";
2628 map { delete $form->{$_} } qw(action header);
2632 # save form variables in a previousform variable
2633 foreach my $key (sort keys %$form) {
2636 $form->{$key} =~ s/&/%26/g;
2637 $previousform .= qq|$key=$form->{$key}&|;
2640 $previousform = $form->escape($form->escape($previousform, 1));
2641 $form->{callback} = $callback;
2643 $form->{assemblytotal} = 0;
2644 $form->{weight} = 0;
2647 $column_header{runningnumber} =
2648 qq|<th nowrap width=5%>| . $locale->text('No.') . qq|</th>|;
2649 $column_header{qty} =
2650 qq|<th align=left nowrap width=10%>| . $locale->text('Qty') . qq|</th>|;
2651 $column_header{unit} =
2652 qq|<th align=left nowrap width=5%>| . $locale->text('Unit') . qq|</th>|;
2653 $column_header{partnumber} =
2654 qq|<th align=left nowrap width=20%>|
2655 . $locale->text('Part Number')
2657 $column_header{description} =
2658 qq|<th nowrap width=50%>| . $locale->text('Part Description') . qq|</th>|;
2659 $column_header{total} =
2660 qq|<th align=right nowrap>| . $locale->text('Extended') . qq|</th>|;
2661 $column_header{bom} = qq|<th>| . $locale->text('BOM') . qq|</th>|;
2662 $column_header{partsgroup} = qq|<th>| . $locale->text('Group') . qq|</th>|;
2665 <tr class=listheading>
2666 <th class=listheading>| . $locale->text('Individual Items') . qq|</th>
2674 map { print "\n$column_header{$_}" } @column_index;
2680 for my $i (1 .. $numrows) {
2681 $form->{"partnumber_$i"} =~ s/\"/"/g;
2684 $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2);
2685 $form->{assemblytotal} += $linetotal;
2687 $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
2689 $linetotal = $form->format_amount(\%myconfig, $linetotal, 2);
2691 if (($i >= 1) && ($i == $numrows)) {
2694 map { $column_data{$_} = qq|<td></td>| }
2695 qw(qty unit partnumber description bom partsgroup);
2698 map { $column_data{$_} = qq|<td></td>| } qw(runningnumber unit bom);
2701 qq|<td><input name="qty_$i" size=5 value="$form->{"qty_$i"}"></td>|;
2702 $column_data{partnumber} =
2703 qq|<td><input name="partnumber_$i" size=15 value="$form->{"partnumber_$i"}"></td>|;
2704 $column_data{description} =
2705 qq|<td><input name="description_$i" size=40 value="$form->{"description_$i"}"></td>|;
2706 $column_data{partsgroup} =
2707 qq|<td><input name="partsgroup_$i" size=10 value="$form->{"partsgroup_$i"}"></td>|;
2713 if ($form->{previousform}) {
2714 $column_data{partnumber} =
2715 qq|<td><input type=hidden name="partnumber_$i" value="$form->{"partnumber_$i"}">$form->{"partnumber_$i"}</td>|;
2717 qq|<td align=right><input type=hidden name="qty_$i" value="$form->{"qty_$i"}">$form->{"qty_$i"}</td>|;
2720 qq|<td align=center><input type=hidden name="bom_$i" value=$form->{"bom_$i"}>|;
2721 $column_data{bom} .= ($form->{"bom_$i"}) ? "x" : " ";
2722 $column_data{bom} .= qq|</td>|;
2724 $column_data{partsgroup} =
2725 qq|<td><input type=hidden name="partsgroup_$i" value="$form->{"partsgroup_$i"}">$form->{"partsgroup_$i"}</td>|;
2729 qq|$form->{script}?action=edit&id=$form->{"id_$i"}&login=$form->{login}&password=$form->{password}&rowcount=$i&previousform=$previousform|;
2730 $column_data{partnumber} =
2731 qq|<td><input type=hidden name="partnumber_$i" value="$form->{"partnumber_$i"}"><a href=$href>$form->{"partnumber_$i"}</a></td>|;
2732 $column_data{runningnumber} =
2733 qq|<td><input name="runningnumber_$i" size=3 value="$i"></td>|;
2735 qq|<td><input name="qty_$i" size=5 value="$form->{"qty_$i"}"></td>|;
2737 $form->{"bom_$i"} = ($form->{"bom_$i"}) ? "checked" : "";
2739 qq|<td align=center><input name="bom_$i" type=checkbox class=checkbox value=1 $form->{"bom_$i"}></td>|;
2741 $column_data{partsgroup} =
2742 qq|<td><input type=hidden name="partsgroup_$i" value="$form->{"partsgroup_$i"}">$form->{"partsgroup_$i"}</td>|;
2745 $column_data{unit} =
2746 qq|<td><input type=hidden name="unit_$i" value="$form->{"unit_$i"}">$form->{"unit_$i"}</td>|;
2747 $column_data{description} =
2748 qq|<td><input type=hidden name="description_$i" value="$form->{"description_$i"}">$form->{"description_$i"}</td>|;
2751 $column_data{total} = qq|<td align=right>$linetotal</td>|;
2753 $column_data{deliverydate} = qq|<td align=right>$deliverydate</td>|;
2758 map { print "\n$column_data{$_}" } @column_index;
2762 <input type=hidden name="id_$i" value=$form->{"id_$i"}>
2763 <input type=hidden name="sellprice_$i" value=$form->{"sellprice_$i"}>
2764 <input type=hidden name="weight_$i" value=$form->{"weight_$i"}>
2774 $lxdebug->leave_sub();
2778 $lxdebug->enter_sub();
2780 if ($form->{item} eq "assembly") {
2781 my $i = $form->{assembly_rows};
2783 # if last row is empty check the form otherwise retrieve item
2784 if ( ($form->{"partnumber_$i"} eq "")
2785 && ($form->{"description_$i"} eq "")
2786 && ($form->{"partsgroup_$i"} eq "")) {
2792 IC->assembly_item(\%myconfig, \%$form);
2794 my $rows = scalar @{ $form->{item_list} };
2797 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
2800 $form->{makemodel_rows}--;
2804 map { $form->{item_list}[$i]{$_} =~ s/\"/"/g }
2805 qw(partnumber description unit partsgroup);
2806 map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} }
2807 keys %{ $form->{item_list}[0] };
2808 $form->{"runningnumber_$i"} = $form->{assembly_rows};
2809 $form->{assembly_rows}++;
2817 $form->{rowcount} = $i;
2818 $form->{assembly_rows}++;
2825 } elsif (($form->{item} eq 'part') || ($form->{item} eq 'service')) {
2829 $lxdebug->leave_sub();
2833 $lxdebug->enter_sub();
2835 my ($parts_id, %newform, $previousform, $amount, $callback);
2837 # check if there is a part number - commented out, cause there is an automatic allocation of numbers
2838 # $form->isblank("partnumber", $locale->text(ucfirst $form->{item}." Part Number missing!"));
2840 # check if there is a description
2841 $form->isblank("description", $locale->text("Part Description missing!"));
2843 if ($form->{obsolete}) {
2846 "Inventory quantity must be zero before you can set this $form->{item} obsolete!"
2848 if ($form->{onhand} * 1);
2851 if (!$form->{buchungsgruppen_id}) {
2852 $form->error($locale->text("Parts must have an entry type.") . " " .
2853 $locale->text("If you see this message, you most likely just setup your LX-Office and haven't added any entry types. If this is the case, the option is accessible for administrators in the System menu.")
2857 $form->error($locale->text('Description must not be empty!')) unless $form->{description};
2858 $form->error($locale->text('Partnumber must not be set to empty!')) if $form->{id} && !$form->{partnumber};
2860 # expand dynamic strings
2861 # $locale->text('Inventory quantity must be zero before you can set this part obsolete!')
2862 # $locale->text('Inventory quantity must be zero before you can set this assembly obsolete!')
2863 # $locale->text('Part Number missing!')
2864 # $locale->text('Service Number missing!')
2865 # $locale->text('Assembly Number missing!')
2868 $lxdebug->message($LXDebug::DEBUG1, "ic.pl: sellprice in save = $form->{sellprice}\n");
2869 if (IC->save(\%myconfig, \%$form) == 3) {
2870 $form->error($locale->text('Partnumber not unique!'));
2872 # saving the history
2873 if(!exists $form->{addition}) {
2874 $form->{snumbers} = qq|partnumber_| . $form->{partnumber};
2875 $form->{addition} = "SAVED";
2876 $form->save_history($form->dbconnect(\%myconfig));
2878 # /saving the history
2879 $parts_id = $form->{id};
2882 # load previous variables
2883 if ($form->{previousform}) {
2885 # save the new form variables before splitting previousform
2886 map { $newform{$_} = $form->{$_} } keys %$form;
2888 $previousform = $form->unescape($form->{previousform});
2890 # don't trample on previous variables
2891 map { delete $form->{$_} } keys %newform;
2893 # now take it apart and restore original values
2894 foreach my $item (split /&/, $previousform) {
2895 my ($key, $value) = split /=/, $item, 2;
2896 $value =~ s/%26/&/g;
2897 $form->{$key} = $value;
2899 $form->{taxaccounts} = $newform{taxaccount2};
2901 if ($form->{item} eq 'assembly') {
2903 # undo number formatting
2904 map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
2905 qw(weight listprice sellprice rop);
2907 $form->{assembly_rows}--;
2908 $i = $newform{rowcount};
2909 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
2911 $form->{sellprice} -= $form->{"sellprice_$i"} * $form->{"qty_$i"};
2912 $form->{weight} -= $form->{"weight_$i"} * $form->{"qty_$i"};
2914 # change/add values for assembly item
2915 map { $form->{"${_}_$i"} = $newform{$_} }
2916 qw(partnumber description bin unit weight listprice sellprice inventory_accno income_accno expense_accno);
2918 $form->{sellprice} += $form->{"sellprice_$i"} * $form->{"qty_$i"};
2919 $form->{weight} += $form->{"weight_$i"} * $form->{"qty_$i"};
2923 # set values for last invoice/order item
2924 $i = $form->{rowcount};
2925 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
2927 map { $form->{"${_}_$i"} = $newform{$_} }
2928 qw(partnumber description bin unit listprice inventory_accno income_accno expense_accno sellprice);
2929 $form->{"sellprice_$i"} = $newform{lastcost} if ($form->{vendor_id});
2930 if ($form->{exchangerate} != 0) {
2931 $form->{"sellprice_$i"} /= $form->{exchangerate};
2933 $lxdebug->message($LXDebug::DEBUG1, qq|sellprice_$i in previousform 2 = | . $form->{"sellprice_$i"} . qq|\n|);
2934 map { $form->{"taxaccounts_$i"} .= "$_ " } split / /,
2935 $newform{taxaccount};
2936 chop $form->{"taxaccounts_$i"};
2937 foreach my $item (qw(description rate taxnumber)) {
2938 my $index = $form->{"taxaccounts_$i"} . "_$item";
2939 $form->{$index} = $newform{$index};
2942 # credit remaining calculation
2944 $form->{"sellprice_$i"} * (1 - $form->{"discount_$i"} / 100) *
2946 map { $form->{"${_}_base"} += $amount }
2947 (split / /, $form->{"taxaccounts_$i"});
2948 map { $amount += ($form->{"${_}_base"} * $form->{"${_}_rate"}) }
2949 split / /, $form->{"taxaccounts_$i"}
2950 if !$form->{taxincluded};
2952 $form->{creditremaining} -= $amount;
2954 # redo number formatting, because invoice parse them!
2955 $i = $form->{rowcount};
2957 $form->{"${_}_$i"} =
2958 $form->format_amount(\%myconfig, $form->{"${_}_$i"})
2959 } qw(weight listprice sellprice rop);
2962 $form->{"id_$i"} = $parts_id;
2963 delete $form->{action};
2965 # restore original callback
2966 $callback = $form->unescape($form->{callback});
2967 $form->{callback} = $form->unescape($form->{old_callback});
2968 delete $form->{old_callback};
2970 $form->{makemodel_rows}--;
2972 # put callback together
2973 foreach my $key (keys %$form) {
2975 # do single escape for Apache 2.0
2976 my $value = $form->escape($form->{$key}, 1);
2977 $callback .= qq|&$key=$value|;
2979 $form->{callback} = $callback;
2981 $lxdebug->message($LXDebug::DEBUG1, qq|ic.pl: sellprice_$i nach sub save = | . $form->{"sellprice_$i"} . qq|\n|);
2986 $lxdebug->leave_sub();
2990 $lxdebug->enter_sub();
2992 # saving the history
2993 if(!exists $form->{addition}) {
2994 $form->{snumbers} = qq|partnumber_| . $form->{partnumber};
2995 $form->{addition} = "SAVED AS NEW";
2996 $form->save_history($form->dbconnect(\%myconfig));
2998 # /saving the history
3000 if ($form->{"original_partnumber"} &&
3001 ($form->{"partnumber"} eq $form->{"original_partnumber"})) {
3002 $form->{partnumber} = "";
3005 $lxdebug->leave_sub();
3009 $lxdebug->enter_sub();
3010 # saving the history
3011 if(!exists $form->{addition}) {
3012 $form->{snumbers} = qq|partnumber_| . $form->{partnumber};
3013 $form->{addition} = "DELETED";
3014 $form->save_history($form->dbconnect(\%myconfig));
3016 # /saving the history
3017 my $rc = IC->delete(\%myconfig, \%$form);
3020 $form->redirect($locale->text('Item deleted!')) if ($rc > 0);
3021 $form->error($locale->text('Cannot delete item!'));
3023 $lxdebug->leave_sub();
3027 $lxdebug->enter_sub();
3036 <th class="listheading">| . $locale->text('Preisklasse') . qq|</th>
3037 <th class="listheading">| . $locale->text('Preis') . qq|</th>
3040 for my $i (1 .. $numrows) {
3043 <td width=50%><input type=hidden name="pricegroup_$i" size=30 value="$form->{"pricegroup_$i"}">$form->{"pricegroup_$i"}</td>
3044 <td width=50%><input name="price_$i" size=11 value="$form->{"price_$i"}"></td>
3045 <input type=hidden name="pricegroup_id_$i" value="$form->{"pricegroup_id_$i"}">
3056 $lxdebug->leave_sub();
3059 sub parts_language_selection {
3060 $lxdebug->enter_sub();
3064 my $languages = IC->retrieve_languages(\%myconfig, $form);
3067 my $callback = "$form->{script}?action=parts_language_selection&";
3068 map({ $callback .= "$_=" . $form->escape($form->{$_}) . "&" }
3069 (qw(login password name input_name), grep({ /^[fl]_/ } keys %$form)));
3071 my @header_sort = qw(name longdescription);
3072 my %header_title = ( "name" => $locale->text("Name"),
3073 "longdescription" => $locale->text("Long Description"),
3077 map(+{ "column_title" => $header_title{$_},
3079 "callback" => $callback,
3083 $form->{"title"} = $locale->text("Language Values");
3085 print($form->parse_html_template("ic/parts_language_selection", { "HEADER" => \@header,
3086 "LANGUAGES" => $languages,
3087 "onload" => $onload }));
3089 $lxdebug->leave_sub();
3092 sub continue { call_sub($form->{"nextsub"}); }