$h++; if ($id) { $lipre = new LignePrelevement($db, $user); if ($lipre->fetch($id) == 0) { $bon = new BonPrelevement($db); $bon->fetch($lipre->bon_rowid); dol_fiche_head($head, $hselected, $langs->trans("StandingOrder")); print '<table class="border" width="100%">'; print '<tr><td width="20%">' . $langs->trans("WithdrawalReceipt") . '</td><td>'; print '<a href="fiche.php?id=' . $lipre->bon_rowid . '">' . $lipre->bon_ref . '</a></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($lipre->amount) . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("Status") . '</td><td>'; print $lipre->LibStatut($lipre->statut, 1) . '</td></tr>'; if ($lipre->statut == 3) { $rej = new RejetPrelevement($db, $user); $resf = $rej->fetch($lipre->id); if ($resf == 0) { print '<tr><td width="20%">' . $langs->trans("RefusedReason") . '</td><td>' . $rej->motif . '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("RefusedData") . '</td><td>'; if ($rej->date_rejet == 0) { /* Historique pour certaines install */ print $langs->trans("Unknown"); } else { print dol_print_date($rej->date_rejet, 'day'); } print '</td></tr>'; print '<tr><td width="20%">' . $langs->trans("RefusedInvoicing") . '</td><td>' . $rej->invoicing . '</td></tr>'; } else { print '<tr><td width="20%">' . $resf . '</td></tr>'; }