/** * Add tax data for duty amounts and taxes for duty prices and discounts. * * @return self */ protected function _addDutyAmounts() { if ($this->_includeDutyPricing()) { $taxes = $this->_getTaxRecordsBySource(EbayEnterprise_Tax_Model_Record::SOURCE_DUTY); $discountTaxes = $this->_getTaxRecordsBySource(EbayEnterprise_Tax_Model_Record::SOURCE_DUTY_DISCOUNT); $priceGroup = $this->_orderItemPayload->getDutyPricing() ?: $this->_orderItemPayload->getEmptyPriceGroup(); if ($this->_duty) { $priceGroup->setAmount($this->_duty->getAmount())->setTaxClass($this->_duty->getTaxClass()); } $this->_addTaxRecordsToContainer($taxes, $priceGroup)->_addDiscountTaxRecords($discountTaxes, $priceGroup); $this->_orderItemPayload->setDutyPricing($priceGroup); } return $this; }
/** * fillout the shipping price group payload for the order item * @param Mage_Sales_Model_Order_Address * @param IOrderItem * @return self */ protected function prepareShippingPriceGroup(Mage_Sales_Model_Order_Address $address, IOrderItem $payload) { $shippingPriceGroup = $payload->getEmptyPriceGroup(); $shippingPriceGroup->setAmount((double) $address->getShippingAmount()); $this->discountHelper->transferDiscounts($address, $shippingPriceGroup); $payload->setShippingPricing($shippingPriceGroup); return $this; }