diff --git a/html/admin/setup.php b/html/admin/setup.php index 11867b1f2..7cb632365 100644 --- a/html/admin/setup.php +++ b/html/admin/setup.php @@ -144,6 +144,7 @@ function ExecuteScript($p_cn,$script) { $buffer=str_replace (';','',$buffer); } $sql.=$buffer; +echo_debug('setup.php',__LINE__,"Execute sql $sql"); if ( ExecSql($p_cn,$sql,false) == false ) { Rollback($p_cn); if ( DEBUG=='false' ) ob_clean(); diff --git a/include/user_form_ven.php b/include/user_form_ven.php index 5ec3ed882..a4bec4212 100644 --- a/include/user_form_ven.php +++ b/include/user_form_ven.php @@ -551,9 +551,16 @@ function FormVenteView ($p_cn,$p_jrn,$p_periode,$p_array,$p_number,$p_doc='form' // Sum of invoice $sum_march+=$fiche_sum; // vat of the card - $fiche_amount_vat=$fiche_price*$fiche_quant*$vat_rate; + $fiche_amount_vat=round($fiche_price*$fiche_quant*$vat_rate,2); // value card + vat - $fiche_with_vat=$fiche_price*$fiche_quant*(1+$vat_rate); + $fiche_with_vat=$fiche_price*$fiche_quant+$fiche_amount_vat; + // store in array + if ( $vat_label != "") { + if ( ! isset($a_sum_tva_cat[$vat_label])) { + $a_sum_tva_cat[$vat_label]=0.0; + } + $a_sum_tva_cat[$vat_label]+=$fiche_amount_vat; + } // Sum of invoice vat $sum_with_vat+=$fiche_with_vat; // Show the data @@ -587,9 +594,17 @@ function FormVenteView ($p_cn,$p_jrn,$p_periode,$p_array,$p_number,$p_doc='form' // end table $r.=' '; + $total_vat=0.0; $r.='