34 foreach ( $this->_aList as $oPrice ) {
35 $dSum += $oPrice->getBruttoPrice();
49 foreach ( $this->_aList as $oPrice ) {
50 $dSum += $oPrice->getNettoPrice();
63 public function getSum( $isNettoMode =
true )
81 $aVatValues = array();
83 foreach ( $this->_aList as $oPrice ) {
84 $sKey = ( string ) $oPrice->getVat();
85 if ( !isset( $aPrices[$sKey] )) {
86 $aPrices[$sKey][
'sum'] = 0;
87 $aPrices[$sKey][
'vat'] = $oPrice->getVat();
89 $aPrices[$sKey][
'sum'] += $oPrice->getPrice();
92 foreach ( $aPrices as $sKey => $aPrice ) {
94 $dPrice = $aPrice[
'sum'] * $aPrice[
'vat'] / 100;
96 $dPrice = $aPrice[
'sum'] * $aPrice[
'vat'] / ( 100 + $aPrice[
'vat'] );
98 $aVatValues[$sKey] = $dPrice;
113 foreach ( $this->_aList as $oPrice ) {
114 $sVat = ( string ) $oPrice->getVat();
115 if ( !isset( $aPrices[$sVat] )) {
118 $aPrices[$sVat] += $oPrice->getBruttoPrice();
133 if ( count( $aPrices ) == 0 ) {
137 $aVats = array_keys( $aPrices, max( $aPrices ) );
138 return max( $aVats );
150 foreach ( $this->_aList as $oPrice ) {
151 $dTotalSum += $oPrice->getNettoPrice();
154 $dProportionalVat = 0;
156 foreach ( $this->_aList as $oPrice ) {
157 if ( $dTotalSum > 0 ) {
158 $dProportionalVat += $oPrice->getNettoPrice() / $dTotalSum * $oPrice->getVat();
162 return $dProportionalVat;
176 $this->_aList[] = $oPrice;
186 if ( count($this->_aList) == 0 ) {
194 foreach ( $this->_aList as $oPrice ) {
195 $dNetoTotal += $oPrice->getNettoPrice();
196 $dVatTotal += $oPrice->getVatValue();
199 $oPrice =
oxNew(
'oxPrice');
202 $dVat = $dVatTotal*100/$dNetoTotal;
204 $oPrice->setNettoPriceMode();
205 $oPrice->setPrice($dNetoTotal);
206 $oPrice->setVat($dVat);
219 return count($this->_aList);