Task #1762 , printtva peut mettre donner les totaux de tva

suivant l'exigibilité configuré par Code TVA , par date de paiement
ou par date d'opération
This commit is contained in:
Dany De Bontridder 2019-11-12 21:13:47 +01:00
parent 6b96cb0a44
commit 096169b987
39 changed files with 694 additions and 228 deletions

View file

@ -3,5 +3,5 @@
DOSSIER_TEST=rel70dossier25
createdb $DOSSIER_TEST
pg_restore -Fc --no-owner --no-privilege --verbose -d $DOSSIER_TEST db/dossiertest191101-2109.bin
pg_restore -Fc --no-owner --no-privilege --verbose -d $DOSSIER_TEST db/dossiertest191112-1806.bin

View file

@ -201,10 +201,10 @@ class Acc_Account_LedgerTest extends TestCase
function DataBelong_ledger()
{
return array(
array(0, -1),
array(-1, 0),
array(1, -1),
array(3, -1),
array(2, 0),
array(3, 0),
array(2, -1),
array(4, 0)
);
}

View file

@ -48,7 +48,7 @@ class Acc_BalanceTest extends TestCase
$min=$g_connection->get_value("select min(p_id) from parm_periode");
$this->object->jrn=NULL;
$array=$this->object->get_row($min,$max);
$this->assertEquals(29,count($array));
$this->assertEquals(31,count($array));
$this->object->jrn=[2,4];
$array=$this->object->get_row($min,$max);
$this->assertEquals(10,count($array));
@ -64,9 +64,9 @@ class Acc_BalanceTest extends TestCase
$this->object->filter_cat(array());
$this->assertEquals($this->object->jrn,null);
$this->object->filter_cat(array('2'=>'FIN'));
$this->assertEquals($this->object->jrn,[1]);
$this->assertEquals([1,83],$this->object->jrn);
$this->object->filter_cat(array('1'=>'ACH','2'=>'FIN'));
$this->assertEquals($this->object->jrn,[3,35,1]);
$this->assertEquals($this->object->jrn,[3,35,1,83]);
}
/**
*@covers Acc_Balance::summary_add

View file

@ -140,7 +140,7 @@ class Acc_BilanTest extends TestCase
$this->assertTrue(isset($this->object->C70));
$this->assertTrue(isset($this->object->C60));
$this->assertEquals($this->object->C70,445.6);
$this->assertEquals($this->object->C70,456.8);
$this->assertEquals($this->object->C60,0);
}

View file

@ -2,7 +2,7 @@
use PHPUnit\Framework\TestCase;
/**
* Generated by PHPUnit_SkeletonGenerator on 2014-11-09 at 12:39:58.
* @coversDefaultClass Acc_Ledger
*/
class Acc_LedgerTest extends TestCase
{
@ -11,7 +11,7 @@ class Acc_LedgerTest extends TestCase
* @var Acc_Ledger
*/
protected $object;
protected function getDataSet()
protected function getDataSet()
{
$dataSet = new PHPUnit_Extensions_Database_DataSet_CsvDataSet();
$dataSet->addTable('jrn', dirname(__FILE__)."/jrn.csv");
@ -61,23 +61,44 @@ class Acc_LedgerTest extends TestCase
{
}
/**
* covers ::existing_vat
* covers ::get_type
*/
public function testExisting_vat()
{
$this->object->set_ledger_id(2);
$this->assertEquals($this->object->get_type(),'VEN',"Sales ledger");
$a_vat=$this->object->existing_vat();
$this->assertEquals(2,count($a_vat));
$this->object->set_ledger_id(3);
$this->assertEquals($this->object->get_type(),'ACH',"Purchases ledger");
$a_vat=$this->object->existing_vat();
$this->assertEquals(5,count($a_vat));
}
/**
* @covers Acc_Ledger::get_last_pj
* @todo Implement testGet_last_pj().
*/
public function testGet_last_pj()
{
$this->object->id=2;
$sPj=$this->object->get_last_pj(2);
$this->assertEquals(9,$sPj);
$this->assertEquals(40,$sPj);
$this->object->id=0;
try {
$this->object->get_last_pj();
$this->assertTrue(FALSE,"get_last_pj exception non lancée");
} catch (Exception $ex) {
$this->assertTrue(TRUE,"Exception si id =0");
}
}
/**
* @covers Acc_Ledger::get_type
* @todo Implement testGet_type().
*/
public function testGet_type()
{
@ -96,6 +117,10 @@ class Acc_LedgerTest extends TestCase
$this->object->id=3;
$type=$this->object->get_type();
$this->assertEquals('ACH',$type);
$this->object->id=999;
$type=$this->object->get_type();
$this->assertEquals(null,$type);
}
@ -138,7 +163,6 @@ class Acc_LedgerTest extends TestCase
}
/**
* @covers Acc_Ledger::display_warning
* @todo Implement testDisplay_warning().
*/
public function testDisplay_warning()
{
@ -148,7 +172,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::reverse
* @todo Implement testReverse().
*/
public function testReverse()
{
@ -170,18 +193,24 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_name
* @todo Implement testGet_name().
*/
public function testGet_name()
{
$this->object->id=3;
$name=$this->object->get_name();
$this->assertEquals('Achat',$name);
$this->object->id=0;
$name=$this->object->get_name();
$this->assertEquals('Grand Livre',$name);
$this->object->id=1000;
$name=$this->object->get_name();
$this->assertEquals(null,$name);
}
/**
* @covers Acc_Ledger::get_rowSimple
* @todo Implement testGet_rowSimple().
*/
public function testGet_rowSimple()
{
@ -199,18 +228,16 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::guess_pj
* @todo Implement testGuess_pj().
*/
public function testGuess_pj()
{
$this->object->id=2;
$r=$this->object->guess_pj();
$this->assertEquals("VEN10",$r);
$this->assertEquals("VEN40",$r);
}
/**
* @covers Acc_Ledger::get_propertie
* @todo Implement testGet_propertie().
*/
public function testGet_propertie()
{
@ -219,6 +246,9 @@ class Acc_LedgerTest extends TestCase
$array=$this->object->get_propertie();
// there are 16 columns in jrn_def
$this->assertEquals(count($array),20);
$this->object->id=0;
$array=$this->object->get_propertie();
$this->assertEquals(null,$array);
}
/**
@ -255,7 +285,6 @@ class Acc_LedgerTest extends TestCase
}
/**
* @covers Acc_Ledger::get_solde
* @todo Implement testGet_solde().
*/
public function testGet_solde()
{
@ -264,23 +293,21 @@ class Acc_LedgerTest extends TestCase
$max=$g_connection->get_value("select max(p_id) from parm_periode");
$min=$g_connection->get_value("select min(p_id) from parm_periode");
$solde=$ledger->get_solde($min,$max);
$this->assertEquals($solde[0],490.77);
$this->assertEquals($solde[1],490.77);
$this->assertEquals($solde[0],4175.02);
$this->assertEquals($solde[1],4175.02);
}
/**
* @covers Acc_Ledger::select_ledger
* @todo Implement testSelect_ledger().
*/
public function testSelect_ledger()
{
$select_available=$this->object->select_ledger();
$this->assertEquals(4,count($select_available->value));
$this->assertEquals(7,count($select_available->value));
}
/**
* @covers Acc_Ledger::get_fiche_def
* @todo Implement testGet_fiche_def().
*/
public function testGet_fiche_def()
{
@ -293,7 +320,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_class_def
* @todo Implement testGet_class_def().
*/
public function testGet_class_def()
{
@ -306,7 +332,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::confirm
* @todo Implement testConfirm().
*/
public function testConfirm()
{
@ -358,7 +383,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_min_row
* @todo Implement testGet_min_row().
*/
public function testGet_min_row()
{
@ -375,7 +399,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::input
* @todo Implement testInput().
*/
public function testInput()
{
@ -406,7 +429,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::is_closed
* @todo Implement testIs_closed().
*/
public function testIs_closed()
{
@ -418,7 +440,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::verify
* @todo Implement testVerify().
*/
public function testVerify_Ledger()
{
@ -451,7 +472,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::compute_internal_code
* @todo Implement testCompute_internal_code().
*/
public function testCompute_internal_code()
{
@ -506,6 +526,8 @@ class Acc_LedgerTest extends TestCase
$this->assertEquals(1,$cnt);
$ledger->delete();
$g_connection->exec_sql("alter sequence s_jrn_pj4 restart with 43");
$cnt=$g_connection->get_value("select count(*) from jrn where jr_mt=$1",[$array['mt']]);
$this->assertEquals(0,$cnt);
@ -513,7 +535,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::next_number
* @todo Implement testNext_number().
*/
public function testNext_number()
{
@ -524,7 +545,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_first
* @todo Implement testGet_first().
*/
public function testGet_first()
{
@ -536,7 +556,9 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_all_fiche_def
* @todo Implement testGet_all_fiche_def().
* @todo
* $this->object->set_ledger_id(3);
$this->assertEquals($this->object->is_enable(),TRUE); Implement testGet_all_fiche_def().
*/
public function testGet_all_fiche_def()
{
@ -547,16 +569,15 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_saldo_exercice
* @todo Implement testGet_saldo_exercice().
*/
public function testGet_saldo_exercice()
{
$result=[
["solde"=> 658.2500 , "j_poste"=> "4400004", "j_qcode"=> "FOURNI"],
["solde"=> 658.25 , "j_poste"=> "4400004", "j_qcode"=> "FOURNI"],
["solde"=> 490.7700 , "j_poste"=> "4000005", "j_qcode"=> "CLIENT1"],
["solde"=> 21.9600, "j_poste"=> "4112", "j_qcode"=> ""],
["solde"=> 87.8400, "j_poste"=> "4112", "j_qcode"=> ""],
["solde"=>-85.1700 , "j_poste"=> "4511", "j_qcode"=> ""],
["solde"=> -863.2100 , "j_poste"=>"4400005", "j_qcode"=> "FOURNI1"]
["solde"=> -1496.3400 , "j_poste"=>"4400005", "j_qcode"=> "FOURNI1"]
];
$get=$this->object->get_saldo_exercice("2018");
$nb_get=count($get);
@ -580,18 +601,16 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_last_date
* @todo Implement testGet_last_date().
*/
public function testGet_last_date()
{
$this->object->set_ledger_id(2);
$last_date=$this->object->get_last_date();
$this->assertEquals("24.04.2018",$last_date);
$this->assertEquals("24.04.2019",$last_date);
}
/**
* @covers Acc_Ledger::get_id
* @todo Implement testGet_id().
*/
public function testGet_id()
{
@ -603,7 +622,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::array_cat
* @todo Implement testArray_cat().
*/
public function testArray_cat()
{
@ -613,7 +631,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_tiers
* @todo Implement testGet_tiers().
*/
public function testGet_tiers()
{
@ -631,6 +648,9 @@ class Acc_LedgerTest extends TestCase
$this->assertTrue($this->object->get_tiers("VEN",$jr_id)!=' ');
}
/**
* @covers Acc_Ledger::get_tiers_id
*/
public function testGet_tiers_id()
{
global $g_connection;
@ -650,7 +670,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::verify_ledger
* @todo Implement testVerify_ledger().
*/
public function testVerify_Operation()
{
@ -751,7 +770,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::input_new
* @todo Implement testInput_new().
*/
public function testInput_new()
{
@ -802,7 +820,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::delete_ledger
* @todo Implement testDelete_ledger().
*/
public function testDelete_ledger()
{
@ -832,7 +849,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_operation_date
* @todo Implement testGet_operation_date().
*/
public function testGet_operation_date()
{
@ -849,7 +865,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_supplier_now
* @todo Implement testGet_supplier_now().
*/
public function testGet_supplier_now()
{
@ -858,7 +873,6 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_supplier_late
* @todo Implement testGet_supplier_late().
*/
public function testGet_supplier_late()
{
@ -867,20 +881,34 @@ class Acc_LedgerTest extends TestCase
/**
* @covers Acc_Ledger::get_customer_now
* @todo Implement testGet_customer_now().
*/
public function testGet_customer_now()
{
$this->assertTrue(is_array($this->object->get_customer_now()));
}
/**
/**
* @covers Acc_Ledger::get_customer_late
* @todo Implement testGet_customer_late().
*/
public function testGet_customer_late()
{
$this->assertTrue(is_array($this->object->get_customer_late()));
}
/**
* @covers Acc_Ledger::set_ledger_id
* @covers Acc_Ledger::is_enable
*/
public function testIs_Enable()
{
$this->object->set_ledger_id(83);
$this->assertEquals($this->object->is_enable(),0);
$this->object->set_ledger_id(4);
$this->assertEquals($this->object->is_enable(),1);
$this->object->set_ledger_id(2);
$this->assertEquals($this->object->is_enable(),1);
$this->object->set_ledger_id(3);
$this->assertEquals($this->object->is_enable(),1);
}
}

View file

@ -108,6 +108,7 @@ class Acc_Ledger_FinTest extends TestCase
$this->assertContains('<INPUT TYPE="hidden" id="dateop1" NAME="dateop1" VALUE="">',$result);
$this->assertContains('<INPUT TYPE="hidden" id="chdate" NAME="chdate" VALUE="1">',$result);
}
private function clean_operation()
{
@ -125,6 +126,8 @@ class Acc_Ledger_FinTest extends TestCase
[ '1572695340.6768']
);
$g_connection->exec_sql(' delete from jrnx where j_grpt not in (select jr_grpt_id from jrn)');
$g_connection->exec_sql("alter sequence s_jrn_pj1 restart with 48");
$g_connection->commit();
}
@ -154,7 +157,7 @@ class Acc_Ledger_FinTest extends TestCase
$ret=$this->object->insert($array);
$this->assertContains('<table class="result" ><tr ><th >Date</th>',$ret);
$this->assertContains(' HREF="javascript:modifyOperation',$ret);
$this->assertContains('-935,91',$ret);
$this->assertContains('-1.095,39',$ret);
$this->clean_operation();
}

View file

@ -24,6 +24,7 @@ use PHPUnit\Framework\TestCase;
/**
* @file
* @brief concerne acc_ledger_history_financialTest.class
* @coversDefaultClass Acc_History_Financial
*/
class Acc_Ledger_History_FinancialTest extends TestCase
{
@ -63,7 +64,7 @@ class Acc_Ledger_History_FinancialTest extends TestCase
function testGet__row()
{
$this->object->get_row();
$this->assertEquals(5, count($this->object->get_data()));
$this->assertEquals(7, count($this->object->get_data()));
}
//@covers Acc_Ledger_History_Financial::export_html
@ -93,4 +94,12 @@ class Acc_Ledger_History_FinancialTest extends TestCase
$this->assertFileExists(__DIR__."/file/".$name);
}
/**
* @covers Acc_Ledger_History::get_ledger_type
*/
function testGet_Ledger_type()
{
$this->assertEquals($this->object->get_ledger_type(),'FIN');
}
}

View file

@ -113,5 +113,12 @@ class Acc_Ledger_History_GenericTest extends TestCase
$this->save_file($name, $content);
$this->assertFileExists(__DIR__."/file/".$name);
}
/**
* @covers Acc_Ledger_History::get_ledger_type
*/
function testGet_Ledger_type()
{
$this->assertEquals($this->object->get_ledger_type(),'ODS');
}
}

View file

@ -62,7 +62,7 @@ class Acc_Ledger_History_PurchaseTest extends TestCase
function testGet_Row()
{
$this->object->get_row();
$this->assertSame(count($this->object->get_data()),65);
$this->assertSame(count($this->object->get_data()),14);
}
//@covers Acc_Ledger_History_Financial::export_oneline_html
@ -112,5 +112,12 @@ class Acc_Ledger_History_PurchaseTest extends TestCase
$this->save_file($name, $content);
$this->assertFileExists(__DIR__."/file/".$name);
}
/**
* @covers Acc_Ledger_History::get_ledger_type
*/
function testGet_Ledger_type()
{
$this->assertEquals($this->object->get_ledger_type(),'ACH');
}
}

View file

@ -55,7 +55,7 @@ class Acc_Ledger_History_SaleTest extends TestCase
function testGet_row()
{
$this->object->get_row();
$this->assertSame(count($this->object->get_data()),4);
$this->assertSame(count($this->object->get_data()),6);
}
private function save_file($p_name,$content)
{
@ -110,4 +110,12 @@ class Acc_Ledger_History_SaleTest extends TestCase
$this->save_file($name, $content);
$this->assertFileExists(__DIR__."/file/".$name);
}
/**
* @covers Acc_Ledger_History::get_ledger_type
*/
function testGet_Ledger_type()
{
$this->assertEquals($this->object->get_ledger_type(),'VEN');
}
}

View file

@ -3,8 +3,9 @@
use PHPUnit\Framework\TestCase;
/**
* Generated by PHPUnit_SkeletonGenerator on 2014-11-08 at 14:20:36.
* @backupGlobals enabled
* @coversDefaultClass Acc_Ledger_Purchase
*
*/
class Acc_Ledger_PurchaseTest extends TestCase
{
@ -102,7 +103,6 @@ class Acc_Ledger_PurchaseTest extends TestCase
/**
* @covers Acc_Ledger_Purchase::insert
* @todo Implement testInsert().
*/
public function testInsert()
{
@ -128,7 +128,6 @@ class Acc_Ledger_PurchaseTest extends TestCase
/**
* @covers Acc_Ledger_Purchase::input
* @todo Implement testInput().
*/
public function testInput()
{
@ -138,7 +137,7 @@ class Acc_Ledger_PurchaseTest extends TestCase
"acc_ledger_purchase_input.html",
\Noalyss\Facility::page_start().$res);
$this->assertContains(
'<OPTION VALUE="3" SELECTED>Achat</SELECT>',
'<OPTION VALUE="3" SELECTED>Achat',
$res);
$this->assertContains('<INPUT TYPE="hidden" id="jrn_type" NAME="jrn_type" VALUE="ACH"',$res);
$this->assertContains('<td class="num"> <span id="tvac" >0.0</span> </td>',$res);
@ -147,7 +146,6 @@ class Acc_Ledger_PurchaseTest extends TestCase
/**
* @covers Acc_Ledger_Purchase::confirm
* @todo Implement testConfirm().
*/
public function testConfirm()
{
@ -161,14 +159,29 @@ class Acc_Ledger_PurchaseTest extends TestCase
$this->assertContains("value=\"Efface détail\" onClick=\"anc_key_clean('25','','658.25','','','0');",$ret);
$this->assertContains('NAME="e_quant0" VALUE="1">',$ret);
}
private function clean_operation()
{
global $g_connection;
$g_connection->exec_sql("delete from jrn where jr_mt=$1", ["1572704002.1732"]);
$g_connection->exec_sql("delete from jrnx where j_grpt not in (select jr_grpt_id from jrn)");
$g_connection->exec_sql("alter sequence s_jrn_pj3 restart with 52");
}
/**
* @covers ::get_detail_purchase
*/
public function testget_detail_purchase()
{
// 92 = 1.1.2018 and 103 = 31.12.2018
$ret=$this->object->get_detail_purchase(92,103,'all');
$this->assertEquals(7,Database::num_row($ret),"all operation (no filter)");
$ret=$this->object->get_detail_purchase(92,103,'paid');
$this->assertEquals(2,Database::num_row($ret),'only paid operations');
$ret=$this->object->get_detail_purchase(92,103,'unpaid');
$this->assertEquals(5,Database::num_row($ret),'only unpaid operations');
}
}

View file

@ -3,8 +3,8 @@
use PHPUnit\Framework\TestCase;
/**
* Generated by PHPUnit_SkeletonGenerator on 2014-11-08 at 14:20:37.
* @backupGlobals enabled
* @coversDefaultClass Acc_Ledger_Sold
*/
class Acc_Ledger_SoldTest extends TestCase
{
@ -83,6 +83,7 @@ class Acc_Ledger_SoldTest extends TestCase
global $g_connection;
$g_connection->exec_sql("delete from jrn where jr_mt=$1", ["1572714478.3155"]);
$g_connection->exec_sql("delete from jrnx where j_grpt not in (select jr_grpt_id from jrn)");
$g_connection->exec_sql("alter sequence s_jrn_pj2 restart with 40");
}
/**
* @covers Acc_Ledger_Sold::verify
@ -90,6 +91,7 @@ class Acc_Ledger_SoldTest extends TestCase
public function testVerify()
{
$this->object->verify_operation($this->array);
$this->assertTrue(TRUE);
}
/**
@ -157,17 +159,6 @@ class Acc_Ledger_SoldTest extends TestCase
$this->assertContains('ID="add_item" VALUE="Ajout article" onClick="ledger_add_row()">', $info);
}
/**
* @covers Acc_Ledger_Sold::get_detail_sale
* @todo Implement testGet_detail_sale().
*/
public function testGet_detail_sale()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
}
/**
* @covers Acc_Ledger_Sold::heading_detail_sale
@ -175,10 +166,23 @@ class Acc_Ledger_SoldTest extends TestCase
*/
public function testHeading_detail_sale()
{
// Remove the following lines when you implement this test.
$this->markTestIncomplete(
'This test has not been implemented yet.'
);
$a=$this->object->heading_detail_sale();
$this->assertEquals(28,count($a));
}
/**
* @covers Acc_Ledger_Sold::get_detail_sale
*/
public function testget_detail_sale()
{
// 92 = 1.1.2018 and 103 = 31.12.2018
$ret=$this->object->get_detail_sale(92,103,'all');
$this->assertEquals(7,Database::num_row($ret),"all operation (no filter)");
$ret=$this->object->get_detail_sale(92,103,'paid');
$this->assertEquals(2,Database::num_row($ret),'only paid operations');
$ret=$this->object->get_detail_sale(92,103,'unpaid');
$this->assertEquals(5,Database::num_row($ret),'only unpaid operations');
}
}

View file

@ -1,5 +1,5 @@
<?php
$a_result = array (
$a_result= array (
0 =>
array (
'jrn_def_name' => 'Achat',
@ -37,8 +37,8 @@ $a_result = array (
'tva_rate' => '0.2100',
'tva_both_side' => '0',
'qp_vat_code' => '1',
'amount_vat' => '38.4300',
'amount_wovat' => '183.0000',
'amount_vat' => '44.5300',
'amount_wovat' => '212.0000',
'amount_sided' => '0.0000',
'amount_noded_amount' => '0.0000',
'amount_noded_tax' => '0.0000',
@ -46,6 +46,21 @@ $a_result = array (
'amount_private' => '0.0000',
),
3 =>
array (
'jrn_def_name' => 'Achat',
'tva_label' => '6%',
'tva_rate' => '0.0600',
'tva_both_side' => '0',
'qp_vat_code' => '3',
'amount_vat' => '5.2800',
'amount_wovat' => '88.3200',
'amount_sided' => '0.0000',
'amount_noded_amount' => '0.0000',
'amount_noded_tax' => '0.0000',
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
4 =>
array (
'jrn_def_name' => 'Achat',
'tva_label' => 'ART44',
@ -60,7 +75,7 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
4 =>
5 =>
array (
'jrn_def_name' => 'Achat',
'tva_label' => 'EXPORT',
@ -75,7 +90,7 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
5 =>
6 =>
array (
'jrn_def_name' => 'Achat',
'tva_label' => 'IMMO',
@ -90,7 +105,7 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
6 =>
7 =>
array (
'jrn_def_name' => 'Achat',
'tva_label' => 'VOIT',
@ -105,22 +120,22 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
7 =>
8 =>
array (
'jrn_def_name' => 'Frais Divers',
'tva_label' => '21%',
'tva_rate' => '0.2100',
'tva_both_side' => '0',
'qp_vat_code' => '1',
'amount_vat' => '140.0400',
'amount_wovat' => '666.8600',
'amount_vat' => '244.5500',
'amount_wovat' => '1164.5400',
'amount_sided' => '0.0000',
'amount_noded_amount' => '0.0000',
'amount_noded_tax' => '0.0000',
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
8 =>
9 =>
array (
'jrn_def_name' => 'Frais Divers',
'tva_label' => 'EXPORT',
@ -135,7 +150,7 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
9 =>
10 =>
array (
'jrn_def_name' => 'Frais Divers',
'tva_label' => 'IMMO',
@ -150,7 +165,7 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
10 =>
11 =>
array (
'jrn_def_name' => 'Frais Divers',
'tva_label' => 'INTRA',
@ -165,7 +180,7 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
11 =>
12 =>
array (
'jrn_def_name' => 'Frais Divers',
'tva_label' => 'VOIT',

View file

@ -8,8 +8,8 @@ array (
'qs_vat_code' => '1',
'tva_rate' => '0.2100',
'tva_both_side' => '0',
'amount_vat' => '16.8000',
'amount_wovat' => '80.0000',
'amount_vat' => '219.5700',
'amount_wovat' => '1045.6000',
'amount_sided' => '0.0000',
'tva_type' => 'P',
),
@ -44,8 +44,8 @@ array (
'qs_vat_code' => '1003',
'tva_rate' => '0.2100',
'tva_both_side' => '0',
'amount_vat' => '10.7500',
'amount_wovat' => '51.2000',
'amount_vat' => '19.1500',
'amount_wovat' => '91.2000',
'amount_sided' => '0.0000',
'tva_type' => 'P',
),

View file

@ -1,5 +1,4 @@
<?php
$a_result = array (
0 =>
array (
@ -35,8 +34,8 @@ $a_result = array (
'tva_rate' => '0.2100',
'tva_both_side' => '0',
'qp_vat_code' => '1',
'amount_vat' => '178.4700',
'amount_wovat' => '849.8600',
'amount_vat' => '289.0800',
'amount_wovat' => '1376.5400',
'amount_sided' => '0.0000',
'amount_noded_amount' => '0.0000',
'amount_noded_tax' => '0.0000',
@ -44,6 +43,20 @@ $a_result = array (
'amount_private' => '0.0000',
),
3 =>
array (
'tva_label' => '6%',
'tva_rate' => '0.0600',
'tva_both_side' => '0',
'qp_vat_code' => '3',
'amount_vat' => '5.2800',
'amount_wovat' => '88.3200',
'amount_sided' => '0.0000',
'amount_noded_amount' => '0.0000',
'amount_noded_tax' => '0.0000',
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
4 =>
array (
'tva_label' => 'ART44',
'tva_rate' => '0.0000',
@ -57,7 +70,7 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
4 =>
5 =>
array (
'tva_label' => 'EXPORT',
'tva_rate' => '0.0000',
@ -71,7 +84,7 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
5 =>
6 =>
array (
'tva_label' => 'IMMO',
'tva_rate' => '0.2100',
@ -85,7 +98,7 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
6 =>
7 =>
array (
'tva_label' => 'INTRA',
'tva_rate' => '0.0000',
@ -99,7 +112,7 @@ $a_result = array (
'amount_noded_return' => '0.0000',
'amount_private' => '0.0000',
),
7 =>
8 =>
array (
'tva_label' => 'VOIT',
'tva_rate' => '0.2100',

View file

@ -1,5 +1,5 @@
<?php
$a_result =
$a_result =
array (
0 =>
array (
@ -7,10 +7,10 @@ array (
'qs_vat_code' => '1',
'tva_rate' => '0.2100',
'tva_both_side' => '0',
'amount_vat' => '16.8000',
'amount_wovat' => '80.0000',
'amount_vat' => '219.5700',
'amount_wovat' => '1045.6000',
'amount_sided' => '0.0000',
'tva_payment_sale' => 'P',
'tva_payment_sale' => 'O',
),
1 =>
array (
@ -40,9 +40,9 @@ array (
'qs_vat_code' => '1003',
'tva_rate' => '0.2100',
'tva_both_side' => '0',
'amount_vat' => '10.7500',
'amount_wovat' => '51.2000',
'amount_vat' => '19.1500',
'amount_wovat' => '91.2000',
'amount_sided' => '0.0000',
'tva_payment_sale' => 'P',
'tva_payment_sale' => 'O',
),
);

View file

@ -89,7 +89,7 @@ class Tax_SummaryTest extends TestCase
{
$nb_result=count($p_array_expected);
$nb_array=count($p_array);
$this->assertEquals($nb_result, $nb_array);
$this->assertEquals($nb_result, $nb_array,$p_scenario);
$ix=0;
switch ($jrn_type)
{
@ -204,7 +204,7 @@ class Tax_SummaryTest extends TestCase
$this->object->set_tva_type("T");
$array=$this->object->get_row_sale();
//-- For creating the array
// Noalyss\Facility::save_file(__DIR__."/file", "tax_summary_getrow_sale_t.txt", var_export($array, TRUE));
//Noalyss\Facility::save_file(__DIR__."/file", "tax_summary_getrow_sale_t.txt", var_export($array, TRUE));
require __DIR__."/data/tax_summary_getrow_sale_t.php";
$this->check_result("tva_type = T , get_row_sale",$array,$a_result,'VEN');
@ -215,7 +215,7 @@ class Tax_SummaryTest extends TestCase
$this->object->set_tva_type("T");
$array=$this->object->get_summary_purchase();
//-- For creating the array
// Noalyss\Facility::save_file(__DIR__."/file", "tax_summary_getsummary_purchase_t.txt", var_export($array, TRUE));
Noalyss\Facility::save_file(__DIR__."/file", "tax_summary_getsummary_purchase_t.txt", var_export($array, TRUE));
require __DIR__."/data/tax_summary_getsummary_purchase_t.php";
$this->check_result("tva_type = T , get_summary_purchase",$array,$a_result,'SMRACH');
@ -256,7 +256,7 @@ class Tax_SummaryTest extends TestCase
$this->object->set_tva_type("T");
$array=$this->object->get_summary_sale();
//-- For creating the array
//Noalyss\Facility::save_file(__DIR__."/file", "tax_summary_getsummary_sale_t.txt", var_export($array, TRUE));
Noalyss\Facility::save_file(__DIR__."/file", "tax_summary_getsummary_sale_t.txt", var_export($array, TRUE));
require __DIR__."/data/tax_summary_getsummary_sale_t.php";
$this->check_result("tva_type = T , get_summary_sale",$array,$a_result,'SMRVEN');

View file

@ -37,6 +37,8 @@ if [ ! -z "$FUNCTION" ] ; then
$PHPUNIT --bootstrap bootstrap.php --verbose --color --filter $FUNCTION $FILETOTEST
else
$PHPUNIT --bootstrap bootstrap.php --color $FILETOTEST
# $PHPUNIT --bootstrap bootstrap.php --whitelist $FILETOTEST --coverage-text=${FILETOTEST%.php}.txt --color $FILETOTEST
$PHPUNIT --bootstrap bootstrap.php --whitelist=../include/class --coverage-html=coverage --color $FILETOTEST
#$PHPUNIT --bootstrap bootstrap.php $FILETOTEST --testdox-html ${FILETOTEST%.php}-testdox.html --color $FILETOTEST
fi