Ajoute option pour permettre de ne pas afficher les produits dfinis ds la cration

This commit is contained in:
Laurent Destailleur 2006-08-27 22:37:18 +00:00
parent 0df017047c
commit e6350aa25a
4 changed files with 75 additions and 68 deletions

View File

@ -30,7 +30,7 @@
*/
require("./pre.inc.php");
include_once(DOL_DOCUMENT_ROOT.'/includes/modules/propale/modules_propale.php');
if (defined("PROPALE_ADDON") && is_readable(DOL_DOCUMENT_ROOT ."/includes/modules/propale/".PROPALE_ADDON.".php"))
{
@ -104,7 +104,7 @@ if ($_GET["action"] == 'create')
// Ref
print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2"><input name="ref" value="'.$numpr.'"></td></tr>';
// Reference client
print '<tr><td>'.$langs->trans('RefCustomer').'</td><td>';
print '<input type="text" name="ref_client" value=""></td>';
@ -115,7 +115,7 @@ if ($_GET["action"] == 'create')
print '<input type="hidden" name="socidp" value="'.$soc->id.'">';
print '</td>';
print '</tr>';
/*
* Contact de la propale
*/
@ -162,7 +162,7 @@ if ($_GET["action"] == 'create')
if ($relative_discount)
{
print $langs->trans("CompanyHasRelativeDiscount",$relative_discount);
}
}
else
{
print $langs->trans("CompanyHasNoRelativeDiscount");
@ -180,7 +180,7 @@ if ($_GET["action"] == 'create')
if ($absolute_discount)
{
print $langs->trans("CompanyHasAbsoluteDiscount",$absolute_discount,$langs->trans("Currency".$conf->monnaie));
}
}
else
{
print $langs->trans("CompanyHasNoAbsoluteDiscount");
@ -212,7 +212,7 @@ if ($conf->expedition->enabled)
}
print '</td></tr>';
}
// Adresse de livraison
if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS)
{
@ -253,7 +253,7 @@ if ($conf->expedition->enabled)
print "</table>";
print '<br>';
/*
* Combobox pour la fonction de copie
*/
@ -264,7 +264,7 @@ if ($conf->expedition->enabled)
print '<td>';
$liste_propal = array();
$liste_propal[0] = '';
$sql ="SELECT p.rowid as id, CONCAT(p.ref, '-', s.nom) as lib";
$sql ="SELECT p.rowid as id, CONCAT(p.ref, ' - ', s.nom) as lib";
$sql.=" FROM ".MAIN_DB_PREFIX."propal p, ".MAIN_DB_PREFIX."societe s";
$sql.=" WHERE s.idp = p.fk_soc AND fk_statut <> 0 ORDER BY Id";
$resql = $db->query($sql);
@ -285,44 +285,48 @@ if ($conf->expedition->enabled)
dolibarr_print_error($db);
}
print '</td></tr>';
print '<tr><td colspan="3">&nbsp;</td></tr>';
if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) print '<tr><td colspan="3">&nbsp;</td></tr>';
print '<tr><td valign="top"><input type="radio" name="createmode" value="empty" checked="true"></td>';
print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>';
print '<tr><td colspan="3">';
if ($conf->produit->enabled || $conf->service->enabled)
{
$lib=$langs->trans("ProductsAndServices");
print '<table class="border" width="100%">';
print '<tr>';
print '<td>'.$lib.'</td>';
print '<td>'.$langs->trans("Qty").'</td>';
print '<td>'.$langs->trans("ReductionShort").'</td>';
print '</tr>';
for ($i = 1 ; $i <= $conf->global->PROPALE_NEW_FORM_NB_PRODUCT ; $i++)
{
print '<tr><td>';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES == 1)
$html->select_produits('',"idprod".$i,'',$conf->produit->limit_size,$soc->price_level);
else
$html->select_produits('',"idprod".$i,'',$conf->produit->limit_size);
print '</td>';
print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>';
print '<td><input type="text" size="2" name="remise'.$i.'" value="'.$soc->remise_client.'">%</td>';
print '</tr>';
}
if ($conf->global->PRODUCT_SHOW_WHEN_CREATE)
{
print '<tr><td colspan="3">';
if ($conf->produit->enabled || $conf->service->enabled)
{
$lib=$langs->trans("ProductsAndServices");
print "</table>";
print '<table class="border" width="100%">';
print '<tr>';
print '<td>'.$lib.'</td>';
print '<td>'.$langs->trans("Qty").'</td>';
print '<td>'.$langs->trans("ReductionShort").'</td>';
print '</tr>';
for ($i = 1 ; $i <= $conf->global->PROPALE_NEW_FORM_NB_PRODUCT ; $i++)
{
print '<tr><td>';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES == 1)
$html->select_produits('',"idprod".$i,'',$conf->produit->limit_size,$soc->price_level);
else
$html->select_produits('',"idprod".$i,'',$conf->produit->limit_size);
print '</td>';
print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>';
print '<td><input type="text" size="2" name="remise'.$i.'" value="'.$soc->remise_client.'">%</td>';
print '</tr>';
}
}
else
{
print '&nbsp;';
}
print '</td></tr>';
print "</table>";
}
else
{
print '&nbsp;';
}
print '</td></tr>';
}
print '</table>';
print '<br>';

