$id = $_GET['id']; $ref= $_GET['ref']; if ($id > 0 || ! empty($ref)) { llxHeader(); $upload_dir = $conf->fournisseur->dir_output.'/commande/'.dol_sanitizeFileName($commande->ref); $soc = new Societe($db); $soc->fetch($commande->socid); $author = new User($db); $author->fetch($commande->user_author_id); $head = ordersupplier_prepare_head($commande); dol_fiche_head($head, 'documents', $langs->trans('SupplierOrder'), 0, 'order'); // Construit liste des fichiers $filearray=dol_dir_list($upload_dir,"files",0,'','\.meta$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1); $totalsize=0; foreach($filearray as $key => $file) { $totalsize+=$file['size']; } print '<table class="border"width="100%">';
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 CommandeFournisseur($db); if ($facture->fetch($id, $user->societe_id) > 0) { $facture->fetch_thirdparty(); $head = ordersupplier_prepare_head($facture); // 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; dol_fiche_head($head, 'labelprint', $langs->trans("SupplierOrder"), 0, 'order'); /* * 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 $facture->ref; //print $html->showrefnav($facture,'ref','',1,'rowid','ref',$morehtmlref);
if (empty($reshook) && !empty($extrafields->attribute_label)) { print $object->showOptionals($extrafields, 'edit'); } // Bouton "Create Draft" print "</table>\n"; print '<br><center><input type="submit" class="button" name="bouton" value="' . $langs->trans('CreateDraft') . '"></center>'; print "</form>\n"; } elseif (!empty($object->id)) { $author = new User($db); $author->fetch($object->user_author_id); $societe = new Fournisseur($db); $result = $societe->fetch($object->socid); if ($result < 0) { dol_print_error($db); } $head = ordersupplier_prepare_head($object); $title = $langs->trans("SupplierOrder"); dol_fiche_head($head, 'card', $title, 0, 'order'); $res = $object->fetch_optionals($object->id, $extralabels); /* * Confirmation de la suppression de la commande */ if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2); } // Clone confirmation if ($action == 'clone') { // Create an array for form $formquestion = array(); // Paiement incomplet. On demande si motif = escompte ou autre print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneOrder'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
function fiche(&$commande, &$TImport) { global $langs, $db, $conf; llxHeader(); $head = ordersupplier_prepare_head($commande); $title = $langs->trans("SupplierOrder"); dol_fiche_head($head, 'recepasset', $title, 0, 'order'); entetecmd($commande); $form = new TFormCore('auto', 'formrecept', 'post', true); echo $form->hidden('action', 'SAVE'); echo $form->hidden('id', $commande->id); if ($commande->statut < 5 && $conf->global->DISPATCH_USE_IMPORT_FILE) { echo $form->fichier('Fichier à importer', 'file1', '', 80); echo $form->btsubmit('Envoyer', 'btsend'); } tabImport($TImport, $commande); $form->end(); _list_already_dispatched($commande); llxFooter(); }