35 foreach ($this->_aList as $oPrice) {
36 $dSum += $oPrice->getBruttoPrice();
50 foreach ($this->_aList as $oPrice) {
51 $dSum += $oPrice->getNettoPrice();
64 public function getSum($isNettoMode =
true)
82 $aVatValues = array();
84 foreach ($this->_aList as $oPrice) {
85 $sKey = ( string ) $oPrice->getVat();
86 if (!isset($aPrices[$sKey])) {
87 $aPrices[$sKey][
'sum'] = 0;
88 $aPrices[$sKey][
'vat'] = $oPrice->getVat();
90 $aPrices[$sKey][
'sum'] += $oPrice->getPrice();
93 foreach ($aPrices as $sKey => $aPrice) {
95 $dPrice = $aPrice[
'sum'] * $aPrice[
'vat'] / 100;
97 $dPrice = $aPrice[
'sum'] * $aPrice[
'vat'] / (100 + $aPrice[
'vat']);
99 $aVatValues[$sKey] = $dPrice;
114 foreach ($this->_aList as $oPrice) {
115 $sVat = ( string ) $oPrice->getVat();
116 if (!isset($aPrices[$sVat])) {
119 $aPrices[$sVat] += $oPrice->getBruttoPrice();
134 if (count($aPrices) == 0) {
138 $aVats = array_keys($aPrices, max($aPrices));
152 foreach ($this->_aList as $oPrice) {
153 $dTotalSum += $oPrice->getNettoPrice();
156 $dProportionalVat = 0;
158 foreach ($this->_aList as $oPrice) {
159 if ($dTotalSum > 0) {
160 $dProportionalVat += $oPrice->getNettoPrice() / $dTotalSum * $oPrice->getVat();
164 return $dProportionalVat;
175 $this->_aList[] = $oPrice;
185 if (count($this->_aList) == 0) {
193 foreach ($this->_aList as $oPrice) {
194 $dNetoTotal += $oPrice->getNettoPrice();
195 $dVatTotal += $oPrice->getVatValue();
198 $oPrice =
oxNew(
'oxPrice');
201 $dVat = $dVatTotal * 100 / $dNetoTotal;
203 $oPrice->setNettoPriceMode();
204 $oPrice->setPrice($dNetoTotal);
205 $oPrice->setVat($dVat);
218 return count($this->_aList);