E-Invoice - Fix a problem reported by Brian, PO not tally with updated booking amount

This commit is contained in:
Dillon Ngo
2025-08-15 22:35:45 +08:00
parent bc8e6f2a77
commit 67e624c21a
@@ -86,7 +86,9 @@ class UpdateBookingAmountWithPOLogic extends AbstractControllerLogic
return $product['quantity'] * floatval(str_replace(',', '', $product['unit_price']));
});
$bookingAmountUpdate = (float)$bookingAttribute->value;
$isTally = $total === $bookingAmountUpdate ? true : false;
// $isTally = ($total === $bookingAmountUpdate) ? true : false;
$isTally = bccomp($total, $bookingAmountUpdate, 3) === 0;
if(!$isTally){
throw new MalformedRequestException('Purchase Order total not tally with updated booking amount of ' . $bookingAmountUpdate);
}