Class: Atol::Request::PostDocument::Item::V5::Body
- Inherits:
-
Object
- Object
- Atol::Request::PostDocument::Item::V5::Body
- Defined in:
- lib/atol/request/post_document/item/v5/body.rb
Constant Summary collapse
- BadPaymentMethodError =
Class.new(StandardError)
- BadPaymentObjectError =
Class.new(StandardError)
- BadMeasureError =
Class.new(StandardError)
- BadVatTypeError =
Class.new(StandardError)
- PAYMENT_METHODS =
atol-kassa.ru/wp-content/nfiles/files/ATOL/kassa/АТОЛ%20Онлайн%20-%20Описание%20протокола%20v5%20(ФФД%201.2).pdf
%w[full_prepayment prepayment advance full_payment partial_payment credit credit_payment].freeze
- PAYMENT_OBJECTS =
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23].freeze
- MEASURE =
[0, 10, 11, 12, 20, 21, 22, 30, 31, 32, 40, 41, 42, 50, 51, 70, 71, 72, 73, 80, 81, 82, 83, 255].freeze
- VAT_TYPES =
%w[none vat0 vat5 vat7 vat10 vat22 vat105 vat107 vat110 vat20 vat120 vat122].freeze
Instance Attribute Summary collapse
-
#agent_info_type ⇒ Object
Returns the value of attribute agent_info_type.
-
#measure ⇒ Object
Returns the value of attribute measure.
-
#name ⇒ Object
Returns the value of attribute name.
-
#payment_method ⇒ Object
Returns the value of attribute payment_method.
-
#payment_object ⇒ Object
Returns the value of attribute payment_object.
-
#price ⇒ Object
Returns the value of attribute price.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#supplier_info_inn ⇒ Object
Returns the value of attribute supplier_info_inn.
-
#supplier_info_name ⇒ Object
Returns the value of attribute supplier_info_name.
-
#vat ⇒ Object
Returns the value of attribute vat.
Instance Method Summary collapse
-
#initialize(name:, price:, quantity: 1, payment_method:, payment_object:, measure:, vat:, **options) ⇒ Body
constructor
A new instance of Body.
- #to_h ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(name:, price:, quantity: 1, payment_method:, payment_object:, measure:, vat:, **options) ⇒ Body
Returns a new instance of Body.
34 35 36 37 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 34 def initialize(name:, price:, quantity: 1, payment_method:, payment_object:, measure:, vat:, **) setup_attributes(name, price, quantity, payment_method, payment_object, measure, vat, ) validate_attributes end |
Instance Attribute Details
#agent_info_type ⇒ Object
Returns the value of attribute agent_info_type.
23 24 25 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 23 def agent_info_type @agent_info_type end |
#measure ⇒ Object
Returns the value of attribute measure.
23 24 25 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 23 def measure @measure end |
#name ⇒ Object
Returns the value of attribute name.
23 24 25 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 23 def name @name end |
#payment_method ⇒ Object
Returns the value of attribute payment_method.
23 24 25 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 23 def payment_method @payment_method end |
#payment_object ⇒ Object
Returns the value of attribute payment_object.
23 24 25 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 23 def payment_object @payment_object end |
#price ⇒ Object
Returns the value of attribute price.
23 24 25 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 23 def price @price end |
#quantity ⇒ Object
Returns the value of attribute quantity.
23 24 25 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 23 def quantity @quantity end |
#supplier_info_inn ⇒ Object
Returns the value of attribute supplier_info_inn.
23 24 25 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 23 def supplier_info_inn @supplier_info_inn end |
#supplier_info_name ⇒ Object
Returns the value of attribute supplier_info_name.
23 24 25 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 23 def supplier_info_name @supplier_info_name end |
#vat ⇒ Object
Returns the value of attribute vat.
23 24 25 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 23 def vat @vat end |
Instance Method Details
#to_h ⇒ Object
39 40 41 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 39 def to_h body.clone end |
#to_json(*_args) ⇒ Object
43 44 45 |
# File 'lib/atol/request/post_document/item/v5/body.rb', line 43 def to_json(*_args) body.to_json end |