noalyss Version-9
Public Member Functions | Data Fields
Supplier Class Reference

class Supplier are a specific kind of card More...

+ Inheritance diagram for Supplier:
+ Collaboration diagram for Supplier:

Public Member Functions

 __construct ($p_cn, $p_id=0)
 Constructor /* only a db connection is needed. More...
 
 get_by_account ($p_poste=0)
 Get all info contains in the view thanks to the poste elt (account) More...
 
- Public Member Functions inherited from Fiche
 __construct ($p_cn, $p_id=0)
 
 __toString ()
 
 belong_ledger ($p_jrn, $p_type="")
 Check if a fiche is used by a jrn return 1 if the fiche is in the range otherwise 0, the quick_code or the id must be set. More...
 
 blank ($p_fiche_def)
 insert a new record show a blank card to be filled More...
 
 build_sql ($array)
 create the sql statement for retrieving all the card More...
 
 button_csv ($p_from, $p_to)
 Return a string with the HTML code to display a button to export the history in CSV. More...
 
 button_pdf ($p_from, $p_to)
 Return a string with the HTML code to display a button to export the history in PDF. More...
 
 count_by_modele ($p_frd_id, $p_search="", $p_sql="")
 Count the nb of card with the reference card id frd_id. More...
 
 delete ()
 
 Display ($p_readonly, $p_in="")
 Display object instance, getAttribute sort the attribute and add missing ones. More...
 
 display_row ()
 display card as a table row , the tag TR must be added More...
 
 empty_attribute ($p_attr)
 check if an attribute is empty More...
 
 filter_history ($p_table_id)
 Filter in javascript the table with the history. More...
 
 Get ()
 Synonum of fiche::getAttribut. More...
 
 get_all_account ()
 
 get_amount_side ($p_amount)
 return the letter C if amount is > 0, D if < 0 or = More...
 
 get_bank_ledger ()
 Returns the Acc_Ledger_Fin ledger for which the card is the default bank account or null if no ledger is found. More...
 
 get_bk_account ()
 get the available bank_account filtered by the security More...
 
 get_bk_balance ($p_cond="")
 get the bank balance with receipt or not in Euro More...
 
 get_bk_balance_currency ($p_cond="")
 Get the sum in Currency. More...
 
 get_by_category ($p_offset=-1, $p_search="", $p_order='')
 get all the card thanks the fiche_def_ref More...
 
 get_by_qcode ($p_qcode=null, $p_all=true)
 Retrieve a card thx his quick_code complete the object,, set the id member of the object or set it to 0 if no card is found. More...
 
 get_categorie ()
 get the fd_id of the card : fd_id, it set the attribute fd_id More...
 
 get_f_enable ()
 
 get_fiche_def_ref ()
 
 get_fiche_def_ref_id ()
 retrieve the frd_id of the fiche it is the type of the card (bank, purchase...) (fiche_def_ref primary key) More...
 
 get_gestion_title ()
 
 get_id ()
 
 get_quick_code ()
 return the quick_code of a card More...
 
 get_row ($p_from, $p_to)
 Get data for poste. More...
 
 get_row_date ($p_from, $p_to, $op_let=0)
 Get data for poste. More...
 
 get_solde_detail ($p_cond="")
 give the balance of an card More...
 
 getAttribut ()
 get all the attribute of a card, add missing ones and sort the array ($this->attribut) by ad_id More...
 
 GetByDef ($p_frd_id, $p_offset=-1, $p_search="", $p_order='')
 Return array of card from the frd family deprecated , use insert get_by_category_id. More...
 
 getDisplayMode ()
 
 getLabelCategory ()
 
 getName ()
 return the name of a card More...
 
 HtmlTable ($p_array=null, $op_let=0, $from_div=1)
 HtmlTable, display a HTML of a card for the asked period. More...
 
 HtmlTableDetail ($p_array=null, $op_let=0)
 HtmlTable, display a HTML of a card for the asked period. More...
 
 HtmlTableHeader ($p_array=null)
 Display HTML Table Header (button) More...
 
 insert ($p_fiche_def, $p_array=null, $transaction=true)
 insert a new record thanks an array , either as parameter or $_POST More...
 
 is_used ()
 check if a card is used More...
 
 load ()
 Synonum of fiche::getAttribut. More...
 
 move_to ($p_fdid)
 move a card to another cat. More...
 
 remove ($silent=false)
 remove a card, check if not used first, must be synchro with is_used More...
 
 save ($p_fiche_def=0)
 Save a card, call insert or update. More...
 
 seek ($p_attribut, $p_value)
 find the card with the p_attribut equal to p_value, it is not case sensitive More...
 
 set_f_enable ($f_enable)
 
 set_fiche_def ($p_fiche_def)
 
 set_fiche_def_ref ($fiche_def_ref)
 
 set_id ($id)
 
 setAttribut ($p_ad_id, $p_value)
 set an attribute by a value, if the attribut array is empty a call to getAttribut is performed More...
 
 setDisplayMode ($p_mode)
 how the card is display : either in a window or a greated container More...
 
 ShowTable ()
 
 strAttribut ($p_ad_id, $p_return=1)
 
 Summary ($p_search="", $p_action="", $p_sql="", $p_amount=false)
 show the default screen More...
 
 to_array ()
 turn a card into an array , then it can be saved thanks update or insert More...
 
 update ($p_array=null)
 update a card with an array More...
 

Data Fields

 $country
 
 $cp
 
 $name
 
 $poste
 
 $street
 
 $vat_number
 
- Data Fields inherited from Fiche
 $attribut
 
 $cn
 
 $fiche_def
 
 $fiche_def_ref
 
 $id
 
 $quick_code
 
 $row
 
 $tot_cred
 
 $tot_deb
 

Additional Inherited Members

- Static Public Member Functions inherited from Fiche
static cmp_name (Fiche $o1, Fiche $o2)
 used with a usort function, to sort an array of Fiche on the name More...
 
static from_qcode ($p_qcode)
 create a card from a qcode and returns a card More...
 
static get_fiche_def ($p_cn, $pFd_id, $p_order='')
 get all the card from a categorie More...
 
static test_me ()
 

Detailed Description

class Supplier are a specific kind of card

Definition at line 31 of file supplier.class.php.

Constructor & Destructor Documentation

◆ __construct()

Supplier::__construct (   $p_cn,
  $p_id = 0 
)

Constructor /* only a db connection is needed.

Reimplemented from Fiche.

Definition at line 43 of file supplier.class.php.

44 {
45 $this->fiche_def_ref=FICHE_TYPE_FOURNISSEUR;
46 parent::__construct($p_cn,$p_id) ;
47
48 }
const FICHE_TYPE_FOURNISSEUR
Definition: constant.php:249

References $p_id, and FICHE_TYPE_FOURNISSEUR.

Member Function Documentation

◆ get_by_account()

Supplier::get_by_account (   $p_poste = 0)

Get all info contains in the view thanks to the poste elt (account)

Definition at line 52 of file supplier.class.php.

53 {
54 $this->poste=($p_poste==0)?$this->poste:$p_poste;
55 $sql="select * from vw_supplier where poste_comptable=".$this->poste;
56 $Res=$this->cn->exec_sql($sql);
57 if ( Database::num_row($Res) == 0) return null;
58 // There is only _one_ row by supplier
60 $this->name=$row['name'];
61 $this->id=$row['f_id'];
62 $this->street=$row['rue'];
63 $this->cp=$row['code_postal'];
64 $this->country=$row['pays'];
65 $this->vat_number=$row['tva_num'];
66
67 }
$input_from cn
Definition: balance.inc.php:66
$from_poste name
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
$Res

References $Res, Fiche\$row, $sql, cn, DatabaseCore\fetch_array(), name, and DatabaseCore\num_row().

+ Here is the call graph for this function:

Field Documentation

◆ $country

Supplier::$country

$country Country

Definition at line 37 of file supplier.class.php.

◆ $cp

Supplier::$cp

$cp Zip code

Definition at line 38 of file supplier.class.php.

◆ $name

Supplier::$name

$name name of the company

Definition at line 35 of file supplier.class.php.

◆ $poste

Supplier::$poste

$poste poste comptable

Definition at line 34 of file supplier.class.php.

◆ $street

Supplier::$street

$street Street

Definition at line 36 of file supplier.class.php.

◆ $vat_number

Supplier::$vat_number

$vat_number vat number

Definition at line 39 of file supplier.class.php.


The documentation for this class was generated from the following file: