25require_once NOALYSS_INCLUDE.
'/constant.php';
42 "ledger_target"=>
"mp_jrn_def_id",
43 "ledger_source"=>
"jrn_def_id",
44 "fiche_def"=>
"mp_fd_id");
67 throw new Exception(
"Attribut inexistant $p_string");
78 throw new Exception(
"Attribut inexistant $p_string");
87 public function load():bool
89 $sql=
'select mp_id,mp_lib,mp_fd_id,mp_jrn_def_id,mp_qcode,jrn_def_id from payment_method '.
100 foreach ($a_index as
$idx)
113 $sql=
'select mp_id,mp_lib '.
114 ' from payment_method order by mp_lib';
135 $sql=
'select mp_id '.
136 ' from payment_method '.
137 ' where jrn_def_id=$1 and mp_jrn_def_id is not null and '.
138 ' (mp_fd_id is not null or mp_qcode is not null)';
159 $lib=
new IText(
'mp_lib');
161 $f_lib=$lib->input();
164 $ledger_source=
new ISelect(
'jrn_def_id');
165 $ledger_source->value=$this->
cn->make_array(
"select jrn_def_id,jrn_Def_name from
166 jrn_def where jrn_def_type in ('ACH','VEN') order by jrn_def_name");
168 $f_source=$ledger_source->input();
171 $tcard=
new ISelect(
'mp_fd_id');
172 $tcard->value=$this->
cn->make_array(
'select fd_id,fd_label from fiche_def join fiche_def_ref '.
173 ' using (frd_id) where frd_id in (25,4) order by fd_label');
176 $f_type_fiche=$tcard->input();
177 $ledger_record=
new ISelect(
'mp_jrn_def_id');
178 $ledger_record->value=$this->
cn->make_array(
"select jrn_def_id,jrn_Def_name from
179 jrn_def where jrn_def_type in ('ODS','FIN')");
180 $ledger_record->selected=$this->mp_jrn_def_id;
181 $f_ledger_record=$ledger_record->input();
187 $list=$this->
cn->make_list(
'select fd_id from fiche_def where frd_id in (25,4)');
189 $qcode->dblclick=
'fill_ipopcard(this);';
194 $msg=
"Modification de ".$this->mp_lib;
196 require_once NOALYSS_TEMPLATE.
'/new_mod_payment.php';
197 $r=ob_get_contents();
218 if ( empty(
$array)==
false ) {
219 $date_pay=
new IDate(
'mp_date');
221 $r.=sprintf(_(
"Date %s"),
225 $r.=_(
" Acompte à déduire");
228 $e_comm_paiement=
new IText(
'e_comm_paiement');
229 $e_comm_paiement->value=$p_comm;
230 $e_comm_paiement->table = 0;
231 $e_comm_paiement->setReadOnly(
false);
232 $e_comm_paiement->size = 60;
233 $e_comm_paiement->tabindex = 3;
234 $r.=_(
" Libellé du paiement");
235 $r.=$e_comm_paiement->input();
240 $r.=
'<li ><input type="radio" name="e_mp" value="0" checked>'._(
'Paiement encodé plus tard');
242 if ( empty(
$array ) ==
false )
249 if (
$row->mp_qcode==NULL)
252 $a->jrn=
$row->mp_jrn_def_id;
253 $a->set_attribute(
'typecard',
$row->mp_fd_id);
254 $a->name=
'e_mp_qcode_'.$row->mp_id;
255 $a->set_dblclick(
"fill_ipopcard(this);");
256 $a->set_callback(
'filter_card');
257 $a->set_function(
'fill_data');
258 $a->set_attribute(
'ipopup',
'ipopcard');
259 $a->set_attribute(
'label',
$a->name.
'_label');
260 if ( $p_select ==
$row->mp_id ) {
261 $a->value=
$http->request(
"e_mp_qcode_".$p_select,
"string",
"");
264 $s->name=
$a->name.
'_label';
265 $f=_(
" paiement par ").$a->input().$s->input().$a->search();
274 $fiche->get_by_qcode($row->mp_qcode);
279 $check=( $p_select ==
$row->mp_id)?
" checked " :
"unchecked";
280 $r.=
'<li><input type="radio" name="e_mp" value="'.$row->mp_id.
'" '.
$check.
'>';
296 foreach ($a_index as
$l) {
306 $lib=
new IText(
'mp_lib');
307 $f_lib=$lib->input();
309 $ledger_source=
new ISelect(
'jrn_def_id');
310 $ledger_source->value=$this->
cn->make_array(
"select jrn_def_id,jrn_Def_name from
311 jrn_def where jrn_def_type in ('ACH','VEN') order by jrn_def_name");
312 $f_source=$ledger_source->input();
315 $tcard=
new ISelect(
'mp_fd_id');
316 $tcard->value=$this->
cn->make_array(
'select fd_id,fd_label from fiche_def join fiche_def_ref '.
317 ' using (frd_id) where frd_id in (25,4) order by fd_label');
318 $f_type_fiche=$tcard->input();
319 $ledger_record=
new ISelect(
'mp_jrn_def_id');
320 $ledger_record->value=$this->
cn->make_array(
"select jrn_def_id,jrn_Def_name from
321 jrn_def where jrn_def_type in ('ODS','FIN')");
322 $f_ledger_record=$ledger_record->input();
328 $list=$this->
cn->make_list(
'select fd_id from fiche_def where frd_id in (25,4)');
330 $qcode->dblclick=
'fill_ipopcard(this);';
333 $msg=
"Ajout d'un nouveau moyen de paiement";
335 require_once NOALYSS_TEMPLATE.
'/new_mod_payment.php';
336 $r=ob_get_contents();
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
Handle the table payment_method.
from_array($p_array)
convert an array into an Acc_Payment object
form()
return a string with a form (into a table)
set_parameter($p_string, $p_value)
blank()
return an html with a form to add a new middle of payment
__construct($p_cn, $p_init=0)
get_valide()
retrieve all the data for a ledger but filter on the valid record (jrn and fd not null
select($p_select, $p_amount, $p_date, $p_comm)
show several lines with radio button to select the payment method we want to use, the $_POST['e_mp'] ...
get_all()
retrieve all the data for all ledgers
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Input HTML for the card show buttons, in the file, you have to add card.js How to use :
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
This class handles only the numeric input, the input will call a javascript to change comma to period...
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...