fix roundings
This commit is contained in:
@@ -73,8 +73,6 @@ class CheckPrestaBox extends Module
|
||||
$this->processNewFiscalForm((int) $params['id_order']);
|
||||
$orderURL = $router->generate('admin_orders_view', [
|
||||
'orderId' => (int) $params['id_order'],
|
||||
|
||||
|
||||
]) . '#checkprestaboxTabContent';
|
||||
|
||||
Tools::redirectAdmin($orderURL);
|
||||
@@ -122,7 +120,7 @@ class CheckPrestaBox extends Module
|
||||
|
||||
foreach ($submittedProducts as $product) {
|
||||
|
||||
$price = round((float)($product['price'] ?? 0.0) * 100, 2);
|
||||
$price = round((float)($product['price'] ?? 0.0), 2) * 100;
|
||||
$quantity = (int)($product['quantity'] ?? 0) * 1000;
|
||||
if ($quantity == 0) {
|
||||
continue;
|
||||
@@ -133,7 +131,7 @@ class CheckPrestaBox extends Module
|
||||
'good' => [
|
||||
'code' => (string)($product['code'] ?? ''),
|
||||
'name' => (string)($product['name'] ?? 'Unknown Product'),
|
||||
'price' => $price,
|
||||
'price' => round((float) $price, 2),
|
||||
],
|
||||
'quantity' => $quantity,
|
||||
];
|
||||
@@ -148,7 +146,7 @@ class CheckPrestaBox extends Module
|
||||
$paymentsForFiscalize[] = [
|
||||
'type' => $payment['type'] == 'Готівка' ? 'CASH' : 'CASHLESS',
|
||||
'label' => $payment['type'],
|
||||
'value' => round($value, 2),
|
||||
'value' => round((float) $value, 2),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -162,7 +160,7 @@ class CheckPrestaBox extends Module
|
||||
$discountsForFiscalize[] = [
|
||||
'type' => 'DISCOUNT',
|
||||
'mode' => 'VALUE',
|
||||
'value' => $value,
|
||||
'value' => round((float) $value, 2),
|
||||
'name' => $cart_rule['name'],
|
||||
];
|
||||
}
|
||||
@@ -437,7 +435,6 @@ class CheckPrestaBox extends Module
|
||||
$headers = [
|
||||
'X-License-Key: ' . $key,
|
||||
];
|
||||
|
||||
$resp = $this->apiCall('/api/v1/shifts', [], 'POST', null);
|
||||
if (isset($resp['id']) && isset($resp['status']) && $resp['status'] == 'CREATED') {
|
||||
return $resp['id'];
|
||||
|
||||
Reference in New Issue
Block a user