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(
7474 */
7575 private function round (float $ value ): float
7676 {
77- return (float ) max ($ value , 0 );
77+ return (float ) max (round ( $ value, 2 ) , 0 );
7878 }
7979
8080 /**
Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright © Magento, Inc. All rights reserved.
4- * See COPYING.txt for license details .
3+ * Copyright 2022 Adobe
4+ * All Rights Reserved .
55 */
66declare (strict_types=1 );
77
@@ -98,6 +98,24 @@ public static function negativeTotals()
9898 OrderItemInterface::ROW_TOTAL_INCL_TAX => 0 ,
9999 OrderItemInterface::BASE_ROW_TOTAL_INCL_TAX => 0
100100 ]
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+ ]
101119 ]
102120 ];
103121 }
You can’t perform that action at this time.
0 commit comments