diff --git a/include/bank.inc.php b/include/bank.inc.php index 76a491887..a0de094d2 100644 --- a/include/bank.inc.php +++ b/include/bank.inc.php @@ -23,6 +23,7 @@ require_once('user_form_fin.php'); require_once('jrn.php'); require_once("class_document.php"); require_once("class_fiche.php"); +require_once("class_parm_code.php"); /*!\file * \brief the purpose off this file encode expense and to record them * @@ -51,6 +52,52 @@ if ( isset ($_REQUEST['url'])) } $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:""; +//---------------------------------------------------------------------- +// ask the saldo of the bank +if ( $sub_action == "solde" ) +{ + echo '
'; + +echo ShowMenuJrnUser($_SESSION['g_dossier'],'FIN',0,'Liste'. +'Solde'); + echo '
'; + require_once("poste.php"); + // find the bank account + // NOTE : those values are in a table because + // they are _national_ parameters + $banque=new parm_code($cn,'BANQUE'); + $caisse=new parm_code($cn,'CAISSE'); + $vir_interne=new parm_code($cn,'VIREMENT_INTERNE'); + $accountSql="select distinct pcm_val::text,pcm_lib from + tmp_pcmn + where pcm_val like '".$banque->p_value."%' or pcm_val like '".$vir_interne->p_value."%' + or pcm_val like '".$caisse->p_value."%' + order by pcm_val::text"; + $ResAccount=ExecSql($cn,$accountSql); + echo '
'; + echo ""; + // for each account + for ( $i = 0; $i < pg_NumRows($ResAccount);$i++) { + // get the saldo + $l=pg_fetch_array($ResAccount,$i); + $m=GetSolde($cn,$l['pcm_val']); + // print the result if the saldo is not equal to 0 + if ( $m != 0.0 ) { + echo ""; + echo "". + ""."".""; + } + }// for + echo "
". + $l['pcm_val']. + "". + $l['pcm_lib']. + "". + $m. + "
"; + echo "
"; + exit(); +} //----------------------------------------------------- // If a list of depense is asked // @@ -129,7 +176,8 @@ if ( $sub_action == "list") } //----------------------------------------------------- echo '
'; -echo ShowMenuJrnUser($_SESSION['g_dossier'],'FIN',$p_jrn,'Liste'); +echo ShowMenuJrnUser($_SESSION['g_dossier'],'FIN',$p_jrn,'Liste'. +'Solde'); echo '
'; //----------------------------------------------------- // if we request to add an item diff --git a/include/user_action_fin.php b/include/user_action_fin.php index 8653e2ca0..d0e8dadce 100644 --- a/include/user_action_fin.php +++ b/include/user_action_fin.php @@ -212,7 +212,7 @@ echo 'P if ( $action == 'solde' ) { require_once("poste.php"); // find the bank account - // TODO : those values should be in a table because + // NOTE : those values are in a table because // they are _national_ parameters $banque=new parm_code($cn,'BANQUE'); $caisse=new parm_code($cn,'CAISSE');