Skip to content

Commit c061a90

Browse files
authored
[FIX] Set type discount only for rounding diff <0
Discount must be negative so can't use discount to adjust positive differences.
1 parent 01e6410 commit c061a90

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/BuilderAbstract.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ public function fixTotals($order)
231231
}
232232
if ( ! $amended) {
233233
unset($item);
234-
$item['type'] = 'discount';
234+
if($diff_with_tax<0){
235+
$item['type'] = 'discount';
236+
}
235237
$item['reference'] = '';
236238
$item['name'] = 'ajuste por redondeos';
237239
$item['total_without_tax'] = $diff_without_tax;

0 commit comments

Comments
 (0)