From 8c0fe6eb777c7fe5a5ee3771ed3e849a1adb66dd Mon Sep 17 00:00:00 2001 From: Shohrat Date: Mon, 20 Nov 2023 22:40:21 +0500 Subject: [PATCH] order item setting --- .../romanah/gokbakja/components/OrderItem.php | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/plugins/romanah/gokbakja/components/OrderItem.php b/plugins/romanah/gokbakja/components/OrderItem.php index e5173f9..5f154de 100644 --- a/plugins/romanah/gokbakja/components/OrderItem.php +++ b/plugins/romanah/gokbakja/components/OrderItem.php @@ -67,12 +67,13 @@ class OrderItem extends ComponentBase $stockCalc = $rulonCalc; + $calc = (float)($stockCalc - $amountCalc); + //dd($stockCalc); + if($calc > 0){ - if($stockCalc > 0){ - - $notCompleteCalc = ' +'.number_format(($stockCalc - $amountCalc), 2).' artyk'; - }elseif($stockCalc < 0){ - $notCompleteCalc = ''.number_format(($stockCalc - $amountCalc), 2).' ýetenok'; + $notCompleteCalc = ' +'.number_format($calc, 2).' artyk'; + }elseif($calc < 0){ + $notCompleteCalc = ''.number_format($calc, 2).' ýetenok'; } }else{ @@ -106,12 +107,13 @@ class OrderItem extends ComponentBase $stockCalc = (float)$bagCalc; + $calc = (float)($stockCalc - $amountCalc); + //dd($stockCalc); + if($calc > 0){ - if($stockCalc > 0){ - - $notCompleteCalc = ' +'.number_format((float)((float)$stockCalc - (float)$amountCalc), 2).' artyk'; - }elseif($stockCalc < 0){ - $notCompleteCalc = ''.number_format((float)((float)$stockCalc - (float)$amountCalc), 2).' ýetenok'; + $notCompleteCalc = ' +'.number_format($calc, 2).' artyk'; + }elseif($calc < 0){ + $notCompleteCalc = ''.number_format($calc, 2).' ýetenok'; }