From a9e5668ea4b4444c8d86b1cfd49d226a1990f27d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Aug 2016 15:58:52 +0200 Subject: [PATCH 01/12] Fix for jmobile --- htdocs/product/class/product.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 79c21cfcbdf..afff7d6f1c6 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -3690,11 +3690,11 @@ class Product extends CommonObject if (empty($maxHeight) || $photo_vignette && $imgarray['height'] > $maxHeight) { $return.= ''; - $return.= 'dol_use_jmobile?'max-height':'height').'="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdirthumb.$photo_vignette).'" title="'.dol_escape_htmltag($alt).'">'; + $return.= ''; } else { $return.= ''; - $return.= 'dol_use_jmobile?'max-height':'height').'="'.$maxHeight.'" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=product&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" title="'.dol_escape_htmltag($alt).'">'; + $return.= ''; } if (empty($nolink)) $return.= ''; From 18cf2f8f8b04a50e2f8c7eb4f604b2eb01907020 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 31 Aug 2016 10:19:40 +0200 Subject: [PATCH 02/12] FIX : header title in commercial area --- htdocs/comm/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 7dc359b4568..2d473efc310 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -66,7 +66,7 @@ $companystatic=new Societe($db); if (! empty($conf->propal->enabled)) $propalstatic=new Propal($db); if (! empty($conf->commande->enabled)) $orderstatic=new Commande($db); -llxHeader(); +llxHeader("",$langs->trans("CommercialArea")); print_fiche_titre($langs->trans("CommercialArea"),'','title_commercial.png'); From 10ced563b30063f6faaa2cbf2689f907c6bdff97 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Aug 2016 19:39:12 +0200 Subject: [PATCH 03/12] Fix var $conf not defined --- htdocs/compta/prelevement/class/bonprelevement.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 9a569a46f7c..bd2fd150d75 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1673,8 +1673,9 @@ class BonPrelevement extends CommonObject * @return string String with SEPA Sender */ function EnregEmetteurSEPA($configuration, $ladate, $nombre, $total, $CrLf='\n') - { // SEPA INITIALISATION - global $confs; + { + // SEPA INITIALISATION + global $conf; $dateTime_YMD = dol_print_date($ladate, '%Y%m%d'); $dateTime_ETAD = dol_print_date($ladate, '%Y-%m-%d'); From 959f4d0ba0d6bf374999dc03e1fdecfd800f3437 Mon Sep 17 00:00:00 2001 From: philippe grand Date: Thu, 1 Sep 2016 19:44:49 +0200 Subject: [PATCH 04/12] internationalized comments --- .../class/bonprelevement.class.php | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 924d8092485..12195e5e05e 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -22,7 +22,7 @@ /** * \file htdocs/compta/prelevement/class/bonprelevement.class.php * \ingroup prelevement - * \brief Fichier de la classe des bons de prelevements + * \brief File of withdrawal receipts class */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; @@ -104,11 +104,11 @@ class BonPrelevement extends CommonObject } /** - * Add facture to withdrawal + * Add invoice to withdrawal * * @param int $facture_id id invoice to add * @param int $client_id id invoice customer - * @param string $client_nom name of cliente + * @param string $client_nom customer name * @param int $amount amount of invoice * @param string $code_banque code of bank withdrawal * @param string $code_guichet code of bank's office @@ -166,7 +166,7 @@ class BonPrelevement extends CommonObject * * @param int $line_id id line to add * @param int $client_id id invoice customer - * @param string $client_nom name of cliente + * @param string $client_nom customer name * @param int $amount amount of invoice * @param string $code_banque code of bank withdrawal * @param string $code_guichet code of bank's office @@ -182,7 +182,7 @@ class BonPrelevement extends CommonObject if ($concat == 1) { /* - * On aggrege les lignes + * We aggregate the lines */ $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes"; @@ -205,7 +205,7 @@ class BonPrelevement extends CommonObject else { /* - * Pas de d'agregation + * No aggregate */ $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_lignes ("; $sql.= "fk_prelevement_bons"; @@ -376,7 +376,7 @@ class BonPrelevement extends CommonObject } /* - * Fin de la procedure + * End of procedure */ if ($error == 0) { @@ -478,7 +478,7 @@ class BonPrelevement extends CommonObject $error++; } } - // Update prelevement line + // Update withdrawal line // TODO: Translate to ligneprelevement.class.php $sql = " UPDATE ".MAIN_DB_PREFIX."prelevement_lignes"; $sql.= " SET statut = 2"; @@ -605,8 +605,8 @@ class BonPrelevement extends CommonObject $arr = array(); /* - * Renvoie toutes les factures presente - * dans un bon de prelevement + * Returns all invoices presented + * within a withdrawal receipt */ $sql = "SELECT fk_facture"; if ($amounts) $sql .= ", SUM(pl.amount)"; From a54784588ba54c51fc7bb2855a63e56edbaf7faf Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 1 Sep 2016 22:39:01 +0200 Subject: [PATCH 05/12] Fix: Info tab on product card - Double header --- htdocs/product/info.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/product/info.php b/htdocs/product/info.php index f725d0e17d9..e29d1a168cb 100644 --- a/htdocs/product/info.php +++ b/htdocs/product/info.php @@ -74,8 +74,6 @@ llxHeader('', $title, $helpurl); $form=new Form($b); -llxHeader('', $title, $help_url); - if ($id > 0 || $ref) { $result = $object->fetch($id,$ref); From 1c626c01eee96e1720e3aee0bd3fa3555c1d4645 Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 2 Sep 2016 11:29:28 +0200 Subject: [PATCH 06/12] Ignore time when checking lot dates --- .../stock/class/mouvementstock.class.php | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index dde89bfb6e5..f9c844cd7c5 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -137,17 +137,26 @@ class MouvementStock extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - if ($this->db->jdate($obj->eatby) != $eatby) + // only check date values + $tmparray=dol_getdate($eatby, true); + $eatby=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); + $tmparray=dol_getdate($sellby, true); + $sellby=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); + $tmparray=dol_getdate($this->db->jdate($obj->eatby), true); + $dbEatby=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); + $tmparray=dol_getdate($this->db->jdate($obj->sellby), true); + $dbSellby=dol_mktime(0, 0, 0, $tmparray['mon'], $tmparray['mday'], $tmparray['year']); + if ($dbEatby != $eatby) { - $this->errors[]=$langs->trans("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->eatby)), dol_print_date($eatby)); - dol_syslog($langs->transnoentities("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->eatby)), dol_print_date($eatby)), LOG_ERR); + $this->errors[]=$langs->trans("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($dbEatby), dol_print_date($eatby)); + dol_syslog($langs->transnoentities("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($dbEatby), dol_print_date($eatby)), LOG_ERR); $this->db->rollback(); return -3; } - if ($this->db->jdate($obj->sellby) != $sellby) + if ($dbSellby != $sellby) { - $this->errors[]=$langs->trans("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->sellby)), dol_print_date($sellby)); - dol_syslog($langs->transnoentities("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($this->db->jdate($obj->sellby)), dol_print_date($sellby)), LOG_ERR); + $this->errors[]=$langs->trans("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($dbSellby), dol_print_date($sellby)); + dol_syslog($langs->transnoentities("ThisSerialAlreadyExistWithDifferentDate", $batch, dol_print_date($dbSellby), dol_print_date($sellby)), LOG_ERR); $this->db->rollback(); return -3; } From 416a0892d75438a4083c94176d803a5c723d8fa9 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Fri, 2 Sep 2016 12:32:14 +0200 Subject: [PATCH 07/12] Fix: An empty variable is used to update multiprice --- htdocs/product/price.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/price.php b/htdocs/product/price.php index cfdcfd33db7..ef807d2f603 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -10,6 +10,7 @@ * Copyright (C) 2014 Ion agorria * Copyright (C) 2015 Alexandre Spangaro * Copyright (C) 2015 Marcos GarcĂ­a + * Copyright (C) 2016 Ferran Marcet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -213,7 +214,7 @@ if (empty($reshook)) 'price' => $newprice[$i], 'price_min' => $newprice_min[$i], 'price_base_type' => $newpricebase[$i], - 'vat_tx' => $tva_tx, + 'vat_tx' => $tva_tx_txt, 'npr' => $npr, 'localtaxes_array' => array('0'=>$localtax1_type, '1'=>$localtax1, '2'=>$localtax2_type, '3'=>$localtax2) ); From fcd5e1fb2c529a5eb9c5e501c23094bab5e9a05e Mon Sep 17 00:00:00 2001 From: phf Date: Fri, 2 Sep 2016 15:30:42 +0200 Subject: [PATCH 08/12] Fix lost value if use double quote --- htdocs/societe/soc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 3a5ed38e2d5..d2fccc12f9b 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -252,7 +252,7 @@ if (empty($reshook)) $object->name_alias = GETPOST('name_alias'); } - $object->address = GETPOST('address', 'alpha'); + $object->address = GETPOST('address'); $object->zip = GETPOST('zipcode', 'alpha'); $object->town = GETPOST('town', 'alpha'); $object->country_id = GETPOST('country_id', 'int'); From aedd8132363cc4ae9760521cf37afcdc7cef831a Mon Sep 17 00:00:00 2001 From: fappels Date: Fri, 2 Sep 2016 18:13:25 +0200 Subject: [PATCH 09/12] Delete product_lot when product deleted --- htdocs/product/class/product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 98cadbff7d9..1b94b00d1bf 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -926,7 +926,7 @@ class Product extends CommonObject // Delete all child tables if (! $error) { - $elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock','product_customer_price'); + $elements = array('product_fournisseur_price','product_price','product_lang','categorie_product','product_stock','product_customer_price','product_lot'); foreach($elements as $table) { if (! $error) From dc9c2f0ed7190ddec07d19aa84ce2022330f5169 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2016 21:10:46 +0200 Subject: [PATCH 10/12] FIX #5687 --- scripts/cron/cron_run_jobs.php | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 38054c48c69..a0f067b5d0c 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -27,7 +27,6 @@ if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1'); if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); -if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1'); if (! defined('NOLOGIN')) define('NOLOGIN','1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); From 8c4324d9124e0551da38dff74ac602eb0afbf361 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2016 21:15:48 +0200 Subject: [PATCH 11/12] FIX #5674 --- htdocs/product/stock/class/mouvementstock.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 7d7dd66bd10..ef59971d95e 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -415,8 +415,8 @@ class MouvementStock extends CommonObject // $sql = "UPDATE ".MAIN_DB_PREFIX."product SET pmp = ".$newpmp.", stock = ".$this->db->ifsql("stock IS NULL", 0, "stock") . " + ".$qty; // $sql.= " WHERE rowid = ".$fk_product; // Update pmp + denormalized fields because we change content of produt_stock. Warning: Do not use "SET p.stock", does not works with pgsql - $sql = "UPDATE ".MAIN_DB_PREFIX."product as p SET p.pmp = ".$newpmp.", "; - $sql.= " stock=(SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock ps WHERE ps.fk_product = p.rowid)"; + $sql = "UPDATE ".MAIN_DB_PREFIX."product as p SET pmp = ".$newpmp.", "; + $sql.= " stock=(SELECT SUM(ps.reel) FROM ".MAIN_DB_PREFIX."product_stock as ps WHERE ps.fk_product = p.rowid)"; $sql.= " WHERE rowid = ".$fk_product; dol_syslog(get_class($this)."::_create", LOG_DEBUG); From dc1bc33343318acfaad86c0a1f1ce27e0459fb58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Sep 2016 21:48:02 +0200 Subject: [PATCH 12/12] sql syntax --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 00efb287dcc..09fa2dc69e9 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1192,8 +1192,8 @@ class SupplierProposal extends CommonObject $sql = "SELECT d.rowid, d.fk_supplier_proposal, d.fk_parent_line, d.label as custom_label, d.description, d.price, d.tva_tx, d.localtax1_tx, d.localtax2_tx, d.qty, d.fk_remise_except, d.remise_percent, d.subprice, d.fk_product,"; $sql.= " d.info_bits, d.total_ht, d.total_tva, d.total_localtax1, d.total_localtax2, d.total_ttc, d.fk_product_fournisseur_price as fk_fournprice, d.buy_price_ht as pa_ht, d.special_code, d.rang, d.product_type,"; $sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label,'; - $sql.= ' d.ref_fourn as ref_produit_fourn'; - $sql.= ' ,d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc'; + $sql.= ' d.ref_fourn as ref_produit_fourn,'; + $sql.= ' d.fk_multicurrency, d.multicurrency_code, d.multicurrency_subprice, d.multicurrency_total_ht, d.multicurrency_total_tva, d.multicurrency_total_ttc'; $sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposaldet as d"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON d.fk_product = p.rowid"; $sql.= " WHERE d.fk_supplier_proposal = ".$this->id;