From 22045603b744134fa4c75066b97ff1adca623d37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 5 Mar 2015 13:51:29 +0100 Subject: [PATCH 01/12] Fix bad update of denormalized field --- htdocs/projet/class/task.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 017e2b782ec..b01a9644cb1 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -807,7 +807,7 @@ class Task extends CommonObject if ($ret >= 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; - $sql.= " SET duration_effective = duration_effective + '".price2num($this->timespent_duration)."'"; + $sql.= " SET duration_effective = (SELECT SUM(task_duration) FROM ".MAIN_DB_PREFIX."projet_task_time as ptt where ptt.fk_task = ".$this->id.")"; if (isset($this->progress)) $sql.= ", progress = " . $this->progress; // Do not overwrite value if not provided $sql.= " WHERE rowid = ".$this->id; @@ -980,7 +980,7 @@ class Task extends CommonObject $newDuration = $this->timespent_duration - $this->timespent_old_duration; $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; - $sql.= " SET duration_effective = duration_effective + '".$newDuration."'"; + $sql.= " SET duration_effective = (SELECT SUM(task_duration) FROM ".MAIN_DB_PREFIX."projet_task_time as ptt where ptt.fk_task = ".$this->id.")"; $sql.= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::updateTimeSpent", LOG_DEBUG); From 77dd07c846e335869800b6e1e0f01ed6c7086e3c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Mar 2015 13:12:33 +0100 Subject: [PATCH 02/12] Fix thumbs generation --- htdocs/categories/class/categorie.class.php | 16 +++++++++----- htdocs/product/class/product.class.php | 24 +++++++++++++-------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index f5828ecdea7..b9876bb8382 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1330,17 +1330,23 @@ class Categorie extends CommonObject * Build thumb * * @param string $file Chemin du fichier d'origine - * @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut) - * @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut) * @return void */ - function add_thumb($file, $maxWidth = 160, $maxHeight = 120) + function add_thumb($file) { - require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; + global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality; + + require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ... if (file_exists($file)) { - vignette($file,$maxWidth,$maxHeight); + // Create small thumbs for company (Ratio is near 16/9) + // Used on logon for example + $imgThumbSmall = vignette($file, $maxwidthsmall, $maxheightsmall, '_small', $quality); + + // Create mini thumbs for company (Ratio is near 16/9) + // Used on menu or for setup page for example + $imgThumbMini = vignette($file, $maxwidthmini, $maxheightmini, '_mini', $quality); } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index e26f9102544..653925701ad 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3100,11 +3100,9 @@ class Product extends CommonObject * * @param string $sdir Target directory * @param string $file Array of file info of file to upload: array('name'=>..., 'tmp_name'=>...) - * @param int $maxWidth Largeur maximum que dois faire la miniature (160 by defaut) - * @param int $maxHeight Hauteur maximum que dois faire la miniature (120 by defaut) * @return int <0 if KO, >0 if OK */ - function add_photo($sdir, $file, $maxWidth = 160, $maxHeight = 120) + function add_photo($sdir, $file) { global $conf; @@ -3114,10 +3112,12 @@ class Product extends CommonObject $dir = $sdir; if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO)) $dir .= '/'. get_exdir($this->id,2) . $this->id ."/photos"; + else $dir .= '/'.dol_sanitizeFileName($this->ref); dol_mkdir($dir); $dir_osencoded=$dir; + if (is_dir($dir_osencoded)) { $originImage = $dir . '/' . $file['name']; @@ -3128,7 +3128,7 @@ class Product extends CommonObject if (file_exists(dol_osencode($originImage))) { // Cree fichier en taille vignette - $this->add_thumb($originImage,$maxWidth,$maxHeight); + $this->add_thumb($originImage); } } @@ -3140,18 +3140,24 @@ class Product extends CommonObject * Build thumb * * @param string $file Chemin du fichier d'origine - * @param int $maxWidth Largeur maximum que dois faire la miniature (160 par defaut) - * @param int $maxHeight Hauteur maximum que dois faire la miniature (120 par defaut) * @return void */ - function add_thumb($file, $maxWidth = 160, $maxHeight = 120) + function add_thumb($file) { - require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; + global $maxwidthsmall, $maxheightsmall, $maxwidthmini, $maxheightmini, $quality; + + require_once DOL_DOCUMENT_ROOT .'/core/lib/images.lib.php'; // This define also $maxwidthsmall, $quality, ... $file_osencoded=dol_osencode($file); if (file_exists($file_osencoded)) { - vignette($file,$maxWidth,$maxHeight); + // Create small thumbs for company (Ratio is near 16/9) + // Used on logon for example + $imgThumbSmall = vignette($file, $maxwidthsmall, $maxheightsmall, '_small', $quality); + + // Create mini thumbs for company (Ratio is near 16/9) + // Used on menu or for setup page for example + $imgThumbMini = vignette($file, $maxwidthmini, $maxheightmini, '_mini', $quality); } } From a169b3348ee2d5249baccc0fadc8adeffd747c75 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Mar 2015 14:36:22 +0100 Subject: [PATCH 03/12] Fix show alays date fields for contract module. Fix select of product were lost. --- htdocs/commande/card.php | 32 +++++++++++------------ htdocs/core/tpl/objectline_create.tpl.php | 22 +++++++--------- htdocs/fourn/commande/card.php | 6 ++--- htdocs/product/class/product.class.php | 4 +-- 4 files changed, 31 insertions(+), 33 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 12150f9a61e..27c333eec21 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -207,13 +207,13 @@ if (empty($reshook)) if ($datecommande == '') { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), 'errors'); $action = 'create'; - $error ++; + $error++; } if ($socid < 1) { setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Customer")), 'errors'); $action = 'create'; - $error ++; + $error++; } if (! $error) { @@ -334,7 +334,7 @@ if (empty($reshook)) $result = $object->addline($desc, $lines [$i]->subprice, $lines [$i]->qty, $lines [$i]->tva_tx, $lines [$i]->localtax1_tx, $lines [$i]->localtax2_tx, $lines [$i]->fk_product, $lines [$i]->remise_percent, $lines [$i]->info_bits, $lines [$i]->fk_remise_except, 'HT', 0, $date_start, $date_end, $product_type, $lines [$i]->rang, $lines [$i]->special_code, $fk_parent_line, $lines [$i]->fk_fournprice, $lines [$i]->pa_ht, $label, $array_option); if ($result < 0) { - $error ++; + $error++; break; } @@ -349,14 +349,14 @@ if (empty($reshook)) $reshook = $hookmanager->executeHooks('createFrom', $parameters, $object, $action); // Note that $action and $object may have been // modified by hook if ($reshook < 0) - $error ++; + $error++; } else { setEventMessage($srcobject->error, 'errors'); - $error ++; + $error++; } } else { setEventMessage($object->error, 'errors'); - $error ++; + $error++; } } else { // Required extrafield left blank, error message already defined by setOptionalsFromPost() @@ -390,7 +390,7 @@ if (empty($reshook)) $result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external'); if ($result < 0) { setEventMessage($langs->trans("ErrorFailedToAddContact"), 'errors'); - $error ++; + $error++; } } @@ -554,24 +554,24 @@ if (empty($reshook)) if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) { setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); - $error ++; + $error++; } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && GETPOST('type') < 0) { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); - $error ++; + $error++; } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && (! ($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); - $error ++; + $error++; } if ($qty == '') { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), 'errors'); - $error ++; + $error++; } if (GETPOST('prod_entry_mode') == 'free' && empty($idprod) && empty($product_desc)) { setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), 'errors'); - $error ++; + $error++; } if (! $error && ($qty >= 0) && (! empty($product_desc) || ! empty($idprod))) { @@ -826,7 +826,7 @@ if (empty($reshook)) if ($price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent')) / 100) < price2num($price_min))) { setEventMessage($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), 'errors'); - $error ++; + $error++; } } else { $type = GETPOST('type'); @@ -835,7 +835,7 @@ if (empty($reshook)) // Check parameters if (GETPOST('type') < 0) { setEventMessage($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), 'errors'); - $error ++; + $error++; } } @@ -1137,10 +1137,10 @@ if (empty($reshook)) if (empty($reshook)) { $result = $object->insertExtraFields(); if ($result < 0) { - $error ++; + $error++; } } else if ($reshook < 0) - $error ++; + $error++; } if ($error) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 6037f6c77c9..e3f2431783f 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -153,12 +153,12 @@ else { if (empty($senderissupplier)) { - $form->select_produits('', 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); + $form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, 1, 2, '', 1, array(),$buyer->id); } else { $ajaxoptions=array( - 'update' => array('qty'=>'qty','remise_percent' => 'discount'), // html id tag will be edited with which ajax json response key + 'update' => array('qty'=>'qty','remise_percent' => 'discount'), // html id tags that will be edited with which ajax json response key 'option_disabled' => 'addPredefinedProductButton', // html id to disable once select is done 'warning' => $langs->trans("NoPriceDefinedForThisSupplier") // translation of an error saved into var 'error' ); @@ -192,23 +192,16 @@ else { tva_assuj == "0") echo '0'; - else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer); - } + if ($seller->tva_assuj == "0") echo '0'; + else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer); ?> - "> - - "> - "> @@ -273,7 +266,7 @@ else { service->enabled) && $dateSelector && GETPOST('type') != '0') +if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $dateSelector && GETPOST('type') != '0') // We show date field if required { if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; else $colspan = 9; @@ -493,6 +486,11 @@ jQuery(document).ready(function() { if (jQuery('#idprod').val() > 0) jQuery('#dp_desc').focus(); if (jQuery('#idprodfournprice').val() > 0) jQuery('#dp_desc').focus(); }); + + + setforpredef(); + + }); /* Function to set fields from choice */ diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 7750250b00b..eefd5c961e2 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -251,7 +251,7 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $idprod=0; $productsupplier = new ProductFournisseur($db); - if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-2; // Same behaviour than with combolist. When not select idprodfournprice is now -2 (to avoid conflict with next action that may return -1) + if (GETPOST('idprodfournprice') == -1 || GETPOST('idprodfournprice') == '') $idprod=-99; // Same behaviour than with combolist. When not select idprodfournprice is now -99 (to avoid conflict with next action that may return -1, -2, ...) if (GETPOST('idprodfournprice') > 0) { @@ -294,12 +294,12 @@ if ($action == 'addline' && $user->rights->fournisseur->commande->creer) $date_end ); } - if ($idprod == -2 || $idprod == 0) + if ($idprod == 0 || $idprod == -99) { // Product not selected $error++; $langs->load("errors"); - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ProductOrService")), 'errors'); + setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ProductOrService")).' '.$langs->trans("or").' '.$langs->trans("NoPriceDefinedForThisSupplier"), 'errors'); } if ($idprod == -1) { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 653925701ad..ac3d8e967a2 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1229,14 +1229,14 @@ class Product extends CommonObject } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); return -3; } } } else { - $this->error=$this->db->error(); + $this->error=$this->db->lasterror(); return -2; } } From dd3f569ede8ee53737d0643a515dfd3a2084e934 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Mar 2015 20:34:00 +0100 Subject: [PATCH 04/12] NEW: Enhance the natural_search function so we can use it to search numeric fields with criteria with operator <>= inside (< 100, >= 1000) --- htdocs/core/lib/functions.lib.php | 62 +++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 438f0ee22ca..c5d8d509b08 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4946,34 +4946,64 @@ function dol_getmypid() /** - * Natural search + * Generate natural SQL search string * - * @param mixed $fields String or array of strings filled with the fields names in the SQL query - * @param string $value The value to look for (example: "keyword1 keyword2") - * @return string $res The statement to append to the SQL query + * @param string|string[] $fields String or array of strings, filled with the name of fields in the SQL query + * @param string $value The value to look for. + * If param $numeric is 0, can contains several keywords separated with a space, like "keyword1 keyword2" = We want record field like keyword1 and field like keyword2 + * If param $numeric is 1, can contains an operator <>= like "<10" or ">=100.5 < 1000" + * @param string $number 0=value is list of keywords, 1=value is a numeric test + * @return string $res The statement to append to the SQL query */ -function natural_search($fields, $value) +function natural_search($fields, $value, $numeric=0) { - global $db; + global $db,$langs; + + if ($numeric) + { + $value=preg_replace('/([<>=]+)\s([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do + } $crits = explode(' ', $value); $res = ''; if (! is_array($fields)) $fields = array($fields); - $end = count($fields); + $nboffields = count($fields); $end2 = count($crits); $j = 0; - foreach ($crits as $crit) { - $i = 0; - foreach ($fields as $field) { - if ( $i > 0 && $i < $end) $res .= " OR "; - $res .= $field . " LIKE '%" . $db->escape(trim($crit)) . "%'"; + foreach ($crits as $crit) + { + $i = 0; $i2 = 0; + $newres = ''; + foreach ($fields as $field) + { + if ($numeric) + { + $operator='='; + $newcrit = preg_replace('/([<>=]+)/','',trim($crit)); + + preg_match('/([<>=]+)/',trim($crit), $reg); + if ($reg[1]) + { + $operator = $reg[1]; + } + if ($newcrit != '') + { + $newres .= ($i2 > 0 ? ' OR ' : '') . $field . ' '.$operator.' '.price2num($newcrit); + $i2++; // a criteria was added to string + } + } + else + { + $newres .= ($i2 > 0 ? ' OR ' : '') . $field . " LIKE '%" . $db->escape(trim($crit)) . "%'"; + $i2++; // a criteria was added to string + } $i++; } - if ($end > 1) $res .= ')'; - if ($j < $end2 - 1) $res .= " AND "; - if ($end > 1 && $j < $end2 - 1) $res .= '('; + if ($newres) $res = $res . ($res ? ' AND ' : '') . ($i2 > 1 ? '(' : '') .$newres . ($i2 > 1 ? ')' : ''); $j++; } - return " AND " . ($end > 1? '(' : '') . $res; + $res = " AND (" . $res . ")"; + //print 'xx'.$res.'yy'; + return $res; } From 9e4e9a54111ae543692a77d1eac08b58151bfac1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Mar 2015 20:59:18 +0100 Subject: [PATCH 05/12] NEW: Can search on customer order amount into customer order list. --- htdocs/comm/card.php | 2 +- htdocs/comm/propal/list.php | 10 +++++----- htdocs/commande/list.php | 18 ++++++++++++++---- htdocs/compta/facture.php | 4 ++-- htdocs/compta/facture/list.php | 16 ++++++++-------- htdocs/core/lib/functions.lib.php | 2 +- htdocs/fourn/commande/list.php | 14 +++++++------- htdocs/fourn/facture/list.php | 14 +++++++------- 8 files changed, 45 insertions(+), 35 deletions(-) diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index ffc01a998d5..78b786d2366 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -400,7 +400,7 @@ if ($id > 0) // display amount and link to unpaid bill $outstandigBills = $object->get_OutstandingBill(); if ($outstandigBills != 0) - print " / ".price($outstandigBills).''; + print " (".$langs->trans("CurrentOutstandingBill")." ".price($outstandigBills, '', $langs, 0, 0, -1, $conf->currency).')'; print ''; print ''; } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index a3ef72bb6ca..da6e56c9460 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -182,9 +182,9 @@ if ($search_author) { $sql.= " AND u.login LIKE '%".$db->escape(trim($search_author))."%'"; } -if ($search_montant_ht) +if ($search_montant_ht != '') { - $sql.= " AND p.total_ht='".$db->escape(price2num(trim($search_montant_ht)))."'"; + $sql.= natural_search("p.total_ht", $search_montant_ht, 1); } if ($sall) { $sql .= natural_search(array('s.nom', 'p.note_private', 'p.note_public', 'pd.description'), $sall); @@ -316,12 +316,12 @@ if ($result) print ''; print ' '; // Amount - print ''; - print ''; + print ''; + print ''; print ''; // Author print ''; - print ''; + print ''; print ''; print ''; $formpropal->selectProposalStatus($viewstatut,1); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9d143d87eb2..c38b1a8e34f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -51,6 +51,7 @@ $sall=GETPOST('sall'); $socid=GETPOST('socid','int'); $search_user=GETPOST('search_user','int'); $search_sale=GETPOST('search_sale','int'); +$search_total_ht=GETPOST('search_total_ht','alpha'); // Security check $id = (GETPOST('orderid')?GETPOST('orderid'):GETPOST('id','int')); @@ -79,6 +80,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $search_ref=''; $search_ref_customer=''; $search_company=''; + $search_total_ht=''; $orderyear=''; $ordermonth=''; $deliverymonth=''; @@ -96,6 +98,7 @@ $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hook if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + /* * View */ @@ -198,7 +201,10 @@ if ($search_user > 0) { $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user; } - +if ($search_total_ht != '') +{ + $sql.= natural_search('c.total_ht', $search_total_ht, 1); +} $sql.= ' ORDER BY '.$sortfield.' '.$sortorder; $nbtotalofrecords = 0; @@ -252,7 +258,8 @@ if ($resql) if ($search_ref_customer) $param.='&search_ref_customer='.$search_ref_customer; if ($search_user > 0) $param.='&search_user='.$search_user; if ($search_sale > 0) $param.='&search_sale='.$search_sale; - + if ($search_total_ht != '') $param.='&search_total_ht='.$search_total_ht; + $num = $db->num_rows($resql); print_barre_liste($title, $page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); $i = 0; @@ -316,7 +323,9 @@ if ($resql) print ''; $formother->select_year($deliveryyear?$deliveryyear:-1,'deliveryyear',1, 20, 5); print ''; - print ' '; + print ''; + print ''; + print ''; print ''; print ''; print "\n"; @@ -328,7 +337,8 @@ if ($resql) $generic_commande = new Commande($db); $generic_product = new Product($db); - while ($i < min($num,$limit)) { + while ($i < min($num,$limit)) + { $objp = $db->fetch_object($resql); $var=!$var; print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4cb696836bd..d38519bf6d5 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1962,11 +1962,11 @@ if ($action == 'create') // Outstanding Bill $outstandigBills = $soc->get_OutstandingBill(); print ' (' . $langs->trans('CurrentOutstandingBill') . ': '; - print price($outstandigBills, '', $langs, 0, 0, - 1, $conf->currency); + print price($outstandigBills, '', $langs, 0, 0, -1, $conf->currency); if ($soc->outstanding_limit != '') { if ($outstandigBills > $soc->outstanding_limit) print img_warning($langs->trans("OutstandingBillReached")); - print ' / ' . price($soc->outstanding_limit); + print ' / ' . price($soc->outstanding_limit, '', $langs, 0, 0, -1, $conf->currency); } print ')'; print ''; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 56bd57c725a..dc081424ace 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -187,13 +187,13 @@ if ($search_societe) { $sql .= natural_search('s.nom', $search_societe); } -if ($search_montant_ht) +if ($search_montant_ht != '') { - $sql.= ' AND f.total = \''.$db->escape(price2num(trim($search_montant_ht))).'\''; + $sql.= natural_search('f.total', $search_montant_ht, 1); } -if ($search_montant_ttc) +if ($search_montant_ttc != '') { - $sql.= ' AND f.total_ttc = \''.$db->escape(price2num(trim($search_montant_ttc))).'\''; + $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); } if ($search_status != '') { @@ -263,8 +263,8 @@ if ($resql) if ($search_societe) $param.='&search_societe=' .$search_societe; if ($search_sale > 0) $param.='&search_sale=' .$search_sale; if ($search_user > 0) $param.='&search_user=' .$search_user; - if ($search_montant_ht) $param.='&search_montant_ht='.$search_montant_ht; - if ($search_montant_ttc) $param.='&search_montant_ttc='.$search_montant_ttc; + if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht; + if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc; print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); $i = 0; @@ -323,9 +323,9 @@ if ($resql) print ''; print ' '; print ''; - print ''; + print ''; print ' '; - print ''; + print ''; print ' '; print ''; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c5d8d509b08..509f237b0d6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4961,7 +4961,7 @@ function natural_search($fields, $value, $numeric=0) if ($numeric) { - $value=preg_replace('/([<>=]+)\s([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do + $value=preg_replace('/([<>=]+)\s([0-9'.preg_quote($langs->trans("DecimalSeparator"),'/').'\-])/','\1\2',$value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do } $crits = explode(' ', $value); $res = ''; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 613eb463366..6926997f0f1 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -100,7 +100,7 @@ $offset = $conf->liste_limit * $page ; /* - * Mode Liste + * Mode list */ $sql = "SELECT s.rowid as socid, s.nom as name, cf.date_commande as dc,"; @@ -130,13 +130,13 @@ if ($search_user) { $sql.= " AND u.login LIKE '%".$db->escape($search_user)."%'"; } -if ($search_ht) +if ($search_ht != '') { - $sql .= " AND cf.total_ht = '".$db->escape(price2num($search_ht))."'"; + $sql .= natural_search("cf.total_ht",$search_ht, 1); } -if ($search_ttc) +if ($search_ttc != '') { - $sql .= " AND cf.total_ttc = '".$db->escape(price2num($search_ttc))."'"; + $sql .= natural_search("cf.total_ttc", $search_ttc, 1); } if ($sall) { @@ -214,8 +214,8 @@ if ($resql) print ''; } print ''; - print ''; - print ''; + print ''; + print ''; print ' '; print ' '; print ''; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index d59870d8fc5..66ad20e4c05 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -153,7 +153,7 @@ if ($search_ref) if (is_numeric($search_ref)) $sql .= natural_search(array('fac.ref'), $search_ref); else $sql .= natural_search('fac.ref', $search_ref); } -if (search_ref_supplier) +if ($search_ref_supplier) { $sql .= natural_search('fac.ref_supplier', $search_ref_supplier); } @@ -178,14 +178,14 @@ if ($search_company) $sql .= natural_search('s.nom', $search_company); } -if ($search_amount_no_tax) +if ($search_amount_no_tax != '') { - $sql .= " AND fac.total_ht = '".$db->escape(price2num($search_amount_no_tax))."'"; + $sql .= natural_search('fac.total_ht', $search_amount_no_tax, 1); } -if ($search_amount_all_tax) +if ($search_amount_all_tax != '') { - $sql .= " AND fac.total_ttc = '".$db->escape(price2num($search_amount_all_tax))."'"; + $sql .= natural_search('fac.total_ttc', $search_amount_all_tax, 1); } $nbtotalofrecords = 0; @@ -270,9 +270,9 @@ if ($resql) print ''; } print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; $liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid")); print $form->selectarray('filtre', $liststatus, $filter, 1); From c80007c6801840bc0cb2ba2179be92d922c19f08 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Mar 2015 21:57:58 +0100 Subject: [PATCH 06/12] Fix: we must use stockreal of stockvirtual when we are speaking about stock ('stock' alone is not accurate enough) --- htdocs/expedition/shipment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index d5d82f2baa3..973066971a3 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -402,7 +402,7 @@ if ($id > 0 || ! empty($ref)) print ''.$langs->trans("KeepToShip").''; if (! empty($conf->stock->enabled)) { - print ''.$langs->trans("Stock").''; + print ''.$langs->trans("RealStock").''; } else { From fc0be43f5f8e4d4ccb90077bddcd7501c6825220 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 6 Mar 2015 22:40:41 +0100 Subject: [PATCH 07/12] Fix: beautify search box --- htdocs/product/stats/commande.php | 8 +++++--- htdocs/product/stats/commande_fournisseur.php | 8 +++++--- htdocs/product/stats/facture.php | 4 +++- htdocs/product/stats/facture_fournisseur.php | 4 +++- htdocs/product/stats/propal.php | 4 +++- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 2ae1dcd1582..49a443938ab 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -141,9 +141,9 @@ if ($id > 0 || ! empty($ref)) $sql.= " AND d.fk_commande = c.rowid"; $sql.= " AND d.fk_product =".$product->id; if (! empty($search_month)) - $sql.= ' AND MONTH(f.datef) IN (' . $search_month . ')'; + $sql.= ' AND MONTH(c.date_commande) IN (' . $search_month . ')'; if (! empty($search_year)) - $sql.= ' AND YEAR(f.datef) IN (' . $search_year . ')'; + $sql.= ' AND YEAR(c.date_commande) IN (' . $search_year . ')'; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND c.fk_soc = ".$socid; $sql.= " ORDER BY $sortfield $sortorder "; @@ -189,12 +189,14 @@ if ($id > 0 || ! empty($ref)) print_barre_liste($langs->trans("CustomersOrders"),$page,$_SERVER["PHP_SELF"],"&id=$product->id",$sortfield,$sortorder,'',$num,$totalrecords,''); print '
'; - print $langs->trans('Period').'('.$langs->trans("DateInvoice") .') '; + print $langs->trans('Period').' ('.$langs->trans("OrderDate") .') - '; print $langs->trans('Month') . ': '; print $langs->trans('Year') . ':' . $formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); + print '
'; print ''; print ''; print '
'; + print '
'; $i = 0; print ''; diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 3141b3266e9..8cbdea41495 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -150,9 +150,9 @@ if ($id > 0 || ! empty($ref)) { $sql .= " AND d.fk_commande = c.rowid"; $sql .= " AND d.fk_product =" . $product->id; if (! empty($search_month)) - $sql .= ' AND MONTH(f.datef) IN (' . $search_month . ')'; + $sql .= ' AND MONTH(c.date_commande) IN (' . $search_month . ')'; if (! empty($search_year)) - $sql .= ' AND YEAR(f.datef) IN (' . $search_year . ')'; + $sql .= ' AND YEAR(c.date_commande) IN (' . $search_year . ')'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id; if ($socid) @@ -199,12 +199,14 @@ if ($id > 0 || ! empty($ref)) { print_barre_liste($langs->trans("SuppliersOrders"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); print '
'; - print $langs->trans('Period') . '(' . $langs->trans("DateInvoice") . ') '; + print $langs->trans('Period') . ' (' . $langs->trans("OrderDate") . ') - '; print $langs->trans('Month') . ': '; print $langs->trans('Year') . ':' . $formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); + print '
'; print ''; print ''; print '
'; + print '
'; $i = 0; print '
'; diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index b59bc008f17..2ae8164b0f9 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -190,12 +190,14 @@ if ($id > 0 || ! empty($ref)) print_barre_liste($langs->trans("CustomersInvoices"),$page,$_SERVER["PHP_SELF"],"&id=".$product->id,$sortfield,$sortorder,'',$num,$totalrecords,''); print '
'; - print $langs->trans('Period').'('.$langs->trans("DateInvoice") .') '; + print $langs->trans('Period').' ('.$langs->trans("DateInvoice") .') - '; print $langs->trans('Month') . ': '; print $langs->trans('Year') . ':' . $formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); + print '
'; print ''; print ''; print '
'; + print '
'; $i = 0; print '
'; diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 0feb415cc43..2e8e84621ba 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -191,12 +191,14 @@ if ($id > 0 || ! empty($ref)) print_barre_liste($langs->trans("SuppliersInvoices"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); print '
'; - print $langs->trans('Period') . '(' . $langs->trans("DateInvoice") . ') '; + print $langs->trans('Period') . ' (' . $langs->trans("DateInvoice") . ') - '; print $langs->trans('Month') . ': '; print $langs->trans('Year') . ':' . $formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); + print '
'; print ''; print ''; print '
'; + print '
'; $i = 0; print '
'; diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 50d7c952b6d..10fd8247204 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -192,12 +192,14 @@ if ($id > 0 || ! empty($ref)) print_barre_liste($langs->trans("Proposals"), $page, $_SERVER["PHP_SELF"], "&id=$product->id", $sortfield, $sortorder, '', $num, $totalrecords, ''); print '
'; - print $langs->trans('Period') . '(' . $langs->trans("DateInvoice") . ') '; + print $langs->trans('Period') . ' (' . $langs->trans("DatePropal") . ') - '; print $langs->trans('Month') . ': '; print $langs->trans('Year') . ':' . $formother->selectyear($search_year ? $search_year : - 1, 'search_year', 1, 20, 5); + print '
'; print ''; print ''; print '
'; + print '
'; $i = 0; print '
'; From 6db3f1b30ed294d0054d35830b64d64c3977745f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Mar 2015 19:06:56 +0100 Subject: [PATCH 08/12] Add mdule askpricesupplier into MAIN__MODULES_FOR_EXTERNAL --- htdocs/core/class/conf.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 67b5b8147d5..b6cc390ca33 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -452,7 +452,7 @@ class Conf $this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024); // Define list of limited modules - if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later. + if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,askpricesupplier,facture,categorie,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda,adherent'; // '' means 'all'. Note that contact is added here as it should be a module later. // Enable select2 if (empty($conf->global->MAIN_USE_JQUERY_MULTISELECT)) $conf->global->MAIN_USE_JQUERY_MULTISELECT='select2'; From 56b5bfd25b63041cb8d0298b939da4721e5509a7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Mar 2015 02:08:26 +0100 Subject: [PATCH 09/12] NEW: Implement option SUPPLIER_ORDER_USE_DISPATCH_STATUS to add a status into each dispathing line of supplier order to "verify" a reception is ok. Status of order can be set to "total/done" only if line is verified. --- htdocs/core/class/commonobject.class.php | 3 +- htdocs/core/class/html.formorder.class.php | 6 +- .../class/fournisseur.commande.class.php | 82 +++++++++++-- .../fournisseur.commande.dispatch.class.php | 18 +-- htdocs/fourn/commande/card.php | 25 ++-- htdocs/fourn/commande/dispatch.php | 113 +++++++++++++----- htdocs/fourn/commande/list.php | 10 +- htdocs/langs/en_US/errors.lang | 1 + htdocs/langs/en_US/main.lang | 2 + htdocs/langs/en_US/orders.lang | 1 + htdocs/theme/eldy/style.css.php | 9 ++ 11 files changed, 200 insertions(+), 70 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8ad8ecd2331..02ccd13b97c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2141,7 +2141,8 @@ abstract class CommonObject $fieldstatus="fk_statut"; if ($elementTable == 'user') $fieldstatus="statut"; if ($elementTable == 'expensereport') $fieldstatus="fk_c_expensereport_statuts"; - + if ($elementTable == 'commande_fournisseur_dispatch') $fieldstatus="status"; + $sql = "UPDATE ".MAIN_DB_PREFIX.$elementTable; $sql.= " SET ".$fieldstatus." = ".$status; // If status = 1 = validated, update also fk_user_valid diff --git a/htdocs/core/class/html.formorder.class.php b/htdocs/core/class/html.formorder.class.php index 5ea5b33c1f4..2abc0c38485 100644 --- a/htdocs/core/class/html.formorder.class.php +++ b/htdocs/core/class/html.formorder.class.php @@ -57,11 +57,11 @@ class FormOrder { print ''; print ''; print ''; - if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) print ''; + if (! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS)) print ''; print "\n"; $var=false; @@ -553,6 +591,7 @@ if ($id > 0 || ! empty($ref)) while ($i < $num) { $objp = $db->fetch_object($resql); + print ""; print ''; - } + // Add button to check/uncheck disaptching + print ''; + } + print "\n"; $i++; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 6926997f0f1..7e525a9d080 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -45,7 +45,7 @@ $search_user=GETPOST('search_user'); $search_ht=GETPOST('search_ht'); $search_ttc=GETPOST('search_ttc'); $sall=GETPOST('search_all'); -$search_status=(GETPOST('search_status','int')!=''?GETPOST('search_status','int'):GETPOST('statut','int')); +$search_status=(GETPOST('search_status','alpha')!=''?GETPOST('search_status','alpha'):GETPOST('statut','alpha')); // alpha and not intbecause it can be '6,7' $page = GETPOST('page','int'); $socid = GETPOST('socid','int'); @@ -153,9 +153,9 @@ if ($search_refsupp) { $sql.= " AND (cf.ref_supplier LIKE '%".$db->escape($search_refsupp)."%')"; } -if ($search_status >= 0) +if ($search_status != '' && $search_status >= 0) { - if ($search_status == 6 || $search_status == 7) $sql.=" AND cf.fk_statut IN (6,7)"; + if (strstr($search_status, ',')) $sql.=" AND cf.fk_statut IN (".$db->escape($search_status).")"; else $sql.=" AND cf.fk_statut = ".$search_status; } @@ -205,9 +205,9 @@ if ($resql) print ''; - print ''; + print ''; if (empty($conf->global->SUPPLIER_ORDER_HIDE_REF_SUPPLIER)) print ''; - print ''; + print ''; if (! empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) { print ''; - print ''; + print ''; print ''; - print ''; + print ''; print "\n"; $i++; From 7c08f33fe184fbebcff5c87e74f5858f2849f051 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Mar 2015 02:26:41 +0100 Subject: [PATCH 11/12] Missing style buttonRefused --- htdocs/theme/amarok/style.css.php | 18 ++++++++++++++++++ htdocs/theme/auguria/style.css.php | 17 +++++++++++++++++ htdocs/theme/bureau2crea/style.css.php | 17 +++++++++++++++++ htdocs/theme/cameleo/style.css.php | 17 +++++++++++++++++ 4 files changed, 69 insertions(+) diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php index bd41d0735a5..c7f3d27dcfb 100644 --- a/htdocs/theme/amarok/style.css.php +++ b/htdocs/theme/amarok/style.css.php @@ -1125,6 +1125,24 @@ td.formdocbutton {padding-top:6px;} ); color:white; } +.button:disabled { + opacity: 0.4; + filter: alpha(opacity=40); /* For IE8 and earlier */ + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + cursor: auto; +} +.buttonRefused { + pointer-events: none; + cursor: default; + opacity: 0.4; + filter: alpha(opacity=40); /* For IE8 and earlier */ + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} + /* ============================================================================== */ /* Tables */ diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 35e0cdd36c9..7278521e092 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -184,6 +184,23 @@ legend { margin-bottom: 8px; } padding: 0px 2px 0px 2px; margin: 0px 0px 0px 0px; } +.button:disabled { + opacity: 0.4; + filter: alpha(opacity=40); /* For IE8 and earlier */ + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + cursor: auto; +} +.buttonRefused { + pointer-events: none; + cursor: default; + opacity: 0.4; + filter: alpha(opacity=40); /* For IE8 and earlier */ + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} form { padding: 0em 0em 0em 0em; margin: 0em 0em 0em 0em; diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index b720bd4a802..31071f0b10c 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -209,6 +209,23 @@ legend { margin-bottom: 8px; } padding: 0px 2px 0px 2px; margin: 0px 0px 0px 0px; } +.button:disabled { + opacity: 0.4; + filter: alpha(opacity=40); /* For IE8 and earlier */ + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + cursor: auto; +} +.buttonRefused { + pointer-events: none; + cursor: default; + opacity: 0.4; + filter: alpha(opacity=40); /* For IE8 and earlier */ + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} form { padding: 0em 0em 0em 0em; margin: 0em 0em 0em 0em; diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index a49ad6daaec..d09cb844b88 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -185,6 +185,23 @@ legend { margin-bottom: 8px; } padding: 0px 2px 0px 2px; margin: 0px 0px 0px 0px; } +.button:disabled { + opacity: 0.4; + filter: alpha(opacity=40); /* For IE8 and earlier */ + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + cursor: auto; +} +.buttonRefused { + pointer-events: none; + cursor: default; + opacity: 0.4; + filter: alpha(opacity=40); /* For IE8 and earlier */ + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} form { padding: 0em 0em 0em 0em; margin: 0em 0em 0em 0em; From 3894a48ffdaba5acfff20e1c34e71b0c190f9289 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Mar 2015 02:37:25 +0100 Subject: [PATCH 12/12] Fix: bad CSS --- htdocs/compta/bank/index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/bank/index.php b/htdocs/compta/bank/index.php index 050db37fefc..9c9f0574c31 100644 --- a/htdocs/compta/bank/index.php +++ b/htdocs/compta/bank/index.php @@ -174,7 +174,11 @@ foreach ($accounts as $key=>$type) $total[$acc->currency_code] += $solde; } } -if (! $found) print ''; +if (! $found) +{ + $var = !$var; + print ''; +} // Total foreach ($total as $key=>$solde) {
'.$langs->trans("Warehouse").''.$langs->trans("Comment").''.$langs->trans("Status").''.$langs->trans("Status").'
'; print ''.img_object($langs->trans("ShowProduct"),'product').' '.$objp->ref.''; @@ -588,8 +627,22 @@ if ($id > 0 || ! empty($ref)) //print $supplierorderdispatch->status; print $supplierorderdispatch->getLibStatut(5); print ''; + $disabled=''; + if ($commande->statut == 5) $disabled=1; + if (empty($objp->status)) + { + print 'dispatchlineid.'">'.$langs->trans("Check").''; + } + else + { + print 'dispatchlineid.'">'.$langs->trans("Uncheck").''; + } + print '
'; diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index be75e3a96a3..3d83901194b 100755 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -160,6 +160,7 @@ ErrorPriceExpressionInternal=Internal error '%s' ErrorPriceExpressionUnknown=Unknown error '%s' ErrorSrcAndTargetWarehouseMustDiffers=Source and target warehouses must differs ErrorTryToMakeMoveOnProductRequiringBatchData=Error, trying to make a stock movement without batch/serial information, on a product requiring batch/serial information +ErrorCantSetReceptionToTotalDoneWithReceptionToApprove=All recorded receptions must first be verified before being allowed to do this action # Warnings WarningMandatorySetupNotComplete=Mandatory setup parameters are not yet defined diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index be893d52569..551807aad59 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -159,6 +159,7 @@ Search=Search SearchOf=Search Valid=Valid Approve=Approve +Disapprove=Disapprove ReOpen=Re-Open Upload=Send file ToLink=Link @@ -524,6 +525,7 @@ DateFromTo=From %s to %s DateFrom=From %s DateUntil=Until %s Check=Check +Uncheck=Uncheck Internal=Internal External=External Internals=Internal diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang index 4f6e0b0dfb2..ea3659b90de 100644 --- a/htdocs/langs/en_US/orders.lang +++ b/htdocs/langs/en_US/orders.lang @@ -42,6 +42,7 @@ StatusOrderCanceled=Canceled StatusOrderDraft=Draft (needs to be validated) StatusOrderValidated=Validated StatusOrderOnProcess=Ordered - Standby reception +StatusOrderOnProcessWithValidation=Ordered - Standby reception or validation StatusOrderProcessed=Processed StatusOrderToBill=Delivered StatusOrderToBill2=To bill diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index ccf54a6f9b5..206b1df019e 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -361,6 +361,15 @@ fieldset { border: 1px solid #AAAAAA !important; box-shadow: 2px 2px 3px #DDD; } -moz-box-shadow: none; cursor: auto; } +.buttonRefused { + pointer-events: none; + cursor: default; + opacity: 0.4; + filter: alpha(opacity=40); /* For IE8 and earlier */ + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} form { padding:0px; margin:0px; From 3e4845635962e323eb9d61ff53e54b1875dee8fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 8 Mar 2015 02:13:47 +0100 Subject: [PATCH 10/12] Fix when no price defined, we must how nothing instead of 0 --- htdocs/fourn/product/list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index afaf4c8e796..33e1ea46dd9 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -125,7 +125,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); } -$sql .= " ORDER BY ".$sortfield." ".$sortorder; +$sql .= $db->order($sortfield,$sortorder); $sql .= $db->plimit($limit + 1, $offset); dol_syslog("fourn/product/list.php:", LOG_DEBUG); @@ -225,11 +225,11 @@ if ($resql) if ($companystatic->id > 0) print $companystatic->getNomUrl(1,'supplier'); print ''.price($objp->price).''.(isset($objp->price) ? price($objp->price) : '').''.$objp->qty.''.price($objp->unitprice).''.(isset($objp->unitprice) ? price($objp->unitprice) : '').'
'.$langs->trans("None").'
'.$langs->trans("None").'