From 6d880d10ce80177f98e4f2db6f46db1abbbe956e Mon Sep 17 00:00:00 2001 From: phf Date: Tue, 3 Feb 2015 15:20:17 +0100 Subject: [PATCH] =?UTF-8?q?[CORE]=20modifications=20sur=20les=20champs=20v?= =?UTF-8?q?isibles=20et=20utilis=C3=A9s=20+=20correction=20de=20bug=20+=20?= =?UTF-8?q?ajout=20de=20traductions=20(#new=5Fask=5Fprice).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/askpricesupplier.php | 32 ++++++++++++------- .../class/askpricesupplier.class.php | 16 ++++++---- htdocs/comm/askpricesupplier/document.php | 2 +- htdocs/comm/askpricesupplier/note.php | 11 +++++-- htdocs/langs/fr_FR/askpricesupplier.lang | 4 ++- 5 files changed, 43 insertions(+), 22 deletions(-) diff --git a/htdocs/comm/askpricesupplier.php b/htdocs/comm/askpricesupplier.php index de6cf4fefa6..f286dc03039 100644 --- a/htdocs/comm/askpricesupplier.php +++ b/htdocs/comm/askpricesupplier.php @@ -211,11 +211,13 @@ if (empty($reshook)) { $datep = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']); + /* PHFAVRE if (empty($datep)) { $error ++; setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); } - + */ + if (! $error) { $result = $object->set_date($user, $datep); if ($result < 0) @@ -250,12 +252,14 @@ if (empty($reshook)) $datep = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $date_delivery = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); + /* PHFAVRE if (empty($datep)) { setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), 'errors'); $action = 'create'; $error ++; } - + */ + if ($socid < 1) { setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); $action = 'create'; @@ -1305,11 +1309,15 @@ if ($action == 'create') print ''; } */ + // Date - print '' . $langs->trans('Date') . ''; + + /* PHFAVRE retrait en temporaire + print '' . $langs->trans('AskPriceSupplierDate') . ''; $form->select_date('', '', '', '', '', "addask", 1, 1); print ''; - + */ + // Validaty duration /* PHFAVRE retrait en temporaire print '' . $langs->trans("ValidityDuration") . ' ' . $langs->trans("days") . ''; @@ -1354,7 +1362,6 @@ if ($action == 'create') } // Delivery date (or manufacturing) - /* PHFAVRE retrait en temporaire print '' . $langs->trans("DeliveryDate") . ''; print ''; if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") { @@ -1367,7 +1374,7 @@ if ($action == 'create') $form->select_date(-1, 'liv_', '', '', '', "addask", 1, 1); } print ''; - */ + // Model print ''; @@ -1378,7 +1385,6 @@ if ($action == 'create') print ""; // Project - /* PHFAVRE retrait en temporaire if (! empty($conf->projet->enabled) && $socid > 0) { $formproject = new FormProjets($db); @@ -1398,7 +1404,7 @@ if ($action == 'create') print ''; print ''; } - */ + // Other attributes $parameters = array('colspan' => ' colspan="3"'); @@ -1708,10 +1714,11 @@ if ($action == 'create') */ // Date of proposal + /* PHFAVRE retrait en temporaire print ''; print ''; print ''; if ($action != 'editdate' && ! empty($object->brouillon)) print ''; @@ -1732,7 +1739,8 @@ if ($action == 'create') } } print ''; - + */ + // Date end proposal /* PHFAVRE retrait en temporaire print ''; @@ -1782,7 +1790,6 @@ if ($action == 'create') print ''; // Delivery date - /* PHFAVRE retrait en temporaire $langs->load('deliveries'); print '
'; - print $langs->trans('Date'); + print $langs->trans('AskPriceSupplierDate'); print 'id . '">' . img_edit($langs->trans('SetDate'), 1) . '
'; print ''; print ''; - */ + // Delivery delay /* PHFAVRE retrait en temporaire @@ -2079,6 +2086,7 @@ if ($action == 'create') * Form to close proposal (signed or not) */ $form_close = ''; + $form_close .= '

'.$langs->trans('AskPriceSupplierRefFournNotice').'

'; $form_close .= ''; $form_close .= '
'; @@ -1804,7 +1811,7 @@ if ($action == 'create') } print '
'; $form_close .= '"; + print ""; print ''; print ''; diff --git a/htdocs/comm/askpricesupplier/note.php b/htdocs/comm/askpricesupplier/note.php index d0034a99338..1a596309a8f 100644 --- a/htdocs/comm/askpricesupplier/note.php +++ b/htdocs/comm/askpricesupplier/note.php @@ -102,7 +102,7 @@ if ($id > 0 || ! empty($ref)) // Customer if ( is_null($object->client) ) $object->fetch_thirdparty(); - print ""; + print ""; print ''; // Ligne info remises tiers @@ -119,10 +119,17 @@ if ($id > 0 || ! empty($ref)) */ // Date - print ''; print ''; + */ + + print ''; + print ''; // Date fin propal /* PHFAVRE retrait en temporaire diff --git a/htdocs/langs/fr_FR/askpricesupplier.lang b/htdocs/langs/fr_FR/askpricesupplier.lang index 68d02b477c8..91603c3406d 100644 --- a/htdocs/langs/fr_FR/askpricesupplier.lang +++ b/htdocs/langs/fr_FR/askpricesupplier.lang @@ -44,7 +44,9 @@ NewAskPrice=Nouvelle demande de prix NewAsk=Nouvelle demande ShowAskpricesupplier=Afficher la demande de prix AddAskPriceSupplier=Créer une demande de prix -AskPriceSupplierRefFourn= Réf. fournisseur +AskPriceSupplierRefFourn=Réf. fournisseur +AskPriceSupplierDate=Date de livraison +AskPriceSupplierRefFournNotice=Avant de clôturer à "Acceptée", pensez à saisir les références fournisseurs. # # Modifié ConfirmValidateAsk=Êtes-vous sûr de vouloir valider cette demande de prix sous la référence %s ? DateAsk=Date de demande
' . $langs->trans("CloseAs") . ''; diff --git a/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php b/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php index f8b5fed1cc6..1fbe004e734 100644 --- a/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php +++ b/htdocs/comm/askpricesupplier/class/askpricesupplier.class.php @@ -712,13 +712,14 @@ class AskPriceSupplier extends CommonObject } } + /* PHFAVRE if (empty($this->date)) { $this->error="Date of proposal is required"; dol_syslog(get_class($this)."::create ".$this->error, LOG_ERR); return -4; } - + */ $this->db->begin(); @@ -829,7 +830,8 @@ class AskPriceSupplier extends CommonObject $this->lines[$i]->label, $this->lines[$i]->date_start, $this->lines[$i]->date_end, - $this->lines[$i]->array_options + $this->lines[$i]->array_options, + $this->lines[$i]->ref_fourn ); if ($result < 0) @@ -1018,6 +1020,7 @@ class AskPriceSupplier extends CommonObject // Create clone $result=$this->create($user); if ($result < 0) $error++; + /* PHFAVRE retrait en temporaire else { // copy internal contacts @@ -1031,7 +1034,8 @@ class AskPriceSupplier extends CommonObject $error++; } } - + */ + if (! $error) { // Hook of thirdparty module @@ -1847,7 +1851,7 @@ class AskPriceSupplier extends CommonObject { $productsupplier = new ProductFournisseur($this->db); - dol_syslog(get_class($this)."::updateorCreatePriceFournisseur", LOG_DEBUG); + dol_syslog(get_class($this)."::updateOrCreatePriceFournisseur", LOG_DEBUG); foreach ($this->lines as $product) { $idProductFourn = $productsupplier->find_min_price_product_fournisseur($product->fk_product, $product->qty); $res = $productsupplier->fetch($idProductFourn); @@ -1876,7 +1880,7 @@ class AskPriceSupplier extends CommonObject $price=price2num($product->subprice*$product->qty,'MU'); $unitPrice = price2num($product->subprice,'MU'); - $sql = 'UPDATE '.MAIN_DB_PREFIX.'product_fournisseur_price SET '.(!empty($product->ref_fourn) ? 'ref_fourn = `'.$product->ref_fourn.'`, ' : '').' price ='.$price.', unitprice ='.$unitPrice.' WHERE rowid = '.$idProductFournPrice; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'product_fournisseur_price SET '.(!empty($product->ref_fourn) ? 'ref_fourn = "'.$product->ref_fourn.'", ' : '').' price ='.$price.', unitprice ='.$unitPrice.' WHERE rowid = '.$idProductFournPrice; $resql = $this->db->query($sql); if (!resql) { @@ -2198,7 +2202,7 @@ class AskPriceSupplier extends CommonObject $ref = dol_sanitizeFileName($this->ref); if ($conf->propal->dir_output && !empty($this->ref)) { - $dir = $conf->propal->dir_output . "/" . $ref ; + $dir = $conf->askpricesupplier->dir_output . "/" . $ref ; $file = $dir . "/" . $ref . ".pdf"; if (file_exists($file)) { diff --git a/htdocs/comm/askpricesupplier/document.php b/htdocs/comm/askpricesupplier/document.php index 6c76496e329..f89e38838c3 100644 --- a/htdocs/comm/askpricesupplier/document.php +++ b/htdocs/comm/askpricesupplier/document.php @@ -122,7 +122,7 @@ if ($object->id > 0) */ // Customer - print "
".$langs->trans("Company")."
".$langs->trans("Supplier")."'.$object->thirdparty->getNomUrl(1).'
'.$langs->trans("NbOfAttachedFiles").''.count($filearray).'
".$langs->trans("Company")."
".$langs->trans("Supplier")."'.$object->client->getNomUrl(1).'
'.$langs->trans('Date').''; + /* PHFAVRE retrait en temporaire + print '
'.$langs->trans('AskPriceSupplierDate').''; print dol_print_date($object->date,'daytext'); print '
'.$langs->trans('AskPriceSupplierDate').''; + print dol_print_date($object->date_livraison,'daytext'); + print '