-sub stock_assembly {
- $lxdebug->enter_sub();
-
- $form->{title} = $locale->text('Stock Assembly');
-
- $form->header;
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<table width="100%">
- <tr>
- <th class=listtop>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr valign=top>
- <td>
- <table>
- <tr>
- <th align="right" nowrap="true">|
- . $locale->text('Part Number') . qq|</th>
- <td><input name=partnumber size=20></td>
- <td> </td>
- </tr>
- <tr>
- <th align="right" nowrap="true">|
- . $locale->text('Part Description') . qq|</th>
- <td><input name=description size=40></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr><td><hr size=3 noshade></td></tr>
-</table>
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input type=hidden name=nextsub value=list_assemblies>
-
-<br>
-<input class=submit type=submit name=action value="|
- . $locale->text('Continue') . qq|">
-</form>
-
-</body>
-</html>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub list_assemblies {
- $lxdebug->enter_sub();
-
- IC->retrieve_assemblies(\%myconfig, \%$form);
-
- $column_header{partnumber} =
- qq|<th class=listheading>| . $locale->text('Part Number') . qq|</th>|;
- $column_header{description} =
- qq|<th class=listheading>| . $locale->text('Part Description') . qq|</th>|;
- $column_header{bin} =
- qq|<th class=listheading>| . $locale->text('Bin') . qq|</th>|;
- $column_header{onhand} =
- qq|<th class=listheading>| . $locale->text('Qty') . qq|</th>|;
- $column_header{rop} =
- qq|<th class=listheading>| . $locale->text('ROP') . qq|</th>|;
- $column_header{stock} =
- qq|<th class=listheading>| . $locale->text('Add') . qq|</th>|;
-
- @column_index = (qw(partnumber description bin onhand rop stock));
-
- $form->{title} = $locale->text('Stock Assembly');
-
- $form->{callback} =
- "$form->{script}?action=stock_assembly&path=$form->{path}&login=$form->{login}&password=$form->{password}";
-
- $form->header;
-
- $colspan = $#column_index + 1;
-
- print qq|
-<body>
-
-<form method=post action=$form->{script}>
-
-<table width=100%>
- <tr>
- <th class=listtop colspan=$colspan>$form->{title}</th>
- </tr>
- <tr size=5></tr>
- <tr class=listheading>|;
-
- map { print "\n$column_header{$_}" } @column_index;
-
- print qq|
- </tr>
-|;
-
- $i = 1;
- foreach $ref (@{ $form->{assembly_items} }) {
-
- map { $ref->{$_} =~ s/\"/"/g } qw(partnumber description);
-
- $column_data{partnumber} = qq|<td width=20%>$ref->{partnumber}</td>|;
- $column_data{description} =
- qq|<td width=50%>$ref->{description} </td>|;
- $column_data{bin} = qq|<td>$ref->{bin} </td>|;
- $column_data{onhand} =
- qq|<td align=right>|
- . $form->format_amount(\%myconfig, $ref->{onhand}, '', " ")
- . qq|</td>|;
- $column_data{rop} =
- qq|<td align=right>|
- . $form->format_amount(\%myconfig, $ref->{rop}, '', " ")
- . qq|</td>|;
- $column_data{stock} = qq|<td width=10%><input name="qty_$i" size=10></td>|;
-
- $j++;
- $j %= 2;
- print
- qq|<tr class=listrow$j><input name="id_$i" type=hidden value=$ref->{id}>\n|;
-
- map { print "\n$column_data{$_}" } @column_index;
-
- print qq|
- </tr>
-|;
-
- $i++;
-
- }
-
- $i--;
- print qq|
- <tr>
- <td colspan=6><hr size=3 noshade>
- </tr>
-</table>
-<input name=rowcount type=hidden value="$i">
-
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
-<input name=callback type=hidden value="$form->{callback}">
-
-<input type=hidden name=nextsub value=restock_assemblies>
-
-<br>
-<input class=submit type=submit name=action value="|
- . $locale->text('Continue') . qq|">
-
-</form>
-
-</body>
-</html>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub restock_assemblies {
- $lxdebug->enter_sub();
-
- $form->redirect($locale->text('Assemblies restocked!'))
- if (IC->restock_assemblies(\%myconfig, \%$form));
- $form->error($locale->text('Cannot stock assemblies!'));
-
- $lxdebug->leave_sub();
-}
-