65 $this->
cn=Dossier::connect();
69 $this->inject_col=
null;
89 if (! in_array(
$type, [
"ALL",
"VEN",
"ACH",
"ODS",
"FIN"]))
120 $bledger_param=json_encode(array(
121 'dossier'=>Dossier::id(),
123 'all_type'=>$this->all,
129 $bledger->label=
_(
"choix des journaux");
130 $bledger->javascript=
" show_ledger_choice($bledger_param)";
131 $f_ledger=$bledger->input();
133 if (isset(
$_REQUEST[$this->div.
'nb_jrn']))
135 for ($i=0; $i<$_REQUEST[$this->div.
'nb_jrn']; $i++)
137 if (isset($_REQUEST[$this->div.
"r_jrn"][$i]))
138 $hid_jrn.=HtmlInput::hidden($this->div.
'r_jrn['.$i.
']',
139 $_REQUEST[$this->div.
"r_jrn"][$i]);
141 $hid_jrn.=HtmlInput::hidden($this->div.
'nb_jrn',
145 $hid_jrn=HtmlInput::hidden($this->div.
'nb_jrn', 0);
148 $period=
$g_user->get_periode();
149 $per=
new Periode($this->
cn, $period);
158 $f_date_start=
new IDate(
'date_start',
'', $this->div.
"date_start");
164 $f_date_end=
new IDate(
'date_end',
'', $this->div.
"date_end");
170 $f_date_paid_start=
new IDate(
'date_paid_start',
'',
171 $this->div.
"date_paid_start");
172 $f_date_paid_end=
new IDate(
'date_paid_end',
'',
173 $this->div.
"date_paid_end");
175 $f_date_paid_start->value=
$http->request(
"date_paid_start",
"string",
"");
176 $f_date_paid_end->value=
$http->request(
"date_paid_end",
"string",
"");
179 $f_descript=
new IText(
'desc',
"", $this->div.
"desc");
180 $f_descript->size=40;
181 $f_descript->value=
$http->request(
'desc',
"string",
"");
184 $f_amount_min=
new INum(
'amount_min',
'0', $this->div.
"amount_min");
185 $f_amount_min->value=
$http->request(
"amount_min",
"string",0);
186 $f_amount_max=
new INum(
'amount_max',
'0', $this->div.
"amount_max");
187 $f_amount_max->value=
$http->request(
"amount_max",
"string",0);
191 $f_qcode=
new ICard($this->div.
'qcode');
193 $f_qcode->set_attribute(
'typecard',
'all');
198 $f_qcode->set_dblclick(
"fill_ipopcard(this);");
201 $f_qcode->set_function(
'fill_data');
202 $f_qcode->javascript=sprintf(
' onchange="fill_data_onchange(%s);" ',
204 $f_qcode->value=
$http->request($this->div.
'qcode',
"string",
"");
205 $f_qcode->setAfter_clean(
"");
211 $f_accounting=
new IPoste(
'accounting',
"", $this->div.
"accounting");
212 $f_accounting->value=
$http->request(
'accounting',
"string",
"");
219 $f_accounting->set_attribute(
'jrn', 0);
220 $f_accounting->set_attribute(
'ipopup',
'ipop_account');
221 $f_accounting->set_attribute(
'label',
'ld');
222 $f_accounting->set_attribute(
'account', $this->div.
'accounting');
226 $f_paid=
new ISelect(
'operation_filter',
null, $this->div.
'operation_filter');
227 $f_paid->value=array([
"value"=>
'all',
"label"=>
_(
"Toutes")],
228 [
"value"=>
'unpaid',
"label"=>
_(
"Non payées")],
229 [
"value"=>
'paid',
"label"=>
_(
"Payées")]
231 $f_paid->selected=
$http->request(
"operation_filter",
"string",
"all");
233 $r.=dossier::hidden();
235 $this->div.
"ledger_type");
242 if (isset(
$_REQUEST[
'single_operation']))
248 $currency_id=
$http->request(
"p_currency_code",
"string",-1);
249 $acc_currency=
new Acc_Currency($this->
cn);
251 $sCurrency=$acc_currency->select_currency();
252 $sCurrency->id=$this->div.
"p_currency_code";
253 $sCurrency->value[]=array(
"label"=>
_(
"Toutes"),
"value"=>-1);
254 $sCurrency->selected=$currency_id;
255 $tva_id_search=
new ITva_Popup(
"tva_id_search",
256 $http->request(
"tva_id_search",
"string",
null),
257 $this->div.
"tva_id_search");
260 require_once NOALYSS_TEMPLATE.
'/ledger_search.php';
261 $r.=ob_get_contents();
277 $json=json_encode([
"div"=>$this->div,
"ledger_type"=>$this->
type,
"all_type"=>$this->all,
278 "dossier"=>Dossier::id()]);
280 $r=sprintf(
'manage_search_filter(%s)',
$json);
290 $name->placeholder=
_(
"Nom de la recherche");
292 $bt=
new IButton($this->div.
"save_ok",
_(
"Ajout"));
293 $bt->javascript=sprintf(
"save_filter('%s','%s')",$this->div,Dossier::id());
328 select distinct jr_id
330 join jrnx on (jr_grpt_id=j_grpt)
332 exists(select 1 from operation_analytique where j_id=jrnx.j_id) )
335 substr(jr_comment,1,60) as jr_comment,
336 to_char(jr_ech,'DD.MM.YY') as str_jr_ech,
337 to_char(jr_date,'DD.MM.YY') as str_jr_date,
338 jr_date as jr_date_order,
353 (select string_agg(a,' ')
354 from (select '<span style=\"font-size:80%\" class=\"tagcell tagcell-color'||t.t_color::text||'\">'||t_tag||'</span>' a
355 from operation_tag ot join tags t on(ot.tag_id=t.t_id)
356 where ot.jrn_id=X.jr_id
361 when jrn_def_type='VEN' then
362 (select ad_value from fiche_detail where ad_id=1
363 and f_id=(select max(qs_client) from quant_sold join jrnx
364 using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt)
365 where e.jr_id=x.jr_id))
366 when jrn_def_type = 'ACH' then
370 and f_id=(select max(qp_supplier) from quant_purchase
371 join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
372 when jrn_def_type = 'FIN' then
373 (select ad_value from fiche_detail where ad_id=1
374 and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
377 when jrn_def_type='VEN' then
378 (select ad_value from fiche_detail
380 and f_id=(select max(qs_client)
382 join jrnx using (j_id)
383 join jrn as e on (e.jr_grpt_id=j_grpt)
384 where e.jr_id=x.jr_id))
385 when jrn_def_type = 'ACH' then (select ad_value
388 and f_id=(select max(qp_supplier)
390 join jrnx using (j_id)
391 join jrn as e on (e.jr_grpt_id=j_grpt)
392 where e.jr_id=x.jr_id))
393 when jrn_def_type = 'FIN' then (select ad_value
396 and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
399 when jrn_def_type='VEN' then
403 and f_id=(select max(qs_client)
405 join jrnx using (j_id)
406 join jrn as e on (e.jr_grpt_id=j_grpt)
407 where e.jr_id=x.jr_id))
408 when jrn_def_type = 'ACH' then (select ad_value
411 and f_id=(select max(qp_supplier)
413 join jrnx using (j_id)
414 join jrn as e on (e.jr_grpt_id=j_grpt)
415 where e.jr_id=x.jr_id))
416 when jrn_def_type = 'FIN' then (select ad_value
419 and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
422 when jrn_def_type='VEN' then
423 (select sum(qs_price)+sum(vat) from
424 (select qs_internal,qs_price,case when qs_vat_sided<>0 then 0
425 else qs_vat end as vat
427 where qs_internal=X.jr_internal) as ven_invoice
429 when jrn_def_type = 'ACH' then
430 (select sum(qp_price)+sum(vat)+sum(qp_nd_tva)+sum(qp_nd_tva_recup)
432 (select qp_internal,qp_price,qp_nd_tva,qp_nd_tva_recup,qp_vat-qp_vat_sided as vat
434 where qp_internal=X.jr_internal) as invoice_purchase
438 coalesce( case when jrn_def_type='VEN' then
439 (select sum(case when j102.j_debit is true then 0-j102.J_montant else j102.j_montant end)
440 from jrnx j102 join jrn_tax using(j_id) where j102.j_grpt =X.jr_grpt_id)
441 when jrn_def_type='ACH' then
442 (select sum(case when j103.j_debit is false then 0-j103.J_montant else j103.j_montant end)
443 from jrnx j103 join jrn_tax using(j_id) where j103.j_grpt =X.jr_grpt_id)
445 0 end ,0) ) as total_invoice,
447 to_char(jr_date_paid,'DD.MM.YY') as str_jr_date_paid,
448 cas.jr_id as analytic_op,
450 (select cr_code_iso from currency c where c.id=x.currency_id) cr_code_iso,
454 left join jrn_note using(jr_id)
455 left join cas using( jr_id)
456 join jrn_def on jrn_def_id=jr_def_id
457 join parm_periode on p_id=jr_tech_per
466 $r_jrn=$p_array[$op.
"r_jrn"];
470 $r_jrn=(isset($r_jrn))?$r_jrn:-1;
503 $fil_hide_operation=
'';
542 $fil_ledger=
' jrn_def_id in ('.$fil_ledger.
')';
556 $strTag=join(
",", $p_array[$op.
"tag"]);
557 if ($p_array[$op.
"tag_option"] == 1){
559 $fil_tag=$and.
' jr_id in (select jrn_id from operation_tag where tag_id in ('.sql_string($strTag).
')) ';
562 $aTag=$p_array[$op.
"tag"];
563 $sub_tag=
""; $nb_tag=count($aTag);
565 for ($x=0;$x < $nb_tag;$x++) {
566 $sub_tag =
" tag_id = ".sql_string($aTag[$x]);
567 $fil_tag=$and.
' jr_id in (select jrn_id from operation_tag where '.$sub_tag.
')' ;
574 $amount_min=abs(
toNumber($amount_min));
575 $amount_max=abs(
toNumber($amount_max));
576 if ($amount_min>0&&
isNumber($amount_min))
578 $fil_amount=$and.
' jr_montant >='.$amount_min;
581 if ($amount_max>0&&
isNumber($amount_max))
583 $fil_amount.=$and.
' jr_montant <='.$amount_max;
593 bccomp($amount_min, $amount_max, 2)==0)
595 $fil_amount=$and.
' ( ';
598 $fil_amount.=
'jr_grpt_id in ( select distinct j_grpt from jrnx where j_montant = '.$amount_min.
') ';
602 $fil_amount.=
' jr_montant = '.$amount_min;
610 $fil_date=$and.
" jr_date >= to_date('".
$date_start.
"','DD.MM.YYYY')";
615 $fil_date.=$and.
" jr_date <= to_date('".
$date_end.
"','DD.MM.YYYY')";
619 if (isset($date_paid_start)&&
isDate($date_paid_start)!=
null)
621 $fil_date_paid=$and.
" jr_date_paid >= to_date('".$date_paid_start.
"','DD.MM.YYYY')";
624 if (isset($date_paid_end)&&
isDate($date_paid_end)!=
null)
626 $fil_date_paid.=$and.
" jr_date_paid <= to_date('".$date_paid_end.
"','DD.MM.YYYY')";
633 $fil_desc=$and.
" ( upper(jr_comment) like upper('%".
$desc.
"%') or upper(jr_pj_number) like upper('%".
$desc.
"%') ".
634 " or upper(jr_internal) like upper('%".$desc.
"%')
635 or jr_grpt_id in (select j_grpt from jrnx where j_text ilike '%".
$desc.
"%')
636 or jr_id in (select jr_id from jrn_info where ji_value is not null and ji_value ilike '%$desc%')
637 or jr_id in (select jr_id from jrn_note where upper(n_text) ilike '%$desc%' )
644 $fil_account=$and.
" jr_grpt_id in (select j_grpt
652 $fil_qcode=$and.
" jr_grpt_id in ( select j_grpt from
658 if ( isset($operation_filter)) {
659 switch ($operation_filter) {
661 $fil_paid=$and.
"(jr_rapt is null or jr_rapt = '') and jr_valid = true ";
668 $fil_paid=$and.
"(coalesce(jr_rapt,'') != '' or jr_rapt = 'paid') and jr_valid = true ";
672 throw new Exception(
_(
"ALS01 Etat inconnu"),10);
686 $fil_sec=$and.
" jr_def_id in ( select uj_jrn_id ".
687 " from user_sec_jrn where ".
688 " uj_login='".sql_string($_SESSION[SESSION_KEY.
'g_user']).
"'".
689 " and uj_priv in ('R','W'))";
692 if ( isset($p_currency_code) && $p_currency_code !=-1) {
693 $fil_currency=$and.
" x.currency_id = ".
sql_string($p_currency_code);
697 if ( isset($tva_id_search) && ! empty (trim($tva_id_search??
"")))
700 if ($acc_tva->tva_id != -1 )
702 $fil_vat = $and.
" jr_internal in
703 ( select distinct qp_internal
705 where qp_vat_code=".
sql_string($acc_tva->tva_id ).
707 select distinct qs_internal
709 where qs_vat_code=".sql_string($acc_tva->tva_id ).
")";
713 $where=$fil_ledger.$fil_amount.$fil_date.$fil_desc.$fil_sec.
714 $fil_qcode.$fil_paid.$fil_account.$fil_date_paid.$fil_hide_operation.$fil_tag.$fil_currency.$fil_vat;
716 $sql.=
" where ".$where;
719 return array(
$sql, $where);
733 $r.=
'<div id="search_form" style="display:none">';
734 $r.=HtmlInput::title_box(
_(
'Recherche'),
"search_form",
"hide",
"",
"n");
735 $r.=
'<FORM METHOD="GET" >';
738 $r.=HtmlInput::submit(
'search',
_(
'Rechercher'));
746 $r.=HtmlInput::hidden(
'ac',
$http->request(
'ac'));
751 $r.=HtmlInput::hidden(
"sa",
$http->request(
'sa'));
753 $r.=HtmlInput::hidden(
"sb",
$http->request(
'sb'));
755 $r.=HtmlInput::hidden(
"sc",
$http->request(
'sc'));
757 $r.=HtmlInput::hidden(
"f_id",
$http->request(
'f_id'));
762 $r.=HtmlInput::button_hide(
"search_form");
767 $button->label=
_(
"Chercher");
768 $button->javascript=
"toggleHideShow('search_form','tfs');";
769 $r.=$button->input();
838 $limit=($_SESSION[SESSION_KEY.
'g_pagesize']!=-1)?
" LIMIT ".$_SESSION[SESSION_KEY.
'g_pagesize']:
"";
840 $order=
" order by jr_date_order asc,jr_internal asc";
845 'order by jr_date asc,substring(jr_pj_number,\'[0-9]+$\')::numeric asc',
846 'order by jr_date desc,substring(jr_pj_number,\'[0-9]+$\')::numeric desc',
848 $table->add(
_(
'Echeance'),
$url,
" order by jr_ech asc",
849 " order by jr_ech desc",
'ea',
'ed');
850 $table->add(
_(
'Paiement'),
$url,
" order by jr_date_paid asc",
851 " order by jr_date_paid desc",
'eap',
'edp');
853 ' order by substring(jr_pj_number,\'[0-9]+$\')::numeric asc ',
854 ' order by substring(jr_pj_number,\'[0-9]+$\')::numeric desc ',
856 $table->add(
_(
'Tiers'),
$url,
" order by name asc",
857 " order by name desc",
'na',
'nd');
858 $table->add(
_(
'Montant'),
$url,
" order by jr_montant asc",
859 " order by jr_montant desc",
"ma",
"md");
860 $table->add(
_(
"Description"),
$url,
"order by jr_comment asc",
861 "order by jr_comment desc",
"ca",
"cd");
883 return array(0,
_(
"Aucun enregistrement trouvé"));
886 $r.=
'<table class="result" id="history_operation_t">';
890 $r.=
'<th>'.$table->get_header(0).
'</th>';
893 $r.=
'<th>'.$table->get_header(1).
'</td>';
897 $r.=
'<th>'.$table->get_header(2).
'</th>';
899 $r.=
'<th>'.$table->get_header(3).
'</th>';
901 if ( $this->
type !=
"ODS")
903 $r.=
'<th>'.$table->get_header(4).
'</th>';
905 $r.=
"<th>"._(
"n° interne").
"</th>";
906 $r.=
'<th>'.$table->get_header(6).
'</th>';
907 $r.=
th(
'Notes',
' style="width:15%"');
908 $r.=
'<th>'.$table->get_header(5).
'</th>';
912 $r.=
"<th> "._(
'Payé').
"</th>";
914 $r.=
"<th>"._(
'Concerne').
"</th>";
915 $r.=
"<th>"._(
'Document').
"</th>";
916 if ( $this->inject_col !=
null)
918 $r.=call_user_func($this->inject_col,
"header");
932 $tr=
'<TR class="odd">';
936 $tr=
'<TR class="even">';
951 $r.=
$row[
'str_jr_date_paid'];
964 if ($this->
type !=
'ODS')
967 $other=(
$row[
'quick_code']!=
'')?HtmlInput::card_detail(
$row[
'quick_code'],
h(
$row[
'name'].
' '.
$row[
'first_name'])):
'';
973 $r.=sprintf(
'<A class="detail" style="text-decoration:underline" HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>',
979 $tmp_jr_comment=
h(
$row[
'jr_comment']).$row[
'tag_operation'];
981 if (
$row[
'analytic_op'] !=
"")
982 $r.=sprintf(
'<span style="float:right;background:black;color:white;">∋</span>');
986 $r.=
'<span id="als_note'.$row[
'jr_id'].
'" class="font-small">';
987 $r.= substr(
$row[
'n_text']??
"",0,120);
998 if (
$row[
'jrn_def_type']==
'FIN')
1000 $positive=$this->
cn->get_value(
"select qf_amount from quant_fin where jr_id=$1",
1001 array(
$row[
'jr_id']));
1002 if ($this->
cn->count()!=0)
1004 $positive=($positive<0)?1:0;
1007 $r.=
"<TD align=\"right\">";
1008 $t_amount=
$row[
'jr_montant'];
1009 if (
$row[
'total_invoice']!=
null&&
$row[
'total_invoice']!=
$row[
'jr_montant'])
1010 $t_amount=
$row[
'total_invoice'];
1011 $tot=($positive!=0)?bcsub(
$tot, $t_amount):bcadd(
$tot, $t_amount);
1013 if (
$row [
'jrn_def_type']==
'FIN')
1015 $r.=( $positive!=0 )?
"<font color=\"red\"> - ".
nbm($t_amount).
"</font>":
nbm($t_amount);
1019 $r.=( $t_amount<0 )?
"<font color=\"red\"> ".
nbm($t_amount).
"</font>":
nbm($t_amount);
1028 $w->set_range(
"paid_operation_ck");
1029 $w->name=
"rd_paid".$row[
'jr_id'];
1030 $w->selected=(
$row[
'jr_rapt']==
'paid')?
true:
false;
1032 $w->readonly=( $p_paid==2)?
true:
false;
1033 $w->javascript=
'onclick="operation_payment.check_item(this)"';
1035 $h->name=
"set_jr_id".$row[
'jr_id'];
1036 $r.=
'<TD>'.$w->input().$h->input().
'</TD>';
1037 if (
$row[
'jr_rapt']==
'paid')
1039 $amount_paid=bcadd($amount_paid, $t_amount);
1043 $amount_unpaid=bcadd($amount_unpaid, $t_amount);
1049 $rec->set_jr_id(
$row[
'jr_id']);
1055 foreach (
$a as $key=> $element)
1059 $l_amount=$this->
cn->get_value(
"select jr_montant from jrn ".
1060 " where jr_id=$1", array($element));
1061 $r.=
"<A class=\"detail\" HREF=\"javascript:modifyOperation('".$element.
"',".
$gDossier.
")\" > ".
$operation->get_internal().
"[".
nbm($l_amount).
"]</A>";
1066 if (
$row[
'jr_valid']==
'f')
1068 $r.=
"<TD>"._(
"Opération annulée").
"</TD>";
1075 if (
$row[
'jr_pj_name']!=
"")
1077 $r.=
'<td>'.HtmlInput::show_receipt_document(
$row[
'jr_id']).
'</td>';
1085 if ( $this->inject_col !=
null)
1087 $r.=call_user_func($this->inject_col,
$row);
1092 $amount_paid=round($amount_paid, 4);
1093 $amount_unpaid=round($amount_unpaid, 4);
1096 $r.=
'<TD COLSPAN="5">Total</TD>';
1098 $r.=
'<TD ALIGN="RIGHT">'.nbm(
$tot).
"</TD>";
1103 $r.=
'<TD COLSPAN="5">'._(
"Payé").
'</TD>';
1104 $r.=
td(
"").td(
"").td(
"").td(
'');
1105 $r.=
'<TD ALIGN="RIGHT">'.nbm($amount_paid).
"</TD>";
1109 $r.=
'<TD COLSPAN="5">'._(
"Non payé").
'</TD>';
1110 $r.=
td(
"").td(
"").td(
"").td(
'');
1111 $r.=
'<TD ALIGN="RIGHT">'.nbm($amount_unpaid).
"</TD>";
1153 $limit=
" LIMIT ".MAX_RECONCILE;
1158 $sql.=
" order by jr_date asc ".$limit;
1172 return array(0,
_(
"Aucun enregistrement trouvé"));
1173 $r.=HtmlInput::hidden(
"target", $p_target);
1174 $r.=
'<table class="result">';
1178 $r.=
"<th>"._(
"Selection").
"</th>";
1179 $r.=
"<th>"._(
"Internal").
"</th>";
1181 if ($this->
type==
'ALL')
1183 $r.=
th(
_(
'Journal'));
1186 $r.=
'<th>'._(
"Date").
'</th>';
1187 $r.=
'<th>'._(
"Pièce").
'</td>';
1189 $r.=
'<th>'._(
"Description").
'</th>';
1190 $r.=
th(
_(
'Notes'),
' ');
1191 $r.=
'<th>'._(
"Montant").
'</th>';
1192 $r.=
"<th>"._(
'Concerne').
"</th>";
1205 $tr=
'<TR class="odd">';
1207 $tr=
'<TR class="even">';
1212 $r.=
'<td><INPUT TYPE="CHECKBOX" name="jr_concerned'.$row[
'jr_id'].
'" ID="jr_concerned'.
$row[
'jr_id'].
'" value="'.
$row[
'quick_code'].
'"> </td>';
1219 $href=basename($_SERVER[
'PHP_SELF']);
1222 $r.=sprintf(
'<A class="detail" style="text-decoration:underline" HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>',
1225 if ($this->
type==
'ALL')
1234 $r.=
$row[
'jr_pj_number'];
1242 $tmp_jr_comment=
h(
$row[
'jr_comment']).$row[
'tag_operation'];
1243 $r.=$tmp_jr_comment;
1245 $r.=
td(
h(
$row[
'n_text']),
' style="font-size:0.87em"');
1252 if (
$row[
'jrn_def_type']==
'FIN')
1254 $positive=$this->
cn->get_value(
"select qf_amount from quant_fin where jr_id=$1",
1255 array(
$row[
'jr_id']));
1256 if ($this->
cn->count()!=0)
1257 $positive=($positive<0)?1:0;
1259 $r.=
"<TD align=\"right\">";
1261 $r.=( $positive!=0 )?
"<font color=\"red\"> - ".
nbm(
$row[
'total_invoice']).
"</font>":
nbm(
$row[
'total_invoice']);
1268 $rec->set_jr_id(
$row[
'jr_id']);
1274 foreach (
$a as $key=> $element)
1278 $l_amount=$this->
cn->get_value(
"select jr_montant from jrn ".
1279 " where jr_id=$1", array($element));
1280 $r.=
"<A class=\"detail\" HREF=\"javascript:modifyOperation('".$element.
"',".
$gDossier.
")\" > ".
$operation->get_internal().
"[".
nbm($l_amount).
"]</A>";
1285 if (
$row[
'jr_valid']==
'f')
1287 $r.=
"<TD>"._(
"Opération annulée").
"</TD>";
1313 echo
'<div id="div_jrn'.$p_div.
'" >';
1314 echo HtmlInput::title_box(
_(
"Journaux"), $p_div.
"jrn_search");
1315 echo
'<div style="padding:5px">';
1316 echo
'<form method="GET" id="'.$p_div.
'search_frm" onsubmit="return hide_ledger_choice(\''.$p_div.
'search_frm\')">';
1318 echo HtmlInput::hidden(
'nb_jrn',
$nb_array);
1319 echo
_(
'Filtre ').HtmlInput::filter_table($p_div.
'tb_jrn',
'0,1,2', 2);
1320 echo HtmlInput::anchor_action(
_(
'Inverser sel'),
' toggle_checkbox(\''.
"{$p_div}search_frm".
'\')
','sel_
'.$p_div,"nav");
1322 echo HtmlInput::anchor_action(_('Effacer sel
'),' unselect_checkbox(\
''.
"{$p_div}search_frm".
'\')
','unsel_
'.$p_div,"nav");
1324 echo HtmlInput::anchor_action(_('Financier
'),' select_checkbox_attribute(\
''.
"{$p_div}search_frm".
'\',\
'ledger_type\',\'FIN\') ',
'selfin_'.$p_div,
"nav");
1326 echo HtmlInput::anchor_action(
_(
'Vente'),
' select_checkbox_attribute(\''.
"{$p_div}search_frm".
'\',\
'ledger_type\',\'VEN\') ',
'selfven_'.$p_div,
"nav");
1328 echo HtmlInput::anchor_action(
_(
'Achat'),
' select_checkbox_attribute(\''.
"{$p_div}search_frm".
'\',\
'ledger_type\',\'ACH\') ',
'selfach_'.$p_div,
"nav");
1330 echo HtmlInput::anchor_action(
_(
'Op.Diverses'),
' select_checkbox_attribute(\''.
"{$p_div}search_frm".
'\',\
'ledger_type\',\'ODS\') ',
'selfods_'.$p_div,
"nav");
1331 echo
'<table class="result" id="'.$p_div.
'tb_jrn">';
1334 echo
th(
_(
'Description'));
1347 $r->set_attribute(
"ledger_type",
$row[
'jrn_def_type']);
1349 if ( $p_selected !=
null && in_array(
$row[
'jrn_def_id'],$p_selected))
1353 $class=(
$e%2==0)?
' class="even" ':
' class="odd" ';
1354 echo
'<tr '.$class.
'>';
1355 echo
'<td style="white-space: nowrap">'.$r->input().$row[
'jrn_def_name'].
"(".
$row[
'jrn_def_code'].
")".
'</td>';
1356 echo
'<td >'.$row[
'jrn_def_description'].
'</td>';
1357 echo
'<td >'.$row[
'jrn_def_type'].
'</td>';
1362 echo HtmlInput::hidden(
'div',$p_div);
1363 echo HtmlInput::submit(
'save',
_(
'Valider'));
1364 echo HtmlInput::button_close($p_div.
"jrn_search");
1369 $ret=ob_get_contents();
1382 $record=$user_filter_sql->to_array();
1384 $record[
'desc']=$record[
'description'];
1385 $record[
'r_jrn']=explode(
",", $record[
'r_jrn']??
"");
1386 $record[
'tag']=explode(
",",$record[
'uf_tag']??
"");
1387 $record[
'tag_option']=$record[
"uf_tag_option"];
1388 $record[
'p_currency_code']=$record[
'uf_currency_code'];
1401 $button=HtmlInput::button_action(
"Recherches sauvées",
1402 sprintf(
"display_list_filter('%s','%s','%s')"
1404 ,
$http->request(
"ac")
1406 ),uniqid(),
'smallbutton');
1415 require_once NOALYSS_TEMPLATE.
"/acc_ledger_search-display_list_filter.php";
th($p_string, $p_extra='', $raw='')
isDate($p_date)
Verifie qu'une date est bien formaté en d.m.y et est valable.
noalyss_str_replace($search, $replace, $string)
sql_string($p_string)
Fix the problem with the quote char for the database.
td($p_string='', $p_extra='')
surround the string with td
nbm($p_number, $p_dec=2)
format the number with a sep.
global $g_user
if no group available , then stop
catch(Exception $exc) if(! $g_user->can_write_action($ag_id)) $r
h( $row[ 'oa_description'])
if(!headers_sent())
– pour utiliser unoconv démarrer un server libreoffice commande libreoffice –headless –accept="socket...
catch(Exception $e) $exercice
foreach($array as $idx=> $m) $w
_("actif, passif,charge,...")
if(! isset($_GET['submit_query'])) $p_action
$class
Display the Plugin and for each profile were it is installed or not.
build_search_filter()
Build the button for managing the filter for search.
search_form()
return a HTML string with the form for the search
$type
type of ledger : FIN,ODS,VEN,ACH
list_operation($sql, $offset, $p_paid=0)
Show all the operation.
$inject_col
inject_code (callback function ) into list_operation
display_search_form()
return a html string with the search_form
display_list_filter()
display a list of saved search
button_propose_filter()
build an HTML string with a button to show the list of saved search
$all
Flag to indicate if all ledgers must be searched (1 for yes)
build_search_sql($p_array, $p_order="", $p_where="")
this function will create a sql stmt to use to create the list for the ledger,
$div
prefix for id of DOM id
build_name_filter()
Build the button for saving the filter for search.
static build_array(User_Filter_SQL $user_filter_sql)
use a user_filter row and turns it into an array for javascript purpose
__construct($p_type, $p_all=1, $p_div="")
return a HTML string with the form for the search
select_ledger($p_selected, $p_div)
return the html code to create an hidden div and a button to show this DIV.
list_operation_to_reconcile($sql, $p_target)
Show all the operation.
this file match the tables jrn & jrnx the purpose is to remove or save accountant writing to these ta...
new class for managing the reconciliation it must be used instead of the function InsertRapt,...
static build($db, $p_code)
retrieve TVA rate thanks the code that could be the tva_id or tva_code.
static escape_string($p_string)
wrapper for the function pg_escape_string
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
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
Class to manage the company parameter (address, name...)
Description of class_syn_sort_table.
toNumber($p_num)
remove the useless space, change comma by period and try to return a number