59 $this->
cn=Dossier::connect();
82 if (! in_array(
$type, [
"ALL",
"VEN",
"ACH",
"ODS",
"FIN"]))
114 $bledger_param=json_encode(array(
115 'dossier'=>Dossier::id(),
117 'all_type'=>$this->all,
123 $bledger->label=
_(
"choix des journaux");
124 $bledger->javascript=
" show_ledger_choice($bledger_param)";
125 $f_ledger=$bledger->input();
127 if (isset(
$_REQUEST[$this->div.
'nb_jrn']))
129 for ($i=0; $i<$_REQUEST[$this->div.
'nb_jrn']; $i++)
131 if (isset($_REQUEST[$this->div.
"r_jrn"][$i]))
132 $hid_jrn.=HtmlInput::hidden($this->div.
'r_jrn['.$i.
']',
133 $_REQUEST[$this->div.
"r_jrn"][$i]);
135 $hid_jrn.=HtmlInput::hidden($this->div.
'nb_jrn',
139 $hid_jrn=HtmlInput::hidden($this->div.
'nb_jrn', 0);
142 $period=
$g_user->get_periode();
143 $per=
new Periode($this->
cn, $period);
152 $f_date_start=
new IDate(
'date_start',
'', $this->div.
"date_start");
158 $f_date_end=
new IDate(
'date_end',
'', $this->div.
"date_end");
164 $f_date_paid_start=
new IDate(
'date_paid_start',
'',
165 $this->div.
"date_paid_start");
166 $f_date_paid_end=
new IDate(
'date_paid_end',
'',
167 $this->div.
"date_paid_end");
169 $f_date_paid_start->value=
$http->request(
"date_paid_start",
"string",
"");
170 $f_date_paid_end->value=
$http->request(
"date_paid_end",
"string",
"");
173 $f_descript=
new IText(
'desc',
"", $this->div.
"desc");
174 $f_descript->size=40;
175 $f_descript->value=
$http->request(
'desc',
"string",
"");
178 $f_amount_min=
new INum(
'amount_min',
'0', $this->div.
"amount_min");
179 $f_amount_min->value=
$http->request(
"amount_min",
"string",0);
180 $f_amount_max=
new INum(
'amount_max',
'0', $this->div.
"amount_max");
181 $f_amount_max->value=
$http->request(
"amount_max",
"string",0);
185 $f_qcode=
new ICard($this->div.
'qcode');
187 $f_qcode->set_attribute(
'typecard',
'all');
192 $f_qcode->set_dblclick(
"fill_ipopcard(this);");
195 $f_qcode->set_function(
'fill_data');
196 $f_qcode->javascript=sprintf(
' onchange="fill_data_onchange(%s);" ',
198 $f_qcode->value=
$http->request($this->div.
'qcode',
"string",
"");
205 $f_accounting=
new IPoste(
'accounting',
"", $this->div.
"accounting");
206 $f_accounting->value=
$http->request(
'accounting',
"string",
"");
213 $f_accounting->set_attribute(
'jrn', 0);
214 $f_accounting->set_attribute(
'ipopup',
'ipop_account');
215 $f_accounting->set_attribute(
'label',
'ld');
216 $f_accounting->set_attribute(
'account', $this->div.
'accounting');
220 $f_paid=
new ISelect(
'operation_filter',
null, $this->div.
'operation_filter');
221 $f_paid->value=array([
"value"=>
'all',
"label"=>
_(
"Toutes")],
222 [
"value"=>
'unpaid',
"label"=>
_(
"Non payées")],
223 [
"value"=>
'paid',
"label"=>
_(
"Payées")]
225 $f_paid->selected=
$http->request(
"operation_filter",
"string",
"all");
227 $r.=dossier::hidden();
229 $this->div.
"ledger_type");
236 if (isset(
$_REQUEST[
'single_operation']))
242 $currency_id=
$http->request(
"p_currency_code",
"string",-1);
243 $acc_currency=
new Acc_Currency($this->
cn);
245 $sCurrency=$acc_currency->select_currency();
246 $sCurrency->id=$this->div.
"p_currency_code";
247 $sCurrency->value[]=array(
"label"=>
_(
"Toutes"),
"value"=>-1);
248 $sCurrency->selected=$currency_id;
249 $tva_id_search=
new ITva_Popup(
"tva_id_search",
250 $http->request(
"tva_id_search",
"string",
null),
251 $this->div.
"tva_id_search");
254 require_once NOALYSS_TEMPLATE.
'/ledger_search.php';
255 $r.=ob_get_contents();
271 $json=json_encode([
"div"=>$this->div,
"ledger_type"=>$this->
type,
"all_type"=>$this->all,
272 "dossier"=>Dossier::id()]);
274 $r=sprintf(
'manage_search_filter(%s)',
$json);
284 $name->placeholder=
_(
"Nom de la recherche");
286 $bt=
new IButton($this->div.
"save_ok",
_(
"Ajout"));
287 $bt->javascript=sprintf(
"save_filter('%s','%s')",$this->div,Dossier::id());
322 select distinct jr_id
324 join jrnx on (jr_grpt_id=j_grpt)
326 exists(select 1 from operation_analytique where j_id=jrnx.j_id) )
329 substr(jr_comment,1,60) as jr_comment,
330 to_char(jr_ech,'DD.MM.YY') as str_jr_ech,
331 to_char(jr_date,'DD.MM.YY') as str_jr_date,
332 jr_date as jr_date_order,
346 (select string_agg(a,' ')
347 from (select '<span style=\"font-size:80%\" class=\"tagcell tagcell-color'||t.t_color::text||'\">'||t_tag||'</span>' a
348 from operation_tag ot join tags t on(ot.tag_id=t.t_id)
349 where ot.jrn_id=X.jr_id
354 when jrn_def_type='VEN' then
355 (select ad_value from fiche_detail where ad_id=1
356 and f_id=(select max(qs_client) from quant_sold join jrnx
357 using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt)
358 where e.jr_id=x.jr_id))
359 when jrn_def_type = 'ACH' then
363 and f_id=(select max(qp_supplier) from quant_purchase
364 join jrnx using (j_id) join jrn as e on (e.jr_grpt_id=j_grpt) where e.jr_id=x.jr_id))
365 when jrn_def_type = 'FIN' then
366 (select ad_value from fiche_detail where ad_id=1
367 and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
370 when jrn_def_type='VEN' then
371 (select ad_value from fiche_detail
373 and f_id=(select max(qs_client)
375 join jrnx using (j_id)
376 join jrn as e on (e.jr_grpt_id=j_grpt)
377 where e.jr_id=x.jr_id))
378 when jrn_def_type = 'ACH' then (select ad_value
381 and f_id=(select max(qp_supplier)
383 join jrnx using (j_id)
384 join jrn as e on (e.jr_grpt_id=j_grpt)
385 where e.jr_id=x.jr_id))
386 when jrn_def_type = 'FIN' then (select ad_value
389 and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
392 when jrn_def_type='VEN' then
396 and f_id=(select max(qs_client)
398 join jrnx using (j_id)
399 join jrn as e on (e.jr_grpt_id=j_grpt)
400 where e.jr_id=x.jr_id))
401 when jrn_def_type = 'ACH' then (select ad_value
404 and f_id=(select max(qp_supplier)
406 join jrnx using (j_id)
407 join jrn as e on (e.jr_grpt_id=j_grpt)
408 where e.jr_id=x.jr_id))
409 when jrn_def_type = 'FIN' then (select ad_value
412 and f_id=(select qf_other from quant_fin where quant_fin.jr_id=x.jr_id))
415 when jrn_def_type='VEN' then
416 (select sum(qs_price)+sum(vat) from
417 (select qs_internal,qs_price,case when qs_vat_sided<>0 then 0
418 else qs_vat end as vat
420 where qs_internal=X.jr_internal) as ven_invoice
422 when jrn_def_type = 'ACH' then
423 (select sum(qp_price)+sum(vat)+sum(qp_nd_tva)+sum(qp_nd_tva_recup)
425 (select qp_internal,qp_price,qp_nd_tva,qp_nd_tva_recup,qp_vat-qp_vat_sided as vat
427 where qp_internal=X.jr_internal) as invoice_purchase
431 coalesce( case when jrn_def_type='VEN' then
432 (select sum(case when j102.j_debit is true then 0-j102.J_montant else j102.j_montant end)
433 from jrnx j102 join jrn_tax using(j_id) where j102.j_grpt =X.jr_grpt_id)
434 when jrn_def_type='ACH' then
435 (select sum(case when j103.j_debit is false then 0-j103.J_montant else j103.j_montant end)
436 from jrnx j103 join jrn_tax using(j_id) where j103.j_grpt =X.jr_grpt_id)
438 0 end ,0) ) as total_invoice,
440 to_char(jr_date_paid,'DD.MM.YY') as str_jr_date_paid,
441 cas.jr_id as analytic_op,
443 (select cr_code_iso from currency c where c.id=x.currency_id) cr_code_iso,
447 left join jrn_note using(jr_id)
448 left join cas using( jr_id)
449 join jrn_def on jrn_def_id=jr_def_id
450 join parm_periode on p_id=jr_tech_per
459 $r_jrn=$p_array[$op.
"r_jrn"];
463 $r_jrn=(isset($r_jrn))?$r_jrn:-1;
496 $fil_hide_operation=
'';
535 $fil_ledger=
' jrn_def_id in ('.$fil_ledger.
')';
549 $strTag=join(
",", $p_array[$op.
"tag"]);
550 if ($p_array[$op.
"tag_option"] == 1){
552 $fil_tag=$and.
' jr_id in (select jrn_id from operation_tag where tag_id in ('.sql_string($strTag).
')) ';
555 $aTag=$p_array[$op.
"tag"];
556 $sub_tag=
""; $nb_tag=count($aTag);
558 for ($x=0;$x < $nb_tag;$x++) {
559 $sub_tag =
" tag_id = ".sql_string($aTag[$x]);
560 $fil_tag=$and.
' jr_id in (select jrn_id from operation_tag where '.$sub_tag.
')' ;
567 $amount_min=abs(
toNumber($amount_min));
568 $amount_max=abs(
toNumber($amount_max));
569 if ($amount_min>0&&
isNumber($amount_min))
571 $fil_amount=$and.
' jr_montant >='.$amount_min;
574 if ($amount_max>0&&
isNumber($amount_max))
576 $fil_amount.=$and.
' jr_montant <='.$amount_max;
586 bccomp($amount_min, $amount_max, 2)==0)
588 $fil_amount=$and.
' ( ';
591 $fil_amount.=
'jr_grpt_id in ( select distinct j_grpt from jrnx where j_montant = '.$amount_min.
') ';
595 $fil_amount.=
' jr_montant = '.$amount_min;
603 $fil_date=$and.
" jr_date >= to_date('".
$date_start.
"','DD.MM.YYYY')";
608 $fil_date.=$and.
" jr_date <= to_date('".
$date_end.
"','DD.MM.YYYY')";
612 if (isset($date_paid_start)&&
isDate($date_paid_start)!=
null)
614 $fil_date_paid=$and.
" jr_date_paid >= to_date('".$date_paid_start.
"','DD.MM.YYYY')";
617 if (isset($date_paid_end)&&
isDate($date_paid_end)!=
null)
619 $fil_date_paid.=$and.
" jr_date_paid <= to_date('".$date_paid_end.
"','DD.MM.YYYY')";
626 $fil_desc=$and.
" ( upper(jr_comment) like upper('%".
$desc.
"%') or upper(jr_pj_number) like upper('%".
$desc.
"%') ".
627 " or upper(jr_internal) like upper('%".$desc.
"%')
628 or jr_grpt_id in (select j_grpt from jrnx where j_text ilike '%".
$desc.
"%')
629 or jr_id in (select jr_id from jrn_info where ji_value is not null and ji_value ilike '%$desc%')
630 or jr_id in (select jr_id from jrn_note where upper(n_text) ilike '%$desc%' )
637 $fil_account=$and.
" jr_grpt_id in (select j_grpt
645 $fil_qcode=$and.
" jr_grpt_id in ( select j_grpt from
651 if ( isset($operation_filter)) {
652 switch ($operation_filter) {
654 $fil_paid=$and.
"(jr_rapt is null or jr_rapt = '') and jr_valid = true ";
661 $fil_paid=$and.
"(jr_rapt is not null or jr_rapt = 'paid') and jr_valid = true ";
665 throw new Exception(
_(
"ALS01 Etat inconnu"),10);
679 $fil_sec=$and.
" jr_def_id in ( select uj_jrn_id ".
680 " from user_sec_jrn where ".
681 " uj_login='".sql_string($_SESSION[SESSION_KEY.
'g_user']).
"'".
682 " and uj_priv in ('R','W'))";
685 if ( isset($p_currency_code) && $p_currency_code !=-1) {
686 $fil_currency=$and.
" x.currency_id = ".
sql_string($p_currency_code);
690 if ( isset($tva_id_search) && ! empty (trim($tva_id_search??
"")))
693 if ($acc_tva->tva_id != -1 )
695 $fil_vat = $and.
" jr_internal in
696 ( select distinct qp_internal
698 where qp_vat_code=".
sql_string($acc_tva->tva_id ).
700 select distinct qs_internal
702 where qs_vat_code=".sql_string($acc_tva->tva_id ).
")";
706 $where=$fil_ledger.$fil_amount.$fil_date.$fil_desc.$fil_sec.
707 $fil_qcode.$fil_paid.$fil_account.$fil_date_paid.$fil_hide_operation.$fil_tag.$fil_currency.$fil_vat;
709 $sql.=
" where ".$where;
712 return array(
$sql, $where);
726 $r.=
'<div id="search_form" style="display:none">';
727 $r.=HtmlInput::title_box(
_(
'Recherche'),
"search_form",
"hide",
"",
"n");
728 $r.=
'<FORM METHOD="GET" >';
731 $r.=HtmlInput::submit(
'search',
_(
'Rechercher'));
739 $r.=HtmlInput::hidden(
'ac',
$http->request(
'ac'));
744 $r.=HtmlInput::hidden(
"sa",
$http->request(
'sa'));
746 $r.=HtmlInput::hidden(
"sb",
$http->request(
'sb'));
748 $r.=HtmlInput::hidden(
"sc",
$http->request(
'sc'));
750 $r.=HtmlInput::hidden(
"f_id",
$http->request(
'f_id'));
755 $r.=HtmlInput::button_hide(
"search_form");
760 $button->label=
_(
"Chercher");
761 $button->javascript=
"toggleHideShow('search_form','tfs');";
762 $r.=$button->input();
804 $limit=($_SESSION[SESSION_KEY.
'g_pagesize']!=-1)?
" LIMIT ".$_SESSION[SESSION_KEY.
'g_pagesize']:
"";
806 $order=
" order by jr_date_order asc,jr_internal asc";
811 'order by jr_date asc,substring(jr_pj_number,\'[0-9]+$\')::numeric asc',
812 'order by jr_date desc,substring(jr_pj_number,\'[0-9]+$\')::numeric desc',
814 $table->add(
_(
'Echeance'),
$url,
" order by jr_ech asc",
815 " order by jr_ech desc",
'ea',
'ed');
816 $table->add(
_(
'Paiement'),
$url,
" order by jr_date_paid asc",
817 " order by jr_date_paid desc",
'eap',
'edp');
819 ' order by substring(jr_pj_number,\'[0-9]+$\')::numeric asc ',
820 ' order by substring(jr_pj_number,\'[0-9]+$\')::numeric desc ',
822 $table->add(
_(
'Tiers'),
$url,
" order by name asc",
823 " order by name desc",
'na',
'nd');
824 $table->add(
_(
'Montant'),
$url,
" order by jr_montant asc",
825 " order by jr_montant desc",
"ma",
"md");
826 $table->add(
_(
"Description"),
$url,
"order by jr_comment asc",
827 "order by jr_comment desc",
"ca",
"cd");
849 return array(0,
_(
"Aucun enregistrement trouvé"));
852 $r.=
'<table class="result" id="history_operation_t">';
856 $r.=
'<th>'.$table->get_header(0).
'</th>';
859 $r.=
'<th>'.$table->get_header(1).
'</td>';
863 $r.=
'<th>'.$table->get_header(2).
'</th>';
865 $r.=
'<th>'.$table->get_header(3).
'</th>';
867 if ( $this->
type !=
"ODS")
869 $r.=
'<th>'.$table->get_header(4).
'</th>';
871 $r.=
"<th>"._(
"n° interne").
"</th>";
872 $r.=
'<th>'.$table->get_header(6).
'</th>';
873 $r.=
th(
'Notes',
' style="width:15%"');
874 $r.=
'<th>'.$table->get_header(5).
'</th>';
878 $r.=
"<th> "._(
'Payé').
"</th>";
880 $r.=
"<th>"._(
'Concerne').
"</th>";
881 $r.=
"<th>"._(
'Document').
"</th>";
894 $tr=
'<TR class="odd">';
898 $tr=
'<TR class="even">';
913 $r.=
$row[
'str_jr_date_paid'];
926 if ($this->
type !=
'ODS')
929 $other=(
$row[
'quick_code']!=
'')?HtmlInput::card_detail(
$row[
'quick_code'],
h(
$row[
'name'].
' '.
$row[
'first_name'])):
'';
935 $r.=sprintf(
'<A class="detail" style="text-decoration:underline" HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>',
941 $tmp_jr_comment=
h(
$row[
'jr_comment']).$row[
'tag_operation'];
943 if (
$row[
'analytic_op'] !=
"")
944 $r.=sprintf(
'<span style="float:right;background:black;color:white;">∋</span>');
946 $r.=
td(
h(
$row[
'n_text']),
' style="font-size:0.87em%"');
953 if (
$row[
'jrn_def_type']==
'FIN')
955 $positive=$this->
cn->get_value(
"select qf_amount from quant_fin where jr_id=$1",
956 array(
$row[
'jr_id']));
957 if ($this->
cn->count()!=0)
959 $positive=($positive<0)?1:0;
962 $r.=
"<TD align=\"right\">";
963 $t_amount=
$row[
'jr_montant'];
964 if (
$row[
'total_invoice']!=
null&&
$row[
'total_invoice']!=
$row[
'jr_montant'])
965 $t_amount=
$row[
'total_invoice'];
966 $tot=($positive!=0)?bcsub(
$tot, $t_amount):bcadd(
$tot, $t_amount);
968 if (
$row [
'jrn_def_type']==
'FIN')
970 $r.=( $positive!=0 )?
"<font color=\"red\"> - ".
nbm($t_amount).
"</font>":
nbm($t_amount);
974 $r.=( $t_amount<0 )?
"<font color=\"red\"> ".
nbm($t_amount).
"</font>":
nbm($t_amount);
983 $w->set_range(
"paid_operation_ck");
984 $w->name=
"rd_paid".$row[
'jr_id'];
985 $w->selected=(
$row[
'jr_rapt']==
'paid')?
true:
false;
987 $w->readonly=( $p_paid==2)?
true:
false;
988 $w->javascript=
'onclick="operation_payment.check_item(this)"';
990 $h->name=
"set_jr_id".$row[
'jr_id'];
991 $r.=
'<TD>'.$w->input().$h->input().
'</TD>';
992 if (
$row[
'jr_rapt']==
'paid')
994 $amount_paid=bcadd($amount_paid, $t_amount);
998 $amount_unpaid=bcadd($amount_unpaid, $t_amount);
1004 $rec->set_jr_id(
$row[
'jr_id']);
1010 foreach (
$a as $key=> $element)
1014 $l_amount=$this->
cn->get_value(
"select jr_montant from jrn ".
1015 " where jr_id=$1", array($element));
1016 $r.=
"<A class=\"detail\" HREF=\"javascript:modifyOperation('".$element.
"',".
$gDossier.
")\" > ".
$operation->get_internal().
"[".
nbm($l_amount).
"]</A>";
1021 if (
$row[
'jr_valid']==
'f')
1023 $r.=
"<TD>"._(
"Opération annulée").
"</TD>";
1030 if (
$row[
'jr_pj_name']!=
"")
1032 $r.=
'<td>'.HtmlInput::show_receipt_document(
$row[
'jr_id']).
'</td>';
1040 $amount_paid=round($amount_paid, 4);
1041 $amount_unpaid=round($amount_unpaid, 4);
1044 $r.=
'<TD COLSPAN="5">Total</TD>';
1046 $r.=
'<TD ALIGN="RIGHT">'.nbm(
$tot).
"</TD>";
1051 $r.=
'<TD COLSPAN="5">'._(
"Payé").
'</TD>';
1052 $r.=
td(
"").td(
"").td(
"").td(
'');
1053 $r.=
'<TD ALIGN="RIGHT">'.nbm($amount_paid).
"</TD>";
1057 $r.=
'<TD COLSPAN="5">'._(
"Non payé").
'</TD>';
1058 $r.=
td(
"").td(
"").td(
"").td(
'');
1059 $r.=
'<TD ALIGN="RIGHT">'.nbm($amount_unpaid).
"</TD>";
1101 $limit=
" LIMIT ".MAX_RECONCILE;
1106 $sql.=
" order by jr_date asc ".$limit;
1120 return array(0,
_(
"Aucun enregistrement trouvé"));
1121 $r.=HtmlInput::hidden(
"target", $p_target);
1122 $r.=
'<table class="result">';
1126 $r.=
"<th>"._(
"Selection").
"</th>";
1127 $r.=
"<th>"._(
"Internal").
"</th>";
1129 if ($this->
type==
'ALL')
1131 $r.=
th(
_(
'Journal'));
1134 $r.=
'<th>'._(
"Date").
'</th>';
1135 $r.=
'<th>'._(
"Pièce").
'</td>';
1137 $r.=
'<th>'._(
"Description").
'</th>';
1138 $r.=
th(
_(
'Notes'),
' ');
1139 $r.=
'<th>'._(
"Montant").
'</th>';
1140 $r.=
"<th>"._(
'Concerne').
"</th>";
1153 $tr=
'<TR class="odd">';
1155 $tr=
'<TR class="even">';
1160 $r.=
'<td><INPUT TYPE="CHECKBOX" name="jr_concerned'.$row[
'jr_id'].
'" ID="jr_concerned'.
$row[
'jr_id'].
'" value="'.
$row[
'quick_code'].
'"> </td>';
1167 $href=basename($_SERVER[
'PHP_SELF']);
1170 $r.=sprintf(
'<A class="detail" style="text-decoration:underline" HREF="javascript:modifyOperation(\'%s\',\'%s\')" >%s </A>',
1173 if ($this->
type==
'ALL')
1182 $r.=
$row[
'jr_pj_number'];
1190 $tmp_jr_comment=
h(
$row[
'jr_comment']).$row[
'tag_operation'];
1191 $r.=$tmp_jr_comment;
1193 $r.=
td(
h(
$row[
'n_text']),
' style="font-size:0.87em"');
1200 if (
$row[
'jrn_def_type']==
'FIN')
1202 $positive=$this->
cn->get_value(
"select qf_amount from quant_fin where jr_id=$1",
1203 array(
$row[
'jr_id']));
1204 if ($this->
cn->count()!=0)
1205 $positive=($positive<0)?1:0;
1207 $r.=
"<TD align=\"right\">";
1209 $r.=( $positive!=0 )?
"<font color=\"red\"> - ".
nbm(
$row[
'total_invoice']).
"</font>":
nbm(
$row[
'total_invoice']);
1216 $rec->set_jr_id(
$row[
'jr_id']);
1222 foreach (
$a as $key=> $element)
1226 $l_amount=$this->
cn->get_value(
"select jr_montant from jrn ".
1227 " where jr_id=$1", array($element));
1228 $r.=
"<A class=\"detail\" HREF=\"javascript:modifyOperation('".$element.
"',".
$gDossier.
")\" > ".
$operation->get_internal().
"[".
nbm($l_amount).
"]</A>";
1233 if (
$row[
'jr_valid']==
'f')
1235 $r.=
"<TD>"._(
"Opération annulée").
"</TD>";
1262 echo
'<div id="div_jrn'.$p_div.
'" >';
1263 echo HtmlInput::title_box(
_(
"Journaux"), $p_div.
"jrn_search");
1264 echo
'<div style="padding:5px">';
1265 echo
'<form method="GET" id="'.$p_div.
'search_frm" onsubmit="return hide_ledger_choice(\''.$p_div.
'search_frm\')">';
1267 echo HtmlInput::hidden(
'nb_jrn',
$nb_array);
1268 echo
_(
'Filtre ').HtmlInput::filter_table($p_div.
'tb_jrn',
'0,1,2', 2);
1269 echo HtmlInput::anchor_action(
_(
'Inverser sel'),
' toggle_checkbox(\''.
"{$p_div}search_frm".
'\')
','sel_
'.$p_div,"nav");
1271 echo HtmlInput::anchor_action(_('Effacer sel
'),' unselect_checkbox(\
''.
"{$p_div}search_frm".
'\')
','unsel_
'.$p_div,"nav");
1273 echo HtmlInput::anchor_action(_('Financier
'),' select_checkbox_attribute(\
''.
"{$p_div}search_frm".
'\',\
'ledger_type\',\'FIN\') ',
'selfin_'.$p_div,
"nav");
1275 echo HtmlInput::anchor_action(
_(
'Vente'),
' select_checkbox_attribute(\''.
"{$p_div}search_frm".
'\',\
'ledger_type\',\'VEN\') ',
'selfven_'.$p_div,
"nav");
1277 echo HtmlInput::anchor_action(
_(
'Achat'),
' select_checkbox_attribute(\''.
"{$p_div}search_frm".
'\',\
'ledger_type\',\'ACH\') ',
'selfach_'.$p_div,
"nav");
1279 echo HtmlInput::anchor_action(
_(
'Op.Diverses'),
' select_checkbox_attribute(\''.
"{$p_div}search_frm".
'\',\
'ledger_type\',\'ODS\') ',
'selfods_'.$p_div,
"nav");
1280 echo
'<table class="result" id="'.$p_div.
'tb_jrn">';
1283 echo
th(
_(
'Description'));
1296 $r->set_attribute(
"ledger_type",
$row[
'jrn_def_type']);
1298 if ( $p_selected !=
null && in_array(
$row[
'jrn_def_id'],$p_selected))
1302 $class=(
$e%2==0)?
' class="even" ':
' class="odd" ';
1303 echo
'<tr '.$class.
'>';
1304 echo
'<td style="white-space: nowrap">'.$r->input().$row[
'jrn_def_name'].
"(".
$row[
'jrn_def_code'].
")".
'</td>';
1305 echo
'<td >'.$row[
'jrn_def_description'].
'</td>';
1306 echo
'<td >'.$row[
'jrn_def_type'].
'</td>';
1311 echo HtmlInput::hidden(
'div',$p_div);
1312 echo HtmlInput::submit(
'save',
_(
'Valider'));
1313 echo HtmlInput::button_close($p_div.
"jrn_search");
1318 $ret=ob_get_contents();
1331 $record=$user_filter_sql->to_array();
1333 $record[
'desc']=$record[
'description'];
1334 $record[
'r_jrn']=explode(
",", $record[
'r_jrn']??
"");
1335 $record[
'tag']=explode(
",",$record[
'uf_tag']??
"");
1336 $record[
'tag_option']=$record[
"uf_tag_option"];
1337 $record[
'p_currency_code']=$record[
'uf_currency_code'];
1350 $button=HtmlInput::button_action(
"Recherches sauvées",
1351 sprintf(
"display_list_filter('%s','%s','%s')"
1353 ,
$http->request(
"ac")
1355 ),uniqid(),
'smallbutton');
1364 require_once NOALYSS_TEMPLATE.
"/acc_ledger_search-display_list_filter.php";
th($p_string, $p_extra='', $raw='')
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
build_search_filter()
Build the button for managing the filter for search.
$type
type of ledger : FIN,ODS,VEN,ACH
list_operation($sql, $offset, $p_paid=0)
Show all the 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 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,
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
$id
prefix for id of DOM id id of the ledger
__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