X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/a34c05f386bc2abb45a097dcb4d68e8ab2f5af94..0e4da157188830a45e606285bca5d0ea668bbcf5:/SL/DO.pm diff --git a/SL/DO.pm b/SL/DO.pm index 17876e514..eb74e26c7 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -69,7 +69,7 @@ sub transactions { dord.transdate, dord.reqdate, ct.${vc}number, ct.name, dord.${vc}_id, dord.globalproject_id, dord.closed, dord.delivered, dord.shippingpoint, dord.shipvia, - dord.transaction_description, + dord.transaction_description, dord.itime::DATE AS insertdate, pr.projectnumber AS globalprojectnumber, dep.description AS department, e.name AS employee, @@ -119,7 +119,7 @@ sub transactions { } if (!$main::auth->assert('sales_all_edit', 1)) { push @where, qq|dord.employee_id = (select id from employee where login= ?)|; - push @values, $form->{login}; + push @values, $::myconfig{login}; } foreach my $item (qw(donumber ordnumber cusordnumber transaction_description)) { @@ -163,6 +163,16 @@ sub transactions { push @values, conv_date($form->{reqdateto}); } + if($form->{insertdatefrom}) { + push @where, qq|dord.itime::DATE >= ?|; + push@values, conv_date($form->{insertdatefrom}); + } + + if($form->{insertdateto}) { + push @where, qq|dord.itime::DATE <= ?|; + push @values, conv_date($form->{insertdateto}); + } + if (@where) { $query .= " WHERE " . join(" AND ", map { "($_)" } @where); } @@ -179,6 +189,7 @@ sub transactions { "shipvia" => "dord.shipvia", "transaction_description" => "dord.transaction_description", "department" => "lower(dep.description)", + "insertdate" => "dord.itime", ); my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; @@ -298,7 +309,7 @@ SQL CVar->get_non_editable_ic_cvars(form => $form, dbh => $dbh, - row => $i, + row => $i, sub_module => 'delivery_order_items', may_converted_from => ['orderitems', 'delivery_order_items']); @@ -673,7 +684,7 @@ sub retrieve { dord.shipto_id, dord.globalproject_id, dord.delivered, dord.transaction_description, dord.taxzone_id, dord.taxincluded, dord.terms, (SELECT cu.name FROM currencies cu WHERE cu.id=dord.currency_id) AS currency, - dord.delivery_term_id + dord.delivery_term_id, dord.itime::DATE AS insertdate FROM delivery_orders dord JOIN ${vc} cv ON (dord.${vc}_id = cv.id) LEFT JOIN employee e ON (dord.employee_id = e.id) @@ -1008,7 +1019,7 @@ sub order_details { CVar->get_non_editable_ic_cvars(form => $form, dbh => $dbh, - row => $i, + row => $i, sub_module => 'delivery_order_items', may_converted_from => ['orderitems', 'delivery_order_items']); @@ -1190,6 +1201,7 @@ sub transfer_in_out { 'transfer_type' => $params{direction} eq 'in' ? 'stock' : 'shipped', 'project_id' => $request->{project_id}, 'delivery_order_items_stock_id' => $request->{delivery_order_items_stock_id}, + 'comment' => $request->{comment}, }; }