Skip to content

Commit 8c7a61a

Browse files
slopukhovRoman Ganin
authored andcommitted
MAGETWO-35057: Columns 'Interval', 'Price Rule' have incorrect values in Coupon Usage report.
1 parent 60283d9 commit 8c7a61a

File tree

14 files changed

+8
-73
lines changed

14 files changed

+8
-73
lines changed

app/code/Magento/Reports/Model/Resource/Order/Collection.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,6 @@ public function getDateRange($range, $customStart, $customEnd, $returnObjects =
457457
break;
458458
}
459459

460-
$dateStart->setTimezone(new \DateTimeZone('Etc/UTC'));
461-
$dateEnd->setTimezone(new \DateTimeZone('Etc/UTC'));
462-
463460
if ($returnObjects) {
464461
return [$dateStart, $dateEnd];
465462
} else {

app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -465,37 +465,4 @@ protected function _getTZOffsetTransitions($timezone, $from = null, $to = null)
465465

466466
return $tzTransitions;
467467
}
468-
469-
/**
470-
* Retrieve store timezone offset from UTC in the form acceptable by SQL's CONVERT_TZ()
471-
*
472-
* @param null|mixed $store
473-
* @return string
474-
*/
475-
protected function _getStoreTimezoneUtcOffset($store = null)
476-
{
477-
return $this->_localeDate->scopeDate($store)->format('P');
478-
}
479-
480-
/**
481-
* Retrieve date in UTC timezone
482-
*
483-
* @param mixed $date
484-
* @return null|\DateTime
485-
*/
486-
protected function _dateToUtc($date)
487-
{
488-
if ($date === null) {
489-
return null;
490-
}
491-
492-
if ($date instanceof \DateTimeInterface) {
493-
$dateUtc = $date;
494-
} else {
495-
$dateUtc = new \DateTime($date);
496-
}
497-
498-
$dateUtc->setTimezone(new \DateTimeZone('UTC'));
499-
return $dateUtc->format('Y-m-d H:i:s');
500-
}
501468
}

app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ public function aggregate($from = null, $to = null)
9898
$mainTable = $this->getMainTable();
9999
$adapter = $this->_getWriteAdapter();
100100

101-
// convert input dates to UTC to be comparable with DATETIME fields in DB
102-
$from = $this->_dateToUtc($from);
103-
$to = $this->_dateToUtc($to);
104-
105101
if ($from !== null || $to !== null) {
106102
$subSelect = $this->_getTableDateRangeSelect(
107103
$this->getTable('report_event'),

app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@ protected function _construct()
9696
*/
9797
public function aggregate($from = null, $to = null)
9898
{
99-
// convert input dates to UTC to be comparable with DATETIME fields in DB
100-
$from = $this->_dateToUtc($from);
101-
$to = $this->_dateToUtc($to);
102-
10399
$adapter = $this->_getWriteAdapter();
104100
//$this->_getWriteAdapter()->beginTransaction();
105101

app/code/Magento/Sales/Model/Resource/Report/Invoiced.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ protected function _construct()
3131
*/
3232
public function aggregate($from = null, $to = null)
3333
{
34-
// convert input dates to UTC to be comparable with DATETIME fields in DB
35-
$from = $this->_dateToUtc($from);
36-
$to = $this->_dateToUtc($to);
37-
3834
$this->_aggregateByOrderCreatedAt($from, $to);
3935
$this->_aggregateByInvoiceCreatedAt($from, $to);
4036

app/code/Magento/Sales/Model/Resource/Report/Order/Createdat.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ public function aggregate($from = null, $to = null)
4747
*/
4848
protected function _aggregateByField($aggregationField, $from, $to)
4949
{
50-
// convert input dates to UTC to be comparable with DATETIME fields in DB
51-
$from = $this->_dateToUtc($from);
52-
$to = $this->_dateToUtc($to);
53-
5450
$adapter = $this->_getWriteAdapter();
5551

5652
$adapter->beginTransaction();

app/code/Magento/Sales/Model/Resource/Report/Refunded.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ protected function _construct()
3131
*/
3232
public function aggregate($from = null, $to = null)
3333
{
34-
// convert input dates to UTC to be comparable with DATETIME fields in DB
35-
$from = $this->_dateToUtc($from);
36-
$to = $this->_dateToUtc($to);
37-
3834
$this->_aggregateByOrderCreatedAt($from, $to);
3935
$this->_aggregateByRefundCreatedAt($from, $to);
4036

app/code/Magento/Sales/Model/Resource/Report/Shipping.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ protected function _construct()
3131
*/
3232
public function aggregate($from = null, $to = null)
3333
{
34-
// convert input dates to UTC to be comparable with DATETIME fields in DB
35-
$from = $this->_dateToUtc($from);
36-
$to = $this->_dateToUtc($to);
37-
3834
$this->_aggregateByOrderCreatedAt($from, $to);
3935
$this->_aggregateByShippingCreatedAt($from, $to);
4036
$this->_setFlagData(\Magento\Reports\Model\Flag::REPORT_SHIPPING_FLAG_CODE);

app/code/Magento/SalesRule/Model/Resource/Report/Rule/Createdat.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ public function aggregate($from = null, $to = null)
4949
*/
5050
protected function _aggregateByOrder($aggregationField, $from, $to)
5151
{
52-
$from = $this->_dateToUtc($from);
53-
$to = $this->_dateToUtc($to);
54-
5552
$table = $this->getMainTable();
5653
$sourceTable = $this->getTable('sales_order');
5754
$adapter = $this->_getWriteAdapter();

app/code/Magento/Tax/Model/Resource/Report/Tax/Createdat.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ public function aggregate($from = null, $to = null)
4646
*/
4747
protected function _aggregateByOrder($aggregationField, $from, $to)
4848
{
49-
// convert input dates to UTC to be comparable with DATETIME fields in DB
50-
$from = $this->_dateToUtc($from);
51-
$to = $this->_dateToUtc($to);
52-
5349
$writeAdapter = $this->_getWriteAdapter();
5450
$salesAdapter = $this->_resources->getConnection('sales_read');
5551

0 commit comments

Comments
 (0)