$result1 = calcul_price_total ( 1 , 1.24 , 0 , 10 , 0 , 0 , 0 , 'HT' , 0 , 0 );
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 1.24 , 0.12 , 1.36 , 1.24 , 0.124 , 1.364 , 1.24 , 0.12 , 1.36 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 1.24 , 0.12 , 1.36 , 1.24 , 0.124 , 1.364 , 1.24 , 0.12 , 1.36 , 0 , 0 ), $result1 , 'Test1 FR' );
$result1 = calcul_price_total ( 2 , 8.56 , 0 , 10 , 0 , 0 , 0 , 'HT' , 0 , 0 , '' , '' , 100 , 1.09205 );
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 17.12 , 1.71 , 18.83 , 8.56 , 0.856 , 9.416 , 17.12 , 1.71 , 18.83 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 18.7 , 1.87 , 20.57 , 9.34795 , 0.93479 , 10.28274 , 18.7 , 1.87 , 20.57 , 0 , 0 ), $result1 , 'Test1b FR' );
$result1 = calcul_price_total ( 2 , 0 , 0 , 10 , 0 , 0 , 0 , 'HT' , 0 , 0 , '' , '' , 100 , 1.09205 , 20 );
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 36.63 , 3.66 , 40.29 , 18.31418 , 1.83142 , 20.1456 , 36.63 , 3.66 , 40.29 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 40 , 4 , 44 , 20 , 2 , 22 , 40 , 4 , 44 , 0 , 0 ), $result1 , 'Test1c FR' );
$result2 = calcul_price_total ( 10 , 10 , 0 , 10 , 0 , 0 , 0 , 'HT' , 0 , 0 ); // 10 * 10 HT - 0% discount with 10% vat and 1.4% localtax1, 0% localtax2
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 100 , 10 , 110 , 10 , 1 , 11 , 100 , 10 , 110 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 100 , 10 , 110 , 10 , 1 , 11 , 100 , 10 , 110 , 0 , 0 ), $result2 , 'Test1 ES' );
$result2 = calcul_price_total ( 10 , 10 , 0 , 10 , - 1 , - 1 , 0 , 'HT' , 0 , 0 ); // 10 * 10 HT - 0% discount with 10% vat and 1.4% localtax1, 0% localtax2
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 100 , 10 , 110 , 10 , 1 , 11 , 100 , 10 , 110 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 100 , 10 , 110 , 10 , 1 , 11 , 100 , 10 , 110 , 0 , 0 ), $result2 , 'Test2 ES' );
$result2 = calcul_price_total ( 10 , 10 , 0 , 10 , 1.4 , 0 , 0 , 'HT' , 0 , 0 );
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 100 , 10 , 111.4 , 10 , 1 , 11.14 , 100 , 10 , 111.4 , 1.4 , 0 , 0.14 , 0 , 0 , 1.4 , 0 , 100 , 10 , 111.4 , 10 , 1 , 11.14 , 100 , 10 , 111.4 , 1.4 , 0 ), $result2 , 'Test3 ES' );
$result2 = calcul_price_total ( 10 , 10 , 0 , 10 , - 1 , - 1 , 0 , 'HT' , 0 , 0 );
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 100 , 10 , 111.4 , 10 , 1 , 11.14 , 100 , 10 , 111.4 , 1.4 , 0 , 0.14 , 0 , 0 , 1.4 , 0 , 100 , 10 , 111.4 , 10 , 1 , 11.14 , 100 , 10 , 111.4 , 1.4 , 0 ), $result2 , 'Test4 ES' );
$result2 = calcul_price_total ( 10 , 10 , 0 , 10 , 0 , - 19 , 0 , 'HT' , 0 , 1 );
2021-01-14 15:09:08 +01:00
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 100 , 10 , 91 , 10 , 1 , 9.1 , 100 , 10 , 91 , 0 , - 19 , 0 , - 1.90 , 0 , 0 , - 19 , 100 , 10 , 91 , 10 , 1 , 9.1 , 100 , 10 , 91 , 0 , - 19 ), $result2 , 'Test5 ES for service' );
$result2 = calcul_price_total ( 10 , 10 , 0 , 10 , - 1 , - 1 , 0 , 'HT' , 0 , 0 );
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 100 , 10 , 110 , 10 , 1 , 11 , 100 , 10 , 110 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 100 , 10 , 110 , 10 , 1 , 11 , 100 , 10 , 110 , 0 , 0 ), $result2 , 'Test6 ES for product' );
$result2 = calcul_price_total ( 10 , 10 , 0 , 10 , - 1 , - 1 , 0 , 'HT' , 0 , 1 );
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 100 , 10 , 91 , 10 , 1 , 9.1 , 100 , 10 , 91 , 0 , - 19 , 0 , - 1.90 , 0 , 0 , - 19 , 100 , 10 , 91 , 10 , 1 , 9.1 , 100 , 10 , 91 , 0 , - 19 ), $result2 , 'Test6 ES for service' );
$result2 = calcul_price_total ( 10 , - 10 , 0 , 10 , 0 , 19 , 0 , 'HT' , 0 , 0 );
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( - 100 , - 10 , - 110 , - 10 , - 1 , - 11 , - 100 , - 10 , - 110 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 100 , - 10 , - 110 , - 10 , - 1 , - 11 , - 100 , - 10 , - 110 , 0 , 0 ), $result2 , 'Test7 ES for product' );
$result2 = calcul_price_total ( 10 , - 10 , 0 , 10 , - 1 , - 1 , 0 , 'HT' , 0 , 1 );
$this -> assertEquals ( array ( - 100 , - 10 , - 91 , - 10 , - 1 , - 9.1 , - 100 , - 10 , - 91 , 0 , 19 , 0 , 1.90 , 0 , 0 , 19 , - 100 , - 10 , - 91 , - 10 , - 1 , - 9.1 , - 100 , - 10 , - 91 , 0 , 19 ), $result2 , 'Test8 ES for service' );
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 100 , 18 , 126.85 , 10 , 1.8 , 12.685 , 100 , 18 , 126.85 , 8.85 , 0 , 0.885 , 0 , 0 , 8.85 , 0 , 100 , 18 , 126.85 , 10 , 1.8 , 12.685 , 100 , 18 , 126.85 , 8.85 , 0 ), $result3 , 'Test9 CI' );
$result3 = calcul_price_total ( 10 , 10 , 0 , 18 , - 1 , - 1 , 0 , 'HT' , 0 , 0 ); // 10 * 10 HT - 0% discount with 18% vat and 7.5% localtax1, 0% localtax2
// result[0,1,2,3,4,5,6,7,8] (total_ht, total_vat, total_ttc, pu_ht, pu_tva, pu_ttc, total_ht_without_discount, total_vat_without_discount, total_ttc_without_discount)
$this -> assertEquals ( array ( 100 , 18 , 126.85 , 10 , 1.8 , 12.685 , 100 , 18 , 126.85 , 8.85 , 0 , 0.885 , 0 , 0 , 8.85 , 0 , 100 , 18 , 126.85 , 10 , 1.8 , 12.685 , 100 , 18 , 126.85 , 8.85 , 0 ), $result3 , 'Test10 CI' );
$localobject -> addline ( 'Desc' , 1.24 , 1 , 10 , 0 , 0 , 0 , 0 , '' , '' , 0 , 0 , 0 , 'HT' );
$localobject -> addline ( 'Desc' , 1.24 , 1 , 10 , 0 , 0 , 0 , 0 , '' , '' , 0 , 0 , 0 , 'HT' );
$localobject -> addline ( 'Desc' , 1.24 , 1 , 10 , 0 , 0 , 0 , 0 , '' , '' , 0 , 0 , 0 , 'HT' );
$localobject -> addline ( 'Desc' , 1.24 , 1 , 10 , 0 , 0 , 0 , 0 , '' , '' , 0 , 0 , 0 , 'HT' );