Skip to content
Snippets Groups Projects
Commit 1d2c8bbd authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fixed: Prices visible into stock tab.

parent be4c5cf9
No related branches found
No related tags found
No related merge requests found
...@@ -351,28 +351,29 @@ print '</tr>'; ...@@ -351,28 +351,29 @@ print '</tr>';
// MultiPrix // MultiPrix
if (! empty($conf->global->PRODUIT_MULTIPRICES)) if (! empty($conf->global->PRODUIT_MULTIPRICES))
{ {
// Price and min price are variable (depends on level of company).
if (! empty($socid)) if (! empty($socid))
{ {
$soc = new Societe($db); $soc = new Societe($db);
$soc->id = $socid; $soc->id = $socid;
$soc->fetch($socid); $soc->fetch($socid);
// Selling price
print '<tr><td>' . $langs->trans("SellingPrice") . '</td>'; print '<tr><td>' . $langs->trans("SellingPrice") . '</td>';
print '<td>';
if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') { if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') {
print '<td>' . price($object->multiprices_ttc ["$soc->price_level"]); print price($object->multiprices_ttc["$soc->price_level"]);
} else { } else {
print '<td>' . price($object->multiprices ["$soc->price_level"]); print price($object->multiprices["$soc->price_level"]);
} }
if ($object->multiprices_base_type["$soc->price_level"]) { if ($object->multiprices_base_type["$soc->price_level"]) {
print ' ' . $langs->trans($object->multiprices_base_type ["$soc->price_level"]); print ' ' . $langs->trans($object->multiprices_base_type["$soc->price_level"]);
} else { } else {
print ' ' . $langs->trans($object->price_base_type); print ' ' . $langs->trans($object->price_base_type);
} }
print '</td></tr>'; print '</td></tr>';
// Prix mini // Price min
print '<tr><td>' . $langs->trans("MinPrice") . '</td><td>'; print '<tr><td>' . $langs->trans("MinPrice") . '</td><td>';
if ($object->multiprices_base_type["$soc->price_level"] == 'TTC') if ($object->multiprices_base_type["$soc->price_level"] == 'TTC')
{ {
...@@ -390,7 +391,7 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES)) ...@@ -390,7 +391,7 @@ if (! empty($conf->global->PRODUIT_MULTIPRICES))
for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++) for($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i ++)
{ {
// TVA // TVA
if ($i == 1) // We show only price for level 1 if ($i == 1) // We show only vat for level 1
{ {
print '<tr><td>' . $langs->trans("VATRate") . '</td><td>' . vatrate($object->multiprices_tva_tx [1], true) . '</td></tr>'; print '<tr><td>' . $langs->trans("VATRate") . '</td><td>' . vatrate($object->multiprices_tva_tx [1], true) . '</td></tr>';
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
if (! empty($conf->productbatch->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php'; if (! empty($conf->productbatch->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/productbatch.class.php';
...@@ -310,6 +311,9 @@ if ($action == 'updateline' && GETPOST('save') == $langs->trans('Save')) ...@@ -310,6 +311,9 @@ if ($action == 'updateline' && GETPOST('save') == $langs->trans('Save'))
header("Location: product.php?id=".$id); header("Location: product.php?id=".$id);
exit; exit;
} }
/* /*
* View * View
*/ */
...@@ -379,13 +383,50 @@ if ($id > 0 || $ref) ...@@ -379,13 +383,50 @@ if ($id > 0 || $ref)
print '<td>'.price($product->pmp).' '.$langs->trans("HT").'</td>'; print '<td>'.price($product->pmp).' '.$langs->trans("HT").'</td>';
print '</tr>'; print '</tr>';
// Sell price // Minimum Price
print '<tr><td>'.$langs->trans("SellPriceMin").'</td>'; print '<tr><td>'.$langs->trans("BuyingPriceMin").'</td>';
print '<td>'; print '<td colspan="2">';
if (empty($conf->global->PRODUIT_MULTIPRICES)) print price($product->price).' '.$langs->trans("HT"); $product_fourn = new ProductFournisseur($db);
else print $langs->trans("Variable"); if ($product_fourn->find_min_price_product_fournisseur($product->id) > 0)
print '</td>'; {
print '</tr>'; if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur();
else print $langs->trans("NotDefined");
}
print '</td></tr>';
$object = $product;
if (empty($conf->global->PRODUIT_MULTIPRICES))
{
// Price
print '<tr><td>' . $langs->trans("SellingPrice") . '</td><td>';
if ($object->price_base_type == 'TTC') {
print price($object->price_ttc) . ' ' . $langs->trans($object->price_base_type);
} else {
print price($object->price) . ' ' . $langs->trans($object->price_base_type);
}
print '</td></tr>';
// Price minimum
print '<tr><td>' . $langs->trans("MinPrice") . '</td><td>';
if ($object->price_base_type == 'TTC') {
print price($object->price_min_ttc) . ' ' . $langs->trans($object->price_base_type);
} else {
print price($object->price_min) . ' ' . $langs->trans($object->price_base_type);
}
print '</td></tr>';
}
else
{
// Price
print '<tr><td>' . $langs->trans("SellingPrice") . '</td><td>';
print $langs->trans("Variable");
print '</td></tr>';
// Price minimum
print '<tr><td>' . $langs->trans("MinPrice") . '</td><td>';
print $langs->trans("Variable");
print '</td></tr>';
}
// Stock // Stock
print '<tr><td>'.$form->editfieldkey("StockLimit",'stocklimit',$product->seuil_stock_alerte,$product,$user->rights->produit->creer).'</td><td colspan="2">'; print '<tr><td>'.$form->editfieldkey("StockLimit",'stocklimit',$product->seuil_stock_alerte,$product,$user->rights->produit->creer).'</td><td colspan="2">';
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment