mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-08 10:38:15 +01:00
Fix: Minor fix
This commit is contained in:
@@ -2529,8 +2529,9 @@ function price2num($amount,$rounding='',$alreadysqlnb=0)
|
||||
* \brief Return localtaxe rate for a particular tva
|
||||
* \param tva Vat taxe
|
||||
* \param local Local taxe to search and return
|
||||
* \return int <0 if KO, localtax if found
|
||||
*/
|
||||
function get_localtax($tva, $local=0)
|
||||
function get_localtax($tva, $local)
|
||||
{
|
||||
global $db, $conf, $mysoc;
|
||||
|
||||
@@ -2550,6 +2551,8 @@ function get_localtax($tva, $local=0)
|
||||
if ($local==1) return $obj->localtax1;
|
||||
elseif ($local==2) return $obj->localtax2;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -888,6 +888,8 @@ class Product extends CommonObject
|
||||
//Local taxes
|
||||
$localtax1=get_localtax($newvat,1);
|
||||
$localtax2=get_localtax($newvat,2);
|
||||
if (empty($localtax1)) $localtax1=0; // If = '' then = 0
|
||||
if (empty($localtax2)) $localtax2=0; // If = '' then = 0
|
||||
|
||||
// Ne pas mettre de quote sur le numeriques decimaux.
|
||||
// Ceci provoque des stockage avec arrondis en base au lieu des valeurs exactes.
|
||||
@@ -897,8 +899,8 @@ class Product extends CommonObject
|
||||
$sql.= " price_ttc=".$price_ttc.",";
|
||||
$sql.= " price_min=".$price_min.",";
|
||||
$sql.= " price_min_ttc=".$price_min_ttc.",";
|
||||
$sql.= " localtax1_tx=".$localtax1.",";
|
||||
$sql.= " localtax2_tx=".$localtax2.",";
|
||||
$sql.= " localtax1_tx=".($localtax1>=0?$localtax1:'NULL').",";
|
||||
$sql.= " localtax2_tx=".($localtax2>=0?$localtax2:'NULL').",";
|
||||
$sql.= " tva_tx='".price2num($newvat)."'";
|
||||
$sql.= " WHERE rowid = " . $id;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user