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'; }