Amélioration de la possibilité d'éditer ou non les description produit dans les formulaires
Ajout de la possibilité d'afficher ou pas la description produit dans les formulaire Ajout de la possibilité d'utiliser fckeditor dans la description des produits personnalisés des formulaires Modifs esthétiques mineures
This commit is contained in:
parent
3d914a73ea
commit
75b5b3c4c7
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2006 Regis Houssin <regis.houssin@cap-networks.com>
|
* Copyright (C) 2005-2007 Regis Houssin <regis.houssin@cap-networks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -40,6 +40,7 @@ $modules = array(
|
|||||||
'SOCIETE' => 'FCKeditorForCompany',
|
'SOCIETE' => 'FCKeditorForCompany',
|
||||||
'PRODUCTDESC' => 'FCKeditorForProduct',
|
'PRODUCTDESC' => 'FCKeditorForProduct',
|
||||||
'DETAILS' => 'FCKeditorForProductDetails',
|
'DETAILS' => 'FCKeditorForProductDetails',
|
||||||
|
'DETAILS_PERSO' => 'FCKeditorForProductDetailsPerso',
|
||||||
'MAILING' => 'FCKeditorForMailing',
|
'MAILING' => 'FCKeditorForMailing',
|
||||||
'MEMBER' => 'FCKeditorForMembers'
|
'MEMBER' => 'FCKeditorForMembers'
|
||||||
);
|
);
|
||||||
@ -48,6 +49,7 @@ $conditions = array(
|
|||||||
'SOCIETE' => $conf->societe->enabled,
|
'SOCIETE' => $conf->societe->enabled,
|
||||||
'PRODUCTDESC' => ($conf->produit->enabled||$conf->service->enabled),
|
'PRODUCTDESC' => ($conf->produit->enabled||$conf->service->enabled),
|
||||||
'DETAILS' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled),
|
'DETAILS' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled),
|
||||||
|
'DETAILS_PERSO' => ($conf->facture->enabled||$conf->propal->enabled||$conf->commande->enabled),
|
||||||
'MAILING' => $conf->mailing->enabled,
|
'MAILING' => $conf->mailing->enabled,
|
||||||
'MEMBER' => $conf->adherent->enabled
|
'MEMBER' => $conf->adherent->enabled
|
||||||
);
|
);
|
||||||
@ -56,6 +58,7 @@ $picto = array(
|
|||||||
'SOCIETE' => 'company',
|
'SOCIETE' => 'company',
|
||||||
'PRODUCTDESC' => 'product',
|
'PRODUCTDESC' => 'product',
|
||||||
'DETAILS' => 'generic',
|
'DETAILS' => 'generic',
|
||||||
|
'DETAILS_PERSO' => 'generic',
|
||||||
'MAILING' => 'email',
|
'MAILING' => 'email',
|
||||||
'MEMBER' => 'user'
|
'MEMBER' => 'user'
|
||||||
);
|
);
|
||||||
@ -66,7 +69,7 @@ foreach($modules as $const => $desc)
|
|||||||
if ($_GET["action"] == 'activate_'.strtolower($const))
|
if ($_GET["action"] == 'activate_'.strtolower($const))
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1");
|
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1");
|
||||||
//si fckeditor est activé dans la description produit/service, on l'active dans les documents
|
// Si fckeditor est activé dans la description produit/service, on l'active dans les formulaires
|
||||||
if ($const == 'PRODUCTDESC')
|
if ($const == 'PRODUCTDESC')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1");
|
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1");
|
||||||
@ -77,10 +80,12 @@ foreach($modules as $const => $desc)
|
|||||||
if ($_GET["action"] == 'disable_'.strtolower($const))
|
if ($_GET["action"] == 'disable_'.strtolower($const))
|
||||||
{
|
{
|
||||||
dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const);
|
dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const);
|
||||||
//si fckeditor est desactivé dans les documents, on le désactive dans la description produit/service
|
// Si fckeditor est desactivé dans les formulaires,
|
||||||
|
// on le désactive dans la description produit/service et dans la description personnalisée
|
||||||
if ($const == 'DETAILS')
|
if ($const == 'DETAILS')
|
||||||
{
|
{
|
||||||
dolibarr_del_const($db, "FCKEDITOR_ENABLE_PRODUCTDESC");
|
dolibarr_del_const($db, "FCKEDITOR_ENABLE_PRODUCTDESC");
|
||||||
|
dolibarr_del_const($db, "FCKEDITOR_ENABLE_DETAILS_PERSO");
|
||||||
}
|
}
|
||||||
Header("Location: fckeditor.php");
|
Header("Location: fckeditor.php");
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@ -113,7 +113,6 @@ else if ($_POST["action"] == 'sousproduits')
|
|||||||
else if ($_POST["action"] == 'changeproductdesc')
|
else if ($_POST["action"] == 'changeproductdesc')
|
||||||
{
|
{
|
||||||
dolibarr_set_const($db, "PRODUIT_CHANGE_PROD_DESC", $_POST["activate_changeproductdesc"]);
|
dolibarr_set_const($db, "PRODUIT_CHANGE_PROD_DESC", $_POST["activate_changeproductdesc"]);
|
||||||
dolibarr_set_const($db, "PRODUIT_DESC_IN_FORM", 0);
|
|
||||||
Header("Location: produit.php");
|
Header("Location: produit.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -264,22 +263,20 @@ print "</td>";
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
if ($conf->global->PRODUIT_CHANGE_PROD_DESC == 0)
|
// Visualiser description produit dans les formulaires activation/desactivation
|
||||||
{
|
$var=!$var;
|
||||||
// Visualiser description produit dans les formulaires activation/desactivation
|
print "<form method=\"post\" action=\"produit.php\">";
|
||||||
$var=!$var;
|
print "<input type=\"hidden\" name=\"action\" value=\"viewProdDescInForm\">";
|
||||||
print "<form method=\"post\" action=\"produit.php\">";
|
print "<tr ".$bc[$var].">";
|
||||||
print "<input type=\"hidden\" name=\"action\" value=\"viewProdDescInForm\">";
|
print '<td width="80%">'.$langs->trans("ViewProductDescInFormAbility").'</td>';
|
||||||
print "<tr ".$bc[$var].">";
|
print '<td width="60" align="right">';
|
||||||
print '<td width="80%">'.$langs->trans("ViewProductDescInFormAbility").'</td>';
|
print $html->selectyesno("activate_viewProdDescInForm",$conf->global->PRODUIT_DESC_IN_FORM,1);
|
||||||
print '<td width="60" align="right">';
|
print '</td><td align="right">';
|
||||||
print $html->selectyesno("activate_viewProdDescInForm",$conf->global->PRODUIT_DESC_IN_FORM,1);
|
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||||
print '</td><td align="right">';
|
print "</td>";
|
||||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
print '</tr>';
|
||||||
print "</td>";
|
print '</form>';
|
||||||
print '</tr>';
|
|
||||||
print '</form>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Utilisation de l'écotaxe
|
// Utilisation de l'écotaxe
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|||||||
@ -505,13 +505,15 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// La description de la ligne est celle saisie ou
|
// La description de la ligne est celle saisie ou
|
||||||
// celle du produit si (non saisi + PRODUIT_CHANGE_PROD_DESC défini)
|
// celle du produit si PRODUIT_CHANGE_PROD_DESC est défini
|
||||||
// \todo Ne faut-il pas rendre $conf->global->PRODUIT_CHANGE_PROD_DESC toujours a on
|
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||||
$desc=$_POST['np_desc'];
|
|
||||||
if (! $desc && $conf->global->PRODUIT_CHANGE_PROD_DESC)
|
|
||||||
{
|
{
|
||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$desc = $_POST['np_desc'];
|
||||||
|
}
|
||||||
|
|
||||||
$tva_tx = get_default_tva($mysoc,$soc,$prod->tva_tx);
|
$tva_tx = get_default_tva($mysoc,$soc,$prod->tva_tx);
|
||||||
}
|
}
|
||||||
@ -851,7 +853,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|
||||||
// date de livraison (conditonné sur PROPALE_ADD_SHIPPING_DATE car carac à
|
// date de livraison (conditionné sur PROPALE_ADD_SHIPPING_DATE car carac à
|
||||||
// gérer par les commandes et non les propal
|
// gérer par les commandes et non les propal
|
||||||
if ($conf->expedition->enabled)
|
if ($conf->expedition->enabled)
|
||||||
{
|
{
|
||||||
@ -1045,9 +1047,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
|
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
|
||||||
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
|
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
|
||||||
print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>';
|
print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>';
|
||||||
print '<td width="16"> </td>';
|
print '<td width="48" colspan="3"> </td>';
|
||||||
print '<td width="16"> </td>';
|
|
||||||
print '<td width="16"> </td>';
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
$var=true;
|
$var=true;
|
||||||
@ -1068,26 +1068,21 @@ if ($_GET['propalid'] > 0)
|
|||||||
if ($objp->fk_product_type==1) print img_object($langs->trans('ShowService'),'service');
|
if ($objp->fk_product_type==1) print img_object($langs->trans('ShowService'),'service');
|
||||||
else print img_object($langs->trans('ShowProduct'),'product');
|
else print img_object($langs->trans('ShowProduct'),'product');
|
||||||
print ' '.$objp->ref.'</a>';
|
print ' '.$objp->ref.'</a>';
|
||||||
print ' - '.nl2br($objp->product);
|
print ' - '.nl2br(stripslashes($objp->product));
|
||||||
// \todo Ne faut-il pas rendre $conf->global->PRODUIT_CHANGE_PROD_DESC toujours a on
|
print_date_range($objp->date_start,$objp->date_end);
|
||||||
if ($conf->global->PRODUIT_DESC_IN_FORM && !$conf->global->PRODUIT_CHANGE_PROD_DESC)
|
|
||||||
{
|
|
||||||
print '<br>'.nl2br($objp->product_desc);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($objp->date_start && $objp->date_end)
|
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||||
{
|
{
|
||||||
print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')';
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($objp->date_start && ! $objp->date_end)
|
|
||||||
{
|
|
||||||
print ' (A partir du '.dolibarr_print_date($objp->date_start).')';
|
|
||||||
}
|
|
||||||
if (! $objp->date_start && $objp->date_end)
|
|
||||||
{
|
|
||||||
print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')';
|
|
||||||
}
|
|
||||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1116,18 +1111,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print nl2br($objp->description);
|
print nl2br($objp->description);
|
||||||
if ($objp->date_start && $objp->date_end)
|
print_date_range($objp->date_start,$objp->date_end);
|
||||||
{
|
|
||||||
print ' (Du '.dolibarr_print_date($objp->date_start).' au '.dolibarr_print_date($objp->date_end).')';
|
|
||||||
}
|
|
||||||
if ($objp->date_start && ! $objp->date_end)
|
|
||||||
{
|
|
||||||
print ' (A partir du '.dolibarr_print_date($objp->date_start).')';
|
|
||||||
}
|
|
||||||
if (! $objp->date_start && $objp->date_end)
|
|
||||||
{
|
|
||||||
print " (Jusqu'au ".dolibarr_print_date($objp->date_end).')';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
}
|
}
|
||||||
@ -1293,13 +1277,10 @@ if ($_GET['propalid'] > 0)
|
|||||||
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
|
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('ReductionShort').'</td>';
|
print '<td align="right">'.$langs->trans('ReductionShort').'</td>';
|
||||||
print '<td> </td>';
|
print '<td colspan="4"> </td>';
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Ajout produit produits/services personalisés
|
// Ajout produit produits/services personnalisés
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'#add" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'#add" method="post">';
|
||||||
print '<input type="hidden" name="propalid" value="'.$propal->id.'">';
|
print '<input type="hidden" name="propalid" value="'.$propal->id.'">';
|
||||||
print '<input type="hidden" name="action" value="addligne">';
|
print '<input type="hidden" name="action" value="addligne">';
|
||||||
@ -1307,7 +1288,19 @@ if ($_GET['propalid'] > 0)
|
|||||||
$var=true;
|
$var=true;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].">\n";
|
print '<tr '.$bc[$var].">\n";
|
||||||
print '<td><textarea class="flat" cols="70" name="np_desc" rows="'.ROWS_2.'"></textarea></td>';
|
print '<td>';
|
||||||
|
// éditeur wysiwyg
|
||||||
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
|
$doleditor=new DolEditor('np_desc','',100,'dolibarr_details');
|
||||||
|
$doleditor->Create();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<textarea class="flat" cols="70" name="np_desc" rows="'.ROWS_2.'"></textarea>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if($societe->tva_assuj == "0")
|
if($societe->tva_assuj == "0")
|
||||||
{
|
{
|
||||||
@ -1329,6 +1322,21 @@ if ($_GET['propalid'] > 0)
|
|||||||
// Ajout de produits/services prédéfinis
|
// Ajout de produits/services prédéfinis
|
||||||
if ($conf->produit->enabled)
|
if ($conf->produit->enabled)
|
||||||
{
|
{
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td colspan="3">';
|
||||||
|
if ($conf->service->enabled)
|
||||||
|
{
|
||||||
|
print $langs->trans('RecordedProductsAndServices');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans('RecordedProducts');
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||||
|
print '<td align="right">'.$langs->trans('ReductionShort').'</td>';
|
||||||
|
print '<td colspan="4"> </td>';
|
||||||
|
print '</tr>';
|
||||||
print '<form id="addpredefinedproduct" action="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'#add" method="post">';
|
print '<form id="addpredefinedproduct" action="'.$_SERVER["PHP_SELF"].'?propalid='.$propal->id.'#add" method="post">';
|
||||||
print '<input type="hidden" name="propalid" value="'.$propal->id.'">';
|
print '<input type="hidden" name="propalid" value="'.$propal->id.'">';
|
||||||
print '<input type="hidden" name="action" value="addligne">';
|
print '<input type="hidden" name="action" value="addligne">';
|
||||||
@ -1336,7 +1344,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
|
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="3">';
|
||||||
// multiprix
|
// multiprix
|
||||||
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
||||||
{
|
{
|
||||||
@ -1347,9 +1355,23 @@ if ($_GET['propalid'] > 0)
|
|||||||
$html->select_produits('','idprod','',$conf->produit->limit_size);
|
$html->select_produits('','idprod','',$conf->produit->limit_size);
|
||||||
}
|
}
|
||||||
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';
|
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';
|
||||||
print '<textarea cols="70" name="np_desc" rows="'.ROWS_2.'" class="flat"></textarea>';
|
|
||||||
|
if (! $conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||||
|
{
|
||||||
|
// éditeur wysiwyg
|
||||||
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
|
$doleditor=new DolEditor('np_desc','',100,'dolibarr_details');
|
||||||
|
$doleditor->Create();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<textarea cols="70" name="np_desc" rows="'.ROWS_2.'" class="flat"></textarea>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td> </td>';
|
|
||||||
print '<td align="right"><input type="text" size="2" name="qty" value="1"></td>';
|
print '<td align="right"><input type="text" size="2" name="qty" value="1"></td>';
|
||||||
print '<td align="right" nowrap><input type="text" size="1" name="remise_percent" value="'.$societe->remise_client.'">%</td>';
|
print '<td align="right" nowrap><input type="text" size="1" name="remise_percent" value="'.$societe->remise_client.'">%</td>';
|
||||||
|
|
||||||
@ -1396,7 +1418,7 @@ if ($_GET['propalid'] > 0)
|
|||||||
*/
|
*/
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($_GET['action'] != 'statut')
|
if ($_GET['action'] != 'statut' && $_GET['action'] <> 'editline')
|
||||||
{
|
{
|
||||||
|
|
||||||
// Valid
|
// Valid
|
||||||
|
|||||||
@ -256,56 +256,58 @@ if ($_REQUEST['action'] == 'setremiseabsolue' && $user->rights->facture->creer)
|
|||||||
*/
|
*/
|
||||||
if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
|
if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
|
||||||
{
|
{
|
||||||
if ($_POST['qty'] && (($_POST['pu'] && $_POST['desc']) || $_POST['idprod']))
|
if ($_POST['qty'] && (($_POST['pu'] && $_POST['np_desc']) || $_POST['idprod']))
|
||||||
|
{
|
||||||
|
$commande = new Commande($db);
|
||||||
|
$ret=$commande->fetch($_POST['id']);
|
||||||
|
$soc = new Societe($db, $commande->socid);
|
||||||
|
$soc->fetch($commande->socid);
|
||||||
|
|
||||||
|
if ($ret < 0)
|
||||||
{
|
{
|
||||||
$commande = new Commande($db);
|
dolibarr_print_error($db,$commande->error);
|
||||||
$ret=$commande->fetch($_POST['id']);
|
exit;
|
||||||
$soc = new Societe($db, $commande->socid);
|
}
|
||||||
$soc->fetch($commande->socid);
|
|
||||||
|
|
||||||
if ($ret < 0)
|
// Ecrase $pu par celui du produit
|
||||||
{
|
// Ecrase $desc par celui du produit
|
||||||
dolibarr_print_error($db,$commande->error);
|
// Ecrase $txtva par celui du produit
|
||||||
exit;
|
if ($_POST['idprod'])
|
||||||
}
|
{
|
||||||
|
$prod = new Product($db, $_POST['idprod']);
|
||||||
// Ecrase $pu par celui du produit
|
$prod->fetch($_POST['idprod']);
|
||||||
// Ecrase $desc par celui du produit
|
|
||||||
// Ecrase $txtva par celui du produit
|
$libelle = $prod->libelle;
|
||||||
if ($_POST['idprod'])
|
|
||||||
{
|
// multiprix
|
||||||
$prod = new Product($db, $_POST['idprod']);
|
if ($conf->global->PRODUIT_MULTIPRICES == 1)
|
||||||
$prod->fetch($_POST['idprod']);
|
|
||||||
|
|
||||||
$libelle = $prod->libelle;
|
|
||||||
|
|
||||||
// multiprix
|
|
||||||
if ($conf->global->PRODUIT_MULTIPRICES == 1)
|
|
||||||
{
|
{
|
||||||
$pu = $prod->multiprices[$soc->price_level];
|
$pu = $prod->multiprices[$soc->price_level];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$pu=$prod->price;
|
$pu=$prod->price;
|
||||||
}
|
}
|
||||||
|
|
||||||
// La description de la ligne est celle saisie ou
|
// La description de la ligne est celle saisie ou
|
||||||
// celle du produit si (non saisi + PRODUIT_CHANGE_PROD_DESC défini)
|
// celle du produit si PRODUIT_CHANGE_PROD_DESC est défini
|
||||||
// \todo Ne faut-il pas rendre $conf->global->PRODUIT_CHANGE_PROD_DESC toujours a on
|
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||||
$desc=$_POST['np_desc'];
|
{
|
||||||
if (! $desc && $conf->global->PRODUIT_CHANGE_PROD_DESC)
|
|
||||||
{
|
|
||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$desc=$_POST['np_desc'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$tva_tx = get_default_tva($mysoc,$soc,$prod->tva_tx);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$pu=$_POST['pu'];
|
||||||
|
$tva_tx=$_POST['tva_tx'];
|
||||||
|
$desc=$_POST['np_desc'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$tva_tx = get_default_tva($mysoc,$soc,$prod->tva_tx);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$pu=$_POST['pu'];
|
|
||||||
$tva_tx=$_POST['tva_tx'];
|
|
||||||
$desc=$_POST['desc'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$commande->addline(
|
$commande->addline(
|
||||||
$_POST['id'],
|
$_POST['id'],
|
||||||
@ -1264,7 +1266,8 @@ else
|
|||||||
/*
|
/*
|
||||||
* Lignes de commandes
|
* Lignes de commandes
|
||||||
*/
|
*/
|
||||||
$sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, l.fk_remise_except, l.remise_percent, l.subprice, l.info_bits,';
|
$sql = 'SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_tx, ';
|
||||||
|
$sql.= ' l.fk_remise_except, l.remise_percent, l.subprice, l.info_bits,';
|
||||||
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid, ';
|
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid, ';
|
||||||
$sql.= ' p.description as product_desc';
|
$sql.= ' p.description as product_desc';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
|
||||||
@ -1288,9 +1291,7 @@ else
|
|||||||
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
|
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
|
||||||
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
|
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
|
||||||
print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>';
|
print '<td align="right" width="50">'.$langs->trans('AmountHT').'</td>';
|
||||||
print '<td width="16"> </td>';
|
print '<td width="48" colspan="3"> </td>';
|
||||||
print '<td width="16"> </td>';
|
|
||||||
print '<td width="16"> </td>';
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
$var=true;
|
$var=true;
|
||||||
@ -1310,13 +1311,22 @@ else
|
|||||||
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
print '<a href="'.DOL_URL_ROOT.'/product/fiche.php?id='.$objp->fk_product.'">';
|
||||||
if ($objp->fk_product_type==1) print img_object($langs->trans('ShowService'),'service');
|
if ($objp->fk_product_type==1) print img_object($langs->trans('ShowService'),'service');
|
||||||
else print img_object($langs->trans('ShowProduct'),'product');
|
else print img_object($langs->trans('ShowProduct'),'product');
|
||||||
print ' '.$objp->ref.'</a> - '.nl2br($objp->product);
|
print ' '.$objp->ref.'</a>';
|
||||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.nl2br($objp->description):'';
|
print ' - '.nl2br(stripslashes($objp->product));
|
||||||
// \todo Ne faut-il pas rendre $conf->global->PRODUIT_CHANGE_PROD_DESC toujours a on
|
print_date_range($objp->date_start,$objp->date_end);
|
||||||
if ($conf->global->PRODUIT_DESC_IN_FORM && !$conf->global->PRODUIT_CHANGE_PROD_DESC)
|
|
||||||
|
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||||
{
|
{
|
||||||
print '<br>'.nl2br($objp->product_desc);
|
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 '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1487,20 +1497,29 @@ else
|
|||||||
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
|
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('ReductionShort').'</td>';
|
print '<td align="right">'.$langs->trans('ReductionShort').'</td>';
|
||||||
print '<td> </td>';
|
print '<td colspan="4"> </td>';
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Ajout produit produits/services personalisés
|
// Ajout produit produits/services personnalisés
|
||||||
print '<form action="fiche.php?id='.$id.'#add" method="post">';
|
print '<form action="fiche.php?id='.$id.'#add" method="post">';
|
||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
print '<input type="hidden" name="action" value="addligne">';
|
print '<input type="hidden" name="action" value="addligne">';
|
||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print ' <td><textarea cols="70" name="desc" rows="1"></textarea></td>';
|
print '<td>';
|
||||||
|
// éditeur wysiwyg
|
||||||
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
|
$doleditor=new DolEditor('np_desc','',100,'dolibarr_details');
|
||||||
|
$doleditor->Create();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<textarea class="flat" cols="70" name="np_desc" rows="'.ROWS_2.'"></textarea>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
if($soc->tva_assuj == "0")
|
if($soc->tva_assuj == "0")
|
||||||
print '<input type="hidden" name="tva_tx" value="0">0';
|
print '<input type="hidden" name="tva_tx" value="0">0';
|
||||||
@ -1516,28 +1535,66 @@ else
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
// Ajout de produits/services prédéfinis
|
// Ajout de produits/services prédéfinis
|
||||||
print '<form action="fiche.php?id='.$id.'#add" method="post">';
|
if ($conf->produit->enabled)
|
||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
{
|
||||||
print '<input type="hidden" name="action" value="addligne">';
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td colspan="3">';
|
||||||
|
if ($conf->service->enabled)
|
||||||
|
{
|
||||||
|
print $langs->trans('RecordedProductsAndServices');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans('RecordedProducts');
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||||
|
print '<td align="right">'.$langs->trans('ReductionShort').'</td>';
|
||||||
|
print '<td colspan="4"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<form id="addpredefinedproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$id.'#add" method="post">';
|
||||||
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
print '<input type="hidden" name="action" value="addligne">';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="3">';
|
||||||
// multiprix
|
// multiprix
|
||||||
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
||||||
$html->select_produits('','idprod','',$conf->produit->limit_size,$soc->price_level);
|
{
|
||||||
else
|
$html->select_produits('','idprod','',$conf->produit->limit_size,$soc->price_level);
|
||||||
$html->select_produits('','idprod','',$conf->produit->limit_size);
|
}
|
||||||
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';
|
else
|
||||||
print '<textarea cols="70" name="np_desc" rows="1"></textarea>';
|
{
|
||||||
print '</td>';
|
$html->select_produits('','idprod','',$conf->produit->limit_size);
|
||||||
print '<td> </td>';
|
}
|
||||||
print '<td align="right"><input type="text" size="2" name="qty" value="1"></td>';
|
|
||||||
print '<td align="right" nowrap="nowrap"><input type="text" size="1" name="remise_percent" value="'.$soc->remise_client.'">%</td>';
|
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';
|
||||||
print '<td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans('Add').'"></td>';
|
|
||||||
print '</tr>';
|
if (! $conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||||
|
{
|
||||||
|
// éditeur wysiwyg
|
||||||
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
|
$doleditor=new DolEditor('np_desc','',100,'dolibarr_details');
|
||||||
|
$doleditor->Create();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<textarea cols="70" name="np_desc" rows="'.ROWS_2.'" class="flat"></textarea>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right"><input type="text" size="2" name="qty" value="1"></td>';
|
||||||
|
print '<td align="right" nowrap="nowrap"><input type="text" size="1" name="remise_percent" value="'.$soc->remise_client.'">%</td>';
|
||||||
|
print '<td align="center" colspan="4"><input type="submit" class="button" value="'.$langs->trans('Add').'"></td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -1545,7 +1602,7 @@ else
|
|||||||
/*
|
/*
|
||||||
* Boutons actions
|
* Boutons actions
|
||||||
*/
|
*/
|
||||||
if ($user->societe_id == 0)
|
if ($user->societe_id == 0 && $_GET['action'] <> 'editline')
|
||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
|||||||
@ -713,7 +713,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
|
|||||||
*/
|
*/
|
||||||
if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') && $user->rights->facture->creer)
|
if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') && $user->rights->facture->creer)
|
||||||
{
|
{
|
||||||
if ($_POST['qty'] && (($_POST['pu']!='' && $_POST['desc']) || $_POST['idprod']))
|
if ($_POST['qty'] && (($_POST['pu']!='' && $_POST['np_desc']) || $_POST['idprod']))
|
||||||
{
|
{
|
||||||
$fac = new Facture($db);
|
$fac = new Facture($db);
|
||||||
$ret=$fac->fetch($_POST['facid']);
|
$ret=$fac->fetch($_POST['facid']);
|
||||||
@ -773,13 +773,15 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') &&
|
|||||||
}
|
}
|
||||||
|
|
||||||
// La description de la ligne est celle saisie ou
|
// La description de la ligne est celle saisie ou
|
||||||
// celle du produit si (non saisi + PRODUIT_CHANGE_PROD_DESC défini)
|
// celle du produit si PRODUIT_CHANGE_PROD_DESC défini
|
||||||
// \todo Ne faut-il pas rendre $conf->global->PRODUIT_CHANGE_PROD_DESC toujours a on
|
if ($conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||||
$desc=$_POST['desc'];
|
|
||||||
if (! $desc && $conf->global->PRODUIT_CHANGE_PROD_DESC)
|
|
||||||
{
|
{
|
||||||
$desc = $prod->description;
|
$desc = $prod->description;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$desc=$_POST['np_desc'];
|
||||||
|
}
|
||||||
|
|
||||||
$tva_tx = get_default_tva($mysoc,$fac->client,$prod->tva_tx);
|
$tva_tx = get_default_tva($mysoc,$fac->client,$prod->tva_tx);
|
||||||
}
|
}
|
||||||
@ -787,7 +789,7 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') &&
|
|||||||
{
|
{
|
||||||
$pu=$_POST['pu'];
|
$pu=$_POST['pu'];
|
||||||
$tva_tx=$_POST['tva_tx'];
|
$tva_tx=$_POST['tva_tx'];
|
||||||
$desc=$_POST['desc'];
|
$desc=$_POST['np_desc'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insere ligne
|
// Insere ligne
|
||||||
@ -1104,31 +1106,6 @@ if ($_REQUEST['action'] == 'builddoc') // En get ou en post
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
|
||||||
*
|
|
||||||
* Fonctions internes
|
|
||||||
*
|
|
||||||
**********************************************************************/
|
|
||||||
function print_date_range($date_start,$date_end)
|
|
||||||
{
|
|
||||||
global $langs;
|
|
||||||
|
|
||||||
if ($date_start && $date_end)
|
|
||||||
{
|
|
||||||
print ' ('.$langs->trans('DateFromTo',dolibarr_print_date($date_start),dolibarr_print_date($date_end)).')';
|
|
||||||
}
|
|
||||||
if ($date_start && ! $date_end)
|
|
||||||
{
|
|
||||||
print ' ('.$langs->trans('DateFrom',dolibarr_print_date($date_start)).')';
|
|
||||||
}
|
|
||||||
if (! $date_start && $date_end)
|
|
||||||
{
|
|
||||||
print ' ('.$langs->trans('DateUntil',dolibarr_print_date($date_end)).')';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
llxHeader('',$langs->trans('Bill'),'Facture');
|
llxHeader('',$langs->trans('Bill'),'Facture');
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
@ -2231,9 +2208,7 @@ else
|
|||||||
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
|
print '<td align="right" width="50">'.$langs->trans('Qty').'</td>';
|
||||||
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
|
print '<td align="right" width="50">'.$langs->trans('ReductionShort').'</td>';
|
||||||
print '<td align="right" width="50">'.$langs->trans('TotalHT').'</td>';
|
print '<td align="right" width="50">'.$langs->trans('TotalHT').'</td>';
|
||||||
print '<td width="16"> </td>';
|
print '<td width="48" colspan="3"> </td>';
|
||||||
print '<td width="16"> </td>';
|
|
||||||
print '<td width="12"> </td>';
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -2257,12 +2232,17 @@ else
|
|||||||
print ' '.$objp->ref.'</a>';
|
print ' '.$objp->ref.'</a>';
|
||||||
print ' - '.nl2br(stripslashes($objp->product));
|
print ' - '.nl2br(stripslashes($objp->product));
|
||||||
print_date_range($objp->date_start,$objp->date_end);
|
print_date_range($objp->date_start,$objp->date_end);
|
||||||
print ($objp->description && $objp->description!=$objp->product)?'<br>'.stripslashes(nl2br($objp->description)):'';
|
|
||||||
|
if ($conf->global->PRODUIT_DESC_IN_FORM)
|
||||||
// \todo Ne faut-il pas rendre $conf->global->PRODUIT_CHANGE_PROD_DESC toujours a on
|
|
||||||
if ($conf->global->PRODUIT_DESC_IN_FORM && !$conf->global->PRODUIT_CHANGE_PROD_DESC)
|
|
||||||
{
|
{
|
||||||
print '<br>'.nl2br($objp->product_desc);
|
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 '</td>';
|
print '</td>';
|
||||||
@ -2445,7 +2425,7 @@ else
|
|||||||
/*
|
/*
|
||||||
* Ajouter une ligne
|
* Ajouter une ligne
|
||||||
*/
|
*/
|
||||||
if ($fac->statut == 0 && $user->rights->facture->creer && $_GET['action'] <> 'valid')
|
if ($fac->statut == 0 && $user->rights->facture->creer && $_GET['action'] <> 'valid' && $_GET['action'] <> 'editline')
|
||||||
{
|
{
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -2455,10 +2435,7 @@ else
|
|||||||
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
|
print '<td align="right">'.$langs->trans('PriceUHT').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||||
print '<td align="right">'.$langs->trans('ReductionShort').'</td>';
|
print '<td align="right">'.$langs->trans('ReductionShort').'</td>';
|
||||||
print '<td> </td>';
|
print '<td colspan="4"> </td>';
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print '<td> </td>';
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
// Ajout produit produits/services personalisés
|
// Ajout produit produits/services personalisés
|
||||||
@ -2468,8 +2445,19 @@ else
|
|||||||
|
|
||||||
$var=true;
|
$var=true;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td colspan="1">';
|
print '<td>';
|
||||||
print '<textarea name="desc" cols="70" rows="'.ROWS_2.'"></textarea></td>';
|
// éditeur wysiwyg
|
||||||
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
|
$doleditor=new DolEditor('np_desc','',100,'dolibarr_details');
|
||||||
|
$doleditor->Create();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<textarea class="flat" cols="70" name="np_desc" rows="'.ROWS_2.'"></textarea>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if($soc->tva_assuj == "0")
|
if($soc->tva_assuj == "0")
|
||||||
print '<input type="hidden" name="tva_tx" value="0">0';
|
print '<input type="hidden" name="tva_tx" value="0">0';
|
||||||
@ -2496,29 +2484,65 @@ else
|
|||||||
// Ajout de produits/services prédéfinis
|
// Ajout de produits/services prédéfinis
|
||||||
if ($conf->produit->enabled)
|
if ($conf->produit->enabled)
|
||||||
{
|
{
|
||||||
print '<form name="addligne_predef" action="'.$_SERVER['PHP_SELF'].'#add" method="post">';
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td colspan="3">';
|
||||||
|
if ($conf->service->enabled)
|
||||||
|
{
|
||||||
|
print $langs->trans('RecordedProductsAndServices');
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print $langs->trans('RecordedProducts');
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '<td align="right">'.$langs->trans('Qty').'</td>';
|
||||||
|
print '<td align="right">'.$langs->trans('ReductionShort').'</td>';
|
||||||
|
print '<td colspan="4"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
print '<form id="addpredefinedproduct" action="'.$_SERVER['PHP_SELF'].'#add" method="post">';
|
||||||
print '<input type="hidden" name="facid" value="'.$fac->id.'">';
|
print '<input type="hidden" name="facid" value="'.$fac->id.'">';
|
||||||
print '<input type="hidden" name="action" value="addligne_predef">';
|
print '<input type="hidden" name="action" value="addligne_predef">';
|
||||||
|
|
||||||
$var=! $var;
|
$var=! $var;
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="3">';
|
||||||
// multiprix
|
// multiprix
|
||||||
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
||||||
$html->select_produits('','idprod','',$conf->produit->limit_size,$soc->price_level);
|
{
|
||||||
|
$html->select_produits('','idprod','',$conf->produit->limit_size,$soc->price_level);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
$html->select_produits('','idprod','',$conf->produit->limit_size);
|
{
|
||||||
|
$html->select_produits('','idprod','',$conf->produit->limit_size);
|
||||||
|
}
|
||||||
|
|
||||||
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';
|
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) print '<br>';
|
||||||
print '<textarea name="desc" cols="70" rows="'.ROWS_2.'"></textarea></td>';
|
|
||||||
print '<td> </td>';
|
if (! $conf->global->PRODUIT_CHANGE_PROD_DESC)
|
||||||
|
{
|
||||||
|
// éditeur wysiwyg
|
||||||
|
if ($conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_DETAILS_PERSO)
|
||||||
|
{
|
||||||
|
require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php");
|
||||||
|
$doleditor=new DolEditor('np_desc','',100,'dolibarr_details');
|
||||||
|
$doleditor->Create();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<textarea cols="70" name="np_desc" rows="'.ROWS_2.'" class="flat"></textarea>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</td>';
|
||||||
print '<td align="right"><input type="text" name="qty" value="'.($fac->type==2?'-1':'1').'" size="2"></td>';
|
print '<td align="right"><input type="text" name="qty" value="'.($fac->type==2?'-1':'1').'" size="2"></td>';
|
||||||
print '<td align="right" nowrap><input type="text" name="remise_percent" size="1" value="'.$soc->remise_client.'">%</td>';
|
print '<td align="right" nowrap><input type="text" name="remise_percent" size="1" value="'.$soc->remise_client.'">%</td>';
|
||||||
print '<td align="center" valign="middle" rowspan="2" colspan="5"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
print '<td align="center" valign="middle" colspan="5"><input type="submit" class="button" value="'.$langs->trans("Add").'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
if ($conf->service->enabled)
|
if ($conf->service->enabled)
|
||||||
{
|
{
|
||||||
print '<tr '.$bc[$var].'>';
|
print '<tr '.$bc[$var].'>';
|
||||||
print '<td colspan="5">'.$langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
|
print '<td colspan="9">'.$langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
|
||||||
print $html->select_date('','date_start_predef',0,0,1,"addligne_predef");
|
print $html->select_date('','date_start_predef',0,0,1,"addligne_predef");
|
||||||
print ' '.$langs->trans('to').' ';
|
print ' '.$langs->trans('to').' ';
|
||||||
print $html->select_date('','date_end_predef',0,0,1,"addligne_predef");
|
print $html->select_date('','date_end_predef',0,0,1,"addligne_predef");
|
||||||
|
|||||||
@ -722,6 +722,7 @@ FCKeditorForCompany=WYSIWIG creation/edition of companies description and note
|
|||||||
FCKeditorForProduct=WYSIWIG creation/edition of products/services description and note
|
FCKeditorForProduct=WYSIWIG creation/edition of products/services description and note
|
||||||
FCKeditorForMembers=WYSIWIG creation/edition of members description and note
|
FCKeditorForMembers=WYSIWIG creation/edition of members description and note
|
||||||
FCKeditorForProductDetails=WYSIWIG creation/edition of details lines for all entities (proposals, orders, invoices, etc...)
|
FCKeditorForProductDetails=WYSIWIG creation/edition of details lines for all entities (proposals, orders, invoices, etc...)
|
||||||
|
FCKeditorForProductDetailsPerso=WYSIWIG creation/edition of description for all personalized products (proposals, orders, invoices, etc...)
|
||||||
FCKeditorForMailing=WYSIWIG creation/edition of mailings
|
FCKeditorForMailing=WYSIWIG creation/edition of mailings
|
||||||
##### OSCommerce 1 #####
|
##### OSCommerce 1 #####
|
||||||
OSCommerceErrorConnectOkButWrongDatabase=Connection succeeded but database doesn't look to be an OSCommerce database.
|
OSCommerceErrorConnectOkButWrongDatabase=Connection succeeded but database doesn't look to be an OSCommerce database.
|
||||||
|
|||||||
@ -115,3 +115,5 @@ PriceQty=Price for this quantity
|
|||||||
PriceQtyHT=Price for this quantity HT
|
PriceQtyHT=Price for this quantity HT
|
||||||
PriceQtyTTC=Price for this quantity TTC
|
PriceQtyTTC=Price for this quantity TTC
|
||||||
NoPriceDefinedForThisSupplier=No price/qty defined for this supplier/product
|
NoPriceDefinedForThisSupplier=No price/qty defined for this supplier/product
|
||||||
|
RecordedProducts=Products recorded
|
||||||
|
RecordedProductsAndServices=Products/services recorded
|
||||||
@ -724,6 +724,7 @@ FCKeditorForCompany=Cr
|
|||||||
FCKeditorForProduct=Création/édition WYSIWIG des descriptions et notes des produits/services
|
FCKeditorForProduct=Création/édition WYSIWIG des descriptions et notes des produits/services
|
||||||
FCKeditorForMembers=Création/édition WYSIWIG des descriptions et notes des adhérents
|
FCKeditorForMembers=Création/édition WYSIWIG des descriptions et notes des adhérents
|
||||||
FCKeditorForProductDetails=Création/édition WYSIWIG des lignes details des produits (sur commandes, propales, factures, etc...)
|
FCKeditorForProductDetails=Création/édition WYSIWIG des lignes details des produits (sur commandes, propales, factures, etc...)
|
||||||
|
FCKeditorForProductDetailsPerso=Création/édition WYSIWIG des descriptions des produits personnalisées (sur commandes, propales, factures, etc...)
|
||||||
FCKeditorForMailing=Création/édition WYSIWIG des mailings
|
FCKeditorForMailing=Création/édition WYSIWIG des mailings
|
||||||
##### OSCommerce 1 #####
|
##### OSCommerce 1 #####
|
||||||
OSCommerceErrorConnectOkButWrongDatabase=La connexion a réussie mais la base ne semble pas etre une base OSCommerce.
|
OSCommerceErrorConnectOkButWrongDatabase=La connexion a réussie mais la base ne semble pas etre une base OSCommerce.
|
||||||
|
|||||||
@ -115,3 +115,5 @@ PriceQty=Prix pour la quantit
|
|||||||
PriceQtyHT=Prix pour la quantité HT
|
PriceQtyHT=Prix pour la quantité HT
|
||||||
PriceQtyTTC=Prix pour la quantité TTC
|
PriceQtyTTC=Prix pour la quantité TTC
|
||||||
NoPriceDefinedForThisSupplier=Aucun prix/qté défini pour ce fournisseur/produit
|
NoPriceDefinedForThisSupplier=Aucun prix/qté défini pour ce fournisseur/produit
|
||||||
|
RecordedProducts=Produits en vente
|
||||||
|
RecordedProductsAndServices=Produits/services en vente
|
||||||
|
|||||||
@ -2904,4 +2904,27 @@ function make_substitutions($chaine,$substitutionarray)
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* \brief Formate l'affichage de date de début et de fin
|
||||||
|
* \param date_start date de début
|
||||||
|
* \param date_end date de fin
|
||||||
|
*/
|
||||||
|
function print_date_range($date_start,$date_end)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
if ($date_start && $date_end)
|
||||||
|
{
|
||||||
|
print ' ('.$langs->trans('DateFromTo',dolibarr_print_date($date_start),dolibarr_print_date($date_end)).')';
|
||||||
|
}
|
||||||
|
if ($date_start && ! $date_end)
|
||||||
|
{
|
||||||
|
print ' ('.$langs->trans('DateFrom',dolibarr_print_date($date_start)).')';
|
||||||
|
}
|
||||||
|
if (! $date_start && $date_end)
|
||||||
|
{
|
||||||
|
print ' ('.$langs->trans('DateUntil',dolibarr_print_date($date_end)).')';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user