echo '<table style="width:100%;margin-left:0%">'; foreach ($a_poste as $poste_id) { $Poste = new Acc_Account_Ledger($cn, $poste_id['pcm_val']); $Poste->load(); $Poste->get_row_date($_GET['from_periode'], $_GET['to_periode'], $_GET['ople']); if (empty($Poste->row)) { continue; } echo '<tr><td class="mtitle" style="width:auto" colspan="6"><h2 class="title">' . $poste_id['pcm_val'] . ' ' . h($Poste->label) . '</h2></td></tr>'; $detail = $Poste->row[0]; $old = array(); foreach ($Poste->row as $detail) { /* avoid duplicates */ if (in_array($detail['jr_id'], $old) == TRUE) { continue; } $old[] = $detail['jr_id']; echo tr(td("Journal :" . $detail['jrn_def_name'], ''), 'style="width:auto" colspan="6"'); echo '<tr><td class="mtitle" style="width:auto" colspan="6">' . $detail['j_date'] . ' ' . $detail['jr_internal'] . ' ' . hb($detail['description']) . ' ' . hi($detail['jr_pj_number']) . '</td></tr>'; $op = new Acc_Operation($cn); $op->poste = $poste_id['pcm_val']; $op->jr_id = $detail['jr_id']; echo $op->display_jrnx_detail(1); } } echo '</table>'; echo Acc_Account_Ledger::HtmlTableHeader(); } exit; } }
function HtmlTableDetail($p_array = null, $op_let = 0) { if ($p_array == null) { $p_array = $_REQUEST; } $name = $this->getName(); list($array, $tot_deb, $tot_cred) = $this->get_row_date($p_array['from_periode'], $p_array['to_periode'], $op_let); if (count($this->row) == 0) { return; } $qcode = $this->strAttribut(ATTR_DEF_QUICKCODE); $rep = ""; $already_seen = array(); echo '<h2 class="info">' . $this->id . " " . $name . '</h2>'; echo "<TABLE class=\"result\" style=\"width:100%;border-collapse:separate;border-spacing:5px\">"; echo "<TR>" . "<TH>" . _("n° de pièce / Code interne") . " </TH>" . "<TH>" . _("Date") . "</TH>" . "<TH>" . _("Description") . " </TH>" . "<TH>" . _('Montant') . " </TH>" . "<TH> " . _('Débit/Crédit') . " </TH>" . "</TR>"; foreach ($this->row as $op) { if (in_array($op['jr_internal'], $already_seen)) { continue; } else { $already_seen[] = $op['jr_internal']; } echo "<TR style=\"text-align:center;background-color:lightgrey\">" . "<td>" . $op['jr_pj_number'] . " / " . $op['jr_internal'] . "</td>" . "<td>" . $op['j_date'] . "</td>" . "<td>" . h($op['description']) . "</td>" . "<td>" . "</td>" . "<td>" . "</td>" . "</TR>"; $ac = new Acc_Operation($this->cn); $ac->jr_id = $op['jr_id']; $ac->qcode = $qcode; echo $ac->display_jrnx_detail(1); } $solde_type = $tot_deb > $tot_cred ? _("solde débiteur") : _("solde créditeur"); $diff = round(abs($tot_deb - $tot_cred), 2); echo "<TR>" . "<TD>{$solde_type}" . "<TD>{$diff}</TD>" . "<TD></TD>" . "<TD>{$tot_deb}</TD>" . "<TD>{$tot_cred}</TD>" . "</TR>"; echo "</table>"; return; }