Merge branch 'bug-printtva' into entreprise

This commit is contained in:
Dany De Bontridder 2019-10-12 23:27:13 +02:00
commit bc89fb193b
2 changed files with 29 additions and 14 deletions

View file

@ -104,31 +104,34 @@ class Tax_Summary
/*-------------SALE ---------------------------------*/
$sql="select count(*)
from
jrnx
join quant_sold on (quant_sold.j_id = jrnx.j_id)
quant_sold
where
jrnx.j_jrn_def in (select jrn_def_id from jrn_def where jrn_def_type = 'VEN')
and j_date >= to_date($1,'DD.MM.YYYY')
and j_date <= to_date($2,'DD.MM.YYYY')
j_id in (select j_id from jrnx
where
jrnx.j_jrn_def in (select jrn_def_id from jrn_def where jrn_def_type = 'VEN')
and j_date >= to_date($1,'DD.MM.YYYY')
and j_date <= to_date($2,'DD.MM.YYYY')
)
";
$cnt=$this->db->get_value($sql,[$this->date_start,$this->date_end]);
if ($cnt == 0) {
throw new Exception(_("Aucune Donnée"));
throw new Exception(_("Données manquantes"));
}
/*-------------Purchase ---------------------------------*/
$sql="select count(*)
from
jrnx
join quant_purchase as qp on (jrnx.j_id = qp.j_id)
quant_purchase
where
jrnx.j_jrn_def in (select jrn_def_id from jrn_def where jrn_def_type = 'ACH')
and j_date >= to_date($1,'DD.MM.YYYY')
and j_date <= to_date($2,'DD.MM.YYYY')
j_id in (select j_id from jrnx
where
jrnx.j_jrn_def in (select jrn_def_id from jrn_def where jrn_def_type = 'VEN')
and j_date >= to_date($1,'DD.MM.YYYY')
and j_date <= to_date($2,'DD.MM.YYYY')
)
";
$cnt=$this->db->get_value($sql,[$this->date_start,$this->date_end]);
if ($cnt == 0) {
throw new Exception(_("Aucune Donnée"));
if ($cnt > 0) {
throw new Exception(_("Données manquantes"));
}
}

View file

@ -155,7 +155,14 @@ class Acc_ComputeTest extends TestCase
*/
public function testCorrect()
{
$this->object->amount=100.0;
$this->object->amount_perso=15.3333;
$this->object->amount_vat=20.6666;
$this->object->amount_nd_vat=1.5;
$this->object->correct();
$this->assertEquals($this->object->amount,84.6667);
$this->assertEquals($this->object->amount_perso,15.3333);
$this->assertEquals($this->object->amount_vat,20.67);
}
/**
@ -167,6 +174,7 @@ class Acc_ComputeTest extends TestCase
$this->object->verify();
$new=new Acc_Compute();
$this->object->verify($new);
$this->assertTrue(TRUE);
}
/**
@ -176,7 +184,11 @@ class Acc_ComputeTest extends TestCase
*/
public function testDisplay()
{
ob_start();
$this->object->display();
$result= ob_get_flush();
$this->assertStringStartsWith("key amount Description amount value is 0<br>key amount_vat Description amount_vat value is 0<br>",$result);
$this->assertStringEndsWith("<br>key amount_perso_rate Description amount_perso_rate value is 0<br>",$result);
}
/**