Exemplo n.º 1
0
 public static function GetVatRateInfos()
 {
     if (self::$VAT_RATES !== null) {
         return self::$VAT_RATES;
     }
     if (!CModule::IncludeModule('catalog')) {
         return array();
     }
     self::$VAT_RATES = array();
     $dbResult = CCatalogVat::GetListEx(array('C_SORT' => 'ASC'), array('ACTIVE' => 'Y'), false, false, array('ID', 'NAME', 'RATE'));
     if (is_object($dbResult)) {
         while ($fields = $dbResult->Fetch()) {
             $ID = intval($fields['ID']);
             self::$VAT_RATES[] = array('ID' => $ID, 'NAME' => isset($fields['NAME']) ? $fields['NAME'] : "[{$ID}]", 'VALUE' => isset($fields['RATE']) ? round(doubleval($fields['RATE']), 2) : 0.0);
         }
     }
     return self::$VAT_RATES;
 }