noalyss
Version-6.7.2
|
Follow_Up Details are the details for an actions, it means the details of an order, delivery order, submit a quote... this class is linked to the table action_detail. More...
Public Member Functions | |
__construct ($p_cn, $p_id=0) | |
delete () | |
from_array ($array, $idx) | |
Fill an Action_Detail Object with the data contained in an array. | |
get_info () | |
get_parameter ($p_string) | |
insert () | |
load () | |
load_all () | |
retrieve all the details of an Follow_Up | |
save () | |
set_parameter ($p_string, $p_value) | |
update () | |
verify () | |
Static Public Member Functions | |
static | test_me () |
Static Private Attributes | |
static | $variable |
Follow_Up Details are the details for an actions, it means the details of an order, delivery order, submit a quote... this class is linked to the table action_detail.
Definition at line 41 of file class_follow_up_detail.php.
Follow_Up_Detail::__construct | ( | $ | p_cn, |
$ | p_id = 0 |
||
) |
Definition at line 54 of file class_follow_up_detail.php.
References db.
{ $this->db=$p_cn; $this->ad_id=$p_id; }
Follow_Up_Detail::from_array | ( | $ | array, |
$ | idx | ||
) |
Fill an Action_Detail Object with the data contained in an array.
$array |
|
$idx | is the idx (example 7) |
Definition at line 206 of file class_follow_up_detail.php.
References $array, $idx, $qcode, $row, $tmp, ag_id, db, isNumber(), and trim().
{ $row=$array; $this->ad_id=(isset($row['ad_id'.$idx]))?$row['ad_id'.$idx]:0; $qcode=(isset($row['e_march'.$idx]))?$row['e_march'.$idx]:""; if (trim($qcode)=='') { $this->f_id=0; } else { $tmp=new Fiche($this->db); $tmp->get_by_qcode($qcode,false); $this->f_id=$tmp->id; } $this->ad_text=(isset($row['e_march'.$idx.'_label']))?$row['e_march'.$idx.'_label']:""; $this->ad_pu=(isset($row['e_march'.$idx.'_price']))?$row['e_march'.$idx.'_price']:0; $this->ad_quant=(isset($row['e_quant'.$idx]))?$row['e_quant'.$idx]:0; $this->ad_tva_id=(isset($row['e_march'.$idx.'_tva_id']))?$row['e_march'.$idx.'_tva_id']:0; $this->ad_tva_amount=(isset($row['e_march'.$idx.'_tva_amount']))?$row['e_march'.$idx.'_tva_amount']:0; $this->ad_total_amount=(isset($row['tvac_march'.$idx]))?$row['tvac_march'.$idx]:0; $this->ag_id=(isset($array['ag_id']))?$array['ag_id']:0; /* protect numeric */ if (trim($this->ad_pu)=="" || isNumber($this->ad_pu)==0) $this->ad_pu=0; if (trim($this->ad_quant)=="" || isNumber($this->ad_quant)==0) $this->ad_quant=0; if (trim($this->ad_tva_amount)==""||isNumber($this->ad_tva_amount)==0) $this->ad_tva_amount=0; if (trim($this->ad_total_amount)==""||isNumber($this->ad_total_amount)==0) $this->ad_total_amount=0; if (trim($this->ad_tva_id)=="" || isNumber($this->ad_tva_id)==0) $this->ad_tva_id=0; }
Definition at line 81 of file class_follow_up_detail.php.
{ return var_export(self::$variable,true); }
Follow_Up_Detail::get_parameter | ( | $ | p_string | ) |
Definition at line 98 of file class_follow_up_detail.php.
References $sql, ag_id, db, and verify().
Referenced by save().
{ if ( $this->verify() != 0 ) return; $sql='INSERT INTO action_detail('. ' f_id, ad_text, ad_pu, ad_quant, ad_tva_id, ad_tva_amount,'. ' ad_total_amount, ag_id)'. ' VALUES ($1, $2, $3, $4,$5,$6,$7,$8) returning ad_id'; $this->ad_id=$this->db->get_value($sql,array( $this->f_id, $this->ad_text, $this->ad_pu, $this->ad_quant, $this->ad_tva_id, $this->ad_tva_amount, $this->ad_total_amount, $this->ag_id ) ); }
Definition at line 170 of file class_follow_up_detail.php.
References $idx, $res, $row, $sql, $value, and db.
{ $sql="SELECT ad_id, f_id, ad_text, ad_pu, ad_quant, ad_tva_id, ad_tva_amount, ad_total_amount, ag_id FROM action_detail". " where ad_id=$1"; $res=$this->db->get_array($this->db, $sql, array($this->ad_id) ); if ( $this->db->count() == 0 ) return; $row=$res[0]; foreach ($row as $idx=>$value) { $this->$idx=$value; } }
retrieve all the details of an Follow_Up
Definition at line 146 of file class_follow_up_detail.php.
References $a, $idx, $res, $row, $sql, $value, ag_id, and db.
{ $sql="SELECT ad_id, f_id, ad_text, ad_pu, ad_quant, ad_tva_id, ad_tva_amount, ad_total_amount, ag_id FROM action_detail ". " where ag_id=$1 order by ad_id"; $res=$this->db->get_array( $sql, array($this->ag_id) ); if ( $this->db->count() == 0 ) return; $aRet=array(); for($i=0;$i<count($res);$i++) { $a=new Follow_Up_Detail($this->db); $row=$res[$i]; foreach ($row as $idx=>$value) { $a->$idx=$value; } $aRet[$i]=clone $a; } return $aRet; }
Follow_Up_Detail::set_parameter | ( | $ | p_string, |
$ | p_value | ||
) |
static Follow_Up_Detail::test_me | ( | ) | [static] |
Definition at line 119 of file class_follow_up_detail.php.
References $sql, ag_id, db, and verify().
Referenced by save().
{ if ( $this->verify() != 0 ) return; $sql='UPDATE action_detail '. ' SET f_id=$1, ad_text=$2, ad_pu=$3, ad_quant=$4, ad_tva_id=$5,'. ' ad_tva_amount=$6, ad_total_amount=$7, ag_id=$8'. ' WHERE ad_id=$9'; $this->id=$this->db->exec_sql($sql,array( $this->f_id, $this->ad_text, $this->ad_pu, $this->ad_quant, $this->ad_tva_id, $this->ad_tva_amount, $this->ad_total_amount, $this->ag_id, $this->ad_id ) ); }
Definition at line 85 of file class_follow_up_detail.php.
Referenced by insert(), and update().
{ // Verify that the elt we want to add is correct return 0; }
Follow_Up_Detail::$variable [static, private] |
array( "id"=>"ad_id", "qcode"=>"f_id", "text"=>"ad_text", "price_unit"=>"ad_pu", "quantity"=>"ad_quant", "tva_id"=>"ad_tva_id", "tva_amount"=>"ad_tva_amount", "total"=>"ad_total_amount", "ag_id"=>"ag_id" )
Definition at line 43 of file class_follow_up_detail.php.