diff --git a/doc/function.txt b/doc/function.txt index d93e3655e..beabebcb3 100644 --- a/doc/function.txt +++ b/doc/function.txt @@ -1,2134 +1,3 @@ -************************* File = admin_repo.php **************** -************************* File = annulation.php **************** -************************* File = balance.php **************** -************************* File = central.php **************** -************************* File = compta_login.php **************** -************************* File = compta.php **************** -************************* File = dossier_prefs.php **************** -************************* File = enc_jrn.php **************** -************************* File = facturation.php **************** -************************* File = fiche_new.php **************** -************************* File = fiche.php **************** -************************* File = fiche_search.php **************** -************************* File = form.php **************** -************************* File = impress.php **************** -************************* File = index.php **************** -************************* File = jrn_add.php **************** -************************* File = jrn_detail.php **************** -************************* File = jrn_op_detail.php **************** -************************* File = jrn_search.php **************** -************************* File = jrn_update.php **************** -************************* File = line_update.php **************** -************************* File = login.php **************** -************************* File = logout.php **************** -************************* File = modify_op.php **************** -************************* File = not_implemented.php **************** -************************* File = pcmn_update.php **************** -************************* File = poste_search.php **************** -************************* File = print_balance.php **************** -************************* File = print_invoice.php **************** -************************* File = priv_user.php **************** -************************* File = rate_chg.php **************** -************************* File = send_jrn_pdf.php **************** -************************* File = send.php **************** -************************* File = send_poste_pdf.php **************** -************************* File = show_tva.php **************** -************************* File = stock.php **************** -************************* File = test.php **************** -************************* File = user_advanced.php **************** -************************* File = user_compta.php **************** -************************* File = user_jrn.php **************** -************************* File = user_login.php **************** -************************* File = user_pref.php **************** -************************* File = user_sec.php **************** -************************* File = ac_common.php **************** -ac_common.php /* function cmpDate -ac_common.php * Purpose : -ac_common.php * Compare 2 dates -ac_common.php * parm : -ac_common.php * - date1 date2 -ac_common.php * gen : -ac_common.php * - rien -ac_common.php * return: -ac_common.php * - == 0 les dates sont identiques -ac_common.php * - > 0 date1 > date2 -ac_common.php * - < 0 date1 < date2 -ac_common.php */ -ac_common.php /* function IsNumber -ac_common.php * purpose : check if the argument is a number -ac_common.php * -ac_common.php * parm : $p_int -ac_common.php * -ac_common.php * gen nothing -ac_common.php * -ac_common.php * return : -ac_common.php * 1 it's a number -ac_common.php * 0 it is not -ac_common.php */ -ac_common.php /* function isDate -ac_common.php * Purpose : Verifie qu'une date est bien formaté -ac_common.php * en d.m.y et est valable -ac_common.php * parm : -ac_common.php * - $p_date -ac_common.php * gen : -ac_common.php * - rien -ac_common.php * return: -ac_common.php * - null si la date est invalide ou malformaté -ac_common.php * - $p_date si tout est bon -ac_common.php * -ac_common.php */ -ac_common.php /* function formatDate($p_date) -ac_common.php * Purpose : -ac_common.php * -ac_common.php * parm : -ac_common.php * - -ac_common.php * gen : -ac_common.php * - -ac_common.php * return: -ac_common.php */ -ac_common.php /* function html_page_start -ac_common.php * Purpose : Default page header for each page -ac_common.php * -ac_common.php * parm : -ac_common.php * - default theme -ac_common.php * - $p_script -ac_common.php * gen : -ac_common.php * - none -ac_common.php * return: -ac_common.php * none -ac_common.php */ -ac_common.php /* function html_page_stop() -ac_common.php * Purpose : -ac_common.php * -ac_common.php * parm : -ac_common.php * - -ac_common.php * gen : -ac_common.php * - -ac_common.php * return: -ac_common.php */ -ac_common.php /* function html_button_logout -ac_common.php * Purpose : -ac_common.php * -ac_common.php * parm : -ac_common.php * - -ac_common.php * gen : -ac_common.php * - -ac_common.php * return: -ac_common.php */ -ac_common.php /* function NoAccess -ac_common.php * Purpose : -ac_common.php * -ac_common.php * parm : -ac_common.php * - -ac_common.php * gen : -ac_common.php * - -ac_common.php * return: -ac_common.php */ -ac_common.php /* function FormatString($p_string) -ac_common.php * Purpose : Fix the problem with the ' char -ac_common.php * -ac_common.php * parm : -ac_common.php * - -ac_common.php * gen : -ac_common.php * - -ac_common.php * return: -ac_common.php */ -ac_common.php /* function GetUserType -ac_common.php * Purpose : get the type of an user (compta,developper or user) -ac_common.php * -ac_common.php * parm : -ac_common.php * - param $p_user user_login -ac_common.php * gen : -ac_common.php * - none -ac_common.php * return: the type of the user -ac_common.php */ -ac_common.php /* function Redirect -ac_common.php * Purpose : redirect following the user's profile -ac_common.php * -ac_common.php * parm : -ac_common.php * - p_profile (ac_users.use_usertype) -ac_common.php * - php_session PHPSESSID -ac_common.php * gen : -ac_common.php * - none -ac_common.php * return: none -ac_common.php */ -ac_common.php /* function ShowItem($p_array) */ -ac_common.php /* function echo_warning -ac_common.php * Purpose : warns -ac_common.php * -ac_common.php * parm : -ac_common.php * - string -ac_common.php * gen : -ac_common.php * - none -ac_common.php * return: -ac_common.php * - none -ac_common.php */ -************************* File = central_inc.php **************** -central_inc.php /* function Centralise -central_inc.php * Purpose : -central_inc.php * Met les donnees centralisees dans la table -central_inc.php * centralize -central_inc.php * -central_inc.php * parm : -central_inc.php * - p_cn connection -central_inc.php * - periode a centraliser -central_inc.php * gen : -central_inc.php * - none -central_inc.php * return: -central_inc.php * - code error -central_inc.php * -central_inc.php */ -central_inc.php /* function isCentralize($p_cn,$p_user) -central_inc.php ************************************************** -central_inc.php * Purpose : test if e jrn_jr.id is centralize or not -central_inc.php * -central_inc.php * parm : -central_inc.php * - p_cn -central_inc.php * - p_jnr_id jrn.jr_id -central_inc.php * gen : -central_inc.php * - none -central_inc.php * return: 0 if not centralized otherwise > 0 -central_inc.php */ -************************* File = check_priv.php **************** -check_priv.php /* function CheckJrn -check_priv.php * Purpose : -check_priv.php * Vérifie les acces d'un utilisateur -check_priv.php * sur un journal -check_priv.php * -check_priv.php * parm : -check_priv.php * - $p_dossier le dossier -check_priv.php * - $p_user le login user -check_priv.php * - $p_jrn le journal -check_priv.php * gen : -check_priv.php * - rien -check_priv.php * return: -check_priv.php * - 0 pas d'acces -check_priv.php * - 1 Lecture -check_priv.php * - 2 écriture -check_priv.php * -check_priv.php */ -check_priv.php /* function CheckAction -check_priv.php * Purpose : Check if an user is allowed to do an action -check_priv.php * -check_priv.php * parm : -check_priv.php * - p_dossier dossier id -check_priv.php * - p_login user's login -check_priv.php * - p_action_id -check_priv.php * gen : -check_priv.php * - -check_priv.php * return: -check_priv.php * - 0 no priv -check_priv.php * - 1 priv granted -check_priv.php * -check_priv.php */ -check_priv.php /* function CheckIsAdmin -check_priv.php * Purpose : Check if an user is an administrator -check_priv.php * -check_priv.php * parm : -check_priv.php * - $p_user user login -check_priv.php * gen : -check_priv.php * - -check_priv.php * return: -check_priv.php * - 0 if no -check_priv.php * - 1 if yes -check_priv.php * -check_priv.php */ -check_priv.php /* function CheckDossier -check_priv.php ************************************************** -check_priv.php * Purpose : Check if an user has acces to a folder -check_priv.php * -check_priv.php * parm : -check_priv.php * - user -check_priv.php * - p_dossier concerned folder -check_priv.php * gen : -check_priv.php * - none -check_priv.php * return: -check_priv.php * 1 if yes -check_priv.php * 0 if no -check_priv.php */ -************************* File = compta_menu.php **************** -compta_menu.php /* function c_ShowMenuComptaRight -compta_menu.php * Purpose : Display menu on the Right -compta_menu.php * (preference, logout and admin) -compta_menu.php * parm : -compta_menu.php * - $p_dossier the current dossier -compta_menu.php * - $p_admin $g_UserProperty['use_admin'] 1 if admin -compta_menu.php * - $p_more code -compta_menu.php * gen : -compta_menu.php * - none -compta_menu.php * return: -compta_menu.php * - none -compta_menu.php * -compta_menu.php */ -compta_menu.php /* function ShowMenuCompta -compta_menu.php * Purpose : Montre le menu du haut -compta_menu.php * -compta_menu.php * parm : -compta_menu.php * - dossier -compta_menu.php * - $p_user array ($g_UserProperty) -compta_menu.php * gen : -compta_menu.php * - none -compta_menu.php * return: -compta_menu.php * - none -compta_menu.php * -compta_menu.php */ -compta_menu.php /* function c_ShowMenuJrnUser($p_dossier,$p_user) -compta_menu.php * Purpose : Show the Menu from the jrn encode -compta_menu.php * page -compta_menu.php * -compta_menu.php * parm : -compta_menu.php * - $p_dossier -compta_menu.php * - $p_user -compta_menu.php * gen : -compta_menu.php * - none -compta_menu.php * return: -compta_menu.php * - none -compta_menu.php * -compta_menu.php */ -************************* File = constant.php **************** -************************* File = debug.php **************** -************************* File = error.php **************** -error.php /* function AnalyzeError -error.php * Purpose : Following the error code -error.php * show adialog box -error.php * parm : -error.php * - $p_result -error.php * gen : -error.php * - none -error.php * return: none -error.php */ -************************* File = facture_inc.php **************** -facture_inc.php /* function -facture_inc.php * Purpose : -facture_inc.php * -facture_inc.php * parm : -facture_inc.php * - -facture_inc.php * gen : -facture_inc.php * - -facture_inc.php * return: -facture_inc.php * - -facture_inc.php * -facture_inc.php */ -facture_inc.php /* function -facture_inc.php * Purpose : -facture_inc.php * -facture_inc.php * parm : -facture_inc.php * - -facture_inc.php * gen : -facture_inc.php * - -facture_inc.php * return: -facture_inc.php * - -facture_inc.php * -facture_inc.php */ -************************* File = fiche_inc.php **************** -fiche_inc.php /* function GetSqlFiche -fiche_inc.php *************************************************** -fiche_inc.php * purpose : return the sql string which match the p_type -fiche_inc.php * permit to have all the sql here -fiche_inc.php * param : $p_type what sql select command u want -fiche_inc.php * return : string -fiche_inc.php */ -fiche_inc.php /* function addFiche -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : ajoute une nouvelle fiche -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - connexion -fiche_inc.php * - type de la fiche -fiche_inc.php * - tableau -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - none -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function EncodeFiche -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Affiche les détails d'une fiche et propose -fiche_inc.php * de mettre à jour -fiche_inc.php * ou si array est a null, permet d'ajouter une -fiche_inc.php * fiche, to fill the attribute -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connexion -fiche_inc.php * - p_type id du modele fiche_def(fd_id) de la fiche SI array est null -fiche_inc.php * sinon correspond au id d'une fiche fiche(f_id) -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - none -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function GetBaseFiche -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : donne la classe comptable de base d'une fiche -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connexion -fiche_inc.php * - p_type fiche id -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - return la classe id ou rien -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function GetBaseFicheDefault -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Give the default accounts of fiche_def -fiche_inc.php * -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connexion -fiche_inc.php * - p_type fiche id -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - return la classe id ou rien -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function ViewFiche -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Montre les fiches d'une rubrique -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connexion -fiche_inc.php * - $p_type fiche_def.fd_id catg of card -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - none -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function GetNextFiche -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Crée le poste suivant pour une fiche en fonction -fiche_inc.php * de la classe de base (fichedef(fd_class_base)) -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connexion -fiche_inc.php * - p_base -fiche_inc.php * gen : -fiche_inc.php * - -fiche_inc.php * return: -fiche_inc.php * - -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function ViewFicheDetail -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Montre le detail d'une fiche -fiche_inc.php * et ajoute les lignes manquantes -fiche_inc.php * dans le cas où le modèle à changer -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn -fiche_inc.php * - id de la fiche fiche(f_id) -fiche_inc.php * gen : -fiche_inc.php * - -fiche_inc.php * return: -fiche_inc.php * - -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function UpdateFiche -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Met a jour une fiche -fiche_inc.php * change dans le plan comptable, fiche,et isupp -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn -fiche_inc.php * - p_array -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - nothing -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function EncodeModele -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - -fiche_inc.php * gen : -fiche_inc.php * - -fiche_inc.php * return: -fiche_inc.php * - -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function DefModele -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Creation of a model of card or correction -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - $p_cn database connection -fiche_inc.php * - $p_ligne number of lines -fiche_inc.php * - $p_array array -fiche_inc.php * - $p_js class base (javascript code) -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - nothing -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function AddModele -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Add a modele of card into the database -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - connection -fiche_inc.php * - array -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * table : insert into fiche_def -fiche_inc.php * insert into attr_def -fiche_inc.php * return: -fiche_inc.php * - none -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function UpdateModele -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Modify the model of card -fiche_inc.php * change some attribute (fd_label) and permit -fiche_inc.php * to add line -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connexion -fiche_inc.php * - p_fiche fichedef(f_id) -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - none -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function GetDataModele -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Return the info of an fiche identified by -fiche_inc.php * p_fiche -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - connection -fiche_inc.php * - fiche id -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - array with all the data -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function Remove -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : enleve une fiche dans attr_value, jnt_fic_att_value et fiche -fiche_inc.php * a la condition que ce poste n'aie jamais -fiche_inc.php * été utilisé -fiche_inc.php * parm : -fiche_inc.php * - p_cn -fiche_inc.php * - p_fid fiche(f_id) -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - none -fiche_inc.php */ -fiche_inc.php /* function getFicheName -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : retourne le nom de la fiche -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connexion -fiche_inc.php * - p_id fiche id -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - string avec nom fiche -fiche_inc.php */ -fiche_inc.php /* function getFicheDefName -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : retourne le nom de la cat. de fiches -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connexion -fiche_inc.php * - p_id fiche id fiche_def.fd_id -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - string fiche_def.fd_label -fiche_inc.php */ -fiche_inc.php /* function GetFicheJrn -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Get all the fiche related to a "journal" -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connextion -fiche_inc.php * - j_jrn journal_id -fiche_inc.php * - $p_type : deb or cred -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: array containing the fiche(f_id),fiche(f_label) -fiche_inc.php */ -fiche_inc.php /* function Get_fiche_def_ref -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : -fiche_inc.php * return an array containing all the -fiche_inc.php * data contained in the table fiche_def_ref -fiche_inc.php * parm : -fiche_inc.php * - $p_cn connection to the database -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * array if ok null otherwize -fiche_inc.php */ -fiche_inc.php /* function Get_attr_min -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : retrieve the mandatory field of the card model -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - $p_cn database connexion -fiche_inc.php * - $p_fiche_def_ref -fiche_inc.php * gen : -fiche_inc.php * - -fiche_inc.php * return: -fiche_inc.php * array of ad_id (attr_min.ad_id) and labels (attr_def.ad_text) -fiche_inc.php */ -fiche_inc.php /* function Get_attr_def -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : retrieve the fields of the card model -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - $p_cn database connexion -fiche_inc.php * - $p_fiche_def_ref fiche_def.fd_id -fiche_inc.php * gen : -fiche_inc.php * - -fiche_inc.php * return: -fiche_inc.php * array of ad_id (attr_def.ad_id) and labels (attr_def.ad_text) -fiche_inc.php */ -fiche_inc.php /* function GetCreateAccount -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : retrieve the fields of the card model -fiche_inc.php * which indicate if each cards needs its own account -fiche_inc.php * parm : -fiche_inc.php * - $p_cn database connexion -fiche_inc.php * - $p_fiche_def_ref fiche_def.fd_id -fiche_inc.php * gen : -fiche_inc.php * - -fiche_inc.php * return: -fiche_inc.php * not null if yes, each cards has its own account -fiche_inc.php */ -fiche_inc.php /* function GetFicheDefRef -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : retrieve the fiche_def.frd_id thanks the f_id -fiche_inc.php * of a card -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - $p_cn connection -fiche_inc.php * - $p_f_id fiche.f_id -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - the fiche_def.frd_id or null if nothing has been found -fiche_inc.php */ -fiche_inc.php /* function GetFicheRef -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : retrieve the fiche_def.fd_id thanks the f_id -fiche_inc.php * of a card -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - $p_cn connection -fiche_inc.php * - $p_f_id fiche.f_id -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - the fiche_def.fd_id or null if nothing has been found -fiche_inc.php */ -fiche_inc.php /* function GetClass -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Retrieve the account of a card -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - connection -fiche_inc.php * - card id (fiche.f_id) -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * string if a class if found or null otherwise -fiche_inc.php */ -fiche_inc.php /* function InsertModeleLine -fiche_inc.php ************************************************** -fiche_inc.php * Purpose : Insert a new row into jnt_fic_attr -fiche_inc.php * for adding a new attribute to the card model -fiche_inc.php * parm : -fiche_inc.php * - p_cn connection -fiche_inc.php * - the fiche_def.fd_id, id of the cat of the model -fiche_inc.php * - the ad_id is the attr_def.ad_id -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: none -fiche_inc.php */ -fiche_inc.php /* function SaveModeleName -fiche_inc.php ************************************************** -fiche_inc.php * Purpose : Update the model's name -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connection -fiche_inc.php * - the fiche_def.fd_id, id of the cat of the model -fiche_inc.php * - the label -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: none -fiche_inc.php */ -fiche_inc.php /* function DisplayDetailModele -fiche_inc.php ************************************************** -fiche_inc.php * Purpose : Show the data contained in an array of -fiche_inc.php * a model of card (fiche_def) -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn database connection -fiche_inc.php * - array containing -fiche_inc.php * label,class_base,fd_id,ad_textX,ad_idX -fiche_inc.php * - number of line -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * none -fiche_inc.php */ -fiche_inc.php /* function GetParent -fiche_inc.php ************************************************** -fiche_inc.php * Purpose : Get the parent in tmp_pcmn -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - cn database connextion -fiche_inc.php * - the base we want insert -fiche_inc.php * gen : -fiche_inc.php * - -fiche_inc.php * return: the parent -fiche_inc.php * -fiche_inc.php */ -fiche_inc.php /* function getFicheAttribut -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : retrun array of attribut or string -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connexion -fiche_inc.php * - p_id fiche id -fiche_inc.php * - attribut if attribut == "" then return a array -fiche_inc.php * taken from vw_fiche_attr -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * return: -fiche_inc.php * - string avec nom fiche or array -fiche_inc.php */ -fiche_inc.php /* function IsFicheOfJrn -fiche_inc.php *************************************************** -fiche_inc.php * Purpose : Check if a fiche is used by a jrn -fiche_inc.php * return 1 if the fiche is in the range otherwise 0 -fiche_inc.php * -fiche_inc.php * parm : -fiche_inc.php * - p_cn connextion -fiche_inc.php * - j_jrn journal_id -fiche_inc.php * - $p_type : deb or cred -fiche_inc.php * - $p_fiche : p_f_id -fiche_inc.php * gen : -fiche_inc.php * - none -fiche_inc.php * -fiche_inc.php * return 1 if the fiche is in the range otherwise 0 -fiche_inc.php * -fiche_inc.php */ -************************* File = form_inc.php **************** -form_inc.php /* function EncodeForm -form_inc.php * Purpose : -form_inc.php * Encoding Form -form_inc.php * -form_inc.php * parm : -form_inc.php * - array of previous changes -form_inc.php * - sessid for the search window -form_inc.php * - p_line number of line -form_inc.php * gen : -form_inc.php * - none -form_inc.php * return: -form_inc.php * - none -form_inc.php * -form_inc.php */ -form_inc.php /* function ViewForm -form_inc.php * Purpose : Show the details of a form -form_inc.php * -form_inc.php * parm : -form_inc.php * - $p_cn connection -form_inc.php * - $p_id gives the formdef.fr_id -form_inc.php * - sessid for the search window -form_inc.php * gen : -form_inc.php * - none -form_inc.php * return: -form_inc.php * - none -form_inc.php * -form_inc.php */ -form_inc.php /* function GetDataForm -form_inc.php * Purpose : -form_inc.php * Get data from a form -form_inc.php * parm : -form_inc.php * - $p_cn connection -form_inc.php * - $p_id gives the formdef.fr_id -form_inc.php * - -form_inc.php * gen : -form_inc.php * - none -form_inc.php * return: -form_inc.php * - array -form_inc.php * -form_inc.php */ -form_inc.php /* function GetNumberLine -form_inc.php * Purpose : Get the number of line of a form -form_inc.php * -form_inc.php * parm : -form_inc.php * - $p_cn connection -form_inc.php * - $p_id gives the formdef.fr_id -form_inc.php * - -form_inc.php * gen : -form_inc.php * - none -form_inc.php * return: -form_inc.php * - integer -form_inc.php * -form_inc.php */ -form_inc.php /* function GetFormName -form_inc.php * Purpose : Get the name of the form -form_inc.php * -form_inc.php * parm : -form_inc.php * - $p_cn connection -form_inc.php * - $p_id formdef.fr_id -form_inc.php * gen : -form_inc.php * - none -form_inc.php * return: -form_inc.php * - string name -form_inc.php * -form_inc.php */ -form_inc.php /* function UpdateForm -form_inc.php * Purpose : -form_inc.php * -form_inc.php * parm : -form_inc.php * - $p_cn connexion -form_inc.php * - $array -form_inc.php * gen : -form_inc.php * - none -form_inc.php * return: -form_inc.php * - none -form_inc.php * -form_inc.php */ -form_inc.php /* function AddForm -form_inc.php * Purpose : -form_inc.php * -form_inc.php * parm : -form_inc.php * - $p_cn connexion -form_inc.php * - $array -form_inc.php * gen : -form_inc.php * - none -form_inc.php * return: -form_inc.php * - none -form_inc.php * -form_inc.php */ -************************* File = form_input.php **************** -form_input.php /* function InputType -form_input.php * Purpose : Create the tag -form_input.php * -form_input.php * parm : -form_input.php * - Label question -form_input.php * - The type (text, select, text_big -form_input.php * - Name of the variable -form_input.php * - Default Value -form_input.php * - View_only -form_input.php * - $p_list for the select, give the possible values item[0] is the val and item[1] -form_input.php * is the label or for the js_search p_list is a string (cred -form_input.php * or deb or the fiche_def_type -form_input.php * gen : -form_input.php * - None -form_input.php * return: string -form_input.php */ -form_input.php /* function FormVente -form_input.php * Purpose : Display the form for a sell -form_input.php * Used to show detail, encode a new invoice -form_input.php * or update one -form_input.php * -form_input.php * parm : -form_input.php * - p_array which can be empty -form_input.php * - the "journal" -form_input.php * - $p_user = $g_user -form_input.php * - view_only if we cannot change it (no right or centralized op) -form_input.php * - $p_article number of article -form_input.php * gen : -form_input.php * - -form_input.php * return: string with the form -form_input.php * TODO Add in parameters the infos about the company for making the invoice -form_input.php */ -form_input.php /* function FormVenteView ($p_cn,$p_jrn,$p_user,$p_array,$p_number,$p_doc='html',$p_comment='') -form_input.php ************************************************** -form_input.php * Purpose : Show the invoice before inserting it -form_input.php * the database -form_input.php * -form_input.php * parm : -form_input.php * - p_cn database connection -form_input.php * - p_jrn journal -form_input.php * - p_user -form_input.php * - array of value -form_input.php * - nb of item -form_input.php * - p_doc type pdf or html -form_input.php * gen : -form_input.php * - none -form_input.php * return: -form_input.php * - string -form_input.php * -form_input.php */ -form_input.php /* function RecordInvoice -form_input.php ************************************************** -form_input.php * Purpose : Record an invoice in the table jrn & -form_input.php * jrnx -form_input.php * -form_input.php * parm : -form_input.php * - $p_cn Database connection -form_input.php * - $p_array contains all the invoice data -form_input.php * e_date => e : 01.01.2003 -form_input.php * e_client => e : 3 -form_input.php * nb_item => e : 3 -form_input.php * e_march0 => e : 6 -form_input.php * e_quant0 => e : 0 -form_input.php * e_march0_sell=>e:1 -form_input.php * e_march1 => e : 6 -form_input.php * e_quant1 => e : 2 -form_input.php * e_march1_sell=>e:1 -form_input.php * e_march2 => e : 7 -form_input.php * e_quant2 => e : 3 -form_input.php * e_march2_sell=>e:1 -form_input.php V : view_invoice => e : Voir cette facture -form_input.php V : record_invoice => e : Sauver -form_input.php * - $p_user userid -form_input.php * - $p_jrn current folder (journal) -form_input.php * gen : -form_input.php * - none -form_input.php * return: -form_input.php * true on success -form_input.php */ -form_input.php /* function FormAch($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true,$p_article=1) -form_input.php * Purpose : Display the form for buying -form_input.php * Used to show detail, encode a new invoice -form_input.php * or update one -form_input.php * -form_input.php * parm : -form_input.php * - p_array which can be empty -form_input.php * - the "journal" -form_input.php * - $p_user = $g_user -form_input.php * - $p_submit contains the submit string -form_input.php * - view_only if we cannot change it (no right or centralized op) -form_input.php * - $p_article number of article -form_input.php * gen : -form_input.php * - -form_input.php * return: string with the form -form_input.php * TODO Add in parameters the infos about the company for making the invoice -form_input.php */ -form_input.php /* function RecordAchat -form_input.php ************************************************** -form_input.php * Purpose : Record an buy in the table jrn & -form_input.php * jrnx -form_input.php * -form_input.php * parm : -form_input.php * - $p_cn Database connection -form_input.php * - $p_array contains all the invoice data -form_input.php * e_date => e : 01.01.2003 -form_input.php * e_client => e : 3 -form_input.php * nb_item => e : 3 -form_input.php * e_march0 => e : 6 -form_input.php * e_quant0 => e : 0 -form_input.php * e_march0_sell=>e:1 -form_input.php * e_march1 => e : 6 -form_input.php * e_quant1 => e : 2 -form_input.php * e_march1_sell=>e:1 -form_input.php * e_march2 => e : 7 -form_input.php * e_quant2 => e : 3 -form_input.php * e_march2_sell=>e:1 -form_input.php V : view_invoice => e : Voir cette facture -form_input.php V : record_invoice => e : Sauver -form_input.php * - $p_user userid -form_input.php * - $p_jrn current folder (journal) -form_input.php * gen : -form_input.php * - none -form_input.php * return: -form_input.php * true on success -form_input.php */ -form_input.php /* function FormFin($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true,$p_item=1) -form_input.php * Purpose : Display the form for financial -form_input.php * Used to show detail, encode a new fin op -form_input.php * or update one -form_input.php * -form_input.php * parm : -form_input.php * - p_array which can be empty -form_input.php * - the "journal" -form_input.php * - $p_user = $g_user -form_input.php * - $p_submit contains the submit string -form_input.php * - view_only if we cannot change it (no right or centralized op) -form_input.php * - $p_item number of article -form_input.php * gen : -form_input.php * - -form_input.php * return: string with the form -form_input.php */ -form_input.php /* function RecordFin -form_input.php ************************************************** -form_input.php * Purpose : Record an invoice in the table jrn & -form_input.php * jrnx -form_input.php * -form_input.php * parm : -form_input.php * - $p_cn Database connection -form_input.php * - $p_array contains all the invoice data -form_input.php * e_date => e : 01.01.2003 -form_input.php * e_bank_account => e : 3 -form_input.php * - $p_user userid -form_input.php * - $p_jrn current folder (journal) -form_input.php * - array e_other$i, e_other$i_amount, e_other$i_label -form_input.php * gen : -form_input.php * - none -form_input.php * return: -form_input.php * true on success -form_input.php */ -form_input.php /* function FormODS($p_cn,$p_jrn,$p_user,$p_array=null,$view_only=true,$p_article=1) -form_input.php * Purpose : Display the miscellaneous operation -form_input.php * Used to show detail, encode a new oper -form_input.php * or update one -form_input.php * -form_input.php * parm : -form_input.php * - p_array which can be empty -form_input.php * - the "journal" -form_input.php * - $p_user = $g_user -form_input.php * - $p_submit contains the submit string -form_input.php * - view_only if we cannot change it (no right or centralized op) -form_input.php * - $p_article number of article -form_input.php * gen : -form_input.php * - -form_input.php * return: string with the form -form_input.php */ -form_input.php /* function RecordODS -form_input.php ************************************************** -form_input.php * Purpose : Record an buy in the table jrn & -form_input.php * jrnx -form_input.php * -form_input.php * parm : -form_input.php * - $p_cn Database connection -form_input.php * - $p_array contains all the invoice data -form_input.php * e_date => e : 01.01.2003 -form_input.php * nb_item => e : 3 -form_input.php * e_account0 => e : 6 -form_input.php * e_account0_amount=>e:1 -form_input.php * - $p_user userid -form_input.php * - $p_jrn current folder (journal) -form_input.php * gen : -form_input.php * - none -form_input.php * return: -form_input.php * true on success -form_input.php */ -************************* File = impress_inc.php **************** -impress_inc.php /* function ViewImp -impress_inc.php * Purpose : Create the form where the period -impress_inc.php * is asked -impress_inc.php * -impress_inc.php * parm : -impress_inc.php * - array (type,action,central,filter...) -impress_inc.php * - connection -impress_inc.php * gen : -impress_inc.php * - none -impress_inc.php * return: -impress_inc.php * - none -impress_inc.php * -impress_inc.php */ -impress_inc.php /* function Imp -impress_inc.php * Purpose : Show the html printing result -impress_inc.php * -impress_inc.php * -impress_inc.php * parm : -impress_inc.php * - array -impress_inc.php * - db connection -impress_inc.php * gen : -impress_inc.php * - none -impress_inc.php * return: -impress_inc.php * - ImpHtml -impress_inc.php * -impress_inc.php */ -impress_inc.php /* function ImpHtml -impress_inc.php * Purpose : Show the html result -impress_inc.php * -impress_inc.php * parm : -impress_inc.php * - array (type,periode, -impress_inc.php * - connection -impress_inc.php * gen : -impress_inc.php * - none -impress_inc.php * return: -impress_inc.php * - error if something goes wrong or -impress_inc.php * the page result -impress_inc.php * -impress_inc.php */ -impress_inc.php /* function GetDataPoste -impress_inc.php * Purpose : Get dat for poste -impress_inc.php * -impress_inc.php * parm : -impress_inc.php * - connection -impress_inc.php * - condition -impress_inc.php * -. position -impress_inc.php * gen : -impress_inc.php * - none -impress_inc.php * return: -impress_inc.php * - none -impress_inc.php * -impress_inc.php */ -impress_inc.php /* function GetDataJrn -impress_inc.php * Purpose : Get data from the jrn table -impress_inc.php * -impress_inc.php * parm : -impress_inc.php * - connection -impress_inc.php * - array periode -impress_inc.php * - filter (default = YES) -impress_inc.php * gen : -impress_inc.php * - none -impress_inc.php * return: -impress_inc.php * - error code if something code wrong -impress_inc.php * otherwise the result -impress_inc.php * -impress_inc.php */ -impress_inc.php /* function CreatePeriodeCond -impress_inc.php * Purpose : Create the sql query for the periode -impress_inc.php * -impress_inc.php * parm : -impress_inc.php * - p_periode -impress_inc.php * - p_field (default = j_tech_per) -impress_inc.php * gen : -impress_inc.php * - none -impress_inc.php * return: -impress_inc.php * - a string containing the query -impress_inc.php * -impress_inc.php */ -impress_inc.php /* function GetDataJrnPdf -impress_inc.php * Purpose : Get The data for the pdf printing -impress_inc.php * -impress_inc.php * parm : -impress_inc.php * - connection -impress_inc.php * - array -impress_inc.php * - p_limit starting line -impress_inc.php * - p_offset number of lines -impress_inc.php * -impress_inc.php * gen : -impress_inc.php * - none -impress_inc.php * return: -impress_inc.php * - Array with the asked data -impress_inc.php * -impress_inc.php */ -impress_inc.php /* function -impress_inc.php * Purpose : -impress_inc.php * -impress_inc.php * parm : -impress_inc.php * - -impress_inc.php * gen : -impress_inc.php * - -impress_inc.php * return: -impress_inc.php */ -impress_inc.php /* function GetRappel -impress_inc.php * Purpose : Get the amount on each page -impress_inc.php * -impress_inc.php * parm : -impress_inc.php * - $p_cn -impress_inc.php * - $p_jrnx_id jrnx.j_id -impress_inc.php * - $p_jrn_id jrn.jr_id -impress_inc.php * - $which LAST or FIRST -impress_inc.php * - $p_type valeur JRN GL-CENTRAL GL-NOCENTRAL -impress_inc.php * gen : -impress_inc.php * - -impress_inc.php * return: -impress_inc.php * - array sum (deb) sum(cred) -impress_inc.php * -impress_inc.php */ -impress_inc.php /* function ParseFormula -impress_inc.php * Purpose : Parse the formula contained in the fo_formula -impress_inc.php * field and return a array containing all the columns -impress_inc.php * -impress_inc.php * parm : -impress_inc.php * - $p_cn connexion -impress_inc.php * - $p_label -impress_inc.php * - $p_formula -impress_inc.php * gen : -impress_inc.php * - none -impress_inc.php * return: -impress_inc.php * - array -impress_inc.php * -impress_inc.php */ -************************* File = jrn.php **************** -jrn.php /* function RecordJrn -jrn.php * Purpose : Record an entry in the selected journal -jrn.php * -jrn.php * parm : -jrn.php * - p_dossier dossier id -jrn.php * - p_user user id -jrn.php * - p_jrn selected journal -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - none -jrn.php * -jrn.php */ -jrn.php /* function UpdateJrn -jrn.php * Purpose : Display the form to UPDATE account operation -jrn.php * -jrn.php * parm : -jrn.php * - p_dossier -jrn.php * - p_jrn -jrn.php * - p_MaxDeb number of debit line -jrn.php * - p_MaxCred " " credit " -jrn.php *" - p_array array containing the others datas -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - none -jrn.php * -jrn.php */ -jrn.php /* function ViewRec -jrn.php * Purpose : debug function to be dropped -jrn.php * -jrn.php * parm : -jrn.php * - -jrn.php * gen : -jrn.php * - -jrn.php * return: -jrn.php * - -jrn.php * -jrn.php */ -jrn.php /* function CorrectRecord -jrn.php * Purpose : Call the RecordJrn. In fact does nothing -jrn.php * -jrn.php * parm : -jrn.php * - the same as RecordJrn -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - none -jrn.php * -jrn.php */ -jrn.php /* function ViewRecord -jrn.php * Purpose : View the added operation -jrn.php * -jrn.php * parm : -jrn.php * - p_dossier -jrn.php * - p_jrn -jrn.php * - p_id -jrn.php * - p_MaxDeb -jrn.php * - p_MaxCred -jrn.php * - p_array -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - none -jrn.php * -jrn.php */ -jrn.php /* function GetJrnProperty ($p_cn,$p_jrn) -jrn.php * Purpose : Get the properties of a journal -jrn.php * -jrn.php * parm : -jrn.php * - p_cn database connection -jrn.php * - p_jrn the jrn id -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - an array containing properties -jrn.php * -jrn.php */ -jrn.php /* function GetJrnProp -jrn.php * Purpose : Get the properties of a journal -jrn.php * -jrn.php * parm : -jrn.php * - p_dossier the folder id -jrn.php * - p_jrn the jrn id -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - an array containing properties -jrn.php * -jrn.php */ -jrn.php /* function GetNextId($p_cn,$p_name) -jrn.php * Purpose : -jrn.php * -jrn.php * parm : -jrn.php * - -jrn.php * gen : -jrn.php * - -jrn.php * return: -jrn.php * - -jrn.php * -jrn.php */ -jrn.php /* function GetNextJrnId($p_cn,$p_name) -jrn.php * Purpose : -jrn.php * -jrn.php * parm : -jrn.php * - -jrn.php * gen : -jrn.php * - -jrn.php * return: -jrn.php * - -jrn.php * -jrn.php */ -jrn.php /* function ViewJrn -jrn.php * Purpose : Vue des écritures comptables -jrn.php * -jrn.php * parm : -jrn.php * - p_dossier, -jrn.php * - p_user, -jrn.php * - p_jrn -jrn.php * - p_url for modif -jrn.php * - array -jrn.php * gen : -jrn.php * - -jrn.php * return: -jrn.php * - -jrn.php * -jrn.php */ -jrn.php /* function GetData -jrn.php * Purpose : Get data from jrnx where p_grpt=jrnx(j_grpt) -jrn.php * -jrn.php * parm : -jrn.php * - connection -jrn.php * - p_grpt -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - return array -jrn.php * -jrn.php */ -jrn.php /* function -jrn.php * Purpose : -jrn.php * -jrn.php * parm : -jrn.php * - -jrn.php * gen : -jrn.php * - -jrn.php * return: -jrn.php * - -1 si aucune valeur de trouvée -jrn.php * -jrn.php */ -jrn.php /* function GetInternal($p_cn,$p_id) -jrn.php * Purpose : Return the internal value -jrn.php * -jrn.php * parm : -jrn.php * - p_cn database connection -jrn.php * - p_id : jrn.jr_id -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - null si aucune valeur de trouvée -jrn.php * -jrn.php */ -jrn.php /* function GetAmount -jrn.php * Purpose : return the sum of jrn where -jrn.php * the internal_code is the p_id -jrn.php * -jrn.php * parm : -jrn.php * - $p_cn database connection -jrn.php * - p_id = jrn.jr_internal -jrn.php * gen : -jrn.php * - -jrn.php * return: -jrn.php * - number -jrn.php * -jrn.php */ -jrn.php /* function VerifData -jrn.php * Purpose : Verify the data before inserting or -jrn.php * updating -jrn.php * -jrn.php * parm : -jrn.php * - p_cn connection -jrn.php * - p_array array with all the values -jrn.php * - p_user -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - errorcode or ok -jrn.php * -jrn.php */ -jrn.php /* function GetJrnName -jrn.php * Purpose : Return the name of the jrn -jrn.php * -jrn.php * parm : -jrn.php * - p_cn connexion resource -jrn.php * - jrn id -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - string or null if not found -jrn.php * -jrn.php */ -jrn.php /* function NextJrn -jrn.php * Purpose : -jrn.php * Get the number of the next jrn -jrn.php * from the jrn_def.jrn_code -jrn.php * -jrn.php * parm : -jrn.php * - $p_cn connection -jrn.php * - $p_type jrn type -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - string containing the next code -jrn.php * -jrn.php */ -jrn.php /* function SetInternalCode -jrn.php * Purpose : -jrn.php * -jrn.php * parm : -jrn.php * - $p_cn connection -jrn.php * - $p_grpt id in jr_grpt_id -jrn.php * - $p_jrn jrn id jrn_def_id -jrn.php * - $p_dossier dossier id -jrn.php * gen : -jrn.php * - -jrn.php * return: -jrn.php * - -jrn.php * -jrn.php */ -jrn.php /* function GetDataJrnJrid -jrn.php * Purpose : Get data from jrn and jrnx thanks the jr_id -jrn.php * -jrn.php * parm : -jrn.php * - connection -jrn.php * - p_jr_id (jrn.jr_id) -jrn.php * gen : -jrn.php * - none -jrn.php * return: -jrn.php * - return array -jrn.php * -jrn.php */ -************************* File = poste.php **************** -poste.php /* function GetPosteLibelle -poste.php * Purpose : Return the label of a poste -poste.php * -poste.php * parm : -poste.php * - p_dossier -poste.php * - p_id tmp_pcmn (pcm_val) -poste.php * - is_cn conneciton -poste.php * gen : -poste.php * - none -poste.php * return: -poste.php * - string -poste.php * -poste.php */ -poste.php /* function GetNumberLine -poste.php * Purpose : Max of ligne definie dans le journal -poste.php * -poste.php * parm : -poste.php * - p_dossier -poste.php * - p_jrn -poste.php * gen : -poste.php * - none -poste.php * return: -poste.php * - -poste.php * -poste.php */ -poste.php /* function PosteForm -poste.php * Purpose : Cree un form pour prendre les postes -poste.php * -poste.php * parm : -poste.php * - connection -poste.php * gen : -poste.php * - noen -poste.php * return: -poste.php * - morceau de code d'html qui contient un multiselect -poste.php * pour les postes -poste.php * -poste.php */ -poste.php /* function GetSolde -poste.php * Purpose : Cree un form pour prendre les postes -poste.php * -poste.php * parm : -poste.php * - connection -poste.php * gen : -poste.php * - noen -poste.php * return: -poste.php * - morceau de code d'html qui contient un multiselect -poste.php * pour les postes -poste.php * -poste.php */ -************************* File = postgres.php **************** -postgres.php /* function DbConnect -postgres.php * purpose : connect to the database -postgres.php * parameter : p_db : db_name -postgres.php * return the connection -postgres.php * todo : replace hardcoded by variable placed in -postgres.php * constant.php -postgres.php */ -postgres.php /* function ExecSql -postgres.php * purpose : send a sql string to the database -postgres.php * parameter p_connection db connection -postgres.php * p_string sql string -postgres.php * return false if error otherwise true -postgres.php */ -postgres.php /* function SyncRight -postgres.php * Purpose : Synchronize les droits par défaut -postgres.php * avec les journaux existants -postgres.php * parm : -postgres.php * - -postgres.php * gen : -postgres.php * - -postgres.php * return: -postgres.php * - -postgres.php * -postgres.php */ -postgres.php /* function GetUserProperty -postgres.php * Purpose : Get the properties of an user -postgres.php * it means theme, profile, admin... -postgres.php * -postgres.php * parm : -postgres.php * - $p_user user login -postgres.php * - $p_cn connection resource -postgres.php * - -postgres.php * gen : -postgres.php * - -postgres.php * return: an array -postgres.php * containing use_admin -postgres.php * use_usertype -postgres.php * use_theme -postgres.php * use_name -postgres.php * use_login -postgres.php */ -postgres.php /* function GetModeleId -postgres.php * Purpose : Give the mod_id from modeledef -postgres.php * -postgres.php * parm : -postgres.php * - p_cn database connection (repository) -postgres.php * - p_modname template name -postgres.php * gen : -postgres.php * - none -postgres.php * return: -postgres.php * template id or 0 if not found -postgres.php */ -************************* File = preference.php **************** -preference.php /* function FormPeriodeMult -preference.php * Purpose : -preference.php * Generate the form for the periode -preference.php * -preference.php * parm : -preference.php * - $p_cn connexion -preference.php * gen : -preference.php * - none -preference.php * return: -preference.php * - string containing html code for the -preference.php * form -preference.php * -preference.php */ -preference.php /* function FormPeriode -preference.php * Purpose : -preference.php * Generate the form for the periode -preference.php * -preference.php * parm : -preference.php * - $p_cn connexion -preference.php * - $p_default default periode -preference.php * - $p_type the type of the periode -preference.php * - $p_suff the suffix of the name -preference.php * gen : -preference.php * - none -preference.php * return: -preference.php * - string containing html code for the -preference.php * form -preference.php * -preference.php */ -preference.php /* function SetUserPeriode -preference.php * Purpose : Set the selected periode in the user's preferences -preference.php * -preference.php * parm : -preference.php * - $p_cn connexion -preference.php * - $p_periode -preference.php * - $p_user -preference.php * gen : -preference.php * - none -preference.php * return: -preference.php * - none -preference.php * -preference.php */ -preference.php /* function GetUserPeriode -preference.php * Purpose : Get the default periode from the user's preferences -preference.php * -preference.php * parm : -preference.php * - $p_cn connexion -preference.php * - $p_user -preference.php * gen : -preference.php * - none -preference.php * return: -preference.php * - the default periode -preference.php * -preference.php */ -preference.php /* function SetUserPreferences -preference.php * Purpose : Get the default user's preferences -preference.php * -preference.php * parm : -preference.php * - $p_cn connexion -preference.php * - $p_user -preference.php * gen : -preference.php * - none -preference.php * return: -preference.php * - none -preference.php * -preference.php */ -preference.php /* function GetPeriode -preference.php * Purpose :Give the start & end date of a periode -preference.php * -preference.php * parm : -preference.php * - connection -preference.php * - p_periode -preference.php * gen : -preference.php * - none -preference.php * return: -preference.php * - array containing the start date & the end date -preference.php * -preference.php */ -preference.php /* function PeriodeClosed($p_cn,$p_periode) -preference.php * Purpose : -preference.php * -preference.php * parm : -preference.php * - -preference.php * gen : -preference.php * - -preference.php * return: -preference.php * - true if closed -preference.php * -preference.php */ -preference.php /* function GetExercice -preference.php * Purpose : -preference.php * -preference.php * parm : -preference.php * - $p_cn connection -preference.php * - $p_periode periode -preference.php * gen : -preference.php * - -preference.php * return: -preference.php * - Exercice of the periode -preference.php * -preference.php */ -preference.php /* function ShowDevise -preference.php * Purpose : -preference.php * -preference.php * parm : -preference.php * - -preference.php * gen : -preference.php * - -preference.php * return: -preference.php * - -preference.php * -preference.php */ -preference.php /* function ShowPeriode -preference.php * Purpose : -preference.php * -preference.php * parm : -preference.php * - -preference.php * gen : -preference.php * - -preference.php * return: -preference.php * - -preference.php * -preference.php */ -************************* File = stock_inc.php **************** -stock_inc.php /* function ViewStock ($p_cn) -stock_inc.php ************************************************** -stock_inc.php * Purpose : show the listing of all goods -stock_inc.php * -stock_inc.php * parm : -stock_inc.php * - database connection -stock_inc.php * gen : -stock_inc.php * - -stock_inc.php * return: string containing the table -stock_inc.php */ -stock_inc.php /* function getFicheNameCode ($p_cn,$p_sg_code) -stock_inc.php ************************************************************ -stock_inc.php * Purpose : return an array of f_id and f_name -stock_inc.php * -stock_inc.php * parm : -stock_inc.php * - p_cn database connection -stock_inc.php * - stock_goods.sg_code -stock_inc.php * gen : -stock_inc.php * - none -stock_inc.php * return: -stock_inc.php * - array (f_id, f_label) or null if nothing is found -stock_inc.php */ -stock_inc.php /* function ViewDetailStock($cn,$sg_code,$year) -stock_inc.php ************************************************** -stock_inc.php * Purpose : -stock_inc.php * -stock_inc.php * parm : -stock_inc.php * - cn database connection -stock_inc.php * - sg_code -stock_inc.php * - year -stock_inc.php * gen : -stock_inc.php * - -stock_inc.php * return: HTML code -stock_inc.php */ -stock_inc.php /* function ChangeStock($cn,$sg_code,$sg_date) -stock_inc.php ************************************************** -stock_inc.php * Purpose : -stock_inc.php * -stock_inc.php * parm : -stock_inc.php * - -stock_inc.php * gen : -stock_inc.php * - -stock_inc.php * return: -stock_inc.php */ -************************* File = top_menu_compta.php **************** -top_menu_compta.php /* function ShowMenu -top_menu_compta.php * Purpose : Show The login menu -top_menu_compta.php * -top_menu_compta.php * parm : -top_menu_compta.php * - $p_admin 1 if admin -top_menu_compta.php * - $p_item item to add -top_menu_compta.php * gen : -top_menu_compta.php * - none -top_menu_compta.php * return: -top_menu_compta.php * - nothing -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function ShowMenuCompta -top_menu_compta.php * Purpose : Montre le menu du haut -top_menu_compta.php * -top_menu_compta.php * parm : -top_menu_compta.php * - dossier -top_menu_compta.php * - $p_user array ($g_UserProperty) -top_menu_compta.php * gen : -top_menu_compta.php * - none -top_menu_compta.php * return: -top_menu_compta.php * - none -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function -top_menu_compta.php * Purpose : -top_menu_compta.php * -top_menu_compta.php * parm : -top_menu_compta.php * - -top_menu_compta.php * gen : -top_menu_compta.php * - -top_menu_compta.php * return: -top_menu_compta.php * - -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function ShowMenuComptaRight -top_menu_compta.php * Purpose : Display menu on the Right -top_menu_compta.php * (preference, logout and admin) -top_menu_compta.php * parm : -top_menu_compta.php * - $p_dossier the current dossier -top_menu_compta.php * - $p_auser array $g_UserProperty -top_menu_compta.php * - $p_more code -top_menu_compta.php * gen : -top_menu_compta.php * - none -top_menu_compta.php * return: -top_menu_compta.php * - none -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function ShowMenuAdminGlobalRight($p_dossier=0) -top_menu_compta.php * Purpose : -top_menu_compta.php * Same as previous : show the right menu -top_menu_compta.php * parm : -top_menu_compta.php * - p_dossier -top_menu_compta.php * gen : -top_menu_compta.php * - none -top_menu_compta.php * return: -top_menu_compta.php * - none -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function ShowMenuPcmn($p_start=1) -top_menu_compta.php * Purpose : Show the menu from the pcmn page -top_menu_compta.php * -top_menu_compta.php * parm : -top_menu_compta.php * - $p_start class start -top_menu_compta.php * gen : -top_menu_compta.php * - none -top_menu_compta.php * return: -top_menu_compta.php * - none -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function ShowMenuJrn($p_dossier) -top_menu_compta.php * Purpose : Show the menu in the jrn page -top_menu_compta.php * -top_menu_compta.php * parm : -top_menu_compta.php * - $p_dossier -top_menu_compta.php * gen : -top_menu_compta.php * - none -top_menu_compta.php * return: -top_menu_compta.php * - none -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function ShowMenuJrnUser($p_dossier,$p_user) -top_menu_compta.php * Purpose : Display and Show the Menu from the jrn encode -top_menu_compta.php * page following the use_usertype (compta,user,...) -top_menu_compta.php * -top_menu_compta.php * parm : -top_menu_compta.php * - $p_dossier -top_menu_compta.php * - $p_auser -top_menu_compta.php * - $p_type (ACH, BQE, VEN) -top_menu_compta.php * - $p_jrn what journal -top_menu_compta.php * gen : -top_menu_compta.php * - none -top_menu_compta.php * return: -top_menu_compta.php * - none -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function ShowMenuRecherche -top_menu_compta.php * Purpose : -top_menu_compta.php * -top_menu_compta.php * parm : -top_menu_compta.php * - $p_dossier, -top_menu_compta.php * - $p_jrn jrn id -top_menu_compta.php * - $p_array=null previous search -top_menu_compta.php * gen : -top_menu_compta.php * - none -top_menu_compta.php * return: -top_menu_compta.php * - none -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function -top_menu_compta.php * Purpose : -top_menu_compta.php * -top_menu_compta.php * parm : -top_menu_compta.php * - -top_menu_compta.php * gen : -top_menu_compta.php * - -top_menu_compta.php * return: -top_menu_compta.php * - -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function ShowMenuJrnUserImp( -top_menu_compta.php * -top_menu_compta.php * -top_menu_compta.php * Purpose : Show the menu of jrn to print -top_menu_compta.php * -top_menu_compta.php * parm : -top_menu_compta.php * - $p_cn, connection -top_menu_compta.php * $p_user, user -top_menu_compta.php * $p_dossier dossier -top_menu_compta.php * gen : -top_menu_compta.php * - none -top_menu_compta.php * return: -top_menu_compta.php * - none -top_menu_compta.php * -top_menu_compta.php */ -top_menu_compta.php /* function ShowMenuAdminGlobal */ -************************* File = user_action_ach.php **************** -************************* File = user_action_fin.php **************** -************************* File = user_action_ods.php **************** -************************* File = user_action_ven.php **************** -************************* File = user_common.php **************** -user_common.php /* function GetTvaRate -user_common.php ************************************************** -user_common.php * Purpose : Return the rate of the p_tva_id -user_common.php * -user_common.php * parm : -user_common.php * - p_cn database connection -user_common.php * - p_tva_id tva.tva_id -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * an array containing the rate and the label -user_common.php * the tva rate or null if a problem occured -user_common.php */ -user_common.php /* function ComputeVat($p_cn,$a_fiche,$a_quant,$a_price,$ap_vat) -user_common.php ************************************************** -user_common.php * Purpose : Compute the vat, -user_common.php * the fiche.f_id are in a_fiche -user_common.php * the quantity in a_quant -user_common.php * -user_common.php * -user_common.php * parm : -user_common.php * - database connection -user_common.php * - fiche id array -user_common.php * - quantity array -user_common.php * - price array -user_common.php * - $ap_vat Array of tva id -user_common.php * gen : -user_common.php * - -user_common.php * return: array -user_common.php * a[tva_id] = amount vat -user_common.php */ -user_common.php /* function GetTvaPoste($p_cn,$tva_id,$p_type); -user_common.php ************************************************** -user_common.php * Purpose : Get the account of tva_rate.tva_poste -user_common.php * return the credit or the debit account -user_common.php * parm : connection -user_common.php * - tva_rate.tva_id -user_common.php * type ( d or credit) -user_common.php * gen : -user_common.php * - -user_common.php * return: -user_common.php * return the credit or the debit account -user_common.php * null if error -user_common.php */ -user_common.php /* function InsertJrnx($p_cn,$p_type,$p_user,$p_jrn,$p_poste,$p_date,$p_amount,$p_grpt,$p_periode -user_common.php ************************************************** -user_common.php * Purpose : Insert into the table Jrn -user_common.php * -user_common.php * parm : -user_common.php * - $p_cn database connection -user_common.php * - $p_type debit or credit -user_common.php * - $p_user the current user -user_common.php * - $p_jrn the current 'journal' (folder) -user_common.php * - $p_poste the account -user_common.php * - $p_date -user_common.php * - $p_amount amount to insert -user_common.php * - $p_periode the concerned periode -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * - nothing -user_common.php */ -user_common.php /* function InsertJrn($p_cn,$p_date,$p_jrn,$p_comment,$p_amount,$p_grpt,$p_periode -user_common.php ************************************************** -user_common.php * Purpose : Insert into the table Jrnx -user_common.php * -user_common.php * parm : -user_common.php * - $p_cn database connection -user_common.php * - $p_date date -user_common.php * - $p_jrn the current 'journal' (folder) -user_common.php * - $p_poste the account -user_common.php * - $p_amount amount to insert -user_common.php * - $p_periode the concerned periode -user_common.php * - $p_comment comment -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * - nothing -user_common.php */ -user_common.php /* function ListJrn($p_cn,$p_jrn,$p_wherel) -user_common.php ************************************************** -user_common.php * Purpose : show all the lines of the asked jrn -user_common.php * -user_common.php * parm : -user_common.php * - $p_cn database connection -user_common.php * - $p_jrn jrn_id jrn.jrn_def_id -user_common.php * - $p_sql the sql query (where clause) -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * -user_common.php */ -user_common.php /* function InsertStockGoods($p_cn,$j_id,$a_good[$i],$a_quant[$i],'c'); -user_common.php ************************************************** -user_common.php * Purpose : Insert data into stock_goods, -user_common.php * -user_common.php * parm : -user_common.php * - $p_cn database connection -user_common.php * - $p_j_id the j_id -user_common.php * - $p_goods the goods -user_common.php * - $p_quant quantity -user_common.php * - $p_type c for credit or d for debit -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * none -user_common.php */ -user_common.php /* function withStock($p_cn,$p_f_id) -user_common.php ************************************************** -user_common.php * Purpose : return true if we manage stock for it -user_common.php * value is stored in attr_value -user_common.php * -user_common.php * parm : -user_common.php * - $p_cn database connection -user_common.php * - $p_f_id fiche.f_id -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * none -user_common.php */ -user_common.php /* function VerifyDate ($p_cn,$p_user,$p_date) -user_common.php ************************************************** -user_common.php * Purpose : Verify if -user_common.php * the date is a valid date -user_common.php * the date is in the default period -user_common.php * the period is not closed -user_common.php * -user_common.php * parm : -user_common.php * - db connection -user_common.php * - user -user_common.php * - date -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * - null if error or date if ok -user_common.php */ -user_common.php /* function InsertRapt($p_cn,$jr_id,$jr_id2) -user_common.php ************************************************** -user_common.php * Purpose : Insert into jrn_rapt the concerned operations -user_common.php * -user_common.php * parm : -user_common.php * - p_cn database connection -user_common.php * - jr_id (jrn.jr_id) => jrn_rapt.jr_id -user_common.php * - jr_id2 (jrn.jr_id) => jrn_rapt.jra_concerned -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * - none -user_common.php */ -user_common.php /* function DeleteRapt($p_cn,$jr_id,$jr_id2) -user_common.php ************************************************** -user_common.php * Purpose : Insert into jrn_rapt the concerned operations -user_common.php * -user_common.php * parm : -user_common.php * - p_cn database connection -user_common.php * - jr_id (jrn.jr_id) => jrn_rapt.jr_id -user_common.php * - jr_id2 (jrn.jr_id) => jrn_rapt.jra_concerned -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * - none -user_common.php */ -user_common.php /* function GetConcerned (p_cn ,jr_id) -user_common.php ************************************************** -user_common.php * Purpose : Return an array of the concerned operation -user_common.php * -user_common.php * parm : -user_common.php * - database connection -user_common.php * - jrn.jr_id -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * - array if something is found -user_common.php */ -user_common.php /* function GetGrpt($p_cn,$p_jr_id) -user_common.php ************************************************** -user_common.php * Purpose : Return the jr_grpt_id from jrn where -user_common.php * jr_id = $p_jr_id -user_common.php * -user_common.php * parm : -user_common.php * - $p_jr_id jrn.jr_id -user_common.php * - $p_cn database connection -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * - return the jrn.jr_grpt_id or null -user_common.php */ -user_common.php /* function UpdateComment ($p_cn,$p_jr_id,$p_comment) -user_common.php ************************************************** -user_common.php * Purpose : Update comment in jrn -user_common.php * -user_common.php * parm : -user_common.php * - database conn. -user_common.php * - jrn.jr_id -user_common.php * - comment -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * - none -user_common.php */ -user_common.php /* function isValid ($p_cn, $p_grpt_id -user_common.php ************************************************** -user_common.php * Purpose : test if a jrn op is valid -user_common.php * -user_common.php * parm : -user_common.php * - db connection -user_common.php * - p_grpt_id -user_common.php * gen : -user_common.php * - none -user_common.php * return: -user_common.php * 1 is valid -user_common.php * 0 is not valid -user_common.php */ -************************* File = user_menu.php **************** -user_menu.php /* function u_ShowDossier -user_menu.php * Purpose : Show all the available folder -user_menu.php * for the users -user_menu.php * parm : -user_menu.php * - $p_user user login -user_menu.php * - $p_admin 1 if admin -user_menu.php * gen : -user_menu.php * - none -user_menu.php * return: -user_menu.php * - nothing -user_menu.php * -user_menu.php */ -user_menu.php /* function u_ShowDossier -user_menu.php * Purpose : Get all the available folders -user_menu.php * for the users -user_menu.php * parm : -user_menu.php * - $p_user user login -user_menu.php * - $p_admin 1 if admin -user_menu.php * gen : -user_menu.php * - none -user_menu.php * return: -user_menu.php * - array containing ac_dossier.dos_id -user_menu.php * ac_dossier.dos_name -user_menu.php * ac_dossier.dos_description -user_menu.php * -user_menu.php */ -user_menu.php /* function u_ShowMenu -user_menu.php * Purpose : Show The login menu -user_menu.php * -user_menu.php * parm : -user_menu.php * - $p_admin 1 if admin -user_menu.php * - $p_item item to add -user_menu.php * gen : -user_menu.php * - none -user_menu.php * return: -user_menu.php * - nothing -user_menu.php * -user_menu.php */ -user_menu.php /* function u_ShowMenuCompta -user_menu.php * purpose : show the top menu for -user_menu.php * the user profile -user_menu.php * parm : p_dossier -user_menu.php * -user_menu.php * return: none -user_menu.php * -user_menu.php * gen : none -user_menu.php */ -user_menu.php /* function ShowMenuComptaRight -user_menu.php * Purpose : Display menu on the Right -user_menu.php * (preference, logout and admin) -user_menu.php * parm : -user_menu.php * - $p_dossier the current dossier -user_menu.php * - $p_admin $g_UserProperty['use_admin'] 1 if admin -user_menu.php * - $p_more code -user_menu.php * gen : -user_menu.php * - none -user_menu.php * return: -user_menu.php * - string containing the html menu -user_menu.php * -user_menu.php */ -user_menu.php /* function u_ShowMenuJrnUser($p_dossier,$p_user) -user_menu.php * Purpose : Show the Menu from the jrn encode -user_menu.php * page -user_menu.php * -user_menu.php * parm : -user_menu.php * - $p_dossier -user_menu.php * - $p_user -user_menu.php * - $p_type type of journal (VEN,ACH,BQE,ODS) -user_menu.php * - $p_jrn journal -user_menu.php * gen : -user_menu.php * - none -user_menu.php * return: -user_menu.php * - none -user_menu.php * -user_menu.php */ -user_menu.php /* function u_ShowMenuJrn -user_menu.php * Purpose : Show the menu of the jrn depending of its type -user_menu.php * -user_menu.php * parm : -user_menu.php * - p_cn database connection -user_menu.php * - p_dossier -user_menu.php * - p_UserProperty -user_menu.php * - p_jrn_type -user_menu.php * - p_jrn -user_menu.php * gen : -user_menu.php * - none -user_menu.php * return: -user_menu.php * - string containing the menu -user_menu.php */ -user_menu.php /* function u_ShowMenuRecherche ($p_cn,$p_jrn,$p_sessid,$p_array=null) -user_menu.php * Purpose : -user_menu.php * -user_menu.php * parm : -user_menu.php * - $p_cn database connection -user_menu.php * - $p_jrn jrn id -user_menu.php * - $p_array=null previous search -user_menu.php * gen : -user_menu.php * - none -user_menu.php * return: -user_menu.php * - none -user_menu.php * -user_menu.php */ -user_menu.php /* function function ShowMenuAdvanced() { -user_menu.php ************************************************** -user_menu.php * Purpose : build the menu of user_advanced.php -user_menu.php * -user_menu.php * parm : -user_menu.php * - none -user_menu.php * gen : -user_menu.php * - none -user_menu.php * return: the menu -user_menu.php */ -************************* File = user_update.php **************** ************************* File = admin_dossier.php **************** ************************* File = admin_repo.php **************** ************************* File = advanced.php **************** @@ -2178,6 +47,7 @@ user_menu.php */ ************************* File = test.php **************** ************************* File = user_advanced.php **************** ************************* File = user_compta.php **************** +************************* File = user_impress.php **************** ************************* File = user_jrn.php **************** ************************* File = user_login.php **************** ************************* File = user_pref.php **************** @@ -3203,6 +1073,7 @@ form_input.php * - none form_input.php * return: form_input.php * true on success form_input.php */ +************************* File = impress_form.php **************** ************************* File = impress_inc.php **************** impress_inc.php /* function ViewImp impress_inc.php * Purpose : Create the form where the period @@ -3335,6 +1206,8 @@ impress_inc.php * return: impress_inc.php * - array impress_inc.php * impress_inc.php */ +************************* File = impress_jrn.php **************** +************************* File = impress_poste.php **************** ************************* File = jrn.php **************** jrn.php /* function RecordJrn jrn.php * Purpose : Record an entry in the selected journal @@ -3716,6 +1589,12 @@ postgres.php * - none postgres.php * return: postgres.php * template id or 0 if not found postgres.php */ +postgres.php /* function GetArray +postgres.php * purpose return the result of a sql statment +postgres.php * in a array +postgres.php * param : $p_cn database connection +postgres.php * $p_sql sql query +postgres.php */ ************************* File = preference.php **************** preference.php /* function FormPeriodeMult preference.php * Purpose : @@ -4254,7 +2133,7 @@ user_menu.php * return: user_menu.php * - nothing user_menu.php * user_menu.php */ -user_menu.php /* function u_ShowDossier +user_menu.php /* function GetAvailableFolder user_menu.php * Purpose : Get all the available folders user_menu.php * for the users user_menu.php * parm : @@ -4354,6 +2233,16 @@ user_menu.php * gen : user_menu.php * - none user_menu.php * return: the menu user_menu.php */ +user_menu.php /* function ShowJrn +user_menu.php ************************************************** +user_menu.php * Purpose : Return a string containing the menu +user_menu.php * main menu when you click on Journaux +user_menu.php * parm : +user_menu.php * - $p_menu the current menu (selected) +user_menu.php * gen : +user_menu.php * - none +user_menu.php * return: a string +user_menu.php */ ************************* File = user_update.php **************** ************************* File = viewjrn.php **************** viewjrn.php /* function ViewJrn diff --git a/html/jrn_csv.php b/html/jrn_csv.php new file mode 100644 index 000000000..8711160bb --- /dev/null +++ b/html/jrn_csv.php @@ -0,0 +1,81 @@ +Check(); +if ( $g_UserProperty['use_admin'] == 0 ) { + if (CheckAction($g_dossier,$g_user,IMP) == 0 ){ + /* Cannot Access */ + NoAccess(); + } +} + + + $p_cent=( isset ( $_POST['cent']) )?'on':'off'; + +$Jrn=new jrn($cn,$_POST['jrn_id']); +$Jrn->GetName(); +$Jrn->GetRow( $_POST['from_periode'], + $_POST['to_periode'], + $p_cent); + + + foreach ( $Jrn->row as $op ) { + $rep=""; + + if ( $op['j_id'] != $rep) { + $rep= $op['j_id']; + // should clean description : remove tag and '; char + // should clean poste : remove tag and '; char + + echo + "'".$op['internal']."';". + "'".$op['j_date']."';". + "'".$op['poste']."';". + "'".$op['description']."';". + "'".$op['cred_montant']."';". + "'".$op['deb_montant']."\n"; + + } else { + echo + "'".$op['internal']."';". + "'".$op['j_date']."';". + "'".$op['poste']."';". + "'".$op['description']."';". + "'".$op['cred_montant']."';". + "'".$op['deb_montant']."\n"; + + } + + } + exit; +?> diff --git a/html/jrn_pdf.php b/html/jrn_pdf.php new file mode 100644 index 000000000..1ad5bb752 --- /dev/null +++ b/html/jrn_pdf.php @@ -0,0 +1,153 @@ +GetName(); +$ret=""; +$pdf=& new Cezpdf("A4"); +$pdf->selectFont('./addon/fonts/Helvetica.afm'); + +// filter : 0 for Grand Livre otherwise 1 +$filter=( $Jrn->id == 0)?0:1; + +$offset=0;$limit=25;$step=25; +$rap_deb=0;$rap_cred=0; +while (1) { + $a=0; + list ($a_jrn,$tot_deb,$tot_cred)=$Jrn->GetRow($_POST['from_periode'], + $_POST['to_periode'], + $_POST['central'], + $limit,$offset); + echo_debug(__FILE__,__LINE__,"Total debit $tot_deb,credit $tot_cred"); + + if ( $a_jrn==null) break; + $offset+=$step; +// foreach ($a_jrn as $key=>$element) { +// echo_debug(__FILE__,__LINE__,"$key => $element"); +// foreach ($element as $c1=>$c2) +// echo_debug(__FILE__,__LINE__,"Array is $c1 => $c2"); +// } + $first_id=$a_jrn[0]['j_id']; + $Exercice=GetExercice($cn,$a_jrn[0]['periode']); + + + list($rap_deb,$rap_cred)=GetRappel($cn,$first_id,$Jrn->id,$Exercice,FIRST, + $filter, + $l_centr + ); + echo_debug(__FILE__,__LINE__,"MONTANT $rap_deb,$rap_cred"); + echo_debug(__FILE__,__LINE__," list($rap_deb,$rap_cred)=GetRappel($cn,$first_id,".$Jrn->id.",$Exercice,FIRST)"); + $pdf->ezText($Jrn->name,30); + + if ( $l_centr == 1 ) { + // si centralisé montre les montants de rappel + $str_debit=sprintf( "report Débit % 10.2f",$rap_deb); + $str_credit=sprintf("report Crédit % 10.2f",$rap_cred); + $pdf->ezText($str_debit,12,array('justification'=>'right')); + $pdf->ezText($str_credit,12,array('justification'=>'right')); + } + + $pdf->ezTable($a_jrn, + array ('internal'=>'Opération', + 'j_date' => 'Date', + 'poste'=>'Poste', + 'description' => 'Description', + 'deb_montant'=> 'Débit', + 'cred_montant'=>'Crédit')," ", + array('shaded'=>0,'showHeadings'=>1,'width'=>500, + 'cols'=>array('deb_montant'=> array('justification'=>'right'), + 'cred_montant'=> array('justification'=>'right')))); + $a=1; + // Total Page + $apage=array(array('deb'=>sprintf("%8.2f",$tot_deb),'cred'=>$tot_cred)); + foreach ($apage as $key=>$element) echo_debug(__FILE__,__LINE__,"apage $key => $element"); + $pdf->ezTable($apage, + array ( + 'deb'=> 'Total Débit', + 'cred'=>'Total Crédit')," ", + array('shaded'=>0,'showHeadings'=>1,'width'=>200, + 'xPos'=>'right','xOrientation'=>'left', + 'cols'=>array('deb'=> array('justification'=>'right'), + 'cred'=> array('justification'=>'right')))); + + $count=count($a_jrn)-1; + $last_id=$a_jrn[$count]['j_id']; + $Exercice=GetExercice($cn,$a_jrn[$count]['periode']); + if ( $l_centr == 1) { + // Montant de rappel si centralisé + list($rap_deb,$rap_cred)=GetRappel($cn,$last_id,$Jrn->id,$Exercice,LAST,$filter,$l_centr); + $str_debit=sprintf( "à reporter Débit % 10.2f",$rap_deb); + $str_credit=sprintf("à reporter Crédit % 10.2f",$rap_cred); + $pdf->ezText($str_debit,12,array('justification'=>'right')); + $pdf->ezText($str_credit,12,array('justification'=>'right')); + } + //New page + $pdf->ezNewPage(); +} +if ( $a == 1 ) { + $apage=array('deb'=>$tot_deb,'cred'=>$tot_cred); +$pdf->ezTable($apage, + array ( + 'deb'=> 'Total Débit', + 'cred'=>'Total Crédit')," ", + array('shaded'=>0,'showHeadings'=>1,'width'=>500, + 'cols'=>array('deb'=> array('justification'=>'right'), + 'cred'=> array('justification'=>'right')))); + $count=count($a_jrn)-1; + $last_id=$a_jrn[$count]['j_id']; + $Exercice=GetExercice($cn,$a_jrn[$count]['periode']); + + list($rap_deb,$rap_cred)=GetRappel($cn,$last_id,$Jrn->id,$Exercice,LAST,$filter,$l_centr); + $str_debit=sprintf( "à reporter Débit % 10.2f",$rap_deb); + $str_credit=sprintf("à reporter Crédit % 10.2f",$rap_cred); + $pdf->ezText($str_debit,12,array('justification'=>'right')); + $pdf->ezText($str_credit,12,array('justification'=>'right')); + +} +$pdf->ezStream(); + +?> diff --git a/html/user_impress.php b/html/user_impress.php index 3e5df20cd..dfa29251c 100644 --- a/html/user_impress.php +++ b/html/user_impress.php @@ -26,7 +26,14 @@ if ( ! isset ( $g_dossier ) ) { } include_once ("postgres.php"); /* Admin. Dossier */ -CheckUser(); +$l_Db=sprintf("dossier%d",$g_dossier); +$cn=DbConnect($l_Db); + + +include ('class_user.php'); +$User=new cl_user($cn); +$User->Check(); + include ("check_priv.php"); include_once ("top_menu_compta.php"); ShowMenuCompta($g_dossier,$g_UserProperty); @@ -38,6 +45,7 @@ echo "
"; $p_array=array(array ("user_impress.php?type=jrn","Journaux"), array("user_impress.php?type=poste","Poste"), + array("user_impress.php?type=fiche","Fiche"), array("user_impress.php?type=form","Formulaire") ); $default=( isset ($_GET['type']))?"user_impress.php?type=".$_GET['type']:""; @@ -56,8 +64,6 @@ if ( $g_UserProperty['use_admin'] == 0 ) { } } -$l_Db=sprintf("dossier%d",$g_dossier); -$cn=DbConnect($l_Db); // something is choosen $default=( isset ($_GET['type']))?$_GET['type']:""; switch ($default) { diff --git a/html/user_jrn.php b/html/user_jrn.php index ea228eab9..a2fab3cf2 100644 --- a/html/user_jrn.php +++ b/html/user_jrn.php @@ -30,7 +30,8 @@ if ( ! isset ( $g_dossier ) ) { include_once ("postgres.php"); include_once ("check_priv.php"); /* Admin. Dossier */ -CheckUser(); + + if ( isset( $_GET['p_jrn'] )) { session_register("g_jrn"); $g_jrn=$_GET['p_jrn']; @@ -43,6 +44,9 @@ if ( isset ($_GET['JRN_TYPE'] ) ) { $l_Db=sprintf("dossier%d",$g_dossier); $cn=DbConnect($l_Db); +include ('class_user.php'); +$User=new cl_user($cn); +$User->Check(); ShowMenuCompta($g_dossier,$g_UserProperty); @@ -99,13 +103,6 @@ if ( isset ($_GET['JRN_TYPE'] ) ) { // if a journal is selected show the journal's menu if ( $g_jrn != -1 ) { -// $p_array=array(array("user_jrn.php?JRN_TYPE=VEN" ,"Entrée"), -// array("user_jrn.php?JRN_TYPE=ACH","Dépense"), -// array("user_jrn.php?JRN_TYPE=FIN","Financier"), -// array("user_jrn.php?JRN_TYPE=OD","Op. Diverses"), -// array("impress.php","Impression"), -// array("","Recherche") -// ); $result=ShowJrn( "user_jrn.php?JRN_TYPE=".$jrn_type); // Get the jrn_type_id include_once('jrn.php'); diff --git a/include/ac_common.php b/include/ac_common.php index 25dacc811..a55f2b4f1 100644 --- a/include/ac_common.php +++ b/include/ac_common.php @@ -318,5 +318,38 @@ function echo_warning($p_string) { echo '

'.$p_string."

"; } +/* function make_array($cn,$sql) + ************************************************** + * Purpose : make a array with the sql + * + * parm : + * - $cn dbatabase connection + * - $sql related sql + * gen : + * - none + * return: a double array [value,label] + */ +function make_array($p_cn,$p_sql,$p_null=0) { + + $a=pg_exec($p_cn,$p_sql); + $max=pg_NumRows($a); + if ( $max==0) return null; + for ($i=0;$i<$max;$i++) { + $row=pg_fetch_row($a); + $r[$i]['value']=$row[0]; + $r[$i]['label']=$row[1]; + } + // add a blank item ? + if ( $p_null == 1 ) { + for ($i=$max;$i!=0;$i--) { + $r[$i]['value']= $r[$i-1]['value']; + $r[$i]['label']= $r[$i-1]['label']; + } + $r[0]['value']=-1; + $r[0]['label']=" "; + } // if ( $p_null == 1 ) + + return $r; +} ?> diff --git a/include/class_jrn.php b/include/class_jrn.php new file mode 100644 index 000000000..309fc4088 --- /dev/null +++ b/include/class_jrn.php @@ -0,0 +1,217 @@ +id=$p_id; + $this->db=$p_cn; + $this->row=null; + } + function GetName() { + if ( $this->id==0 ) { + $this->name=" Grand Livre "; + return $this->name; + } + + $Res=ExecSql($this->db,"select jrn_def_name from ". + " jrn_def where jrn_def_id=". + $this->id); + $Max=pg_NumRows($Res); + if ($Max==0) return null; + $ret=pg_fetch_array($Res,0); + $this->name=$ret['jrn_def_name']; + return $ret['jrn_def_name']; + } + +/* function GetDataJrnPdf + * Purpose : Get The data for the pdf printing + * + * parm : + * - connection + * - array + * - p_limit starting line + * - p_offset number of lines + * + * gen : + * - none + * return: + * - Array with the asked data + * + */ + function GetRow($p_from,$p_to,$cent='off',$p_limit=-1,$p_offset=-1) { + + echo_debug(__FILE__,__LINE__,"GetRow"); + + if ( $p_from == $p_to ) + $periode=" jr_tech_per = $p_from "; + else + $periode = "(jr_tech_per >= $p_from and jr_tech_per <= $p_to) "; + $cond_limite=($p_limit!=-1)?" limit ".$p_limit." offset ".$p_offset:""; + + // Grand livre == 0 + if ( $this->id != 0 ) { + + if ( $cent='off' ) { + // Journaux non centralisés + $Res=ExecSql($this->db,"select j_id,to_char(j_date,'DD.MM.YYYY') as j_date, + jr_internal, + case j_debit when 't' then j_montant::text else ' ' end as deb_montant, + case j_debit when 'f' then j_montant::text else ' ' end as cred_montant, + j_debit as debit,j_poste as poste,jr_montant , ". + "pcm_lib as description,j_grpt as grp,jr_comment , + jr_rapt as oc, j_tech_per as periode from jrnx left join jrn on ". + "jr_grpt_id=j_grpt ". + " left join tmp_pcmn on pcm_val=j_poste ". + " where j_jrn_def=".$this->id. + " and ".$periode." order by j_date::date asc,jr_internal,j_debit desc ". + $cond_limite); + }else { + // Journaux centralisés + + $Sql="select c_id as j_id, + c_j_id, + to_char (c_date,'DD.MM.YYYY') as j_date , + c_internal as jr_internal, + case c_debit when 't' then c_montant::text else ' ' end as deb_montant, + case c_debit when 'f' then c_montant::text else ' ' end as cred_montant, + c_debit as j_debit, + c_poste as poste, + pcm_lib as description, + jr_comment, + jr_montant, + c_grp as grp, + c_comment as comment, + c_rapt as oc, + c_periode as periode + from centralized left join jrn on ". + "jr_grpt_id=c_grp left join tmp_pcmn on pcm_val=c_poste where ". + " c_jrn_def=".$this->id." and ". + $periode." order by c_id "; + $Res=ExecSql($this->db,$Sql.$cond_limite); + + } + } else { + // Grand Livre + if ( $cent == 'off') { + // Non centralisé + $Res=ExecSql($this->db,"select j_id,to_char(j_date,'DD.MM.YYYY') as j_date, + jr_internal, + case j_debit when 't' then j_montant::text else ' ' end as deb_montant, + case j_debit when 'f' then j_montant::text else ' ' end as cred_montant, + j_debit as debit,j_poste as poste,". + "pcm_lib as description,j_grpt as grp,jr_comment as jr_comment, + jr_montant, + jr_rapt as oc, j_tech_per as periode from jrnx left join jrn on ". + "jr_grpt_id=j_grpt left join tmp_pcmn on pcm_val=j_poste where ". + " ".$periode." order by j_date::date,j_grpt,j_debit desc ". + $cond_limite); + + } else { + // Centralisé + $Sql="select c_id as j_id, + c_j_id, + to_char (c_date,'DD.MM.YYYY') as j_date , + c_internal as jr_internal, + case c_debit when 't' then c_montant::text else ' ' end as deb_montant, + case c_debit when 'f' then c_montant::text else ' ' end as cred_montant, + c_debit as j_debit, + c_poste as poste, + pcm_lib as description, + jr_comment, + jr_montant, + c_grp as grp, + c_comment as comment, + c_rapt as oc, + c_periode as periode + from centralized left join jrn on ". + "jr_grpt_id=c_grp left join tmp_pcmn on pcm_val=c_poste where ". + $periode." order by c_id "; + $Res=ExecSql($this->db,$Sql.$cond_limite); + } // Grand Livre + } + + + $array=array(); + $Max=pg_NumRows($Res); + if ($Max==0) return null; + $case=""; + $tot_deb=0; + $tot_cred=0; + for ($i=0;$i<$Max;$i++) { + $line=pg_fetch_array($Res,$i); + $mont_deb=($line['deb_montant']!=0)?sprintf("% 8.2f",$line['deb_montant']):""; + $mont_cred=($line['cred_montant']!=0)?sprintf("% 8.2f",$line['cred_montant']):""; + $jr_montant=($line['jr_montant']!=0)?sprintf("% 8.2f",$line['jr_montant']):""; + $tot_deb+=$line['deb_montant']; + $tot_cred+=$line['cred_montant']; + echo_debug(__FILE__,__LINE__," GetRow : mont_Deb ".$mont_deb); + echo_debug(__FILE__,__LINE__," GetRow : mont_cred ".$mont_cred); + + if ( $case != $line['grp'] ) { + $case=$line['grp']; + $array[]=array ( + 'j_id'=>$line['j_id'], + 'j_date' => $line['j_date'], + 'internal'=>$line['jr_internal'], + 'deb_montant'=>'', + 'cred_montant'=>''.$jr_montant.'', + 'description'=>''.$line['jr_comment'].'', + 'poste' => $line['oc'], + 'periode' =>$line['periode'] ); + + $array[]=array ( + 'j_id'=>$line['j_id'], + 'j_date' => '', + 'internal'=>'', + 'deb_montant'=>$mont_deb, + 'cred_montant'=>$mont_cred, + 'description'=>$line['description'], + 'poste' => $line['poste'], + 'periode' => $line['periode'] + ); + + }else { + $array[]=array ( + 'j_id'=>$line['j_id'], + 'j_date' => '', + 'internal'=>'', + 'deb_montant'=>$mont_deb, + 'cred_montant'=>$mont_cred, + 'description'=>$line['description'], + 'poste' => $line['poste'], + 'periode' => $line['periode']); + + } + + + } + echo_debug(__FILE__,__LINE__,"Total debit $tot_deb,credit $tot_cred"); + $this->row=$array; + $a=array($array,$tot_deb,$tot_cred); + return $a; + } + + +} \ No newline at end of file diff --git a/include/class_operation.php b/include/class_operation.php new file mode 100644 index 000000000..3104f5c4d --- /dev/null +++ b/include/class_operation.php @@ -0,0 +1,117 @@ +GetName(); + $Jrn->GetRow( $_POST['from_periode'], + $_POST['to_periode'], + $p_cent); + foreach ($Jrn->row as $op) { + $a=new operation ($cn,$op); + $a->cent=$p_cent; + + + } + + } + +//////////////////////////////////////////////////////////////////////////////// +// Show the jrn and date +//////////////////////////////////////////////////////////////////////////////// +include_once('form_input.php'); +include_once("postgres.php"); +include_once("class_widget.php"); +if ( $User->Admin() ==0) { + $ret=make_array($cn,"select jrn_def_id,jrn_def_name + from jrn_def join jrn_type on jrn_def_type=jrn_type_id + join user_sec_jrn on uj_jrn_id=jrn_def_id + where + uj_login='$User->id' + and uj_priv !='X' + "); + } else { + $ret=make_array("select jrn_def_id,jrn_def_name + from jrn_def join jrn_type on jrn_def_type=jrn_type_id"); + + } + +// include_once("check_priv.php"); +// printf ('%s',$l_line['jrn_def_id'],$l_line['jrn_def_name']); + +// Count the forbidden journaux + $NoPriv=CountSql($cn,"select jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv, + jrn_deb_max_line,jrn_cred_max_line + from jrn_def join jrn_type on jrn_def_type=jrn_type_id + join user_sec_jrn on uj_jrn_id=jrn_def_id + where + uj_login='$User->id' + and uj_priv ='X' + "); + // Pour voir tout les journal ? + if ( $NoPriv == 0 ) { + $a=count($ret); + $all=array('value'=>0,'label'=>'All'); + $ret[$a]=$all; + } +if ( count($ret) < 1 ) + NoAccess(); +//////////////////////////////////////////////////////////////////////////////// +// Form +//////////////////////////////////////////////////////////////////////////////// +echo '
'; +echo '
'; +echo ''; +$w=new widget("select"); +$w->table=1; +$w->label="Choississez le journal"; +print $w->IOValue("jrn_id",$ret); +print ''; +print ''; +$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id"); +$w->label="Depuis"; +print $w->IOValue('from_periode',$periode_start); +$w->label=" jusqu'à "; +$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode order by p_id"); +print $w->IOValue('to_periode',$periode_end); +print ""; +$centralise=new widget("checkbox"); +$centralise->label="Depuis les journaux centralisés"; +$centralise->table=1; +print $centralise->IOValue('cent'); + +print ""; +echo '
'; +print $w->Submit('bt_html','Impression'); + +echo '
'; +echo '
'; +?> \ No newline at end of file diff --git a/include/class_user.php b/include/class_user.php new file mode 100644 index 000000000..4403733ea --- /dev/null +++ b/include/class_user.php @@ -0,0 +1,115 @@ +id=$_SESSION['g_user']; + $this->pass=$_SESSION['g_pass']; + $this->valid=(isset ($_SESSION['isValid']))?1:0; + $this->db=$p_cn; + } + /*++ + * function : CheckUser + * Parameter : none + * return : not use + * Description : + * Check if user is active and exists in the + * repository + * Automatically redirect + * + ++*/ + function Check() + { + + $res=0; + $pass5=md5($this->pass); + if ( $this->valid == 1 ) { return; } + $cn=DbConnect("account_repository"); + if ( $cn != false ) { + $sql="select ac_users.use_login,ac_users.use_active, ac_users.use_pass + from ac_users + where ac_users.use_login='$this->id' + and ac_users.use_active=1 + and ac_users.use_pass='$pass5'"; + echo_debug(__FILE__,__LINE__,"Sql = $sql"); + $ret=pg_exec($cn,$sql); + $res=pg_NumRows($ret); + echo_debug(__FILE__,__LINE__,"Number of found rows : $res"); + } + + if ( $res == 0 ) { + echo ''; + echo "





"; + echo "

+ + Invalid user
or
Invalid password +

"; + session_unset(); + + exit -1; + } else { + $this->valid=1; + } + + return $ret; + + } + + function getJrn() { + } +/* function CheckAdmin + ************************************************** + * Purpose : Check if an user is an admin + * + * parm : + * - none + * gen : + * - none + * return: 1 for yes 0 for no + */ + function Admin() { + $res=0; + + if ( $this->id != 'phpcompta') { + $pass5=md5($this->pass); + $sql="select use_id from ac_users where use_login='$this->id' + and use_active=1 and use_admin=1 and use_pass='$pass5'"; + + $cn=DbConnect(); + + $this->admin=CountSql($cn,$sql); + } else $this->admin=1; + + return $this->admin; +} +} +?> \ No newline at end of file diff --git a/include/class_widget.php b/include/class_widget.php new file mode 100644 index 000000000..2b3715e2e --- /dev/null +++ b/include/class_widget.php @@ -0,0 +1,206 @@ +type=$p_type; + $this->readonly=false; + $this->size=20; + $this->width=50; + $this->heigh=20; + $this->value=""; + $this->selected=""; + $this->table=0; + $this->label=""; + } + function SetReadOnly($p_read) { + $this->readonly=$p_read; + } + /*+++ + function IOValue($p_name,$p_value="",$p_label="") { + purpose : create the INPUT tag + parameters: $p_name is the INPUT NAME + $p_value is the INPUT VALUE or an array for select + $p_label is the label of the INPUT + return : string containing the tag + +++*/ + function IOValue($p_name,$p_value=null,$p_label="") { + // echo __FILE__."p_value $p_value"; + $this->name=$p_name; + $this->value=($p_value===null)?"":$p_value; + $this->label=($p_label == "")?$this->label:$p_label; + //echo "this->value =".$this->value; + // Input text type + if (strtoupper($this->type)=="TEXT") { + if ( $this->readonly==false) { + $r="size\">";} else { + $r=$this->value; + } + if ($this->table==1) { + if ( $this->label != "") { + $r="".$this->label."".$r.""; + }else { + $r="".$r.""; + } + } + return $r; + } + // Hidden field + if (strtoupper($this->type)=="HIDDEN") { + $r=''; + if ( $this->readonly==true) return ""; + return $r; + } + // Select value + if ( strtoupper($this->type) == "SELECT") { + if ($this->readonly==false ){ + //echo "Selected ".$this->selected; + $r=""; + } else { + echo_debug(__FILE__,__LINE__,"this->selected = ".$this->selected); + for ( $i=0;$ivalue);$i++) { + echo_debug(__FILE__,__LINE__,"check for ".$this->value[$i]['value']); + if ($this->selected==$this->value[$i]['value'] ) { + $r=$this->value[$i]['label']; + + } + } + } + if ( $this->table==1) { + $r=" $r "; + if ( $this->label != "") $r=" $this->label".$r; + } + return $r; + } + // Password + if (strtoupper($this->type)=="PASSWORD") { + if ( $this->readonly==true) return ""; + $r=''; + if ($this->table==1) { + $r=" $this->label $r "; + } + return $r; + } + + // Checkbox + if (strtoupper($this->type)=="CHECKBOX") { + if ( $this->readonly == true) { + $check=( $this->selected==true )?"Yes":"no"; + $r=$check; + } else { + $check=( $this->selected==true )?"checked":"unchecked"; + $r='table==1) { + $r=" $this->label $r "; + } else { + $r=$r." $this->label"; + } + return $r; + } + + //radio + if (strtoupper($this->type)=="RADIO") { + if ( $this->readonly == true) { + $check=( $this->selected==true || $this->selected=='t' )?"Yes":"no"; + $r=$check; + } else { + $check=( $this->selected==true||$this->selected=='t' )?"checked":"unchecked"; + $r='value\""; + $r.=" $check"; + $r.='>'; + } + if ($this->table==1) { + $r=" $this->label $r "; + } else { + $r=$this->label.$r; + } + return $r; + } + + //textarea + if (strtoupper($this->type)=="TEXTAREA") { + if ( $this->readonly == false ) { + $r='"; + } else { + $r='

