Skip to content
Snippets Groups Projects
Commit 077563ac authored by Prasad's avatar Prasad
Browse files

Fixed empty string to float type-casting

parent 0af599e4
No related branches found
No related tags found
No related merge requests found
......@@ -42,10 +42,10 @@ class InvoiceHandler extends VTEventHandler {
$wsrecord = vtws_retrieve($wsid,$current_user);
if ($oldCurrency != $newCurrency && $oldCurrency != '') {
if($oldConversionRate != ''){
$wsrecord['received'] = floatval(($wsrecord['received']/$oldConversionRate) * $wsrecord['conversion_rate']);
$wsrecord['received'] = floatval(((float)$wsrecord['received']/$oldConversionRate) * (float)$wsrecord['conversion_rate']);
}
}
$wsrecord['balance'] = floatval($wsrecord['hdnGrandTotal'] - $wsrecord['received']);
$wsrecord['balance'] = floatval((float)$wsrecord['hdnGrandTotal'] - (float)$wsrecord['received']);
if ($wsrecord['balance'] == 0) {
$wsrecord['invoicestatus'] = 'Paid';
}
......
......@@ -42,10 +42,10 @@ class PurchaseOrderHandler extends VTEventHandler {
$wsrecord = vtws_retrieve($wsid,$current_user);
if ($oldCurrency != $newCurrency && $oldCurrency != '') {
if($oldConversionRate != ''){
$wsrecord['paid'] = floatval(($wsrecord['paid']/$oldConversionRate) * $wsrecord['conversion_rate']);
$wsrecord['paid'] = floatval(((float)$wsrecord['paid']/$oldConversionRate) * (float)$wsrecord['conversion_rate']);
}
}
$wsrecord['balance'] = floatval($wsrecord['hdnGrandTotal'] - $wsrecord['paid']);
$wsrecord['balance'] = floatval((float)$wsrecord['hdnGrandTotal'] - (float)$wsrecord['paid']);
if ($wsrecord['balance'] == 0)
$wsrecord['postatus'] = 'Received Shipment';
$query = "UPDATE vtiger_purchaseorder SET balance=?,paid=? WHERE purchaseorderid=?";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment