$langs->load("withdrawals");
// Security check
if ($user->societe_id > 0) {
    accessforbidden();
}
// Get supervariables
$prev_id = GETPOST('id', 'int');
$page = GETPOST('page', 'int');
/*
 * View
 */
llxHeader('', $langs->trans("WithdrawalsReceipts"));
if ($prev_id) {
    $bon = new BonPrelevement($db, "");
    if ($bon->fetch($prev_id) == 0) {
        $head = prelevement_prepare_head($bon);
        dol_fiche_head($head, 'statistics', $langs->trans("WithdrawalsReceipts"), '', 'payment');
        print '<table class="border" width="100%">';
        print '<tr><td width="20%">' . $langs->trans("Ref") . '</td><td>' . $bon->getNomUrl(1) . '</td></tr>';
        print '<tr><td width="20%">' . $langs->trans("Date") . '</td><td>' . dol_print_date($bon->datec, 'day') . '</td></tr>';
        print '<tr><td width="20%">' . $langs->trans("Amount") . '</td><td>' . price($bon->amount) . '</td></tr>';
        // Status
        print '<tr><td width="20%">' . $langs->trans('Status') . '</td>';
        print '<td>' . $bon->getLibStatut(1) . '</td>';
        print '</tr>';
        if ($bon->date_trans != 0) {
            $muser = new User($db);
            $muser->fetch($bon->user_trans);
            print '<tr><td width="20%">' . $langs->trans("TransData") . '</td><td>';
            print dol_print_date($bon->date_trans, 'day');
            print ' ' . $langs->trans("By") . ' ' . $muser->getFullName($langs) . '</td></tr>';
Exemple #2
0
$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 '<table class="border" width="100%">';
        print '<tr><td width="20%">' . $langs->trans("Ref") . '</td><td>' . $object->ref . '</td></tr>';
        print '<tr><td width="20%">' . $langs->trans("Amount") . '</td><td>' . price($object->amount) . '</td></tr>';
        print '<tr><td width="20%">' . $langs->trans("File") . '</td><td>';
        $relativepath = 'bon/' . $object->ref;
        print '<a href="' . DOL_URL_ROOT . '/document.php?type=text/plain&amp;modulepart=prelevement&amp;file=' . urlencode($relativepath) . '">' . $object->ref . '</a>';
        print '</td></tr>';
        print '</table><br>';
        $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);