diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index c231a36402d..1c09d2ed48e 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -95,7 +95,7 @@ abstract class CommonInvoice extends CommonObject * This does not include open direct debit requests. * * @param int $multicurrency Return multicurrency_amount instead of amount - * @return double Remain of amount to pay + * @return double Remain of amount to pay */ public function getRemainToPay($multicurrency = 0) { @@ -104,7 +104,7 @@ abstract class CommonInvoice extends CommonObject $alreadypaid+=$this->getSumDepositsUsed($multicurrency); $alreadypaid+=$this->getSumCreditNotesUsed($multicurrency); - $remaintopay = ($this->total_ttc - $alreadypaid); + $remaintopay = price2num($this->total_ttc - $alreadypaid, 'MT'); if ($this->statut == self::STATUS_CLOSED && $this->close_code == 'discount_vat') { // If invoice closed with discount for anticipated payment $remaintopay = 0; } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 5078bc9dbd7..eac9f404188 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1100,7 +1100,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '') if (!empty($arrayfields['t.'.$key]['checked'])) print getTitleFieldOfList($val['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; if ($key == 'role') $align .= ($align ? ' ' : '').'left'; if (!empty($arrayfields['sc.'.$key]['checked'])) { - print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 'sc.'.$key, '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; + print getTitleFieldOfList($arrayfields['sc.'.$key]['label'], 0, $_SERVER['PHP_SELF'], '', '', $param, ($align ? 'class="'.$align.'"' : ''), $sortfield, $sortorder, $align.' ')."\n"; } } // Extra fields 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/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 613daa18ab0..3b91c867ebe 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;