Regression solved
This commit is contained in:
parent
28148f8637
commit
f96fdc7d0a
@ -2027,7 +2027,7 @@ class Facture extends CommonInvoice
|
|||||||
* @param int $fk_prev_id Previous situation line id reference
|
* @param int $fk_prev_id Previous situation line id reference
|
||||||
* @return int <0 if KO, Id of line if OK
|
* @return int <0 if KO, Id of line if OK
|
||||||
*/
|
*/
|
||||||
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=self::TYPE_STANDARD, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='', $array_option=0, $situation_percent=0, $fk_prev_id='')
|
function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1=0, $txlocaltax2=0, $fk_product=0, $remise_percent=0, $date_start='', $date_end='', $ventil=0, $info_bits=0, $fk_remise_except='', $price_base_type='HT', $pu_ttc=0, $type=self::TYPE_STANDARD, $rang=-1, $special_code=0, $origin='', $origin_id=0, $fk_parent_line=0, $fk_fournprice=null, $pa_ht=0, $label='', $array_option=0, $situation_percent=100, $fk_prev_id='')
|
||||||
{
|
{
|
||||||
global $mysoc, $conf, $langs;
|
global $mysoc, $conf, $langs;
|
||||||
|
|
||||||
|
|||||||
@ -49,7 +49,7 @@
|
|||||||
* @param int $type 0/1=Product/service
|
* @param int $type 0/1=Product/service
|
||||||
* @param Societe $seller Thirdparty seller (we need $seller->country_id property). Provided only if seller is the supplier, otherwise $seller will be $mysoc.
|
* @param Societe $seller Thirdparty seller (we need $seller->country_id property). Provided only if seller is the supplier, otherwise $seller will be $mysoc.
|
||||||
* @param array $localtaxes_array Array with localtaxes info (loaded by getLocalTaxesFromRate function).
|
* @param array $localtaxes_array Array with localtaxes info (loaded by getLocalTaxesFromRate function).
|
||||||
* @param float $progress Situation invoices progress
|
* @param float $progress Situation invoices progress (value from 0 to 100, 100 by default)
|
||||||
* @return result[ 0=total_ht,
|
* @return result[ 0=total_ht,
|
||||||
* 1=total_vat,
|
* 1=total_vat,
|
||||||
* 2=total_ttc,
|
* 2=total_ttc,
|
||||||
@ -97,6 +97,8 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
|
|||||||
if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj;
|
if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj;
|
||||||
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
|
if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj;
|
||||||
|
|
||||||
|
dol_syslog('Price.lib::calcul_price_total qty='.$qty.' pu='.$pu.' remise_percent_ligne='.$remise_percent_ligne.' txtva='.$txtva.' uselocaltax1_rate='.$uselocaltax1_rate.' uselocaltax2_rate='.$uselocaltax2_rate.' remise_percent_global='.$remise_percent_global.' price_base_type='.$ice_base_type.' type='.$type.' progress='.$progress);
|
||||||
|
|
||||||
// Now we search localtaxes information ourself (rates and types).
|
// Now we search localtaxes information ourself (rates and types).
|
||||||
$localtax1_type=0;
|
$localtax1_type=0;
|
||||||
$localtax2_type=0;
|
$localtax2_type=0;
|
||||||
|
|||||||
@ -215,9 +215,9 @@ class PricesTest extends PHPUnit_Framework_TestCase
|
|||||||
$newlocalobject=new Facture($this->savdb);
|
$newlocalobject=new Facture($this->savdb);
|
||||||
$newlocalobject->fetch($invoiceid);
|
$newlocalobject->fetch($invoiceid);
|
||||||
|
|
||||||
$this->assertEquals(2.48,$newlocalobject->total_ht);
|
$this->assertEquals(2.48,$newlocalobject->total_ht, "testUpdatePrice test1");
|
||||||
$this->assertEquals(0.24,$newlocalobject->total_tva);
|
$this->assertEquals(0.24,$newlocalobject->total_tva, "testUpdatePrice test2");
|
||||||
$this->assertEquals(2.72,$newlocalobject->total_ttc);
|
$this->assertEquals(2.72,$newlocalobject->total_ttc, "testUpdatePrice test3");
|
||||||
|
|
||||||
|
|
||||||
// Two lines of 1.24 give 2.48 HT and 2.73 TTC with global vat rounding mode
|
// Two lines of 1.24 give 2.48 HT and 2.73 TTC with global vat rounding mode
|
||||||
@ -231,7 +231,7 @@ class PricesTest extends PHPUnit_Framework_TestCase
|
|||||||
$newlocalobject=new Facture($this->savdb);
|
$newlocalobject=new Facture($this->savdb);
|
||||||
$newlocalobject->fetch($invoiceid);
|
$newlocalobject->fetch($invoiceid);
|
||||||
|
|
||||||
$this->assertEquals(2.48,$newlocalobject->total_ht);
|
$this->assertEquals(2.48,$newlocalobject->total_ht, "testUpdatePrice test4");
|
||||||
//$this->assertEquals(0.25,$newlocalobject->total_tva);
|
//$this->assertEquals(0.25,$newlocalobject->total_tva);
|
||||||
//$this->assertEquals(2.73,$newlocalobject->total_ttc);
|
//$this->assertEquals(2.73,$newlocalobject->total_ttc);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user