From a4863ffa8976fe974c04e7fbd58c232f7b7f329d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 4 Mar 2012 18:38:28 +0100 Subject: [PATCH 1/3] Fix: missing compatibility --- htdocs/product/fiche.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index a6cb43e55e2..f6ce3c148b4 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -97,7 +97,7 @@ if (empty($reshook)) } // Barcode type - if ($action == 'setbarcodetype' && $user->rights->barcode->creer) + if ($action == 'setfk_barcode_type' && $user->rights->barcode->creer) { $object->fetch($id); $result = $object->setValueFrom('fk_barcode_type', $_POST['fk_barcode_type']); @@ -129,8 +129,6 @@ if (empty($reshook)) if ($action == 'setaccountancy_code_buy') { $object->fetch($id,$ref); - $product->accountancy_code_sell=$_POST["productaccountancycodesell"]; - $result=$product->update($product->id,$user,1,0,1); $result = $object->setValueFrom('accountancy_code_sell', $_POST['accountancy_code_sell']); if ($result < 0) { From 55f5e26b8589755fcfe87fd3b6587841ae52697e Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 4 Mar 2012 20:52:35 +0100 Subject: [PATCH 2/3] New: works on multi-currency --- .../mysql/tables/llx_exchange_rates.key.sql | 22 ++++++++++++++++ .../mysql/tables/llx_exchange_rates.sql | 26 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 htdocs/install/mysql/tables/llx_exchange_rates.key.sql create mode 100644 htdocs/install/mysql/tables/llx_exchange_rates.sql diff --git a/htdocs/install/mysql/tables/llx_exchange_rates.key.sql b/htdocs/install/mysql/tables/llx_exchange_rates.key.sql new file mode 100644 index 00000000000..d9a551ca007 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_exchange_rates.key.sql @@ -0,0 +1,22 @@ +-- =================================================================== +-- Copyright (C) 2012 Regis Houssin +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =================================================================== + + +ALTER TABLE llx_exchange_rates ADD INDEX idx_exchange_rates_fk_currency (fk_currency); + +ALTER TABLE llx_exchange_rates ADD CONSTRAINT fk_exchange_rates_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code); diff --git a/htdocs/install/mysql/tables/llx_exchange_rates.sql b/htdocs/install/mysql/tables/llx_exchange_rates.sql new file mode 100644 index 00000000000..01d03598daf --- /dev/null +++ b/htdocs/install/mysql/tables/llx_exchange_rates.sql @@ -0,0 +1,26 @@ +-- ============================================================================ +-- Copyright (C) 2012 Regis Houssin +-- +-- 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 +-- the Free Software Foundation; either version 2 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program. If not, see . +-- +-- =========================================================================== + +create table llx_exchange_rates +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + fk_currency varchar(2) NOT NULL, + rates text NOT NULL, + date datetime, + +)ENGINE=innodb; From cbbe00e03f936ccb11aed7ea58dcdeb10631ba0d Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sun, 4 Mar 2012 21:19:34 +0100 Subject: [PATCH 3/3] Fix: move to an external module --- .../mysql/tables/llx_exchange_rates.key.sql | 22 ---------------- .../mysql/tables/llx_exchange_rates.sql | 26 ------------------- 2 files changed, 48 deletions(-) delete mode 100644 htdocs/install/mysql/tables/llx_exchange_rates.key.sql delete mode 100644 htdocs/install/mysql/tables/llx_exchange_rates.sql diff --git a/htdocs/install/mysql/tables/llx_exchange_rates.key.sql b/htdocs/install/mysql/tables/llx_exchange_rates.key.sql deleted file mode 100644 index d9a551ca007..00000000000 --- a/htdocs/install/mysql/tables/llx_exchange_rates.key.sql +++ /dev/null @@ -1,22 +0,0 @@ --- =================================================================== --- Copyright (C) 2012 Regis Houssin --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- =================================================================== - - -ALTER TABLE llx_exchange_rates ADD INDEX idx_exchange_rates_fk_currency (fk_currency); - -ALTER TABLE llx_exchange_rates ADD CONSTRAINT fk_exchange_rates_fk_currency FOREIGN KEY (fk_currency) REFERENCES llx_c_currencies (code); diff --git a/htdocs/install/mysql/tables/llx_exchange_rates.sql b/htdocs/install/mysql/tables/llx_exchange_rates.sql deleted file mode 100644 index 01d03598daf..00000000000 --- a/htdocs/install/mysql/tables/llx_exchange_rates.sql +++ /dev/null @@ -1,26 +0,0 @@ --- ============================================================================ --- Copyright (C) 2012 Regis Houssin --- --- 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 --- the Free Software Foundation; either version 2 of the License, or --- (at your option) any later version. --- --- This program is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with this program. If not, see . --- --- =========================================================================== - -create table llx_exchange_rates -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_currency varchar(2) NOT NULL, - rates text NOT NULL, - date datetime, - -)ENGINE=innodb;