diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index f4f05f96b78..0436c33f3ad 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -46,6 +46,7 @@ $langs->load('bills'); $langs->load('deliveries'); $langs->load('products'); $langs->load('stocks'); +$langs->load('receptions'); if (! empty($conf->productbatch->enabled)) $langs->load('productbatch'); @@ -738,6 +739,7 @@ if ($id > 0 || ! empty($ref)) { $sql = "SELECT p.ref, p.label,"; $sql .= " e.rowid as warehouse_id, e.label as entrepot,"; $sql .= " cfd.rowid as dispatchlineid, cfd.fk_product, cfd.qty, cfd.eatby, cfd.sellby, cfd.batch, cfd.comment, cfd.status"; + if($conf->reception->enabled)$sql.=" ,cfd.fk_reception"; $sql .= " FROM " . MAIN_DB_PREFIX . "product as p,"; $sql .= " " . MAIN_DB_PREFIX . "commande_fournisseur_dispatch as cfd"; $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "entrepot as e ON cfd.fk_entrepot = e.rowid"; @@ -759,6 +761,7 @@ if ($id > 0 || ! empty($ref)) { print '
| ' . $langs->trans("Reception") . ' | '; print '' . $langs->trans("Product") . ' | '; if (! empty($conf->productbatch->enabled)) { print '' . $langs->trans("batch_number") . ' | '; @@ -769,7 +772,7 @@ if ($id > 0 || ! empty($ref)) { print ''; print ' | ' . $langs->trans("Warehouse") . ' | '; print '' . $langs->trans("Comment") . ' | '; - if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) + if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) || !empty($conf->reception->enabled)) print '' . $langs->trans("Status") . ' | '; print "|
| '; + if(!empty($conf->reception->enabled) && !empty($objp->fk_reception)){ + $reception = new Reception($db); + $reception->fetch($objp->fk_reception); + print $reception->getNomUrl(); + } + print " | "; + print ''; print '' . img_object($langs->trans("ShowProduct"), 'product') . ' ' . $objp->ref . ''; print ' - ' . $objp->label; print " | \n"; @@ -805,7 +817,7 @@ if ($id > 0 || ! empty($ref)) { print '' . $objp->comment . ' | '; // Status - if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) { + if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS) && empty($reception->rowid)) { print ''; $supplierorderdispatch->status = (empty($objp->status) ? 0 : $objp->status); // print $supplierorderdispatch->status; @@ -841,6 +853,15 @@ if ($id > 0 || ! empty($ref)) { } } print ' | '; + }else if(!empty($conf->reception->enabled)){ + print ''; + if(!empty($reception->rowid)){ + print $reception->getLibStatut(5); + } + print ' | '; + print ''; + print ' | '; + } print "||