Merge pull request #1975 from frederic34/patch-1
"Is Order shippable" icon
This commit is contained in:
commit
6a1a0303d8
@ -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
|
* View
|
||||||
@ -548,6 +560,22 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'
|
|||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
|
// Shippable Icon in List
|
||||||
|
$var=!$var;
|
||||||
|
print "<tr ".$bc[$var].">";
|
||||||
|
print '<td>'.$langs->trans("ShippableOrderIconInList").'</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '<td align="center">';
|
||||||
|
if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setshippableiconinlist&value=0">';
|
||||||
|
print img_picto($langs->trans("Activated"),'switch_on');
|
||||||
|
} else {
|
||||||
|
print '<a href="'.$_SERVER['PHP_SELF'].'?action=setshippableiconinlist&value=1">';
|
||||||
|
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
|
}
|
||||||
|
print '</a></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT .'/product/class/product.class.php';
|
||||||
|
|
||||||
$langs->load('orders');
|
$langs->load('orders');
|
||||||
$langs->load('deliveries');
|
$langs->load('deliveries');
|
||||||
@ -325,22 +326,77 @@ if ($resql)
|
|||||||
$total=0;
|
$total=0;
|
||||||
$subtotal=0;
|
$subtotal=0;
|
||||||
|
|
||||||
$generic_commande = new Commande($db);
|
$generic_commande = new Commande($db);
|
||||||
while ($i < min($num,$limit))
|
$generic_product = new Product($db);
|
||||||
{
|
while ($i < min($num,$limit)) {
|
||||||
$objp = $db->fetch_object($resql);
|
$objp = $db->fetch_object($resql);
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
|
|
||||||
$generic_commande->id=$objp->rowid;
|
$generic_commande->id=$objp->rowid;
|
||||||
$generic_commande->ref=$objp->ref;
|
$generic_commande->ref=$objp->ref;
|
||||||
|
$generic_commande->lines=array();
|
||||||
|
$generic_commande->getLinesArray();
|
||||||
|
|
||||||
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
|
||||||
print '<td class="nobordernopadding nowrap">';
|
print '<td class="nobordernopadding nowrap">';
|
||||||
print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut));
|
print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
|
// 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.='<span class="warning">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||||
|
} else {
|
||||||
|
$text_info.='<span class="ok">'.$langs->trans('Available').' : '.$text_stock_reel.'</span>';
|
||||||
|
}
|
||||||
|
if ($stock_order_supplier>0) {
|
||||||
|
$text_info.= ' '.$langs->trans('SupplierOrder').' : '.$stock_order_supplier.'<br>';
|
||||||
|
} else {
|
||||||
|
$text_info.= '<br>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($notshippable==0) {
|
||||||
|
$text_icon = img_picto('', 'object_sending');
|
||||||
|
$text_info = $langs->trans('Shippable').'<br>'.$text_info;
|
||||||
|
} else {
|
||||||
|
$text_icon = img_picto('', 'error');
|
||||||
|
$text_info = $langs->trans('NonShippable').'<br>'.$text_info;
|
||||||
|
}
|
||||||
|
if ($nbprod>0) {
|
||||||
|
print '<td>';
|
||||||
|
print $form->textwithtooltip('',$text_info,2,1,$text_icon,'',2);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// warning late icon
|
||||||
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
|
||||||
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))
|
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");
|
print img_picto($langs->trans("Late"),"warning");
|
||||||
|
|||||||
@ -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
|
ValidOrderAfterPropalClosed=To validate the order after proposal closer, makes it possible not to step by the provisional order
|
||||||
FreeLegalTextOnOrders=Free text on orders
|
FreeLegalTextOnOrders=Free text on orders
|
||||||
WatermarkOnDraftOrders=Watermark on draft orders (none if empty)
|
WatermarkOnDraftOrders=Watermark on draft orders (none if empty)
|
||||||
|
ShippableOrderIconInList=Add an icon in Orders list which indicate if order is shippable
|
||||||
##### Clicktodial #####
|
##### Clicktodial #####
|
||||||
ClickToDialSetup=Click To Dial module setup
|
ClickToDialSetup=Click To Dial module setup
|
||||||
ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags<br><b>__PHONETO__</b> that will be replaced with the phone number of person to call<br><b>__PHONEFROM__</b> that will be replaced with phone number of calling person (yours)<br><b>__LOGIN__</b> that will be replaced with your clicktodial login (defined on your user card)<br><b>__PASS__</b> that will be replaced with your clicktodial password (defined on your user card).
|
ClickToDialUrlDesc=Url called when a click on phone picto is done. In URL, you can use tags<br><b>__PHONETO__</b> that will be replaced with the phone number of person to call<br><b>__PHONEFROM__</b> that will be replaced with phone number of calling person (yours)<br><b>__LOGIN__</b> that will be replaced with your clicktodial login (defined on your user card)<br><b>__PASS__</b> that will be replaced with your clicktodial password (defined on your user card).
|
||||||
|
|||||||
@ -24,3 +24,5 @@ Deliverer=Deliverer :
|
|||||||
Sender=Sender
|
Sender=Sender
|
||||||
Recipient=Recipient
|
Recipient=Recipient
|
||||||
ErrorStockIsNotEnough=There's not enough stock
|
ErrorStockIsNotEnough=There's not enough stock
|
||||||
|
Shippable=Shippable
|
||||||
|
NonShippable=Not Shippable
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user