X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FWH.pm;h=6fab5ec63b2819d8e464f8133530b9d81ec135d2;hb=c7241bf7c547d63999898dee7b5dd486e4d122d3;hp=73e0365d95454f069d07df6387dcb33d8855ac38;hpb=e2cb496badd343f860266a59ecd668f3c4bd0d5b;p=kivitendo-erp.git diff --git a/SL/WH.pm b/SL/WH.pm index 73e0365d9..6fab5ec63 100644 --- a/SL/WH.pm +++ b/SL/WH.pm @@ -348,12 +348,12 @@ sub get_warehouse_journal { } 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_ary, "?::DATE >= i1.itime::DATE"; + push @filter_ary, "? >= i1.shippingdate"; push @filter_vars, $form->{todate}; } @@ -383,8 +383,8 @@ sub get_warehouse_journal { 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"); @@ -409,8 +409,9 @@ sub get_warehouse_journal { "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", "itime" => "i1.itime", + "shippingdate" => "i1.shippingdate", "employee" => "e.name", "projectnumber" => "COALESCE(pr.projectnumber, '$filter{na}')", }; @@ -431,13 +432,14 @@ sub get_warehouse_journal { # 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_$'" } - ( 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 : ''; + my $query = qq|SELECT DISTINCT $select{trans} FROM inventory i1 @@ -658,7 +660,7 @@ sub get_warehouse_report { } if ($filter{date}) { - push @filter_ary, "i.itime <= ?"; + push @filter_ary, "i.shippingdate <= ?"; push @filter_vars, $filter{date}; } if (!$filter{include_invalid_warehouses}){ @@ -1000,7 +1002,7 @@ SL::WH - Warehouse backend =head1 DESCRIPTION -Backend for lx-office warehousing functions. +Backend for kivitendo warehousing functions. =head1 FUNCTIONS @@ -1014,7 +1016,7 @@ is called like this: qty => 12.45, transfer_type => 'transfer', src_warehouse_id => 12, - stc_bin_id => 23, + src_bin_id => 23, dst_warehouse_id => 25, dst_bin_id => 167, });