From 4e74feb34bb67a384dc14b3884333917b64d6fa5 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Thu, 18 Mar 2004 14:39:48 +0000 Subject: [PATCH] New user interface --- include/form_input.php | 39 ++++++++++++++++++++++++++++++------- include/user_action_ven.php | 2 +- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/include/form_input.php b/include/form_input.php index 2eaf2386a..a7f3c6669 100644 --- a/include/form_input.php +++ b/include/form_input.php @@ -18,6 +18,8 @@ */ // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr /* $Revision$ */ +include_once("preference.php"); + /* function InputType * Purpose : Create the tag * @@ -76,29 +78,52 @@ function InputType($p_label,$p_type,$p_name,$p_value,$p_viewonly=false,$p_list=n * parm : * - p_array which can be empty * - the "journal" + * - $p_user = $g_user * - view_only if we cannot change it (no right or centralized op) * gen : * - * return: string with the form */ -function FormVente($p_cn,$p_jrn,$p_array=null,$view_only=true) -{ +function FormVente($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true) +{ + $userPref=GetUserPeriode($p_cn,$p_user); + + // The date + list ($l_date_start,$l_date_end)=GetPeriode($p_cn,$userPref); + + $op_date="01".substr($l_date_start,2,8); + echo_debug("form_input.php.FormVentep_op_date is $op_date"); $r=""; if ( $view_only == false) { $r="
"; } $r.=''; - $r.=''.InputType("Date ","Text","e_date","",$view_only).''; + $r.=''.InputType("Date ","Text","e_date",$op_date,$view_only).''; include_once("fiche_inc.php"); - $fiche=GetFicheJrn($p_cn,$p_jrn,'cred'); + // Display the customer + $fiche=GetFicheJrn($p_cn,$p_jrn,'cred',FICHE_TYPE_CLIENT); $r.=''.InputType("Client ","SELECT","e_client","",$view_only,$fiche).''; - $fiche=GetFicheJrn($p_cn,$p_jrn,'deb'); + $r.="
"; + + // Start the div for item to sell + $r.="
"; + $r.=''; + $fiche=GetFicheJrn($p_cn,$p_jrn,'deb',FICHE_TYPE_VENTE); $r.=''.InputType("Article","SELECT","e_march","",$view_only,$fiche); - $r.=InputType("Qt","TEXT","e_quant","",$view_only); + $r.=InputType("Quantité","TEXT","e_quant","1",$view_only); + + // TODO Show the price + + // TODO PERMIT multi lines + $r.=''; - $r.="
"; + $r.=""; + + $r.=''; + $r.="
"; + $r.=""; return $r; diff --git a/include/user_action_ven.php b/include/user_action_ven.php index b1fecb34c..21ca9f54b 100644 --- a/include/user_action_ven.php +++ b/include/user_action_ven.php @@ -32,7 +32,7 @@ if ( $action == 'insert_vente' ) { } // Show an empyt form of invoice include_once("form_input.php"); - $form=FormVente($cn,$g_jrn,'deb'); + $form=FormVente($cn,$g_jrn,$g_user,'deb'); echo '
'; echo $form; echo '
';