';
print ''.$langs->trans("MAIN_OPTIMIZEFORTEXTBROWSER").' ';
print '';
+ //print ajax_constantonoff("MAIN_OPTIMIZEFORTEXTBROWSER", array(), null, 0, 0, 1, 0);
if ($edit)
{
print $form->selectyesno('MAIN_OPTIMIZEFORTEXTBROWSER', $fuser->conf->MAIN_OPTIMIZEFORTEXTBROWSER, 1);
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index 332e33ece59..07059830e6a 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -1,12 +1,13 @@
- * Copyright (C) 2006-2011 Laurent Destailleur
- * Copyright (C) 2009-2014 Regis Houssin
- * Copyright (C) 2011 Juanjo Menent
- * Copyright (C) 2012 Christophe Battarel
- * Copyright (C) 2015 Marcos García
- * Copyright (C) 2016 Charlie Benke
- * Copyright (C) 2019 Frédéric France
+/* Copyright (C) 2005 Rodolphe Quiedeville
+ * Copyright (C) 2006-2011 Laurent Destailleur
+ * Copyright (C) 2009-2014 Regis Houssin
+ * Copyright (C) 2011 Juanjo Menent
+ * Copyright (C) 2012 Christophe Battarel
+ * Copyright (C) 2015 Marcos García
+ * Copyright (C) 2016 Charlie Benke
+ * Copyright (C) 2019 Frédéric France
+ * Copyright (C) 2020 Pierre Ardoin
*
* 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
@@ -605,7 +606,7 @@ class ProductFournisseur extends Product
global $conf;
$sql = "SELECT s.nom as supplier_name, s.rowid as fourn_id,";
- $sql .= " pfp.rowid as product_fourn_pri_id, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,";
+ $sql .= " pfp.rowid as product_fourn_pri_id, pfp.entity, pfp.ref_fourn, pfp.desc_fourn, pfp.fk_product as product_fourn_id, pfp.fk_supplier_price_expression,";
$sql .= " pfp.price, pfp.quantity, pfp.unitprice, pfp.remise_percent, pfp.remise, pfp.tva_tx, pfp.fk_availability, pfp.charges, pfp.info_bits, pfp.delivery_time_days, pfp.supplier_reputation,";
$sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code, pfp.datec, pfp.tms,";
$sql .= " pfp.barcode, pfp.fk_barcode_type";
@@ -632,6 +633,7 @@ class ProductFournisseur extends Product
$prodfourn->product_fourn_price_id = $record["product_fourn_pri_id"];
$prodfourn->product_fourn_id = $record["product_fourn_id"];
+ $prodfourn->product_fourn_entity = $record["entity"];
$prodfourn->fourn_ref = $record["ref_fourn"];
$prodfourn->ref_supplier = $record["ref_fourn"];
$prodfourn->desc_supplier = $record["desc_fourn"];
diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
index f5c4dee3f15..892c2a94f5f 100644
--- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
+++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql
@@ -200,3 +200,6 @@ ALTER TABLE llx_entrepot ADD COLUMN phone varchar(20) DEFAULT NULL;
ALTER TABLE llx_accounting_account ADD COLUMN reconcilable tinyint DEFAULT 0 NOT NULL after active;
ALTER TABLE llx_categorie MODIFY type integer NOT NULL DEFAULT 1;
+
+ALTER TABLE llx_societe_remise_except ADD COLUMN vat_src_code varchar(10) DEFAULT '';
+
diff --git a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql
index 750b40cb73c..22a0e241dd6 100644
--- a/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql
+++ b/htdocs/install/mysql/tables/llx_commande_fournisseur_dispatch.sql
@@ -31,7 +31,7 @@ create table llx_commande_fournisseur_dispatch
fk_entrepot integer,
fk_user integer,
comment varchar(255), -- comment on movement
- batch varchar(30) DEFAULT NULL,
+ batch varchar(128) DEFAULT NULL,
eatby date DEFAULT NULL,
sellby date DEFAULT NULL,
status integer,
diff --git a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql
index af3a261e893..7a6a3bfd777 100644
--- a/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql
+++ b/htdocs/install/mysql/tables/llx_expeditiondet_batch.sql
@@ -20,7 +20,7 @@ CREATE TABLE llx_expeditiondet_batch (
fk_expeditiondet int NOT NULL,
eatby date DEFAULT NULL,
sellby date DEFAULT NULL,
- batch varchar(30) DEFAULT NULL,
+ batch varchar(128) DEFAULT NULL,
qty double NOT NULL DEFAULT '0',
fk_origin_stock integer NOT NULL
) ENGINE=InnoDB;
diff --git a/htdocs/install/mysql/tables/llx_inventorydet.sql b/htdocs/install/mysql/tables/llx_inventorydet.sql
index c70a2909882..b4df529433e 100644
--- a/htdocs/install/mysql/tables/llx_inventorydet.sql
+++ b/htdocs/install/mysql/tables/llx_inventorydet.sql
@@ -25,7 +25,7 @@ tms timestamp,
fk_inventory integer DEFAULT 0,
fk_warehouse integer DEFAULT 0,
fk_product integer DEFAULT 0,
-batch varchar(30) DEFAULT NULL, -- Lot or serial number
+batch varchar(128) DEFAULT NULL, -- Lot or serial number
qty_stock double DEFAULT NULL, -- The targeted value. can be filled during draft edition
qty_view double DEFAULT NULL, -- must be filled once regulation is done
qty_regulated double DEFAULT NULL -- must be filled once regulation is done
diff --git a/htdocs/install/mysql/tables/llx_mrp_production.sql b/htdocs/install/mysql/tables/llx_mrp_production.sql
index 78b8847d9de..509d78a5c0e 100644
--- a/htdocs/install/mysql/tables/llx_mrp_production.sql
+++ b/htdocs/install/mysql/tables/llx_mrp_production.sql
@@ -23,7 +23,7 @@ CREATE TABLE llx_mrp_production(
qty real NOT NULL DEFAULT 1,
qty_frozen smallint DEFAULT 0,
disable_stock_change smallint DEFAULT 0,
- batch varchar(30),
+ batch varchar(128),
role varchar(10), -- 'toconsume' or 'toproduce' (initialized at MO creation), 'consumed' or 'produced' (added after MO validation)
fk_mrp_production integer, -- if role = 'consumed', id of line with role 'toconsume', if role = 'produced' id of line with role 'toproduce'
fk_stock_movement integer, -- id of stock movement when movements are validated
diff --git a/htdocs/install/mysql/tables/llx_product_batch.sql b/htdocs/install/mysql/tables/llx_product_batch.sql
index ba8b7ff59e4..7b09d6a0024 100644
--- a/htdocs/install/mysql/tables/llx_product_batch.sql
+++ b/htdocs/install/mysql/tables/llx_product_batch.sql
@@ -24,7 +24,7 @@ CREATE TABLE llx_product_batch (
fk_product_stock integer NOT NULL,
eatby datetime DEFAULT NULL, -- deprecated. should not be used here but should be stored into a table llx_product_lot
sellby datetime DEFAULT NULL, -- deprecated. should not be used here but should be stored into a table llx_product_lot
- batch varchar(30) NOT NULL,
+ batch varchar(128) NOT NULL,
qty double NOT NULL DEFAULT 0,
import_key varchar(14) DEFAULT NULL
) ENGINE=InnoDB;
diff --git a/htdocs/install/mysql/tables/llx_product_lot.sql b/htdocs/install/mysql/tables/llx_product_lot.sql
index 493a8792f20..885f699d800 100644
--- a/htdocs/install/mysql/tables/llx_product_lot.sql
+++ b/htdocs/install/mysql/tables/llx_product_lot.sql
@@ -21,7 +21,7 @@ CREATE TABLE llx_product_lot (
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1,
fk_product integer NOT NULL, -- Id of product
- batch varchar(30) DEFAULT NULL, -- Lot or serial number
+ batch varchar(128) DEFAULT NULL, -- Lot or serial number
eatby date DEFAULT NULL, -- Eatby date
sellby date DEFAULT NULL, -- Sellby date
datec datetime,
diff --git a/htdocs/install/mysql/tables/llx_societe_remise_except.sql b/htdocs/install/mysql/tables/llx_societe_remise_except.sql
index 50cbfae51c1..63762f8ad32 100644
--- a/htdocs/install/mysql/tables/llx_societe_remise_except.sql
+++ b/htdocs/install/mysql/tables/llx_societe_remise_except.sql
@@ -30,6 +30,7 @@ create table llx_societe_remise_except
amount_tva double(24,8) DEFAULT 0 NOT NULL,
amount_ttc double(24,8) DEFAULT 0 NOT NULL,
tva_tx double(6,3) DEFAULT 0 NOT NULL,
+ vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.
fk_user integer NOT NULL,
fk_facture_line integer,
fk_facture integer,
diff --git a/htdocs/install/mysql/tables/llx_stock_mouvement.sql b/htdocs/install/mysql/tables/llx_stock_mouvement.sql
index 397165e296c..94501a516dd 100644
--- a/htdocs/install/mysql/tables/llx_stock_mouvement.sql
+++ b/htdocs/install/mysql/tables/llx_stock_mouvement.sql
@@ -21,9 +21,9 @@ create table llx_stock_mouvement
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
- datem datetime, -- Date and hour of movement
+ datem datetime, -- Date and hour of movement
fk_product integer NOT NULL, -- Id of product
- batch varchar(30) DEFAULT NULL, -- Lot or serial number
+ batch varchar(128) DEFAULT NULL, -- Lot or serial number
eatby date DEFAULT NULL, -- Eatby date (deprecated, we should get value from batch number in table llx_product_lot)
sellby date DEFAULT NULL, -- Sellby date (deprecated, we should get value from batch number in table llx_product_lot)
fk_entrepot integer NOT NULL, -- Id warehouse
diff --git a/htdocs/langs/en_US/multicurrency.lang b/htdocs/langs/en_US/multicurrency.lang
index 4dc04ff2622..bfcbd11fb7c 100644
--- a/htdocs/langs/en_US/multicurrency.lang
+++ b/htdocs/langs/en_US/multicurrency.lang
@@ -18,3 +18,5 @@ MulticurrencyReceived=Received, original currency
MulticurrencyRemainderToTake=Remaining amount, original currency
MulticurrencyPaymentAmount=Payment amount, original currency
AmountToOthercurrency=Amount To (in currency of receiving account)
+CurrencyRateSyncSucceed=Currency rate synchronization done successfuly
+MULTICURRENCY_USE_CURRENCY_ON_DOCUMENT=Use the currency of the document for online payments
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 8d3812d5553..400ad73fad2 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1969,51 +1969,57 @@ function top_menu_bookmark()
include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php';
$langs->load("bookmarks");
- $html .= '
- ';
+ if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+ $html .= '';
+ } else {
+ $html .= '
+ ';
- $html .= '
-
-
- ';
+ });
+
+ ';
+ }
}
return $html;
}
diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php
index d3b589fe88a..2085678f583 100644
--- a/htdocs/multicurrency/class/multicurrency.class.php
+++ b/htdocs/multicurrency/class/multicurrency.class.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2007-2020 Laurent Destailleur
* Copyright (C) 2014 Juanjo Menent
* Copyright (C) 2015 Florian Henry
* Copyright (C) 2015 Raphaël Doursenaud
@@ -29,6 +29,7 @@
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT .'/core/class/commonobjectline.class.php';
+
/**
* Class Currency
*
@@ -92,6 +93,7 @@ class MultiCurrency extends CommonObject
*/
public $rate;
+
/**
* Constructor
*
@@ -99,7 +101,7 @@ class MultiCurrency extends CommonObject
*/
public function __construct(DoliDB $db)
{
- $this->db = &$db;
+ $this->db = $db;
return 1;
}
@@ -107,16 +109,15 @@ class MultiCurrency extends CommonObject
/**
* Create object into database
*
- * @param User $user User that creates
- * @param bool $trigger true=launch triggers after, false=disable triggers
- *
- * @return int <0 if KO, Id of created object if OK
+ * @param User $user User that creates
+ * @param bool $trigger true=launch triggers after, false=disable triggers
+ * @return int <0 if KO, Id of created object if OK
*/
public function create(User $user, $trigger = true)
{
global $conf,$langs;
- dol_syslog('Currency::create', LOG_DEBUG);
+ dol_syslog('MultiCurrency::create', LOG_DEBUG);
$error = 0;
@@ -152,7 +153,7 @@ class MultiCurrency extends CommonObject
if (!$resql) {
$error ++;
$this->errors[] = 'Error ' . $this->db->lasterror();
- dol_syslog('Currency::create ' . join(',', $this->errors), LOG_ERR);
+ dol_syslog('MultiCurrency::create ' . join(',', $this->errors), LOG_ERR);
}
if (!$error) {
@@ -180,14 +181,13 @@ class MultiCurrency extends CommonObject
/**
* Load object in memory from the database
*
- * @param int $id Id object
- * @param string $code code
- *
- * @return int <0 if KO, 0 if not found, >0 if OK
+ * @param int $id Id object
+ * @param string $code code
+ * @return int <0 if KO, 0 if not found, >0 if OK
*/
public function fetch($id, $code = null)
{
- dol_syslog('Currency::fetch', LOG_DEBUG);
+ dol_syslog('MultiCurrency::fetch', LOG_DEBUG);
global $conf;
@@ -224,7 +224,7 @@ class MultiCurrency extends CommonObject
}
} else {
$this->errors[] = 'Error ' . $this->db->lasterror();
- dol_syslog('Currency::fetch ' . join(',', $this->errors), LOG_ERR);
+ dol_syslog('MultiCurrency::fetch ' . join(',', $this->errors), LOG_ERR);
return -1;
}
@@ -260,7 +260,7 @@ class MultiCurrency extends CommonObject
return $num;
} else {
$this->errors[] = 'Error ' . $this->db->lasterror();
- dol_syslog('Currency::fetchAllCurrencyRate ' . join(',', $this->errors), LOG_ERR);
+ dol_syslog('MultiCurrency::fetchAllCurrencyRate ' . join(',', $this->errors), LOG_ERR);
return - 1;
}
@@ -269,16 +269,15 @@ class MultiCurrency extends CommonObject
/**
* Update object into database
*
- * @param User $user User that modifies
- * @param bool $trigger true=launch triggers after, false=disable triggers
- *
- * @return int <0 if KO, >0 if OK
+ * @param User $user User that modifies
+ * @param bool $trigger true=launch triggers after, false=disable triggers
+ * @return int <0 if KO, >0 if OK
*/
public function update(User $user, $trigger = true)
{
$error = 0;
- dol_syslog('Currency::update', LOG_DEBUG);
+ dol_syslog('MultiCurrency::update', LOG_DEBUG);
// Clean parameters
$this->name = trim($this->name);
@@ -287,7 +286,7 @@ class MultiCurrency extends CommonObject
// Check parameters
if (empty($this->code)) {
$error++;
- dol_syslog('Currency::update $this->code can not be empty', LOG_ERR);
+ dol_syslog('MultiCurrency::update $this->code can not be empty', LOG_ERR);
return -1;
}
@@ -298,14 +297,13 @@ class MultiCurrency extends CommonObject
$sql .= ' code=\''.$this->db->escape($this->code).'\'';
$sql .= ' WHERE rowid=' . $this->id;
- dol_syslog(__METHOD__, LOG_DEBUG);
$this->db->begin();
$resql = $this->db->query($sql);
if (!$resql) {
$error ++;
$this->errors[] = 'Error ' . $this->db->lasterror();
- dol_syslog('Currency::update ' . join(',', $this->errors), LOG_ERR);
+ dol_syslog('MultiCurrency::update ' . join(',', $this->errors), LOG_ERR);
}
if (!$error && $trigger) {
@@ -329,14 +327,13 @@ class MultiCurrency extends CommonObject
* Delete object in database
*
* @param bool $trigger true=launch triggers after, false=disable triggers
- *
* @return int <0 if KO, >0 if OK
*/
public function delete($trigger = true)
{
global $user;
- dol_syslog('Currency::delete', LOG_DEBUG);
+ dol_syslog('MultiCurrency::delete', LOG_DEBUG);
$error = 0;
@@ -363,7 +360,7 @@ class MultiCurrency extends CommonObject
if (!$resql) {
$error ++;
$this->errors[] = 'Error ' . $this->db->lasterror();
- dol_syslog('Currency::delete ' . join(',', $this->errors), LOG_ERR);
+ dol_syslog('MultiCurrency::delete ' . join(',', $this->errors), LOG_ERR);
}
}
@@ -398,16 +395,15 @@ class MultiCurrency extends CommonObject
}
/**
- * Delete rate in database
+ * Add a Rate into database
*
* @param double $rate rate value
- *
- * @return int -1 if KO, 1 if OK
+ * @return int -1 if KO, 1 if OK
*/
public function addRate($rate)
{
$currencyRate = new CurrencyRate($this->db);
- $currencyRate->rate = $rate;
+ $currencyRate->rate = price2num($rate);
if ($currencyRate->create($this->id) > 0)
{
@@ -427,7 +423,6 @@ class MultiCurrency extends CommonObject
*
* @param string $code currency code
* @param double $rate new rate
- *
* @return int -1 if KO, 1 if OK, 2 if label found and OK
*/
public function addRateFromDolibarr($code, $rate)
@@ -459,10 +454,9 @@ class MultiCurrency extends CommonObject
}
/**
- * Add new entry into llx_multicurrency_rate to historise
+ * Add new entry into llx_multicurrency_rate
*
* @param double $rate rate value
- *
* @return int <0 if KO, >0 if OK
*/
public function updateRate($rate)
@@ -628,11 +622,11 @@ class MultiCurrency extends CommonObject
}
/**
- * Sync rates from api
+ * Sync rates from API
*
* @param string $key Key to use. Come from $conf->global->MULTICURRENCY_APP_ID.
* @param int $addifnotfound Add if not found
- * @return void
+ * @return int <0 if KO, >0 if OK
*/
public static function syncRates($key, $addifnotfound = 0)
{
@@ -672,11 +666,15 @@ class MultiCurrency extends CommonObject
}
}
}
- }
+
+ return 1;
+ }
else
{
dol_syslog("Failed to call endpoint ".$response->error->info, LOG_WARNING);
setEventMessages($langs->trans('multicurrency_syncronize_error', $response->error->info), null, 'errors');
+
+ return -1;
}
}
diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php
index 51e5fdc5dac..369840efc71 100644
--- a/htdocs/opensurvey/fonctions.php
+++ b/htdocs/opensurvey/fonctions.php
@@ -89,15 +89,11 @@ function llxHeaderSurvey($title, $head = "", $disablejs = 0, $disablehead = 0, $
print ' '."\n";
print "\n";
-
// Show logo (search order: logo defined by PAYMENT_LOGO_suffix, then PAYMENT_LOGO, then small company logo, large company logo, theme logo, common logo)
$width = 0;
// Define logo and logosmall
$logosmall = $mysoc->logo_small;
$logo = $mysoc->logo;
- $paramlogo = 'ONLINE_PAYMENT_LOGO_'.$suffix;
- if (!empty($conf->global->$paramlogo)) $logosmall = $conf->global->$paramlogo;
- elseif (!empty($conf->global->ONLINE_PAYMENT_LOGO)) $logosmall = $conf->global->ONLINE_PAYMENT_LOGO;
//print ''."\n";
// Define urllogo
$urllogo = '';
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 7ff90dc296a..22b4ac6e651 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -10,6 +10,7 @@
* Copyright (C) 2016 Ferran Marcet
* Copyright (C) 2019 Frédéric France
* Copyright (C) 2019 Tim Otte
+ * Copyright (C) 2020 Pierre Ardoin
*
* 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
@@ -1070,6 +1071,7 @@ SCRIPT;
// Modify-Remove
print '';
+
if ($usercancreate)
{
print ''.img_edit()." ";
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 7bb3f55242d..2e13a551e97 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -3,6 +3,7 @@
* Copyright (C) 2010-2012 Regis Houssin
* Copyright (C) 2014 Marcos García
* Copyright (C) 2018 Frédéric France
+ * Copyright (C) 2020 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
@@ -154,7 +155,8 @@ class Task extends CommonObject
// Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."projet_task (";
- $sql .= "fk_projet";
+ $sql .= "entity";
+ $sql .= ", fk_projet";
$sql .= ", ref";
$sql .= ", entity";
$sql .= ", fk_task_parent";
@@ -167,7 +169,8 @@ class Task extends CommonObject
$sql .= ", planned_workload";
$sql .= ", progress";
$sql .= ") VALUES (";
- $sql .= $this->fk_project;
+ $sql .= $conf->entity;
+ $sql .= ", ".$this->fk_project;
$sql .= ", ".(!empty($this->ref) ? "'".$this->db->escape($this->ref)."'" : 'null');
$sql .= ", ".$conf->entity;
$sql .= ", ".$this->fk_task_parent;
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index e61c98e3267..e6e9e42aa75 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1987,11 +1987,11 @@ class Societe extends CommonObject
* @param float $remise Amount of discount
* @param User $user User adding discount
* @param string $desc Reason of discount
- * @param float $tva_tx VAT rate
+ * @param string $vatrate VAT rate (may contain the vat code too). Exemple: '1.23', '1.23 (ABC)', ...
* @param int $discount_type 0 => customer discount, 1 => supplier discount
- * @return int <0 if KO, id of discount record if OK
+ * @return int <0 if KO, id of discount record if OK
*/
- public function set_remise_except($remise, User $user, $desc, $tva_tx = 0, $discount_type = 0)
+ public function set_remise_except($remise, User $user, $desc, $vatrate = '', $discount_type = 0)
{
// phpcs:enable
global $langs;
@@ -2012,8 +2012,17 @@ class Societe extends CommonObject
return -2;
}
- if ($this->id)
+ if ($this->id > 0)
{
+ // Clean vat code
+ $reg = array();
+ $vat_src_code = '';
+ if (preg_match('/\((.*)\)/', $vatrate, $reg))
+ {
+ $vat_src_code = $reg[1];
+ $vatrate = preg_replace('/\s*\(.*\)/', '', $vatrate); // Remove code into vatrate.
+ }
+
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
$discount = new DiscountAbsolute($this->db);
@@ -2022,10 +2031,12 @@ class Societe extends CommonObject
$discount->discount_type = $discount_type;
$discount->amount_ht = $discount->multicurrency_amount_ht = price2num($remise, 'MT');
- $discount->amount_tva = $discount->multicurrency_amount_tva = price2num($remise * $tva_tx / 100, 'MT');
+ $discount->amount_tva = $discount->multicurrency_amount_tva = price2num($remise * $vatrate / 100, 'MT');
$discount->amount_ttc = $discount->multicurrency_amount_ttc = price2num($discount->amount_ht + $discount->amount_tva, 'MT');
- $discount->tva_tx = price2num($tva_tx, 'MT');
+ $discount->tva_tx = price2num($vatrate, 'MT');
+ $discount->vat_src_code = $vat_src_code;
+
$discount->description = $desc;
$result = $discount->create($user);
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 2ce3f31211b..9f3a259e441 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -733,7 +733,6 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
?>
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 51536ba8133..6251b5b57b0 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -717,7 +717,7 @@ $( document ).ready(function() {
trans("Customer");
- if ($invoice->socid != $conf->global->$constforcompanyid) {
+ if ($invoice->id > 0 && ($invoice->socid != $conf->global->$constforcompanyid)) {
$s = $soc->name;
}
?>
@@ -733,17 +733,17 @@ $( document ).ready(function() {
while ($obj = $db->fetch_object($resql)) {
echo '$("#customerandsales").append(\'';
if ($placeid==$obj->rowid) echo "";
- echo 'ref));
echo $num_sale;
if (str_replace("-", "", $num_sale)>$max_sale) $max_sale=str_replace("-", "", $num_sale);
- echo '\\\'">'.date('H:i', strtotime($obj->datec));
+ echo '\\\';Refresh();">'.date('H:i', strtotime($obj->datec));
if ($placeid==$obj->rowid) echo " ";
echo '\');';
}
- echo '$("#customerandsales").append(\' \');';
+ echo '\\\';Refresh();">\');';
} else {
dol_print_error($db);
}
diff --git a/htdocs/theme/eldy/badges.inc.php b/htdocs/theme/eldy/badges.inc.php
index ed609ddbc87..ae02a8e7f73 100644
--- a/htdocs/theme/eldy/badges.inc.php
+++ b/htdocs/theme/eldy/badges.inc.php
@@ -118,13 +118,13 @@ a.badge-warning:focus, a.badge-warning:hover {
}
/* WARNING colorblind */
-body[class^="colorblind-"] .badge-warning {
+body[class*="colorblind-"] .badge-warning {
background-color: ;
}
-body[class^="colorblind-"] a.badge-warning.focus,body[class^="colorblind-"] a.badge-warning:focus {
+body[class*="colorblind-"] a.badge-warning.focus,body[class^="colorblind-"] a.badge-warning:focus {
box-shadow: 0 0 0 0.2rem ;
}
-body[class^="colorblind-"] a.badge-warning:focus, a.badge-warning:hover {
+body[class*="colorblind-"] a.badge-warning:focus, a.badge-warning:hover {
background-color: ;
}
diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php
index bfe55597316..e930eef3f03 100644
--- a/htdocs/theme/eldy/dropdown.inc.php
+++ b/htdocs/theme/eldy/dropdown.inc.php
@@ -164,7 +164,9 @@ button.dropdown-item.global-search-item {
}
div#topmenu-global-search-dropdown, div#topmenu-bookmark-dropdown {
- line-height: 46px;
+ global->THEME_TOPMENU_DISABLE_IMAGE)) { ?>
+ line-height: 46px;
+
}
a.top-menu-dropdown-link {
padding: 8px;
diff --git a/htdocs/theme/eldy/progress.inc.php b/htdocs/theme/eldy/progress.inc.php
index 750db266dfd..6df6d3480a8 100644
--- a/htdocs/theme/eldy/progress.inc.php
+++ b/htdocs/theme/eldy/progress.inc.php
@@ -145,16 +145,21 @@ if (! defined('ISLOADEDBYSTEELSHEET')) die('Must be call by steelsheet'); ?>
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
-.progress-bar-green,
-.progress-bar-success {
+.progress-bar-green, .progress-bar-success {
background-color: ;
}
-.progress-striped .progress-bar-green,
-.progress-striped .progress-bar-success {
+.progress-striped .progress-bar-green, .progress-striped .progress-bar-success {
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
}
+body[class*="colorblind-"] .progress-bar-green, body[class*="colorblind-"] .progress-bar-success {
+ background-color: ;
+}
+body[class*="colorblind-"] .progress-bar-red, body[class*="colorblind-"] .progress-bar-danger {
+ background-color: ;
+}
+
.progress-bar-aqua,
.progress-bar-info {
background-color: #00c0ef;
diff --git a/htdocs/theme/eldy/theme_vars.inc.php b/htdocs/theme/eldy/theme_vars.inc.php
index 65c51e10dfe..b0ab509dc5c 100644
--- a/htdocs/theme/eldy/theme_vars.inc.php
+++ b/htdocs/theme/eldy/theme_vars.inc.php
@@ -99,6 +99,7 @@ $badgeLight = '#f8f9fa';
$colorblind_deuteranopes_badgeSuccess = '#37de5d'; //! text color black
$colorblind_deuteranopes_badgeSuccess_textColor7 = '#000';
$colorblind_deuteranopes_badgeWarning = '#e4e411';
+$colorblind_deuteranopes_badgeDanger = $badgeDanger; // currently not tested with a color blind people so use default color
/* default color for status : After a quick check, somme status can have oposite function according to objects
* So this badges status uses default value according to theme eldy status img