1 #=====================================================================
2 # SQL-Ledger, Accounting
5 # Author: Dieter Simader
6 # Email: dsimader@sql-ledger.org
7 # Web: http://www.sql-ledger.org
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; either version 2 of the License, or
13 # (at your option) any later version.
15 # This program is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #======================================================================
24 # Inventory Control module
26 #======================================================================
31 require "$form->{path}/io.pl";
40 $form->{title} = $locale->text('Add ' . ucfirst $form->{item});
42 $form->{callback} = "$form->{script}?action=add&item=$form->{item}&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback};
44 $form->{unit} = ($form->{item} eq 'service') ? $locale->text('hr') : $locale->text('ea');
55 $form->{title} = (ucfirst $form->{searchitems})."s";
56 $form->{title} = $locale->text($form->{title});
58 # $locale->text('Parts')
59 # $locale->text('Services')
61 unless ($form->{searchitems} eq 'service') {
64 <input name=itemstatus class=radio type=radio value=onhand> |.$locale->text('On Hand').qq|
65 <input name=itemstatus class=radio type=radio value=short> |.$locale->text('Short').qq|
70 <th width="1%" align=right nowrap>|.$locale->text('Make').qq|</th>
71 <td><input name=make size=20></td>
72 <th width="1%" align=right nowrap>|.$locale->text('Model').qq|</th>
73 <td><input name=model size=20></td>
78 if ($form->{searchitems} eq 'assembly') {
80 $form->{title} = $locale->text('Assemblies');
86 <input name=none class=radio type=radio value=1 checked> |.$locale->text('Top Level').qq|
87 <input name=bom class=checkbox type=checkbox value=1> |.$locale->text('Individual Items').qq|
101 <td><input name=sold class=checkbox type=checkbox value=1></td>
102 <td nowrap>|.$locale->text('Sold').qq|</td>
105 <td colspan=2><hr size=1 noshade></td>
108 <td><input name=ordered class=checkbox type=checkbox value=1></td>
109 <td nowrap>|.$locale->text('Ordered').qq|</td>
113 <td width=5%> </td>
114 <th>|.$locale->text('From').qq|</th>
115 <td><input name=transdatefrom size=11 title="$myconfig{dateformat}"></td>
116 <th>|.$locale->text('to').qq|</th>
117 <td><input name=transdateto size=11 title="$myconfig{dateformat}"></td>
119 <td><input name=closed class=checkbox type=checkbox value=1> |.$locale->text('Closed').qq|</td>
137 <td><input name=bought class=checkbox type=checkbox value=1></td>
138 <td nowrap>|.$locale->text('Bought').qq|</td>
139 <td><input name=sold class=checkbox type=checkbox value=1></td>
140 <td nowrap>|.$locale->text('Sold').qq|</td>
143 <td colspan=4><hr size=1 noshade></td>
146 <td><input name=onorder class=checkbox type=checkbox value=1></td>
147 <td nowrap>|.$locale->text('On Order').qq|</td>
148 <td><input name=ordered class=checkbox type=checkbox value=1></td>
149 <td nowrap>|.$locale->text('Ordered').qq|</td>
153 <td width=5%> </td>
157 <th>|.$locale->text('From').qq|</th>
158 <td><input name=transdatefrom size=11 title="$myconfig{dateformat}"></td>
159 <th>|.$locale->text('to').qq|</th>
160 <td><input name=transdateto size=11 title="$myconfig{dateformat}"></td>
162 <td><input name=closed class=checkbox type=checkbox value=1> |.$locale->text('Closed').qq|</td>
179 <form method=post action=$form->{script}>
181 <input type=hidden name=searchitems value=$form->{searchitems}>
182 <input type=hidden name=title value="$form->{title}">
185 <tr><th class=listtop>$form->{title}</th></tr>
191 <th width=1% align=right nowrap>|.$locale->text('Number').qq|</th>
192 <td><input name=partnumber size=20></td>
193 <th align=right nowrap>|.$locale->text('Description').qq|</th>
194 <td><input name=description size=40></td>
197 <th align=right nowrap>|.$locale->text('Group').qq|</th>
198 <td><input name=partsgroup size=20></td>
202 <th align=right nowrap>|.$locale->text('Drawing').qq|</th>
203 <td><input name=drawing size=20></td>
204 <th align=right nowrap>|.$locale->text('Microfiche').qq|</th>
205 <td><input name=microfiche size=20></td>
211 <input name=itemstatus class=radio type=radio value=active checked> |.$locale->text('Active').qq|
213 <input name=itemstatus class=radio type=radio value=obsolete> |.$locale->text('Obsolete').qq|
214 <input name=itemstatus class=radio type=radio value=orphaned> |.$locale->text('Orphaned').qq|
225 <th align=right nowrap>|.$locale->text('Include in Report').qq|</th>
229 <td><input name=l_partnumber class=checkbox type=checkbox value=Y checked> |.$locale->text('Number').qq|</td>
230 <td><input name=l_description class=checkbox type=checkbox value=Y checked> |.$locale->text('Description').qq|</td>
231 <td><input name=l_unit class=checkbox type=checkbox value=Y checked> |.$locale->text('Unit of measure').qq|</td>
234 <td><input name=l_listprice class=checkbox type=checkbox value=Y> |.$locale->text('List Price').qq|</td>
235 <td><input name=l_sellprice class=checkbox type=checkbox value=Y checked> |.$locale->text('Sell Price').qq|</td>
236 <td><input name=l_lastcost class=checkbox type=checkbox value=Y> |.$locale->text('Last Cost').qq|</td>
237 <td><input name=l_linetotal class=checkbox type=checkbox value=Y checked> |.$locale->text('Line Total').qq|</td>
240 <td><input name=l_priceupdate class=checkbox type=checkbox value=Y> |.$locale->text('Updated').qq|</td>
241 <td><input name=l_bin class=checkbox type=checkbox value=Y> |.$locale->text('Bin').qq|</td>
242 <td><input name=l_rop class=checkbox type=checkbox value=Y> |.$locale->text('ROP').qq|</td>
243 <td><input name=l_weight class=checkbox type=checkbox value=Y> |.$locale->text('Weight').qq|</td>
246 <td><input name=l_image class=checkbox type=checkbox value=Y> |.$locale->text('Image').qq|</td>
247 <td><input name=l_drawing class=checkbox type=checkbox value=Y> |.$locale->text('Drawing').qq|</td>
248 <td><input name=l_microfiche class=checkbox type=checkbox value=Y> |.$locale->text('Microfiche').qq|</td>
249 <td><input name=l_partsgroup class=checkbox type=checkbox value=Y> |.$locale->text('Group').qq|</td>
252 <td><input name=l_subtotal class=checkbox type=checkbox value=Y> |.$locale->text('Subtotal').qq|</td>
260 <tr><td colspan=4><hr size=3 noshade></td></tr>
263 <input type=hidden name=nextsub value=generate_report>
265 <input type=hidden name=path value=$form->{path}>
266 <input type=hidden name=login value=$form->{login}>
267 <input type=hidden name=password value=$form->{password}>
270 <input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
281 sub generate_report {
283 # setup $form->{sort}
284 unless ($form->{sort}) {
285 if ($form->{description} && !($form->{partnumber})) {
286 $form->{sort} = "description";
288 $form->{sort} = "partnumber";
292 $callback = "$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=".$form->escape($form->{title},1);
294 IC->all_parts(\%myconfig, \%$form);
297 if ($form->{itemstatus} eq 'active') {
298 $option .= $locale->text('Active')." : ";
300 if ($form->{itemstatus} eq 'obsolete') {
301 $option .= $locale->text('Obsolete')." : ";
303 if ($form->{itemstatus} eq 'orphaned') {
304 $option .= $locale->text('Orphaned')." : ";
306 if ($form->{itemstatus} eq 'onhand') {
307 $option .= $locale->text('On Hand')." : ";
308 $form->{l_onhand} = "Y";
310 if ($form->{itemstatus} eq 'short') {
311 $option .= $locale->text('Short')." : ";
312 $form->{l_onhand} = "Y";
314 if ($form->{onorder}) {
315 $form->{l_ordnumber} = "Y";
316 $callback .= "&onorder=$form->{onorder}";
317 $option .= $locale->text('On Order')." : ";
319 if ($form->{ordered}) {
320 $form->{l_ordnumber} = "Y";
321 $callback .= "&ordered=$form->{ordered}";
322 $option .= $locale->text('Ordered')." : ";
324 if ($form->{closed}) {
325 $callback .= "&closed=$form->{closed}";
326 $option .= $locale->text('Closed')." : ";
328 if ($form->{bought}) {
329 $form->{l_invnumber} = "Y";
330 $callback .= "&bought=$form->{bought}";
331 $option .= $locale->text('Bought')." : ";
334 $form->{l_invnumber} = "Y";
335 $callback .= "&sold=$form->{sold}";
336 $option .= $locale->text('Sold')." : ";
338 if ($form->{bought} || $form->{sold} || $form->{onorder} || $form->{ordered}) {
340 $form->{l_lastcost} = "";
341 if ($form->{transdatefrom}) {
342 $callback .= "&transdatefrom=$form->{transdatefrom}";
343 $option .= "\n<br>".$locale->text('From')." ".$locale->date(\%myconfig, $form->{transdatefrom}, 1);
345 if ($form->{transdateto}) {
346 $callback .= "&transdateto=$form->{transdateto}";
347 $option .= "\n<br>".$locale->text('to')." ".$locale->date(\%myconfig, $form->{transdateto}, 1);
353 if ($form->{partnumber}) {
354 $callback .= "&partnumber=$form->{partnumber}";
355 $option .= $locale->text('Number').qq| : $form->{partnumber}<br>|;
357 if ($form->{description}) {
358 $callback .= "&description=$form->{description}";
359 $option .= $locale->text('Description').qq| : $form->{description}<br>|;
362 $callback .= "&make=$form->{make}";
363 $option .= $locale->text('Make').qq| : $form->{make}<br>|;
365 if ($form->{model}) {
366 $callback .= "&model=$form->{model}";
367 $option .= $locale->text('Model').qq| : $form->{model}<br>|;
369 if ($form->{drawing}) {
370 $callback .= "&drawing=$form->{drawing}";
371 $option .= $locale->text('Drawing').qq| : $form->{drawing}<br>|;
373 if ($form->{microfiche}) {
374 $callback .= "µfiche=$form->{microfiche}";
375 $option .= $locale->text('Microfiche').qq| : $form->{microfiche}<br>|;
377 if ($form->{partsgroup}) {
378 $callback .= "&partsgroup=$form->{partsgroup}";
379 $option .= $locale->text('Group').qq| : $form->{partsgroup}<br>|;
383 @columns = $form->sort_columns(qw(partnumber description partsgroup bin onhand rop unit listprice linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber));
385 if ($form->{l_linetotal}) {
386 $form->{l_onhand} = "Y";
387 $form->{l_linetotalsellprice} = "Y" if $form->{l_sellprice};
388 if ($form->{l_lastcost}) {
389 $form->{l_linetotallastcost} = "Y";
390 if (($form->{searchitems} eq 'assembly') && !$form->{bom}) {
391 $form->{l_linetotallastcost} = "";
394 $form->{l_linetotallistprice} = "Y" if $form->{l_listprice};
397 if ($form->{searchitems} eq 'service') {
398 # remove bin, weight and rop from list
399 map { $form->{"l_$_"} = "" } qw(bin weight rop);
401 $form->{l_onhand} = "";
402 # qty is irrelevant unless bought or sold
403 if ($form->{bought} || $form->{sold} || $form->{onorder} || $form->{ordered}) {
404 $form->{l_onhand} = "Y";
406 $form->{l_linetotalsellprice} = "";
407 $form->{l_linetotallastcost} = "";
411 $form->{l_lastcost} = "" if ($form->{searchitems} eq 'assembly' && !$form->{bom});
413 foreach $item (@columns) {
414 if ($form->{"l_$item"} eq "Y") {
415 push @column_index, $item;
417 # add column to callback
418 $callback .= "&l_$item=Y";
422 if ($form->{l_subtotal} eq 'Y') {
423 $callback .= "&l_subtotal=Y";
426 $column_header{partnumber} = qq|<th nowrap><a class=listheading href=$callback&sort=partnumber>|.$locale->text('Number').qq|</a></th>|;
427 $column_header{description} = qq|<th nowrap><a class=listheading href=$callback&sort=description>|.$locale->text('Description').qq|</a></th>|;
428 $column_header{partsgroup} = qq|<th nowrap><a class=listheading href=$callback&sort=partsgroup>|.$locale->text('Group').qq|</a></th>|;
429 $column_header{bin} = qq|<th><a class=listheading href=$callback&sort=bin>|.$locale->text('Bin').qq|</a></th>|;
430 $column_header{priceupdate} = qq|<th nowrap><a class=listheading href=$callback&sort=priceupdate>|.$locale->text('Updated').qq|</a></th>|;
431 $column_header{onhand} = qq|<th class=listheading nowrap>|.$locale->text('Qty').qq|</th>|;
432 $column_header{unit} = qq|<th class=listheading nowrap>|.$locale->text('Unit').qq|</th>|;
433 $column_header{listprice} = qq|<th class=listheading nowrap>|.$locale->text('List Price').qq|</th>|;
434 $column_header{lastcost} = qq|<th class=listheading nowrap>|.$locale->text('Last Cost').qq|</th>|;
435 $column_header{rop} = qq|<th class=listheading nowrap>|.$locale->text('ROP').qq|</th>|;
436 $column_header{weight} = qq|<th class=listheading nowrap>|.$locale->text('Weight').qq|</th>|;
438 $column_header{invnumber} = qq|<th nowrap><a class=listheading href=$callback&sort=invnumber>|.$locale->text('Invoice Number').qq|</a></th>|;
439 $column_header{ordnumber} = qq|<th nowrap><a class=listheading href=$callback&sort=ordnumber>|.$locale->text('Order Number').qq|</a></th>|;
441 $column_header{sellprice} = qq|<th class=listheading nowrap>|.$locale->text('Sell Price').qq|</th>|;
442 $column_header{linetotalsellprice} = qq|<th class=listheading nowrap>|.$locale->text('Extended').qq|</th>|;
443 $column_header{linetotallastcost} = qq|<th class=listheading nowrap>|.$locale->text('Extended').qq|</th>|;
444 $column_header{linetotallistprice} = qq|<th class=listheading nowrap>|.$locale->text('Extended').qq|</th>|;
446 $column_header{image} = qq|<th class=listheading nowrap>|.$locale->text('Image').qq|</a></th>|;
447 $column_header{drawing} = qq|<th nowrap><a class=listheading href=$callback&sort=drawing>|.$locale->text('Drawing').qq|</a></th>|;
448 $column_header{microfiche} = qq|<th nowrap><a class=listheading href=$callback&sort=microfiche>|.$locale->text('Microfiche').qq|</a></th>|;
451 $colspan = $#column_index + 1;
457 <tr><th class=listtop colspan=$colspan>$form->{title}</th></tr>
460 <tr><td colspan=$colspan>$option</td></tr>
462 <tr class=listheading>
465 map { print "\n$column_header{$_}" } @column_index;
472 # add order to callback
473 $form->{callback} = $callback .= "&sort=$form->{sort}";
475 # escape callback for href
476 $callback = $form->escape($callback);
478 if (@{ $form->{parts} }) {
479 $sameitem = $form->{parts}->[0]->{$form->{sort}};
482 foreach $ref (@{ $form->{parts} }) {
484 if ($form->{l_subtotal} eq 'Y' && !$ref->{assemblyitem}) {
485 if ($sameitem ne $ref->{$form->{sort}}) {
487 $sameitem = $ref->{$form->{sort}};
491 $ref->{exchangerate} = 1 unless $ref->{exchangerate};
492 $ref->{sellprice} *= $ref->{exchangerate};
493 $ref->{listprice} *= $ref->{exchangerate};
494 $ref->{lastcost} *= $ref->{exchangerate};
497 $onhand = $ref->{onhand};
499 if ($ref->{assemblyitem}) {
501 $onhand = 0 if ($form->{sold});
504 $column_data{partnumber} = "<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>";
505 $column_data{description} = "<td>$ref->{description} </td>";
506 $column_data{partsgroup} = "<td>$ref->{partsgroup} </td>";
508 $column_data{onhand} = "<td align=right>".$form->format_amount(\%myconfig, $onhand, '', " ")."</td>";
509 $column_data{sellprice} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{sellprice}, 2, " ") . "</td>";
510 $column_data{listprice} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{listprice}, 2, " ") . "</td>";
511 $column_data{lastcost} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{lastcost}, 2, " ") . "</td>";
513 $column_data{linetotalsellprice} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{onhand} * $ref->{sellprice}, 2, " ")."</td>";
514 $column_data{linetotallastcost} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{onhand} * $ref->{lastcost}, 2, " ")."</td>";
515 $column_data{linetotallistprice} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{onhand} * $ref->{listprice}, 2, " ")."</td>";
517 if (!$ref->{assemblyitem}) {
518 $totalsellprice += $onhand * $ref->{sellprice};
519 $totallastcost += $onhand * $ref->{lastcost};
520 $totallistprice += $onhand * $ref->{listprice};
522 $subtotalonhand += $onhand;
523 $subtotalsellprice += $onhand * $ref->{sellprice};
524 $subtotallastcost += $onhand * $ref->{lastcost};
525 $subtotallistprice += $onhand * $ref->{listprice};
528 $column_data{rop} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{rop}, '', " ")."</td>";
529 $column_data{weight} = "<td align=right>".$form->format_amount(\%myconfig, $ref->{weight}, '', " ")."</td>";
530 $column_data{unit} = "<td>$ref->{unit} </td>";
531 $column_data{bin} = "<td>$ref->{bin} </td>";
532 $column_data{priceupdate} = "<td>$ref->{priceupdate} </td>";
534 $column_data{invnumber} = ($ref->{module} ne 'oe') ? "<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>" : "<td>$ref->{invnumber} </td>";
535 $column_data{ordnumber} = ($ref->{module} eq 'oe') ? "<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>" : "<td>$ref->{ordnumber} </td>";
537 $column_data{image} = ($ref->{image}) ? "<td><a href=$ref->{image}><img src=$ref->{image} height=32 border=0></a></td>" : "<td> </td>";
538 $column_data{drawing} = ($ref->{drawing}) ? "<td><a href=$ref->{drawing}>$ref->{drawing}</a></td>" : "<td> </td>";
539 $column_data{microfiche} = ($ref->{microfiche}) ? "<td><a href=$ref->{microfiche}>$ref->{microfiche}</a></td>" : "<td> </td>";
542 print "<tr class=listrow$i>";
544 map { print "\n$column_data{$_}" } @column_index;
553 if ($form->{l_subtotal} eq 'Y') {
557 if ($form->{"l_linetotal"}) {
558 map { $column_data{$_} = "<td> </td>" } @column_index;
559 $column_data{linetotalsellprice} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totalsellprice, 2, " ")."</th>";
560 $column_data{linetotallastcost} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totallastcost, 2, " ")."</th>";
561 $column_data{linetotallistprice} = "<th class=listtotal align=right>".$form->format_amount(\%myconfig, $totallistprice, 2, " ")."</th>";
563 print "<tr class=listtotal>";
565 map { print "\n$column_data{$_}" } @column_index;
572 <tr><td colspan=$colspan><hr size=3 noshade></td></tr>
582 <form method=post action=$form->{script}>
584 <input name=callback type=hidden value="$form->{callback}">
586 <input type=hidden name=item value=$form->{searchitems}>
588 <input type=hidden name=path value=$form->{path}>
589 <input type=hidden name=login value=$form->{login}>
590 <input type=hidden name=password value=$form->{password}>
592 <input class=submit type=submit name=action value="|.$locale->text('Add').qq|">
606 map { $column_data{$_} = "<td> </td>" } @column_index;
607 $subtotalonhand = 0 if ($form->{searchitems} eq 'assembly' && $form->{bom});
609 $column_data{onhand} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalonhand, '', " ")."</th>";
610 $column_data{sellprice} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotalsellprice, 2, " ")."</th>";
611 $column_data{listprice} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotallistprice, 2, " ")."</th>";
612 $column_data{lastcost} = "<th class=listsubtotal align=right>".$form->format_amount(\%myconfig, $subtotallastcost, 2, " ")."</th>";
615 $subtotalsellprice = 0;
616 $subtotallistprice = 0;
617 $subtotallastcost = 0;
619 print "<tr class=listsubtotal>";
621 map { print "\n$column_data{$_}" } @column_index;
633 IC->get_part(\%myconfig, \%$form);
635 $form->{title} = $locale->text('Edit '.ucfirst $form->{item});
646 IC->create_links("IC", \%myconfig, \%$form);
648 # parts and assemblies have the same links
649 $item = $form->{item};
650 if ($form->{item} eq 'assembly') {
654 # build the popup menus
655 $form->{taxaccounts} = "";
656 foreach $key (keys %{ $form->{IC_links} }) {
657 foreach $ref (@{ $form->{IC_links}{$key} }) {
658 # if this is a tax field
659 if ($key =~ /IC_tax/) {
660 if ($key =~ /$item/) {
661 $form->{taxaccounts} .= "$ref->{accno} ";
662 $form->{"IC_tax_$ref->{accno}_description"} = "$ref->{accno}--$ref->{description}";
665 if ($form->{amount}{$ref->{accno}}) {
666 $form->{"IC_tax_$ref->{accno}"} = "checked";
669 $form->{"IC_tax_$ref->{accno}"} = "checked";
674 $form->{"select$key"} .= "<option>$ref->{accno}--$ref->{description}\n";
675 if ($form->{amount}{$key} eq $ref->{accno}) {
676 $form->{$key} = "$ref->{accno}--$ref->{description}";
682 chop $form->{taxaccounts};
684 if (($form->{item} eq "part") || ($form->{item} eq "assembly")) {
685 $form->{selectIC_income} = $form->{selectIC_sale};
686 $form->{selectIC_expense} = $form->{selectIC_cogs};
687 $form->{IC_income} = $form->{IC_sale};
688 $form->{IC_expense} = $form->{IC_cogs};
691 delete $form->{IC_links};
692 delete $form->{amount};
700 ($dec) = ($form->{sellprice} =~ /\.(\d+)/);
702 my $decimalplaces = ($dec > 2) ? $dec : 2;
704 map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}, $decimalplaces)} qw(listprice sellprice);
706 ($dec) = ($form->{lastcost} =~ /\.(\d+)/);
708 my $decimalplaces = ($dec > 2) ? $dec : 2;
710 $form->{lastcost} = $form->format_amount(\%myconfig, $form->{lastcost}, $decimalplaces);
712 map { $form->{$_} = $form->format_amount(\%myconfig, $form->{$_}) } qw(weight rop stock);
714 foreach $item (qw(partnumber description unit notes)) {
715 $form->{$item} =~ s/"/"/g;
719 if (($rows = $form->numtextrows($form->{notes}, 40)) < 2) {
723 $notes = qq|<textarea name=notes rows=$rows cols=40 wrap=soft>$form->{notes}</textarea>|;
725 if (($rows = $form->numtextrows($form->{description}, 40)) > 1) {
726 $description = qq|<textarea name="description" rows=$rows cols=40 wrap=soft>$form->{description}</textarea>|;
728 $description = qq|<input name=description size=40 value="$form->{description}">|;
731 foreach $item (split / /, $form->{taxaccounts}) {
732 $form->{"IC_tax_$item"} = ($form->{"IC_tax_$item"}) ? "checked" : "";
737 foreach $item (qw(IC IC_income IC_expense)) {
738 if ($form->{$item}) {
739 if ($form->{id} && $form->{orphaned}) {
740 $form->{"select$item"} =~ s/ selected//;
741 $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
744 $form->{"select$item"} = qq|<option selected>$form->{$item}|;
750 foreach $item (split / /, $form->{taxaccounts}) {
752 <input class=checkbox type=checkbox name="IC_tax_$item" value=1 $form->{"IC_tax_$item"}> <b>$form->{"IC_tax_${item}_description"}</b>
753 <br><input type=hidden name=IC_tax_${item}_description value="$form->{"IC_tax_${item}_description"}">
757 $form->{obsolete} = "checked" if $form->{obsolete};
761 <th align="right" nowrap="true">|.$locale->text('Last Cost').qq|</th>
762 <td><input name=lastcost size=11 value=$form->{lastcost}></td>
766 if ($form->{item} eq "part") {
770 <th width="1%" align=right>|.$locale->text('Inventory').qq|</th>
771 <td><select name=IC>$form->{selectIC}</select></td>
772 <input name=selectIC type=hidden value="$form->{selectIC}">
775 <th align=right>|.$locale->text('Sales').qq|</th>
776 <td><select name=IC_income>$form->{selectIC_income}</select></td>
777 <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
780 <th align=right>|.$locale->text('COGS').qq|</th>
781 <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
782 <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
789 <th align=right>|.$locale->text('Tax').qq|</th>
797 <th align="right" nowrap="true">|.$locale->text('Weight').qq|</th>
802 <input name=weight size=10 value=$form->{weight}>
807 <input type=hidden name=weightunit value=$form->{weightunit}>
818 if ($form->{item} eq "assembly") {
824 <th width="1%" align=right>|.$locale->text('Sales').qq|</th>
825 <td><select name=IC_income>$form->{selectIC_income}</select></td>
826 <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
833 <th align=right>|.$locale->text('Tax').qq|</th>
841 <th align="right" nowrap="true">|.$locale->text('Weight').qq|</th>
846 $form->{weight}
847 <input type=hidden name=weight value=$form->{weight}>
852 <input type=hidden name=weightunit value=$form->{weightunit}>
864 if ($form->{item} eq "service") {
868 <th width="1%" align=right>|.$locale->text('Income').qq|</th>
869 <td><select name=IC_income>$form->{selectIC_income}</select></td>
870 <input name=selectIC_income type=hidden value="$form->{selectIC_income}">
873 <th align=right>|.$locale->text('Expense').qq|</th>
874 <td><select name=IC_expense>$form->{selectIC_expense}</select></td>
875 <input name=selectIC_expense type=hidden value="$form->{selectIC_expense}">
882 <th align=right>|.$locale->text('Tax').qq|</th>
891 if ($form->{item} ne 'service') {
892 $color = ($form->{onhand} > 0) ? "green" : "red";
895 <th align="right" nowrap>|.$locale->text('On Hand').qq|</th>
896 <th align=left nowrap> |.$form->format_amount(\%myconfig, $form->{onhand}).qq|</th>
900 if ($form->{item} eq 'assembly') {
903 <th align="right" nowrap>|.$locale->text('Stock').qq|</th>
904 <td><input name=stock size=10 value=$form->{stock}></td>
911 <th align="right" nowrap="true">|.$locale->text('ROP').qq|</th>
912 <td><input name=rop size=10 value=$form->{rop}></td>
918 <th align="right" nowrap="true">|.$locale->text('Bin').qq|</th>
919 <td><input name=bin size=10 value=$form->{bin}></td>
928 <th width=1% align=right nowrap>|.$locale->text('Image').qq|</th>
929 <td width=70%><input name=image size=40 value="$form->{image}"></td>
933 <th width=1% align=right nowrap>|.$locale->text('Drawing').qq|</th>
934 <td width=70%><input name=drawing size=40 value="$form->{drawing}"></td>
935 <th width=1% align=right nowrap>|.$locale->text('Microfiche').qq|</th>
936 <td width=30%><input name=microfiche size=20 value="$form->{microfiche}"></td>
948 <th align="right" nowrap="true">|.$locale->text('Obsolete').qq|</th>
949 <td><input name=obsolete type=checkbox class=checkbox value=1 $form->{obsolete}></td>
956 # type=submit $locale->text('Add Part')
957 # type=submit $locale->text('Add Service')
958 # type=submit $locale->text('Add Assembly')
960 # type=submit $locale->text('Edit Part')
961 # type=submit $locale->text('Edit Service')
962 # type=submit $locale->text('Edit Assembly')
970 <form method=post action=$form->{script}>
972 <input name=id type=hidden value=$form->{id}>
973 <input name=item type=hidden value=$form->{item}>
974 <input name=title type=hidden value="$form->{title}">
975 <input name=makemodel type=hidden value="$form->{makemodel}">
976 <input name=alternate type=hidden value="$form->{alternate}">
977 <input name=onhand type=hidden value=$form->{onhand}>
978 <input name=orphaned type=hidden value=$form->{orphaned}>
979 <input name=taxaccounts type=hidden value="$form->{taxaccounts}">
980 <input name=rowcount type=hidden value=$form->{rowcount}>
983 <tr><th class=listtop>$form->{title}</th></tr>
989 <th align=left>|.$locale->text('Number').qq|</th>
990 <th align=left>|.$locale->text('Description').qq|</th>
991 <th align=left>|.$locale->text('Group').qq|</th>
994 <td><input name=partnumber value="$form->{partnumber}" size=20></td>
995 <td>$description</td>
996 <td><input name=partsgroup size=20 value="$form->{partsgroup}"></td>
997 <input type=hidden name=oldpartsgroup value="$form->{oldpartsgroup}">
1004 <table width="100%" height="100%">
1007 <table width="100%" height="100%">
1008 <tr class="listheading">
1009 <th class="listheading" align="center" colspan=2>|.$locale->text('Link Accounts').qq|</th>
1013 <th align="left">|.$locale->text('Notes').qq|</th>
1023 <table width="100%">
1025 <th align="right" nowrap="true">|.$locale->text('Updated').qq|</th>
1026 <td><input name=priceupdate size=11 title="$myconfig{dateformat}" value=$form->{priceupdate}></td>
1029 <th align="right" nowrap="true">|.$locale->text('List Price').qq|</th>
1030 <td><input name=listprice size=11 value=$form->{listprice}></td>
1033 <th align="right" nowrap="true">|.$locale->text('Sell Price').qq|</th>
1034 <td><input name=sellprice size=11 value=$form->{sellprice}></td>
1038 <th align="right" nowrap="true">|.$locale->text('Unit').qq|</th>
1039 <td><input name=unit size=5 maxsize=5 value="$form->{unit}"></td>
1058 if ($form->{item} eq "assembly") {
1063 <table width="100%">
1065 <th colspan=2 align=right>|.$locale->text('Total').qq| </th>
1066 <th width="1%" align=right>|.$form->format_amount(\%myconfig, $form->{assemblytotal}, 2).qq|</th>
1071 <input type=hidden name=assembly_rows value=$form->{assembly_rows}>
1076 <input type=hidden name=path value=$form->{path}>
1077 <input type=hidden name=login value=$form->{login}>
1078 <input type=hidden name=password value=$form->{password}>
1079 <input type=hidden name=callback value="$form->{callback}">
1080 <input type=hidden name=previous_form value="$form->{previous_form}">
1082 <td><hr size=3 noshade></td>
1087 <input class=submit type=submit name=action value="|.$locale->text('Update').qq|">
1090 if ($form->{item} ne "service") {
1092 <input type=hidden name=makemodel_rows value=$form->{makemodel_rows}>
1097 <input class=submit type=submit name=action value="|.$locale->text('Save').qq|">|;
1101 if (! $form->{previous_form}) {
1103 <input class=submit type=submit name=action value="|.$locale->text('Save as new').qq|">|;
1106 if ($form->{orphaned}) {
1107 if (! $form->{previous_form}) {
1109 <input class=submit type=submit name=action value="|.$locale->text('Delete').qq|">|;
1130 $form->{"make_$i"} =~ s/"/"/g;
1131 $form->{"model_$i"} =~ s/"/"/g;
1138 <th class="listheading">|.$locale->text('Make').qq|</th>
1139 <th class="listheading">|.$locale->text('Model').qq|</th>
1143 for $i (1 .. $numrows) {
1146 <td width=50%><input name="make_$i" size=30 value="$form->{"make_$i"}"></td>
1147 <td width=50%><input name="model_$i" size=30 value="$form->{"model_$i"}"></td>
1164 @column_index = qw(runningnumber qty unit bom partnumber description partsgroup total);
1166 if ($form->{previous_form}) {
1168 @column_index = qw(qty unit bom partnumber description partsgroup total);
1171 $form->{old_callback} = $form->{callback};
1172 $callback = $form->{callback};
1173 $form->{callback} = "$form->{script}?action=display_form";
1176 delete $form->{action};
1178 $previous_form = "";
1179 # save form variables in a previous_form variable
1180 foreach $key (sort keys %$form) {
1182 $form->{$key} =~ s/&/%26/g;
1183 $previous_form .= qq|$key=$form->{$key}&|;
1185 chop $previous_form;
1186 $previous_form = $form->escape($form->escape($previous_form, 1));
1187 $form->{callback} = $callback;
1189 $form->{assemblytotal} = 0;
1190 $form->{weight} = 0;
1194 $column_header{runningnumber} = qq|<th nowrap width=5%>|.$locale->text('No.').qq|</th>|;
1195 $column_header{qty} = qq|<th align=left nowrap width=10%>|.$locale->text('Qty').qq|</th>|;
1196 $column_header{unit} = qq|<th align=left nowrap width=5%>|.$locale->text('Unit').qq|</th>|;
1197 $column_header{partnumber} = qq|<th align=left nowrap width=20%>|.$locale->text('Number').qq|</th>|;
1198 $column_header{description} = qq|<th nowrap width=50%>|.$locale->text('Description').qq|</th>|;
1199 $column_header{total} = qq|<th align=right nowrap>|.$locale->text('Extended').qq|</th>|;
1200 $column_header{bom} = qq|<th>|.$locale->text('BOM').qq|</th>|;
1201 $column_header{partsgroup} = qq|<th>|.$locale->text('Group').qq|</th>|;
1204 <tr class=listheading>
1205 <th class=listheading>|.$locale->text('Individual Items').qq|</th>
1213 map { print "\n$column_header{$_}" } @column_index;
1219 for $i (1 .. $numrows) {
1220 $form->{"partnumber_$i"} =~ s/"/"/g;
1222 $linetotal = $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2);
1223 $form->{assemblytotal} += $linetotal;
1225 $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
1227 $linetotal = $form->format_amount(\%myconfig, $linetotal, 2);
1229 if (($i >= 1) && ($i == $numrows)) {
1232 map { $column_data{$_} = qq|<td></td>| } qw(qty unit partnumber description bom partsgroup);
1235 map { $column_data{$_} = qq|<td></td>| } qw(runningnumber unit bom);
1237 $column_data{qty} = qq|<td><input name="qty_$i" size=5 value="$form->{"qty_$i"}"></td>|;
1238 $column_data{partnumber} = qq|<td><input name="partnumber_$i" size=15 value="$form->{"partnumber_$i"}"></td>|;
1239 $column_data{description} = qq|<td><input name="description_$i" size=40 value="$form->{"description_$i"}"></td>|;
1240 $column_data{partsgroup} = qq|<td><input name="partsgroup_$i" size=10 value="$form->{"partsgroup_$i"}"></td>|;
1246 if ($form->{previous_form}) {
1247 $column_data{partnumber} = qq|<td><input type=hidden name="partnumber_$i" value="$form->{"partnumber_$i"}">$form->{"partnumber_$i"}</td>|;
1248 $column_data{qty} = qq|<td align=right><input type=hidden name="qty_$i" value="$form->{"qty_$i"}">$form->{"qty_$i"}</td>|;
1250 $column_data{bom} = qq|<td align=center><input type=hidden name="bom_$i" value=$form->{"bom_$i"}>|;
1251 $column_data{bom} .= ($form->{"bom_$i"}) ? "x" : " ";
1252 $column_data{bom} .= qq|</td>|;
1254 $column_data{partsgroup} = qq|<td><input type=hidden name="partsgroup_$i" value="$form->{"partsgroup_$i"}">$form->{"partsgroup_$i"}</td>|;
1257 $href = qq|$form->{script}?action=edit&id=$form->{"id_$i"}&path=$form->{path}&login=$form->{login}&password=$form->{password}&rowcount=$i&previous_form=$previous_form|;
1258 $column_data{partnumber} = qq|<td><input type=hidden name="partnumber_$i" value="$form->{"partnumber_$i"}"><a href=$href>$form->{"partnumber_$i"}</a></td>|;
1259 $column_data{runningnumber} = qq|<td><input name="runningnumber_$i" size=3 value="$i"}"></td>|;
1260 $column_data{qty} = qq|<td><input name="qty_$i" size=5 value="$form->{"qty_$i"}"></td>|;
1262 $form->{"bom_$i"} = ($form->{"bom_$i"}) ? "checked" : "";
1263 $column_data{bom} = qq|<td align=center><input name="bom_$i" type=checkbox class=checkbox value=1 $form->{"bom_$i"}></td>|;
1265 $column_data{partsgroup} = qq|<td><input type=hidden name="partsgroup_$i" value="$form->{"partsgroup_$i"}">$form->{"partsgroup_$i"}</td>|;
1269 $column_data{unit} = qq|<td><input type=hidden name="unit_$i" value="$form->{"unit_$i"}">$form->{"unit_$i"}</td>|;
1270 $column_data{description} = qq|<td><input type=hidden name="description_$i" value="$form->{"description_$i"}">$form->{"description_$i"}</td>|;
1273 $column_data{total} = qq|<td align=right>$linetotal</td>|;
1278 map { print "\n$column_data{$_}" } @column_index;
1282 <input type=hidden name="id_$i" value=$form->{"id_$i"}>
1283 <input type=hidden name="sellprice_$i" value=$form->{"sellprice_$i"}>
1284 <input type=hidden name="weight_$i" value=$form->{"weight_$i"}>
1300 if ($form->{item} eq "assembly") {
1302 $i = $form->{assembly_rows};
1304 # if last row is empty check the form otherwise retrieve item
1305 if (($form->{"partnumber_$i"} eq "") && ($form->{"description_$i"} eq "") && ($form->{"partsgroup_$i"} eq "")) {
1311 IC->assembly_item(\%myconfig, \%$form);
1313 $rows = scalar @{ $form->{item_list} };
1316 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
1319 $form->{makemodel_rows}--;
1323 map { $form->{item_list}[$i]{$_} =~ s/"/"/g } qw(partnumber description unit partsgroup);
1324 map { $form->{"${_}_$i"} = $form->{item_list}[0]{$_} } keys %{ $form->{item_list}[0] };
1325 $form->{"runningnumber_$i"} = $form->{assembly_rows};
1326 $form->{assembly_rows}++;
1334 $form->{rowcount} = $i;
1335 $form->{assembly_rows}++;
1343 if ($form->{item} eq "part") {
1347 if ($form->{item} eq 'service') {
1348 map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(sellprice listprice);
1359 # check if there is a part number
1360 $form->isblank("partnumber", $locale->text(ucfirst $form->{item}." Number missing!"));
1362 if ($form->{obsolete}) {
1363 $form->error($locale->text("Inventory quantity must be zero before you can set this $form->{item} obsolete!")) if ($form->{onhand});
1366 # expand dynamic strings
1367 # $locale->text('Inventory quantity must be zero before you can set this part obsolete!')
1368 # $locale->text('Inventory quantity must be zero before you can set this assembly obsolete!')
1369 # $locale->text('Part Number missing!')
1370 # $locale->text('Service Number missing!')
1371 # $locale->text('Assembly Number missing!')
1374 $rc = IC->save(\%myconfig, \%$form);
1376 $parts_id = $form->{id};
1378 # load previous variables
1379 if ($form->{previous_form}) {
1380 # save the new form variables before splitting previous_form
1381 map { $newform{$_} = $form->{$_} } keys %$form;
1383 $previous_form = $form->unescape($form->{previous_form});
1385 # don't trample on previous variables
1386 map { delete $form->{$_} } keys %newform;
1388 # now take it apart and restore original values
1389 foreach $item (split /&/, $previous_form) {
1390 ($key, $value) = split /=/, $item, 2;
1391 $value =~ s/%26/&/g;
1392 $form->{$key} = $value;
1395 if ($form->{item} eq 'assembly') {
1397 map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(listprice sellprice weight);
1399 $form->{assembly_rows}--;
1400 $i = $newform{rowcount};
1401 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
1403 $form->{sellprice} -= $form->{"sellprice_$i"} * $form->{"qty_$i"};
1404 $form->{weight} -= $form->{"weight_$i"} * $form->{"qty_$i"};
1406 # change/add values for assembly item
1407 map { $form->{"${_}_$i"} = $newform{$_} } qw(partnumber description bin unit weight listprice sellprice inventory_accno income_accno expense_accno partsgroup);
1409 # undo string formatting
1410 map { $form->{"${_}_$i"} =~ s/''/'/g } qw(partnumber description unit bin);
1412 $form->{sellprice} += $form->round_amount($form->{"sellprice_$i"} * $form->{"qty_$i"}, 2);
1413 $form->{weight} += $form->{"weight_$i"} * $form->{"qty_$i"};
1416 # set values for last invoice/order item
1417 $i = $form->{rowcount};
1418 $form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
1420 map { $form->{"${_}_$i"} = $newform{$_} } qw(partnumber description bin unit listprice inventory_accno income_accno expense_accno sellprice);
1421 $form->{"sellprice_$i"} = $newform{lastcost} if ($form->{vendor_id});
1423 if ($form->{exchangerate} != 0) {
1424 $form->{"sellprice_$i"} /= $form->{exchangerate};
1427 map { $form->{"taxaccounts_$i"} .= "$_ " if ($newform{"IC_tax_$_"}) } split / /, $newform{taxaccounts};
1428 chop $form->{"taxaccounts_$i"};
1430 # credit remaining calculation
1431 $amount = $form->{"sellprice_$i"} * (1 - $form->{"discount_$i"} / 100) * $form->{"qty_$i"};
1432 map { $form->{"${_}_base"} += $amount } (split / /, $form->{"taxaccounts_$i"});
1433 map { $amount += ($form->{"${_}_base"} * $form->{"${_}_rate"}) } split / /, $form->{"taxaccounts_$i"} if !$form->{taxincluded};
1435 $form->{creditremaining} -= $amount;
1439 $form->{"id_$i"} = $parts_id;
1440 delete $form->{action};
1442 # restore original callback
1443 $callback = $form->unescape($form->{callback});
1444 $form->{callback} = $form->unescape($form->{old_callback});
1445 delete $form->{old_callback};
1447 $form->{makemodel_rows}--;
1449 # put callback together
1450 foreach $key (keys %$form) {
1451 # do single escape for Apache 2.0
1452 $value = $form->escape($form->{$key}, 1);
1453 $callback .= qq|&$key=$value|;
1455 $form->{callback} = $callback;
1474 $rc = IC->delete(\%myconfig, \%$form);
1477 $form->redirect($locale->text('Item deleted!')) if ($rc > 0);
1478 $form->error($locale->text('Cannot delete item!'));
1484 sub stock_assembly {
1486 $form->{title} = $locale->text('Stock Assembly');
1493 <form method=post action=$form->{script}>
1495 <table width="100%">
1496 <tr><th class=listtop>$form->{title}</th></tr>
1497 <tr height="5"></tr>
1500 <table width="100%">
1502 <th width="1%" align="right" nowrap="true">|.$locale->text('Number').qq|</th>
1503 <td width="40%"><input name=partnumber size=20></td>
1507 <th align="right" nowrap="true">|.$locale->text('Description').qq|</th>
1508 <td colspan="2"><input name=description size=40></td>
1513 <tr><td><hr size=3 noshade></td></tr>
1516 <input type=hidden name=path value=$form->{path}>
1517 <input type=hidden name=login value=$form->{login}>
1518 <input type=hidden name=password value=$form->{password}>
1520 <input type=hidden name=nextsub value=list_assemblies>
1523 <input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
1535 sub list_assemblies {
1537 IC->retrieve_assemblies(\%myconfig, \%$form);
1539 $column_header{partnumber} = qq|<th class=listheading>|.$locale->text('Number').qq|</th>|;
1540 $column_header{description} = qq|<th class=listheading>|.$locale->text('Description').qq|</th>|;
1541 $column_header{bin} = qq|<th class=listheading>|.$locale->text('Bin').qq|</th>|;
1542 $column_header{onhand} = qq|<th class=listheading>|.$locale->text('Qty').qq|</th>|;
1543 $column_header{rop} = qq|<th class=listheading>|.$locale->text('ROP').qq|</th>|;
1544 $column_header{stock} = qq|<th class=listheading>|.$locale->text('Add').qq|</th>|;
1546 @column_index = (qw(partnumber description bin onhand rop stock));
1548 $form->{title} = $locale->text('Stock Assembly');
1550 $form->{callback} = "$form->{script}?action=stock_assembly&path=$form->{path}&login=$form->{login}&password=$form->{password}";
1554 $colspan = $#column_index + 1;
1559 <form method=post action=$form->{script}>
1562 <tr><th class=listtop colspan=$colspan>$form->{title}</th></tr>
1564 <tr class=listheading>|;
1566 map { print "\n$column_header{$_}" } @column_index;
1573 foreach $ref (@{ $form->{assembly_items} }) {
1575 map { $ref->{$_} =~ s/"/"/g } qw(partnumber description);
1577 # figure out how many to stock
1578 $form->{"qty_$i"} = $form->format_amount(\%myconfig, $ref->{rop} - $ref->{onhand});
1580 $column_data{partnumber} = qq|<td width=20%>$ref->{partnumber}</td>|;
1581 $column_data{description} = qq|<td width=50%>$ref->{description} </td>|;
1582 $column_data{bin} = qq|<td>$ref->{bin} </td>|;
1583 $column_data{onhand} = qq|<td align=right>|.$form->format_amount(\%myconfig, $ref->{onhand}, '', " ").qq|</td>|;
1584 $column_data{rop} = qq|<td align=right>|.$form->format_amount(\%myconfig, $ref->{rop}, '', " ").qq|</td>|;
1585 $column_data{stock} = qq|<td width=10%><input name="qty_$i" size=10 value=$form->{"qty_$i"}></td>|;
1588 print qq|<tr class=listrow$j><input name="id_$i" type=hidden value=$ref->{id}>\n|;
1590 map { print "\n$column_data{$_}" } @column_index;
1603 <td colspan=6><hr size=3 noshade>
1606 <input name=rowcount type=hidden value="$i">
1608 <input type=hidden name=path value=$form->{path}>
1609 <input type=hidden name=login value=$form->{login}>
1610 <input type=hidden name=password value=$form->{password}>
1612 <input name=callback type=hidden value="$form->{callback}">
1614 <input type=hidden name=nextsub value=restock_assemblies>
1617 <input class=submit type=submit name=action value="|.$locale->text('Continue').qq|">
1628 sub restock_assemblies {
1630 $form->redirect($locale->text('Assemblies restocked!')) if (IC->restock_assemblies(\%myconfig, \%$form));
1631 $form->error($locale->text('Cannot stock assemblies!'));
1636 sub continue { &{ $form->{nextsub} } };