Revision 8fd88684
Von Kivitendo Admin vor etwa 9 Jahren hinzugefügt
SL/WH.pm | ||
---|---|---|
348 | 348 |
} |
349 | 349 |
|
350 | 350 |
if ($form->{fromdate}) { |
351 |
push @filter_ary, "?::DATE <= i1.itime::DATE";
|
|
351 |
push @filter_ary, "? <= i1.shippingdate";
|
|
352 | 352 |
push @filter_vars, $form->{fromdate}; |
353 | 353 |
} |
354 | 354 |
|
355 | 355 |
if ($form->{todate}) { |
356 |
push @filter_ary, "?::DATE >= i1.itime::DATE";
|
|
356 |
push @filter_ary, "? >= i1.shippingdate";
|
|
357 | 357 |
push @filter_vars, $form->{todate}; |
358 | 358 |
} |
359 | 359 |
|
... | ... | |
383 | 383 |
my $sort_order = $form->{order}; |
384 | 384 |
|
385 | 385 |
$sort_col = $filter{sort} unless $sort_col; |
386 |
$sort_order = ($sort_col = 'itime') unless $sort_col;
|
|
387 |
$sort_col = 'itime' if $sort_col eq 'date';
|
|
386 |
$sort_order = ($sort_col = 'shippingdate') unless $sort_col;
|
|
387 |
$sort_col = 'shippingdate' if $sort_col eq 'date';
|
|
388 | 388 |
$sort_order = $filter{order} unless $sort_order; |
389 | 389 |
my $sort_spec = "${sort_col} " . ($sort_order ? " DESC" : " ASC"); |
390 | 390 |
|
... | ... | |
409 | 409 |
"trans_id" => "i1.trans_id", |
410 | 410 |
"oe_id" => "COALESCE(i1.oe_id, i2.oe_id)", |
411 | 411 |
"invoice_id" => "COALESCE(i1.invoice_id, i2.invoice_id)", |
412 |
"date" => "i1.itime::DATE",
|
|
412 |
"date" => "i1.shippingdate",
|
|
413 | 413 |
"itime" => "i1.itime", |
414 |
"shippingdate" => "i1.shippingdate", |
|
414 | 415 |
"employee" => "e.name", |
415 | 416 |
"projectnumber" => "COALESCE(pr.projectnumber, '$filter{na}')", |
416 | 417 |
}; |
... | ... | |
431 | 432 |
# take all the requested ones from the first hash and overwrite them from the out/in hashes if present. |
432 | 433 |
for my $i ('trans', 'out', 'in') { |
433 | 434 |
$select{$i} = join ', ', map { +/^l_/; ($select_tokens{$i}{"$'"} || $select_tokens{'trans'}{"$'"}) . " AS r_$'" } |
434 |
( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_qty l_partunit l_itime) );
|
|
435 |
( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_qty l_partunit l_shippingdate) );
|
|
435 | 436 |
} |
436 | 437 |
|
437 | 438 |
my $group_clause = join ", ", map { +/^l_/; "r_$'" } |
438 |
( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_partunit l_itime) );
|
|
439 |
( grep( { !/qty$/ and /^l_/ and $form->{$_} eq 'Y' } keys %$form), qw(l_parts_id l_partunit l_shippingdate) );
|
|
439 | 440 |
|
440 | 441 |
$where_clause = defined($where_clause) ? $where_clause : ''; |
442 |
|
|
441 | 443 |
my $query = |
442 | 444 |
qq|SELECT DISTINCT $select{trans} |
443 | 445 |
FROM inventory i1 |
... | ... | |
658 | 660 |
} |
659 | 661 |
|
660 | 662 |
if ($filter{date}) { |
661 |
push @filter_ary, "i.itime <= ?";
|
|
663 |
push @filter_ary, "i.shippingdate <= ?";
|
|
662 | 664 |
push @filter_vars, $filter{date}; |
663 | 665 |
} |
664 | 666 |
if (!$filter{include_invalid_warehouses}){ |
Auch abrufbar als: Unified diff
Lagerberichte auf shippingdate statt itime umgestellt
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.