X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FWH.pm;h=f05ba4fd5345e14fe94b7b9f164b9a8a673a5811;hb=9f4ef62c42dceef5a27ad3a0d8c8d260ffef9848;hp=3c3f65420b989e3976854b58a737d6c0c52d939e;hpb=1bbcb32cff12865da20d6f2dabc85d7683dca31e;p=kivitendo-erp.git diff --git a/SL/WH.pm b/SL/WH.pm index 3c3f65420..f05ba4fd5 100644 --- a/SL/WH.pm +++ b/SL/WH.pm @@ -99,15 +99,21 @@ sub transfer { $direction |= 1 if $src_bin; $direction |= 2 if $dst_bin; - my $transfer_type = $objectify->($transfer, 'transfer_type', 'SL::DB::TransferType', direction => $directions[$direction], - description => $transfer->{transfer_type}); + my $transfer_type_id; + if ($transfer->{transfer_type_id}) { + $transfer_type_id = $transfer->{transfer_type_id}; + } else { + my $transfer_type = $objectify->($transfer, 'transfer_type', 'SL::DB::TransferType', direction => $directions[$direction], + description => $transfer->{transfer_type}); + $transfer_type_id = $transfer_type->id; + } my $stocktaking_qty = $transfer->{stocktaking_qty}; my %params = ( part => $part, employee => $employee, - trans_type => $transfer_type, + trans_type_id => $transfer_type_id, project => $project, trans_id => $trans_id, shippingdate => !$transfer->{shippingdate} || $transfer->{shippingdate} eq 'current_date' @@ -801,8 +807,9 @@ sub get_warehouse_report { "chargeid" => "c.id", "warehousedescription" => "w.description", "partunit" => "p.unit", - "stock_value" => "p.lastcost / COALESCE(pfac.factor, 1)", + "stock_value" => ($form->{stock_value_basis} // '') eq 'list_price' ? "p.listprice / COALESCE(pfac.factor, 1)" : "p.lastcost / COALESCE(pfac.factor, 1)", "purchase_price" => "p.lastcost", + "list_price" => "p.listprice", ); $form->{l_classification_id} = 'Y'; $form->{l_part_type} = 'Y'; @@ -1328,7 +1335,7 @@ as the specific reason. The method is transaction safe, in case of errors not a single entry will be made in inventory. -Two prerequisites can be changed with this global parameters +Two prerequisites can be changed with these global parameters =over 2