noalyss
Version-6.7.2
|
this object handles the table quant_purchase More...
Public Member Functions | |
get_list () | |
return an array of gestion_table, the object are retrieved thanks the qs_internal | |
load () | |
search_by_jid ($p_jid) | |
Data Fields | |
$j_id | |
$qp_dep_priv | |
$qp_fiche | |
$qp_id | |
$qp_internal | |
$qp_nd_amount | |
$qp_nd_tva | |
$qp_nd_tva_recup | |
$qp_price | |
$qp_quantite | |
$qp_supplier | |
$qp_valid | |
$qp_vat | |
$qp_vat_code |
this object handles the table quant_purchase
Definition at line 32 of file class_gestion_purchase.php.
return an array of gestion_table, the object are retrieved thanks the qs_internal
Definition at line 52 of file class_gestion_purchase.php.
References $array, $count, $idx, $res, $ret, $row, $sql, $value, db, exit, and Database\fetch_all().
{ if ($this->qp_internal=="") exit (__FILE__.__LINE__." qs_internal est vide"); $sql="select qp_id, qp_internal, qp_fiche, qp_quantite, qp_price, qp_vat, qp_vat_code, tva_rate, tva_label, qp_nd_amount, qp_nd_tva, qp_nd_tva_recup, qp_supplier, j_id, qp_dep_priv from quant_purchase left join tva_rate on (qp_vat_code=tva_id) where qp_internal='".$this->qp_internal."'"; $ret=$this->db->exec_sql($sql); // $res contains all the line $res=Database::fetch_all($ret); if ( sizeof($res)==0) return null; $count=0; foreach ($res as $row) { $t_gestion_purchase=new gestion_purchase($this->db); foreach ($row as $idx=>$value) $t_gestion_purchase->$idx=$value; $array[$count]=clone $t_gestion_purchase; $count++; } return $array; }
Definition at line 98 of file class_gestion_purchase.php.
References $idx, $res, $ret, $sql, $value, db, and Database\fetch_all().
{ $sql="select qp_id, qp_internal, qp_fiche, qp_quantite, qp_price, qp_vat, qp_vat_code, qp_nd_amount, qp_nd_tva, qp_nd_tva_recup, qp_supplier, j_id, qp_dep_priv from quant_purchase where qp_id=".$this->qp_id; $ret=$this->db->exec_sql($sql); // $res contains all the line $res=Database::fetch_all($ret); if ( empty($res) ) return null; foreach ($res[0] as $idx=>$value) $this->$idx=$value; }
gestion_purchase::search_by_jid | ( | $ | p_jid | ) |
Definition at line 89 of file class_gestion_purchase.php.
References $res, db, Database\fetch_result(), and Database\num_row().
{ $res=$this->db->exec_sql("select qp_id from quant_purchase where j_id=".$p_jid); if ( Database::num_row($res) == 1) $this->qp_id=Database::fetch_result($res,0,0); else $this->qp_id=0; }
gestion_purchase::$j_id |
jrnx.j_id
Definition at line 46 of file class_gestion_purchase.php.
gestion_purchase::$qp_dep_priv |
private purchase
Definition at line 48 of file class_gestion_purchase.php.
gestion_purchase::$qp_fiche |
card id (fiche.f_id)
Definition at line 36 of file class_gestion_purchase.php.
gestion_purchase::$qp_id |
id
Definition at line 34 of file class_gestion_purchase.php.
gestion_purchase::$qp_internal |
internal code
Definition at line 35 of file class_gestion_purchase.php.
gestion_purchase::$qp_nd_amount |
no deductible
Definition at line 41 of file class_gestion_purchase.php.
gestion_purchase::$qp_nd_tva |
tva not deductible
Definition at line 42 of file class_gestion_purchase.php.
gestion_purchase::$qp_nd_tva_recup |
tva ded via taxe
Definition at line 43 of file class_gestion_purchase.php.
gestion_purchase::$qp_price |
quantity
Definition at line 38 of file class_gestion_purchase.php.
gestion_purchase::$qp_quantite |
quantity
Definition at line 37 of file class_gestion_purchase.php.
gestion_purchase::$qp_supplier |
supplier code (f_id)
Definition at line 44 of file class_gestion_purchase.php.
gestion_purchase::$qp_valid |
Definition at line 45 of file class_gestion_purchase.php.
gestion_purchase::$qp_vat |
vat amount
Definition at line 39 of file class_gestion_purchase.php.
gestion_purchase::$qp_vat_code |
vat_code
Definition at line 40 of file class_gestion_purchase.php.