insertdate => 'itime::DATE',
);
- if ($form->{l_assembly} && $form->{l_lastcost}) {
- @simple_l_switches = grep { $_ ne 'lastcost' } @simple_l_switches;
}
my $make_token_builder = sub {
FROM assembly a_lc
LEFT JOIN parts p_lc ON (a_lc.parts_id = p_lc.id)
LEFT JOIN price_factors pfac_lc ON (p_lc.price_factor_id = pfac_lc.id)
- WHERE (a_lc.id = p.id)) AS lastcost|;
+ WHERE (a_lc.id = p.id)) AS assembly_lastcost|;
$table_prefix{$q_assembly_lastcost} = ' ';
# special case makemodel search
'insertdate' => { 'text' => $locale->text('Insert Date'), },
'invnumber' => { 'text' => $locale->text('Invoice Number'), },
'lastcost' => { 'text' => $locale->text('Last Cost'), },
+ 'assembly_lastcost' => { 'text' => $locale->text('Assembly Last Cost'), },
'linetotallastcost' => { 'text' => $locale->text('Extended'), },
'linetotallistprice' => { 'text' => $locale->text('Extended'), },
'linetotalsellprice' => { 'text' => $locale->text('Extended'), },
$column_defs{sellprice}{text} = $locale->text('Price');
$form->{l_lastcost} = ""
}
+ $form->{l_assembly_lastcost} = "Y" if $form->{l_assembly} && $form->{l_lastcost};
if ($form->{description}) {
$description = $form->{description};
my @columns = qw(
partnumber type_and_classific description notes partsgroup warehouse bin
make model onhand rop soldtotal unit listprice
- linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost
+ linetotallistprice sellprice linetotalsellprice lastcost assembly_lastcost linetotallastcost
priceupdate weight image drawing microfiche invnumber ordnumber quonumber
transdate name serialnumber deliverydate ean projectnumber projectdescription
insertdate shop
%column_defs = (%column_defs, %column_defs_cvars, %column_defs_pricegroups);
map { $column_defs{$_}->{visible} ||= $form->{"l_$_"} ? 1 : 0 } @columns;
- map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal shop), @pricegroup_columns;
+ map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost assembly_lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal shop), @pricegroup_columns;
my @hidden_variables = (
qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups insertdatefrom insertdateto),
$ref->{sellprice} *= $ref->{exchangerate} / $ref->{price_factor};
$ref->{listprice} *= $ref->{exchangerate} / $ref->{price_factor};
$ref->{lastcost} *= $ref->{exchangerate} / $ref->{price_factor};
+ $ref->{assembly_lastcost} *= $ref->{exchangerate} / $ref->{price_factor};
# use this for assemblies
my $soldtotal = $bsooqr_mode ? $ref->{soldtotal} : $ref->{onhand};
$row->{partnumber}->{link} = $edit_link;
$row->{description}->{link} = $edit_link;
- foreach (qw(sellprice listprice lastcost)) {
+ foreach (qw(sellprice listprice lastcost assembly_lastcost)) {
$row->{$_}{data} = $form->format_amount(\%myconfig, $ref->{$_}, 2);
$row->{"linetotal$_"}{data} = $form->format_amount(\%myconfig, $ref->{onhand} * $ref->{$_}, 2);
}