Example #1
0
 $object->fetch($id, $ref);
 $result = $object->fetch_thirdparty();
 if ($result < 0) {
     dol_print_error($db);
 }
 $societe = new Fournisseur($db);
 $result = $societe->fetch($object->socid);
 if ($result < 0) {
     dol_print_error($db);
 }
 // fetch optionals attributes and labels
 $extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
 /*
  *	View card
  */
 $head = facturefourn_prepare_head($object);
 $titre = $langs->trans('SupplierInvoice');
 dol_fiche_head($head, 'card', $titre, 0, 'bill');
 // Clone confirmation
 if ($action == 'clone') {
     // Create an array for form
     $formquestion = array();
     // Paiement incomplet. On demande si motif = escompte ou autre
     $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
 }
 // Confirmation de la validation
 if ($action == 'valid') {
     // on verifie si l'objet est en numerotation provisoire
     $objectref = substr($object->ref, 1, 4);
     if ($objectref == 'PROV') {
         $savdate = $object->date;
dol_include_once('/labelprint/class/utils.class.php');
$html = new Form($db);
$form = new Form($db);
$formcompany = new FormCompany($db);
$contactstatic = new Contact($db);
$userstatic = new User($db);
/* *************************************************************************** */
/*                                                                             */
/* Mode vue et edition                                                         */
/*                                                                             */
/* *************************************************************************** */
if ($id > 0) {
    $facture = new FactureFournisseur($db);
    if ($facture->fetch($id, $user->societe_id) > 0) {
        $facture->fetch_thirdparty();
        $head = facturefourn_prepare_head($facture);
        dol_fiche_head($head, 'labelprint', $langs->trans('SupplierInvoice'), 0, 'bill');
        // Confirmation to delete invoice
        if ($action == 'truncate') {
            $text = $langs->trans('ConfirmTruncateList');
            $formconfirm = $html->formconfirm($_SERVER['PHP_SELF'] . '?id=' . $id, $langs->trans('TruncateList'), $text, 'confirm_truncate', '', 0, 1);
        }
        print $formconfirm;
        /*
         *   Facture synthese pour rappel
         */
        print '<table class="border" width="100%">';
        // Reference du facture
        print '<tr><td width="20%">' . $langs->trans("Ref") . '</td><td colspan="3">';
        print $html->showrefnav($facture, 'facid', '', 1, 'rowid', 'ref', $morehtmlref);
        print "</td></tr>";