diff --git a/app/Classes/Modules/Transactions/ControllersLogic/CreatePurchaseOrderTransactionLogic.php b/app/Classes/Modules/Transactions/ControllersLogic/CreatePurchaseOrderTransactionLogic.php index 7f112b20..c3394a94 100644 --- a/app/Classes/Modules/Transactions/ControllersLogic/CreatePurchaseOrderTransactionLogic.php +++ b/app/Classes/Modules/Transactions/ControllersLogic/CreatePurchaseOrderTransactionLogic.php @@ -97,6 +97,8 @@ class CreatePurchaseOrderTransactionLogic extends AbstractControllerLogic return $product['quantity'] * floatval(str_replace(',', '', $product['unit_price'])); }); + $total = floor(number_format($total, 3, '.', '')* 100) / 100; + $object = new TransactionObject($billNumber, TransactionType::PURCHASE_ORDER, $booking->company->id, 1, 1, PaymentMethodType::CASH, $total, $total, $booking->fix_currency_id, $booking->fix_currency_id, @@ -104,8 +106,7 @@ class CreatePurchaseOrderTransactionLogic extends AbstractControllerLogic !$transaction ? $transaction = $this->createsTransaction->execute($booking, $object) : $transaction = $this->updatesTransaction->execute($transaction, $object); - dd(number_format(floor((float) $total * 100) / 100 , 2, '.', '') === number_format((float)$booking->fix_amount, 2, '.', '')); - $this->updatesTransactionStatus->execute($transaction, number_format(floor((float) $total * 100) / 100 , 2, '.', '') === number_format((float)$booking->fix_amount, 2, '.', '') ? ApprovalStatus::PENDING_VERIFICATION : ApprovalStatus::PENDING_SUBMISSION); + $this->updatesTransactionStatus->execute($transaction, (float) number_format($total, 2, '.', '') === (float) number_format((float)$booking->fix_amount, 2, '.', '') ? ApprovalStatus::PENDING_VERIFICATION : ApprovalStatus::PENDING_SUBMISSION); $this->deletesTransactionDetails->execute($transaction);