Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 require_once("constant.php");
00021 require_once('class_database.php');
00022 require_once("class_acc_parm_code.php");
00023 require_once('class_periode.php');
00024 require_once('class_fiche.php');
00025 require_once('class_acc_account_ledger.php');
00026 require_once('user_common.php');
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 class Supplier extends Fiche
00037 {
00038
00039 var $poste;
00040 var $name;
00041 var $street;
00042 var $country;
00043 var $cp;
00044 var $vat_number;
00045
00046
00047
00048 function __construct($p_cn,$p_id=0)
00049 {
00050 $this->fiche_def_ref=FICHE_TYPE_FOURNISSEUR;
00051 parent::__construct($p_cn,$p_id) ;
00052
00053 }
00054
00055
00056
00057 function get_by_account($p_poste=0)
00058 {
00059 $this->poste=($p_poste==0)?$this->poste:$p_poste;
00060 $sql="select * from vw_supplier where poste_comptable=".$this->poste;
00061 $Res=$this->cn->exec_sql($sql);
00062 if ( Database::num_row($Res) == 0) return null;
00063
00064 $row=Database::fetch_array($Res,0);
00065 $this->name=$row['name'];
00066 $this->id=$row['f_id'];
00067 $this->street=$row['rue'];
00068 $this->cp=$row['code_postal'];
00069 $this->country=$row['pays'];
00070 $this->vat_number=$row['tva_num'];
00071
00072 }
00073
00074
00075
00076 }
00077
00078 ?>