397 |
|
|
398 |
|
|
399 |
$r.="</TABLE>"; |
$r.="</TABLE>"; |
400 |
|
$r.="<hr>"; |
401 |
|
$r.="<table>"; |
402 |
|
$file=new widget("file"); |
403 |
|
$file->table=1; |
404 |
|
$r.="<TR>".$file->IOValue("pj",null,"Pièce justificative")."</TR>"; |
405 |
|
$r.="</table>"; |
406 |
|
$r.="<hr>"; |
407 |
if ($view_only == false ) { |
if ($view_only == false ) { |
408 |
$r.='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">'; |
$r.='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">'; |
409 |
$r.='<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">'; |
$r.='<INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Enregistrer">'; |
411 |
$r.="</FORM>"; |
$r.="</FORM>"; |
412 |
$r.=JS_CALC_LINE; |
$r.=JS_CALC_LINE; |
413 |
} else { |
} else { |
|
// // show summary |
|
|
// $total=0; |
|
|
// $r.='<h2 class="info">Total</h2>'; |
|
|
// $r.="<table>"; |
|
|
// $r.="<th> Description</th>"; |
|
|
// $r.="<th> Base TVA </th>"; |
|
|
// $r.="<th> Tva </th>"; |
|
|
// $r.="<th> Total </th>"; |
|
|
// 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.="<TR>"; |
|
|
// $r.="<TD>".$a_fiche['vw_name']."</td>"; |
|
|
// // $r.="<TD>".$a_fiche['tva_label']."</td>"; |
|
|
// $r.="<TD> ".round($total_row_no_vat,2)."</TD>"; |
|
|
// $r.="<TD> ".$vat_row."</TD>"; |
|
|
// $r.="<TD> ".round($total_row,2)."</TD>"; |
|
|
// $r.="</TR>"; |
|
|
// $total+=$total_row; |
|
|
// } |
|
|
// }// for ($i=0 |
|
|
// $r.="</table>"; |
|
|
// $r.=sprintf(" Total = %8.2f",$total); |
|
414 |
$r.="</div>"; |
$r.="</div>"; |
415 |
|
|
416 |
} |
} |