25if ( ! defined (
'ALLOWED') ) die(
'Appel direct ne sont pas permis');
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");
43$icall->selected = (isset(
$_GET[
'allcard'])) ? 1 : 0;
62 array(
'value' => -1,
'label' => _(
'Liste')),
63 array(
'value' => 0,
'label' => _(
'Historique')),
64 array(
'value' => 1,
'label' => _(
'Historique Lettré')),
65 array(
'value' => 6,
'label' => _(
'Historique Lettré et montants différents')),
66 array(
'value' => 2,
'label' => _(
'Historique non Lettré')),
67 array(
'value' => 3,
'label' => _(
'Résumé')),
68 array(
'value' => 4,
'label' => _(
'Balance')),
69 array(
'value' => 8,
'label' => _(
'Balance âgée')),
70 array(
'value' => 7,
'label' => _(
'Balance âgée en-cours')),
71 array(
'value' => 5,
'label' => _(
'Balance non soldée'))
73$histo->javascript =
'onchange="if (this.value==3 || this.value==-1) {
74 g("trstart").style.display="none";g("trend").style.display="none";g("allcard").style.display="none";}
75 else {g("trstart").style.display="";g("trend").style.display="";g("allcard").style.display="";}"';
83echo
'<FORM method="GET">';
84echo dossier::hidden();
86require_once NOALYSS_TEMPLATE.
'/impress_cat_card.php';
91$str =
"if (g('histo').value==3 || g('histo').value== -1 ) {
92 g('trstart').style.display='none';g('trend').style.display='none';g('allcard').style.display='none';}
93 else {g('trstart').style.display='';g('trend').style.display='';g('allcard').style.display='';}
94 if ( g('histo').value== -1 ) { g('allcard').style.display='';}
101if (!isset(
$_GET[
'cat_display']))
110$h_add_card_b->javascript =
"dis_blank_card({gDossier:$gDossier,fd_id:$fd_id,ref:2})";
127 echo
'<div class="content">';
128 echo
'<h2 class="error"> '._(
'Aucune fiche trouvée').
'</h2>';
134echo
'<div class="content">';
139if (
$histo->selected == -1)
145 if (isset(
$_POST[
'action']))
149 $ack =
$http->post(
"f_id",
"array",[]);
155 $move_to=
$http->post(
"move_to",
"number");
156 for (
$i = 0;
$i < count($ack);
$i++)
159 $fiche->move_to($move_to);
168 for (
$i = 0;
$i < count($ack);
$i++)
171 if (
$fiche->remove(
true) == 1 )
178 echo
'<div class="content">';
179 echo
h2(_(
"Fiche non effacées"),
' class="error" ');
180 echo
'<p class="error">'._(
" Ces fiches n'ont pas été effacées ").$msg;
190 $sql =
"select f_id from fiche ";
197 $p_cat=
$http->get(
"cat",
"number");
198 $cond =
" where f.fd_id = " .
sql_string($p_cat);
201 $max =
$cn->get_value(
"select count(*) from fiche as f " . $cond);
203 $step = $_SESSION[SESSION_KEY.
'g_pagesize'];
210 (select ad_value from fiche_detail as fd1 where ad_id=1 and fd1.f_id=f.f_id) as name,
211 (select ad_value from fiche_detail as fd1 where ad_id=23 and fd1.f_id=f.f_id) as qcode,
213 (select ad_value from fiche_detail as fd1 where ad_id=5 and fd1.f_id=f.f_id) as poste
214 from fiche as f join fiche_def as fd on (fd.fd_id=f.fd_id)
215 $cond order by 2,4 offset $offset $limit
219 require_once NOALYSS_TEMPLATE.
'/fiche_list.php';
230 $cat_card->id =
$http->get(
'cat',
'number');
231 $aHeading = $cat_card->getAttribut();
236 $h_add_card_b->javascript =
"dis_blank_card({gDossier:$gDossier,fd_id:$fd_id,after_save:1,ref:2})";
240 require_once NOALYSS_TEMPLATE.
'/result_cat_card_summary.php';
243 echo
'<form method="GET" ACTION="export.php">' . dossier::hidden() ;
248 $hid->input(
"type",
"fiche") .
249 $hid->input(
"ac",
$http->request(
'ac')) .
250 $hid->input(
"fd_id",
$http->request(
'cat',
"number"));
258$export_pdf =
'<FORM METHOD="get" ACTION="export.php" style="display:inline">';
271$export_csv =
'<FORM METHOD="get" ACTION="export.php" style="display:inline">';
286 echo
h2(
'Date invalide !',
'class="error"');
287 alert(_(
'Date invalide !'));
293if (
$histo->selected == 8)
297 $export_csv =
'<FORM METHOD="get" ACTION="export.php" style="display:inline">';
316 $a_cat =
$cn->get_array(
"select fd_id from vw_fiche_def where ad_id=" .
ATTR_DEF_ACCOUNT .
" order by fd_label asc");
317 $nb_cat=count($a_cat);
318 for (
$i=0;
$i < $nb_cat;
$i++)
329if (
$histo->selected == 7)
334 $export_csv =
'<FORM METHOD="get" ACTION="export.php" style="display:inline">';
353 $a_cat =
$cn->get_array(
"select fd_id from vw_fiche_def where ad_id=" .
ATTR_DEF_ACCOUNT .
" order by fd_label asc");
354 $nb_cat=count($a_cat);
355 for (
$i=0;
$i < $nb_cat;
$i++)
377 echo
alert(_(
"Cette catégorie n'ayant pas de poste comptable n'a pas de balance"));
392 $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']));
393 if (
$cn->count() == 0)
397 echo _(
"Aucune fiche trouvée");
402 echo
'<h2>' .
$cn->get_value(
"select fd_label from fiche_def where fd_id=$1", array(
$afiche[
$e][
'fd_id'])) .
'</h2>';
403 $id=
"table_".$afiche[
$e][
'fd_id'].
"_id";
404 echo _(
'Filtre rapide:').HtmlInput::filter_table(
$id,
'0,1,2',
'1');
405 echo
'<table class="sortable" id="'.$id.
'" class="result" >';
407 th(_(
'Quick Code')) .
410 th(_(
'Débit'),
'style="text-align:right"') .
411 th(_(
'Crédit'),
'style="text-align:right"') .
412 th(_(
'Solde'),
'style="text-align:right"') .
413 th(_(
'D/C'),
'style="text-align:right"')
415 $idx = 0;$sum_deb=0;$sum_cred=0;$sum_solde=0;bcscale(4);
420 $filter =
" (j_date >= to_date('" .
$start.
"','DD.MM.YYYY') " .
421 " and j_date <= to_date('" .
$end .
"','DD.MM.YYYY')) ";
430 $class =(
$idx % 2 == 0) ?
'class="odd"':
'class="even"';
432 $sum_cred=bcadd($sum_cred,
$solde[
'credit']);
433 $sum_deb=bcadd($sum_deb,
$solde[
'debit']);
434 $sum_solde=bcsub($sum_deb,$sum_cred);
439 td(
nbm(
$solde[
'debit']),
'class="sorttable_numeric" sorttable_customkey="'.
$solde[
'debit'].
'" style="text-align:right"') .
440 td(
nbm(
$solde[
'credit']),
'class="sorttable_numeric" sorttable_customkey="'.
$solde[
'debit'].
'" style="text-align:right"') .
441 td(
nbm(abs(
$solde[
'solde'])),
'class="sorttable_numeric" sorttable_customkey="'.
$solde[
'solde'].
'" style="text-align:right"') .
453 td(
nbm($sum_deb),
'style="text-align:right"').
454 td(
nbm($sum_cred),
'style="text-align:right"').
455 td(
nbm(abs($sum_solde)),
'style="text-align:right"').
456 td(
findSide($sum_deb - $sum_cred) ,
'style="text-align:right"'),
457 ' class="highlight"');
481 $p_cat=
$http->request(
"cat",
"number");
525 if (count(
$letter->content) == 0)
529 echo
'<h2>' . $detail_card ;
533 echo
'<table class="result">';
537 echo
th(_(
'Interne'));
539 echo
th(_(
'Code Devise'));
540 echo
th(_(
'Devise'),
'style="text-align:right"');
541 echo
th(_(
'Débit'),
'style="width:auto;text-align:right" ');
542 echo
th(_(
'Crédit'),
'style="width:auto;text-align:right" ');
543 echo
th(_(
'Prog.'),
'style="text-align:right"');
554 if (
$row[
'letter']!=-1) {
555 $html_letter=strtoupper(base_convert(
$row[
'letter'],10,36));
558 echo
'<tr class="even" name="tr_'.$html_letter.
'_">';
560 echo
'<tr class="odd" name="tr_'.$html_letter.
'_">';
562 echo
td(
$row[
'j_date_fmt']);
563 echo
td(
h(
$row[
'jr_pj_number']));
565 echo
td(
h(
$row[
'jr_comment']));
566 echo
td(
$row[
'cr_code_iso']);
567 $str_currency_amount=(
$row[
'currency_id']==0)?
"":
nbm(
$row[
'currency_amount'],2);
569 echo
td($str_currency_amount,
'class="num"');
570 if (
$row[
'j_debit'] ==
't')
572 echo
td(
nbm(
$row[
'j_montant']),
' style="text-align:right"');
574 $prog = bcadd($prog,
$row[
'j_montant']);
580 echo
td(
nbm(
$row[
'j_montant']),
' style="text-align:right"');
582 $prog = bcsub($prog,
$row[
'j_montant']);
585 echo
td(
nbm(abs($prog)) .
$side,
'style="text-align:right"');
587 if (
$row[
'letter']!=-1) {
589 if (
$row[
'letter_diff'] != 0)
591 echo
'<td>'.HtmlInput::show_reconcile(
"", $html_letter,$span_error).
'</td>';
604 echo
td(_(
'Credit'));
607 echo
'<tr class="highlight">';
614 $s = _(
'solde débiteur');
616 $s = _(
'solde crediteur');
618 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.
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
h( $row[ 'oa_description'])
if(! empty( $error)) for($i=0;$i< count($error);$i++)( $last !=$error[$i]) $last
if($action=='add_line') if( $action=='remove_line') if($action=='remove_cat') if(isset($_POST['change_name'])) if($action=='save_line') if(isset($_POST['add_modele'])) $fiche_def
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, $pFd_id, $p_order='')
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...
For the periode tables parm_periode and jrn_periode.
if( $histo->selected==-1) if($histo->selected==3) $cat
$categorie
Show first the form.
create_script($p_string)
create the HTML for adding the script tags around of the script
navigation_bar($p_offset, $p_line, $p_size=0, $p_page=1, $p_javascript="")
Create a navigation_bar (pagesize)