Analytic accountancy protect against divide by zero
This commit is contained in:
parent
2debc04708
commit
63c1dbae90
1 changed files with 4 additions and 1 deletions
|
|
@ -710,7 +710,10 @@ class Anc_Operation
|
|||
$op->po_id=$hplan[$p_item][$e];
|
||||
$op->oa_group=$this->oa_group;
|
||||
$op->j_id=$p_j_id;
|
||||
$ratio=bcdiv($val[$p_item][$row],${"amount_t".$p_item});
|
||||
$ratio=0;
|
||||
if (${"amount_t".$p_item} != 0 ) {
|
||||
$ratio=bcdiv($val[$p_item][$row],${"amount_t".$p_item});
|
||||
}
|
||||
$amount= bcmul($p_nd, $ratio);
|
||||
$op->oa_amount=round($amount,2);
|
||||
$op->oa_debit=$this->oa_debit;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue