26if ( ! defined (
'ALLOWED') ) die(
'Appel direct ne sont pas permis');
27include_once NOALYSS_INCLUDE.
'/lib/ac_common.php';
28include_once NOALYSS_INCLUDE.
'/class/acc_balance.class.php';
39echo
'<div class="content">';
43echo
'<form method="GET" onsubmit="return waiting_box()">';
44echo
_(
'Choisissez un autre exercice').
" : ";
46$js=sprintf(
"updatePeriode(%d,'%s','%s','%s',1)",Dossier::id(),
'exercice',
'from_periode',
'to_periode');
49echo dossier::hidden();
50echo HtmlInput::get_to_hidden(array(
'ac',
'type'));
54echo HtmlInput::get_to_hidden(array(
'ac'));
55echo HtmlInput::hidden(
'type',
'bal');
56echo dossier::hidden();
91echo
" "._(
'jusque').
' :'.
$input_to->input();
93echo HtmlInput::button_action(
_(
'Avancé'),
" if (\$('balance_advanced_div').style.display=='none') { \$('balance_advanced_div').show();} else { \$('balance_advanced_div').hide();}",uniqid(),
"smallbutton");
95echo
'<div id="balance_advanced_div" style="display:none">';
112echo
'<ul style="list-style-type:none">';
116echo
'<li>'.$rad->input(
'p_filter',0)._(
'Aucun filtre, tous les journaux').
'</li>';
120echo
'<li>'.$rad->input(
'p_filter',1)._(
'Filtré par journal');
121echo HtmlInput::button_choice_ledger(array(
'div'=>
'',
'type'=>
'ALL',
'all_type'=>1));
127echo
'<li>'.$rad->input(
'p_filter',2)._(
'Filtré par catégorie').HtmlInput::select_cat(
$array_cat).
'</li>';
130echo
_(
'Totaux par sous-niveaux');
139echo
'<ul style="list-style-type:none">';
141if (
$http->get(
'lvl1',
"string",
false) !==
false)
143if (
$http->get(
'lvl2',
"string",
false) !==
false)
145if (
$http->get(
'lvl3',
"string",
false) !==
false)
147echo
'<li>'.$ck_lev1->input()._(
'Niveau 1').
'</li>';
148echo
'<li>'.$ck_lev2->input()._(
'Niveau 2').
'</li>';
149echo
'<li>'.$ck_lev3->input()._(
'Niveau 3').
'</li>';
153if (
$http->get(
'unsold',
"string",
false) !==
false)
158if (
$http->get(
'previous_exc',
"string",
false) !==
false)
164$from_poste->set_attribute(
'ipopup',
'ipop_account');
165$from_poste->set_attribute(
'label',
'from_poste_label');
173$to_poste->set_attribute(
'ipopup',
'ipop_account');
174$to_poste->set_attribute(
'label',
'to_poste_label');
175$to_poste->set_attribute(
'account',
'to_poste');
183echo
" "._(
"jusque").
" :".
$to_poste->input();
188echo
_(
"Uniquement comptes non soldés").
" ".
$unsold->input();
191echo
_(
"Avec la balance de l'année précédente").
" ".
$previous_exc->input();
194echo
_(
'Indiquer le type de poste');
195echo
'<span class="text-muted">',
_(
"actif, passif,charge,..."),
'</span>';
204 <?php echo
_(
"Récapitulatif par classe")?>
215echo HtmlInput::submit(
"view",
_(
"Visualisation"));
222if ( isset (
$_GET[
'view'] ) )
235 echo
'<TD><form method="GET" ACTION="export.php" ';
236 $id=uniqid(
"export_");
237 printf(
'id="%s" onsubmit="download_document_form(\'%s\')">',
$id,
$id);
239 echo dossier::hidden().
240 HtmlInput::submit(
'bt_pdf',
"Export PDF").
241 HtmlInput::hidden(
"ac",
$http->request(
'ac')).
242 HtmlInput::hidden(
"act",
"PDF:balance").
246 echo HtmlInput::hidden(
'p_filter',
$filter);
252 echo HtmlInput::hidden(
"r_cat[$e]",
$e);
256 echo HtmlInput::get_to_hidden(array(
'lvl1',
'lvl2',
'lvl3',
'unsold',
'previous_exc'));
260 echo
'<TD><form method="GET" ACTION="export.php" ';
261 $id=uniqid(
"export_");
262 printf(
'id="%s" onsubmit="download_document_form(\'%s\')">',
$id,
$id);
265 echo HtmlInput::submit(
'bt_csv',
"Export CSV").
267 HtmlInput::hidden(
"act",
"CSV:balance").
270 echo HtmlInput::get_to_hidden(array(
'ac'));
271 echo HtmlInput::hidden(
'p_filter',
$filter);
286 echo
'<td style="vertical-align:top">';
316 $bal->from_poste=
$http->get(
'from_poste');
318 if ( isset(
$_GET[
'unsold']))
$bal->unsold=
true;
329 echo
'<h2 class="h-section">';
330 printf (
_(
"période du %s au %s"),
$a[
'p_start'],
$b[
'p_end']);
332 echo
'<span style="display:block">';
333 echo
_(
'Cherche').Icon_Action::infobulle(24);
334 echo HtmlInput::filter_table(
"t_balance",
"0,1",
"1");
336 echo
'<table id="t_balance" width="100%">';
337 echo
'<th>'._(
"Poste Comptable").
'</th>';
338 echo
'<th>'._(
"Libellé").
'</th>';
340 echo
'<th style="text-align:right;">'._(
"Débit N-1").
'</th>';
341 echo
'<th style="text-align:right;">'._(
'Crédit N-1').
'</th>';
342 echo
'<th style="text-align:right;">'._(
'Solde N-1').
'</th>';
345 echo
'<th style="text-align:right;">'._(
'Ouverture').
'</th>';
346 echo
'<th style="text-align:right;">'._(
'Débit').
'</th>';
347 echo
'<th style="text-align:right;">'._(
'Crédit').
'</th>';
348 echo
'<th style="text-align:right;">'._(
'Solde').
'</th>';
352 $a_sum=array(
'sum_cred',
'sum_deb',
'solde_deb',
'solde_cred',
'sum_deb_ope',
'sum_cred_ope',
'sum_cred_previous',
'sum_deb_previous',
'solde_previous');
355 $a_sum=array(
'sum_cred',
'sum_deb',
'solde_deb',
'solde_cred',
'sum_deb_ope',
'sum_cred_ope') ;
380 $view_history=HtmlInput::history_account(
$r[
'poste'],
$r[
'poste'],
"",
$exercice);
382 $r[
'solde_previous']=bcsub(
$r[
'solde_deb_previous'],
$r[
'solde_cred_previous']);
387 foreach (array(3,2,1) as
$ind)
389 if ( ! isset(
$_GET[
'lvl'.
$ind]))
continue;
390 if (${
'lvl'.$ind.
'_old'} ==
'') ${
'lvl'.$ind.
'_old'}=mb_substr(
$r[
'poste'],0,
$ind);
391 if ( ${
'lvl'.$ind.
'_old'} != mb_substr(
$r[
'poste'],0,
$ind))
394 echo
'<tr class="highlight">';
395 echo
td(${
'lvl'.$ind.
'_old'},
'style="font-weight:bold;"');
396 echo
td(${
'lvl'.$ind.
'_old'}.
" ".
_(
"Total niveau").
" ".
$ind,
'style="font-weight:bold;"');
400 echo
td(
nbm(${
'lvl'.$ind}[
'sum_deb_previous']),
'class="previous_year" style="font-weight:bold;"');
401 echo
td(
nbm(${
'lvl'.$ind}[
'sum_cred_previous']),
' class="previous_year" style="font-weight:bold;" ');
402 $delta_previous=${
'lvl'.$ind}[
'solde_previous'];
403 $side_previous=($delta_previous > 0 ) ?
"D":
"C";
404 echo
td(
nbm(abs($delta_previous)).
" $side_previous",
'class="previous_year" style="text-align:right;font-weight:bold;" ');
409 $solde3=bcsub(${
'lvl'.$ind}[
'sum_deb_ope'],${
'lvl'.$ind}[
'sum_cred_ope']);
410 $side3=($solde3<0)?
" C":
" D";
411 $side3=($solde3==0)?
" ":$side3;
412 echo
td(
nbm(abs($solde3)).$side3,
'style="text-align:right;font-weight:bold;"');
415 $solde_deb=bcsub(${
'lvl'.$ind}[
'sum_deb'],${
'lvl'.$ind}[
'sum_deb_ope']);
416 echo
td(
nbm($solde_deb),
'style="text-align:right;font-weight:bold;"');
419 $solde_cred=bcsub(${
'lvl'.$ind}[
'sum_cred'],${
'lvl'.$ind}[
'sum_cred_ope']);
420 echo
td(
nbm($solde_cred),
'style="text-align:right;font-weight:bold;"');
421 $delta=bcsub(${
'lvl'.$ind}[
'solde_cred'],${
'lvl'.$ind}[
'solde_deb']);
423 echo
td(
nbm(abs(
$delta)).
" $side",
'style="text-align:right;font-weight:bold;" ');
426 ${
'lvl'.$ind.
'_old'}=mb_substr(
$r[
'poste'],0,
$ind);
441 if (
$r[
'poste'] ==
"") {
447 echo
'<TR class="'.$tr.
'">';
448 echo
td($view_history);
452 $label .= sprintf(
"<span class=\"text-70 text-muted\">(%s)</span>",
$r[
'type']);
454 if (isset (
$r[
'type']) && in_array(
$r[
'type'],array(
'CHA',
'ACT',
'PASINV',
'PROINV')) &&
$r[
'sum_deb']<
$r[
'sum_cred'])
457 $label.=
" ".Icon_Action::warnbulle(85);
459 if (isset (
$r[
'type']) && in_array(
$r[
'type'],array(
'PRO',
'PAS',
'ACTINV',
'CHAINV')) &&
$r[
'sum_deb']>
$r[
'sum_cred'])
462 $label.=
" ".Icon_Action::warnbulle(86);
468 echo
td(
nbm(
$r[
'sum_deb_previous']),
' class="previous_year"');
469 echo
td(
nbm(
$r[
'sum_cred_previous']),
' class="previous_year" ');
470 $solde_previous=bcsub(
$r[
'solde_deb_previous'],
$r[
'solde_cred_previous']);
471 $side=($solde_previous<0)?
"C":
"D";
473 $r[
'solde_previous']=$solde_previous;
474 echo
td(
nbm(abs($solde_previous)).
" ".
$side,
' class="previous_year"');
478 $r[
'sum_deb_previous'],
479 $r[
'sum_cred_previous']);
482 $solde=bcsub(
$r[
'sum_deb_ope'],
$r[
'sum_cred_ope']);
486 echo
td(
nbm(bcsub(
$r[
'sum_deb'],
$r[
'sum_deb_ope'])),
'style="text-align:right;"');
487 echo
td(
nbm(bcsub(
$r[
'sum_cred'],
$r[
'sum_cred_ope'])),
'style="text-align:right;"');
489 $solde2=bcsub(
$r[
'sum_deb'],
$r[
'sum_cred']);
490 $side=($solde2 < 0)?
" C":
" D";
493 echo
td(
nbm(abs($solde2)).
$side,
'style="text-align:right;"');
495 if ( isset(
$_GET[
'lvl1']) || isset(
$_GET[
'lvl2']) || isset(
$_GET[
'lvl3'])) echo
'<td></td>';
500 if ( DEBUGNOALYSS>1) echo \Noalyss\Dbg::hidden_info(
"\$row",
$row);
504 echo
'<div style="float:left;margin-right:50px">';
506 echo
_(
"Résumé Exercice précédent");
511 echo
'<div style="float:left">';
513 echo
_(
"Résumé Exercice courant");
get_array_column($p_array, $key)
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
catch(Exception $e) $exercice
_("actif, passif,charge,...")
for($i=0;$i<=6;$i++) $ind
Class for manipulating data to print the balance of account.
static array_cat()
create an array of the existing cat, to be used in a checkbox form
about the accountancy period (usually 1 year starting in January until december) = exercice
Generate the form for the periode Data Members.
show a button, for selecting a account and a input text for manually inserting an account the differe...
catch(Exception $exc) $summary_tab
foreach($a_sum as $a) $lvl1_old
for($e=2;$e< $nb_col;$e++) $a_sum