VAT : Fix minor bug, Acc_TVA::build must be used instead of new Acc_TVA
This commit is contained in:
parent
5e50919715
commit
b05b5e4204
3 changed files with 5 additions and 6 deletions
|
|
@ -1140,8 +1140,7 @@ class Document
|
|||
$march_id='e_march'.$this->counter.'_price';
|
||||
if (!isset($p_array[$march_id]))
|
||||
return '';
|
||||
$tva=new Acc_Tva($this->db);
|
||||
$tva->set_parameter("id", $p_array[$id]);
|
||||
$tva= Acc_Tva::build($this->db,$p_array[$id]);
|
||||
if ($tva->load()==-1)
|
||||
return '';
|
||||
return $tva->get_parameter("rate");
|
||||
|
|
@ -1209,7 +1208,7 @@ class Document
|
|||
// check that something is sold
|
||||
if ($p_array[$price]==0||$p_array[$qt]==0||noalyss_strlentrim($p_array[$price])==0||noalyss_strlentrim($p_array[$qt])==0)
|
||||
return "";
|
||||
$oTva=new Acc_Tva($this->db, $p_array[$tva]);
|
||||
$oTva= Acc_Tva::build($this->db, $p_array[$tva]);
|
||||
if ($oTva->load()==-1)
|
||||
return "";
|
||||
$r=noalyss_round($p_array[$price], 2)*$oTva->get_parameter('rate');
|
||||
|
|
@ -1228,7 +1227,7 @@ class Document
|
|||
return "";
|
||||
if (!isset($p_array['e_march'.$this->counter.'_tva_id']))
|
||||
return '';
|
||||
$tva=new Acc_Tva($this->db, $p_array['e_march'.$this->counter.'_tva_id']);
|
||||
$tva=Acc_Tva::build($this->db, $p_array['e_march'.$this->counter.'_tva_id']);
|
||||
if ($tva->load()==-1)
|
||||
{
|
||||
$r=noalyss_round($p_array[$price], 2);
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ class PDF_Operation extends PDF {
|
|||
* @return type
|
||||
*/
|
||||
private function str_vat($p_tva_id) {
|
||||
$tva=new Acc_Tva($this->cn, $p_tva_id);
|
||||
$tva= Acc_Tva::build($this->cn, $p_tva_id);
|
||||
$tva->load();
|
||||
$auto="";
|
||||
if ( $tva->tva_both_side==1) {
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ $str_anc = "";
|
|||
$sym_tva = '';
|
||||
if ($owner->MY_TVA_USE == 'Y' && $q['qs_vat_code'] != '') {
|
||||
/* retrieve TVA symbol */
|
||||
$tva = new Acc_Tva($cn, $q['qs_vat_code']);
|
||||
$tva = Acc_Tva::build($cn, $q['qs_vat_code']);
|
||||
$tva->load();
|
||||
$sym_tva = (h($tva->get_parameter('label')));
|
||||
$x=($g_user->get_vat_code_preference()==1)?$tva->get_parameter('tva_code'):$tva->get_parameter('id');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue