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

this object handles the table quant_purchase More...

+ Inheritance diagram for gestion_purchase:
+ Collaboration diagram for gestion_purchase:

Public Member Functions

 get_list ()
 return an array of gestion_table, the object are retrieved thanks the qs_internal More...
 
 load ()
 
 search_by_jid ($p_jid)
 
- Public Member Functions inherited from gestion_table
 __construct ($p_cn)
 contains only the dabase connx More...
 

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
 
 $qp_vat_sided
 
- Data Fields inherited from gestion_table
 $db
 

Detailed Description

this object handles the table quant_purchase

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

Member Function Documentation

◆ get_list()

gestion_purchase::get_list ( )

return an array of gestion_table, the object are retrieved thanks the qs_internal

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

53  {
54  if ($this->qp_internal=="")
55  throw new Exception(__FILE__.__LINE__." qs_internal est vide");
56  $sql="select qp_id,
57  qp_internal,
58  qp_fiche,
59  qp_quantite,
60  qp_price,
61  qp_vat,
62  qp_vat_code,
63  tva_rate,
64  tva_label,
65  qp_nd_amount,
66  qp_nd_tva,
67  qp_nd_tva_recup,
68  qp_supplier,
69  j_id,
70  qp_dep_priv,
71  qp_vat_sided
72  from quant_purchase left join tva_rate on (qp_vat_code=tva_id)
73  where qp_internal='".$this->qp_internal."'";
74  $ret=$this->db->exec_sql($sql);
75  // $res contains all the line
77 
78  if ( sizeof($res)==0) return null;
79  $count=0;
80  foreach ($res as $row)
81  {
82  $t_gestion_purchase=new gestion_purchase($this->db);
83  foreach ($row as $idx=>$value)
84  $t_gestion_purchase->$idx=$value;
85  $array[$count]=clone $t_gestion_purchase;
86  $count++;
87  }
88  return $array;
89  }

References $array, $count, $idx, $res, $ret, $row, $sql, $value, db, and DatabaseCore\fetch_all().

+ Here is the call graph for this function:

◆ load()

gestion_purchase::load ( )

Definition at line 99 of file gestion_purchase.class.php.

100  {
101  $sql="select qp_id,
102  qp_internal,
103  qp_fiche,
104  qp_quantite,
105  qp_price,
106  qp_vat,
107  qp_vat_code,
108  qp_nd_amount,
109  qp_nd_tva,
110  qp_nd_tva_recup,
111  qp_supplier,
112  j_id,
113  qp_dep_priv,
114  qp_vat_sided
115  from quant_purchase
116  where qp_id=".$this->qp_id;
117  $ret=$this->db->exec_sql($sql);
118  // $res contains all the line
120 
121  if ( empty($res) ) return null;
122  foreach ($res[0] as $idx=>$value)
123  $this->$idx=$value;
124 
125  }

References $idx, $res, $ret, $sql, $value, db, and DatabaseCore\fetch_all().

+ Here is the call graph for this function:

◆ search_by_jid()

gestion_purchase::search_by_jid (   $p_jid)

Definition at line 90 of file gestion_purchase.class.php.

91  {
92  $res=$this->db->exec_sql("select qp_id from quant_purchase where j_id=".$p_jid);
93 
94  if ( Database::num_row($res) == 1)
95  $this->qp_id=Database::fetch_result($res,0,0);
96  else
97  $this->qp_id=0;
98  }

References $res, db, DatabaseCore\fetch_result(), and DatabaseCore\num_row().

+ Here is the call graph for this function:

Field Documentation

◆ $j_id

gestion_purchase::$j_id

jrnx.j_id

Definition at line 45 of file gestion_purchase.class.php.

◆ $qp_dep_priv

gestion_purchase::$qp_dep_priv

private purchase

Definition at line 47 of file gestion_purchase.class.php.

◆ $qp_fiche

gestion_purchase::$qp_fiche

card id (fiche.f_id)

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

◆ $qp_id

gestion_purchase::$qp_id

id

Definition at line 33 of file gestion_purchase.class.php.

◆ $qp_internal

gestion_purchase::$qp_internal

internal code

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

◆ $qp_nd_amount

gestion_purchase::$qp_nd_amount

no deductible

Definition at line 40 of file gestion_purchase.class.php.

◆ $qp_nd_tva

gestion_purchase::$qp_nd_tva

tva not deductible

Definition at line 41 of file gestion_purchase.class.php.

◆ $qp_nd_tva_recup

gestion_purchase::$qp_nd_tva_recup

tva ded via taxe

Definition at line 42 of file gestion_purchase.class.php.

◆ $qp_price

gestion_purchase::$qp_price

quantity

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

◆ $qp_quantite

gestion_purchase::$qp_quantite

quantity

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

◆ $qp_supplier

gestion_purchase::$qp_supplier

supplier code (f_id)

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

◆ $qp_valid

gestion_purchase::$qp_valid

Definition at line 44 of file gestion_purchase.class.php.

◆ $qp_vat

gestion_purchase::$qp_vat

vat amount

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

◆ $qp_vat_code

gestion_purchase::$qp_vat_code

vat_code

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

◆ $qp_vat_sided

gestion_purchase::$qp_vat_sided

Definition at line 48 of file gestion_purchase.class.php.


The documentation for this class was generated from the following file:
$ret
$ret
Definition: ajax_display_letter.php:51
DatabaseCore\fetch_all
static fetch_all($ret)
wrapper for the function pg_fetch_all
Definition: database_core.class.php:755
db
$SecUser db
Definition: export_security_pdf.php:118
$sql
$sql
Definition: ajax_add_concerned_card.php:100
$array
$array
Definition: ajax_add_concerned_card.php:115
DatabaseCore\fetch_result
static fetch_result($ret, $p_row=0, $p_col=0)
wrapper for the function pg_fetch_all
Definition: database_core.class.php:767
$value
$value
Definition: export_document.php:41
DatabaseCore\num_row
static num_row($ret)
wrapper for the function pg_NumRows
Definition: database_core.class.php:734
$idx
$idx
Definition: ajax_bookmark.php:79
$count
$count
Definition: modele.inc.php:251
gestion_purchase
this object handles the table quant_purchase
Definition: gestion_purchase.class.php:31
$row
$row
Definition: ajax_anc_detail_operation.php:33
$res
$res
Definition: ajax_preference.php:49