my @apoe_filters = qw(transdate);
my @like_filters = (@simple_filters, @invoice_oi_filters);
my @all_columns = (@simple_filters, @makemodel_filters, @apoe_filters, @project_filters, qw(serialnumber));
- my @simple_l_switches = (@all_columns, qw(notes listprice sellprice lastcost priceupdate weight unit rop image));
+ my @simple_l_switches = (@all_columns, qw(notes listprice sellprice lastcost priceupdate weight unit rop image shop));
my @oe_flags = qw(bought sold onorder ordered rfq quoted);
my @qsooqr_flags = qw(invnumber ordnumber quonumber trans_id name module qty);
my @deliverydate_flags = qw(deliverydate);
push @bind_vars, $form->{"partsgroup_id"};
}
+ if ($form->{shop} ne '') {
+ $form->{l_shop} = '1'; # show the column
+ if ($form->{shop} eq '0' || $form->{shop} eq 'f') {
+ push @where_tokens, 'NOT p.shop';
+ $form->{shop} = 'f';
+ } else {
+ push @where_tokens, 'p.shop';
+ }
+ }
+
foreach (@like_filters) {
next unless $form->{$_};
$form->{"l_$_"} = '1'; # show the column
my $token_builder = $make_token_builder->(\%joins_needed);
- my @sort_cols = (@simple_filters, qw(id priceupdate onhand invnumber ordnumber quonumber name serialnumber soldtotal deliverydate));
+ my @sort_cols = (@simple_filters, qw(id priceupdate onhand invnumber ordnumber quonumber name serialnumber soldtotal deliverydate shop));
$form->{sort} = 'id' unless grep { $form->{"l_$_"} } grep { $form->{sort} eq $_ } @sort_cols; # sort by id if unknown or invisible column
my $sort_order = ($form->{revers} ? ' DESC' : ' ASC');
my $order_clause = " ORDER BY " . $token_builder->($form->{sort}) . ($form->{revers} ? ' DESC' : ' ASC');
'transdate' => { 'text' => $locale->text('Transdate'), },
'unit' => { 'text' => $locale->text('Unit'), },
'weight' => { 'text' => $locale->text('Weight'), },
+ 'shop' => { 'text' => $locale->text('Shopartikel'), },
'projectnumber' => { 'text' => $locale->text('Project Number'), },
'projectdescription' => { 'text' => $locale->text('Project Description'), },
);
my @itemstatus_keys = qw(active obsolete orphaned onhand short);
my @callback_keys = qw(onorder ordered rfq quoted bought sold partnumber partsgroup partsgroup_id serialnumber description make model
- drawing microfiche l_soldtotal l_deliverydate transdatefrom transdateto ean);
+ drawing microfiche l_soldtotal l_deliverydate transdatefrom transdateto ean shop);
# calculate dependencies
for (@itemstatus_keys, @callback_keys) {
linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost
priceupdate weight image drawing microfiche invnumber ordnumber quonumber
transdate name serialnumber deliverydate ean projectnumber projectdescription
+ shop
);
my $pricegroups = SL::DB::Manager::Pricegroup->get_all(sort => 'id');
%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), @pricegroup_columns;
+ map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal shop), @pricegroup_columns;
my @hidden_variables = (
qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups),
my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
- my @sort_full = qw(partnumber description onhand soldtotal deliverydate);
+ my @sort_full = qw(partnumber description onhand soldtotal deliverydate shop);
my @sort_no_revers = qw(partsgroup bin priceupdate invnumber ordnumber quonumber name image drawing serialnumber);
foreach my $col (@sort_full) {
$row->{weight}->{data} .= ' ' . $defaults->{weightunit};
+ # 'yes' and 'no' for boolean value shop
+ if ($form->{l_shop}) {
+ $row->{shop}{data} = $row->{shop}{data}? $::locale->text('yes') : $::locale->text('no');
+ }
+
if (!$ref->{assemblyitem}) {
foreach my $col (@subtotal_columns) {
$totals{$col} += $soldtotal * $ref->{$col};
<td><input name="microfiche" size="20"></td>
</tr>
+ <tr>
+ <th align="right" nowrap>[% 'Shopartikel' | $T8 %]</th>
+ <td>[% L.yes_no_tag('shop', shop, default='', with_empty=1, empty_title='---') %]</td>
+ </tr>
+
[% CUSTOM_VARIABLES_FILTER_CODE %]
[%- IF is_assembly %]
<tr>
<td>[%- L.checkbox_tag('l_notes', label=LxERP.t8('Notes'), value='Y') %]</td>
<td>[%- L.checkbox_tag('l_name', label=LxERP.t8('Name in Selected Records'), value='Y') %]</td>
+ <td>[%- L.checkbox_tag('l_shop', label=LxERP.t8('Shopartikel'), value='Y') %]</td>
</tr>
[% CUSTOM_VARIABLES_INCLUSION_CODE %]