@@ -410,10 +410,8 @@ protected function _getTZRangeExpressionForAttribute($range, $attribute, $tzFrom
410
410
*/
411
411
public function getDateRange ($ range , $ customStart , $ customEnd , $ returnObjects = false )
412
412
{
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 ();
417
415
418
416
// go to the end of a day
419
417
$ dateEnd ->setTime (23 , 59 , 59 );
@@ -425,8 +423,8 @@ public function getDateRange($range, $customStart, $customEnd, $returnObjects =
425
423
$ dateEnd ->modify ('now ' );
426
424
break ;
427
425
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 ' );
430
428
$ dateStart = clone $ dateEnd ;
431
429
$ dateStart ->modify ('-1 day ' );
432
430
break ;
@@ -701,8 +699,8 @@ public function setStoreIds($storeIds)
701
699
'invoiced ' => 'SUM(main_table.base_total_paid) ' ,
702
700
'refunded ' => 'SUM(main_table.base_total_refunded) ' ,
703
701
'profit ' => "SUM( {$ baseSubtotalInvoiced }) " .
704
- "+ SUM( {$ baseDiscountRefunded }) - SUM( {$ baseSubtotalRefunded }) " .
705
- "- SUM( {$ baseDiscountInvoiced }) - SUM( {$ baseTotalInvocedCost }) " ,
702
+ "+ SUM( {$ baseDiscountRefunded }) - SUM( {$ baseSubtotalRefunded }) " .
703
+ "- SUM( {$ baseDiscountInvoiced }) - SUM( {$ baseTotalInvocedCost }) " ,
706
704
]
707
705
);
708
706
} else {
@@ -716,10 +714,10 @@ public function setStoreIds($storeIds)
716
714
'invoiced ' => 'SUM(main_table.base_total_paid * main_table.base_to_global_rate) ' ,
717
715
'refunded ' => 'SUM(main_table.base_total_refunded * main_table.base_to_global_rate) ' ,
718
716
'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) " ,
723
721
]
724
722
);
725
723
}
@@ -857,7 +855,7 @@ private function getTotalsExpressionWithDiscountRefunded(
857
855
$ template = ($ storeId != 0 )
858
856
? '(main_table.base_subtotal - %2$s - %1$s - (ABS(main_table.base_discount_amount) - %3$s - %4$s)) '
859
857
: '((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) ' ;
861
859
return sprintf (
862
860
$ template ,
863
861
$ baseSubtotalRefunded ,
0 commit comments