59 $this->
name = $p_name;
61 $this->in_table =
false;
62 $this->
value = $p_value;
64 $this->filter =
'none';
76 public function input($p_name =
null, $p_value =
null)
78 $this->
name = ($p_name ==
null) ? $this->
name : $p_name;
79 $this->
value = ($p_value ==
null) ? $this->
value : $p_value;
80 $this->
js = (isset($this->
js)) ? $this->
js :
'';
81 $this->
id = ($this->
id ==
"") ? $this->
name : $this->
id;
90 if (isset($this->code)) {
91 if ($this->
cn != NULL) {
94 $this->code->value = $this->
cn->get_value(
'select tva_label from tva_rate where tva_id=$1',
95 array($this->
value));;
98 $code = $this->code->input();
104 $str =
'<input type="TEXT" class="input_text" name="%s" value="%s" id="%s" placeholder="%s" size="3" %s %s>';
105 $r = sprintf(
$str, $this->
name, $this->
value, $this->
id, _(
"C.TVA"),$this->
js, $strAttribut);
110 if ($this->
button ==
true && !$this->in_table)
113 if ($this->
button ==
true && $this->in_table)
143 if (trim($this->
name) ==
'')
throw new Exception (_(
'Le nom ne peut ĂȘtre vide'));
144 $this->
id = ($this->
id ==
"") ? $this->
name : $this->
id;
148 $bt->tabindex =
"-1";
149 $bt->label = _(
' TVA ');
151 $bt->set_attribute(
'ctl', $this->
id);
152 $bt->set_attribute(
'popup',
'popup_tva');
153 if (isset($this->code))
154 $bt->set_attribute(
'jcode', $this->code->name);
155 if (isset($this->compute))
156 $bt->set_attribute(
'compute', $this->compute);
157 $bt->set_attribute(
"filter", $this->filter);
158 $bt->javascript = (isset($this->but_javascript)) ? $this->but_javascript :
'popup_select_tva(this)';
169 $comment = ($tva->load() !=
"-1") ? $tva->tva_label :
"";
170 $res = sprintf(
'<input type="text" name="%s" size="6" class="input_text_ro" value="%s" id="%s" readonly="">%s', $this->
name, $this->
value, $this->
name, $comment);
182 $this->code =
new ISpan($p_code);
188 $a->set_title(
'Choix de la tva');
191 $tva->with_button(
true);
193 $tva->add_label(
'code');
194 $tva->js =
'onchange="set_tva_label(this);"';
196 echo $tva->dbutton();
td($p_string='', $p_extra='')
surround the string with td
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
Acc_Tva is used for to map the table tva_rate parameter are.