function display_html() { $idx = 0; $r = ""; //---Html $array = $this->load(); if (is_array($array) == false || empty($array)) { return 0; } $r .= '<table class="result" style="width=100%">'; $r .= '<tr>' . '<th>' . _('Date') . '</th>' . '<th>' . _('Poste') . '</th>' . '<th>' . _('Quick_code') . '</th>' . '<th>' . _('Analytique') . '</th>' . th(_('Description')) . '<th>' . _('libelle') . '</th>' . '<th>' . _('Num.interne') . '</th>' . '<th>' . _('Montant') . '</th>' . '<th>' . _('D/C') . '</th>' . '</tr>'; foreach ($array as $row) { $class = $idx % 2 == 0 ? 'even' : 'odd'; $idx++; $r .= '<tr class="' . $class . '">'; $detail = $row['jr_id'] != null ? HtmlInput::detail_op($row['jr_id'], $row['jr_internal']) : ''; $post_detail = $row['j_poste'] != null ? HtmlInput::history_account($row['j_poste'], $row['j_poste']) : ''; $card_detail = $row['f_id'] != null ? HtmlInput::history_card($row['f_id'], $row['qcode']) : ''; $r .= '<td>' . $row['oa_date'] . '</td>' . td($post_detail) . td($card_detail) . '<td>' . h($row['po_name']) . '</td>' . '<td>' . h($row['oa_description']) . '</td>' . td($row['jr_comment']) . '<td>' . $detail . '</td>' . '<td class="num">' . nbm($row['oa_amount']) . '</td>' . '<td>' . ($row['oa_debit'] == 'f' ? 'CREDIT' : 'DEBIT') . '</td>'; $r .= '</tr>'; } $r .= '</table>'; return $r; }
$aCard = Database::fetch_array($ret, $i); $oCard = new Fiche($cn, $aCard['f_id']); $solde = $oCard->get_solde_detail($filter); if ($solde['debit'] == 0 && $solde['credit'] == 0) { continue; } /* only not purged card */ if ($_GET['histo'] == 5 && $solde['debit'] == $solde['credit']) { continue; } $class = $idx % 2 == 0 ? 'class="odd"' : 'class="even"'; $idx++; $sum_cred = bcadd($sum_cred, $solde['credit']); $sum_deb = bcadd($sum_deb, $solde['debit']); $sum_solde = bcsub($sum_deb, $sum_cred); echo tr(td(HtmlInput::history_card($oCard->id, $oCard->strAttribut(ATTR_DEF_QUICKCODE))) . td($oCard->strAttribut(ATTR_DEF_NAME)) . td(HtmlInput::history_account($oCard->strAttribut(ATTR_DEF_ACCOUNT), $oCard->strAttribut(ATTR_DEF_ACCOUNT))) . td(nbm($solde['debit']), 'class="sorttable_numeric" sorttable_customkey="' . $solde['debit'] . '" style="text-align:right"') . td(nbm($solde['credit']), 'class="sorttable_numeric" sorttable_customkey="' . $solde['debit'] . '" style="text-align:right"') . td(nbm(abs($solde['solde'])), 'class="sorttable_numeric" sorttable_customkey="' . $solde['solde'] . '" style="text-align:right"') . td($solde['debit'] < $solde['credit'] ? 'C' : 'D', 'style="text-align:right"'), $class); } echo '<tfoot>'; echo tr(td('') . td(_('Totaux')) . td('') . td(nbm($sum_deb), 'style="text-align:right"') . td(nbm($sum_cred), 'style="text-align:right"') . td(nbm(abs($sum_solde)), 'style="text-align:right"') . td($sum_deb < $sum_cred ? 'C' : 'D', 'style="text-align:right"'), ' class="highlight"'); echo '</tfoot>'; echo '</table>'; } if ($allcard == 0) { echo $str_add_card; } echo $export_pdf; echo $export_csv; echo $export_print; return; } /***********************************************************************************************************************************
echo _("Résultat"); if (count($a_qcode) == 0) { echo " OK {$g_succeed}"; } else { echo " " . _('Attention ') . $g_failed; } ?> <ol> <?php for ($i = 0; $i < count($a_qcode); $i++) { $poste = $cn->execute('get_poste', array($a_qcode[$i]['j_qcode'])); ?> <li><?php echo HtmlInput::card_detail($a_qcode[$i]["j_qcode"], $a_qcode[$i]["j_qcode"], ' style="display:inline"'); echo " "; echo HtmlInput::history_card($a_qcode[$i]["f_id"], _("Hist."), ' display:inline'); ?> </li> <ul> <?php $all_dep = Database::fetch_all($poste); for ($e = 0; $e < count($all_dep); $e++) { ?> <li> <?php echo HtmlInput::history_account($all_dep[$e]['j_poste'], $all_dep[$e]['j_poste'], ' display:inline '); ?> <?php echo h($all_dep[$e]['pcm_lib']); ?>
function display_html() { bcscale(2); if ($this->check() != 0) { alert('Désolé mais une des dates données n\'est pas valide'); return; } //--------------------------------------------------------------------------- // Card - Acc //--------------------------------------------------------------------------- if ($this->card_poste == '1') { $this->load_card(); /* * Show all the result */ $tot_card = 0; $prev = ''; echo '<table class="result" style="margin-left:5px;margin-top:5px">'; $tot_glob = 0; for ($i = 0; $i < count($this->arow); $i++) { if ($i == 0) { $prev = $this->arow[$i]['f_id']; echo '<tr><td>' . HtmlInput::history_card($this->arow[$i]['f_id'], $this->arow[$i]['j_qcode'] . ' ' . $this->arow[$i]['name'], ' display:inline') . '</td></tr>'; } $style = $i % 2 == 0 ? ' class="odd" ' : ' class="even" '; if ($i != 0 && $prev != $this->arow[$i]['f_id']) { echo td('Total'); echo td(nbm($tot_card), ' class="num"'); echo '</tr>'; echo '<tr style="padding-top:5px"><td>' . HtmlInput::history_card($this->arow[$i]['f_id'], $this->arow[$i]['j_qcode'] . ' ' . $this->arow[$i]['name'], ' display:inline ') . '</td></tr>'; $tot_card = 0; $prev = $this->arow[$i]['f_id']; } echo '<tr ' . $style . '>'; $amount = $this->arow[$i]['sum_amount']; if ($amount == null) { $amount = 0; } $tot_card = bcadd($tot_card, $amount); $tot_glob = bcadd($tot_glob, $amount); echo td($this->arow[$i]['po_name'] . " " . $this->arow[$i]['po_description'], 'style="padding-left:10"'); echo td(nbm($amount), ' class="num" '); echo '</tr>'; } echo '<tr>'; echo td('Total'); echo td(nbm($tot_card), ' class="num"'); echo '</tr>'; echo '</table>'; echo '<h2> Résultat global ' . nbm($tot_glob) . '</h2>'; } //--------------------------------------------------------------------------- // Accountancy - Analytic //--------------------------------------------------------------------------- if ($this->card_poste == '2') { $this->load_poste(); /* * Show all the result */ $tot_card = 0; $prev = ''; echo '<table class="result" style="margin-left:20px;margin-top:5px">'; $tot_glob = 0; for ($i = 0; $i < count($this->arow); $i++) { if ($i == 0) { $prev = $this->arow[$i]['j_poste']; echo '<tr><td>' . HtmlInput::history_account($this->arow[$i]['j_poste'], $this->arow[$i]['j_poste'] . ' ' . $this->arow[$i]['name'], ' display:inline') . '</td></tr>'; } $style = $i % 2 == 0 ? ' class="odd" ' : ' class="even" '; if ($i != 0 && $prev != $this->arow[$i]['j_poste']) { echo td('Total'); echo td(nbm($tot_card), ' class="num"'); echo '</tr>'; echo '<tr style="padding-top:5px"><td>' . HtmlInput::history_account($this->arow[$i]['j_poste'], $this->arow[$i]['j_poste'] . ' ' . $this->arow[$i]['name'], ' display:inline ') . '</td></tr>'; $tot_card = 0; $prev = $this->arow[$i]['j_poste']; } echo '<tr ' . $style . '>'; $amount = $this->arow[$i]['sum_amount']; if ($amount == null) { $amount = 0; } $tot_card = bcadd($tot_card, $amount); $tot_glob = bcadd($tot_glob, $amount); echo td($this->arow[$i]['po_name'] . " " . $this->arow[$i]['po_description'], 'style="padding-left:10"'); echo td(nbm($amount), ' class="num" '); echo '</tr>'; } echo '<tr>'; echo td('Total'); echo td(nbm($tot_card), ' class="num"'); echo '</tr>'; echo '</table>'; echo td(nbm($tot_card), ' class="num"'); } //--------------------------------------------------------------------------- // Acc after card //--------------------------------------------------------------------------- if ($this->card_poste == '3') { $this->load_anc_card(); /* * Show all the result */ $tot_card = 0; $prev = ''; echo '<table class="result" style="margin-left:20px;margin-top:5px">'; $tot_glob = 0; for ($i = 0; $i < count($this->arow); $i++) { if ($i == 0) { $prev = $this->arow[$i]['po_id']; echo '<tr><td>' . $this->arow[$i]['po_name'] . " " . $this->arow[$i]['po_description'] . '</td></tr>'; } $style = $i % 2 == 0 ? ' class="odd" ' : ' class="even" '; if ($i != 0 && $prev != $this->arow[$i]['po_id']) { echo td('Total'); echo td(nbm($tot_card), ' class="num"'); echo '</tr>'; echo '<tr><td>' . $this->arow[$i]['po_name'] . " " . $this->arow[$i]['po_description'] . '</td></tr>'; $tot_card = 0; $prev = $this->arow[$i]['po_id']; } echo '<tr ' . $style . '>'; $amount = $this->arow[$i]['sum_amount']; if ($amount == null) { $amount = 0; } $tot_card = bcadd($tot_card, $amount); $tot_glob = bcadd($tot_glob, $amount); echo '<td style="padding-left:10">' . HtmlInput::history_card($this->arow[$i]['f_id'], $this->arow[$i]['j_qcode'] . ' ' . $this->arow[$i]['name'], ' display:inline') . '</td>'; echo td(nbm($amount), ' class="num" '); echo '</tr>'; } echo '<tr>'; echo td('Total'); echo td(nbm($tot_card), ' class="num"'); echo '</tr>'; echo '</table>'; echo td(nbm($tot_card), ' class="num"'); } //--------------------------------------------------------------------------- // Analytic - Accountancy //--------------------------------------------------------------------------- if ($this->card_poste == '4') { $this->load_anc_account(); /* * Show all the result */ $tot_card = 0; $prev = ''; echo '<table class="result" style="margin-left:20px;margin-top:5px">'; $tot_glob = 0; for ($i = 0; $i < count($this->arow); $i++) { if ($i == 0) { $prev = $this->arow[$i]['po_id']; echo '<tr><td>' . $this->arow[$i]['po_name'] . " " . $this->arow[$i]['po_description'] . '</td></tr>'; } $style = $i % 2 == 0 ? ' class="odd" ' : ' class="even" '; if ($i != 0 && $prev != $this->arow[$i]['po_id']) { echo td('Total'); echo td(nbm($tot_card), ' class="num"'); echo '</tr>'; $tot_card = 0; $prev = $this->arow[$i]['po_id']; echo '<tr><td>' . $this->arow[$i]['po_name'] . " " . $this->arow[$i]['po_description'] . '</td></tr>'; } echo '<tr ' . $style . '>'; $amount = $this->arow[$i]['sum_amount']; if ($amount == null) { $amount = 0; } $tot_card = bcadd($tot_card, $amount); $tot_glob = bcadd($tot_glob, $amount); echo '<td style="padding-left:10">' . HtmlInput::history_account($this->arow[$i]['j_poste'], $this->arow[$i]['j_poste'] . ' ' . $this->arow[$i]['name'], ' display:inline') . '</td>'; echo td(nbm($amount), ' class="num" '); echo '</tr>'; } echo '<tr>'; echo td('Total'); echo td(nbm($tot_card), ' class="num"'); echo '</tr>'; echo '</table>'; echo '<h2> Résultat global ' . nbm($tot_glob) . '</h2>'; } }
function display_html() { $r = ""; //---Html $array = $this->load(); if (is_array($array) == false || empty($array)) { return 0; } $r .= '<table class="result" style="width:100%">'; $ix = 0; $prev = 'xx'; $idx = 0; $tot_deb = $tot_cred = 0; bcscale(2); foreach ($array as $row) { if ($prev != $row['po_name']) { if ($ix > 0) { $r .= '<tr>'; $tot_solde = bcsub($tot_cred, $tot_deb); $sign = " " . ($tot_solde > 0) ? 'C' : 'D'; $r .= td('') . td('') . td(''); $r .= td('') . td('') . td('') . td('') . td('') . td(nbm($tot_deb), ' class="num"') . td(nbm($tot_cred), ' class="num"') . td(nbm($tot_solde) . $sign, ' class="num notice"'); } $r .= '<tr>' . '<td colspan="7" style="width:auto">' . '<h2>' . h($row['po_name'] . ' ' . $row['po_description']) . '</td></tr>'; $r .= '<tr>' . '<th>' . '</th>' . '<th>' . _('Date') . '</th>' . '<th>' . _('Poste') . '</th>' . '<th>' . _('Quick_code') . '</th>' . '<th>' . _('Libellé') . '</th>' . '<th>' . '</th>' . '<th>' . _('Pièce') . '</th>' . '<th>' . _('Interne') . '</th>' . '<th style="text-align:right">' . _('Débit') . '</th>' . '<th style="text-align:right">' . _('Crédit') . '</th>' . '<th style="text-align:right">' . _('Prog.') . '</th>' . '</tr>'; $tot_deb = $tot_cred = 0; $prev = $row['po_name']; $ix++; } $class = $idx % 2 == 0 ? 'even' : 'odd'; $idx++; $r .= '<tr class="' . $class . '">'; $detail = $row['jr_id'] != null ? HtmlInput::detail_op($row['jr_id'], $row['jr_internal']) : ''; $post_detail = $row['j_poste'] != null ? HtmlInput::history_account($row['j_poste'], $row['j_poste']) : ''; $card_detail = $row['f_id'] != null ? HtmlInput::history_card($row['f_id'], $row['qcode']) : ''; $amount_deb = $row['oa_debit'] == 't' ? $row['oa_amount'] : 0; $amount_cred = $row['oa_debit'] == 'f' ? $row['oa_amount'] : 0; $tot_deb = bcadd($tot_deb, $amount_deb); $tot_cred = bcadd($tot_cred, $amount_cred); $tot_solde = bcsub($tot_cred, $tot_deb); /* * Checked button */ $str_ck = ""; $str_document = ""; if ($row['jr_id'] != null) { /* * Get receipt info */ $str_document = HtmlInput::show_receipt_document($row['jr_id']); if ($str_document != "") { $ck = new ICheckBox('ck[]', $row['jr_id']); $str_ck = $ck->input(); } } $r .= '<td>' . $str_ck . '</td>' . '<td>' . $row['oa_date'] . '</td>' . td($post_detail) . td($card_detail) . td($row['jr_comment']) . '<td>' . $str_document . '</td>' . td($row['jr_pj_number']) . '<td>' . $detail . '</td>' . '<td class="num">' . nbm($amount_deb) . '</td>' . '<td class="num">' . nbm($amount_cred) . '</td>' . '<td class="num">' . nbm($tot_solde) . '</td>'; $r .= '</tr>'; } $r .= '<tr>'; $tot_solde = bcsub($tot_cred, $tot_deb); $sign = $tot_solde > 0 ? 'C' : 'D'; $r .= td('') . td('') . td(''); $r .= td('') . td('') . td('') . td('') . td('') . td(nbm($tot_deb), ' class="num"') . td(nbm($tot_cred), ' class="num"') . td(nbm($tot_solde) . $sign, ' class="num notice"'); $r .= '</table>'; return $r; }
function display_html() { bcscale(2); if ($this->check() != 0) { alert('Désolé mais une des dates données n\'est pas valide'); return; } if ($this->card_poste == '1') { $this->load_card(); echo '<table class="result">'; echo '<tr>'; echo th('Fiche'); foreach ($this->aheader as $h) { echo '<th style="text-align:right">' . h($h['po_name']) . '</th>'; } echo th('Total', ' style="text-align:right"'); echo '</tr>'; /* * Show all the result */ $tot_global = 0; for ($i = 0; $i < count($this->arow); $i++) { $tr = $i % 2 == 0 ? '<tr class="even">' : '<tr class="odd">'; echo $tr; echo td(HtmlInput::history_card($this->arow[$i]['f_id'], $this->arow[$i]['card_account'] . ' ' . $this->arow[$i]['name'])); $tot_row = 0; for ($x = 0; $x < count($this->aheader); $x++) { $amount = $this->db->get_value($this->sql, array($this->arow[$i]['f_id'], $this->aheader[$x]['po_id'])); if ($amount == null) { $amount = 0; } if (isset($tot_col[$x])) { $tot_col[$x] = bcadd($tot_col[$x], $amount); } else { $tot_col[$x] = $amount; } echo td(nbm($amount), ' class="num" '); $tot_row = bcadd($tot_row, $amount); } echo td(nbm($tot_row), ' class="num"'); $tot_global = bcadd($tot_global, $tot_row); echo '</tr>'; } echo '<tr>'; echo td('Totaux'); for ($i = 0; $i < count($this->aheader); $i++) { echo td(nbm($tot_col[$i]), ' class="num"'); } echo td(nbm($tot_global), ' class="num input_text notice" '); echo '</tr>'; echo '</table>'; } if ($this->card_poste == '2') { $this->load_poste(); echo '<table class="result">'; echo '<tr>'; echo th('poste comptable '); foreach ($this->aheader as $h) { echo '<th style="text-align:right">' . h($h['po_name']) . '</th>'; } echo th('Total', ' style="text-align:right"'); echo '</tr>'; /* * Show all the result */ $tot_global = 0; for ($i = 0; $i < count($this->arow); $i++) { $tr = $i % 2 == 0 ? '<tr class="even">' : '<tr class="odd">'; echo $tr; echo td(HtmlInput::history_account($this->arow[$i]['card_account'], $this->arow[$i]['card_account'] . ' ' . $this->arow[$i]['name'])); $tot_row = 0; for ($x = 0; $x < count($this->aheader); $x++) { $amount = $this->db->get_value($this->sql, array($this->arow[$i]['card_account'], $this->aheader[$x]['po_id'])); if ($amount == null) { $amount = 0; } if (isset($tot_col[$x])) { $tot_col[$x] = bcadd($tot_col[$x], $amount); } else { $tot_col[$x] = $amount; } echo td(nbm($amount), ' class="num" '); $tot_row = bcadd($tot_row, $amount); } echo td(nbm($tot_row), ' class="num"'); $tot_global = bcadd($tot_global, $tot_row); echo '</tr>'; } echo '<tr>'; echo td('Totaux'); for ($i = 0; $i < count($this->aheader); $i++) { echo td(nbm($tot_col[$i]), ' class="num"'); } echo td(nbm($tot_global), ' class="num input_text notice" '); echo '</tr>'; echo '</table>'; } }