-
Couldn't load subscription status.
- Fork 4
feat: Добавлена поддержка полей для поставщика товара/услуги #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: Добавлена поддержка полей для поставщика товара/услуги #27
Conversation
…тствие полей agent_info и supplier_info в стандартном запросе
|
@GeorgeGorbanev предлагаю в рамках данного PR добавить поддержку полей для указания поставщика. Супер не уверен в том, что выбрал оптимальный способ передачи |
| self.quantity = quantity.to_f | ||
| self.payment_method = payment_method.to_s | ||
| self.payment_object = payment_object.to_s | ||
| self.agent_type = agent_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я бы предложил данное значение также приводить к строке, раз уж это делается для payment_method и payment_object
| self.agent_type = agent_type | |
| self.agent_type = agent_type.to_s |
| def initialize( | ||
| config: nil, name:, price:, quantity: 1, payment_method:, | ||
| payment_object:, agent_type: nil, supplier_phones: nil, | ||
| supplier_name: nil, supplier_inn: nil | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agent_info, судя по документации, очень большой объект: в нём может быть тип и три вложенных объекта с атрибутами других операторов (в сумме до 10 полей). Если в будущем понадобится добавить другие поля, то через опции это будет делать некрасиво, т.к. получим 20 опций в конструкторе.
Возможно, стоит добавить Atol::Request::PostDocument::Item::AgentInfo и Atol::Request::PostDocument::Item::SupplierInfo?
Изменения
agent_infoиsupplier_info(требуется, когда чек печатается агент, а продаваемый товар или услуга предоставляются отдельным поставщиком)