25 require_once NOALYSS_INCLUDE.
'/class/class_pre_operation.php';
35 parent::__construct(
$cn);
36 $this->operation->od_direct=
't';
42 extract(
$_POST, EXTR_SKIP);
44 for ($i=0;$i<$this->operation->nb_item;$i++)
53 $this->{
'poste'.$i}=
$poste;
54 $this->{
'isqc'.$i}=
'f';
58 $this->{
'isqc'.$i}=(
trim(
$_POST[
'qc_'.$i]) !=
"")?
't':
'f';
61 $this->{
"amount".$i}=
$_POST[
'amount'.$i];
62 $this->{
"ck".$i}=(isset(
$_POST[
'ck'.$i]))?
't':
'f';
74 if ($this->operation->save() ==
false )
78 for ($i=0;$i<$this->operation->nb_item;$i++)
80 if ( ! isset ($this->{
"poste".$i}))
83 $sql=sprintf(
'insert into op_predef_detail (opd_poste,opd_amount,'.
84 'opd_debit,od_id,opd_qc)'.
86 "('%s',%.2f,'%s',%d,'%s')",
90 $this->operation->od_id,
102 echo ($e->getMessage());
103 $this->
db->rollback();
112 $a_op=$this->operation->load();
113 $array=$this->operation->compute_array($a_op);
116 if (empty(
$p_array))
return array();
119 $tmp_array=array(
"qc_".
$count=>
'',
121 "amount".
$count=>$row[
'opd_amount'],
122 'ck'.
$count=>$row[
'opd_debit']
125 if ( $row[
'opd_qc'] ==
't' )
126 $tmp_array[
'qc_'.$count]=$row[
'opd_poste'];
128 $tmp_array[
'poste'.$count]=$row[
'opd_poste'];
131 if ( $row[
'opd_debit'] ==
'f' )
132 unset ($tmp_array[
'ck'.
$count]);
146 $sql=
"select opd_id,opd_poste,opd_amount,opd_debit,".
147 " opd_qc from op_predef_detail where od_id=".$this->operation->od_id.
155 $this->operation->od_id=
$p_id;
160 require_once NOALYSS_INCLUDE.
'/class/class_acc_ledger.php';
162 $legder->nb=$legder->get_min_row();
169 if ($g_user->check_action(
FICADD) == 1)
172 $f_add_button =
new IButton(
'add_card');
173 $f_add_button->label = _(
'Créer une nouvelle fiche');
174 $f_add_button->set_attribute(
'ipopup',
'ipop_newcard');
175 $f_add_button->set_attribute(
'jrn', $legder->id);
176 $f_add_button->javascript =
" this.jrn=\$('p_jrn').value;select_card_type(this);";
177 $f_add_button->input();
180 $nb_row = (isset($nb_item) ) ? $nb_item : $legder->nb;
184 $ret.=dossier::hidden();
186 $ret.=dossier::hidden();
191 if ($g_user->check_action(
FICADD) == 1)
192 $ret.=$f_add_button->input();
193 $ret.=
'<table id="quick_item" style="width:100%">';
195 '<th style="text-align:left">Quickcode' . $info .
'</th>' .
196 '<th style="text-align:left">' . _(
'Poste') . $info_poste .
'</th>' .
197 '<th style="text-align:left">' . _(
'Libellé') .
'</th>' .
198 '<th style="text-align:left">' . _(
'Montant') .
'</th>' .
199 '<th style="text-align:left">' . _(
'Débit') .
'</th>' .
203 for ($i = 0; $i <
$nb_row; $i++)
223 $quick_code->value = (isset(${
'qc_' . $i})) ? ${
'qc_' . $i} :
"";
236 $poste->name =
'poste' . $i;
237 $poste->set_attribute(
'jrn', $legder->id);
238 $poste->set_attribute(
'ipopup',
'ipop_account');
239 $poste->set_attribute(
'label',
'ld' . $i);
240 $poste->set_attribute(
'account',
'poste' . $i);
243 $poste->value = (isset(${
'poste' . $i})) ? ${
"poste" . $i} :
''
245 $poste->dbl_click_history();
251 $Poste->set_parameter(
'value',
$poste->value);
252 $label = $Poste->get_lib();
256 $line_desc =
new IText();
257 $line_desc->name =
'ld' . $i;
258 $line_desc->size = 30;
259 $line_desc->value = (isset(${
"ld" . $i})) ? ${
"ld" . $i} :
266 $amount->value = (isset(${
'amount' . $i})) ? ${
"amount" . $i} :
''
268 $amount->javascript =
' onChange="format_number(this);checkTotalDirect()"';
271 $deb->name =
'ck' . $i;
272 $deb->selected = (isset(${
'ck' . $i})) ?
true :
false;
273 $deb->javascript =
' onChange="checkTotalDirect()"';
278 '<script> document.getElementById(\'poste' . $i .
'\').onblur=
function(){
if (
trim(this.
value) !=\
'\') {
document.getElementById(\
'qc_' . $i .
'\').value=
"";}}</script>
' .
280 $ret.='<
td>
' . $line_desc->input() . '</
td>
';
281 $ret.='<
td>
' . $amount->input() . '</
td>
';
282 $ret.='<
td>
' . $deb->input() . '</
td>
';
284 // If readonly == 1 then show CA
static fetch_all($ret)
wrapper for the function pg_fetch_all
td($p_string='', $p_extra='')
surround the string with td
Manage the account from the table tmp_pcmn.
show a button, for selecting a account and a input text for manually inserting an account the differe...
save()
save the detail and op in the database
load()
load the data from the database and return an array
compute_array()
compute an array accordingly with the FormVenView function
if(!isset($_REQUEST['act'])||!isset($_REQUEST['jr_id'])||!isset($_REQUEST['div'])) global $g_parameter
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
for($i=0;$i<$nb_jrn;$i++) $deb
global $g_user
Find the default module or the first one.
Class for jrn, class acc_ledger for manipulating the ledger.
function trim(s)
remove trailing and heading space
mother of the pre_op_XXX, it contains only one data : an object Pre_Operation. The child class contai...
static id()
return the $_REQUEST['gDossier'] after a check
Input HTML for the card show buttons, in the file, you have to add card.js How to use : ...
tr($p_string, $p_extra='')
concerns the predefined operation for the operation from 'Ecriture direct'
This class handles only the numeric input, the input will call a javascript to change comma to period...