From e6350aa25a46acbed0c58d7896e46f1a8d1cadae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 27 Aug 2006 22:37:18 +0000 Subject: [PATCH] =?UTF-8?q?Ajoute=20option=20pour=20permettre=20de=20ne=20?= =?UTF-8?q?pas=20afficher=20les=20produits=20d=E9finis=20d=E8s=20la=20cr?= =?UTF-8?q?=E9ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/addpropal.php | 86 ++++++++++++++------------- htdocs/commande/fiche.php | 53 +++++++++-------- htdocs/includes/boxes/box_comptes.php | 2 +- mysql/migration/2.0.0-2.1.0.sql | 2 +- 4 files changed, 75 insertions(+), 68 deletions(-) diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index f0ecc7a6365..8a443e1e144 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -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 ''.$langs->trans("Ref").''; - + // Reference client print ''.$langs->trans('RefCustomer').''; print ''; @@ -115,7 +115,7 @@ if ($_GET["action"] == 'create') print ''; print ''; print ''; - + /* * 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 ''; } - + // Adresse de livraison if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS) { @@ -253,7 +253,7 @@ if ($conf->expedition->enabled) print ""; print '
'; - + /* * Combobox pour la fonction de copie */ @@ -264,7 +264,7 @@ if ($conf->expedition->enabled) print ''; $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 ''; - - print ' '; - + + if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) print ' '; + print ''; print ''.$langs->trans("CreateEmptyPropal").''; - print ''; - if ($conf->produit->enabled || $conf->service->enabled) - { - $lib=$langs->trans("ProductsAndServices"); - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - for ($i = 1 ; $i <= $conf->global->PROPALE_NEW_FORM_NB_PRODUCT ; $i++) - { - print ''; - print ''; - print ''; - print ''; - } + if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) + { + print '
'.$lib.''.$langs->trans("Qty").''.$langs->trans("ReductionShort").'
'; - // 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 '%
'; + if ($conf->produit->enabled || $conf->service->enabled) + { + $lib=$langs->trans("ProductsAndServices"); - print "
"; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + for ($i = 1 ; $i <= $conf->global->PROPALE_NEW_FORM_NB_PRODUCT ; $i++) + { + print ''; + print ''; + print ''; + print ''; + } - } - else - { - print ' '; - } - print ''; + print "
'.$lib.''.$langs->trans("Qty").''.$langs->trans("ReductionShort").'
'; + // 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 '%
"; + + } + else + { + print ' '; + } + print ''; + } print ''; print '
'; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 2a4c96ae76f..aec088af08e 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -822,33 +822,36 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) } else { - /* - * Services/produits prédéfinis - */ - $NBLINES=8; - - print ''; - - print ''; - print ''; - print ''; - print ''; - print ''; - for ($i = 1 ; $i <= $NBLINES ; $i++) + if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) { - print ''; - print ''; - print ''; + /* + * Services/produits prédéfinis + */ + $NBLINES=8; + + print ''; } - - print '
'.$langs->trans('ProductsAndServices').''.$langs->trans('Qty').''.$langs->trans('ReductionShort').'
'; - // 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 '%
'; + + print ''; + print ''; + print ''; + print ''; + print ''; + for ($i = 1 ; $i <= $NBLINES ; $i++) + { + print ''; + print ''; + print ''; + } + + print '
'.$langs->trans('ProductsAndServices').''.$langs->trans('Qty').''.$langs->trans('ReductionShort').'
'; + // 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 '%
'; + print '
'; - print ''; } /* diff --git a/htdocs/includes/boxes/box_comptes.php b/htdocs/includes/boxes/box_comptes.php index fbf90c8f3bd..43e9aa138f1 100644 --- a/htdocs/includes/boxes/box_comptes.php +++ b/htdocs/includes/boxes/box_comptes.php @@ -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++; diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index 064e7b3bf3e..6cf9a0377d6 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -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');