Fix: Hide price if multiprice enabled

This commit is contained in:
Laurent Destailleur 2011-05-13 22:04:52 +00:00
parent 6ab2ecc10c
commit be7b79d31d
4 changed files with 44 additions and 54 deletions

View File

@ -997,23 +997,6 @@ if ($id || $ref)
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionnarySetup"),1);
print '</td></tr>'; print '</td></tr>';
// Hidden
/*
if ((! $product->isservice() && $user->rights->produit->hidden)
|| ($product->isservice() && $user->rights->service->hidden))
{
print '<tr><td>'.$langs->trans("HiddenIntoCombo").'</td><td>';
print $html->selectyesno('hidden',$product->hidden);
print '</td></tr>';
}
else
{
print '<tr><td>'.$langs->trans("HiddenIntoCombo").'</td><td>';
print yn("No");
print '</td></tr>';
}
*/
// Note // Note
print '<tr><td valign="top">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="2">'; print '<tr><td valign="top">'.$langs->trans("NoteNotVisibleOnBill").'</td><td colspan="2">';
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
@ -1054,11 +1037,13 @@ if ($id || $ref)
if (empty($usecanvas)) if (empty($usecanvas))
{ {
// En mode visu $isphoto=$product->is_photo_available($conf->product->dir_output);
// En mode visu
print '<table class="border" width="100%"><tr>'; print '<table class="border" width="100%"><tr>';
// Ref // Ref
print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="2">'; print '<td width="15%">'.$langs->trans("Ref").'</td><td colspan="'.(2+($isphoto?1:0)).'">';
print $html->showrefnav($product,'ref','',1,'ref'); print $html->showrefnav($product,'ref','',1,'ref');
print '</td>'; print '</td>';
@ -1067,8 +1052,12 @@ if ($id || $ref)
// Label // Label
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$product->libelle.'</td>'; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="2">'.$product->libelle.'</td>';
$nblignes=5; $nblignes=9;
if ($product->is_photo_available($conf->product->dir_output)) if ($product->type!=1) $nblignes++;
if ($product->isservice()) $nblignes++;
else $nblignes+=4;
if ($isphoto)
{ {
// Photo // Photo
print '<td valign="middle" align="center" width="30%" rowspan="'.$nblignes.'">'; print '<td valign="middle" align="center" width="30%" rowspan="'.$nblignes.'">';
@ -1175,25 +1164,10 @@ if ($id || $ref)
// Custom code // Custom code
print '<tr><td>'.$langs->trans("CustomCode").'</td><td colspan="2">'.$product->customcode.'</td>'; print '<tr><td>'.$langs->trans("CustomCode").'</td><td colspan="2">'.$product->customcode.'</td>';
// Origin country code // Origin country code
print '<tr><td>'.$langs->trans("CountryOrigin").'</td><td colspan="2">'.getCountry($product->country_id,0,$db).'</td>'; print '<tr><td>'.$langs->trans("CountryOrigin").'</td><td colspan="2">'.getCountry($product->country_id,0,$db).'</td>';
// Hidden
/*
if ((! $product->isservice() && $user->rights->produit->hidden)
|| ($product->isservice() && $user->rights->service->hidden))
{
print '<tr><td>'.$langs->trans("HiddenIntoCombo").'</td><td colspan="2">';
print yn($product->hidden);
print "</td></tr>\n";
}
else
{
print '<tr><td>'.$langs->trans("HiddenIntoCombo").'</td><td>';
print yn("No");
print '</td></tr>';
}
*/
// Note // Note
print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="2">'.(dol_textishtml($product->note)?$product->note:dol_nl2br($product->note,1,true)).'</td></tr>'; print '<tr><td valign="top">'.$langs->trans("Note").'</td><td colspan="2">'.(dol_textishtml($product->note)?$product->note:dol_nl2br($product->note,1,true)).'</td></tr>';

View File

@ -307,7 +307,7 @@ if ($resql)
if ($conf->barcode->enabled) print_liste_field_titre($langs->trans("BarCode"),"liste.php", "p.barcode",$param,"","",$sortfield,$sortorder); if ($conf->barcode->enabled) print_liste_field_titre($langs->trans("BarCode"),"liste.php", "p.barcode",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateModification"),"liste.php", "p.tms",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateModification"),"liste.php", "p.tms",$param,"",'align="center"',$sortfield,$sortorder);
if ($conf->service->enabled && $type != 0) print_liste_field_titre($langs->trans("Duration"),"liste.php", "p.duration",$param,"",'align="center"',$sortfield,$sortorder); if ($conf->service->enabled && $type != 0) print_liste_field_titre($langs->trans("Duration"),"liste.php", "p.duration",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("SellingPrice"),"liste.php", "p.price",$param,"",'align="right"',$sortfield,$sortorder); if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("SellingPrice"),"liste.php", "p.price",$param,"",'align="right"',$sortfield,$sortorder);
if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("PhysicalStock").'</td>'; if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("PhysicalStock").'</td>';
print_liste_field_titre($langs->trans("Sell"),"liste.php", "p.tosell",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Sell"),"liste.php", "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Buy"),"liste.php", "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Buy"),"liste.php", "p.tobuy",$param,"",'align="right"',$sortfield,$sortorder);
@ -330,24 +330,35 @@ if ($resql)
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
// Duration
if ($conf->service->enabled && $type != 0) if ($conf->service->enabled && $type != 0)
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
} }
print '<td class="liste_titre">';
print '&nbsp;'; // Sell price
print '</td>'; if (empty($conf->global->PRODUIT_MULTIPRICES))
{
print '<td class="liste_titre">';
print '&nbsp;';
print '</td>';
}
// Stock
if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1) if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1)
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
} }
print '<td class="liste_titre">';
print '<td class="liste_titre">';
print '&nbsp;'; print '&nbsp;';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="right">'; print '<td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
@ -414,11 +425,14 @@ if ($resql)
print '</td>'; print '</td>';
} }
// Price // Sell price
print '<td align="right">'; if (empty($conf->global->PRODUIT_MULTIPRICES))
if ($objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); {
else print price($objp->price).' '.$langs->trans("HT"); print '<td align="right">';
print '</td>'; if ($objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC");
else print price($objp->price).' '.$langs->trans("HT");
print '</td>';
}
// Show stock // Show stock
if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1) if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1)

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
@ -114,7 +114,7 @@ $html = new Form($db);
$product = new Product($db); $product = new Product($db);
if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]); if ($_GET["ref"]) $result = $product->fetch('',$_GET["ref"]);
if ($_GET["id"]) $result = $product->fetch($_GET["id"]); if ($_GET["id"]) $result = $product->fetch($_GET["id"]);
llxHeader("","",$langs->trans("CardProduct".$product->type)); llxHeader("","",$langs->trans("CardProduct".$product->type));
@ -136,8 +136,10 @@ print '</tr>';
// Label // Label
print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>'; print '<tr><td>'.$langs->trans("Label").'</td><td>'.$product->libelle.'</td>';
$nblignes=4; $isphoto=$product->is_photo_available($conf->product->dir_output);
if ($product->is_photo_available($conf->product->dir_output))
$nblignes=5;
if ($isphoto)
{ {
// Photo // Photo
print '<td valign="middle" align="center" width="30%" rowspan="'.$nblignes.'">'; print '<td valign="middle" align="center" width="30%" rowspan="'.$nblignes.'">';
@ -148,7 +150,7 @@ if ($product->is_photo_available($conf->product->dir_output))
print '</tr>'; print '</tr>';
// MultiPrix // MultiPrix
if($conf->global->PRODUIT_MULTIPRICES) if ($conf->global->PRODUIT_MULTIPRICES)
{ {
if ($socid) if ($socid)
{ {

View File

@ -1377,8 +1377,8 @@ else
// Status // Status
print '<tr><td>'.$langs->trans("Status").'</td>'; print '<tr><td>'.$langs->trans("Status").'</td>';
$activity_status = $soc->status == 1 ? $langs->trans('InActivity') : $langs->trans('ActivityCeased'); // nouvelle entrée statut activité print '<td colspan="3">';
print '<td colspan="3">'.$activity_status; print $soc->getLibStatut(2);
print '</td></tr>'; print '</td></tr>';
// Barcode // Barcode