/**
  * @internal
  *
  * @param Sale\Tax $tax
  * @param array $fields
  * @return Sale\Result
  */
 public function fillTaxFromRequest(Sale\Tax $tax, array $fields)
 {
     if (!empty($fields['COUNT_DELIVERY_TAX'])) {
         $tax->setDeliveryCalculate($fields['COUNT_DELIVERY_TAX'] == "Y");
     }
     if (!empty($fields['TAX_LIST']) && is_array($fields['TAX_LIST'])) {
         $tax->initTaxList($fields['TAX_LIST']);
     } elseif (count($tax->getTaxList()) > 0) {
         /** @var Sale\Order $order */
         if ($order = $this->getOrder()) {
             $order->refreshVat();
         }
         $tax->resetTaxList();
     }
     return new Sale\Result();
 }
Exemple #2
0
 /**
  * @return Tax|static
  */
 protected function loadTax()
 {
     return Tax::load($this);
 }
 /**
  * @internal
  *
  * @param Sale\Tax $tax
  * @param array $fields
  * @return Sale\Result
  */
 public static function fillTaxFromRequest(Sale\Tax $tax, array $fields)
 {
     if (!empty($fields['TAX_LIST']) && is_array($fields['TAX_LIST'])) {
         $tax->initTaxList($fields['TAX_LIST']);
     }
     return new Sale\Result();
 }