fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [13142] property: refine datesearh for tickets


From: Sigurd Nes
Subject: [Fmsystem-commits] [13142] property: refine datesearh for tickets
Date: Tue, 05 May 2015 11:44:50 +0000

Revision: 13142
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13142
Author:   sigurdne
Date:     2015-05-05 11:44:49 +0000 (Tue, 05 May 2015)
Log Message:
-----------
property: refine datesearh for tickets

Modified Paths:
--------------
    trunk/property/inc/class.sotts.inc.php

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2015-05-04 22:57:52 UTC (rev 
13141)
+++ trunk/property/inc/class.sotts.inc.php      2015-05-05 11:44:49 UTC (rev 
13142)
@@ -398,21 +398,19 @@
                        {
                                $order_add      = 
$GLOBALS['phpgw']->acl->check('.ticket.order', PHPGW_ACL_ADD, 'property');
                                $order_edit = 
$GLOBALS['phpgw']->acl->check('.ticket.order', PHPGW_ACL_EDIT, 'property');
+                               $_end_date      = $end_date + 3600 * 16 + 
phpgwapi_datetime::user_timezone();
+                               $_start_date    = $start_date - 3600 * 8 + 
phpgwapi_datetime::user_timezone();
+                               $filtermethod .= " $where 
fm_tts_tickets.entry_date >= $_start_date AND fm_tts_tickets.entry_date <= 
$_end_date ";
 
                                if($order_add || $order_edit)
                                {
                                        $end_period     = date('Ym', $end_date);
                                        $start_period   = date('Ym', 
$start_date);
-                                       $date_join = "JOIN fm_tts_payments ON ( 
fm_tts_tickets.id=fm_tts_payments.ticket_id AND fm_tts_payments.period >= 
$start_period AND fm_tts_payments.period <= $end_period )";
+                                       $date_join = "LEFT JOIN fm_tts_payments 
ON ( fm_tts_tickets.id=fm_tts_payments.ticket_id AND fm_tts_payments.period >= 
$start_period AND fm_tts_payments.period <= $end_period )";
                                        $actual_cost_field = 
'SUM(fm_tts_payments.amount) AS actual_cost';
                                        $actual_cost_group_field = '';
+
                                }
-                               else
-                               {
-                                       $_end_date      = $end_date + 3600 * 16 
+ phpgwapi_datetime::user_timezone();
-                                       $_start_date    = $start_date - 3600 * 
8 + phpgwapi_datetime::user_timezone();
-                                       $filtermethod .= " $where 
fm_tts_tickets.entry_date >= $_start_date AND fm_tts_tickets.entry_date <= 
$_end_date ";
-                               }
 
                                $where= 'AND';
                        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]