mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 12:34:24 +00:00
fix 3rd decimal bug with purchase orders
This commit is contained in:
+3
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user