$this->_shippingCosts =
$this->_order
['invoice_shipping'
];
if ($this->_shippingCostsAsPosition === true && !
empty($this->_shippingCosts
)) { $taxes =
[];
if ($this->_order
['taxfree'
]) { $this->_amountNetto +=
$this->_order
['invoice_shipping'
];
} else { if ($this->_order
['is_proportional_calculation'
]) { $taxes =
Shopware()->
Container()->
get('shopware.cart.proportional_tax_calculator'
)->
calculate($this->_order
['invoice_shipping'
],
$this->
getPricePositions(), false
);
$taxNet = 0;
foreach ($taxes as $tax) { $taxNet +=
$tax->
getNetPrice();
$this->_tax
[number_format($tax->
getTaxRate(), 2
)] +=
$tax->
getTax();
} $this->_amountNetto +=
$taxNet;
} else { $this->_amountNetto
+= ($this->_order
['invoice_shipping'
] /
(100 +
$taxShipping) * 100
);