... im Bericht anzeigen und danach filtern.
Conflicts:
SL/IC.pm
bin/mozilla/ic.pl
templates/webpages/ic/search.html
Übernahme aus Kundenprojekt.
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 shop));
+ my @simple_l_switches = (@all_columns, qw(notes listprice sellprice lastcost priceupdate weight unit rop image shop insertdate));
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);
'ioi.id' => 'ioi_id',
'ioi.ioi' => 'ioi',
'projectdescription' => 'projectdescription',
+ 'insertdate' => 'insertdate',
);
my %real_column = (
projectdescription => 'description',
+ insertdate => 'itime::DATE',
);
if (($form->{searchitems} eq 'assembly') && $form->{l_lastcost}) {
}
}
+ # special case insertdate
+ if (grep { $form->{$_} } qw(insertdatefrom insertdateto)) {
+ $form->{"l_insertdate"} = 1;
+ push @select_tokens, 'insertdate';
+
+ my $token_builder = $make_token_builder->();
+ my $token = $token_builder->('insertdate');
+
+ for (qw(insertdatefrom insertdateto)) {
+ next unless $form->{$_};
+ push @where_tokens, sprintf "$token %s ?", /from$/ ? '>=' : '<=';
+ push @bind_vars, $form->{$_};
+ }
+ }
+
if ($form->{"partsgroup_id"}) {
$form->{"l_partsgroup"} = '1'; # show the column
push @where_tokens, "pg.id = ?";
my $token_builder = $make_token_builder->(\%joins_needed);
- my @sort_cols = (@simple_filters, qw(id priceupdate onhand invnumber ordnumber quonumber name serialnumber soldtotal deliverydate shop));
+ my @sort_cols = (@simple_filters, qw(id priceupdate onhand invnumber ordnumber quonumber name serialnumber soldtotal deliverydate insertdate 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');
if ($form->{searchitems} eq 'assembly' && $form->{bom}) {
$query =
qq|SELECT p.id, p.partnumber, p.description, a.qty AS onhand,
- p.unit, p.notes,
+ p.unit, p.notes, p.itime::DATE as insertdate,
p.sellprice, p.listprice, p.lastcost,
p.rop, p.weight, p.priceupdate,
p.image, p.drawing, p.microfiche,
'drawing' => { 'text' => $locale->text('Drawing'), },
'ean' => { 'text' => $locale->text('EAN'), },
'image' => { 'text' => $locale->text('Image'), },
+ 'insertdate' => { 'text' => $locale->text('Insert Date'), },
'invnumber' => { 'text' => $locale->text('Invoice Number'), },
'lastcost' => { 'text' => $locale->text('Last Cost'), },
'linetotallastcost' => { 'text' => $locale->text('Extended'), },
microfiche => $locale->text('Microfiche') . ": '$form->{microfiche}'",
l_soldtotal => $locale->text('Qty in Selected Records'),
ean => $locale->text('EAN') . ": '$form->{ean}'",
+ insertdatefrom => $locale->text('Insert Date') . ": " . $locale->text('From') . " " . $locale->date(\%myconfig, $form->{insertdatefrom}, 1),
+ insertdateto => $locale->text('Insert Date') . ": " . $locale->text('To (time)') . " " . $locale->date(\%myconfig, $form->{insertdateto}, 1),
);
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 shop);
+ drawing microfiche l_soldtotal l_deliverydate transdatefrom transdateto insertdatefrom insertdateto 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
+ insertdate shop
);
my $pricegroups = SL::DB::Manager::Pricegroup->get_all(sort => 'id');
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),
+ qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups insertdatefrom insertdateto),
@itemstatus_keys,
@callback_keys,
map({ "cvar_$_->{name}" } @searchable_custom_variables),
my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
- my @sort_full = qw(partnumber description onhand soldtotal deliverydate shop);
+ my @sort_full = qw(partnumber description onhand soldtotal deliverydate insertdate shop);
my @sort_no_revers = qw(partsgroup bin priceupdate invnumber ordnumber quonumber name image drawing serialnumber);
foreach my $col (@sort_full) {
<td>[% L.yes_no_tag('shop', shop, default='', with_empty=1, empty_title='---') %]</td>
</tr>
+ <tr>
+ <th align="right">[% 'Insert Date' | $T8 %]</th>
+ <td>
+ [% 'From' | $T8 %][% L.date_tag('insertdatefrom') %]
+ [% 'Bis' | $T8 %] [% L.date_tag('insertdateto') %]
+ </td>
+ </tr>
+
[% CUSTOM_VARIABLES_FILTER_CODE %]
[%- IF is_assembly %]
<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>
+ <td>[%- L.checkbox_tag('l_insertdate', label=LxERP.t8('Insert Date'), value='Y') %]</td>
</tr>
[% CUSTOM_VARIABLES_INCLUSION_CODE %]