Fix: Add constant to hide an obscur feature

This commit is contained in:
Laurent Destailleur 2014-12-03 00:22:48 +01:00
parent bde5a5d307
commit c3b74e66ff

View File

@ -34,7 +34,6 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
$langs->load("products"); $langs->load("products");
$langs->load("suppliers"); $langs->load("suppliers");
$langs->load("bills"); $langs->load("bills");
// Charges ????
if (! empty($conf->margin->enabled)) $langs->load("margins"); if (! empty($conf->margin->enabled)) $langs->load("margins");
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
@ -383,15 +382,18 @@ if ($id || $ref)
print '</tr>'; print '</tr>';
// Charges ???? // Charges ????
if (! empty($conf->margin->enabled)) if ($conf->global->PRODUCT_CHARGES)
{ {
print '<tr>'; if (! empty($conf->margin->enabled))
print '<td>'.$langs->trans("Charges").'</td>'; {
print '<td><input class="flat" name="charges" size="8" value="'.(GETPOST('charges')?price(GETPOST('charges')):(isset($product->fourn_charges)?price($product->fourn_charges):'')).'">'; print '<tr>';
print '</td>'; print '<td>'.$langs->trans("Charges").'</td>';
print '</tr>'; print '<td><input class="flat" name="charges" size="8" value="'.(GETPOST('charges')?price(GETPOST('charges')):(isset($product->fourn_charges)?price($product->fourn_charges):'')).'">';
print '</td>';
print '</tr>';
}
} }
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('id_fourn'=>$id_fourn,'prod_id'=>$product->id); $parameters=array('id_fourn'=>$id_fourn,'prod_id'=>$product->id);
@ -444,11 +446,17 @@ if ($id || $ref)
print '<td class="liste_titre" align="right">'.$langs->trans("VATRate").'</td>'; print '<td class="liste_titre" align="right">'.$langs->trans("VATRate").'</td>';
print '<td class="liste_titre" align="right">'.$langs->trans("PriceQtyMinHT").'</td>'; print '<td class="liste_titre" align="right">'.$langs->trans("PriceQtyMinHT").'</td>';
// Charges ???? // Charges ????
if (! empty($conf->margin->enabled)) print '<td align="right">'.$langs->trans("Charges").'</td>'; if ($conf->global->PRODUCT_CHARGES)
{
if (! empty($conf->margin->enabled)) print '<td align="right">'.$langs->trans("Charges").'</td>';
}
print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("UnitPriceHT"),$_SERVER["PHP_SELF"],"pfp.unitprice","",$param,'align="right"',$sortfield,$sortorder);
print '<td class="liste_titre" align="right">'.$langs->trans("DiscountQtyMin").'</td>'; print '<td class="liste_titre" align="right">'.$langs->trans("DiscountQtyMin").'</td>';
// Charges ???? // Charges ????
if (! empty($conf->margin->enabled)) print '<td align="right">'.$langs->trans("UnitCharges").'</td>'; if ($conf->global->PRODUCT_CHARGES)
{
if (! empty($conf->margin->enabled)) print '<td align="right">'.$langs->trans("UnitCharges").'</td>';
}
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print "</tr>\n"; print "</tr>\n";
@ -494,13 +502,16 @@ if ($id || $ref)
print '</td>'; print '</td>';
// Charges ???? // Charges ????
if (! empty($conf->margin->enabled)) if ($conf->global->PRODUCT_CHARGES)
{ {
print '<td align="right">'; if (! empty($conf->margin->enabled))
print $productfourn->fourn_charges?price($productfourn->fourn_charges):""; {
print '</td>'; print '<td align="right">';
print $productfourn->fourn_charges?price($productfourn->fourn_charges):"";
print '</td>';
}
} }
// Unit price // Unit price
print '<td align="right">'; print '<td align="right">';
print price($productfourn->fourn_unitprice); print price($productfourn->fourn_unitprice);
@ -512,14 +523,17 @@ if ($id || $ref)
print price2num($productfourn->fourn_remise_percent).'%'; print price2num($productfourn->fourn_remise_percent).'%';
print '</td>'; print '</td>';
// Unit Charges ??? // Charges ????
if (! empty($conf->margin->enabled)) if ($conf->global->PRODUCT_CHARGES)
{ {
print '<td align="right">'; if (! empty($conf->margin->enabled))
print $productfourn->fourn_unitcharges?price($productfourn->fourn_unitcharges) : ($productfourn->fourn_qty?price($productfourn->fourn_charges/$productfourn->fourn_qty):"&nbsp;"); {
print '</td>'; print '<td align="right">';
print $productfourn->fourn_unitcharges?price($productfourn->fourn_unitcharges) : ($productfourn->fourn_qty?price($productfourn->fourn_charges/$productfourn->fourn_qty):"&nbsp;");
print '</td>';
}
} }
if (is_object($hookmanager)) if (is_object($hookmanager))
{ {
$parameters=array('id_pfp'=>$productfourn->product_fourn_price_id,'id_fourn'=>$id_fourn,'prod_id'=>$product->id); $parameters=array('id_pfp'=>$productfourn->product_fourn_price_id,'id_fourn'=>$id_fourn,'prod_id'=>$product->id);