summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
3c69e83)
Die beiden Lagerberichte Lagerbestand und Lagerbuchungen prüfen auf
itime statt auf shippingdate. Normalerweise sind diese beiden Daten
identisch (bis auf den Zeitanteil von itime), da man bei den meisten
Lagerbewegungen kein vom aktuellen Tag abweichendes Lagerdatum angeben
kann. Beim CSV-Import von Lagerbuchungen, z.B. für die Inventur, kann
man aber sehr wohl ein abweichendes Lagerdatum angeben, dies wurde bei
den beiden Berichten aber bisher nicht berücksichtigt. Daher wurde dies
jetzt umgestellt.
}
if ($form->{fromdate}) {
}
if ($form->{fromdate}) {
- push @filter_ary, "?::DATE <= i1.itime::DATE";
+ push @filter_ary, "? <= i1.shippingdate";
push @filter_vars, $form->{fromdate};
}
if ($form->{todate}) {
push @filter_vars, $form->{fromdate};
}
if ($form->{todate}) {
- push @filter_ary, "?::DATE >= i1.itime::DATE";
+ push @filter_ary, "? >= i1.shippingdate";
push @filter_vars, $form->{todate};
}
push @filter_vars, $form->{todate};
}
my $sort_order = $form->{order};
$sort_col = $filter{sort} unless $sort_col;
my $sort_order = $form->{order};
$sort_col = $filter{sort} unless $sort_col;
- $sort_order = ($sort_col = 'itime') unless $sort_col;
- $sort_col = 'itime' if $sort_col eq 'date';
+ $sort_order = ($sort_col = 'shippingdate') unless $sort_col;
+ $sort_col = 'shippingdate' if $sort_col eq 'date';
$sort_order = $filter{order} unless $sort_order;
my $sort_spec = "${sort_col} " . ($sort_order ? " DESC" : " ASC");
$sort_order = $filter{order} unless $sort_order;
my $sort_spec = "${sort_col} " . ($sort_order ? " DESC" : " ASC");
"trans_id" => "i1.trans_id",
"oe_id" => "COALESCE(i1.oe_id, i2.oe_id)",
"invoice_id" => "COALESCE(i1.invoice_id, i2.invoice_id)",
"trans_id" => "i1.trans_id",
"oe_id" => "COALESCE(i1.oe_id, i2.oe_id)",
"invoice_id" => "COALESCE(i1.invoice_id, i2.invoice_id)",
- "date" => "i1.itime::DATE",
+ "date" => "i1.shippingdate",
+ "shippingdate" => "i1.shippingdate",
"employee" => "e.name",
"projectnumber" => "COALESCE(pr.projectnumber, '$filter{na}')",
};
"employee" => "e.name",
"projectnumber" => "COALESCE(pr.projectnumber, '$filter{na}')",
};
# take all the requested ones from the first hash and overwrite them from the out/in hashes if present.
for my $i ('trans', 'out', 'in') {
$select{$i} = join ', ', map { +/^l_/; ($select_tokens{$i}{"$'"} || $select_tokens{'trans'}{"$'"}) . " AS r_$'" }
# take all the requested ones from the first hash and overwrite them from the out/in hashes if present.
for my $i ('trans', 'out', 'in') {
$select{$i} = join ', ', map { +/^l_/; ($select_tokens{$i}{"$'"} || $select_tokens{'trans'}{"$'"}) . " AS r_$'" }
- ( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_qty l_partunit l_itime) );
+ ( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_qty l_partunit l_shippingdate) );
}
my $group_clause = join ", ", map { +/^l_/; "r_$'" }
}
my $group_clause = join ", ", map { +/^l_/; "r_$'" }
- ( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_partunit l_itime) );
+ ( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_partunit l_shippingdate) );
$where_clause = defined($where_clause) ? $where_clause : '';
$where_clause = defined($where_clause) ? $where_clause : '';
my $query =
qq|SELECT DISTINCT $select{trans}
FROM inventory i1
my $query =
qq|SELECT DISTINCT $select{trans}
FROM inventory i1
- push @filter_ary, "i.itime <= ?";
+ push @filter_ary, "i.shippingdate <= ?";
push @filter_vars, $filter{date};
}
if (!$filter{include_invalid_warehouses}){
push @filter_vars, $filter{date};
}
if (!$filter{include_invalid_warehouses}){