Skip to content

Commit d4016e7

Browse files
kpitnFlyingmana
authored andcommitted
Fix calculation of base total in magento report with discount (#555)
* Fix calculation of base total in magento report with discount Actually magento store discount with negative value : - 10 If you have an order with subtotal = 90 and base_discount_invoiced = -10 When Magento do base_subtotal_invoiced - base_discount_invoiced => 90 -- 10 => 90 +10 => 100 * Update fix I think it's clearer with ABS value, like magento do for the other columns
1 parent b559b6f commit d4016e7

File tree

1 file changed

+1
-1
lines changed
  • app/code/core/Mage/SalesRule/Model/Resource/Report/Rule

1 file changed

+1
-1
lines changed

app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ protected function _aggregateByOrder($aggregationField, $from, $to)
125125
'total_amount_actual' =>
126126
$adapter->getIfNullSql('SUM((base_subtotal_invoiced - ' .
127127
$adapter->getIfNullSql('base_subtotal_refunded', 0) . ' - ' .
128-
$adapter->getIfNullSql('base_discount_invoiced - ' .
128+
$adapter->getIfNullSql('ABS(base_discount_invoiced) - ' .
129129
$adapter->getIfNullSql('base_discount_refunded', 0), 0) .
130130
') * base_to_global_rate)', 0),
131131
);

0 commit comments

Comments
 (0)