File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
Test/Unit/Model/Order/Webapi Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ public function execute(
74
74
*/
75
75
private function round (float $ value ): float
76
76
{
77
- return (float ) max ($ value , 0 );
77
+ return (float ) max (round ( $ value, 2 ) , 0 );
78
78
}
79
79
80
80
/**
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2022 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
declare (strict_types=1 );
7
7
@@ -98,6 +98,24 @@ public static function negativeTotals()
98
98
OrderItemInterface::ROW_TOTAL_INCL_TAX => 0 ,
99
99
OrderItemInterface::BASE_ROW_TOTAL_INCL_TAX => 0
100
100
]
101
+ ],
102
+ [
103
+ 'totals ' => [
104
+ 'totalAmount ' => -2.83 ,
105
+ 'baseTotalAmount ' => -2.83 ,
106
+ 'totalAmountIncTax ' => 3.5527136788005E-15 ,
107
+ 'baseRowTotal ' => 0.0000 ,
108
+ 'baseTaxAmount ' => 0.0000 ,
109
+ 'baseDiscountTaxCompensationAmount ' => 2.83 ,
110
+ 'baseWeeeTaxAppliedAmount ' => null ,
111
+ 'baseDiscountAmount ' => 16.99
112
+ ],
113
+ 'expected ' => [
114
+ OrderItemInterface::ROW_TOTAL => 0 ,
115
+ OrderItemInterface::BASE_ROW_TOTAL => 0 ,
116
+ OrderItemInterface::ROW_TOTAL_INCL_TAX => 0 ,
117
+ OrderItemInterface::BASE_ROW_TOTAL_INCL_TAX => 0
118
+ ]
101
119
]
102
120
];
103
121
}
You can’t perform that action at this time.
0 commit comments