@@ -410,10 +410,8 @@ protected function _getTZRangeExpressionForAttribute($range, $attribute, $tzFrom
410410 */
411411 public function getDateRange ($ range , $ customStart , $ customEnd , $ returnObjects = false )
412412 {
413- $ timezoneLocal = $ this ->_localeDate ->getConfigTimezone ();
414-
415- $ dateEnd = new \DateTime ('now ' , new \DateTimeZone ($ timezoneLocal ));
416- $ dateStart = new \DateTime ('now ' , new \DateTimeZone ($ timezoneLocal ));
413+ $ dateEnd = new \DateTime ();
414+ $ dateStart = new \DateTime ();
417415
418416 // go to the end of a day
419417 $ dateEnd ->setTime (23 , 59 , 59 );
@@ -425,8 +423,8 @@ public function getDateRange($range, $customStart, $customEnd, $returnObjects =
425423 $ dateEnd ->modify ('now ' );
426424 break ;
427425 case '24h ' :
428- $ dateEnd = new \DateTime (' now ' , new \ DateTimeZone ( $ timezoneLocal ) );
429- $ dateEnd ->modify ('+1 hour ' );
426+ $ dateEnd = new \DateTime ();
427+ $ dateStart = new \ DateTime (); $ dateEnd ->modify ('+1 hour ' );
430428 $ dateStart = clone $ dateEnd ;
431429 $ dateStart ->modify ('-1 day ' );
432430 break ;
@@ -701,8 +699,8 @@ public function setStoreIds($storeIds)
701699 'invoiced ' => 'SUM(main_table.base_total_paid) ' ,
702700 'refunded ' => 'SUM(main_table.base_total_refunded) ' ,
703701 'profit ' => "SUM( {$ baseSubtotalInvoiced }) " .
704- "+ SUM( {$ baseDiscountRefunded }) - SUM( {$ baseSubtotalRefunded }) " .
705- "- SUM( {$ baseDiscountInvoiced }) - SUM( {$ baseTotalInvocedCost }) " ,
702+ "+ SUM( {$ baseDiscountRefunded }) - SUM( {$ baseSubtotalRefunded }) " .
703+ "- SUM( {$ baseDiscountInvoiced }) - SUM( {$ baseTotalInvocedCost }) " ,
706704 ]
707705 );
708706 } else {
@@ -716,10 +714,10 @@ public function setStoreIds($storeIds)
716714 'invoiced ' => 'SUM(main_table.base_total_paid * main_table.base_to_global_rate) ' ,
717715 'refunded ' => 'SUM(main_table.base_total_refunded * main_table.base_to_global_rate) ' ,
718716 'profit ' => "SUM( {$ baseSubtotalInvoiced } * main_table.base_to_global_rate) " .
719- "+ SUM( {$ baseDiscountRefunded } * main_table.base_to_global_rate) " .
720- "- SUM( {$ baseSubtotalRefunded } * main_table.base_to_global_rate) " .
721- "- SUM( {$ baseDiscountInvoiced } * main_table.base_to_global_rate) " .
722- "- SUM( {$ baseTotalInvocedCost } * main_table.base_to_global_rate) " ,
717+ "+ SUM( {$ baseDiscountRefunded } * main_table.base_to_global_rate) " .
718+ "- SUM( {$ baseSubtotalRefunded } * main_table.base_to_global_rate) " .
719+ "- SUM( {$ baseDiscountInvoiced } * main_table.base_to_global_rate) " .
720+ "- SUM( {$ baseTotalInvocedCost } * main_table.base_to_global_rate) " ,
723721 ]
724722 );
725723 }
@@ -857,7 +855,7 @@ private function getTotalsExpressionWithDiscountRefunded(
857855 $ template = ($ storeId != 0 )
858856 ? '(main_table.base_subtotal - %2$s - %1$s - (ABS(main_table.base_discount_amount) - %3$s - %4$s)) '
859857 : '((main_table.base_subtotal - %1$s - %2$s - (ABS(main_table.base_discount_amount) - %3$s - %4$s)) '
860- . ' * main_table.base_to_global_rate) ' ;
858+ . ' * main_table.base_to_global_rate) ' ;
861859 return sprintf (
862860 $ template ,
863861 $ baseSubtotalRefunded ,
0 commit comments