noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
Additional_Tax Class Reference

Additional tax , Canada and France on sales. More...

+ 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
 
static get_by_operation ($p_jrn_id, &$sum_euro, &$sum_currency)
 create an array of Additional_Tax
 

Private Attributes

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

Detailed Description

Additional tax , Canada and France on sales.

Definition at line 31 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 41 of file additional_tax.class.php.

42 {
43 $this->tax_amount = round($tax_amount, 2);
44 $this->currency_amount = round($currency_amount, 4);
45 $this->currency_id = $currency_id;
46 $this->ac_id = $ac_id;
47 $this->ac_label = $ac_label;
48 $this->ac_rate = $ac_rate;
49 $this->ac_accounting = $ac_accounting;
50 }

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 169 of file additional_tax.class.php.

170 {
171 global $g_parameter;
172 $a_additional_tax = Additional_Tax::get_by_operation($p_jrn_id, $sum_euro, $sum_currency);
173 $nb = count($a_additional_tax);
174 for ($i = 0; $i < $nb; $i++) {
175 echo '<tr>';
176
177 echo td($a_additional_tax[$i]->ac_accounting);
178 echo td($a_additional_tax[$i]->ac_label . " ( " . $a_additional_tax[$i]->ac_rate . " %)");
179 echo td(nbm($a_additional_tax[$i]->tax_amount), 'class="num"');
180 if ($g_parameter->MY_TVA_USE == 'Y')
181 echo td("") . td("") . td("") . td("");
182 else
183 echo td("") ;
184 for ($e = 0; $e < $decalage; $e++) {
185 echo td("");
186 }
187 echo td(nbm($a_additional_tax[$i]->tax_amount), 'class="num"');
188 if ($a_additional_tax[$i]->currency_id != 0) {
189 echo td(nbm($a_additional_tax[$i]->currency_amount), 'class="num"');
190 }
191 echo '</tr>';
192 }
193 }
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.
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 115 of file additional_tax.class.php.

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

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 103 of file additional_tax.class.php.

104 {
106 }

References $ac_accounting.

◆ getAcId()

Additional_Tax::getAcId ( )
Returns
mixed

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

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

References $ac_id.

◆ getAcLabel()

Additional_Tax::getAcLabel ( )
Returns
mixed

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

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

References $ac_label.

◆ getAcRate()

Additional_Tax::getAcRate ( )
Returns
mixed

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

96 {
97 return $this->ac_rate;
98 }

References $ac_rate.

◆ getCurrencyAmount()

Additional_Tax::getCurrencyAmount ( )
Returns
float

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

63 : float
64 {
66 }

References $currency_amount.

◆ getCurrencyId()

Additional_Tax::getCurrencyId ( )
Returns
mixed

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

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

References $currency_id.

◆ getTaxAmount()

Additional_Tax::getTaxAmount ( )
Returns
float

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

55 : float
56 {
57 return $this->tax_amount;
58 }

References $tax_amount.

Field Documentation

◆ $ac_accounting

Additional_Tax::$ac_accounting
private

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

Referenced by __construct(), and getAcAccounting().

◆ $ac_id

Additional_Tax::$ac_id
private

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

Referenced by __construct(), and getAcId().

◆ $ac_label

Additional_Tax::$ac_label
private

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

Referenced by __construct(), and getAcLabel().

◆ $ac_rate

Additional_Tax::$ac_rate
private

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

Referenced by __construct(), and getAcRate().

◆ $currency_amount

Additional_Tax::$currency_amount
private

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

Referenced by __construct(), and getCurrencyAmount().

◆ $currency_id

Additional_Tax::$currency_id
private

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

Referenced by __construct(), and getCurrencyId().

◆ $tax_amount

Additional_Tax::$tax_amount
private

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

Referenced by __construct(), and getTaxAmount().


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