'; + $r.=$this->value; + $r.='

'; + } + if ($this->table==1) { + $r=" $this->label $r "; + } + return $r; + } + + //file + if (strtoupper($this->type)=="FILE") { + if ( $this->readonly == false ) { + $r=''; + + } + if ( $this->table==1) $r="$this->label$r"; + return $r; + } + + } //end function + function debug() { + echo "Type ".$this->type."
"; + echo "name ".$this->name."
"; + echo "value". $this->value."
"; + $readonly=($this->readonly==false)?"false":"true"; + echo "read only".$readonly."
"; + } + function Submit ($p_name,$p_value) { + return ''; + } +} diff --git a/include/form_input.php b/include/form_input.php index 2c6bd2a0d..6d249524e 100644 --- a/include/form_input.php +++ b/include/form_input.php @@ -71,6 +71,23 @@ function InputType($p_label,$p_type,$p_name,$p_value,$p_viewonly=false,$p_list=n $r.=""; return $r; } + // Input type == select + if ( strtolower($p_type)=="select" ) { + $r=" $p_label"; + $r.=sprintf('"; + return $r; + } // Input type == select2 if ( strtolower($p_type)=="select2" ) { $r=" $p_label"; diff --git a/include/impress_jrn.php b/include/impress_jrn.php index 4899aa3d0..d7c4f8d3c 100644 --- a/include/impress_jrn.php +++ b/include/impress_jrn.php @@ -18,3 +18,156 @@ */ /* $Revision$ */ // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr +include_once("class_widget.php"); +//////////////////////////////////////////////////////////////////////////////// +// If print is asked +// First time in html +// after in pdf or cvs +//////////////////////////////////////////////////////////////////////////////// +if ( isset( $_POST['bt_html'] ) ) { +include("class_jrn.php"); + $p_cent=( isset ( $_POST['cent']) )?'on':'off'; + // $POST=from_periode, to_periode, jrn_id, cent + + $Jrn=new jrn($cn,$_POST['jrn_id']); + $Jrn->GetName(); + $Jrn->GetRow( $_POST['from_periode'], + $_POST['to_periode'], + $p_cent); + + $rep=""; + $submit=new widget(); + $hid=new widget("hidden"); + echo '
'; + echo '

