Task #1064 - VEN si autoliquidation montant incorrect

remove commented code
This commit is contained in:
Dany De Bontridder 2014-12-03 22:53:54 +01:00
parent 6948eebd70
commit 58cb73e17b
3 changed files with 8 additions and 6 deletions

View file

@ -73,7 +73,8 @@ if ( $t != -1 && isNumber($t) == 1 )
{
$total->set_parameter('amount_vat_rate',$tva_rate->get_parameter('rate'));
$total->compute_vat();
$tvac=bcadd($total->get_parameter('amount_vat'),$amount);
if ($tva_rate->get_parameter('both_side')== 1) $total->set_parameter('amount_vat', 0);
$tvac=($tva_rate->get_parameter('rate') == 0 || $tva_rate->get_parameter('both_side')== 1) ? $amount : bcadd($total->get_parameter('amount_vat'),$amount);
header("Content-type: text/html; charset: utf8",true);
echo '{"ctl":"'.$n.'","htva":"'.$amount.'","tva":"'.$total->get_parameter('amount_vat').'","tvac":"'.$tvac.'"}';
}

View file

@ -569,7 +569,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
if ( $g_parameter->MY_TVA_USE=='Y')
{
$acc_amount->set_parameter('amount_vat_rate',$oTva->get_parameter('rate'));
if ( strlen(trim(${'e_march'.$i.'_tva_amount'})) ==0)
if ( strlen(trim(${'e_march'.$i.'_tva_amount'})) ==0 || ${'e_march'.$i.'_tva_amount'} == 0)
{
$acc_amount->compute_vat();
@ -1489,7 +1489,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
same */
bcscale(2);
$css_void_tva=($both_side == 1)?'style="text-decoration:line-through"':'';
if ( bcsub($tva_item,$tva_computed) != 0)
if ( bcsub($tva_item,$tva_computed) != 0 && ! ($tva_item == 0 && $both_side == 1))
{
$r.='<td style="background-color:red" class="num" '.$css_void_tva.'>';

View file

@ -315,7 +315,7 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$oTva->set_parameter("id", $idx_tva);
$oTva->load();
/* if empty then we need to compute it */
if (trim($tva_item) == '') {
if (trim($tva_item) == '' || ${'e_march'.$i.'_tva_amount'} == 0) {
/* retrieve tva */
$l = new Acc_Tva($this->db, $idx_tva);
$l->load();
@ -753,14 +753,15 @@ class Acc_Ledger_Sold extends Acc_Ledger {
$r.='<td class="num">';
$r.=nbm(${"e_quant" . $i});
$r.='</td>';
$both_side=0;
if ($g_parameter->MY_TVA_USE == 'Y') {
$r.='<td class="num">';
$r.=$oTva->get_parameter('label');
$r.='</td>';
$both_side=$oTva->get_parameter("both_side");
/* warning if tva_computed and given are not the
same */
if (bcsub($tva_item, $tva_computed) != 0) {
if (bcsub($tva_item, $tva_computed) != 0 && ! ($tva_item == 0 && $both_side == 1)) {
$r.='<td style="background-color:red" class="num">';
$r.=HtmlInput::infobulle(28);
$r.='<a href="#" class="error" style="display:inline" title="' . _("Attention Différence entre TVA calculée et donnée") . '">'