diff --git a/app/Views/capitalpurchaseorder.php b/app/Views/capitalpurchaseorder.php index b7c00d58..b80a4b51 100755 --- a/app/Views/capitalpurchaseorder.php +++ b/app/Views/capitalpurchaseorder.php @@ -3443,6 +3443,7 @@ if (!empty($INRSYMBOL)) { var Total = (parseFloat(basicval) + parseFloat(AfterCgst) + parseFloat(AfterSgst) + parseFloat(AfterIgst) + parseFloat(OtherAmt) - parseFloat(AfterDisVal) + parseFloat(AfterFreightAmountloc)).toFixed(2); + Total = isNaN(Total) ? 0 : Total ; var TotalOrderValuePerkg = $("#txtTotalOrderValue").val(); diff --git a/app/Views/editCapitalPo.php b/app/Views/editCapitalPo.php index fd8e346f..0c86df1d 100755 --- a/app/Views/editCapitalPo.php +++ b/app/Views/editCapitalPo.php @@ -1006,7 +1006,20 @@ $(document).ready(function () { ServiceTaxamount; ?> - Rate * $record->Quantity + $record->ServiceTaxamount + $record->otherallowance + $record->Afvalue - $record->Afterdiscountval, 2, '.', '') ?> + Rate; + $quantity = (float) $record->Quantity; + $serviceTax = (float) $record->ServiceTaxamount; + $otherAllowance = (float) $record->otherallowance; + $afValue = (float) $record->Afvalue; + $afterDiscount = (float) $record->Afterdiscountval; + + $total = $rate * $quantity + $serviceTax + $otherAllowance + $afValue - $afterDiscount; + + echo is_nan($total) || !is_finite($total) + ? '0.00' + : number_format($total, 2, '.', ''); + ?>