fiche_def_ref=FICHE_TYPE_FOURNISSEUR; fiche::fiche($p_cn,$p_id) ; } /*! \brief Get all info contains in the view * thanks to the poste elt (account) */ function GetFromPoste($p_poste=0) { $this->poste=($p_poste==0)?$this->poste:$p_poste; $sql="select * from vw_supplier where poste_comptable=".$this->poste; $Res=ExecSql($this->cn,$sql); if ( pg_NumRows($Res) == 0) return null; // There is only _one_ row by supplier $row=pg_fetch_array($Res,0); $this->name=$row['name']; $this->id=$row['f_id']; $this->street=$row['rue']; $this->cp=$row['code_postal']; $this->country=$row['pays']; $this->vat_number=$row['tva_num']; } /*! ************************************************** * \brief show the default screen * * \param p_search (filter) * \return string to display */ function Summary($p_search) { $str_dossier=dossier::get(); $p_search=FormatString($p_search); $url=urlencode($_SERVER['REQUEST_URI']); $script=$_SERVER['PHP_SELF']; // Creation of the nav bar // Get the max numberRow $all_supplier=$this->CountByDef($this->fiche_def_ref,$p_search); // Get offset and page variable $offset=( isset ($_REQUEST['offset'] )) ?$_REQUEST['offset']:0; $page=(isset($_REQUEST['page']))?$_REQUEST['page']:1; $bar=jrn_navigation_bar($offset,$all_supplier,$_SESSION['g_pagesize'],$page); // set a filter ? $search=""; if ( trim($p_search) != "" ) { $search=" and f_id in (select f_id from jnt_fic_att_value join fiche using (f_id) join attr_value using (jft_id) where ad_id=1 and av_text ~* '$p_search')"; } // Get The result Array $step_supplier=$this->GetAll($offset,$search); if ( $all_supplier == 0 ) return ""; $r=$bar; $r.='
| Quick Code | Nom | Adresse | Total débit | Total crédit | Solde | Action | |||
|---|---|---|---|---|---|---|---|---|---|
| $e".$supplier->strAttribut(ATTR_DEF_QUICKCODE)." | "; $r.="".$supplier->strAttribut(ATTR_DEF_NAME)." | "; $r.="".$supplier->strAttribut(ATTR_DEF_ADRESS). " ".$supplier->strAttribut(ATTR_DEF_CP). " ".$supplier->strAttribut(ATTR_DEF_PAYS). " | "; $post=new poste($this->cn,$supplier->strAttribut(ATTR_DEF_ACCOUNT)); /* Filter on the default year */ $User=new cl_user($this->cn); $filter_year=" j_tech_per in (select p_id from parm_periode ". "where p_exercice='".$User->getExercice()."')"; $a=$post->GetSoldeDetail($filter_year); $r.=sprintf('%15.2f€ | ',$a['debit']); $r.=sprintf('%15.2f€ | ',$a['credit']); $r.=sprintf('%15.2f€ | ',$a['solde']); $r.=sprintf('Contact | ', $script,$supplier->strAttribut(ATTR_DEF_QUICKCODE),$str_dossier,$url); $r.=sprintf('Courrier | ', $script,$supplier->strAttribut(ATTR_DEF_QUICKCODE) ,$str_dossier,$url); $r.='Facture | '; $r.=sprintf('Financier | ', $script,$supplier->strAttribut(ATTR_DEF_QUICKCODE) ,$url); $r.=''; $r.="