Ejemplo n.º 1
0
    }
    return;
}
/********************************************************************************************************************************
 * Balance
 *
 **********************************************************************************************************************************/
if ($_GET['histo'] == 4 || $_GET['histo'] == 5) {
    if ($allcard == 0) {
        echo $str_add_card;
    }
    echo $export_pdf;
    echo $export_csv;
    echo $export_print;
    $fd = new Fiche_Def($cn, $_REQUEST['cat']);
    if ($allcard == 0 && $fd->hasAttribute(ATTR_DEF_ACCOUNT) == false) {
        echo alert(_("Cette catégorie n'ayant pas de poste comptable n'a pas de balance"));
        return;
    }
    // all card
    if ($allcard == 1) {
        $afiche = $cn->get_array("select fd_id from vw_fiche_def where ad_id=" . ATTR_DEF_ACCOUNT . " order by fd_label asc");
    } else {
        $afiche[0] = array('fd_id' => $_REQUEST['cat']);
    }
    for ($e = 0; $e < count($afiche); $e++) {
        $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']));
        if ($cn->count() == 0) {
            if ($allcard == 0) {
                echo _("Aucune fiche trouvée");
                return;
Ejemplo n.º 2
0
$cn = new Database($gDossier);
$g_user->Check();
$g_user->check_dossier($gDossier);
$pdf = new PDF($cn);
$pdf->setDossierInfo("  Periode : " . $_GET['start'] . " - " . $_GET['end']);
$pdf->AliasNbPages();
$pdf->AddPage();
$name = $cn->get_value('select fd_label from fiche_def where fd_id=$1', array($_GET['cat']));
$pdf->SetFont('DejaVu', 'BI', 14);
$pdf->Cell(0, 8, $name, 0, 1, 'C');
$pdf->SetTitle($name, 1);
$pdf->SetAuthor('NOALYSS');
/* balance */
if ($_GET['histo'] == 4) {
    $fd = new Fiche_Def($cn, $_REQUEST['cat']);
    if ($fd->hasAttribute(ATTR_DEF_ACCOUNT) == false) {
        $pdf->Cell(0, 10, "Cette catégorie n'ayant pas de poste comptable n'a pas de balance");
        //Save PDF to file
        $fDate = date('dmy-Hi');
        $pdf->Output("category-{$fDate}.pdf", 'D');
        exit;
    }
    $aCard = $cn->get_array("select f_id,ad_value from fiche join fiche_Detail using (f_id)  where ad_id=1 and fd_id=\$1 order by 2 ", array($_REQUEST['cat']));
    if (empty($aCard)) {
        $pdf->Cell(0, 10, "Aucune fiche trouvée");
        //Save PDF to file
        $fDate = date('dmy-Hi');
        $pdf->Output("category-{$fDate}.pdf", 'D');
        exit;
    }
    $pdf->SetFont('DejaVuCond', '', 7);