noalyss Version-9
Public Member Functions | Static Public Member Functions | Private Attributes
Additional_Tax Class Reference
+ Collaboration diagram for Additional_Tax:

Public Member Functions

 __construct ($tax_amount, $currency_amount, $currency_id, $ac_id, $ac_label, $ac_rate, $ac_accounting)
 
 getAcAccounting ()
 
 getAcId ()
 
 getAcLabel ()
 
 getAcRate ()
 
 getCurrencyAmount ()
 
 getCurrencyId ()
 
 getTaxAmount ()
 

Static Public Member Functions

static display_row ($p_jrn_id, &$sum_euro, &$sum_currency, $decalage=0)
 display the additional_tax in the ledger_detail for Sales and Purchase More...
 
static get_by_operation ($p_jrn_id, &$sum_euro, &$sum_currency)
 create an array of Additional_Tax More...
 

Private Attributes

 $ac_accounting
 
 $ac_id
 
 $ac_label
 
 $ac_rate
 
 $currency_amount
 
 $currency_id
 
 $tax_amount
 

Detailed Description

Definition at line 23 of file additional_tax.class.php.

Constructor & Destructor Documentation

◆ __construct()

Additional_Tax::__construct (   $tax_amount,
  $currency_amount,
  $currency_id,
  $ac_id,
  $ac_label,
  $ac_rate,
  $ac_accounting 
)

Definition at line 33 of file additional_tax.class.php.

34 {
35 $this->tax_amount = round($tax_amount, 2);
36 $this->currency_amount = round($currency_amount, 4);
37 $this->currency_id = $currency_id;
38 $this->ac_id = $ac_id;
39 $this->ac_label = $ac_label;
40 $this->ac_rate = $ac_rate;
41 $this->ac_accounting = $ac_accounting;
42 }

References $ac_accounting, $ac_id, $ac_label, $ac_rate, $currency_amount, $currency_id, and $tax_amount.

Member Function Documentation

◆ display_row()

static Additional_Tax::display_row (   $p_jrn_id,
$sum_euro,
$sum_currency,
  $decalage = 0 
)
static

display the additional_tax in the ledger_detail for Sales and Purchase

Parameters
$p_jrn_id
$sum_euro
$sum_currency
int$decalage

Definition at line 161 of file additional_tax.class.php.

162 {
163 global $g_parameter;
164 $a_additional_tax = Additional_Tax::get_by_operation($p_jrn_id, $sum_euro, $sum_currency);
165 $nb = count($a_additional_tax);
166 for ($i = 0; $i < $nb; $i++) {
167 echo '<tr>';
168
169 echo td($a_additional_tax[$i]->ac_accounting);
170 echo td($a_additional_tax[$i]->ac_label . " ( " . $a_additional_tax[$i]->ac_rate . " %)");
171 echo td(nbm($a_additional_tax[$i]->tax_amount), 'class="num"');
172 if ($g_parameter->MY_TVA_USE == 'Y')
173 echo td("") . td("") . td("") . td("");
174 else
175 echo td("") ;
176 for ($e = 0; $e < $decalage; $e++) {
177 echo td("");
178 }
179 echo td(nbm($a_additional_tax[$i]->tax_amount), 'class="num"');
180 if ($a_additional_tax[$i]->currency_id != 0) {
181 echo td(nbm($a_additional_tax[$i]->currency_amount), 'class="num"');
182 }
183 echo '</tr>';
184 }
185 }
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
nbm($p_number, $p_dec=2)
format the number with a sep.
Definition: ac_common.php:137
global $g_parameter
static get_by_operation($p_jrn_id, &$sum_euro, &$sum_currency)
create an array of Additional_Tax

References $e, $g_parameter, $i, $nb, get_by_operation(), nbm(), and td().

+ Here is the call graph for this function:

◆ get_by_operation()

static Additional_Tax::get_by_operation (   $p_jrn_id,
$sum_euro,
$sum_currency 
)
static

create an array of Additional_Tax

Parameters
$p_jrn_id
$sum_euro
$sum_currency
Returns
array

Definition at line 107 of file additional_tax.class.php.

