-sub parts_subtotal {
- $lxdebug->enter_sub();
-
- $auth->assert('part_service_assembly_edit');
-
- my (%column_data);
- my ($column_index, $subtotalonhand, $subtotalsellprice, $subtotallastcost, $subtotallistprice) = @_;
-
- map { $column_data{$_} = "<td> </td>" } @{ $column_index };
- $$subtotalonhand = 0 if ($form->{searchitems} eq 'assembly' && $form->{bom});
-
- $column_data{onhand} =
- "<th class=listsubtotal align=right>"
- . $form->format_amount(\%myconfig, $$subtotalonhand)
- . "</th>";
-
- $column_data{linetotalsellprice} =
- "<th class=listsubtotal align=right>"
- . $form->format_amount(\%myconfig, $$subtotalsellprice, 2)
- . "</th>";
- $column_data{linetotallistprice} =
- "<th class=listsubtotal align=right>"
- . $form->format_amount(\%myconfig, $$subtotallistprice, 2)
- . "</th>";
- $column_data{linetotallastcost} =
- "<th class=listsubtotal align=right>"
- . $form->format_amount(\%myconfig, $$subtotallastcost, 2)
- . "</th>";
-
- $$subtotalonhand = 0;
- $$subtotalsellprice = 0;
- $$subtotallistprice = 0;
- $$subtotallastcost = 0;
-
- print "<tr class=listsubtotal>";
-
- map { print "\n$column_data{$_}" } @{ $column_index };
-
- print qq|
- </tr>
-|;
-
- $lxdebug->leave_sub();
-}
-
-sub ajax_autocomplete {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
-
- $form->{column} = 'description' unless $form->{column} =~ /^partnumber|description$/;
- $form->{$form->{column}} = $form->{q} || '';
- $form->{limit} = ($form->{limit} * 1) || 10;
- $form->{searchitems} ||= '';
-
- my @results = IC->all_parts(\%myconfig, $form);
-
- print $form->ajax_response_header(),
- $form->parse_html_template('ic/ajax_autocomplete');
-
- $main::lxdebug->leave_sub();
-}
-
-sub back_to_record {
- _check_io_auth();
-
-
- delete @{$::form}{qw(action action_add action_back_to_record back_sub description item notes partnumber sellprice taxaccount2 unit vc)};
-
- $::auth->restore_form_from_session($::form->{previousform}, clobber => 1);
- $::form->{rowcount}--;
- $::form->{action} = 'display_form';
- $::form->{callback} = $::form->{script} . '?' . join('&', map { $::form->escape($_) . '=' . $::form->escape($::form->{$_}) } sort keys %{ $::form });
- $::form->redirect;