71 $this->_blNetPriceMode =
true;
81 $this->_blNetPriceMode =
false;
93 $this->_dVat = (double) $newVat;
112 if (!$this->_blNetPriceMode && $newVat != $this->_dVat) {
113 $this->_dBrutto = self::Netto2Brutto(self::Brutto2Netto($this->_dBrutto, $this->_dVat), (
double) $newVat);
115 $this->_dVat = (double) $newVat;
140 $this->_dVat = (double) $dVat;
143 if ($this->_blNetPriceMode) {
144 $this->_dNetto = $dPrice;
146 $this->_dBrutto = $dPrice;
157 if ( $this->_blNetPriceMode ) {
171 if ( $this->_blNetPriceMode ) {
185 if ( $this->_blNetPriceMode ) {
199 if ( $this->_blNetPriceMode ) {
219 $this->
setPrice( $dPrice - self::percent( $dPrice, $dValue) );
244 if ($this->_blNetPriceMode) {
259 public function add($dValue)
262 $this->
setPrice( $dPrice + $dValue );
275 $this->
add(-$dValue);
289 $this->
setPrice( $dPrice * $dValue );
303 $this->
setPrice( $dPrice / $dValue );
322 if ($dBruttoPrice1 == $dBruttoPrice2) {
324 } elseif ($dBruttoPrice1 > $dBruttoPrice2) {
341 public static function percent($dValue, $dPercent)
343 return ((
double) $dValue * (
double) $dPercent)/100.0;
366 return (
double) ((double) $dBrutto*100.0)/(100.0 + (double) $dVat);
398 if ( $this->_blNetPriceMode ) {
417 return ( (
double ) $dPrice ) * $oCur->rate;
431 $this->_aDiscounts[] = array(
'value' => $dValue,
'type' => $sType );
451 $this->_aDiscounts = null;
465 foreach ($aDiscounts as $aDiscount) {
467 if ($aDiscount[
'type'] ==
'abs') {
468 $dPrice = $dPrice - $aDiscount[
'value'];
470 $dPrice = $dPrice * (100 - $aDiscount[
'value']) / 100;