'transdate' => { 'text' => $locale->text('Transdate'), },
'unit' => { 'text' => $locale->text('Unit'), },
'weight' => { 'text' => $locale->text('Weight'), },
+ 'projectnumber' => { 'text' => $locale->text('Project Number'), },
+ 'projectdescription' => { 'text' => $locale->text('Project Description'), },
);
$revers = $form->{revers};
model => $locale->text('Model') . ": '$form->{model}'",
drawing => $locale->text('Drawing') . ": '$form->{drawing}'",
microfiche => $locale->text('Microfiche') . ": '$form->{microfiche}'",
- l_soldtotal => $locale->text('soldtotal'),
+ l_soldtotal => $locale->text('Qty in Selected Records'),
ean => $locale->text('EAN') . ": '$form->{ean}'",
);
}
if ($form->{l_linetotal}) {
- $form->{l_onhand} = "Y";
+ $form->{l_qty} = "Y";
$form->{l_linetotalsellprice} = "Y" if $form->{l_sellprice};
$form->{l_linetotallastcost} = $form->{searchitems} eq 'assembly' && !$form->{bom} ? "" : 'Y' if $form->{l_lastcost};
$form->{l_linetotallistprice} = "Y" if $form->{l_listprice};
|| $form->{ordered}
|| $form->{rfq}
|| $form->{quoted}) {
- $form->{l_onhand} = "Y";
+# $form->{l_onhand} = "Y";
} else {
$form->{l_linetotalsellprice} = "";
$form->{l_linetotallastcost} = "";
}
}
+ # soldtotal doesn't make sense with more than one bsooqr option.
+ # so reset it to sold (the most common option), and issue a warning
+ my @bsooqr = qw(sold bought onorder ordered rfq quoted);
+ if ($form->{l_subtotal} && 1 < grep { $form->{$_} } @bsooqr) {
+ my $enabled = first { $form->{$_} } @bsooqr;
+ $form->{$_} = '' for @bsooqr;
+ $form->{$enabled} = 'Y';
+
+ push @options, $::locale->text('Subtotal cannot distinguish betweens record types. Only one of the selected record types will be displayed: #1', $optiontexts{$enabled});
+ }
+
IC->all_parts(\%myconfig, \%$form);
my @columns = qw(
partnumber description partsgroup bin onhand rop soldtotal unit listprice
linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost
priceupdate weight image drawing microfiche invnumber ordnumber quonumber
- transdate name serialnumber deliverydate ean
+ transdate name serialnumber deliverydate ean projectnumber projectdescription
);
my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
$ref->{lastcost} *= $ref->{exchangerate} / $ref->{price_factor};
# use this for assemblies
- my $onhand = $ref->{onhand};
+ my $soldtotal = $ref->{soldtotal};
if ($ref->{assemblyitem}) {
$row->{partnumber}{align} = 'right';
- $row->{onhand}{data} = 0;
- $onhand = 0 if ($form->{sold});
+ $row->{soldtotal}{data} = 0;
+ $soldtotal = 0 if ($form->{sold});
}
my $edit_link = build_std_url('action=edit', 'id=' . E($ref->{id}), 'callback');
if (!$ref->{assemblyitem}) {
foreach my $col (@subtotal_columns) {
- $totals{$col} += $onhand * $ref->{$col};
- $subtotals{$col} += $onhand * $ref->{$col};
+ $totals{$col} += $soldtotal * $ref->{$col};
+ $subtotals{$col} += $soldtotal * $ref->{$col};
}
- $subtotals{onhand} += $onhand;
+ $subtotals{soldtotal} += $soldtotal;
}
# set module stuff
my $row = { map { $_ => { 'class' => 'listsubtotal', } } @columns };
if (($form->{searchitems} ne 'assembly') || !$form->{bom}) {
- $row->{onhand}->{data} = $form->format_amount(\%myconfig, $subtotals{onhand});
+ $row->{soldtotal}->{data} = $form->format_amount(\%myconfig, $subtotals{soldtotal});
}
map { $row->{"linetotal$_"}->{data} = $form->format_amount(\%myconfig, $subtotals{$_}, 2) } @subtotal_columns;
- map { $subtotals{$_} = 0 } ('onhand', @subtotal_columns);
+ map { $subtotals{$_} = 0 } ('soldtotal', @subtotal_columns);
$report->add_data($row);
qw(weight listprice sellprice rop);
$form->{assembly_rows}--;
- $i = $newform{rowcount};
+ $i = $form->{assembly_rows};
$form->{"qty_$i"} = 1 unless ($form->{"qty_$i"});
$form->{sellprice} -= $form->{"sellprice_$i"} * $form->{"qty_$i"};
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';