From 50184babb95a19ff01efb76696b3e3b60441af8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 1 Sep 2015 16:38:53 +0200 Subject: [PATCH 1/8] FIX [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask Close #2893 --- htdocs/compta/facture/class/facture.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index f5a7c27ecd1..72103f6ac5a 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2558,15 +2558,16 @@ class Facture extends CommonInvoice $numref = ""; $numref = $obj->getNextValue($soc,$this,$mode); - if ($numref != "") - { - return $numref; - } - else - { + /** + * $numref can be empty in case we ask for the last value because if there is no invoice created with the + * set up mask. + */ + if ($mode != 'last' && !$numref) { dol_print_error($db,"Facture::getNextNumRef ".$obj->error); return ""; } + + return $numref; } else { From bd21cf5d68c764f989e1fbea8a5125d0ca6c8290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 3 Sep 2015 11:58:20 +0200 Subject: [PATCH 2/8] Updated changelog --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0291eeb3a21..a612e867ecb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 3.6.4 compared to 3.6.3 ***** +- Fix: [ bug #2893 ] Dolibarr error when viewing an invoice after changing invoice mask + ***** ChangeLog for 3.6.3 compared to 3.6.2 ***** - Fix: ref_ext was not saved when recording a customer order from web service - Fix: amarok is a bugged theme making dolidroid failed. We switch to eldy automatically with dolidroid. @@ -43,6 +46,7 @@ English Dolibarr ChangeLog - Fix: Not showing product supplier reference when page break - Fix: [ bug #3341 ] Missing translation in /compta/paiement_charge.php - Fix: [ bug #3342 ] Taxes dictionary page does not accept localized decimals for localtax2 rate +- Fix: [ bug ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. From 7a115c9366ea56e2239738e4cc023d17d96d6876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Thu, 3 Sep 2015 11:59:46 +0200 Subject: [PATCH 3/8] Typo --- ChangeLog | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a612e867ecb..f83979aa8e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,7 +46,6 @@ English Dolibarr ChangeLog - Fix: Not showing product supplier reference when page break - Fix: [ bug #3341 ] Missing translation in /compta/paiement_charge.php - Fix: [ bug #3342 ] Taxes dictionary page does not accept localized decimals for localtax2 rate -- Fix: [ bug ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. From 8076ea85eab97f6c27859de0ed0b28f7ab8faf50 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 5 Sep 2015 20:07:17 +0200 Subject: [PATCH 4/8] 3.6.4 was packaged --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 73f3ae3e77a..0e23287ac31 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -29,7 +29,7 @@ * \brief File that include conf.php file and commons lib like functions.lib.php */ -if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.4'); +if (! defined('DOL_VERSION')) define('DOL_VERSION','3.6.5'); if (! defined('EURO')) define('EURO',chr(128)); // Define syslog constants From b268ccf064b453974ea197a013e3b46f7ee2b809 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 6 Sep 2015 04:52:03 +0200 Subject: [PATCH 5/8] Fix #3455 In advanced accounting module, button transfer to general ledger don't work --- .../accountancy/class/bookkeeping.class.php | 58 +++++++++++++++---- htdocs/accountancy/journal/bankjournal.php | 2 + .../accountancy/journal/purchasesjournal.php | 3 + htdocs/accountancy/journal/sellsjournal.php | 3 + 4 files changed, 54 insertions(+), 12 deletions(-) diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 9dcba514ae1..2e6c300d004 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2013-2014 Olivier Geffroy - * Copyright (C) 2013-2014 Alexandre Spangaro + * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * * This program is free software; you can redistribute it and/or modify @@ -225,6 +225,8 @@ class BookKeeping */ function create($user='') { + global $conf; + $this->piece_num = 0; // first check if line not yet in bookkeeping @@ -278,13 +280,45 @@ class BookKeeping $this->date_create = $now; } - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping (doc_date, "; - $sql .= "doc_type, doc_ref,fk_doc,fk_docdet,code_tiers,numero_compte,label_compte,"; - $sql .= "debit,credit,montant,sens,fk_user_author,import_key,code_journal,piece_num)"; - $sql .= " VALUES ('" . $this->doc_date . "','" . $this->doc_type . "','" . $this->doc_ref . "'," . $this->fk_doc . ","; - $sql .= $this->fk_docdet . ",'" . $this->code_tiers . "','" . $this->numero_compte . "','" . $this->db->escape($this->label_compte) . "',"; - $sql .= $this->debit . "," . $this->credit . "," . $this->montant . ",'" . $this->sens . "'," . $user->id . ", '"; - $sql .= $this->date_create . "','" . $this->code_journal . "'," . $this->piece_num . ")"; + $sql = "INSERT INTO " . MAIN_DB_PREFIX . "accounting_bookkeeping ("; + + $sql .= "doc_date"; + $sql .= ", doc_type"; + $sql .= ", doc_ref"; + $sql .= ", fk_doc"; + $sql .= ", fk_docdet"; + $sql .= ", code_tiers"; + $sql .= ", numero_compte"; + $sql .= ", label_compte"; + $sql .= ", debit"; + $sql .= ", credit"; + $sql .= ", montant"; + $sql .= ", sens"; + $sql .= ", fk_user_author"; + $sql .= ", import_key"; + $sql .= ", code_journal"; + $sql .= ", piece_num"; + + $sql .= ") VALUES ("; + + $sql .= "'" . $this->doc_date . "'"; + $sql .= ",'" . $this->doc_type . "'"; + $sql .= ",'" . $this->doc_ref . "'"; + $sql .= "," . $this->fk_doc; + $sql .= "," . $this->fk_docdet; + $sql .= ",'" . $this->code_tiers . "'"; + $sql .= ",'" . $this->numero_compte . "'"; + $sql .= ",'" . $this->db->escape($this->label_compte) . "'"; + $sql .= "," . $this->debit; + $sql .= "," . $this->credit; + $sql .= "," . $this->montant; + $sql .= ",'" . $this->sens . "'"; + $sql .= ",'" . $this->fk_user_author."'"; + $sql .= ",'" . $this->date_create . "'"; + $sql .= ",'" . $this->code_journal . "'"; + $sql .= "," . $this->piece_num; + + $sql .= ")"; dol_syslog(get_class($this) . ":: create sql=" . $sql, LOG_DEBUG); $resql = $this->db->query($sql); @@ -296,19 +330,19 @@ class BookKeeping $result = 0; } else { $result = - 2; - dol_syslog("BookKeeping::Create Erreur $result lecture ID"); + dol_syslog("BookKeeping::Create Error $result lecture ID"); } } else { $result = - 1; - dol_syslog("BookKeeping::Create Erreur $result INSERT Mysql"); + dol_syslog("BookKeeping::Create Error $result INSERT Mysql"); } } else { $result = - 3; - dol_syslog("BookKeeping::Create Erreur $result SELECT Mysql"); + dol_syslog("BookKeeping::Create Error $result SELECT Mysql"); } } else { $result = - 5; - dol_syslog("BookKeeping::Create Erreur $result SELECT Mysql"); + dol_syslog("BookKeeping::Create Error $result SELECT Mysql"); } return $result; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 8125f6ef14d..ac6317d9d1f 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -286,6 +286,7 @@ if ($action == 'writeBookKeeping') $bookkeeping->debit = ($mt >= 0 ? $mt : 0); $bookkeeping->credit = ($mt < 0 ? - $mt : 0); $bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL; + $bookkeeping->fk_user_author = $user->id; if ($tabtype[$key] == 'payment') { @@ -336,6 +337,7 @@ if ($action == 'writeBookKeeping') $bookkeeping->debit = ($mt < 0 ? - $mt : 0); $bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_BANK_JOURNAL; + $bookkeeping->fk_user_author = $user->id; if ($tabtype[$key] == 'sc') { $bookkeeping->code_tiers = ''; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 8b9b7929db8..705434365fa 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -177,6 +177,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->debit = ($mt <= 0) ? $mt : 0; $bookkeeping->credit = ($mt > 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; + $bookkeeping->fk_user_author = $user->id; $bookkeeping->create(); } @@ -202,6 +203,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; + $bookkeeping->fk_user_author = $user->id; $bookkeeping->create(); } @@ -228,6 +230,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->debit = ($mt > 0) ? $mt : 0; $bookkeeping->credit = ($mt <= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; + $bookkeeping->fk_user_author = $user->id; $bookkeeping->create(); } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index d80e8f36562..1dd6975ea34 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -188,6 +188,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->debit = ($mt >= 0) ? $mt : 0; $bookkeeping->credit = ($mt < 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; + $bookkeeping->fk_user_author = $user->id; $bookkeeping->create(); } @@ -213,6 +214,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->debit = ($mt < 0) ? $mt : 0; $bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; + $bookkeeping->fk_user_author = $user->id; $bookkeeping->create(); } @@ -238,6 +240,7 @@ if ($action == 'writebookkeeping') { $bookkeeping->debit = ($mt < 0) ? $mt : 0; $bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; + $bookkeeping->fk_user_author = $user->id; $bookkeeping->create(); } From a4a72d64c033a775d031628c500d503d0f436fe5 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sun, 6 Sep 2015 06:43:40 +0200 Subject: [PATCH 6/8] New: Accountancy Add message when general ledger is witten --- htdocs/accountancy/journal/bankjournal.php | 2 +- .../accountancy/journal/purchasesjournal.php | 23 ++++++++++++++++--- htdocs/accountancy/journal/sellsjournal.php | 23 ++++++++++++++++--- htdocs/langs/en_US/accountancy.lang | 3 ++- 4 files changed, 43 insertions(+), 8 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index ac6317d9d1f..c97cde97b14 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -402,7 +402,7 @@ if ($action == 'writeBookKeeping') } if (empty($error)) { - setEventMessage($langs->trans('Success'), 'mesgs'); + setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); } } // Export diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 705434365fa..14e77e20f3f 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -157,6 +157,7 @@ if ($result) { // Bookkeeping Write if ($action == 'writebookkeeping') { $now = dol_now(); + $error = 0; foreach ( $tabfac as $key => $val ) { foreach ( $tabttc[$key] as $k => $mt ) { @@ -179,7 +180,11 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->fk_user_author = $user->id; - $bookkeeping->create(); + $result = $bookkeeping->create(); + if ($result < 0) { + $error ++; + setEventMessage($object->errors, 'errors'); + } } // Product / Service @@ -205,7 +210,11 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->fk_user_author = $user->id; - $bookkeeping->create(); + $result = $bookkeeping->create(); + if ($result < 0) { + $error ++; + setEventMessage($object->errors, 'errors'); + } } } } @@ -232,10 +241,18 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $conf->global->ACCOUNTING_PURCHASE_JOURNAL; $bookkeeping->fk_user_author = $user->id; - $bookkeeping->create(); + $result = $bookkeeping->create(); + if ($result < 0) { + $error ++; + setEventMessage($object->errors, 'errors'); + } } } } + + if (empty($error)) { + setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + } } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 1dd6975ea34..9eb6d67f56b 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -170,6 +170,7 @@ if ($result) { // Bookkeeping Write if ($action == 'writebookkeeping') { $now = dol_now(); + $error = 0; foreach ( $tabfac as $key => $val ) { foreach ( $tabttc[$key] as $k => $mt ) { @@ -190,7 +191,11 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->fk_user_author = $user->id; - $bookkeeping->create(); + $result = $bookkeeping->create(); + if ($result < 0) { + $error ++; + setEventMessage($object->errors, 'errors'); + } } // Product / Service @@ -216,7 +221,11 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->fk_user_author = $user->id; - $bookkeeping->create(); + $result = $bookkeeping->create(); + if ($result < 0) { + $error ++; + setEventMessage($object->errors, 'errors'); + } } } } @@ -242,10 +251,18 @@ if ($action == 'writebookkeeping') { $bookkeeping->code_journal = $conf->global->ACCOUNTING_SELL_JOURNAL; $bookkeeping->fk_user_author = $user->id; - $bookkeeping->create(); + $result = $bookkeeping->create(); + if ($result < 0) { + $error ++; + setEventMessage($object->errors, 'errors'); + } } } } + + if (empty($error)) { + setEventMessage($langs->trans("GeneralLedgerIsWritten"),'mesgs'); + } } // Export if ($action == 'export_csv') { diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index b09dab7f764..57ce6b09201 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -157,4 +157,5 @@ ValidateHistory=Validate Automatically ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used -FicheVentilation=Breakdown card \ No newline at end of file +FicheVentilation=Breakdown card +GeneralLedgerIsWritten=Operations are written in the general ledger \ No newline at end of file From 89b723b2a778e1ba4c8d910840fda2e304c92e7f Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 8 Sep 2015 16:23:00 +0200 Subject: [PATCH 7/8] FIX : multientity warehouse management --- htdocs/core/modules/modStock.class.php | 2 +- htdocs/product/class/html.formproduct.class.php | 2 +- htdocs/product/stock/index.php | 4 ++-- htdocs/product/stock/list.php | 2 +- htdocs/product/stock/mouvement.php | 2 +- htdocs/product/stock/product.php | 2 +- htdocs/product/stock/valo.php | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index 43c7cec6fb3..8f6840a21b0 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -131,7 +131,7 @@ class modStock extends DolibarrModules $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e'; $this->export_sql_end[$r] .=' WHERE p.rowid = ps.fk_product AND ps.fk_entrepot = e.rowid'; - $this->export_sql_end[$r] .=' AND e.entity = '.$conf->entity; + $this->export_sql_end[$r] .=' AND e.entity IN ('.getEntity('stock',1).')'; // Imports diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 69e999b18ea..534e679814a 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -72,7 +72,7 @@ class FormProduct $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_entrepot = e.rowid"; $sql.= " AND ps.fk_product = '".$fk_product."'"; } - $sql.= " WHERE e.entity = ".$conf->entity; + $sql.= " WHERE e.entity IN (".getEntity('stock',1).')'; $sql.= " AND e.statut = 1"; $sql.= " ORDER BY e.label"; diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index dc394f898dc..5c149988cfe 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -63,7 +63,7 @@ print "
"; $sql = "SELECT e.label, e.rowid, e.statut"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " WHERE e.statut in (0,1)"; -$sql.= " AND e.entity = ".$conf->entity; +$sql.= " AND e.entity IN (".getEntity('stock',1).')'; $sql.= $db->order('e.statut','DESC'); $sql.= $db->plimit(15, 0); @@ -118,7 +118,7 @@ $sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; $sql.= ", ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE m.fk_product = p.rowid"; $sql.= " AND m.fk_entrepot = e.rowid"; -$sql.= " AND e.entity = ".$conf->entity; +$sql.= " AND e.entity IN (".getEntity('stock',1).')'; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0"; $sql.= $db->order("datem","DESC"); $sql.= $db->plimit($max,0); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index c85c501fa58..963974e1dd8 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -56,7 +56,7 @@ $sql.= " SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellv $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid"; -$sql.= " WHERE e.entity = ".$conf->entity; +$sql.= " WHERE e.entity IN (".getEntity('stock',1).')'; if ($sref) { $sql.= " AND e.label LIKE '%".$db->escape($sref)."%'"; diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index 5622899c052..39a6271d8cd 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -129,7 +129,7 @@ $sql.= " ".MAIN_DB_PREFIX."stock_mouvement as m)"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON m.fk_user_author = u.rowid"; $sql.= " WHERE m.fk_product = p.rowid"; $sql.= " AND m.fk_entrepot = e.rowid"; -$sql.= " AND e.entity = ".$conf->entity; +$sql.= " AND e.entity IN (".getEntity('stock',1).')'; if (empty($conf->global->STOCK_SUPPORTS_SERVICES)) $sql.= " AND p.fk_product_type = 0"; if ($id) { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 6dad4256aef..73d38fa16a4 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -687,7 +687,7 @@ $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,"; $sql.= " ".MAIN_DB_PREFIX."product_stock as ps"; $sql.= " WHERE ps.reel != 0"; $sql.= " AND ps.fk_entrepot = e.rowid"; -$sql.= " AND e.entity = ".$conf->entity; +$sql.= " AND e.entity IN (".getEntity('stock',1).')'; $sql.= " AND ps.fk_product = ".$product->id; $sql.= " ORDER BY e.label"; diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 6f5cb7ae578..7c73da3794c 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -56,7 +56,7 @@ $sql.= " SUM(ps.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sell $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid"; -$sql.= " WHERE e.entity = ".$conf->entity; +$sql.= " WHERE e.entity IN (".getEntity('stock',1).')'; if ($sref) { $sql.= " AND e.label LIKE '%".$db->escape($sref)."%'"; From 355fcc78cf2fae81ebcc8aea7a86fadea9f803be Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Tue, 8 Sep 2015 20:48:31 +0200 Subject: [PATCH 8/8] Fix #3475 RemiseCheque: Undefined variable $date --- htdocs/compta/paiement/cheque/class/remisecheque.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 917c88e0743..f469b48fdde 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2006 Rodolphe Quiedeville * Copyright (C) 2007-2011 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2011 Juanjo Menent + * Copyright (C) 2011-2015 Juanjo Menent * * 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 @@ -744,7 +744,6 @@ class RemiseCheque extends CommonObject $resql=$this->db->query($sql); if ($resql) { - $this->date_bordereau = $date; return 1; } else