fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12101] property: fix sql


From: Sigurd Nes
Subject: [Fmsystem-commits] [12101] property: fix sql
Date: Wed, 24 Sep 2014 18:54:50 +0000

Revision: 12101
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12101
Author:   sigurdne
Date:     2014-09-24 18:54:49 +0000 (Wed, 24 Sep 2014)
Log Message:
-----------
property: fix sql

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

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2014-09-24 11:21:11 UTC (rev 
12100)
+++ trunk/property/inc/class.sotts.inc.php      2014-09-24 18:54:49 UTC (rev 
12101)
@@ -392,27 +392,26 @@
 
                        $actual_cost_field = 'fm_tts_tickets.actual_cost';
                        $actual_cost_group_field = 
',fm_tts_tickets.actual_cost';
+                       $date_join = '';
+
                        if ($start_date)
                        {
+                               $_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 ";
+
                                $order_add      = 
$GLOBALS['phpgw']->acl->check('.ticket.order', PHPGW_ACL_ADD, 'property');
                                $order_edit = 
$GLOBALS['phpgw']->acl->check('.ticket.order', PHPGW_ACL_EDIT, 'property');
 
                                if($order_add || $order_edit)
                                {
-                                       $end_date       = date('Ym', $end_date);
-                                       $start_date     = date('Ym', 
$start_date);
-                                       $filtermethod .= " $where 
fm_tts_payments.period >= $start_date AND fm_tts_payments.period <= $end_date ";
-                                       $date_join = " LEFT OUTER JOIN 
fm_tts_payments ON fm_tts_tickets.id=fm_tts_payments.ticket_id";
+                                       $end_period     = date('Ym', $end_date);
+                                       $start_period   = date('Ym', 
$start_date);
+               //                      $filtermethod .= " $where 
fm_tts_payments.period >= $start_period AND fm_tts_payments.period <= 
$end_period";
+                                       $date_join = " LEFT OUTER 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 ";
-                                       $date_join = '';
-                               }
 
                                $where= 'AND';
                        }




reply via email to

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