Simplification gestion des lignes factures/commandes/propales
This commit is contained in:
parent
d0e2bfb024
commit
8d7bb266ef
@ -234,6 +234,7 @@ print '</form>';
|
||||
|
||||
|
||||
// Modification description produit activation/desactivation
|
||||
/* Cet option ne doit pas exister. Les description de lignes doivent toujours etre modifiable.
|
||||
$var=!$var;
|
||||
print "<form method=\"post\" action=\"produit.php\">";
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"changeproductdesc\">";
|
||||
@ -246,6 +247,7 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
print '</form>';
|
||||
*/
|
||||
|
||||
// Visualiser description produit dans les formulaires activation/desactivation
|
||||
$var=!$var;
|
||||
|
||||
@ -536,16 +536,9 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
|
||||
}
|
||||
}
|
||||
|
||||
// La description de la ligne est celle saisie ou
|
||||
// celle du produit si PRODUIT_CHANGE_PROD_DESC est défini
|
||||
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
{
|
||||
$desc = $prod->description;
|
||||
}
|
||||
else
|
||||
{
|
||||
$desc = $_POST['np_desc'];
|
||||
}
|
||||
$desc = $prod->description;
|
||||
$desc.= $prod->description && $_POST['np_desc'] ? "\n" : "";
|
||||
$desc.= $_POST['np_desc'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1085,30 +1078,19 @@ if ($_GET['propalid'] > 0)
|
||||
print '<td>';
|
||||
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
|
||||
$text = '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
||||
|
||||
// Affiche ligne produit
|
||||
$text = '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
||||
if ($objp->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
|
||||
else $text.= img_object($langs->trans('ShowProduct'),'product');
|
||||
$text.= ' '.$objp->ref.'</a>';
|
||||
$text.= ' - '.nl2br(stripslashes($objp->product));
|
||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||
{
|
||||
print $text;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $html->textwithtooltip($text,$objp->description,4,'','',$i,500,100,$objp->ref.' - '.nl2br(stripslashes($objp->product)));
|
||||
}
|
||||
$text.= ' - '.$objp->product;
|
||||
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':$objp->description);
|
||||
print $html->textwithtooltip($text,$description,3,'','',$i);
|
||||
print_date_range($objp->date_start,$objp->date_end);
|
||||
|
||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||
{
|
||||
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
{
|
||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<br>'.nl2br($objp->product_desc);
|
||||
}
|
||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -352,18 +351,9 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
|
||||
}
|
||||
}
|
||||
|
||||
// La description de la ligne est celle saisie ou
|
||||
// celle du produit si PRODUIT_CHANGE_PROD_DESC est défini
|
||||
$libelle = $prod->libelle;
|
||||
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
{
|
||||
$desc = $prod->description;
|
||||
}
|
||||
else
|
||||
{
|
||||
$desc = $_POST['np_desc'];
|
||||
}
|
||||
|
||||
$desc = $prod->description;
|
||||
$desc.= $prod->description && $_POST['np_desc'] ? "\n" : "";
|
||||
$desc.= $_POST['np_desc'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1343,32 +1333,20 @@ else
|
||||
{
|
||||
print '<td>';
|
||||
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
|
||||
|
||||
// Affiche ligne produit
|
||||
$text = '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
||||
if ($objp->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
|
||||
else $text.= img_object($langs->trans('ShowProduct'),'product');
|
||||
$text.= ' '.$objp->ref.'</a>';
|
||||
$text.= ' - '.nl2br(stripslashes($objp->product));
|
||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||
{
|
||||
print $text;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $html->textwithtooltip($text,$objp->description,4,'','',$i,$objp->ref.' - '.nl2br(stripslashes($objp->product)));
|
||||
}
|
||||
$text.= ' - '.$objp->product;
|
||||
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':$objp->description);
|
||||
print $html->textwithtooltip($text,$description,3,'','',$i);
|
||||
// Todo: voir si on insert ou pas en option les dates de début et de fin de service
|
||||
//print_date_range($objp->date_start,$objp->date_end);
|
||||
|
||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||
{
|
||||
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
{
|
||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.nl2br(stripslashes($objp->description)):'';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<br>'.nl2br($objp->product_desc);
|
||||
}
|
||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
@ -802,16 +802,9 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') &&
|
||||
}
|
||||
}
|
||||
|
||||
// La description de la ligne est celle saisie ou
|
||||
// celle du produit si PRODUIT_CHANGE_PROD_DESC défini
|
||||
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
{
|
||||
$desc = $prod->description;
|
||||
}
|
||||
else
|
||||
{
|
||||
$desc=$_POST['np_desc'];
|
||||
}
|
||||
$desc = $prod->description;
|
||||
$desc.= $prod->description && $_POST['np_desc'] ? "\n" : "";
|
||||
$desc.= $_POST['np_desc'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2248,31 +2241,19 @@ else
|
||||
{
|
||||
print '<td>';
|
||||
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
|
||||
|
||||
// Affiche ligne produit
|
||||
$text = '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
||||
if ($objp->fk_product_type==1) $text.= img_object($langs->trans('ShowService'),'service');
|
||||
else $text.= img_object($langs->trans('ShowProduct'),'product');
|
||||
$text.= ' '.$objp->ref.'</a>';
|
||||
$text.= ' - '.nl2br(stripslashes($objp->product));
|
||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||
{
|
||||
print $text;
|
||||
}
|
||||
else
|
||||
{
|
||||
print $html->textwithtooltip($text,$objp->description,4,'','',$i,$objp->ref.' - '.nl2br(stripslashes($objp->product)));
|
||||
}
|
||||
$text.= ' - '.$objp->product;
|
||||
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':$objp->description);
|
||||
print $html->textwithtooltip($text,$description,3,'','',$i);
|
||||
print_date_range($objp->date_start,$objp->date_end);
|
||||
|
||||
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||
{
|
||||
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
{
|
||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<br>'.nl2br($objp->product_desc);
|
||||
}
|
||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
||||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
@ -116,14 +116,9 @@ if ($_POST['action'] == 'addligne' && $user->rights->fournisseur->commande->cree
|
||||
|
||||
$libelle = $prod->libelle;
|
||||
|
||||
// La description de la ligne est celle saisie ou
|
||||
// celle du produit si (non saisi + PRODUIT_CHANGE_PROD_DESC défini)
|
||||
// \todo Ne faut-il pas rendre $conf->global->PRODUIT_CHANGE_PROD_DESC toujours a on
|
||||
$desc=$_POST['np_desc'];
|
||||
if (! $desc && $conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||
{
|
||||
$desc = $prod->description;
|
||||
}
|
||||
$desc = $prod->description;
|
||||
$desc.= $prod->description && $_POST['np_desc'] ? "\n" : "";
|
||||
$desc.= $_POST['np_desc'];
|
||||
|
||||
$tva_tx = get_default_tva($soc,$mysoc,$prod->tva_tx);
|
||||
}
|
||||
|
||||
@ -65,15 +65,15 @@ class Form
|
||||
|
||||
|
||||
/**
|
||||
\brief Affiche un texte+picto avec tooltip sur texte ou sur picto
|
||||
\param text Texte à afficher
|
||||
\param htmltext Contenu html du tooltip, codé en html
|
||||
\param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2, 4=tooltip Ajax
|
||||
\param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est après
|
||||
\param img Code img du picto
|
||||
\return string Code html du texte,picto
|
||||
\brief Affiche un texte+picto avec tooltip sur texte ou sur picto
|
||||
\param text Texte à afficher
|
||||
\param htmltext Contenu html du tooltip, codé en html
|
||||
\param tooltipon 1=tooltip sur texte, 2=tooltip sur picto, 3=tooltip sur les 2, 4=tooltip sur les 2 et forcé en Ajaxa
|
||||
\param direction -1=Le picto est avant, 0=pas de picto, 1=le picto est après
|
||||
\param img Code img du picto
|
||||
\return string Code html du texte,picto
|
||||
*/
|
||||
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$i=1,$width='200',$shiftX='10',$option='')
|
||||
function textwithtooltip($text,$htmltext,$tooltipon=1,$direction=0,$img='',$i=1,$width='200',$shiftX='10')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
@ -96,7 +96,7 @@ class Form
|
||||
$s.= '</div>'."\n";
|
||||
$s.= '<script type=\'text/javascript\'>'."\n";
|
||||
$s.= 'TooltipManager.init("","",{width:'.$width.', shiftX:'.$shiftX.'});'."\n";
|
||||
$s.= 'TooltipManager.addHTML("tip'.$i.'", "tooltip_content");'."\n";
|
||||
$s.= 'TooltipManager.addHTML("tip'.$i.'", "tooltip_content");'."\n";
|
||||
$s.= '</script>'."\n";
|
||||
}
|
||||
else
|
||||
|
||||
@ -1061,4 +1061,6 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (10
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (105,10, '15','0','TVA 12% Majoré à 25% (15%)',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (106,10, '22.5','0','VAT 18% Majoré à 25% (22.5%)',1);
|
||||
|
||||
ALTER TABLE llx_bank_account MODIFY iban_prefix varchar(50);
|
||||
ALTER TABLE llx_bank_account MODIFY iban_prefix varchar(50);
|
||||
|
||||
delete from llx_const where name='PRODUIT_CHANGE_PROD_DESC';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user