133 if ( $this->check && $this->order != 0 )
throw new Exception (
'ORDER NOT RESPECTED');
134 $this->amount_vat=bcmul($this->amount,$this->amount_vat_rate);
135 $this->amount_vat=round($this->amount_vat,2);
136 $this->amount_vat_currency=bcmul($this->amount_vat,$this->currency_rate);
144 if ( $this->check && $this->order > 2 )
throw new Exception (
'ORDER NOT RESPECTED');
146 $this->amount_nd=bcmul($this->amount,$this->amount_nd_rate);
147 $this->amount_nd=bcdiv($this->amount_nd,100);
148 $this->amount_nd=round($this->amount_nd,2);
150 $nd_vat=bcmul($this->amount_vat,$this->amount_nd_rate);
151 $nd_vat=bcdiv($nd_vat,100);
152 $nd_vat=round($nd_vat,2);
157 if ( $this->check && $this->order > 3 )
throw new Exception (
'ORDER NOT RESPECTED');
161 $this->nd_vat=bcmul($this->amount_vat,$this->nd_vat_rate);
162 $this->nd_vat=bcdiv($this->nd_vat,100);
163 $this->nd_vat=round($this->nd_vat,2);
168 if ( $this->check && $this->order > 4 )
throw new Exception (
'ORDER NOT RESPECTED');
172 $this->nd_ded_vat=bcmul($this->amount_vat,$this->nd_ded_vat_rate);
173 $this->nd_ded_vat=bcdiv($this->nd_ded_vat,100);
174 $this->nd_ded_vat=round($this->nd_ded_vat,2);
179 if ( $this->check && $this->order != 1 )
throw new Exception (
'ORDER NOT RESPECTED');
181 if ( $this->amount == 0 )
return;
182 $this->amount_perso=bcmul($this->amount,$this->amount_perso_rate);
183 $this->amount_perso=bcdiv($this->amount_perso,100);
184 $this->amount_perso=round($this->amount_perso,2);
191 $this->amount=bcsub($this->amount,$this->amount_perso);
193 $this->amount=bcsub($this->amount,$this->amount_nd);
194 $this->amount_vat=bcsub($this->amount_vat,$this->nd_ded_vat);
195 $this->amount_vat=round($this->amount_vat,2);
196 $this->amount_vat=bcsub($this->amount_vat,$this->nd_vat);
197 $this->amount_vat=round($this->amount_vat,2);
212 foreach (self::$variable as $key=>
$value)
214 throw new Exception (
_(
"Montant invalide"));
216 if ( $p_obj !=
null )
219 foreach ( array(
'amount',
'amount_vat',
'amount_nd',
'nd_vat',
'amount_perso',
'nd_ded_vat') as
$value)
220 $sum=bcadd($sum,$this->$value);
221 if ( $p_obj->amount_vat == 0 ) $p_obj->compute_vat();
222 $cmp=bcadd($p_obj->amount,$p_obj->amount_vat);
223 $diff=bcsub($sum,$cmp);
225 throw new Exception (
_(
"ECHEC VERIFICATION : valeur totale = $sum valeur attendue = $cmp diff = $diff"));