diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index e5b2e5e6b1d..89a78b5d6da 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -222,6 +222,18 @@ else if ($action == 'set_COMMANDE_FREE_TEXT') } } +//Activate Set Shippable Icon In List +else if ($action=="setshippableiconinlist") { + $setshippableiconinlist = GETPOST('value','int'); + $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity); + if (! $res > 0) $error++; + if (! $error) { + setEventMessage($langs->trans("SetupSaved")); + } else { + setEventMessage($langs->trans("Error"), 'errors'); + } +} + /* * View @@ -548,6 +560,22 @@ print '' print "\n"; print ''; +// Shippable Icon in List +$var=!$var; +print "
| '; - print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); - print ' | '; + print '
| '; + print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); + print ' | '; + // Shippable Icon + if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && ! empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { + $notshippable=0; + $text_info=''; + $nbprod=0; + for ($lig=0; $lig<(count($generic_commande->lines)); $lig++) { + if ($generic_commande->lines[$lig]->product_type==0) { + $nbprod++; // order contains real products + $generic_product->id = $generic_commande->lines[$lig]->fk_product; + $generic_product->load_stock(); + // stock order and stock order_supplier + $stock_order=0; + $stock_order_supplier=0; + if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { + if (! empty($conf->commande->enabled)) { + $generic_product->load_stats_commande(0,'1,2'); + $stock_order=$generic_product->stats_commande['qty']; + } + if (! empty($conf->fournisseur->enabled)) { + $generic_product->load_stats_commande_fournisseur(0,'3'); + $stock_order_supplier=$generic_product->stats_commande_fournisseur['qty']; + } + } + $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25); + $text_stock_reel = $generic_product->stock_reel.'/'.$stock_order; + if ($generic_product->stock_reel<$generic_commande->lines[$lig]->qty) { + $notshippable++; + $text_info.=''.$langs->trans('Available').' : '.$text_stock_reel.''; + } else { + $text_info.=''.$langs->trans('Available').' : '.$text_stock_reel.''; + } + if ($stock_order_supplier>0) { + $text_info.= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.''; + print $form->textwithtooltip('',$text_info,2,1,$text_icon,'',2); + print ' | '; + } + } + + // warning late icon print '';
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay))
print img_picto($langs->trans("Late"),"warning");
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index de373163008..59b31693b2b 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -1147,6 +1147,7 @@ HideTreadedOrders=Hide the treated or cancelled orders in the list
ValidOrderAfterPropalClosed=To validate the order after proposal closer, makes it possible not to step by the provisional order
FreeLegalTextOnOrders=Free text on orders
WatermarkOnDraftOrders=Watermark on draft orders (none if empty)
+ShippableOrderIconInList=Add an icon in Orders list which indicate if order is shippable
##### Clicktodial #####
ClickToDialSetup=Click To Dial module setup
ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags __PHONETO__ that will be replaced with the phone number of person to call __PHONEFROM__ that will be replaced with phone number of calling person (yours) __LOGIN__ that will be replaced with your clicktodial login (defined on your user card) __PASS__ that will be replaced with your clicktodial password (defined on your user card). diff --git a/htdocs/langs/en_US/deliveries.lang b/htdocs/langs/en_US/deliveries.lang index cabd31a3a32..c96a506281d 100644 --- a/htdocs/langs/en_US/deliveries.lang +++ b/htdocs/langs/en_US/deliveries.lang @@ -24,3 +24,5 @@ Deliverer=Deliverer : Sender=Sender Recipient=Recipient ErrorStockIsNotEnough=There's not enough stock +Shippable=Shippable +NonShippable=Not Shippable |