if ($pos !== false)
{
$len = strlen(substr($str, $pos + 1));
- if ($len > $dec)
+ if ($len > $dec && $len < ini_get('precision')-3)
$dec = $len;
}
return number_format2($number, $dec);
LEFT JOIN ".TB_PREF."debtor_trans cust_trans ON cust_trans.trans_no=move.trans_no AND cust_trans.type=move.type
LEFT JOIN ".TB_PREF."debtors_master debtor ON cust_trans.debtor_no=debtor.debtor_no
WHERE stock_id=".db_escape($stock_id)."
- AND move.tran_date < '$to_date' AND standard_cost > 0.001 AND qty <> 0 AND move.type <> ".ST_LOCTRANSFER;
+ AND move.tran_date <= '$to_date' AND standard_cost > 0.001 AND qty <> 0 AND move.type <> ".ST_LOCTRANSFER;
if ($location != 'all')
$sql .= " AND move.loc_code = ".db_escape($location);
LEFT JOIN ".TB_PREF."debtor_trans cust_trans ON cust_trans.trans_no=move.trans_no AND cust_trans.type=move.type
LEFT JOIN ".TB_PREF."debtors_master debtor ON cust_trans.debtor_no=debtor.debtor_no
WHERE stock_id=".db_escape($stock_id)."
- AND move.tran_date < '$to_date' AND standard_cost > 0.001 AND qty <> 0 AND move.type <> ".ST_LOCTRANSFER;
+ AND move.tran_date <= '$to_date' AND standard_cost > 0.001 AND qty <> 0 AND move.type <> ".ST_LOCTRANSFER;
if ($location != '')
$sql .= " AND move.loc_code = ".db_escape($location);