diff --git a/include/form_input.php b/include/form_input.php index 4bf49d8ca..43ef10844 100644 --- a/include/form_input.php +++ b/include/form_input.php @@ -397,12 +397,58 @@ function FormVente($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true,$p_article $r.=""; - $r.=''; - $r.=''; - $r.=""; - $r.=""; + if ($view_only == false ) { + $r.=''; + $r.=''; + $r.=""; + $r.=""; + $r.=JS_CALC_LINE; + } else { +// // show summary +// $total=0; +// $r.='

Total

'; +// $r.=""; +// $r.=""; +// $r.=""; +// $r.=""; +// $r.=""; +// for ( $i = 0; $i < $p_article;$i++) { +// if ( $view_only == true and ! isset (${"e_march$i"}) ) continue; +// $march=${"e_march$i"}; +// if ( isNumber($march) ==1 and +// isFicheOfJrn($p_cn,$p_jrn,$march,'cred')){ +// $a_fiche=GetFicheAttribut($p_cn, $march); +// // compute some data +// // $tva=(isNumber($a_fiche['tva_rate']) == 0 )?0:$a_fiche['tva_rate']; +// if ( isNumber(${"e_march$i"."_tva_id"}) ==1 ) { + +// $a_tva=GetTvaRate($p_cn,${"e_march$i"."_tva_id"}); +// $tva=$a_tva['tva_rate']; +// } else { +// $tva=(isNumber($a_fiche['tva_rate'])==1)?$a_fiche['tva_rate']:0; +// } +// $vat_row=${"e_march$i"."_sell"}*${"e_quant$i"}*$tva; +// $total_row_no_vat=${"e_march$i"."_sell"}*${"e_quant$i"}; +// $total_row=${"e_march$i"."_sell"}*${"e_quant$i"}+$vat_row; + +// $r.=""; +// $r.=""; +// // $r.=""; +// $r.=""; +// $r.=""; +// $r.=""; +// $r.=""; +// $total+=$total_row; +// } +// }// for ($i=0 +// $r.="
Description Base TVA Tva Total
".$a_fiche['vw_name']."".$a_fiche['tva_label']." ".round($total_row_no_vat,2)." ".$vat_row." ".round($total_row,2)."
"; +// $r.=sprintf(" Total = %8.2f",$total); + $r.=""; + + } + + - $r.=JS_CALC_LINE; return $r; @@ -427,7 +473,7 @@ function FormVente($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true,$p_article * */ -function FormVenteView ($p_cn,$p_jrn,$p_user,$p_array,$p_number,$p_doc='html',$p_comment='') +function FormVenteView ($p_cn,$p_jrn,$p_user,$p_array,$p_number,$p_doc='form',$p_comment='') { $r=""; $data=""; @@ -647,7 +693,7 @@ for ($o = 0;$o < $p_number; $o++) { $r.="Total HTVA =".round( $sum_march,2)."
"; $r.="Total = ".round($sum_with_vat,2); $r.=""; - if ( $p_doc == 'html' ) { + if ( $p_doc == 'form' ) { $r.='
'; $r.=$data; // $r.=''; @@ -658,19 +704,6 @@ for ($o = 0;$o < $p_number; $o++) { $r.=''; $r.='
'; } -if ( $p_doc == 'pdf' ) { - // prob with pdf and the pdf pluggin - // Cannot find a nice workaround for that - $r.='
'; -// $r.=''; - $r.=$data; - $r.=InputType("","HIDDEN","e_comment",$p_comment); - $sessid=( isset ($_POST['PHPSESSID']))?$_POST['PHPSESSID']:$_GET['PHPSESSID']; - // $r.=''; - $r.=''; - $r.='
'; - - } return $r; }