Restore link to stock for products.

This commit is contained in:
Laurent Destailleur 2015-04-08 19:26:36 +02:00
parent 0987aa1c74
commit 1bbecc0912
6 changed files with 16 additions and 13 deletions

View File

@ -627,7 +627,7 @@ if ($id > 0)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></a></td>';
print '<td colspan="4"><table width="100%" class="nobordernopadding"><tr><td>'.$langs->trans("LastCustomerOrders",($num<=$MAXLIST?"":$MAXLIST)).'</td><td align="right"><a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></a></td>';
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
//if($num2 > 0) print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.img_picto($langs->trans("CreateInvoiceForThisCustomer"),'object_bill').'</a></td>';
//else print '<td width="20px" align="right"><a href="#">'.img_picto($langs->trans("NoOrdersToInvoice"),'object_bill').'</a></td>';

View File

@ -93,7 +93,7 @@ function product_prepare_head($object)
$head[$h][2] = 'referers';
$h++;
if($object->isproduct()) // Si produit stockable
if ($object->isproduct() || ($object->isservice() && ! empty($conf->global->STOCK_SUPPORTS_SERVICES))) // If physical product we can stock (or service with option)
{
if (! empty($conf->stock->enabled) && $user->rights->stock->lire)
{

View File

@ -364,7 +364,7 @@ if ($object->id > 0)
/*
* Last orders
* Last supplier orders
*/
$orderstatic = new CommandeFournisseur($db);
@ -409,7 +409,7 @@ if ($object->id > 0)
print '<tr class="liste_titre">';
print '<td colspan="3">';
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastOrders",($num<$MAXLIST?"":$MAXLIST)).'</td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'.$langs->trans("LastSupplierOrders",($num<$MAXLIST?"":$MAXLIST)).'</td>';
print '<td align="right"><a href="commande/list.php?socid='.$object->id.'">'.$langs->trans("AllOrders").' <span class="badge">'.$num.'</span></td>';
print '<td width="20px" align="right"><a href="'.DOL_URL_ROOT.'/commande/stats/index.php?mode=supplier&socid='.$object->id.'">'.img_picto($langs->trans("Statistics"),'stats').'</a></td>';
print '</tr></table>';
@ -455,7 +455,7 @@ if ($object->id > 0)
}
/*
* Last invoices
* Last supplier invoices
*/
$MAXLIST=5;

View File

@ -79,7 +79,9 @@ NoOpenedOrders=No opened orders
NoOtherOpenedOrders=No other opened orders
NoDraftOrders=No draft orders
OtherOrders=Other orders
LastOrders=Last %s orders
LastOrders=Last %s customer orders
LastCustomerOrders=Last %s customer orders
LastSupplierOrders=Last %s supplier orders
LastModifiedOrders=Last %s modified orders
LastClosedOrders=Last %s closed orders
AllOrders=All orders

View File

@ -3689,7 +3689,7 @@ class Product extends CommonObject
*/
function isproduct()
{
return ($this->type != Product::TYPE_PRODUCT ? true : false);
return ($this->type == Product::TYPE_PRODUCT ? true : false);
}
/**

View File

@ -821,8 +821,9 @@ if (empty($action) && $product->id)
/*
* Stock detail
* Stock detail (by warehouse). Do not go down into batch.
*/
print '<br><table class="noborder" width="100%">';
print '<tr class="liste_titre"><td width="40%" colspan="4">'.$langs->trans("Warehouse").'</td>';
print '<td align="right">'.$langs->trans("NumberOfUnit").'</td>';
@ -870,9 +871,9 @@ if ($resql)
print '<td colspan="4">'.$entrepotstatic->getNomUrl(1).'</td>';
print '<td align="right">'.$obj->reel.($obj->reel<0?' '.img_warning():'').'</td>';
// PMP
print '<td align="right">'.(price2num($product->pmp)?price2num($product->pmp,'MU'):'').'</td>'; // Ditto : Show PMP from movement or from product
print '<td align="right">'.(price2num($product->pmp)?price2num($product->pmp,'MU'):'').'</td>';
// Value purchase
print '<td align="right">'.(price2num($product->pmp)?price(price2num($product->pmp*$obj->reel,'MT')):'').'</td>'; // Ditto : Show PMP from movement or from product
print '<td align="right">'.(price2num($product->pmp)?price(price2num($product->pmp*$obj->reel,'MT')):'').'</td>';
// Sell price
print '<td align="right">';
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price,'MU'),1);
@ -880,13 +881,13 @@ if ($resql)
print '</td>';
// Value sell
print '<td align="right">';
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price*$obj->reel,'MT'),1).'</td>'; // Ditto : Show PMP from movement or from product
if (empty($conf->global->PRODUIT_MULTI_PRICES)) print price(price2num($product->price*$obj->reel,'MT'),1).'</td>';
else print $langs->trans("Variable");
print '</tr>'; ;
$total += $obj->reel;
if (price2num($product->pmp)) $totalwithpmp += $obj->reel;
$totalvalue = $totalvalue + ($product->pmp*$obj->reel); // Ditto : Show PMP from movement or from product
$totalvaluesell = $totalvaluesell + ($product->price*$obj->reel); // Ditto : Show PMP from movement or from product
$totalvalue = $totalvalue + ($product->pmp*$obj->reel);
$totalvaluesell = $totalvaluesell + ($product->price*$obj->reel);
//Batch Detail
if ((! empty($conf->productbatch->enabled)) && $product->hasbatch())
{