'.$Jrn->name.'

'; + echo ""; + echo ''; + echo '"; + + echo '"; + echo '"; + + echo ""; + + echo "
'. + $submit->Submit('bt_other',"Autre journal"). + $hid->IOValue("type","jrn")."
'. + $submit->Submit('bt_pdf',"Export PDF"). + $hid->IOValue("type","jrn"). + $hid->IOValue("central",$p_cent). + $hid->IOValue("jrn_id",$Jrn->id). + $hid->IOValue("from_periode",$_POST['from_periode']). + $hid->IOValue("to_periode",$_POST['to_periode']); + + echo "
'. + $submit->Submit('bt_csv',"Export CSV"). + $hid->IOValue("type","jrn"). + $hid->IOValue("central",$p_cent). + $hid->IOValue("jrn_id",$Jrn->id). + $hid->IOValue("from_periode",$_POST['from_periode']). + $hid->IOValue("to_periode",$_POST['to_periode']); + + echo "
"; + + echo ""; + foreach ( $Jrn->row as $op ) { + if ( $op['j_id'] != $rep) { + $rep= $op['j_id']; + + echo "". + "". + "". + "". + "". + "". + "". + ""; + } else { + echo "". + "". + "". + "". + "". + "". + "". + ""; + } + + } + echo "
".$op['internal']."".$op['j_date']."".$op['poste']."".$op['description']."".$op['cred_montant']."".$op['deb_montant']."
".$op['internal']."".$op['j_date']."".$op['poste']."".$op['description']."".$op['cred_montant']."".$op['deb_montant']."
"; + echo "
"; + exit; +} + +//////////////////////////////////////////////////////////////////////////////// +// Show the jrn and date +//////////////////////////////////////////////////////////////////////////////// +include_once('form_input.php'); +include_once("postgres.php"); + +if ( $User->Admin() ==0) { + $ret=make_array($cn,"select jrn_def_id,jrn_def_name + from jrn_def join jrn_type on jrn_def_type=jrn_type_id + join user_sec_jrn on uj_jrn_id=jrn_def_id + where + uj_login='$User->id' + and uj_priv !='X' + "); + } else { + $ret=make_array($cn,"select jrn_def_id,jrn_def_name + from jrn_def join jrn_type on jrn_def_type=jrn_type_id"); + + } + +// include_once("check_priv.php"); +// printf ('%s',$l_line['jrn_def_id'],$l_line['jrn_def_name']); + +// Count the forbidden journaux + $NoPriv=CountSql($cn,"select jrn_def_id,jrn_def_name,jrn_def_class_deb,jrn_def_class_cred,jrn_type_id,jrn_desc,uj_priv, + jrn_deb_max_line,jrn_cred_max_line + from jrn_def join jrn_type on jrn_def_type=jrn_type_id + join user_sec_jrn on uj_jrn_id=jrn_def_id + where + uj_login='$User->id' + and uj_priv ='X' + "); + // Pour voir tout les journal ? + if ( $NoPriv == 0 ) { + $a=count($ret); + $all=array('value'=>0,'label'=>'All'); + $ret[$a]=$all; + } +if ( count($ret) < 1 ) + NoAccess(); +//////////////////////////////////////////////////////////////////////////////// +// Form +//////////////////////////////////////////////////////////////////////////////// +echo '
'; +echo '
'; +echo ''; +$w=new widget("select"); +$w->table=1; +$w->label="Choississez le journal"; +print $w->IOValue("jrn_id",$ret); +print ''; +print ''; +$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id"); +$w->label="Depuis"; +print $w->IOValue('from_periode',$periode_start); +$w->label=" jusqu'à "; +$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode order by p_id"); +print $w->IOValue('to_periode',$periode_end); +print ""; +$centralise=new widget("checkbox"); +$centralise->label="Depuis les journaux centralisés"; +$centralise->table=1; +print $centralise->IOValue('cent'); + +print ""; +echo '
'; +print $w->Submit('bt_html','Impression'); + +echo '
'; +echo '
'; +?> \ No newline at end of file diff --git a/include/jrn.php b/include/jrn.php index 47b3196ab..21f42fc12 100644 --- a/include/jrn.php +++ b/include/jrn.php @@ -1031,6 +1031,4 @@ function GetDataJrnJrId ($p_cn,$p_jr_id) { } return $ret_array; } - - ?> diff --git a/include/user_menu.php b/include/user_menu.php index 81768ee56..523f40142 100644 --- a/include/user_menu.php +++ b/include/user_menu.php @@ -435,9 +435,7 @@ function ShowJrn($p_menu="") $p_array=array(array("user_jrn.php?JRN_TYPE=VEN" ,"Entrée"), array("user_jrn.php?JRN_TYPE=ACH","Dépense"), array("user_jrn.php?JRN_TYPE=FIN","Financier"), - array("user_jrn.php?JRN_TYPE=OD","Op. Diverses"), - array("user_impress.php","Impression"), - array("user_search.php","Recherche") + array("user_jrn.php?JRN_TYPE=OD","Op. Diverses") ); $result=ShowItem($p_array,'H',"cell","mtitle",$p_menu); return $result;