Ejemplo n.º 1
0
 /**
  * @internal
  * @return array
  */
 public static function getRoundFields()
 {
     $isOrderConverted = \Bitrix\Main\Config\Option::get("main", "~sale_converted_15", 'N');
     if ($isOrderConverted == "Y") {
         return Sale\Basket::getRoundFields();
     }
     return array('PRICE', 'DISCOUNT_PRICE', 'VAT_RATE', 'VAT_VALUE', 'DISCOUNT_PRICE_PERCENT');
 }
Ejemplo n.º 2
0
 /**
  * Round basket results.
  * @return void
  */
 protected function roundBasketPrices()
 {
     $roundFields = Basket::getRoundFields();
     if (empty($roundFields)) {
         return;
     }
     $roundFields = array_fill_keys($roundFields, true);
     foreach ($this->orderData['BASKET_ITEMS'] as $basketCode => $basketItem) {
         foreach ($basketItem as $field => $value) {
             if (isset($roundFields[$field])) {
                 $basketItem[$field] = roundEx($value, SALE_VALUE_PRECISION);
             }
         }
         unset($field, $value);
         $this->orderData['BASKET_ITEMS'][$basketCode] = $basketItem;
     }
     unset($basketCode, $basketItem);
 }