From aa377865963220c73bf2d5d6659a190cb8f3806d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 26 Jun 2018 11:51:49 +0200 Subject: [PATCH 1/9] Fix migration errors reported by Softaculous --- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 7 ++++--- htdocs/install/mysql/tables/llx_website_account.key.sql | 3 ++- htdocs/install/mysql/tables/llx_website_page.sql | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index ee4fd5f15b4af..61e829d5028a3 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -298,6 +298,7 @@ ALTER TABLE llx_website_account ADD INDEX idx_website_account_login (login); ALTER TABLE llx_website_account ADD INDEX idx_website_account_import_key (import_key); ALTER TABLE llx_website_account ADD INDEX idx_website_account_status (status); ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_soc (fk_soc); +ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_website (fk_website); ALTER TABLE llx_website_account ADD UNIQUE INDEX uk_website_account_login_website_soc(login, fk_website, fk_soc); @@ -474,7 +475,7 @@ ALTER TABLE llx_extrafields MODIFY COLUMN list integer DEFAULT 1; ALTER TABLE llx_extrafields MODIFY COLUMN langs varchar(64); -ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128); +ALTER TABLE llx_holiday_config MODIFY COLUMN name varchar(128) NOT NULL; ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (name); ALTER TABLE llx_societe MODIFY COLUMN ref_ext varchar(255); @@ -670,9 +671,9 @@ ALTER TABLE llx_blockedlog ADD COLUMN user_fullname varchar(255); ALTER TABLE llx_blockedlog MODIFY COLUMN ref_object varchar(255); -- SPEC : use database type 'double' to store monetary values -ALTER TABLE llx_blockedlog MODIFY COLUMN amounts double(24,8); +ALTER TABLE llx_blockedlog MODIFY COLUMN amounts double(24,8) NOT NULL; ALTER TABLE llx_chargessociales MODIFY COLUMN amount double(24,8); -ALTER TABLE llx_commande MODIFY COLUMN amount_ht double(24,8); +ALTER TABLE llx_commande MODIFY COLUMN amount_ht double(24,8) default 0; ALTER TABLE llx_commande_fournisseur MODIFY COLUMN amount_ht double(24,8); ALTER TABLE llx_don MODIFY COLUMN amount double(24,8); ALTER TABLE llx_expensereport_rules MODIFY COLUMN amount double(24,8); diff --git a/htdocs/install/mysql/tables/llx_website_account.key.sql b/htdocs/install/mysql/tables/llx_website_account.key.sql index 1302ec50d2c4c..2114d3c0f8509 100644 --- a/htdocs/install/mysql/tables/llx_website_account.key.sql +++ b/htdocs/install/mysql/tables/llx_website_account.key.sql @@ -17,9 +17,10 @@ -- BEGIN MODULEBUILDER INDEXES ALTER TABLE llx_website_account ADD INDEX idx_website_account_rowid (rowid); ALTER TABLE llx_website_account ADD INDEX idx_website_account_login (login); +ALTER TABLE llx_website_account ADD INDEX idx_website_account_import_key (import_key); ALTER TABLE llx_website_account ADD INDEX idx_website_account_status (status); -ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_website (fk_website); ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_soc (fk_soc); +ALTER TABLE llx_website_account ADD INDEX idx_website_account_fk_website (fk_website); -- END MODULEBUILDER INDEXES ALTER TABLE llx_website_account ADD UNIQUE INDEX uk_website_account_login_website_soc(login, fk_website, fk_soc); diff --git a/htdocs/install/mysql/tables/llx_website_page.sql b/htdocs/install/mysql/tables/llx_website_page.sql index 5393177a3bb8a..e6d7616ab4e38 100644 --- a/htdocs/install/mysql/tables/llx_website_page.sql +++ b/htdocs/install/mysql/tables/llx_website_page.sql @@ -21,6 +21,7 @@ CREATE TABLE llx_website_page ( rowid integer AUTO_INCREMENT NOT NULL PRIMARY KEY, fk_website integer NOT NULL, + type_container varchar(16) NOT NULL DEFAULT 'page', pageurl varchar(255) NOT NULL, title varchar(255), description varchar(255), From ed2ec78332d2161079f2a26ad0f56d8d271dd6bb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jun 2018 11:53:52 +0200 Subject: [PATCH 2/9] FIX combo of stock in popup are crazy in IE --- htdocs/fourn/commande/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 9783fc9911ed0..ce89f379b15c1 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1740,11 +1740,13 @@ $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; $formproduct=new FormProduct($db); + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy $formquestion=array( //'text' => $langs->trans("ConfirmClone"), //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1)) + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse','int'), 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) ); } $text=$langs->trans("ConfirmApproveThisOrder",$object->ref); From da138db528a93f2545df81bd4af61491f2cf2253 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 28 Jun 2018 12:05:02 +0200 Subject: [PATCH 3/9] FIX combo into popup become crazy with IE10 Conflicts: htdocs/asset/card.php htdocs/modulebuilder/template/myobject_card.php --- htdocs/commande/card.php | 39 ++++++++++--------- htdocs/compta/facture/card.php | 13 ++++--- htdocs/fourn/commande/card.php | 6 +-- .../modulebuilder/template/myobject_card.php | 17 ++++---- htdocs/product/inventory/card.php | 14 ------- htdocs/website/websiteaccount_card.php | 14 ------- 6 files changed, 41 insertions(+), 62 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 9f55311444ba1..27fc1821a03d9 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1850,13 +1850,14 @@ $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' - // => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), - // 'value' => 1), - array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockDecrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1))); + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockDecrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse','int')?GETPOST('idwarehouse','int'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + ); } $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220); @@ -1882,13 +1883,14 @@ $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' - // => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), - // 'value' => 1), - array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1))); + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + ); } $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220); @@ -1923,13 +1925,14 @@ $langs->load("stocks"); require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' - // => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), - // 'value' => 1), - array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1))); + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + ); } $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Cancel'), $text, 'confirm_cancel', $formquestion, 0, 1); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 055a100848a36..e846b47cb4ea8 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3064,13 +3064,14 @@ require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php'; $formproduct = new FormProduct($db); $label = $object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("SelectWarehouseForStockDecrease") : $langs->trans("SelectWarehouseForStockIncrease"); + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => - // 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' - // => 1), - array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction")))); + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction"), 0, $forcecombo)) + ); $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1); } else { $formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', '', 1); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index ce89f379b15c1..a6629b9bd2513 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1743,9 +1743,9 @@ $forcecombo=0; if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy $formquestion=array( - //'text' => $langs->trans("ConfirmClone"), - //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + //'text' => $langs->trans("ConfirmClone"), + //array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + //array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockIncrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse','int'), 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) ); } diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index c4f92994d7a33..3244b44d057c7 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -243,14 +243,17 @@ function init_myfunc() // Confirmation of action xxxx if ($action == 'xxx') { - $formquestion=array(); + $formquestion=array(); /* - $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1))); - }*/ + $forcecombo=0; + if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy + $formquestion = array( + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), + // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + ); + */ $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); } diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index aaba9e8cdfe8b..f7044cc35dae4 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -223,20 +223,6 @@ function init_myfunc() $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1); } - // Confirmation of action xxxx - if ($action == 'xxx') - { - $formquestion=array(); - /* - $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1))); - }*/ - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); - } - if (! $formconfirm) { $parameters = array('lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 9918b0b30227a..037737533b20a 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -233,20 +233,6 @@ function init_myfunc() $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteWebsiteAccount'), $langs->trans('ConfirmDeleteWebsiteAccount'), 'confirm_delete', '', 0, 1); } - // Confirmation of action xxxx - if ($action == 'xxx') - { - $formquestion=array(); - /* - $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1))); - }*/ - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220); - } - if (! $formconfirm) { $parameters = array('lineid' => $lineid); $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook From 7ebf54fbead8bae82238a754d1a26262baff162f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 28 Jun 2018 12:54:19 +0200 Subject: [PATCH 4/9] Fix : division by 0 on homepage if nothing to do --- htdocs/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/index.php b/htdocs/index.php index b01e37927c49c..4d4ebb03cb9a7 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -526,7 +526,7 @@ } } //var_dump($totallate, $totaltodo); -if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $totallate = round($totallate / $totaltodo * 100, 2); +if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) && !empty($totaltodo)) $totallate = round($totallate / $totaltodo * 100, 2); //var_dump($totallate); $boxwork=''; $boxwork.='
'; From 2175a012e1f18ddfd63da161cbde7a83bea1c0fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Jun 2018 18:23:59 +0200 Subject: [PATCH 5/9] Fix lang --- htdocs/core/class/CMailFile.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 6dbc622032d46..fe8ca1f235200 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -613,6 +613,7 @@ function sendfile() if (! $res) { + $langs->load("errors"); $this->error="Failed to send mail with php mail"; $linuxlike=1; if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; From ca8144c5eaf1fda2fefa3d26f12cc9a275d4ac1a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Jun 2018 19:08:35 +0200 Subject: [PATCH 6/9] Fix error message --- htdocs/hrm/index.php | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 2f360dce5c548..58a681693e1a0 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -36,38 +36,35 @@ if ($conf->expensereport->enabled) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; -$langs->load('users'); -$langs->load('holidays'); -$langs->load('trips'); +$langs->loadLangs(array('users','holidays','trips')); -$socid=GETPOST("socid"); +$socid=GETPOST("socid","int"); // Protection if external user if ($user->societe_id > 0) accessforbidden(); +if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1; + +$holiday = new Holiday($db); +$holidaystatic=new Holiday($db); + /* * Actions */ -// None - +// Update sold +if (! empty($conf->holiday->enabled) && ! empty($setupcompanynotcomplete)) +{ + $result = $holiday->updateBalance(); +} /* * View */ -$holiday = new Holiday($db); -$holidaystatic=new Holiday($db); - -// Update sold -if (! empty($conf->holiday->enabled)) -{ - $result = $holiday->updateBalance(); -} - $childids = $user->getAllChildIds(); $childids[]=$user->id; @@ -76,13 +73,13 @@ print load_fiche_titre($langs->trans("HRMArea"),'', 'title_hrm.png'); -if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1; if (! empty($setupcompanynotcomplete)) { $langs->load("errors"); $warnpicto=img_warning($langs->trans("WarningMandatorySetupNotComplete")); print '
'; + llxFooter(); exit; } From 932ff0be183b6a3ca3a1ab9c28f5a9dff5083539 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 29 Jun 2018 19:16:29 +0200 Subject: [PATCH 7/9] Trans --- htdocs/langs/en_US/compta.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index e476c95112325..e60572a40451d 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -76,7 +76,7 @@ MenuNewSocialContribution=New social/fiscal tax NewSocialContribution=New social/fiscal tax AddSocialContribution=Add social/fiscal tax ContributionsToPay=Social/fiscal taxes to pay -AccountancyTreasuryArea=Accountancy/Treasury area +AccountancyTreasuryArea=Billing and payment area NewPayment=New payment Payments=Payments PaymentCustomerInvoice=Customer invoice payment From 11021353da7da3d57bd347a9fbc1e539c62934ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jul 2018 11:33:33 +0200 Subject: [PATCH 8/9] Fix text in payment area of crabe pdf --- htdocs/compta/facture/card.php | 2 +- htdocs/core/class/commoninvoice.class.php | 2 +- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 10 ++++++---- htdocs/langs/en_US/bills.lang | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e846b47cb4ea8..1d22d21d574fd 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -4376,7 +4376,7 @@ function js_recalculate_revenuestamp(){ if ($objectidnext) { print '
' . $langs->trans('DoPayment') . '
'; } else { - //if ($resteapayer == 0) { + //if ($resteapayer == 0) { // Sometimes we can receive more, so we accept to enter more and will offer a button to convert into discount (but it is not a credit note, just a prepayment done) // print '
' . $langs->trans('DoPayment') . '
'; //} else { print ''; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index ac5d3869a3dec..af9d694e5e6a3 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -173,7 +173,7 @@ function getSumDepositsUsed($multicurrency=0) } /** - * Return amount (with tax) of all credit notes and deposits invoices used by invoice + * Return amount (with tax) of all credit notes invoices + excess received used by invoice * * @param int $multicurrency Return multicurrency_amount instead of amount * @return int <0 if KO, Sum of credit notes and deposits amount otherwise diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 8050abf811b23..8b316e29dca71 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -780,7 +780,7 @@ function _tableau_versements(&$pdf, $object, $posy, $outputlangs) $pdf->SetFont('','', $default_font_size - 4); - // Loop on each deposits and credit notes included + // Loop on each discount available (deposits and credit notes and excess of payment included) $sql = "SELECT re.rowid, re.amount_ht, re.multicurrency_amount_ht, re.amount_tva, re.multicurrency_amount_tva, re.amount_ttc, re.multicurrency_amount_ttc,"; $sql.= " re.description, re.fk_facture_source,"; $sql.= " f.type, f.datef"; @@ -799,6 +799,7 @@ function _tableau_versements(&$pdf, $object, $posy, $outputlangs) if ($obj->type == 2) $text=$outputlangs->trans("CreditNote"); elseif ($obj->type == 3) $text=$outputlangs->trans("Deposit"); + elseif ($obj->type == 0) $text=$outputlangs->trans("ExcessReceived"); else $text=$outputlangs->trans("UnknownType"); $invoice->fetch($obj->fk_facture_source); @@ -1289,7 +1290,7 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) $pdf->SetTextColor(0,0,0); - $creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); + $creditnoteamount=$object->getSumCreditNotesUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received $depositsamount=$object->getSumDepositsUsed(($conf->multicurrency->enabled && $object->multicurrency_tx != 1) ? 1 : 0); //print "x".$creditnoteamount."-".$depositsamount;exit; $resteapayer = price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'); @@ -1307,9 +1308,10 @@ function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) // Credit note if ($creditnoteamount) { + $labeltouse = ($outputlangs->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangs->transnoentities("CreditNotesOrExcessReceived") : $outputlangs->transnoentities("CreditNotes"); $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0); + $pdf->MultiCell($col2x-$col1x, $tab2_hl, $labeltouse, 0, 'L', 0); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); } @@ -1688,7 +1690,7 @@ function _pagehead(&$pdf, $object, $showaddress, $outputlangs) { $top_shift = $pdf->getY() - $current_y; } - + if ($showaddress) { // Sender properties diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 3e5aaca519826..1bcebb8c890c2 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -279,6 +279,7 @@ RelativeDiscount=Relative discount GlobalDiscount=Global discount CreditNote=Credit note CreditNotes=Credit notes +CreditNotesOrExcessReceived=Credit notes or excess received Deposit=Down payment Deposits=Down payments DiscountFromCreditNote=Discount from credit note %s From af21222c3050be4630ca2ca9bf31f57134e33e12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 2 Jul 2018 11:47:04 +0200 Subject: [PATCH 9/9] Fix translation --- htdocs/langs/fr_FR/bills.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 9f2f21fbe7764..1f5c33c2ef9dd 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -282,6 +282,7 @@ RelativeDiscount=Remise relative GlobalDiscount=Ligne de déduction CreditNote=Avoir CreditNotes=Avoirs +CreditNotesOrExcessReceived=Avoirs ou trop perçus Deposit=Acompte Deposits=Acomptes DiscountFromCreditNote=Remise issue de l'avoir %s