diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php
index cc1ffc5486e..f7df9198f19 100644
--- a/htdocs/comm/propal/index.php
+++ b/htdocs/comm/propal/index.php
@@ -160,7 +160,7 @@ print '
';
* Last modified proposals
*/
-$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, date_cloture as datec, c.tms as datem,";
+$sql = "SELECT c.rowid, c.entity, c.ref, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status, date_cloture as datec, c.tms as datem,";
$sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta";
$sql .= " FROM ".MAIN_DB_PREFIX."propal as c,";
$sql .= " ".MAIN_DB_PREFIX."societe as s";
@@ -200,6 +200,9 @@ if ($resql) {
$propalstatic->id = $obj->rowid;
$propalstatic->ref = $obj->ref;
+ $propalstatic->total_ht = $obj->total_ht;
+ $propalstatic->total_tva = $obj->total_tva;
+ $propalstatic->total_ttc = $obj->total_ttc;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->socname;
@@ -251,7 +254,7 @@ if ($resql) {
*/
if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
$sql = "SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta";
- $sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
+ $sql .= ", p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ", ".MAIN_DB_PREFIX."propal as p";
$sql .= " WHERE p.fk_soc = s.rowid";
@@ -290,6 +293,9 @@ if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) {
$propalstatic->id = $obj->propalid;
$propalstatic->ref = $obj->ref;
+ $propalstatic->total_ht = $obj->total_ht;
+ $propalstatic->total_tva = $obj->total_tva;
+ $propalstatic->total_ttc = $obj->total_ttc;
$companystatic->id = $obj->socid;
$companystatic->name = $obj->socname;
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 86265c872b8..96a8d9fc59d 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -2361,14 +2361,14 @@ class Product extends CommonObject
if ($newprice !== '' || $newprice === 0) {
if ($newpricebase == 'TTC') {
- $price_ttc = price2num($newprice, 'MU');
+ $price_ttc = (float) price2num($newprice, 'MU');
$price = (float) price2num($newprice) / (1 + ((float) $newvat / 100));
- $price = price2num($price, 'MU');
+ $price = (float) price2num($price, 'MU');
if ($newminprice != '' || $newminprice == 0) {
- $price_min_ttc = price2num($newminprice, 'MU');
+ $price_min_ttc = (float) price2num($newminprice, 'MU');
$price_min = (float) price2num($newminprice) / (1 + ($newvat / 100));
- $price_min = price2num($price_min, 'MU');
+ $price_min = (float) price2num($price_min, 'MU');
} else {
$price_min = 0;
$price_min_ttc = 0;
@@ -2379,9 +2379,9 @@ class Product extends CommonObject
$price_ttc = (float) price2num($price_ttc, 'MU');
if ($newminprice !== '' || $newminprice === 0) {
- $price_min = price2num($newminprice, 'MU');
+ $price_min = (float) price2num($newminprice, 'MU');
$price_min_ttc = (float) price2num($newminprice) * (1 + ($newvat / 100));
- $price_min_ttc = price2num($price_min_ttc, 'MU');
+ $price_min_ttc = (float) price2num($price_min_ttc, 'MU');
//print 'X'.$newminprice.'-'.$price_min;
} else {
$price_min = 0;