25if ( ! defined (
'ALLOWED') ) die(
'Appel direct ne sont pas permis');
28$cn = Dossier::connect();
38$categorie->value =
$cn->make_array(
"select fd_id,fd_label||' ('||(select count(*) from fiche where fiche.fd_id=fiche_def.fd_id)::text||')' from fiche_def order by fd_label");
47$icall->selected = (isset(
$_GET[
'allcard'])) ? 1 : 0;
78 array(
'value' => -1,
'label' =>
_(
'Liste')),
79 array(
'value' => 0,
'label' =>
_(
'Historique')),
80 array(
'value' => 1,
'label' =>
_(
'Historique Lettré')),
81 array(
'value' => 6,
'label' =>
_(
'Historique Lettré et montants différents')),
82 array(
'value' => 2,
'label' =>
_(
'Historique non Lettré')),
83 array(
'value' => 3,
'label' =>
_(
'Résumé')),
84 array(
'value' => 4,
'label' =>
_(
'Balance')),
85 array(
'value' => 8,
'label' =>
_(
'Balance âgée')),
86 array(
'value' => 7,
'label' =>
_(
'Balance âgée en-cours')),
87 array(
'value' => 5,
'label' =>
_(
'Balance non soldée'))
89$histo->javascript =
'onchange="if (this.value==3 || this.value==-1) {
90 g("trstart").style.display="none";g("trend").style.display="none";g("allcard").style.display="none";}
91 else {g("trstart").style.display="";g("trend").style.display="";g("allcard").style.display="";}"';
104echo
'<FORM method="GET">';
105echo dossier::hidden();
106echo HtmlInput::hidden(
'ac',
$ac);
107require_once NOALYSS_TEMPLATE.
'/impress_cat_card.php';
108echo HtmlInput::submit(
'cat_display',
_(
'Recherche'));
112$str =
"if (g('histo').value==3 || g('histo').value== -1 ) {
113 g('trstart').style.display='none';g('trend').style.display='none';g('allcard').style.display='none';}
114 else {g('trstart').style.display='';g('trend').style.display='';g('allcard').style.display='';}
115 if ( g('histo').value== -1 ) { g('allcard').style.display='';}
122if (!isset(
$_GET[
'cat_display']))
130$h_add_card_b->javascript =
"dis_blank_card({gDossier:$gDossier,fd_id:$fd_id,ref:2})";
149 echo
'<div class="content">';
150 echo
'<h2 class="error"> '._(
'Aucune fiche trouvée').
'</h2>';
156echo
'<div class="content">';
161if (
$histo->selected == -1)
169 if (isset(
$_POST[
'action']))
173 $ack =
$http->post(
"f_id",
"array",[]);
179 $move_to=
$http->post(
"move_to",
"number");
180 for (
$i = 0;
$i < count($ack);
$i++)
183 $fiche->move_to($move_to);
192 for (
$i = 0;
$i < count($ack);
$i++)
195 if (
$fiche->remove(
true) == 1 )
202 echo
'<div class="content">';
203 echo
h2(
_(
"Fiche non effacées"),
' class="error" ');
204 echo
'<p class="error">'._(
" Ces fiches n'ont pas été effacées ").$msg;
214 $sql =
"select f_id from fiche ";
224 $cond =
" where f.f_enable = '1' ";
229 $p_cat=
$http->get(
"cat",
"number");
230 $cond =
" where f.fd_id = " .
sql_string($p_cat);
233 $p_cat=
$http->get(
"cat",
"number");
234 $cond =
" where f.fd_id = " .
sql_string($p_cat);
235 $cond .=
" and f.f_enable='1'";
239 $max =
$cn->get_value(
"select count(*) from fiche as f " . $cond);
241 $step = $_SESSION[SESSION_KEY.
'g_pagesize'];
242 $page=
$http->get(
"page",
"number",1);
248 (select ad_value from fiche_detail as fd1 where ad_id=1 and fd1.f_id=f.f_id) as name,
249 (select ad_value from fiche_detail as fd1 where ad_id=23 and fd1.f_id=f.f_id) as qcode,
251 (select ad_value from fiche_detail as fd1 where ad_id=5 and fd1.f_id=f.f_id) as poste
252 from fiche as f join fiche_def as fd on (fd.fd_id=f.fd_id)
253 $cond order by 2,4 offset $offset $limit
257 require_once NOALYSS_TEMPLATE.
'/fiche_list.php';
270 $cat_card->id =
$http->get(
'cat',
'number');
271 $aHeading = $cat_card->load_attribute();
276 $h_add_card_b->javascript =
"dis_blank_card({gDossier:$gDossier,fd_id:$fd_id,after_save:1,ref:2})";
280 require_once NOALYSS_TEMPLATE.
'/result_cat_card_summary.php';
283 echo
'<form method="GET" ACTION="export.php">' . dossier::hidden() ;
289 $hid->input(
"type",
"fiche") .
290 $hid->input(
"ac",
$http->request(
'ac')) .
291 $hid->input(
"fd_id",
$http->request(
'cat',
"number"));
301$export_pdf =
'<FORM METHOD="get" ACTION="export.php" style="display:inline">';
303$export_pdf.=HtmlInput::hidden(
'act',
"PDF:fiche_balance") .
307$export_pdf.=HtmlInput::request_to_hidden(array(
'allcard'));
309$export_pdf.=HtmlInput::submit(
'pdf',
_(
'Export en PDF'));
314$export_csv =
'<FORM METHOD="get" ACTION="export.php" style="display:inline">';
316$export_csv.=HtmlInput::hidden(
'act',
'CSV:fiche_balance');
320$export_csv.=HtmlInput::request_to_hidden(array(
'allcard'));
322$export_csv.=HtmlInput::submit(
'CSV',
_(
'Export en CSV'));
329 echo
h2(
'Date invalide !',
'class="error"');
330 alert(
_(
'Date invalide !'));
336if (
$histo->selected == 8)
340 $export_csv =
'<FORM METHOD="get" ACTION="export.php" style="display:inline">';
359 $a_cat =
$cn->get_array(
"select fd_id from vw_fiche_def where ad_id=" .
ATTR_DEF_ACCOUNT .
" order by fd_label asc");
360 $nb_cat=count($a_cat);
361 for (
$i=0;
$i < $nb_cat;
$i++)
372if (
$histo->selected == 7)
377 $export_csv =
'<FORM METHOD="get" ACTION="export.php" style="display:inline">';
396 $a_cat =
$cn->get_array(
"select fd_id from vw_fiche_def where ad_id=" .
ATTR_DEF_ACCOUNT .
" order by fd_label asc");
397 $nb_cat=count($a_cat);
398 for (
$i=0;
$i < $nb_cat;
$i++)
420 echo
alert(
_(
"Cette catégorie n'ayant pas de poste comptable n'a pas de balance"));
435 $ret =
$cn->exec_sql(
"select f_id,ad_value from fiche join fiche_detail using(f_id) where fd_id=$1 and ad_id=1 order by 2 ", array(
$afiche[
$e][
'fd_id']));
436 if (
$cn->count() == 0)
440 echo
_(
"Aucune fiche trouvée");
445 echo
'<h2 class="h-section">' .
$cn->get_value(
"select fd_label from fiche_def where fd_id=$1", array(
$afiche[
$e][
'fd_id'])) .
'</h2>';
446 $id=
"table_".$afiche[
$e][
'fd_id'].
"_id";
447 echo
_(
'Filtre rapide:').HtmlInput::filter_table(
$id,
'0,1,2',
'1');
448 echo
'<table class="sortable" id="'.$id.
'" class="result" >';
450 th(
_(
'Quick Code')) .
453 th(
_(
'Débit'),
'style="text-align:right"') .
454 th(
_(
'Crédit'),
'style="text-align:right"') .
455 th(
_(
'Solde'),
'style="text-align:right"') .
456 th(
_(
'D/C'),
'style="text-align:right"')
458 $idx = 0;$sum_deb=0;$sum_cred=0;$sum_solde=0;bcscale(4);
463 $filter =
" (j_date >= to_date('" .
$start.
"','DD.MM.YYYY') " .
464 " and j_date <= to_date('" .
$end .
"','DD.MM.YYYY')) ";
473 $class =(
$idx % 2 == 0) ?
'class="odd"':
'class="even"';
475 $sum_cred=bcadd($sum_cred,
$solde[
'credit']);
476 $sum_deb=bcadd($sum_deb,
$solde[
'debit']);
477 $sum_solde=bcsub($sum_deb,$sum_cred);
482 td(
nbm(
$solde[
'debit']),
'class="sorttable_numeric" sorttable_customkey="'.
$solde[
'debit'].
'" style="text-align:right"') .
483 td(
nbm(
$solde[
'credit']),
'class="sorttable_numeric" sorttable_customkey="'.
$solde[
'debit'].
'" style="text-align:right"') .
484 td(
nbm(abs(
$solde[
'solde'])),
'class="sorttable_numeric" sorttable_customkey="'.
$solde[
'solde'].
'" style="text-align:right"') .
496 td(
nbm($sum_deb),
'style="text-align:right"').
497 td(
nbm($sum_cred),
'style="text-align:right"').
498 td(
nbm(abs($sum_solde)),
'style="text-align:right"').
499 td(
findSide($sum_deb - $sum_cred) ,
'style="text-align:right"'),
500 ' class="highlight"');
524 $p_cat=
$http->request(
"cat",
"number");
568 if (count(
$letter->content) == 0)
572 echo
'<h2 class="h-section">' . $detail_card ;
576 echo
'<table class="result">';
580 echo
th(
_(
'Interne'));
582 echo
th(
_(
'Code Devise'));
583 echo
th(
_(
'Devise'),
'style="text-align:right"');
584 echo
th(
_(
'Débit'),
'style="width:auto;text-align:right" ');
585 echo
th(
_(
'Crédit'),
'style="width:auto;text-align:right" ');
586 echo
th(
_(
'Prog.'),
'style="text-align:right"');
597 if (
$row[
'letter']!=-1) {
598 $html_letter=strtoupper(base_convert(
$row[
'letter'],10,36));
601 echo
'<tr class="even" name="tr_'.$html_letter.
'_">';
603 echo
'<tr class="odd" name="tr_'.$html_letter.
'_">';
605 echo
td(
$row[
'j_date_fmt']);
606 echo
td(
h(
$row[
'jr_pj_number']));
607 echo
td(HtmlInput::detail_op(
$row[
'jr_id'],
$row[
'jr_internal']));
608 echo
td(
h(
$row[
'jr_comment']));
609 echo
td(
$row[
'cr_code_iso']);
610 $str_currency_amount=(
$row[
'currency_id']==0)?
"":
nbm(
$row[
'currency_amount'],2);
612 echo
td($str_currency_amount,
'class="num"');
613 if (
$row[
'j_debit'] ==
't')
615 echo
td(
nbm(
$row[
'j_montant']),
' style="text-align:right"');
617 $prog = bcadd($prog,
$row[
'j_montant']);
623 echo
td(
nbm(
$row[
'j_montant']),
' style="text-align:right"');
625 $prog = bcsub($prog,
$row[
'j_montant']);
628 echo
td(
nbm(abs($prog)) .
$side,
'style="text-align:right"');
630 if (
$row[
'letter']!=-1) {
632 if (
$row[
'letter_diff'] != 0)
634 echo
'<td>'.HtmlInput::show_reconcile(
"", $html_letter,$span_error).
'</td>';
647 echo
td(
_(
'Credit'));
650 echo
'<tr class="highlight">';
657 $s =
_(
'solde débiteur');
659 $s =
_(
'solde crediteur');
661 echo
td(
nbm(
$solde),
' style="font-weight:bold;text-align:right"');
h2($p_string, $p_class="", $raw="")
th($p_string, $p_extra='', $raw='')
findSide($p_number)
return D if the number is smaller than 0 , C if bigger and an empty string if equal to 0.
isDate($p_date)
Verifie qu'une date est bien formaté en d.m.y et est valable.
h1($p_string, $p_class="")
NoAccess($js=1)
Echo no access and stop.
tr($p_string, $p_extra='')
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.
alert($p_msg, $buffer=false)
alert in javascript
global $g_user
if no group available , then stop
h( $row[ 'oa_description'])
catch(Exception $e) $exercice
if(isset( $_REQUEST[ 'show'])) if(isset($_REQUEST['del'])) $ac
if(! empty( $error)) for($i=0;$i< count($error);$i++)( $last !=$error[$i]) $last
_("actif, passif,charge,...")
$class
Display the Plugin and for each profile were it is installed or not.
compute the ageing balance, currently this code is not used
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
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
static get_fiche_def($p_cn, $card_category_id, $p_order='', $inactive=1)
get all the card from a categorie
Html Input : Input a date format dd.mm.yyyy The property title should be set to indicate what it is e...
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
only for operation retrieved thanks a quick_code manage the accounting entries for a given card
mother class for the lettering by account and by card use the tables jnt_letter, letter_deb and lette...
$categorie
Show first the form.
create_script($p_string)
create the HTML for adding the script tags around of the script
catch(\Exception $e) $bar
if( $delta< 0) elseif( $delta==0)
navigation_bar($p_offset, $p_line, $p_size=0, $p_page=1, $p_javascript="")
Create a navigation_bar (pagesize)