function header_txt($p_cn) { $own = new own($p_cn); $soc = $own->MY_NAME; $date = date('d / m / Y H:i '); $dossier = utf8_decode(" Dossier : " . dossier::name()); return $dossier . " " . $soc . " " . $date; }
if ($access == 'L') { $str = 'Local Admin'; $admin = 1; } elseif ($access == 'R') { $str = ' Utilisateur normal'; } elseif ($access == 'P') { $str = ' Extension uniquement'; } if ($SecUser->admin == 1) { $str = ' Super Admin'; $admin = 1; } //----------------------------------------------------- // Print result $pdf = new PDF($cn); $pdf->setDossierInfo(dossier::name() . ' Sécurité'); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetAuthor('NOALYSS'); $pdf->setTitle("Sécurité", true); $str_user = sprintf("( %d ) %s %s [ %s ] - %s", $SecUser->id, $SecUser->first_name, $SecUser->name, $SecUser->login, $str); $pdf->SetFont('DejaVu', 'B', 9); $pdf->Cell(0, 7, $str_user, 'B', 0, 'C'); $pdf->Ln(); if ($SecUser->active == 0) { $pdf->SetTextColor(255, 0, 34); $pdf->Cell(0, 7, 'Bloqué', 0, 0, 'R'); $pdf->Ln(); } if ($SecUser->admin == 1) { $pdf->SetTextColor(0, 0, 0);
function display_pdf() { $array = $this->load(); if (empty($array)) { return; } $pdf = new PDF($this->db); $pdf->Setdossierinfo(dossier::name()); $pdf->setTitle("Balance analytique", true); $pdf->SetAuthor('NOALYSS'); $pdf->AliasNbPages(); $pdf->AddPage(); $pa = new Anc_Plan($this->db, $this->pa_id); $pa->get(); $pb = new Anc_Plan($this->db, $this->pa_id2); $pb->get(); $pdf->SetFont('DejaVu', 'B', 9); $pdf->Cell(0, 7, sprintf("Balance croise plan %s %s ", $pa->name, $pb->name), 1, 0, 'C'); $filtre_date = ""; $filtre_pa = ""; $filtre_pb = ""; if ($this->from != "" || $this->to != "") { $filtre_date = sprintf("Filtre date %s %s", $this->from, $this->to); } if ($this->from_poste != "" || $this->to_poste != "") { $filtre_pa = sprintf("Filtre poste plan1 %s %s", $this->from_poste != "" ? "de " . $this->from_poste : " ", $this->to_poste != "" ? "jusque " . $this->to_poste : ""); } if ($this->from_poste2 != "" || $this->to_poste2 != "") { $filtre_pb = sprintf("Filtre poste plan2 %s %s", $this->from_poste2 != "" ? "de " . $this->from_poste2 : " ", $this->to_poste2 != "" ? "jusque " . $this->to_poste2 : ""); } $pdf->SetFont('DejaVu', '', 8); $pdf->Cell(50, 7, $filtre_date); $pdf->Cell(50, 7, $filtre_pa); $pdf->Cell(50, 7, $filtre_pb); $pdf->Ln(); $pdf->SetFont('DejaVu', '', 6); $pdf->Cell(20, 7, 'id', 'B'); $pdf->Cell(100, 7, 'Poste Comptable', 'B'); $pdf->Cell(20, 7, 'Débit', 'B', 0, 'L'); $pdf->Cell(20, 7, 'Crédit', 'B', 0, 'L'); $pdf->Cell(20, 7, 'Solde', 'B', 0, 'L'); $pdf->Cell(20, 7, 'D/C', 'B', 0, 'L'); $pdf->Ln(); for ($i = 0; $i < count($array); $i++) { $row = $array[$i]; $pdf->Cell(20, 6, $row['a_po_name'], 0, 0, 'L'); $pdf->Cell(40, 6, mb_substr($row['a_po_description'], 0, 31), 0, 0, 'L'); $pdf->Cell(20, 6, $row['b_po_name'], 0, 0, 'L'); $pdf->Cell(40, 6, mb_substr($row['b_po_description'], 0, 31), 0, 0, 'L'); $pdf->Cell(20, 6, $row['a_d'], 0, 0, 'R'); $pdf->Cell(20, 6, $row['a_c'], 0, 0, 'R'); $pdf->Cell(20, 6, $row['a_solde'], 0, 0, 'R'); $pdf->Cell(20, 6, $row['a_debit'], 0, 0, 'C'); $pdf->Ln(); } $sum = $this->show_sum($array); $pdf->SetFont('DejaVu', 'B', 8); $pdf->Cell(70, 6, 'Somme', 1, 0, 'C'); $pdf->Ln(5); $pdf->SetFont('DejaVu', '', 6); $pdf->Cell(20, 7, 'Poste'); $pdf->Cell(60, 7, 'Description', 'B'); $pdf->Cell(20, 7, 'Débit', 'B', 0, 'L'); $pdf->Cell(20, 7, 'Crédit', 'B', 0, 'L'); $pdf->Cell(20, 7, 'Solde', 'B', 0, 'L'); $pdf->Cell(20, 7, 'D/C', 'B', 0, 'L'); $pdf->Ln(); for ($i = 0; $i < count($sum); $i++) { $row = $sum[$i]; $pdf->Cell(20, 6, $row['poste'], 0, 0, 'L'); $pdf->Cell(60, 6, $row['desc'], 0, 0, 'L'); $pdf->Cell(20, 6, sprintf('%.2f', $row['debit']), 0, 0, 'R'); $pdf->Cell(20, 6, sprintf('%.2f', $row['credit']), 0, 0, 'R'); $pdf->Cell(20, 6, sprintf('%.2f', $row['solde']), 0, 0, 'R'); $pdf->Cell(20, 6, $row['dc'], 0, 0, 'R'); $pdf->Ln(); } $fDate = date('dmy-Hi'); $pdf->output('crossbalance-' . $fDate . '.pdf', 'D'); }
/** *@brief set_info(dossier,from poste,to poste, from periode, to periode) *@param $p_from_poste start = poste *@param $p_to_poste end = poste *@param $p_from periode start *@param $p_to periode end */ function set_info($p_from_poste, $to_poste, $p_from, $p_to) { $this->dossier = 'Balance simple ' . dossier::name(); $this->from_poste = $p_from_poste; $this->to_poste = $to_poste; $this->from = $p_from; $this->to = $p_to; }
<?php //This file is part of NOALYSS and is under GPL //see licence.txt ?> <div id="top"> <div id="dossier"> <?php echo h(dossier::name()); ?> </div> <div style="clear:both;"></div> <div class="name"> <?php if ($cn->get_value("select count(*) from profile join profile_user using (p_id)\n\t\twhere user_name=\$1 and with_calc=true", array($_SESSION['g_user'])) == 1) { echo '<div id="calc">'; echo IButton::show_calc(); echo '</div>'; } if ($cn->get_value("select count(*) from profile join profile_user using (p_id)\n\t\twhere user_name=\$1 and with_direct_form=true", array($_SESSION['g_user'])) == 1) { ?> <div id="direct"> <form method="get"> <?php echo HtmlInput::default_value('ac', '', $_REQUEST); ?> <?php echo Dossier::hidden(); ?> <?php
function setDossierInfo($dossier = "n/a") { $this->dossier = dossier::name() . " " . $dossier; }
$w->label = 'Periode'; $w->readonly = false; $w->value = $periode; $w->name = "p_periode"; echo 'Période : ' . $w->input(); echo HtmlInput::submit('ok', 'Continuer'); echo dossier::hidden(); echo "</form>"; echo HtmlInput::button_anchor('Retour', $back); exit(0); } /* -------------------------------------------------- * select the ledger where we will import the data */ if ($sa == 'step3') { echo '<div class="content">' . '<div><h1 class="legend">Etape 3</h1>' . '<h2 class="info">' . dossier::name($_REQUEST['f']) . '</h2>' . '<form class="print" method="post">' . ' Choisissez le journal qui contiendra l\'opération d\'ouverture '; echo dossier::hidden(); echo HtmlInput::hidden('p_action', 'ouv'); echo HtmlInput::hidden('sa', 'step4'); echo HtmlInput::hidden('f', $_REQUEST['f']); echo HtmlInput::hidden('p_periode', $_REQUEST['p_periode']); $wLedger = new ISelect(); $g_user = new User(new Database(dossier::id())); $avail = $g_user->get_ledger('ODS'); /* compute select list */ $array = array(); $i = 0; foreach ($avail as $r) { $array[$i]['value'] = $r['jrn_def_id']; $array[$i]['label'] = $r['jrn_def_name']; $i++;