TVA-CODE small bug
This commit is contained in:
parent
2e9b11932d
commit
2fa3bc8823
3 changed files with 4 additions and 3 deletions
|
|
@ -168,7 +168,7 @@ class Acc_Ledger_Purchase extends Acc_Ledger
|
|||
if ( $g_parameter->MY_TVA_USE=='Y')
|
||||
{
|
||||
$tva_rate = Acc_Tva::build($this->db,${'e_march' . $i . '_tva_id'});
|
||||
if ($tva_rate === null)
|
||||
if ($tva_rate->tva_id == -1)
|
||||
throw new Exception(_('La fiche ').${'e_march'.$i}._('a un code tva invalide').' ['.${'e_march'.$i.'_tva_id'}.']',13);
|
||||
$tva_rate->load();
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -157,7 +157,7 @@ class Acc_Ledger_Sale extends Acc_Ledger {
|
|||
if ($g_parameter->MY_TVA_USE == 'Y') {
|
||||
$tva_rate = Acc_Tva::build($this->db,${'e_march' . $i . '_tva_id'});
|
||||
$tva_rate->load();
|
||||
if ($tva_rate === null)
|
||||
if ($tva_rate->tva_id === -1 )
|
||||
throw new Exception(_('La fiche ') . ${'e_march' . $i} . _('a un code tva invalide') . ' [' . ${'e_march' . $i . '_tva_id'} . ']', 13);
|
||||
|
||||
$tva_rate->load();
|
||||
|
|
|
|||
|
|
@ -104,9 +104,10 @@ class Acc_Tva
|
|||
}
|
||||
|
||||
/**
|
||||
*Load the VAT,
|
||||
*@brief Load the VAT, return 0 if the TVA_ID exists otherwise -1
|
||||
*@note if the label is not found then we get an message error, so the best is probably
|
||||
*to initialize the VAT object with default value
|
||||
*
|
||||
*/
|
||||
public function load():int
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue