Ajoute option pour permettre de ne pas afficher les produits définis dès la création

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

@ -264,7 +264,7 @@ if ($conf->expedition->enabled)
print '<td>'; print '<td>';
$liste_propal = array(); $liste_propal = array();
$liste_propal[0] = ''; $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.=" 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"; $sql.=" WHERE s.idp = p.fk_soc AND fk_statut <> 0 ORDER BY Id";
$resql = $db->query($sql); $resql = $db->query($sql);
@ -286,43 +286,47 @@ if ($conf->expedition->enabled)
} }
print '</td></tr>'; 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 '<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 '<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%">'; if ($conf->global->PRODUCT_SHOW_WHEN_CREATE)
print '<tr>'; {
print '<td>'.$lib.'</td>'; print '<tr><td colspan="3">';
print '<td>'.$langs->trans("Qty").'</td>'; if ($conf->produit->enabled || $conf->service->enabled)
print '<td>'.$langs->trans("ReductionShort").'</td>'; {
print '</tr>'; $lib=$langs->trans("ProductsAndServices");
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>';
}
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>';
}
} print "</table>";
else
{ }
print '&nbsp;'; else
} {
print '</td></tr>'; print '&nbsp;';
}
print '</td></tr>';
}
print '</table>'; print '</table>';
print '<br>'; print '<br>';

View File

@ -822,33 +822,36 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer)
} }
else else
{ {
/* if ($conf->global->PRODUCT_SHOW_WHEN_CREATE)
* 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 * Services/produits prédéfinis
if($conf->global->PRODUIT_MULTIPRICES == 1) */
print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size,$soc->price_level); $NBLINES=8;
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 '<tr><td colspan="3">';
print '</td></tr>';
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>';
}
} }
/* /*

View File

@ -104,7 +104,7 @@ class box_comptes extends ModeleBoxes {
); );
$this->info_box_contents[$i][3] = array('align' => 'right', $this->info_box_contents[$i][3] = array('align' => 'right',
'text' => price( $acc->solde() ) 'text' => price($acc->solde())
); );
$i++; $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'; 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('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'); delete from llx_const where name in ('OSC_CATALOG_URL','OSC_LANGUAGE_ID');