108 {
109 bcscale(4);
110 global $cn;
111 $array = $cn->get_array("select
112 case when j_debit is false and jn.jrn_def_type='ACH' then 0-j_montant
113 when j_debit is true and jn.jrn_def_type='VEN' then 0-j_montant
114 else j_montant end j_montant,
115 jrn.currency_id,
116 oc_amount,
117 jt.ac_id,
118 jrnx.j_debit,
119 aot.ac_label,
120 aot.ac_rate,
121 aot.ac_accounting,
122 jn.jrn_def_type
123 from jrn_tax jt
124 join jrnx using (j_id)
125 join jrn on (jrnx.j_grpt=jrn.jr_grpt_id)
126 join jrn_def jn on (jrn.jr_def_id=jn.jrn_def_id)
127 join acc_other_tax aot on (jt.ac_id=aot.ac_id)
128 left join operation_currency oc ON (oc.j_id=jt.j_id)
129 where
130 jr_id=$1", [$p_jrn_id]);
131 $sum_currency = 0;
132 $sum_euro = 0;
133 if (empty($array)) {
134 return array();
135 }
136 $nb = count($array);
137 $a_additional_tax = array();
138 for ($i = 0; $i < $nb; $i++) {
139 $a_additional_tax[] = new Additional_Tax($array[$i]['j_montant'],
140 $array[$i]['oc_amount'],
141 $array[$i]['currency_id'],
142 $array[$i]['ac_id'],
143 $array[$i]['ac_label'],
144 $array[$i]['ac_rate'],
145 $array[$i]['ac_accounting'],
146 );
147 $sum_euro = bcadd($sum_euro, $array[$i]['j_montant']);
148 $sum_currency = bcadd($sum_currency, $array[$i]['oc_amount']);
149 }
150 $sum_euro = round($sum_euro, 2);
151 return $a_additional_tax;
152 }

References $array, $cn, $i, and $nb.

Referenced by display_row(), and PDF_Operation\print_other_tax().

◆ getAcAccounting()

Additional_Tax::getAcAccounting ( )
Returns
mixed

Definition at line 95 of file additional_tax.class.php.

96 {
98 }

References $ac_accounting.

◆ getAcId()

Additional_Tax::getAcId ( )
Returns
mixed

Definition at line 71 of file additional_tax.class.php.

72 {
73 return $this->ac_id;
74 }

References $ac_id.

◆ getAcLabel()

Additional_Tax::getAcLabel ( )
Returns
mixed

Definition at line 79 of file additional_tax.class.php.

80 {
81 return $this->ac_label;
82 }

References $ac_label.

◆ getAcRate()

Additional_Tax::getAcRate ( )
Returns
mixed

Definition at line 87 of file additional_tax.class.php.

88 {
89 return $this->ac_rate;
90 }

References $ac_rate.

◆ getCurrencyAmount()

Additional_Tax::getCurrencyAmount ( )
Returns
float

Definition at line 55 of file additional_tax.class.php.

55 : float
56 {
58 }

References $currency_amount.

◆ getCurrencyId()

Additional_Tax::getCurrencyId ( )
Returns
mixed

Definition at line 63 of file additional_tax.class.php.

64 {
65 return $this->currency_id;
66 }

References $currency_id.

◆ getTaxAmount()

Additional_Tax::getTaxAmount ( )
Returns
float

Definition at line 47 of file additional_tax.class.php.

47 : float
48 {
49 return $this->tax_amount;
50 }

References $tax_amount.

Field Documentation

◆ $ac_accounting

Additional_Tax::$ac_accounting
private

Definition at line 31 of file additional_tax.class.php.

Referenced by __construct(), and getAcAccounting().

◆ $ac_id

Additional_Tax::$ac_id
private

Definition at line 28 of file additional_tax.class.php.

Referenced by __construct(), and getAcId().

◆ $ac_label

Additional_Tax::$ac_label
private

Definition at line 29 of file additional_tax.class.php.

Referenced by __construct(), and getAcLabel().

◆ $ac_rate

Additional_Tax::$ac_rate
private

Definition at line 30 of file additional_tax.class.php.

Referenced by __construct(), and getAcRate().

◆ $currency_amount

Additional_Tax::$currency_amount
private

Definition at line 26 of file additional_tax.class.php.

Referenced by __construct(), and getCurrencyAmount().

◆ $currency_id

Additional_Tax::$currency_id
private

Definition at line 27 of file additional_tax.class.php.

Referenced by __construct(), and getCurrencyId().

◆ $tax_amount

Additional_Tax::$tax_amount
private

Definition at line 25 of file additional_tax.class.php.

Referenced by __construct(), and getTaxAmount().


The documentation for this class was generated from the following file: