update
This commit is contained in:
@@ -848,30 +848,23 @@ class EcmSale extends SugarBean
|
||||
if ($array['date_to'] != '') $field_array[] = "delivery_date<='" . date("Y-m-d", strtotime($array['date_to'])) . "'";
|
||||
if ($array['date_send_from'] != '') $field_array[] = "send_date>='" . date("Y-m-d", strtotime($array['date_send_from'])) . "'";
|
||||
if ($array['date_send_to'] != '') $field_array[] = "send_date<='" . date("Y-m-d", strtotime($array['date_send_to'])) . "'";
|
||||
if ($array['time_from'] != '') $field_array[] = "date_entered>='" . date("Y-m-d", strtotime($array['time_from'])) . "'";
|
||||
if ($array['time_to'] != '') $field_array[] = "date_entered<='" . date("Y-m-d", strtotime($array['time_to'])) . "'";
|
||||
if ($array['account_id'] != '') $field_array[] = "parent_id='" . $array['account_id'] . "'";
|
||||
if ($array['account_name'] != '') $field_array[] = "parent_name like '" . $array['account_name'] . "'";
|
||||
if ($array['parent_order_no'] != '') $field_array[] = "parent_document_no='" . $array['parent_order_no'] . "'";
|
||||
switch ($array ['sale_type']) {
|
||||
case 'all' :
|
||||
$field_array[] = "type IN ('sales_order', 'gratis')";
|
||||
break;
|
||||
case 'sale' :
|
||||
$field_array[] = "type='sales_order'";
|
||||
break;
|
||||
case 'gratis' :
|
||||
$field_array[] = "type='gratis'";
|
||||
break;
|
||||
|
||||
if ($array['sale_type'] != null) {
|
||||
$field_array [] = "type IN ('" . implode($array['sale_type'], "','") . "')";
|
||||
}
|
||||
|
||||
if ($array['sale_status'] != null) {
|
||||
$field_array [] = "status IN ('" . implode($array['sale_status'], "','") . "')";
|
||||
}
|
||||
|
||||
if (count($field_array) > 0)
|
||||
$where = " and " . implode(" and ", $field_array);
|
||||
else
|
||||
$where = "";
|
||||
$z = "select * from ecmsales where deleted='0' and status!='s10' " . $where;
|
||||
if ($array['sale_type'] == 'all')
|
||||
$z .= " ORDER BY type DESC";
|
||||
$z = "select * from ecmsales where deleted='0' and status!='s10' " . $where . " ORDER BY send_date DESC";
|
||||
return $z;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user