Journal non trouvé "; // return (3,3); } $l_line=pg_fetch_array($Res,0); $l_deb=$l_line['jrn_deb_max_line']; $l_cred=$l_line['jrn_cred_max_line']; return array ($l_deb,$l_cred); } /*! * \brief Cree un form pour prendre les postes * * * \param connection * * \return * morceau de code d'html qui contient un multiselect * pour les postes * */ function PosteForm($p_cn) { $Res=ExecSql($p_cn,"select pcm_val,pcm_lib from tmp_pcmn where pcm_val = any (select j_poste from jrnx) order by pcm_val::text"); $Max=pg_NumRows($Res); if ($Max==0) return null; $ret='"; return $ret; } /*! * \brief give the balance of an account * * * \param $p_cn connection * \param $p_account account * \param $p_cond sql condition * * \return balance of the account * */ function GetSolde($p_cn,$p_account,$p_cond="") { $Res=ExecSql($p_cn,"select j_poste,sum(deb) as sum_deb, sum(cred) as sum_cred from ( select j_poste, case when j_debit='t' then j_montant else 0 end as deb, case when j_debit='f' then j_montant else 0 end as cred from jrnx join tmp_pcmn on j_poste=pcm_val where j_poste=$p_account $p_cond ) as m group by j_poste "); $Max=pg_NumRows($Res); if ($Max==0) return 0; $r=pg_fetch_array($Res,0); return $r['sum_deb']-$r['sum_cred']; } ?>