View File

@ -822,33 +822,36 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
}
else
{
/*
* Services/produits prédéfinis
*/
$NBLINES=8;
print '<tr><td colspan="3">';
print '<table class="noborder">';
print '<tr><td>'.$langs->trans('ProductsAndServices').'</td>';
print '<td>'.$langs->trans('Qty').'</td>';
print '<td>'.$langs->trans('ReductionShort').'</td>';
print '</tr>';
for ($i = 1 ; $i <= $NBLINES ; $i++)
if ($conf->global->PRODUCT_SHOW_WHEN_CREATE)
{
print '<tr><td>';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES == 1)
print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size,$soc->price_level);
else
print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size);
print '</td>';
print '<td><input type="text" size="3" name="qty'.$i.'" value="1"></td>';
print '<td><input type="text" size="3" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td></tr>';
/*
* Services/produits prédéfinis
*/
$NBLINES=8;
print '<tr><td colspan="3">';
print '<table class="noborder">';
print '<tr><td>'.$langs->trans('ProductsAndServices').'</td>';
print '<td>'.$langs->trans('Qty').'</td>';
print '<td>'.$langs->trans('ReductionShort').'</td>';
print '</tr>';
for ($i = 1 ; $i <= $NBLINES ; $i++)
{
print '<tr><td>';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES == 1)
print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size,$soc->price_level);
else
print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size);
print '</td>';
print '<td><input type="text" size="3" name="qty'.$i.'" value="1"></td>';
print '<td><input type="text" size="3" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td></tr>';
}
print '</table>';
print '</td></tr>';
}
print '</table>';
print '</td></tr>';
}
/*

View File

@ -104,7 +104,7 @@ class box_comptes extends ModeleBoxes {
);
$this->info_box_contents[$i][3] = array('align' => 'right',
'text' => price( $acc->solde() )
'text' => price($acc->solde())
);
$i++;

View File

@ -164,7 +164,7 @@ update llx_const set name='NOTIFICATION_EMAIL_FROM', visible=0 where name='MAIN_
update llx_const set name='NOTIFICATION_EMAIL_FROM', visible=0 where name='MAIN_EMAIL_FROM';
insert into llx_const(name,value,type,visible,note) values('MAIN_SHOW_DEVELOPMENT_MODULES','0','yesno',1,'Make development modules visible');
insert into llx_const(name,value,type,visible,note) values('PRODUCT_SHOW_WHEN_CREATE','1','yesno',1,'Add product list in first step of proposal, invoice creation');
insert into llx_const(name,value,type,visible,note) values('PRODUCT_SHOW_WHEN_CREATE','1','yesno',1,'Add products\' list in first step of proposal, invoice, order creation');
delete from llx_const where name in ('OSC_CATALOG_URL','OSC_LANGUAGE_ID');