20 require_once NOALYSS_INCLUDE.
'/lib/class_database.php';
21 require_once(
'include/class_bank_item.php');
22 require_once(
'bank_constant.php');
25 $cn=Dossier::connect();
34 $id=HtmlInput::default_value_get(
"id", 0);
35 $suggest_id=HtmlInput::default_value_get(
"suggest_id",0);
42 (select ad_value from fiche_detail where ad_id=23 and f_id=a.f_id) as qcode
45 join importbank.suggest_bank as a on (a.jr_id=b.jr_id)
47 a.id=$1", array($suggest_id));
51 update importbank.temp_bank set status='W',tp_rec=$1,f_id=$2
61 $a_json=array(
'tiers'=>HtmlInput::card_detail(
$a_suggest[0][
'qcode']),
63 'status'=>
'<span style=\"color:red;background-color:white\">Attente</span>'
65 echo json_encode($a_json);
67 $a_json=array(
'tiers'=>
"",
71 echo json_encode($a_json);
76 case 'display_suggest':
81 $id=HtmlInput::default_value_get(
"id", 0);
82 $plugin_code=HtmlInput::default_value_get(
'plugin_code',
"");
83 echo HtmlInput::title_box(_(
"Suggestion"),
"display_suggest_box");
87 $bi_sql=
new Temp_Bank_Sql(
$cn,
$id);
90 $other_info=_(
"Autre information");
92 $str_tiers=_(
'Tiers');
96 echo td($bi_sql->tp_date);
100 echo td($bi_sql->tp_third);
104 echo td($bi_sql->libelle);
108 echo td($bi_sql->amount);
112 echo td($other_info);
113 echo td($bi_sql->tp_extra);
125 (select ad_value from fiche_detail where ad_id=23 and f_id=a.f_id) as qcode
128 join importbank.suggest_bank as a on (a.jr_id=b.jr_id)
130 temp_bank_id=$1", array(
$id));
132 echo
"<ul style=\"list-style:none\">";
133 for ($i=0;$i<$nb_asuggest;$i++) {
137 HtmlInput::card_detail(
$a_suggest[$i][
'qcode']).
144 echo
'<p style="text-align:center">';
145 echo HtmlInput::button_close(
"display_suggest_box");
153 require_once
'include/class_import_bank.php';
154 $import_id=HtmlInput::default_value_get(
"import_id", 0);
155 $checked=HtmlInput::default_value_get(
"checked", 0);
156 $status=HtmlInput::default_value_get(
"status", 0);
159 update importbank.temp_bank set is_checked = $2
160 where import_id=$1 $sql",
161 array($import_id,$checked));
168 $id=HtmlInput::default_value_get(
"row_id", 0);
169 $state=HtmlInput::default_value_get(
"state", 0);
170 if (
$id == 0 )
return;
173 $cn->exec_sql(
"update importbank.temp_bank set is_checked = 0 where id= $1 ",
176 $cn->exec_sql(
"update importbank.temp_bank set is_checked = 1 where id= $1 ",
180 case 'display_tiers':
186 $import_id=HtmlInput::default_value_get(
"import_id", 0);
187 $count=
$cn->get_value(
"select count(*) from importbank.temp_bank where "
188 .
" is_checked = 1 and import_id = $1",
190 echo HtmlInput::title_box(_(
"Choix du tiers pour les opérations sélectionnées"),
"select_tiers_div");
191 if ( $import_id == 0 || $count == 0) {
192 echo
'<p class="warning">';
193 echo (_(
"Rien n'est sélectionné"));
196 echo HtmlInput::button(
"cancel", _(
"Fermer"),
197 " onclick=\"removeDiv('select_tiers_div')\"");
202 echo _(
'Nombre de lignes choisies').
" ".$count;
205 $status=HtmlInput::default_value_get(
"status", 0);
206 echo
'<form method="get" id="display_tiers_frm" onsubmit="selected_set_tiers(\'display_tiers_frm\');return false">';
207 echo HtmlInput::array_to_hidden(array(
"ac",
"gDossier",
"import_id",
"plugin_code"), $_GET);
208 echo HtmlInput::hidden(
"sa",
"purge");
209 echo HtmlInput::hidden(
"sb",
"list");
210 echo HtmlInput::hidden(
"id", $import_id);
211 echo HtmlInput::hidden(
"form_action2",
"selected_record");
212 echo HtmlInput::hidden(
"form_action",
"selected_record");
213 echo HtmlInput::hidden(
"select_action",
"1");
214 echo HtmlInput::hidden(
"fil_status", $status);
216 $w->jrn=
$cn->get_value(
"select jrn_def_id from importbank.format_bank as a "
217 .
"join importbank.import as b on (a.id=b.format_bank_id) "
218 .
"where b.id=$1",array($import_id));
219 $w->name=
'fiche1000';
222 $w->set_dblclick(
"fill_ipopcard(this);");
223 $w->set_attribute(
'ipopup',
'ipopcard');
224 $w->set_attribute(
'label',
'e_third');
225 $w->set_attribute(
'typecard',
'deb');
226 $w->set_callback(
'filter_card');
227 $w->set_function(
'fill_data');
228 $w->set_attribute(
'inp',
'fiche');
230 $w->choice=
"choice_suggest";
232 echo HtmlInput::hidden(
'p_jrn',$w->jrn);
236 <span
id=
"e_third"></span>
237 <ul
style=
"list-style: none">
238 <li style=
"display:inline;"><?php echo HtmlInput::submit(
"set_selected", _(
"Confirmer"));?></li>
239 <li style=
"display:inline;"><?php echo HtmlInput::button(
"cancel", _(
"Fermer"),
" onclick=\"removeDiv('select_tiers_div')\"");?></li>
242 <div
id=
"div_suggest" style=
"position:float;float:left;height:30em">
243 <h2><?php echo
"Suggestion";?></h2>
244 <div
id=
"choice_suggest" class=
"autocomplete_fixed" style=
"position: static;height:auto" >
249 <?php echo
'</form>';
269 if ( isset($_GET[
'remove'] ))
271 $msg=
"Opération a effacer";
272 $bi->show_delete(
$ctl);
274 $bi_sql=
new Temp_Bank_Sql(
$cn,
$id);
277 $extra=
'{"id":"'.$id.
'","msg":"<span style=\"color:red\">Effacer</span>"}';
280 else if ( isset($_GET[
'recup'] ))
282 $msg=
"Opération récupérée";
283 $bi_sql=
new Temp_Bank_Sql(
$cn,
$id);
286 $bi->show_item(
$ctl);
287 $extra=
'{"id":"'.$id.
'","msg":"<span style=\"color:red\">Récupérer</span>"}';
292 if (isset($_GET[
'save']))
295 $concerned=HtmlInput::default_value_get(
"e_concerned".
$id, NULL);
298 if ($concerned ==
"" ) $concerned=null;
300 if ($_GET[
'fiche'.
$id] !=
'')
302 $f_id=
$cn->get_value(
'select f_id from fiche_Detail
304 ad_value=upper(trim($1)) and ad_id=23',array($_GET[
'fiche'.
$id]));
306 $msg_json=
'<span style=\"color:red;background-color:white\">Attente</span>';
307 $tiers_json=HtmlInput::card_detail(trim(strtoupper($_GET[
'fiche'.$id])));
308 if ($concerned!=null)
310 $internal=
$cn->get_value(
"select jr_internal from jrn where jr_id=$1",
311 array($_GET[
'e_concerned'.$id]));
314 $concop_json=HtmlInput::detail_op($_GET[
'e_concerned'.$id],
322 $msg_json=
'<span style=\"color:red;background-color:white\">Nouveau</span>';
325 $bi_sql=
new Temp_Bank_Sql(
$cn,
$id);
327 $rec=$_GET[
'e_concerned'.$id];
328 $bi_sql->tp_rec=(trim(
$rec) !=
'')?trim(
$rec):null;
329 $bi_sql->status=$status;
330 $bi_sql->libelle=$_GET[
'libelle'];
331 $bi_sql->amount=$_GET[
'amount'];
332 $bi_sql->tp_extra=$_GET[
'tp_extra'];
333 $bi_sql->tp_third=$_GET[
'tp_third'];
334 $bi_sql->tp_date=$_GET[
'tp_date'];
339 $bi->show_item(
$ctl);
340 $a_extra=array(
"id"=>
$id,
"msg"=>$msg_json,
"tiers"=>$tiers_json,
"concop"=>$concop_json);
341 $extra=json_encode($a_extra);
344 $bi->show_item(
$ctl);
345 $r=ob_get_contents();
350 header(
'Content-type: text/xml; charset=UTF-8');
352 <?xml version=
"1.0" encoding=
"UTF-8"?>
static convert_status_sql($p_param)
Convert the status (0 to 5 to importbank.temp_bank.status which is a letter (N New T Transfered W wai...