40#[AllowDynamicProperties]
47 "price_unit"=>
"ad_pu",
48 "quantity"=>
"ad_quant",
49 "tva_id"=>
"ad_tva_id",
50 "tva_amount"=>
"ad_tva_amount",
51 "total"=>
"ad_total_amount",
62 if ( array_key_exists($p_string,self::$variable) )
64 $idx=self::$variable[$p_string];
68 throw new Exception(
"Attribut inexistant $p_string");
72 if ( array_key_exists($p_string,self::$variable) )
74 $idx=self::$variable[$p_string];
78 throw new Exception(
"Attribut inexistant $p_string");
84 return var_export(self::$variable,
true);
93 if ( $this->ad_id == 0 )
101 if ( $this->
verify() != 0 )
return;
102 $sql=
'INSERT INTO action_detail('.
103 ' f_id, ad_text, ad_pu, ad_quant, ad_tva_id, ad_tva_amount,'.
104 ' ad_total_amount, ag_id)'.
105 ' VALUES ($1, $2, $3, $4,$5,$6,$7,$8) returning ad_id';
106 $this->ad_id=$this->
db->get_value(
$sql,array(
112 $this->ad_tva_amount,
113 $this->ad_total_amount,
122 if ( $this->
verify() != 0 )
return;
124 $sql=
'UPDATE action_detail '.
125 ' SET f_id=$1, ad_text=$2, ad_pu=$3, ad_quant=$4, ad_tva_id=$5,'.
126 ' ad_tva_amount=$6, ad_total_amount=$7, ag_id=$8'.
128 $this->
id=$this->
db->exec_sql(
$sql,array(
134 $this->ad_tva_amount,
135 $this->ad_total_amount,
149 $sql=
"SELECT ad_id, f_id, ad_text, ad_pu, ad_quant, ad_tva_id, ad_tva_amount,
150 ad_total_amount, ag_id FROM action_detail ".
151 " where ag_id=$1 order by ad_id";
152 $res=$this->
db->get_array(
156 if ( $this->
db->count() == 0 )
return array();
176 $sql=
"SELECT ad_id, f_id, ad_text, ad_pu, ad_quant, ad_tva_id, ad_tva_amount,
177 ad_total_amount, ag_id FROM action_detail".
180 $res=$this->
db->get_array(
184 if ( $this->
db->count() == 0 )
return false;
186 foreach (self::$variable as
$idx)
192 public function delete()
194 $sql=
"delete from action_detail where ad_id=$1";
195 $this->
db->exec_sql(
$sql,array($this->ad_id));
224 $this->f_id=
$tmp->id;
226 $this->ad_text=(isset(
$row[
'e_march'.
$idx.
'_label']))?
$row[
'e_march'.
$idx.
'_label']:
"";
227 $this->ad_pu=(isset(
$row[
'e_march'.
$idx.
'_price']))?
$row[
'e_march'.
$idx.
'_price']:0;
229 $this->ad_tva_id=(isset(
$row[
'e_march'.
$idx.
'_tva_id']))?
$row[
'e_march'.
$idx.
'_tva_id']:0;
230 $this->ad_tva_amount=(isset(
$row[
'e_march'.
$idx.
'_tva_amount']))?
$row[
'e_march'.
$idx.
'_tva_amount']:0;
231 $this->ad_total_amount=(isset(
$row[
'tvac_march'.
$idx]))?
$row[
'tvac_march'.
$idx]:0;
234 if (trim($this->ad_pu)==
"" ||
isNumber($this->ad_pu)==0) $this->ad_pu=0;
235 if (trim($this->ad_quant)==
"" ||
isNumber($this->ad_quant)==0) $this->ad_quant=0;
236 if (trim($this->ad_tva_amount)==
""||
isNumber($this->ad_tva_amount)==0) $this->ad_tva_amount=0;
237 if (trim($this->ad_total_amount)==
""||
isNumber($this->ad_total_amount)==0) $this->ad_total_amount=0;
238 if (trim($this->ad_tva_id)==
"" ||
isNumber($this->ad_tva_id)==0) $this->ad_tva_id=0;
243 $option=$p_follow_up->db->get_value(
"select do_option from document_option "
244 .
" where document_type_id=$1 and do_code='detail_operation'",[$p_follow_up->dt_id]);
246 require NOALYSS_TEMPLATE.
"/follow_up_detail_display.php";
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Follow_Up Details are the details for an actions, it means the details of an order,...
static display(Follow_Up $p_follow_up, $p_view)
set_parameter($p_string, $p_value)
__construct($p_cn, $p_id=0)
load()
load the todo_list row thanks it's ID
from_array($array, $idx)
Fill an Action_Detail Object with the data contained in an array.
load_all()
retrieve all the details of an Follow_Up
class_action for manipulating actions action can be :