* * parm : * - Label * - The type * - Name of the variable * - Default Value * - View_only * - $p_list for the select, give the possible values item[0] is the val and item[1] * is the label * gen : * - None * return: string */ function InputType($p_label,$p_type,$p_name,$p_value,$p_viewonly=false,$p_list=null) { // View only if ( $p_viewonly==false) return "$p_label$value"; // Input type == select if ( strtolower($p_type)=="select" ) { $r=" $p_label"; $r.=sprintf('"; return $r; } // input type == TEXT if ( strtolower($p_type)=="text") { $r=sprintf('%s ', $p_label, $p_type, $p_name, $p_value); return $r; } } /* function FormVente * Purpose : Display the form for a sell * Used to show detail, encode a new invoice * or update one * * 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_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",$op_date,$view_only).''; include_once("fiche_inc.php"); // Display the customer $fiche=GetFicheJrn($p_cn,$p_jrn,'cred',FICHE_TYPE_CLIENT); $r.=''.InputType("Client ","SELECT","e_client","",$view_only,$fiche).''; $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("Quantité","TEXT","e_quant","1",$view_only); // TODO Show the price // TODO PERMIT multi lines $r.=''; $r.="
"; $r.=''; $r.="
"; $r.="
"; return $r; }