Ejemplo n.º 1
0
 /**
  * @return array
  */
 protected function createTaxSetsList()
 {
     $taxSetCollection = $this->taxFacade->getTaxSets();
     if (!$taxSetCollection) {
         return [];
     }
     $taxSetList = [];
     foreach ($taxSetCollection->getTaxSets() as $taxSetTransfer) {
         $taxSetList[$taxSetTransfer->getIdTaxSet()] = $taxSetTransfer->getName();
     }
     return $taxSetList;
 }
Ejemplo n.º 2
0
 /**
  * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer
  *
  * @return void
  */
 public function recalculate(QuoteTransfer $quoteTransfer)
 {
     if ($quoteTransfer->getShipment() === null || $quoteTransfer->getShipment()->getMethod() === null) {
         return;
     }
     $taxRate = $this->taxFacade->getDefaultTaxRate();
     $taxSetEntity = $this->findTaxSetByIdShipmentMethod($quoteTransfer);
     if ($taxSetEntity !== null) {
         $taxRate = (double) $taxSetEntity[ShipmentQueryContainer::COL_MAX_TAX_RATE];
     }
     $this->setShipmentTaxRate($quoteTransfer, $taxRate);
     $this->setQuoteExpenseTaxRate($quoteTransfer, $taxRate);
 }