Class: B2bCenterApi::WebService::Types::Lot

Inherits:
BaseType
  • Object
show all
Defined in:
lib/b2b_center_api/web_service/types/lot.rb

Overview

Конкурс

Constant Summary

Constants inherited from BaseType

BaseType::NO_INSPECT_ATTRS

Instance Attribute Summary collapse

Attributes inherited from BaseType

#date_fields, #soap_client

Class Method Summary collapse

Methods inherited from BaseType

#inspect, #to_h

Methods included from B2bCenterApi::WebService::TypeCast

included

Instance Attribute Details

#addresses_idsObject

@return[Integer] Места поставки товара или оказания услуги. Список адресов организации возвращает метод RemoteMarket.getAddressesIds.



30
31
32
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 30

def addresses_ids
  @addresses_ids
end

#classifier_idsObject

@return[String] Категории классификатора Перечисление категорий классификатора через запятую. Например: “127512010,43222134”



12
13
14
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 12

def classifier_ids
  @classifier_ids
end

#customerObject

@return Сведения о заказчике. Формат значения VARCHAR(255)



33
34
35
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 33

def customer
  @customer
end

#ext_idObject

@return Альтернативный идентификатор лота



35
36
37
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 35

def ext_id
  @ext_id
end

#lot_idObject

@return Номер лота: 1, 2, 3 и т.д. (номер назначается автоматически при сохранении)



7
8
9
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 7

def lot_id
  @lot_id
end

#lot_nameObject

@return Название продукции (наименование лота)



9
10
11
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 9

def lot_name
  @lot_name
end

#okved_codesObject

@return[String] Коды ОКВЭД (обязательно для заполнения для организаций, работающих по 223-ФЗ)



14
15
16
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 14

def okved_codes
  @okved_codes
end

#price_beginObject

@return Начальная (максимальная) цена с НДС. Если цена не указывается, то price_begin=price_begin_notax=0. Формат значения DECIMAL(18,2)



24
25
26
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 24

def price_begin
  @price_begin
end

#price_begin_notaxObject

@return Начальная (максимальная) цена без НДС. Формат значения DECIMAL(18,2)



27
28
29
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 27

def price_begin_notax
  @price_begin_notax
end

#quantityObject

@return Количество. Формат значения DECIMAL(11,3)



17
18
19
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 17

def quantity
  @quantity
end

#unitsObject

@return Единицы измерения (код ОКЕИ). Формат значения VARCHAR(20)



20
21
22
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 20

def units
  @units
end

Class Method Details

.from_response(response) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/b2b_center_api/web_service/types/lot.rb', line 37

def self.from_response(response)
  return if response.nil?
  lots = to_array(response[:lot]).map do |f|
    lot = Lot.new
    lot.lot_id = convert(f[:lot_id], :integer)
    lot.lot_name = f[:lot_name]
    lot.classifier_ids = f[:classifier_ids].split(',')
    lot.okved_codes = ArrayOfIds.from_part_response(f[:okved_codes])
    lot.quantity = convert(f[:quantity], :float)
    lot.units = f[:units]
    lot.price_begin = convert(f[:price_begin], :float)
    lot.price_begin_notax = convert(f[:price_begin_notax], :float)
    lot.addresses_ids = ArrayOfIds.from_part_response(f[:addresses_ids]).flatten.map(&:to_i)
    lot.customer = f[:customer]
    lot.ext_id = f[:ext_id]
    lot
  end
  lots
end