* Copyright (C) 2005 Laurent Destailleur * Copyright (C) 2010-2012 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/compta/prelevement/bon.php * \ingroup prelevement * \brief Fiche apercu du bon de prelevement */ require '../bank/pre.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/prelevement.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; $langs->load("bills"); $langs->load("categories"); // Security check $socid=0; $id = GETPOST('id','int'); $ref = GETPOST('ref','alpha'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement', $id); llxHeader('','Bon de prelevement'); $form = new Form($db); if ($id > 0 || ! empty($ref)) { $object = new BonPrelevement($db,""); if ($object->fetch($id) == 0) { $head = prelevement_prepare_head($object); dol_fiche_head($head, 'preview', 'Prelevement : '. $object->ref); print ''; print ''; print ''; print ''; print '
'.$langs->trans("Ref").''.$object->ref.'
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans("File").''; $relativepath = 'bon/'.$object->ref; print ''.$object->ref.''; print '

'; $fileimage = $conf->prelevement->dir_output.'/receipts/'.$object->ref.'.ps.png.0'; $fileps = $conf->prelevement->dir_output.'/receipts/'.$object->ref.'.ps'; // Conversion du PDF en image png si fichier png non existant if (!file_exists($fileimage)) { if (class_exists("Imagick")) { $ret = dol_convert_file($file); if ($ret < 0) $error++; } else { $langs->load("errors"); print ''.$langs->trans("ErrorNoImagickReadimage").''; } } if (file_exists($fileimage)) { print ''; } } else { dol_print_error($db); } } print ""; llxFooter(); ?>