From 634f1c5bb6397d8efa71be30b7a8ea608b2b01b7 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sun, 23 Apr 2006 20:06:21 +0000 Subject: [PATCH] Task 5023: note de credit --- include/user_common.php | 2 +- include/user_form_ach.php | 7 +++---- include/user_form_ven.php | 3 +-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/user_common.php b/include/user_common.php index c5cc6dd3c..8a3593ce5 100644 --- a/include/user_common.php +++ b/include/user_common.php @@ -176,7 +176,7 @@ function ComputeVat($p_cn, $p_fiche,$p_quant,$p_price,$p_vat ) if ( $tva_id == null ) return -1; // for each fiche find the tva_rate and tva_id $a_vat=GetTvaRate($p_cn,$tva_id); - $vat_amount=-1; + $vat_amount=null; // Get the attribut price of the card(fiche) if ( $a_vat != null and $a_vat['tva_id'] != "" ) { diff --git a/include/user_form_ach.php b/include/user_form_ach.php index 8e0aec4ae..413cd4381 100644 --- a/include/user_form_ach.php +++ b/include/user_form_ach.php @@ -649,8 +649,7 @@ function RecordSell($p_cn,$p_array,$p_user,$p_jrn) } $cost=$a_price[$i]*$a_quant[$i]; $amount+=$cost; - // if cost < 0 => not added to jrn.jr_amount - $amount_jrn+=($cost<0)?0:$cost; + $amount_jrn+=$cost; echo_debug('user_form_ach.php',__LINE__,'Total customer:'.$amount_jrn); } $comm=FormatString($e_comm); @@ -719,7 +718,7 @@ function RecordSell($p_cn,$p_array,$p_user,$p_jrn) { $lvat=ComputeVat($p_cn, $a_good[$i],$a_quant[$i],$a_price[$i], $a_vat_good[$i] ); - $ded_vat=($lvat>0)?$lvat*$non_dedu:0; + $ded_vat=($lvat != null )?$lvat*$non_dedu:0; $sum_tva_nd+=$ded_vat; echo_debug('user_form_ach.php',__LINE__, @@ -735,7 +734,7 @@ function RecordSell($p_cn,$p_array,$p_user,$p_jrn) { $lvat=ComputeVat($p_cn, $a_good[$i],$a_quant[$i],$a_price[$i], $a_vat_good[$i] ); - $ded_vat=($lvat>0)?$lvat*$non_dedu:0; + $ded_vat=($lvat != null )?$lvat*$non_dedu:0; $sum_tva_nd+=$ded_vat; diff --git a/include/user_form_ven.php b/include/user_form_ven.php index 612dd802e..be4962b90 100644 --- a/include/user_form_ven.php +++ b/include/user_form_ven.php @@ -600,8 +600,7 @@ function RecordInvoice($p_cn,$p_array,$p_user,$p_jrn) } $cost=$a_price[$i]*$a_quant[$i]; $amount+=$cost; - // if cost < 0 not added to jr_montant - $amount_jrn+=($cost<0)?0:$cost; + $amount_jrn+=$cost; }// for $comm=FormatString($e_comm);