diff --git a/include/form_input.php b/include/form_input.php
index 1a86ceec3..1f0d2e079 100644
--- a/include/form_input.php
+++ b/include/form_input.php
@@ -397,6 +397,13 @@ function FormVente($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true,$p_article
$r.="";
+ $r.="
";
+ $r.="";
+ $file=new widget("file");
+ $file->table=1;
+ $r.="".$file->IOValue("pj",null,"Pièce justificative")."
";
+ $r.="
";
+ $r.="
";
if ($view_only == false ) {
$r.='';
$r.='';
@@ -404,45 +411,6 @@ function FormVente($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true,$p_article
$r.="";
$r.=JS_CALC_LINE;
} else {
-// // show summary
-// $total=0;
-// $r.='Total
';
-// $r.="";
-// $r.="| Description | ";
-// $r.=" Base TVA | ";
-// $r.=" Tva | ";
-// $r.=" Total | ";
-// 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.="| ".$a_fiche['vw_name']." | ";
-// // $r.="".$a_fiche['tva_label']." | ";
-// $r.=" ".round($total_row_no_vat,2)." | ";
-// $r.=" ".$vat_row." | ";
-// $r.=" ".round($total_row,2)." | ";
-// $r.="
";
-// $total+=$total_row;
-// }
-// }// for ($i=0
-// $r.="
";
-// $r.=sprintf(" Total = %8.2f",$total);
$r.="";
}
diff --git a/include/postgres.php b/include/postgres.php
index 37efcddda..6c81956d4 100644
--- a/include/postgres.php
+++ b/include/postgres.php
@@ -99,7 +99,7 @@ function DbConnect($p_db=-1,$p_type='dossier') {
function ExecSql($p_connection, $p_string) {
echo_debug(__FILE__,__LINE__,"SQL = $p_string");
- $ret=pg_exec($p_connection,$p_string);
+ $ret=pg_query($p_connection,$p_string);
if ( $ret == false ) {
echo_error ("SQL ERROR ::: $p_string");
exit(" Operation cancelled due to error : $p_string");
diff --git a/include/user_action_ven.php b/include/user_action_ven.php
index 49fa3552c..11ed4d74c 100644
--- a/include/user_action_ven.php
+++ b/include/user_action_ven.php
@@ -24,7 +24,6 @@ include_once("class_widget.php");
$cn=DbConnect($_SESSION['g_dossier']);
// default action is insert_vente
if ( ! isset ($_GET['action']) && ! isset ($_POST["action"]) ) {
- // echo u_ShowMenuJrn($cn,$jrn_type);
exit;
} else {
$action=(isset($_GET['action']))?$_GET['action']:$_POST['action'];
diff --git a/include/user_common.php b/include/user_common.php
index 41e8fdb9e..8171aa2c0 100644
--- a/include/user_common.php
+++ b/include/user_common.php
@@ -37,7 +37,7 @@ include_once("postgres.php");
function GetTvaRate($p_cn,$p_tva_id) {
if (strlen(trim($p_tva_id))==0) return 0;
-$Res=pg_exec($p_cn,"select tva_id,tva_rate,tva_label from tva_rate where tva_id=".$p_tva_id);
+$Res=ExecSql($p_cn,"select tva_id,tva_rate,tva_label from tva_rate where tva_id=".$p_tva_id);
if (pg_NumRows($Res) == 0 ) return null;
$r=pg_fetch_array($Res,0);