diff --git a/FAQ-fr.txt b/FAQ-fr.txt index 25b5c8efe..75f9d7bd9 100644 --- a/FAQ-fr.txt +++ b/FAQ-fr.txt @@ -248,8 +248,10 @@ 13.1. Quel patch utiliser ? - Dans certains cas, le dernier patch reprend les autres, il faudra lire - la release note du patch pour savoir ce qu'il faut appliquer avant. + Dans certains cas, le dernier patch ne reprend PAS les autres, il + faudra lire la release note du patch pour savoir ce qu'il faut + appliquer avant. En règle générale, il faut appliquer les patch dans + l'ordre : le premier, puis le second... Sinon, les patchs sont toujours nommés ainsi path-(numéro_version)-(numéro_de_path).tgz diff --git a/include/user_form_ach.php b/include/user_form_ach.php index f0ea02745..a20adccf5 100644 --- a/include/user_form_ach.php +++ b/include/user_form_ach.php @@ -356,7 +356,7 @@ for ($o = 0;$o < $p_number; $o++) { echo ""; return null; } - // Periode ferm� + // Periode fermé if ( PeriodeClosed ($p_cn,$p_periode)=='t' ) { $msg="This periode is closed please change your preference"; @@ -558,6 +558,7 @@ function RecordSell($p_cn,$p_array,$p_user,$p_jrn) // Get the default period $periode=$p_user->GetPeriode(); $amount=0.0; + $amount_jrn=0.0; // Computing total customer for ($i=0;$i<$nb_item;$i++) { // store quantity & goods in array @@ -575,7 +576,10 @@ function RecordSell($p_cn,$p_array,$p_user,$p_jrn) // The price is valid $a_price[$i]=${"e_march$i"."_sell"}; } - $amount+=$a_price[$i]*$a_quant[$i]; + $cost=$a_price[$i]*$a_quant[$i]; + $amount+=$cost; + // if cost < 0 => not added to jrn.jr_amount + $amount_jrn+=($cost<0)?0:$cost; } $comm=FormatString($e_comm); $a_vat=ComputeVat($p_cn,$a_good,$a_quant,$a_price,$a_vat); @@ -629,7 +633,7 @@ function RecordSell($p_cn,$p_array,$p_user,$p_jrn) } } echo_debug(__FILE__,__LINE__,"echeance = $e_ech"); - $r=InsertJrn($p_cn,$e_date,$e_ech,$p_jrn,"Invoice",round($amount,2)+round($sum_vat,2),$seq,$periode); + $r=InsertJrn($p_cn,$e_date,$e_ech,$p_jrn,"Invoice",round($amount_jrn,2)+round($sum_vat,2),$seq,$periode); if ( $r == false ) { Rollback($p_cn); exit(" Error __FILE__ __LINE__");} // Set Internal code and Comment $internal=SetInternalCode($p_cn,$seq,$p_jrn); diff --git a/include/user_form_ven.php b/include/user_form_ven.php index d787a1c2b..e2562f7a7 100644 --- a/include/user_form_ven.php +++ b/include/user_form_ven.php @@ -571,6 +571,7 @@ function RecordInvoice($p_cn,$p_array,$p_user,$p_jrn) // Get the default period $periode=$p_user->GetPeriode(); $amount=0.0; + $amount_jrn=0.0; // Computing total customer //-- for ($i=0;$i<$nb_item;$i++) { @@ -589,7 +590,10 @@ function RecordInvoice($p_cn,$p_array,$p_user,$p_jrn) // The price is valid $a_price[$i]=${"e_march$i"."_sell"}; } - $amount+=$a_price[$i]*$a_quant[$i]; + $cost=$a_price[$i]*$a_quant[$i]; + $amount+=$cost; + // if cost < 0 not added to jr_montant + $amount_jrn+=($cost<0)?0:$cost; }// for $comm=FormatString($e_comm); @@ -645,7 +649,7 @@ function RecordInvoice($p_cn,$p_array,$p_user,$p_jrn) } } echo_debug(__FILE__,__LINE__,"echeance = $e_ech"); - $r=InsertJrn($p_cn,$e_date,$e_ech,$p_jrn,"Invoice",round($amount,2)+round($sum_vat,2),$seq,$periode); + $r=InsertJrn($p_cn,$e_date,$e_ech,$p_jrn,"Invoice",round($amount_jrn,2)+round($sum_vat,2),$seq,$periode); if ( $r == false ) { Rollback($p_cn); exit(" Error __FILE__ __LINE__");} // Set Internal code and Comment $internal=SetInternalCode($p_cn,$seq,$p_jrn);