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 #======================================================================
39 require "$form->{path}/io.pl";
46 $lxdebug->enter_sub();
48 $form->{title} = $locale->text('Add ' . ucfirst $form->{item});
51 "$form->{script}?action=add&item=$form->{item}&path=$form->{path}&login=$form->{login}&password=$form->{password}"
52 unless $form->{callback};
54 $form->{"unit_changeable"} = 1;
56 IC->get_pricegroups(\%myconfig, \%$form);
60 $lxdebug->leave_sub();
64 $lxdebug->enter_sub();
66 $form->{title} = (ucfirst $form->{searchitems}) . "s";
67 $form->{title} = $locale->text($form->{title});
69 # switch for backward sorting
72 # memory for which table was sort at last time
73 $form->{lastsort} = "";
75 # counter for added entries to top100
76 $form->{ndxs_counter} = 0;
78 # $locale->text('Parts')
79 # $locale->text('Services')
81 # use JavaScript Calendar or not
82 $form->{jsscript} = $jscalendar;
84 if ($form->{jsscript}) {
86 # with JavaScript Calendar
88 <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>
89 <td><input type=button name=transdatefrom id="trigger1" value=|
90 . $locale->text('button') . qq|></td>
93 <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>
94 <td><input type=button name=transdateto name=transdateto id="trigger2" value=|
95 . $locale->text('button') . qq|></td>
100 Form->write_trigger(\%myconfig, "2", "transdatefrom", "BL", "trigger1",
101 "transdateto", "BL", "trigger2");
104 # without JavaScript Calendar
106 <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>|;
108 <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>|;
111 unless ($form->{searchitems} eq 'service') {
114 <input name=itemstatus class=radio type=radio value=onhand> |
115 . $locale->text('On Hand') . qq|
116 <input name=itemstatus class=radio type=radio value=short> |
117 . $locale->text('Short') . qq|
122 <th align=right nowrap>| . $locale->text('Make') . qq|</th>
123 <td><input name=make size=20></td>
124 <th align=right nowrap>| . $locale->text('Model') . qq|</th>
125 <td><input name=model size=20></td>
130 <th align=right nowrap>| . $locale->text('Serial Number') . qq|</th>
131 <td><input name=serialnumber size=20></td>
134 $l_serialnumber = qq|
135 <td><input name=l_serialnumber class=checkbox type=checkbox value=Y> |
136 . $locale->text('Serial Number') . qq|</td>
141 if ($form->{searchitems} eq 'assembly') {
143 $form->{title} = $locale->text('Assemblies');
149 <input name=null class=radio type=radio value=1 checked> |
150 . $locale->text('Top Level') . qq|
151 <input name=bom class=checkbox type=checkbox value=1> |
152 . $locale->text('Individual Items') . qq|
166 <td><input name=sold class=checkbox type=checkbox value=1></td>
167 <td nowrap>| . $locale->text('Sold') . qq|</td>
170 <td colspan=2><hr size=1 noshade></td>
173 <td><input name=ordered class=checkbox type=checkbox value=1></td>
174 <td nowrap>| . $locale->text('Ordered') . qq|</td>
177 <td colspan=4><hr size=1 noshade></td>
180 <td><input name=quoted class=checkbox type=checkbox value=1></td>
181 <td nowrap>| . $locale->text('Quoted') . qq|</td>
185 <td width=5%> </td>
186 <th>| . $locale->text('From') . qq|</th>
188 <th>| . $locale->text('To (time)') . qq|</th>
207 <td><input name=bought class=checkbox type=checkbox value=1></td>
208 <td nowrap>| . $locale->text('Bought') . qq|</td>
209 <td><input name=sold class=checkbox type=checkbox value=1></td>
210 <td nowrap>| . $locale->text('Sold') . qq|</td>
213 <td colspan=4><hr size=1 noshade></td>
216 <td><input name=onorder class=checkbox type=checkbox value=1></td>
217 <td nowrap>| . $locale->text('On Order') . qq|</td>
218 <td><input name=ordered class=checkbox type=checkbox value=1></td>
219 <td nowrap>| . $locale->text('Ordered') . qq|</td>
222 <td colspan=4><hr size=1 noshade></td>
225 <td><input name=rfq class=checkbox type=checkbox value=1></td>
226 <td nowrap>| . $locale->text('RFQ') . qq|</td>
227 <td><input name=quoted class=checkbox type=checkbox value=1></td>
228 <td nowrap>| . $locale->text('Quoted') . qq|</td>
232 <td width=5%> </td>
236 <th>| . $locale->text('From') . qq|</th>
238 <th>| . $locale->text('To (time)') . qq|</th>
255 <form method=post action=$form->{script}>
257 <input type=hidden name=searchitems value=$form->{searchitems}>
258 <input type=hidden name=title value="$form->{title}">
260 <input type=hidden name=revers value="$form->{revers}">
261 <input type=hidden name=lastsort value="$form->{lastsort}">
264 <tr><th class=listtop>$form->{title}</th></tr>
270 <th align=right nowrap>| . $locale->text('Part Number') . qq|</th>
271 <td><input name=partnumber size=20></td>
272 <th align=right nowrap>| . $locale->text('EAN') . qq|</th>
273 <td><input name=ean size=20></td>
276 <th align=right nowrap>|
277 . $locale->text('Part Description') . qq|</th>
278 <td colspan=3><input name=description size=40></td>
281 <th align=right nowrap>| . $locale->text('Group') . qq|</th>
282 <td><input name=partsgroup size=20></td>
287 <th align=right nowrap>| . $locale->text('Drawing') . qq|</th>
288 <td><input name=drawing size=20></td>
289 <th align=right nowrap>| . $locale->text('Microfiche') . qq|</th>
290 <td><input name=microfiche size=20></td>
296 <input name=itemstatus class=radio type=radio value=active checked> |
297 . $locale->text('Active') . qq|
299 <input name=itemstatus class=radio type=radio value=obsolete> |
300 . $locale->text('Obsolete') . qq|
301 <input name=itemstatus class=radio type=radio value=orphaned> |
302 . $locale->text('Orphaned') . qq|
313 <th align=right nowrap>|
314 . $locale->text('Include in Report') . qq|</th>
318 <td><input name=l_partnumber class=checkbox type=checkbox value=Y checked> |
319 . $locale->text('Part Number') . qq|</td>
320 <td><input name=l_description class=checkbox type=checkbox value=Y checked> |
321 . $locale->text('Part Description') . qq|</td>
323 <td><input name=l_unit class=checkbox type=checkbox value=Y checked> |
324 . $locale->text('Unit of measure') . qq|</td>
327 <td><input name=l_listprice class=checkbox type=checkbox value=Y> |
328 . $locale->text('List Price') . qq|</td>
329 <td><input name=l_sellprice class=checkbox type=checkbox value=Y checked> |
330 . $locale->text('Sell Price') . qq|</td>
331 <td><input name=l_lastcost class=checkbox type=checkbox value=Y checked> |
332 . $locale->text('Last Cost') . qq|</td>
333 <td><input name=l_linetotal class=checkbox type=checkbox value=Y checked> |
334 . $locale->text('Line Total') . qq|</td>
337 <td><input name=l_priceupdate class=checkbox type=checkbox value=Y> |
338 . $locale->text('Updated') . qq|</td>
339 <td><input name=l_bin class=checkbox type=checkbox value=Y> |
340 . $locale->text('Bin') . qq|</td>
341 <td><input name=l_rop class=checkbox type=checkbox value=Y> |
342 . $locale->text('ROP') . qq|</td>
343 <td><input name=l_weight class=checkbox type=checkbox value=Y> |
344 . $locale->text('Weight') . qq|</td>
347 <td><input name=l_image class=checkbox type=checkbox value=Y> |
348 . $locale->text('Image') . qq|</td>
349 <td><input name=l_drawing class=checkbox type=checkbox value=Y> |
350 . $locale->text('Drawing') . qq|</td>
351 <td><input name=l_microfiche class=checkbox type=checkbox value=Y> |
352 . $locale->text('Microfiche') . qq|</td>
353 <td><input name=l_partsgroup class=checkbox type=checkbox value=Y> |
354 . $locale->text('Group') . qq|</td>
357 <td><input name=l_subtotal class=checkbox type=checkbox value=Y> |
358 . $locale->text('Subtotal') . qq|</td>
359 <td><input name=l_soldtotal class=checkbox type=checkbox value=Y> |
360 . $locale->text('soldtotal') . qq|</td>
361 <td><input name=l_deliverydate class=checkbox type=checkbox value=Y> |
362 . $locale->text('deliverydate') . qq|</td>
370 <tr><td colspan=4><hr size=3 noshade></td></tr>
375 <input type=hidden name=nextsub value=generate_report>
377 <input type=hidden name=path value=$form->{path}>
378 <input type=hidden name=login value=$form->{login}>
379 <input type=hidden name=password value=$form->{password}>
381 <input type=hidden name=revers value="$form->{revers}">
382 <input type=hidden name=lastsort value="$form->{lastsort}">
383 <input type=hidden name=sort value="description">
385 <input type=hidden name=ndxs_counter value="$form->{ndxs_counter}">
388 <input class=submit type=submit name=action value="|
389 . $locale->text('Continue') . qq|">
390 <input class=submit type=submit name=action value="|
391 . $locale->text('TOP100') . qq|">
397 $lxdebug->leave_sub();
401 sub search_update_prices {
402 $lxdebug->enter_sub();
404 $form->{title} = $locale->text('Update prices');
405 IC->get_pricegroups(\%myconfig, \%$form);
407 # use JavaScript Calendar or not
408 # $form->{jsscript} = $jscalendar;
410 # if ($form->{jsscript}) {
412 # # with JavaScript Calendar
414 # <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>
415 # <td><input type=button name=transdatefrom id="trigger1" value=|
416 # . $locale->text('button') . qq|></td>
419 # <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>
420 # <td><input type=button name=transdateto name=transdateto id="trigger2" value=|
421 # . $locale->text('button') . qq|></td>
426 # Form->write_trigger(\%myconfig, "2", "transdatefrom", "BL", "trigger1",
427 # "transdateto", "BL", "trigger2");
430 # # without JavaScript Calendar
432 # <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>|;
434 # <td><input name=transdateto id=transdateto size=11 title="$myconfig{dateformat}"></td>|;
438 <input name=itemstatus class=radio type=radio value=onhand> |
439 . $locale->text('On Hand') . qq|
440 <input name=itemstatus class=radio type=radio value=short> |
441 . $locale->text('Short') . qq|
446 <th align=right nowrap>| . $locale->text('Make') . qq|</th>
447 <td><input name=make size=20></td>
448 <th align=right nowrap>| . $locale->text('Model') . qq|</th>
449 <td><input name=model size=20></td>
454 <th align=right nowrap>| . $locale->text('Serial Number') . qq|</th>
455 <td><input name=serialnumber size=20></td>
458 $l_serialnumber = qq|
459 <td><input name=l_serialnumber class=checkbox type=checkbox value=Y> |
460 . $locale->text('Serial Number') . qq|</td>
470 <form method=post action=$form->{script}>
472 <input type=hidden name=title value="$form->{title}">
475 <tr><th class=listtop>$form->{title}</th></tr>
481 <th align=right nowrap>| . $locale->text('Part Number') . qq|</th>
482 <td><input name=partnumber size=20></td>
485 <th align=right nowrap>|
486 . $locale->text('Part Description') . qq|</th>
487 <td colspan=3><input name=description size=40></td>
490 <th align=right nowrap>| . $locale->text('Group') . qq|</th>
491 <td><input name=partsgroup size=20></td>
496 <th align=right nowrap>| . $locale->text('Drawing') . qq|</th>
497 <td><input name=drawing size=20></td>
498 <th align=right nowrap>| . $locale->text('Microfiche') . qq|</th>
499 <td><input name=microfiche size=20></td>
505 <input name=itemstatus class=radio type=radio value=active checked> |
506 . $locale->text('Active') . qq|
508 <input name=itemstatus class=radio type=radio value=obsolete> |
509 . $locale->text('Obsolete') . qq|
510 <input name=itemstatus class=radio type=radio value=orphaned> |
511 . $locale->text('Orphaned') . qq|
526 <th class="listheading">| . $locale->text('Preisklasse') . qq|</th>
527 <th class="listheading">| . $locale->text('Preis') . qq|</th>
528 <th class="listheading">| . $locale->text('Prozentual/Absolut') . qq|</th>
531 <td>| . $locale->text('Sell Price') . qq|</td>
532 <td><input name="sellprice" size=11 value="$form->{"sellprice"}"></td>
533 <td><input name="sellprice_type" class=radio type=radio value=percent checked>/<input name="sellprice_type" class=radio type=radio value=absolut></td>
536 <td>| . $locale->text('List Price') . qq|</td>
537 <td><input name="listprice" size=11 value="$form->{"listprice"}"></td>
538 <td><input name="listprice_type" class=radio type=radio value=percent checked>/<input name="listprice_type" class=radio type=radio value=absolut></td>
541 for $i (1 .. $form->{price_rows}) {
544 <td width=50%><input type=hidden name="pricegroup_$i" size=30 value="$form->{"pricegroup_$i"}">$form->{"pricegroup_$i"}</td>
545 <td width=50%><input name="price_$i" size=11></td>
546 <input type=hidden name="pricegroup_id_$i" value="$form->{"pricegroup_id_$i"}">
547 <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>
557 <tr><td colspan=4><hr size=3 noshade></td></tr>
559 <input type=hidden name=nextsub value=confirm_price_update>
560 <input type=hidden name=price_rows value=$form->{price_rows}>
562 <input type=hidden name=path value=$form->{path}>
563 <input type=hidden name=login value=$form->{login}>
564 <input type=hidden name=password value=$form->{password}>
567 <input class=submit type=submit name=action value="|
568 . $locale->text('Continue') . qq|">
574 $lxdebug->leave_sub();
577 sub confirm_price_update {
578 $lxdebug->enter_sub();
581 $form->{nextsub} = "update_prices";
587 <form method=post action=$form->{script}>
590 # delete action variable
591 map { delete $form->{$_} } qw(action header);
593 foreach $key (keys %$form) {
594 $form->{$key} =~ s/\"/"/g;
595 print qq|<input type=hidden name=$key value="$form->{$key}">\n|;
599 <h2 class=confirm>| . $locale->text('Confirm!') . qq|</h2>
602 . $locale->text('Are you sure you want to update the prices')
606 <input name=action class=submit type=submit value="|
607 . $locale->text('Continue') . qq|">
611 $lxdebug->leave_sub();
615 $lxdebug->enter_sub();
617 if (IC->update_prices(\%myconfig, \%$form)) {
618 $form->redirect($form->{update_count} . $locale->text('prices updated!'));
620 $form->error($locale->text('Could not update prices!'));
623 $lxdebug->leave_sub();
627 $lxdebug->enter_sub();
629 $form->{title} = $locale->text('Top 100 hinzufuegen');
636 <form method=post action=$form->{script}>
638 <input type=hidden name=searchitems value=$form->{searchitems}>
639 <input type=hidden name=title value="$form->{title}">
641 <input type=hidden name=revers value="$form->{revers}">
642 <input type=hidden name=lastsort value="$form->{lastsort}">|;
646 <tr class=listheading>
647 <th class=listheading nowrap>|
648 . $locale->text('Part Number') . qq|</th>
649 <th class=listheading nowrap>|
650 . $locale->text('Part Description') . qq|</th>
653 <td><input type=text name=partnumber size=20 value=></td>
654 <td><input type=text name=description size=30 value=></td>
661 <input type=hidden name=path value=$form->{path}>
662 <input type=hidden name=login value=$form->{login}>
663 <input type=hidden name=password value=$form->{password}>
665 <input type=hidden name=itemstatus value="$form->{itemstatus}">
666 <input type=hidden name=l_linetotal value="$form->{l_linetotal}">
667 <input type=hidden name=l_partnumber value="$form->{l_partnumber}">
668 <input type=hidden name=l_description value="$form->{l_description}">
669 <input type=hidden name=l_onhand value="$form->{l_onhand}">
670 <input type=hidden name=l_unit value="$form->{l_unit}">
671 <input type=hidden name=l_sellprice value="$form->{l_sellprice}">
672 <input type=hidden name=l_linetotalsellprice value="$form->{l_linetotalsellprice}">
673 <input type=hidden name=sort value="$form->{sort}">
674 <input type=hidden name=revers value="$form->{revers}">
675 <input type=hidden name=lastsort value="$form->{lastsort}">
677 <input type=hidden name=bom value="$form->{bom}">
678 <input type=hidden name=titel value="$form->{titel}">
679 <input type=hidden name=searchitems value="$form->{searchitems}">
681 <input type=hidden name=row value=$j>
683 <input type=hidden name=nextsub value=item_selected>
685 <input type=hidden name=test value=item_selected>
687 <input name=lastndx type=hidden value=$lastndx>
689 <input name=ndxs_counter type=hidden value=$form->{ndxs_counter}>
691 <input name=extras type=hidden value=$form->{extras}>|;
695 for ($i = 0; $i < $form->{ndxs_counter}; $i++) {
698 $partnumber = $form->{"totop100_partnumber_$j"};
699 $description = $form->{"totop100_description_$j"};
700 $unit = $form->{"totop100_unit_$j"};
701 $sellprice = $form->{"totop100_sellprice_$j"};
702 $soldtotal = $form->{"totop100_soldtotal_$j"};
704 # insert data into top100
705 push @{ $form->{parts} },
707 partnumber => "$partnumber",
708 description => "$description",
710 sellprice => "$sellprice",
711 soldtotal => "$soldtotal" };
717 # set data for next page
718 if (($form->{ndxs_counter}) > 0) {
719 for ($i = 1; ($i < $form->{ndxs_counter} + 1); $i++) {
720 $partnumber = $form->{"totop100_partnumber_$i"};
721 $description = $form->{"totop100_description_$i"};
722 $unit = $form->{"totop100_unit_$i"};
723 $sellprice = $form->{"totop100_sellprice_$i"};
724 $soldtotal = $form->{"totop100_soldtotal_$i"};
727 <input type=hidden name=totop100_partnumber_$i value=$form->{"totop100_partnumber_$i"}>
728 <input type=hidden name=totop100_description_$i value=$form->{"totop100_description_$i"}>
729 <input type=hidden name=totop100_unit_$i value=$form->{"totop100_unit_$i"}>
730 <input type=hidden name=totop100_sellprice_$i value=$form->{"totop100_sellprice_$i"}>
731 <input type=hidden name=totop100_soldtotal_$i value=$form->{"totop100_soldtotal_$i"}>
739 <input class=submit type=submit name=action value="|
740 . $locale->text('list') . qq|">
745 $lxdebug->leave_sub();
749 $lxdebug->enter_sub();
752 if (($form->{partnumber} eq "") and ($form->{description} eq "")) {
753 IC->get_parts(\%myconfig, \%$form, "");
755 if ((!($form->{partnumber} eq "")) and ($form->{description} eq "")) {
756 IC->get_parts(\%myconfig, \%$form, "partnumber");
758 if (($form->{partnumber} eq "") and (!($form->{description} eq ""))) {
759 IC->get_parts(\%myconfig, \%$form, "description");
761 IC->get_parts(\%myconfig, \%$form, "all");
766 $form->{title} = $locale->text('Top 100 hinzufuegen');
772 <form method=post action=ic.pl>
775 <th class=listtop colspan=6>| . $locale->text('choice part') . qq|</th>
778 <tr class=listheading>
780 <th class=listheading>| . $locale->text('Part Number') . qq|</th>
781 <th class=listheading>| . $locale->text('Part Description') . qq|</th>
782 <th class=listheading>| . $locale->text('Unit of measure') . qq|</th>
783 <th class=listheading>| . $locale->text('Sell Price') . qq|</th>
784 <th class=listheading>| . $locale->text('soldtotal') . qq|</th>
788 my $i = $form->{rows};
790 for ($j = 1; $j <= $i; $j++) {
793 <tr class=listrow1>|;
796 <td><input name=ndx class=radio type=radio value=$j checked></td>|;
799 <td><input name=ndx class=radio type=radio value=$j></td>|;
802 <td><input name="new_partnumber_$j" type=hidden value="$form->{"partnumber_$j"}">$form->{"partnumber_$j"}</td>
803 <td><input name="new_description_$j" type=hidden value="$form->{"description_$j"}">$form->{"description_$j"}</td>
804 <td><input name="new_unit_$j" type=hidden value="$form->{"unit_$j"}">$form->{"unit_$j"}</td>
805 <td><input name="new_sellprice_$j" type=hidden value="$form->{"sellprice_$j"}">$form->{"sellprice_$j"}</td>
806 <td><input name="new_soldtotal_$j" type=hidden value="$form->{"soldtotal_$j"}">$form->{"soldtotal_$j"}</td>
809 <input name="new_id_$j" type=hidden value="$form->{"id_$j"}">|;
819 <input type=hidden name=path value=$form->{path}>
820 <input type=hidden name=login value=$form->{login}>
821 <input type=hidden name=password value=$form->{password}>
823 <input type=hidden name=itemstatus value="$form->{itemstatus}">
824 <input type=hidden name=l_linetotal value="$form->{l_linetotal}">
825 <input type=hidden name=l_partnumber value="$form->{l_partnumber}">
826 <input type=hidden name=l_description value="$form->{l_description}">
827 <input type=hidden name=l_onhand value="$form->{l_onhand}">
828 <input type=hidden name=l_unit value="$form->{l_unit}">
829 <input type=hidden name=l_sellprice value="$form->{l_sellprice}">
830 <input type=hidden name=l_linetotalsellprice value="$form->{l_linetotalsellprice}">
831 <input type=hidden name=sort value="$form->{sort}">
832 <input type=hidden name=revers value="$form->{revers}">
833 <input type=hidden name=lastsort value="$form->{lastsort}">
835 <input type=hidden name=bom value="$form->{bom}">
836 <input type=hidden name=titel value="$form->{titel}">
837 <input type=hidden name=searchitems value="$form->{searchitems}">
839 <input type=hidden name=row value=$j>
841 <input type=hidden name=nextsub value=item_selected>
843 <input name=lastndx type=hidden value=$lastndx>
845 <input name=ndxs_counter type=hidden value=$form->{ndxs_counter}>|;
849 if (($form->{ndxs_counter}) > 0) {
850 for ($i = 1; ($i < $form->{ndxs_counter} + 1); $i++) {
851 $j1 = $form->{"totop100_partnumber_$i"};
852 $j2 = $form->{"totop100_description_$i"};
853 $j3 = $form->{"totop100_unit_$i"};
854 $j4 = $form->{"totop100_sellprice_$i"};
855 $j5 = $form->{"totop100_soldtotal_$i"};
864 <input type=hidden name=totop100_partnumber_$i value=$form->{"totop100_partnumber_$i"}>
865 <input type=hidden name=totop100_description_$i value=$form->{"totop100_description_$i"}>
866 <input type=hidden name=totop100_unit_$i value=$form->{"totop100_unit_$i"}>
867 <input type=hidden name=totop100_sellprice_$i value=$form->{"totop100_sellprice_$i"}>
868 <input type=hidden name=totop100_soldtotal_$i value=$form->{"totop100_soldtotal_$i"}>
876 <input class=submit type=submit name=action value="|
877 . $locale->text('TOP100') . qq|">
883 $lxdebug->leave_sub();
887 $lxdebug->enter_sub();
890 $form->{ndxs_counter}++;
892 if ($form->{ndxs_counter} > 0) {
894 $index = $form->{ndx};
896 $j1 = $form->{"new_partnumber_$index"};
897 $form->{"totop100_partnumber_$form->{ndxs_counter}"} = $j1;
898 $j2 = $form->{"new_description_$index"};
899 $form->{"totop100_description_$form->{ndxs_counter}"} = $j2;
900 $j3 = $form->{"new_unit_$index"};
901 $form->{"totop100_unit_$form->{ndxs_counter}"} = $j3;
902 $j4 = $form->{"new_sellprice_$index"};
903 $form->{"totop100_sellprice_$form->{ndxs_counter}"} = $j4;
904 $j5 = $form->{"new_soldtotal_$index"};
905 $form->{"totop100_soldtotal_$form->{ndxs_counter}"} = $j5;
909 $lxdebug->leave_sub();
913 $lxdebug->enter_sub();
915 $form->{top100} = "top100";
916 $form->{l_soldtotal} = "Y";
917 $form->{soldtotal} = "soldtotal";
918 $form->{sort} = "soldtotal";
919 $form->{l_qty} = "N";
920 $callback .= "&form->{top100}=$form->{top100}";
921 $form->{l_linetotal} = "";
923 $form->{number} = "position";
924 $form->{l_number} = "Y";
928 $form->{title} = $locale->text('Top 100');
930 $revers = $form->{revers};
931 $lastsort = $form->{lastsort};
933 if (($form->{lastsort} eq "") && ($form->{sort} eq undef)) {
935 $form->{lastsort} = "partnumber";
936 $form->{sort} = "partnumber";
940 "$form->{script}?action=top100&path=$form->{path}&login=$form->{login}&password=$form->{password}&searchitems=$form->{searchitems}&itemstatus=$form->{itemstatus}&bom=$form->{bom}&l_linetotal=$form->{l_linetotal}&title="
941 . $form->escape($form->{title}, 1);
943 # if we have a serialnumber limit search
944 if ($form->{serialnumber} || $form->{l_serialnumber}) {
945 $form->{l_serialnumber} = "Y";
946 unless ( $form->{bought}
949 || $form->{quoted}) {
950 $form->{bought} = $form->{sold} = 1;
953 IC->all_parts(\%myconfig, \%$form);
955 if ($form->{itemstatus} eq 'active') {
956 $option .= $locale->text('Active') . " : ";
958 if ($form->{itemstatus} eq 'obsolete') {
959 $option .= $locale->text('Obsolete') . " : ";
961 if ($form->{itemstatus} eq 'orphaned') {
962 $option .= $locale->text('Orphaned') . " : ";
964 if ($form->{itemstatus} eq 'onhand') {
965 $option .= $locale->text('On Hand') . " : ";
966 $form->{l_onhand} = "Y";
968 if ($form->{itemstatus} eq 'short') {
969 $option .= $locale->text('Short') . " : ";
970 $form->{l_onhand} = "Y";
972 if ($form->{onorder}) {
973 $form->{l_ordnumber} = "Y";
974 $callback .= "&onorder=$form->{onorder}";
975 $option .= $locale->text('On Order') . " : ";
977 if ($form->{ordered}) {
978 $form->{l_ordnumber} = "Y";
979 $callback .= "&ordered=$form->{ordered}";
980 $option .= $locale->text('Ordered') . " : ";
983 $form->{l_quonumber} = "Y";
984 $callback .= "&rfq=$form->{rfq}";
985 $option .= $locale->text('RFQ') . " : ";
987 if ($form->{quoted}) {
988 $form->{l_quonumber} = "Y";
989 $callback .= ""ed=$form->{quoted}";
990 $option .= $locale->text('Quoted') . " : ";
992 if ($form->{bought}) {
993 $form->{l_invnumber} = "Y";
994 $callback .= "&bought=$form->{bought}";
995 $option .= $locale->text('Bought') . " : ";
998 $form->{l_invnumber} = "Y";
999 $callback .= "&sold=$form->{sold}";
1000 $option .= $locale->text('Sold') . " : ";
1002 if ( $form->{bought}
1007 || $form->{quoted}) {
1009 $form->{l_lastcost} = "";
1010 $form->{l_name} = "Y";
1011 if ($form->{transdatefrom}) {
1012 $callback .= "&transdatefrom=$form->{transdatefrom}";
1014 . $locale->text('From')
1016 . $locale->date(\%myconfig, $form->{transdatefrom}, 1);
1018 if ($form->{transdateto}) {
1019 $callback .= "&transdateto=$form->{transdateto}";
1021 . $locale->text('To')
1023 . $locale->date(\%myconfig, $form->{transdateto}, 1);
1029 if ($form->{partnumber}) {
1030 $callback .= "&partnumber=$form->{partnumber}";
1031 $option .= $locale->text('Part Number') . qq| : $form->{partnumber}<br>|;
1034 $callback .= "&partnumber=$form->{ean}";
1035 $option .= $locale->text('EAN') . qq| : $form->{ean}<br>|;
1037 if ($form->{partsgroup}) {
1038 $callback .= "&partsgroup=$form->{partsgroup}";
1039 $option .= $locale->text('Group') . qq| : $form->{partsgroup}<br>|;
1041 if ($form->{serialnumber}) {
1042 $callback .= "&serialnumber=$form->{serialnumber}";
1044 $locale->text('Serial Number') . qq| : $form->{serialnumber}<br>|;
1046 if ($form->{description}) {
1047 $callback .= "&description=$form->{description}";
1048 $description = $form->{description};
1052 $locale->text('Part Description') . qq| : $form->{description}<br>|;
1054 if ($form->{make}) {
1055 $callback .= "&make=$form->{make}";
1056 $option .= $locale->text('Make') . qq| : $form->{make}<br>|;
1058 if ($form->{model}) {
1059 $callback .= "&model=$form->{model}";
1060 $option .= $locale->text('Model') . qq| : $form->{model}<br>|;
1062 if ($form->{drawing}) {
1063 $callback .= "&drawing=$form->{drawing}";
1064 $option .= $locale->text('Drawing') . qq| : $form->{drawing}<br>|;
1066 if ($form->{microfiche}) {
1067 $callback .= "µfiche=$form->{microfiche}";
1068 $option .= $locale->text('Microfiche') . qq| : $form->{microfiche}<br>|;
1070 if ($form->{l_soldtotal}) {
1071 $callback .= "&soldtotal=$form->{soldtotal}";
1072 $option .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|;
1075 @columns = $form->sort_columns(
1076 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)
1079 if ($form->{l_linetotal}) {
1080 $form->{l_onhand} = "Y";
1081 $form->{l_linetotalsellprice} = "Y" if $form->{l_sellprice};
1082 if ($form->{l_lastcost}) {
1083 $form->{l_linetotallastcost} = "Y";
1084 if (($form->{searchitems} eq 'assembly') && !$form->{bom}) {
1085 $form->{l_linetotallastcost} = "";
1088 $form->{l_linetotallistprice} = "Y" if $form->{l_listprice};
1091 if ($form->{searchitems} eq 'service') {
1093 # remove bin, weight and rop from list
1094 map { $form->{"l_$_"} = "" } qw(bin weight rop);
1096 $form->{l_onhand} = "";
1098 # qty is irrelevant unless bought or sold
1099 if ( $form->{bought}
1104 || $form->{quoted}) {
1105 $form->{l_onhand} = "Y";
1107 $form->{l_linetotalsellprice} = "";
1108 $form->{l_linetotallastcost} = "";
1112 $form->{l_lastcost} = ""
1113 if ($form->{searchitems} eq 'assembly' && !$form->{bom});
1115 foreach $item (@columns) {
1116 if ($form->{"l_$item"} eq "Y") {
1117 push @column_index, $item;
1119 # add column to callback
1120 $callback .= "&l_$item=Y";
1124 if ($form->{l_subtotal} eq 'Y') {
1125 $callback .= "&l_subtotal=Y";
1128 $column_header{number} =
1129 qq|<th class=listheading nowrap>| . $locale->text('number') . qq|</th>|;
1130 $column_header{partnumber} =
1131 qq|<th nowrap><a class=listheading href=$callback&sort=partnumber&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1132 . $locale->text('Part Number')
1134 $column_header{description} =
1135 qq|<th nowrap><a class=listheading href=$callback&sort=description&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1136 . $locale->text('Part Description')
1138 $column_header{partsgroup} =
1139 qq|<th nowrap><a class=listheading href=$callback&sort=partsgroup>|
1140 . $locale->text('Group')
1142 $column_header{bin} =
1143 qq|<th><a class=listheading href=$callback&sort=bin>|
1144 . $locale->text('Bin')
1146 $column_header{priceupdate} =
1147 qq|<th nowrap><a class=listheading href=$callback&sort=priceupdate>|
1148 . $locale->text('Updated')
1150 $column_header{onhand} =
1151 qq|<th nowrap><a class=listheading href=$callback&sort=onhand&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1152 . $locale->text('Qty')
1154 $column_header{unit} =
1155 qq|<th class=listheading nowrap>| . $locale->text('Unit') . qq|</th>|;
1156 $column_header{listprice} =
1157 qq|<th class=listheading nowrap>|
1158 . $locale->text('List Price')
1160 $column_header{lastcost} =
1161 qq|<th class=listheading nowrap>| . $locale->text('Last Cost') . qq|</th>|;
1162 $column_header{rop} =
1163 qq|<th class=listheading nowrap>| . $locale->text('ROP') . qq|</th>|;
1164 $column_header{weight} =
1165 qq|<th class=listheading nowrap>| . $locale->text('Weight') . qq|</th>|;
1167 $column_header{invnumber} =
1168 qq|<th nowrap><a class=listheading href=$callback&sort=invnumber>|
1169 . $locale->text('Invoice Number')
1171 $column_header{ordnumber} =
1172 qq|<th nowrap><a class=listheading href=$callback&sort=ordnumber>|
1173 . $locale->text('Order Number')
1175 $column_header{quonumber} =
1176 qq|<th nowrap><a class=listheading href=$callback&sort=quonumber>|
1177 . $locale->text('Quotation')
1180 $column_header{name} =
1181 qq|<th nowrap><a class=listheading href=$callback&sort=name>|
1182 . $locale->text('Name')
1185 $column_header{sellprice} =
1186 qq|<th class=listheading nowrap>|
1187 . $locale->text('Sell Price')
1189 $column_header{linetotalsellprice} =
1190 qq|<th class=listheading nowrap>| . $locale->text('Extended') . qq|</th>|;
1191 $column_header{linetotallastcost} =
1192 qq|<th class=listheading nowrap>| . $locale->text('Extended') . qq|</th>|;
1193 $column_header{linetotallistprice} =
1194 qq|<th class=listheading nowrap>| . $locale->text('Extended') . qq|</th>|;
1196 $column_header{image} =
1197 qq|<th class=listheading nowrap>| . $locale->text('Image') . qq|</a></th>|;
1198 $column_header{drawing} =
1199 qq|<th nowrap><a class=listheading href=$callback&sort=drawing>|
1200 . $locale->text('Drawing')
1202 $column_header{microfiche} =
1203 qq|<th nowrap><a class=listheading href=$callback&sort=microfiche>|
1204 . $locale->text('Microfiche')
1207 $column_header{serialnumber} =
1208 qq|<th nowrap><a class=listheading href=$callback&sort=serialnumber>|
1209 . $locale->text('Serial Number')
1211 $column_header{soldtotal} =
1212 qq|<th nowrap><a class=listheading href=$callback&sort=soldtotal&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1213 . $locale->text('soldtotal')
1217 $colspan = $#column_index + 1;
1224 <th class=listtop colspan=$colspan>$form->{title}</th>
1226 <tr height="5"></tr>
1228 <tr><td colspan=$colspan>$option</td></tr>
1230 <tr class=listheading>
1233 map { print "\n$column_header{$_}" } @column_index;
1239 # add order to callback
1240 $form->{callback} = $callback .= "&sort=$form->{sort}";
1242 # escape callback for href
1243 $callback = $form->escape($callback);
1245 if (@{ $form->{parts} }) {
1246 $sameitem = $form->{parts}->[0]->{ $form->{sort} };
1249 # insert numbers for top100
1251 foreach $ref (@{ $form->{parts} }) {
1253 $ref->{number} = $j;
1256 # if avaible -> insert choice here
1257 if (($form->{ndxs_counter}) > 0) {
1258 for ($i = 1; ($i < $form->{ndxs_counter} + 1); $i++) {
1259 $partnumber = $form->{"totop100_partnumber_$i"};
1260 $description = $form->{"totop100_description_$i"};
1261 $unit = $form->{"totop100_unit_$i"};
1262 $sellprice = $form->{"totop100_sellprice_$i"};
1263 $soldtotal = $form->{"totop100_soldtotal_$i"};
1266 <input type=hidden name=totop100_partnumber_$i value=$form->{"totop100_partnumber_$i"}>
1267 <input type=hidden name=totop100_description_$i value=$form->{"totop100_description_$i"}>
1268 <input type=hidden name=totop100_unit_$i value=$form->{"totop100_unit_$i"}>
1269 <input type=hidden name=totop100_sellprice_$i value=$form->{"totop100_sellprice_$i"}>
1270 <input type=hidden name=totop100_soldtotal_$i value=$form->{"totop100_soldtotal_$i"}>
1274 push @{ $form->{parts} },
1276 partnumber => "$partnumber",
1277 description => "$description",
1279 sellprice => "$sellprice",
1280 soldtotal => "$soldtotal" };
1283 # build data for columns
1284 foreach $ref (@{ $form->{parts} }) {
1286 if ($form->{l_subtotal} eq 'Y' && !$ref->{assemblyitem}) {
1287 if ($sameitem ne $ref->{ $form->{sort} }) {
1289 $sameitem = $ref->{ $form->{sort} };
1293 $ref->{exchangerate} = 1 unless $ref->{exchangerate};
1294 $ref->{sellprice} *= $ref->{exchangerate};
1295 $ref->{listprice} *= $ref->{exchangerate};
1296 $ref->{lastcost} *= $ref->{exchangerate};
1298 # use this for assemblies
1299 $onhand = $ref->{onhand};
1302 if ($ref->{assemblyitem}) {
1304 $onhand = 0 if ($form->{sold});
1307 $ref->{description} =~ s/
1310 $column_data{number} =
1312 . $form->format_amount(\%myconfig, $ref->{number})
1314 $column_data{partnumber} =
1315 "<td align=$align>$ref->{partnumber} </a></td>";
1316 $column_data{description} = "<td>$ref->{description} </td>";
1317 $column_data{partsgroup} = "<td>$ref->{partsgroup} </td>";
1319 $column_data{onhand} =
1321 . $form->format_amount(\%myconfig, $ref->{onhand})
1323 $column_data{sellprice} =
1325 . $form->format_amount(\%myconfig, $ref->{sellprice})
1327 $column_data{listprice} =
1329 . $form->format_amount(\%myconfig, $ref->{listprice})
1331 $column_data{lastcost} =
1333 . $form->format_amount(\%myconfig, $ref->{lastcost})
1336 $column_data{linetotalsellprice} = "<td align=right>"
1337 . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2)
1339 $column_data{linetotallastcost} = "<td align=right>"
1340 . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2)
1342 $column_data{linetotallistprice} = "<td align=right>"
1343 . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2)
1346 if (!$ref->{assemblyitem}) {
1347 $totalsellprice += $onhand * $ref->{sellprice};
1348 $totallastcost += $onhand * $ref->{lastcost};
1349 $totallistprice += $onhand * $ref->{listprice};
1351 $subtotalonhand += $onhand;
1352 $subtotalsellprice += $onhand * $ref->{sellprice};
1353 $subtotallastcost += $onhand * $ref->{lastcost};
1354 $subtotallistprice += $onhand * $ref->{listprice};
1359 . $form->format_amount(\%myconfig, $ref->{rop}) . "</td>";
1360 $column_data{weight} =
1362 . $form->format_amount(\%myconfig, $ref->{weight})
1364 $column_data{unit} = "<td>$ref->{unit} </td>";
1365 $column_data{bin} = "<td>$ref->{bin} </td>";
1366 $column_data{priceupdate} = "<td>$ref->{priceupdate} </td>";
1368 $column_data{invnumber} =
1369 ($ref->{module} ne 'oe')
1370 ? "<td><a href=$ref->{module}.pl?action=edit&type=invoice&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{invnumber}</a></td>"
1371 : "<td>$ref->{invnumber}</td>";
1372 $column_data{ordnumber} =
1373 ($ref->{module} eq 'oe')
1374 ? "<td><a href=$ref->{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{ordnumber}</a></td>"
1375 : "<td>$ref->{ordnumber}</td>";
1376 $column_data{quonumber} =
1377 ($ref->{module} eq 'oe' && !$ref->{ordnumber})
1378 ? "<td><a href=$ref->{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{quonumber}</a></td>"
1379 : "<td>$ref->{quonumber}</td>";
1381 $column_data{name} = "<td>$ref->{name}</td>";
1383 $column_data{image} =
1385 ? "<td><a href=$ref->{image}><img src=$ref->{image} height=32 border=0></a></td>"
1386 : "<td> </td>";
1387 $column_data{drawing} =
1389 ? "<td><a href=$ref->{drawing}>$ref->{drawing}</a></td>"
1390 : "<td> </td>";
1391 $column_data{microfiche} =
1392 ($ref->{microfiche})
1393 ? "<td><a href=$ref->{microfiche}>$ref->{microfiche}</a></td>"
1394 : "<td> </td>";
1396 $column_data{serialnumber} = "<td>$ref->{serialnumber}</td>";
1398 $column_data{soldtotal} = "<td align=right>$ref->{soldtotal}</td>";
1402 print "<tr class=listrow$i>";
1404 map { print "\n$column_data{$_}" } @column_index;
1411 if ($form->{l_subtotal} eq 'Y') {
1415 if ($form->{"l_linetotal"}) {
1416 map { $column_data{$_} = "<td> </td>" } @column_index;
1417 $column_data{linetotalsellprice} =
1418 "<th class=listtotal align=right>"
1419 . $form->format_amount(\%myconfig, $totalsellprice, 2)
1421 $column_data{linetotallastcost} =
1422 "<th class=listtotal align=right>"
1423 . $form->format_amount(\%myconfig, $totallastcost, 2)
1425 $column_data{linetotallistprice} =
1426 "<th class=listtotal align=right>"
1427 . $form->format_amount(\%myconfig, $totallistprice, 2)
1430 print "<tr class=listtotal>";
1432 map { print "\n$column_data{$_}" } @column_index;
1439 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
1448 <form method=post action=$form->{script}>
1450 <input type=hidden name=path value=$form->{path}>
1451 <input type=hidden name=login value=$form->{login}>
1452 <input type=hidden name=password value=$form->{password}>
1454 <input type=hidden name=itemstatus value="$form->{itemstatus}">
1455 <input type=hidden name=l_linetotal value="$form->{l_linetotal}">
1456 <input type=hidden name=l_partnumber value="$form->{l_partnumber}">
1457 <input type=hidden name=l_description value="$form->{l_description}">
1458 <input type=hidden name=l_onhand value="$form->{l_onhand}">
1459 <input type=hidden name=l_unit value="$form->{l_unit}">
1460 <input type=hidden name=l_sellprice value="$form->{l_sellprice}">
1461 <input type=hidden name=l_linetotalsellprice value="$form->{l_linetotalsellprice}">
1462 <input type=hidden name=sort value="$form->{sort}">
1463 <input type=hidden name=revers value="$form->{revers}">
1464 <input type=hidden name=lastsort value="$form->{lastsort}">
1465 <input type=hidden name=parts value="$form->{parts}">
1467 <input type=hidden name=bom value="$form->{bom}">
1468 <input type=hidden name=titel value="$form->{titel}">
1469 <input type=hidden name=searchitems value="$form->{searchitems}">|;
1474 <input type=hidden name=ndxs_counter value="$form->{ndxs_counter}">
1476 <input class=submit type=submit name=action value="|
1477 . $locale->text('choice') . qq|">
1485 $lxdebug->leave_sub();
1488 sub generate_report {
1489 $lxdebug->enter_sub();
1491 $revers = $form->{revers};
1492 $lastsort = $form->{lastsort};
1494 if (($form->{lastsort} eq "") && ($form->{sort} eq undef)) {
1495 $form->{revers} = 0;
1496 $form->{lastsort} = "partnumber";
1497 $form->{sort} = "partnumber";
1500 # switch between backward sorting of tables
1501 if ($form->{lastsort} eq $form->{sort}) {
1502 if ($form->{revers} == 0) {
1503 $form->{revers} = 1;
1505 $form->{revers} = 0;
1508 $form->{revers} == 0;
1509 $form->{lastsort} = $form->{sort};
1514 "$form->{script}?action=generate_report&path=$form->{path}&login=$form->{login}&password=$form->{password}&searchitems=$form->{searchitems}&itemstatus=$form->{itemstatus}&bom=$form->{bom}&l_linetotal=$form->{l_linetotal}&title="
1515 . $form->escape($form->{title}, 1);
1517 # if we have a serialnumber limit search
1518 if ($form->{serialnumber} || $form->{l_serialnumber}) {
1519 $form->{l_serialnumber} = "Y";
1520 unless ( $form->{bought}
1523 || $form->{quoted}) {
1524 $form->{bought} = $form->{sold} = 1;
1528 IC->all_parts(\%myconfig, \%$form);
1530 if ($form->{itemstatus} eq 'active') {
1531 $option .= $locale->text('Active') . " : ";
1533 if ($form->{itemstatus} eq 'obsolete') {
1534 $option .= $locale->text('Obsolete') . " : ";
1536 if ($form->{itemstatus} eq 'orphaned') {
1537 $option .= $locale->text('Orphaned') . " : ";
1539 if ($form->{itemstatus} eq 'onhand') {
1540 $option .= $locale->text('On Hand') . " : ";
1541 $form->{l_onhand} = "Y";
1543 if ($form->{itemstatus} eq 'short') {
1544 $option .= $locale->text('Short') . " : ";
1545 $form->{l_onhand} = "Y";
1547 if ($form->{onorder}) {
1548 $form->{l_ordnumber} = "Y";
1549 $callback .= "&onorder=$form->{onorder}";
1550 $option .= $locale->text('On Order') . " : ";
1552 if ($form->{ordered}) {
1553 $form->{l_ordnumber} = "Y";
1554 $callback .= "&ordered=$form->{ordered}";
1555 $option .= $locale->text('Ordered') . " : ";
1558 $form->{l_quonumber} = "Y";
1559 $callback .= "&rfq=$form->{rfq}";
1560 $option .= $locale->text('RFQ') . " : ";
1562 if ($form->{quoted}) {
1563 $form->{l_quonumber} = "Y";
1564 $callback .= ""ed=$form->{quoted}";
1565 $option .= $locale->text('Quoted') . " : ";
1567 if ($form->{bought}) {
1568 $form->{l_invnumber} = "Y";
1569 $callback .= "&bought=$form->{bought}";
1570 $option .= $locale->text('Bought') . " : ";
1572 if ($form->{sold}) {
1573 $form->{l_invnumber} = "Y";
1574 $callback .= "&sold=$form->{sold}";
1575 $option .= $locale->text('Sold') . " : ";
1577 if ( $form->{bought}
1582 || $form->{quoted}) {
1584 $form->{l_lastcost} = "";
1585 $form->{l_name} = "Y";
1586 if ($form->{transdatefrom}) {
1587 $callback .= "&transdatefrom=$form->{transdatefrom}";
1589 . $locale->text('From')
1591 . $locale->date(\%myconfig, $form->{transdatefrom}, 1);
1593 if ($form->{transdateto}) {
1594 $callback .= "&transdateto=$form->{transdateto}";
1596 . $locale->text('To (time)')
1598 . $locale->date(\%myconfig, $form->{transdateto}, 1);
1604 if ($form->{partnumber}) {
1605 $callback .= "&partnumber=$form->{partnumber}";
1606 $option .= $locale->text('Part Number') . qq| : $form->{partnumber}<br>|;
1608 if ($form->{partsgroup}) {
1609 $callback .= "&partsgroup=$form->{partsgroup}";
1610 $option .= $locale->text('Group') . qq| : $form->{partsgroup}<br>|;
1612 if ($form->{serialnumber}) {
1613 $callback .= "&serialnumber=$form->{serialnumber}";
1615 $locale->text('Serial Number') . qq| : $form->{serialnumber}<br>|;
1617 if ($form->{description}) {
1618 $callback .= "&description=$form->{description}";
1619 $description = $form->{description};
1623 $locale->text('Part Description') . qq| : $form->{description}<br>|;
1625 if ($form->{make}) {
1626 $callback .= "&make=$form->{make}";
1627 $option .= $locale->text('Make') . qq| : $form->{make}<br>|;
1629 if ($form->{model}) {
1630 $callback .= "&model=$form->{model}";
1631 $option .= $locale->text('Model') . qq| : $form->{model}<br>|;
1633 if ($form->{drawing}) {
1634 $callback .= "&drawing=$form->{drawing}";
1635 $option .= $locale->text('Drawing') . qq| : $form->{drawing}<br>|;
1637 if ($form->{microfiche}) {
1638 $callback .= "µfiche=$form->{microfiche}";
1639 $option .= $locale->text('Microfiche') . qq| : $form->{microfiche}<br>|;
1642 # table soldtotal aktive
1643 if ($form->{l_soldtotal}) {
1644 $callback .= "&soldtotal=$form->{soldtotal}";
1645 $option .= $locale->text('soldtotal') . qq| : $form->{soldtotal}<br>|;
1648 if ($form->{l_deliverydate}) {
1649 $callback .= "&deliverydate=$form->{deliverydate}";
1652 @columns = $form->sort_columns(
1653 qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber name serialnumber soldtotal deliverydate)
1656 if ($form->{l_linetotal}) {
1657 $form->{l_onhand} = "Y";
1658 $form->{l_linetotalsellprice} = "Y" if $form->{l_sellprice};
1659 if ($form->{l_lastcost}) {
1660 $form->{l_linetotallastcost} = "Y";
1661 if (($form->{searchitems} eq 'assembly') && !$form->{bom}) {
1662 $form->{l_linetotallastcost} = "";
1665 $form->{l_linetotallistprice} = "Y" if $form->{l_listprice};
1668 if ($form->{searchitems} eq 'service') {
1670 # remove bin, weight and rop from list
1671 map { $form->{"l_$_"} = "" } qw(bin weight rop);
1673 $form->{l_onhand} = "";
1675 # qty is irrelevant unless bought or sold
1676 if ( $form->{bought}
1681 || $form->{quoted}) {
1682 $form->{l_onhand} = "Y";
1684 $form->{l_linetotalsellprice} = "";
1685 $form->{l_linetotallastcost} = "";
1689 $form->{l_lastcost} = ""
1690 if ($form->{searchitems} eq 'assembly' && !$form->{bom});
1692 foreach $item (@columns) {
1693 if ($form->{"l_$item"} eq "Y") {
1694 push @column_index, $item;
1696 # add column to callback
1697 $callback .= "&l_$item=Y";
1701 if ($form->{l_subtotal} eq 'Y') {
1702 $callback .= "&l_subtotal=Y";
1704 $column_header{partnumber} =
1705 qq|<th nowrap><a class=listheading href=$callback&sort=partnumber&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1706 . $locale->text('Part Number')
1708 $column_header{description} =
1709 qq|<th nowrap><a class=listheading href=$callback&sort=description&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1710 . $locale->text('Part Description')
1712 $column_header{partsgroup} =
1713 qq|<th nowrap><a class=listheading href=$callback&sort=partsgroup>|
1714 . $locale->text('Group')
1716 $column_header{bin} =
1717 qq|<th><a class=listheading href=$callback&sort=bin>|
1718 . $locale->text('Bin')
1720 $column_header{priceupdate} =
1721 qq|<th nowrap><a class=listheading href=$callback&sort=priceupdate>|
1722 . $locale->text('Updated')
1724 $column_header{onhand} =
1725 qq|<th nowrap><a class=listheading href=$callback&sort=onhand&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1726 . $locale->text('Qty')
1728 $column_header{unit} =
1729 qq|<th class=listheading nowrap>| . $locale->text('Unit') . qq|</th>|;
1730 $column_header{listprice} =
1731 qq|<th class=listheading nowrap>|
1732 . $locale->text('List Price')
1734 $column_header{lastcost} =
1735 qq|<th class=listheading nowrap>| . $locale->text('Last Cost') . qq|</th>|;
1736 $column_header{rop} =
1737 qq|<th class=listheading nowrap>| . $locale->text('ROP') . qq|</th>|;
1738 $column_header{weight} =
1739 qq|<th class=listheading nowrap>| . $locale->text('Weight') . qq|</th>|;
1741 $column_header{invnumber} =
1742 qq|<th nowrap><a class=listheading href=$callback&sort=invnumber>|
1743 . $locale->text('Invoice Number')
1745 $column_header{ordnumber} =
1746 qq|<th nowrap><a class=listheading href=$callback&sort=ordnumber>|
1747 . $locale->text('Order Number')
1749 $column_header{quonumber} =
1750 qq|<th nowrap><a class=listheading href=$callback&sort=quonumber>|
1751 . $locale->text('Quotation')
1754 $column_header{name} =
1755 qq|<th nowrap><a class=listheading href=$callback&sort=name>|
1756 . $locale->text('Name')
1759 $column_header{sellprice} =
1760 qq|<th class=listheading nowrap>|
1761 . $locale->text('Sell Price')
1763 $column_header{linetotalsellprice} =
1764 qq|<th class=listheading nowrap>| . $locale->text('Extended') . qq|</th>|;
1765 $column_header{linetotallastcost} =
1766 qq|<th class=listheading nowrap>| . $locale->text('Extended') . qq|</th>|;
1767 $column_header{linetotallistprice} =
1768 qq|<th class=listheading nowrap>| . $locale->text('Extended') . qq|</th>|;
1770 $column_header{image} =
1771 qq|<th class=listheading nowrap>| . $locale->text('Image') . qq|</a></th>|;
1772 $column_header{drawing} =
1773 qq|<th nowrap><a class=listheading href=$callback&sort=drawing>|
1774 . $locale->text('Drawing')
1776 $column_header{microfiche} =
1777 qq|<th nowrap><a class=listheading href=$callback&sort=microfiche>|
1778 . $locale->text('Microfiche')
1781 $column_header{serialnumber} =
1782 qq|<th nowrap><a class=listheading href=$callback&sort=serialnumber>|
1783 . $locale->text('Serial Number')
1785 $column_header{soldtotal} =
1786 qq|<th nowrap><a class=listheading href=$callback&sort=soldtotal&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1787 . $locale->text('soldtotal')
1790 $column_header{deliverydate} =
1791 qq|<th nowrap><a class=listheading href=$callback&sort=deliverydate&revers=$form->{revers}&lastsort=$form->{lastsort}>|
1792 . $locale->text('deliverydate')
1796 $colspan = $#column_index + 1;
1803 <th class=listtop colspan=$colspan>$form->{title}</th>
1805 <tr height="5"></tr>
1807 <tr><td colspan=$colspan>$option</td></tr>
1809 <tr class=listheading>
1812 map { print "\n$column_header{$_}" } @column_index;
1818 # add order to callback
1819 $form->{callback} = $callback .= "&sort=$form->{sort}";
1821 # escape callback for href
1822 $callback = $form->escape($callback);
1824 if (@{ $form->{parts} }) {
1825 $sameitem = $form->{parts}->[0]->{ $form->{sort} };
1828 foreach $ref (@{ $form->{parts} }) {
1830 if ($form->{l_subtotal} eq 'Y' && !$ref->{assemblyitem}) {
1831 if ($sameitem ne $ref->{ $form->{sort} }) {
1833 $sameitem = $ref->{ $form->{sort} };
1837 $ref->{exchangerate} = 1 unless $ref->{exchangerate};
1838 $ref->{sellprice} *= $ref->{exchangerate};
1839 $ref->{listprice} *= $ref->{exchangerate};
1840 $ref->{lastcost} *= $ref->{exchangerate};
1842 # use this for assemblies
1843 $onhand = $ref->{onhand};
1846 if ($ref->{assemblyitem}) {
1848 $onhand = 0 if ($form->{sold});
1851 $ref->{description} =~ s/
1854 $column_data{partnumber} =
1855 "<td align=$align><a href=$form->{script}?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{partnumber} </a></td>";
1856 $column_data{description} = "<td><a href=$form->{script}?action=edit&id=$ref->{id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{description} </a></td>";
1857 $column_data{partsgroup} = "<td>$ref->{partsgroup} </td>";
1859 $column_data{onhand} =
1861 . $form->format_amount(\%myconfig, $ref->{onhand})
1863 $column_data{sellprice} =
1865 . $form->format_amount(\%myconfig, $ref->{sellprice}, -2)
1867 $column_data{listprice} =
1869 . $form->format_amount(\%myconfig, $ref->{listprice}, -2)
1871 $column_data{lastcost} =
1873 . $form->format_amount(\%myconfig, $ref->{lastcost}, -2)
1876 $column_data{linetotalsellprice} = "<td align=right>"
1877 . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2)
1879 $column_data{linetotallastcost} = "<td align=right>"
1880 . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2)
1882 $column_data{linetotallistprice} = "<td align=right>"
1883 . $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2)
1886 if (!$ref->{assemblyitem}) {
1887 $totalsellprice += $onhand * $ref->{sellprice};
1888 $totallastcost += $onhand * $ref->{lastcost};
1889 $totallistprice += $onhand * $ref->{listprice};
1891 $subtotalonhand += $onhand;
1892 $subtotalsellprice += $onhand * $ref->{sellprice};
1893 $subtotallastcost += $onhand * $ref->{lastcost};
1894 $subtotallistprice += $onhand * $ref->{listprice};
1899 . $form->format_amount(\%myconfig, $ref->{rop}) . "</td>";
1900 $column_data{weight} =
1902 . $form->format_amount(\%myconfig, $ref->{weight})
1904 $column_data{unit} = "<td>$ref->{unit} </td>";
1905 $column_data{bin} = "<td>$ref->{bin} </td>";
1906 $column_data{priceupdate} = "<td>$ref->{priceupdate} </td>";
1908 $column_data{invnumber} =
1909 ($ref->{module} ne 'oe')
1910 ? "<td><a href=$ref->{module}.pl?action=edit&type=invoice&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{invnumber}</a></td>"
1911 : "<td>$ref->{invnumber}</td>";
1912 $column_data{ordnumber} =
1913 ($ref->{module} eq 'oe')
1914 ? "<td><a href=$ref->{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{ordnumber}</a></td>"
1915 : "<td>$ref->{ordnumber}</td>";
1916 $column_data{quonumber} =
1917 ($ref->{module} eq 'oe' && !$ref->{ordnumber})
1918 ? "<td><a href=$ref->{module}.pl?action=edit&type=$ref->{type}&id=$ref->{trans_id}&path=$form->{path}&login=$form->{login}&password=$form->{password}&callback=$callback>$ref->{quonumber}</a></td>"
1919 : "<td>$ref->{quonumber}</td>";
1921 $column_data{name} = "<td>$ref->{name}</td>";
1923 $column_data{image} =
1925 ? "<td><a href=$ref->{image}><img src=$ref->{image} height=32 border=0></a></td>"
1926 : "<td> </td>";
1927 $column_data{drawing} =
1929 ? "<td><a href=$ref->{drawing}>$ref->{drawing}</a></td>"
1930 : "<td> </td>";
1931 $column_data{microfiche} =
1932 ($ref->{microfiche})
1933 ? "<td><a href=$ref->{microfiche}>$ref->{microfiche}</a></td>"
1934 : "<td> </td>";
1936 $column_data{serialnumber} = "<td>$ref->{serialnumber}</td>";
1938 $column_data{soldtotal} =
1940 . $form->format_amount(\%myconfig, $ref->{soldtotal})
1943 $column_data{deliverydate} = "<td>$ref->{deliverydate}</td>";
1947 print "<tr class=listrow$i>";
1949 map { print "\n$column_data{$_}" } @column_index;
1957 if ($form->{l_subtotal} eq 'Y') {
1961 if ($form->{"l_linetotal"}) {
1962 map { $column_data{$_} = "<td> </td>" } @column_index;
1963 $column_data{linetotalsellprice} =
1964 "<th class=listtotal align=right>"
1965 . $form->format_amount(\%myconfig, $totalsellprice, 2)
1967 $column_data{linetotallastcost} =
1968 "<th class=listtotal align=right>"
1969 . $form->format_amount(\%myconfig, $totallastcost, 2)
1971 $column_data{linetotallistprice} =
1972 "<th class=listtotal align=right>"
1973 . $form->format_amount(\%myconfig, $totallistprice, 2)
1976 print "<tr class=listtotal>";
1978 map { print "\n$column_data{$_}" } @column_index;
1985 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
1994 <form method=post action=$form->{script}>
1996 <input name=callback type=hidden value="$form->{callback}">
1998 <input type=hidden name=item value=$form->{searchitems}>
2000 <input type=hidden name=path value=$form->{path}>
2001 <input type=hidden name=login value=$form->{login}>
2002 <input type=hidden name=password value=$form->{password}>|;
2005 <input class=submit type=submit name=action value="|
2006 . $locale->text('Add') . qq|">
2014 $lxdebug->leave_sub();
2015 } #end generate_report
2017 sub parts_subtotal {
2018 $lxdebug->enter_sub();
2020 map { $column_data{$_} = "<td> </td>" } @column_index;
2021 $subtotalonhand = 0 if ($form->{searchitems} eq 'assembly' && $form->{bom});
2023 $column_data{onhand} =
2024 "<th class=listsubtotal align=right>"
2025 . $form->format_amount(\%myconfig, $subtotalonhand)
2028 $column_data{linetotalsellprice} =
2029 "<th class=listsubtotal align=right>"
2030 . $form->format_amount(\%myconfig, $subtotalsellprice, 2)
2032 $column_data{linetotallistprice} =
2033 "<th class=listsubtotal align=right>"
2034 . $form->format_amount(\%myconfig, $subtotallistprice, 2)
2036 $column_data{linetotallastcost} =
2037 "<th class=listsubtotal align=right>"
2038 . $form->format_amount(\%myconfig, $subtotallastcost, 2)
2041 $subtotalonhand = 0;
2042 $subtotalsellprice = 0;
2043 $subtotallistprice = 0;
2044 $subtotallastcost = 0;
2046 print "<tr class=listsubtotal>";
2048 map { print "\n$column_data{$_}" } @column_index;
2054 $lxdebug->leave_sub();
2058 $lxdebug->enter_sub();
2060 IC->get_part(\%myconfig, \%$form);
2062 $form->{"original_partnumber"} = $form->{"partnumber"};
2064 $form->{title} = $locale->text('Edit ' . ucfirst $form->{item});
2069 $lxdebug->leave_sub();
2073 $lxdebug->enter_sub();
2075 IC->create_links("IC", \%myconfig, \%$form);
2078 map({ $form->{selectcurrency} .= "<option>$_\n" }
2079 split(/:/, $form->{currencies}));
2081 # parts and assemblies have the same links
2082 $item = $form->{item};
2083 if ($form->{item} eq 'assembly') {
2087 # build the popup menus
2088 $form->{taxaccounts} = "";
2089 foreach $key (keys %{ $form->{IC_links} }) {
2090 foreach $ref (@{ $form->{IC_links}{$key} }) {
2092 # if this is a tax field
2093 if ($key =~ /IC_tax/) {
2094 if ($key =~ /$item/) {
2095 $form->{taxaccounts} .= "$ref->{accno} ";
2096 $form->{"IC_tax_$ref->{accno}_description"} =
2097 "$ref->{accno}--$ref->{description}";
2100 if ($form->{amount}{ $ref->{accno} }) {
2101 $form->{"IC_tax_$ref->{accno}"} = "checked";
2104 $form->{"IC_tax_$ref->{accno}"} = "checked";
2109 $form->{"select$key"} .=
2110 "<option $ref->{selected}>$ref->{accno}--$ref->{description}\n";
2111 if ($form->{amount}{$key} eq $ref->{accno}) {
2112 $form->{$key} = "$ref->{accno}--$ref->{description}";
2118 chop $form->{taxaccounts};
2120 if (($form->{item} eq "part") || ($form->{item} eq "assembly")) {
2121 $form->{selectIC_income} = $form->{selectIC_sale};
2122 $form->{selectIC_expense} = $form->{selectIC_cogs};
2123 $form->{IC_income} = $form->{IC_sale};
2124 $form->{IC_expense} = $form->{IC_cogs};
2127 delete $form->{IC_links};
2128 delete $form->{amount};
2130 $form->get_partsgroup(\%myconfig, { all => 1 });
2132 $form->{partsgroup} = "$form->{partsgroup}--$form->{partsgroup_id}";
2134 if (@{ $form->{all_partsgroup} }) {
2135 $form->{selectpartsgroup} = qq|<option>\n|;
2137 $form->{selectpartsgroup} .=
2138 qq|<option value="$_->{partsgroup}--$_->{id}">$_->{partsgroup}\n|
2139 } @{ $form->{all_partsgroup} };
2142 if ($form->{item} eq 'assembly') {
2144 foreach $i (1 .. $form->{assembly_rows}) {
2145 if ($form->{"partsgroup_id_$i"}) {
2146 $form->{"partsgroup_$i"} =
2147 qq|$form->{"partsgroup_$i"}--$form->{"partsgroup_id_$i"}|;
2150 $form->get_partsgroup(\%myconfig);
2152 if (@{ $form->{all_partsgroup} }) {
2153 $form->{selectassemblypartsgroup} = qq|<option>\n|;
2156 $form->{selectassemblypartsgroup} .=
2157 qq|<option value="$_->{partsgroup}--$_->{id}">$_->{partsgroup}\n|
2158 } @{ $form->{all_partsgroup} };
2161 $lxdebug->leave_sub();
2165 $lxdebug->enter_sub();
2167 map({ $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, -2) }
2168 qw(sellprice listprice lastcost gv));
2170 map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}) }
2171 qw(weight rop stock);
2173 foreach $item (qw(partnumber description unit notes)) {
2174 $form->{$item} =~ s/\"/"/g;
2177 $payment = qq|<option value=""></option>|;
2178 foreach $item (@{ $form->{payment_terms} }) {
2179 if ($form->{payment_id} eq $item->{id}) {
2180 $payment .= qq|<option value="$item->{id}" selected>$item->{description}</option>|;
2182 $payment .= qq|<option value="$item->{id}">$item->{description}</option>|;
2187 if (($rows = $form->numtextrows($form->{notes}, 40)) < 2) {
2192 qq|<textarea name=notes rows=$rows cols=45 wrap=soft>$form->{notes}</textarea>|;
2193 if (($rows = $form->numtextrows($form->{description}, 40)) > 1) {
2195 qq|<textarea name="description" rows=$rows cols=40 wrap=soft>$form->{description}</textarea>|;
2198 qq|<input name=description size=40 value="$form->{description}">|;
2201 $ean = qq|<input name=ean size=40 value="$form->{ean}">|;
2203 foreach $item (split / /, $form->{taxaccounts}) {
2204 $form->{"IC_tax_$item"} = ($form->{"IC_tax_$item"}) ? "checked" : "";
2207 IC->retrieve_buchungsgruppen(\%myconfig, $form);
2208 if (@{ $form->{BUCHUNGSGRUPPEN} }) {
2209 foreach $item (@{ $form->{BUCHUNGSGRUPPEN} }) {
2210 if ($item->{id} == $form->{buchungsgruppen_id}) {
2211 $form->{selectbuchungsgruppe} .=
2212 "<option value=$item->{id} selected>$item->{description}\n";
2213 } elsif (($form->{id} && $form->{orphaned}) || (!$form->{id})) {
2214 $form->{selectbuchungsgruppe} .=
2215 "<option value=$item->{id}>$item->{description}\n";
2221 $buchungsgruppe = qq|
2223 <th align=right>| . $locale->text('Buchungsgruppe') . qq|</th>
2224 <td><select name=buchungsgruppen_id>$form->{selectbuchungsgruppe}</select></td>
2229 foreach $item (qw(IC IC_income IC_expense)) {
2230 if ($form->{$item}) {
2231 if ($form->{id} && $form->{orphaned}) {
2232 $form->{"select$item"} =~ s/ selected//;
2233 $form->{"select$item"} =~
2234 s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
2236 $form->{"select$item"} = qq|<option selected>$form->{$item}|;
2241 if ($form->{selectpartsgroup}) {
2242 $form->{selectpartsgroup} = $form->unescape($form->{selectpartsgroup});
2244 qq|<input type=hidden name=selectpartsgroup value="|
2245 . $form->escape($form->{selectpartsgroup}, 1) . qq|">|;
2246 $form->{selectpartsgroup} =~
2247 s/(<option value="\Q$form->{partsgroup}\E")/$1 selected/;
2250 qq|<select name=partsgroup>$form->{selectpartsgroup}</select>|;
2251 $group = $locale->text('Group');
2255 foreach $item (split / /, $form->{taxaccounts}) {
2257 <input class=checkbox type=checkbox name="IC_tax_$item" value=1 $form->{"IC_tax_$item"}> <b>$form->{"IC_tax_${item}_description"}</b>
2258 <br><input type=hidden name=IC_tax_${item}_description value="$form->{"IC_tax_${item}_description"}">
2262 $form->{obsolete} = "checked" if $form->{obsolete};
2266 <th align="right" nowrap="true">|
2267 . $locale->text('Last Cost') . qq|</th>
2268 <td><input name=lastcost size=11 value=$form->{lastcost}></td>
2274 <th align=right>| . $locale->text('Inventory') . qq|</th>
2275 <td><select name=IC>$form->{selectIC}</select></td>
2276 <input name=selectIC type=hidden value="$form->{selectIC}">
2280 if ($form->{item} eq "part") {
2282 $linkaccounts .= qq|
2284 <th align=right>| . $locale->text('Revenue') . qq|</th>
2285 <td><select name=IC_income>$form->{selectIC_income}</select></td>
2286 <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
2289 <th align=right>| . $locale->text('Expense') . qq|</th>
2290 <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
2291 <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
2297 <th align="right" nowrap="true">| . $locale->text('Weight') . qq|</th>
2302 <input name=weight size=10 value=$form->{weight}>
2312 if ($form->{item} eq "assembly") {
2318 <th align=right>| . $locale->text('Revenue') . qq|</th>
2319 <td><select name=IC_income>$form->{selectIC_income}</select></td>
2320 <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
2326 <th align="right" nowrap="true">| . $locale->text('Weight') . qq|</th>
2331 $form->{weight}
2332 <input type=hidden name=weight value=$form->{weight}>
2342 if ($form->{item} eq "service") {
2346 <th align=right>| . $locale->text('Revenue') . qq|</th>
2347 <td><select name=IC_income>$form->{selectIC_income}</select></td>
2348 <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
2351 <th align=right>| . $locale->text('Expense') . qq|</th>
2352 <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
2353 <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
2358 $linkaccounts = qq|<input type=hidden name=IC_income value="$form->{IC_income_default}">|;
2360 if ($form->{IC_cogs_default}) {
2361 $form->{IC_expense_default} = $form->{IC_cogs_default};
2364 if (($form->{item} eq "service") || ($form->{item} eq "part")) {
2365 $linkaccounts .= qq|<input type=hidden name=IC_expense value="$form->{IC_expense_default}">|;
2367 if ($form->{item} eq "part") {
2368 $linkaccounts .= qq|<input type=hidden name=IC value="$form->{IC_default}">|;
2371 if ($form->{item} ne 'service') {
2372 $n = ($form->{onhand} > 0) ? "1" : "0";
2375 <th align="right" nowrap>| . $locale->text('On Hand') . qq|</th>
2376 <th align=left nowrap class="plus$n"> |
2377 . $form->format_amount(\%myconfig, $form->{onhand}) . qq|</th>
2381 if ($form->{item} eq 'assembly') {
2384 <th align="right" nowrap>| . $locale->text('Stock') . qq|</th>
2385 <td><input name=stock size=10 value=$form->{stock}></td>
2392 <th align="right" nowrap="true">| . $locale->text('ROP') . qq|</th>
2393 <td><input name=rop size=10 value=$form->{rop}></td>
2399 <th align="right" nowrap="true">| . $locale->text('Bin') . qq|</th>
2400 <td><input name=bin size=10 value=$form->{bin}></td>
2405 <th align="right" nowrap="true">|
2406 . $locale->text('Verrechnungseinheit') . qq|</th>
2407 <td><input name=ve size=10 value=$form->{ve}></td>
2410 <th align="right" nowrap="true">|
2411 . $locale->text('Geschäftsvolumen') . qq|</th>
2412 <td><input name=gv size=10 value=$form->{gv}></td>
2415 $notdiscountableok = ($form->{not_discountable}) == 1 ? "checked" : "";
2416 $notdiscountable .= qq|
2418 <th align=right nowrap>|
2419 . $locale->text('Not Discountable') . qq|</th>
2420 <td><input class=checkbox type=checkbox name=not_discountable value=1 $notdiscountableok></td>
2425 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>|;
2431 <th align=right nowrap>| . $locale->text('Image') . qq|</th>
2432 <td><input name=image size=40 value="$form->{image}"></td>
2433 <th align=right nowrap>| . $locale->text('Microfiche') . qq|</th>
2434 <td><input name=microfiche size=20 value="$form->{microfiche}"></td>
2437 <th align=right nowrap>| . $locale->text('Drawing') . qq|</th>
2438 <td><input name=drawing size=40 value="$form->{drawing}"></td>
2450 <th align="right" nowrap="true">| . $locale->text('Obsolete') . qq|</th>
2451 <td><input name=obsolete type=checkbox class=checkbox value=1 $form->{obsolete}></td>
2455 $shopok = $form->{shop} == 1 ? "checked" : "";
2458 <th align=right nowrap>|
2459 . $locale->text('Shopartikel') . qq|</th>
2460 <td><input class=checkbox type=checkbox name=shop value=1 $shopok></td>
2465 # type=submit $locale->text('Add Part')
2466 # type=submit $locale->text('Add Service')
2467 # type=submit $locale->text('Add Assembly')
2469 # type=submit $locale->text('Edit Part')
2470 # type=submit $locale->text('Edit Service')
2471 # type=submit $locale->text('Edit Assembly')
2472 # use JavaScript Calendar or not
2473 $form->{jsscript} = $jscalendar;
2475 if ($form->{jsscript}) {
2477 # with JavaScript Calendar
2479 <td width="13"><input name=priceupdate id=priceupdate size=11 title="$myconfig{dateformat}" value="$form->{priceupdate}"></td>
2480 <td width="4" align="left"><input type=button name=priceupdate id="trigger1" value=|
2481 . $locale->text('button') . qq|></td>
2486 Form->write_trigger(\%myconfig, "1", "priceupdate", "BL", "trigger1");
2489 # without JavaScript Calendar
2491 <td><input name=transdatefrom id=transdatefrom size=11 title="$myconfig{dateformat}"></td>|;
2494 my $unit_select = '<input type="hidden" name="unit_changeable" value="' . $form->{"unit_changeable"} . '">';
2495 if (!$form->{"unit_changeable"}) {
2496 $unit_select .= '<input type="hidden" name="unit" value="' . $form->{"unit"} . '">' . $form->{"unit"};
2498 my $units = AM->retrieve_units(\%myconfig, $form, $form->{"item"} eq "service" ? "service" : "dimension");
2499 $unit_select .= AM->unit_select_html($units, "unit", $form->{"unit"});
2502 $form->{fokus} = "ic.partnumber";
2506 <body onLoad="fokus()">
2507 <script type="text/javascript" src="js/common.js"></script>
2508 <script type="text/javascript" src="js/parts_language_selection.js"></script>
2510 <form method=post name="ic" action=$form->{script}>
2512 <input name=id type=hidden value=$form->{id}>
2513 <input name=item type=hidden value=$form->{item}>
2514 <input name=title type=hidden value="$form->{title}">
2515 <input name=makemodel type=hidden value="$form->{makemodel}">
2516 <input name=alternate type=hidden value="$form->{alternate}">
2517 <input name=onhand type=hidden value=$form->{onhand}>
2518 <input name=orphaned type=hidden value=$form->{orphaned}>
2519 <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
2520 <input name=rowcount type=hidden value=$form->{rowcount}>
2521 <input name=eur type=hidden value=$eur>
2522 <input name=language_values type=hidden value="$form->{language_values}">
2523 <input name="original_partnumber" type="hidden" value="| . $form->quote($form->{"original_partnumber"}) . qq|">
2525 <table width="100%">
2527 <th class=listtop>$form->{title}</th>
2529 <tr height="5"></tr>
2532 <table width="100%">
2534 <th align=left>| . $locale->text('Part Number') . qq|</th>
2535 <th align=left>| . $locale->text('Part Description') . qq|</th>
2536 <th align=left>$group</th>
2539 <td><input name=partnumber value="$form->{partnumber}" size=20></td>
2540 <td>$description</td>
2541 <td>$partsgroup</td>
2542 <input type=hidden name=oldpartsgroup value="$form->{oldpartsgroup}">
2549 <table width="100%" height="100%">
2552 <table width="100%" height="100%">
2553 <tr class="listheading">
2554 <th class="listheading" align="center" colspan=2>|
2555 . $locale->text('') . qq|</th>
2564 <th align="left">| . $locale->text('Notes') . qq|</th>
2565 <th align="left">| . $locale->text('Formula') . qq|</th>
2576 <th align="left"></th>
2577 <th align="left">| . $locale->text('EAN-Code') . qq|</th>
2581 <button type="button" onclick="parts_language_selection_window('language_values')">| . $locale->text('Set Language Values') . qq|</button>
2591 <th align=right>| . $locale->text('Payment Terms') . qq|</th>
2592 <td><select name=payment_id>$payment</select></td>
2600 <table width="100%">
2602 <th align="right" nowrap="true">|
2603 . $locale->text('Updated') . qq|</th>
2607 <th align="right" nowrap="true">| . $locale->text('List Price') . qq|</th>
2608 <td><input name=listprice size=11 value=$form->{listprice}></td>
2611 <th align="right" nowrap="true">| . $locale->text('Sell Price') . qq|</th>
2612 <td><input name=sellprice size=11 value=$form->{sellprice}></td>
2616 <th align="right" nowrap="true">| . $locale->text('Unit') . qq|</th>
2617 <td>$unit_select</td>
2636 $lxdebug->leave_sub();
2640 $lxdebug->enter_sub();
2642 if ($form->{item} eq "assembly") {
2647 <table width="100%">
2649 <th colspan=2 align=right>|
2650 . $locale->text('Total') . qq| </th>
2652 . $form->format_amount(\%myconfig, $form->{assemblytotal}, 2) . qq|</th>
2657 <input type=hidden name=assembly_rows value=$form->{assembly_rows}>
2662 <input type=hidden name=path value=$form->{path}>
2663 <input type=hidden name=login value=$form->{login}>
2664 <input type=hidden name=password value=$form->{password}>
2665 <input type=hidden name=callback value="$form->{callback}">
2666 <input type=hidden name=previousform value="$form->{previousform}">
2667 <input type=hidden name=taxaccount2 value="$form->{taxaccount2}">
2668 <input type=hidden name=vc value=$form->{vc}>
2670 <td><hr size=3 noshade></td>
2675 <input class=submit type=submit name=action value="|
2676 . $locale->text('Update') . qq|">
2679 unless ($form->{item} eq "service") {
2681 <input type=hidden name=makemodel_rows value=$form->{makemodel_rows}>
2686 <input type=hidden name=price_rows value=$form->{price_rows}>|;
2689 <input class=submit type=submit name=action value="|
2690 . $locale->text('Save') . qq|">|;
2694 if (!$form->{previousform}) {
2696 <input class=submit type=submit name=action value="|
2697 . $locale->text('Save as new') . qq|">|;
2700 if ($form->{orphaned}) {
2701 if (!$form->{previousform}) {
2702 if ($form->{item} eq 'assembly') {
2703 if (!$form->{onhand}) {
2705 <input class=submit type=submit name=action value="|
2706 . $locale->text('Delete') . qq|">|;
2710 <input class=submit type=submit name=action value="|
2711 . $locale->text('Delete') . qq|">|;
2720 <script type="text/javascript" src="js/wz_tooltip.js"></script>
2726 $lxdebug->leave_sub();
2730 $lxdebug->enter_sub();
2733 $form->{"make_$i"} =~ s/\"/"/g;
2734 $form->{"model_$i"} =~ s/\"/"/g;
2741 <th class="listheading">| . $locale->text('Make') . qq|</th>
2742 <th class="listheading">| . $locale->text('Model') . qq|</th>
2746 for $i (1 .. $numrows) {
2749 <td width=50%><input name="make_$i" size=30 value="$form->{"make_$i"}"></td>
2750 <td width=50%><input name="model_$i" size=30 value="$form->{"model_$i"}"></td>
2761 $lxdebug->leave_sub();
2765 $lxdebug->enter_sub();
2769 qw(runningnumber qty unit bom partnumber description partsgroup total);
2771 if ($form->{previousform}) {
2773 @column_index = qw(qty unit bom partnumber description partsgroup total);
2777 $form->{old_callback} = $form->{callback};
2778 $callback = $form->{callback};
2779 $form->{callback} = "$form->{script}?action=display_form";
2782 map { delete $form->{$_} } qw(action header);
2786 # save form variables in a previousform variable
2787 foreach $key (sort keys %$form) {
2790 $form->{$key} =~ s/&/%26/g;
2791 $previousform .= qq|$key=$form->{$key}&|;
2794 $previousform = $form->escape($form->escape($previousform, 1));
2795 $form->{callback} = $callback;
2797 $form->{assemblytotal} = 0;
2798 $form->{weight} = 0;
2801 $column_header{runningnumber} =
2802 qq|<th nowrap width=5%>| . $locale->text('No.') . qq|</th>|;
2803 $column_header{qty} =
2804 qq|<th align=left nowrap width=10%>| . $locale->text('Qty') . qq|</th>|;
2805 $column_header{unit} =
2806 qq|<th align=left nowrap width=5%>| . $locale->text('Unit') . qq|</th>|;
2807 $column_header{partnumber} =
2808 qq|<th align=left nowrap width=20%>|
2809 . $locale->text('Part Number')
2811 $column_header{description} =
2812 qq|<th nowrap width=50%>| . $locale->text('Part Description') . qq|</th>|;
2813 $column_header{total} =
2814 qq|<th align=right nowrap>| . $locale->text('Extended') . qq|</th>|;
2815 $column_header{bom} = qq|<th>| . $locale->text('BOM') . qq|</th>|;
2816 $column_header{partsgroup} = qq|<th>| . $locale->text('Group') . qq|</th>|;
2819 <tr class=listheading>
2820 <th class=listheading>| . $locale->text('Individual Items') . qq|</th>
2828 map { print "\n$column_header{$_}" } @column_index;
2834 for $i (1 .. $numrows) {
2835 $form->{"partnumber_$i"} =~ s/\"/"/g;
2838 $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2);
2839 $form->{assemblytotal} += $linetotal;
2841 $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
2843 $linetotal = $form->format_amount(\%myconfig, $linetotal, 2);
2845 if (($i >= 1) && ($i == $numrows)) {
2848 map { $column_data{$_} = qq|<td></td>| }
2849 qw(qty unit partnumber description bom partsgroup);
2852 map { $column_data{$_} = qq|<td></td>| } qw(runningnumber unit bom);
2855 qq|<td><input name="qty_$i" size=5 value="$form->{"qty_$i"}"></td>|;
2856 $column_data{partnumber} =
2857 qq|<td><input name="partnumber_$i" size=15 value="$form->{"partnumber_$i"}"></td>|;
2858 $column_data{description} =
2859 qq|<td><input name="description_$i" size=40 value="$form->{"description_$i"}"></td>|;
2860 $column_data{partsgroup} =
2861 qq|<td><input name="partsgroup_$i" size=10 value="$form->{"partsgroup_$i"}"></td>|;
2867 if ($form->{previousform}) {
2868 $column_data{partnumber} =
2869 qq|<td><input type=hidden name="partnumber_$i" value="$form->{"partnumber_$i"}">$form->{"partnumber_$i"}</td>|;
2871 qq|<td align=right><input type=hidden name="qty_$i" value="$form->{"qty_$i"}">$form->{"qty_$i"}</td>|;
2874 qq|<td align=center><input type=hidden name="bom_$i" value=$form->{"bom_$i"}>|;
2875 $column_data{bom} .= ($form->{"bom_$i"}) ? "x" : " ";
2876 $column_data{bom} .= qq|</td>|;
2878 $column_data{partsgroup} =
2879 qq|<td><input type=hidden name="partsgroup_$i" value="$form->{"partsgroup_$i"}">$form->{"partsgroup_$i"}</td>|;
2883 qq|$form->{script}?action=edit&id=$form->{"id_$i"}&path=$form->{path}&login=$form->{login}&password=$form->{password}&rowcount=$i&previousform=$previousform|;
2884 $column_data{partnumber} =
2885 qq|<td><input type=hidden name="partnumber_$i" value="$form->{"partnumber_$i"}"><a href=$href>$form->{"partnumber_$i"}</a></td>|;
2886 $column_data{runningnumber} =
2887 qq|<td><input name="runningnumber_$i" size=3 value="$i"></td>|;
2889 qq|<td><input name="qty_$i" size=5 value="$form->{"qty_$i"}"></td>|;
2891 $form->{"bom_$i"} = ($form->{"bom_$i"}) ? "checked" : "";
2893 qq|<td align=center><input name="bom_$i" type=checkbox class=checkbox value=1 $form->{"bom_$i"}></td>|;
2895 $column_data{partsgroup} =
2896 qq|<td><input type=hidden name="partsgroup_$i" value="$form->{"partsgroup_$i"}">$form->{"partsgroup_$i"}</td>|;
2899 $column_data{unit} =
2900 qq|<td><input type=hidden name="unit_$i" value="$form->{"unit_$i"}">$form->{"unit_$i"}</td>|;
2901 $column_data{description} =
2902 qq|<td><input type=hidden name="description_$i" value="$form->{"description_$i"}">$form->{"description_$i"}</td>|;
2905 $column_data{total} = qq|<td align=right>$linetotal</td>|;
2907 $column_data{deliverydate} = qq|<td align=right>$deliverydate</td>|;
2912 map { print "\n$column_data{$_}" } @column_index;
2916 <input type=hidden name="id_$i" value=$form->{"id_$i"}>
2917 <input type=hidden name="sellprice_$i" value=$form->{"sellprice_$i"}>
2918 <input type=hidden name="weight_$i" value=$form->{"weight_$i"}>
2928 $lxdebug->leave_sub();
2932 $lxdebug->enter_sub();
2934 if ($form->{item} eq "assembly") {
2935 $i = $form->{assembly_rows};
2937 # if last row is empty check the form otherwise retrieve item
2938 if ( ($form->{"partnumber_$i"} eq "")
2939 && ($form->{"description_$i"} eq "")
2940 && ($form->{"partsgroup_$i"} eq "")) {
2946 IC->assembly_item(\%myconfig, \%$form);
2948 $rows = scalar @{ $form->{item_list} };
2951 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
2954 $form->{makemodel_rows}--;
2958 map { $form->{item_list}[$i]{$_} =~ s/\"/"/g }
2959 qw(partnumber description unit partsgroup);
2960 map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} }
2961 keys %{ $form->{item_list}[0] };
2962 $form->{"runningnumber_$i"} = $form->{assembly_rows};
2963 $form->{assembly_rows}++;
2971 $form->{rowcount} = $i;
2972 $form->{assembly_rows}++;
2980 if ($form->{item} eq "part") {
2984 if ($form->{item} eq 'service') {
2985 map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
2986 qw(sellprice listprice);
2992 $lxdebug->leave_sub();
2996 $lxdebug->enter_sub();
2998 # check if there is a part number - commented out, cause there is an automatic allocation of numbers
2999 # $form->isblank("partnumber", $locale->text(ucfirst $form->{item}." Part Number missing!"));
3001 # check if there is a description
3002 $form->isblank("description", $locale->text("Part Description missing!"));
3004 if ($form->{obsolete}) {
3007 "Inventory quantity must be zero before you can set this $form->{item} obsolete!"
3009 if ($form->{onhand} * 1);
3012 if (!$form->{buchungsgruppen_id}) {
3013 $form->error($locale->text("Parts must have an entry type.") . " " .
3014 $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.")
3018 $form->error($locale->text('Description must not be empty!')) unless $form->{description};
3019 $form->error($locale->text('Partnumber must not be set to empty!')) if $form->{id} && !$form->{partnumber};
3021 # expand dynamic strings
3022 # $locale->text('Inventory quantity must be zero before you can set this part obsolete!')
3023 # $locale->text('Inventory quantity must be zero before you can set this assembly obsolete!')
3024 # $locale->text('Part Number missing!')
3025 # $locale->text('Service Number missing!')
3026 # $locale->text('Assembly Number missing!')
3029 $lxdebug->message(LXDebug::DEBUG1,
3030 "ic.pl: sellprice in save = $form->{sellprice}\n");
3031 $rc = IC->save(\%myconfig, \%$form);
3033 $form->error($locale->text('Partnumber not unique!'));
3035 $parts_id = $form->{id};
3037 # load previous variables
3038 if ($form->{previousform}) {
3040 # save the new form variables before splitting previousform
3041 map { $newform{$_} = $form->{$_} } keys %$form;
3043 $previousform = $form->unescape($form->{previousform});
3045 # don't trample on previous variables
3046 map { delete $form->{$_} } keys %newform;
3048 # now take it apart and restore original values
3049 foreach $item (split /&/, $previousform) {
3050 ($key, $value) = split /=/, $item, 2;
3051 $value =~ s/%26/&/g;
3052 $form->{$key} = $value;
3054 $form->{taxaccounts} = $newform{taxaccount2};
3056 if ($form->{item} eq 'assembly') {
3058 # undo number formatting
3059 map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
3060 qw(weight listprice sellprice rop);
3062 $form->{assembly_rows}--;
3063 $i = $newform{rowcount};
3064 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
3066 $form->{sellprice} -= $form->{"sellprice_$i"} * $form->{"qty_$i"};
3067 $form->{weight} -= $form->{"weight_$i"} * $form->{"qty_$i"};
3069 # change/add values for assembly item
3070 map { $form->{"${_}_$i"} = $newform{$_} }
3071 qw(partnumber description bin unit weight listprice sellprice inventory_accno income_accno expense_accno);
3073 $form->{sellprice} += $form->{"sellprice_$i"} * $form->{"qty_$i"};
3074 $form->{weight} += $form->{"weight_$i"} * $form->{"qty_$i"};
3078 # set values for last invoice/order item
3079 $i = $form->{rowcount};
3080 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
3082 map { $form->{"${_}_$i"} = $newform{$_} }
3083 qw(partnumber description bin unit listprice inventory_accno income_accno expense_accno sellprice);
3084 $form->{"sellprice_$i"} = $newform{lastcost} if ($form->{vendor_id});
3085 if ($form->{exchangerate} != 0) {
3086 $form->{"sellprice_$i"} /= $form->{exchangerate};
3088 $lxdebug->message(LXDebug::DEBUG1,
3089 qq|sellprice_$i in previousform 2 = |
3090 . $form->{"sellprice_$i"} . qq|\n|);
3091 map { $form->{"taxaccounts_$i"} .= "$_ " } split / /,
3092 $newform{taxaccount};
3093 chop $form->{"taxaccounts_$i"};
3094 foreach $item (qw(description rate taxnumber)) {
3095 $index = $form->{"taxaccounts_$i"} . "_$item";
3096 $form->{$index} = $newform{$index};
3099 # credit remaining calculation
3101 $form->{"sellprice_$i"} * (1 - $form->{"discount_$i"} / 100) *
3103 map { $form->{"${_}_base"} += $amount }
3104 (split / /, $form->{"taxaccounts_$i"});
3105 map { $amount += ($form->{"${_}_base"} * $form->{"${_}_rate"}) }
3106 split / /, $form->{"taxaccounts_$i"}
3107 if !$form->{taxincluded};
3109 $form->{creditremaining} -= $amount;
3111 # redo number formatting, because invoice parse them!
3112 $i = $form->{rowcount};
3114 $form->{"${_}_$i"} =
3115 $form->format_amount(\%myconfig, $form->{"${_}_$i"})
3116 } qw(weight listprice sellprice rop);
3119 $form->{"id_$i"} = $parts_id;
3120 delete $form->{action};
3122 # restore original callback
3123 $callback = $form->unescape($form->{callback});
3124 $form->{callback} = $form->unescape($form->{old_callback});
3125 delete $form->{old_callback};
3127 $form->{makemodel_rows}--;
3129 # put callback together
3130 foreach $key (keys %$form) {
3132 # do single escape for Apache 2.0
3133 $value = $form->escape($form->{$key}, 1);
3134 $callback .= qq|&$key=$value|;
3136 $form->{callback} = $callback;
3138 $lxdebug->message(LXDebug::DEBUG1,
3139 qq|ic.pl: sellprice_$i nach sub save = |
3140 . $form->{"sellprice_$i"} . qq|\n|);
3145 $lxdebug->leave_sub();
3149 $lxdebug->enter_sub();
3152 if ($form->{"original_partnumber"} &&
3153 ($form->{"partnumber"} eq $form->{"original_partnumber"})) {
3154 $form->{partnumber} = "";
3158 $lxdebug->leave_sub();
3162 $lxdebug->enter_sub();
3164 $rc = IC->delete(\%myconfig, \%$form);
3167 $form->redirect($locale->text('Item deleted!')) if ($rc > 0);
3168 $form->error($locale->text('Cannot delete item!'));
3170 $lxdebug->leave_sub();
3174 $lxdebug->enter_sub();
3183 <th class="listheading">| . $locale->text('Preisklasse') . qq|</th>
3184 <th class="listheading">| . $locale->text('Preis') . qq|</th>
3187 for $i (1 .. $numrows) {
3190 <td width=50%><input type=hidden name="pricegroup_$i" size=30 value="$form->{"pricegroup_$i"}">$form->{"pricegroup_$i"}</td>
3191 <td width=50%><input name="price_$i" size=11 value="$form->{"price_$i"}"></td>
3192 <input type=hidden name="pricegroup_id_$i" value="$form->{"pricegroup_id_$i"}">
3203 $lxdebug->leave_sub();
3207 sub parts_language_selection {
3208 $lxdebug->enter_sub();
3211 my $languages = IC->retrieve_languages(\%myconfig, $form);
3214 my $callback = "$form->{script}?action=parts_language_selection&";
3215 map({ $callback .= "$_=" . $form->escape($form->{$_}) . "&" }
3216 (qw(login path password name input_name), grep({ /^[fl]_/ } keys %$form)));
3218 my @header_sort = qw(name longdescription);
3219 my %header_title = ( "name" => $locale->text("Name"),
3220 "longdescription" => $locale->text("Long Description"),
3224 map(+{ "column_title" => $header_title{$_},
3226 "callback" => $callback,
3230 $form->{"title"} = $locale->text("Language Values");
3232 print($form->parse_html_template("ic/parts_language_selection", { "HEADER" => \@header,
3233 "LANGUAGES" => $languages,
3234 "onload" => $onload }));
3236 $lxdebug->leave_sub();
3239 sub continue { &{ $form->{nextsub} } }