diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index db4c5609f22..c817a252603 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -3091,29 +3091,32 @@ if ($action == 'create' && $usercancreate) { }*/ $numshipping = 0; - if (isModEnabled('shipping')) { - $numshipping = $object->countNbOfShipments(); - } // Create shipment - if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { - if ((getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'creer')) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'creer'))) { - $arrayforbutaction[] = array( - 'lang' => 'sendings', - 'enabled' => (isModEnabled("shipping") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), - 'perm' => $user->hasRight('expedition', 'creer'), - 'label' => 'CreateShipment', - 'url' => '/expedition/shipment.php?id=' . $object->id - ); - /* - if ($user->hasRight('expedition', 'creer')) { - print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, ''); + if (isModEnabled('shipping')) { + $numshipping = $object->countNbOfShipments(); + + if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { + if ((getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'creer')) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'creer'))) { + // Add button to create shipment into the combo + $arrayforbutaction[] = array( + 'lang' => 'sendings', + 'enabled' => (isModEnabled("shipping") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), + 'perm' => $user->hasRight('expedition', 'creer'), + 'label' => 'CreateShipment', + 'url' => '/expedition/shipment.php?id=' . $object->id + ); } else { - print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false); - }*/ - } else { - $langs->load("errors"); - print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false); + //c$langs->load("errors"); + //print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false); + $arrayforbutaction[] = array( + 'lang' => 'sendings', + 'enabled' => (isModEnabled("shipping") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), + 'perm' => 0, + 'label' => 'CreateShipment', + 'url' => '/expedition/shipment.php?id=' . $object->id + ); + } } } diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 8c365e7bee5..c7fc531c605 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -1180,6 +1180,7 @@ if ($action == 'create') { print '
'; + print '
'; print ''; // Load shipments already done for same order @@ -1849,6 +1850,7 @@ if ($action == 'create') { } print "
"; + print '
'; print '
'; @@ -2273,7 +2275,7 @@ if ($action == 'create') { print '
'; print '
'; - print ''; + print '
'; print ''; print ''; // Adds a line numbering column @@ -2297,15 +2299,15 @@ if ($action == 'create') { } print ''; } else { @@ -2554,7 +2556,11 @@ if ($action == 'create') { // Warehouse source print ''; // Batch number management - print ''; + print ''; print ''; } elseif (count($lines[$i]->details_entrepot) > 1) { print ''; @@ -2565,7 +2571,11 @@ if ($action == 'create') { // Warehouse source print ''; // Batch number management - print ''; + print ''; print ''; } } elseif ($lines[$i]->product_type == Product::TYPE_SERVICE && getDolGlobalString('SHIPMENT_SUPPORTS_SERVICES')) { diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index 7fa4f672175..2d553c8dc51 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -527,7 +527,7 @@ if ($object->id > 0 || !empty($object->ref)) { print ''; print '
'; if ($object->status <= 1) { - print $langs->trans("QtyToShip").' - '; + print $langs->trans("QtyToShip"); } else { - print $langs->trans("QtyShipped").' - '; + print $langs->trans("QtyShipped"); } if (isModEnabled('stock')) { - print $langs->trans("WarehouseSource").' - '; + print ' - '.$langs->trans("WarehouseSource"); } if (isModEnabled('productbatch')) { - print $langs->trans("Batch"); + print ' - '.$langs->trans("Batch"); } print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).' - '.$langs->trans("NA").''; + if (isModEnabled('productbatch')) { + print ' - '.$langs->trans("NA"); + } + print '
'.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).' - '.$langs->trans("NA").''; + if (isModEnabled('productbatch')) { + print ' - '.$langs->trans("NA"); + } + print '
'; - print '
'; + print '

'; if (isModEnabled('barcode') || isModEnabled('productbatch')) { print ''.img_picto('', 'barcode', 'class="paddingrightonly"').$langs->trans("UpdateByScaning").''; }