lib/atol/request/post_document/item/body.rb in atol-0.1.1 vs lib/atol/request/post_document/item/body.rb in atol-0.1.2
- old
+ new
@@ -6,9 +6,11 @@
module Item
class Body
def initialize(name:, price:, quantity: 1, config: nil)
@config = config || Atol.config
+ raise Atol::ZeroItemQuantityError if quantity.to_i.zero?
+
@body = Hash[]
@body[:name] = name
@body[:price] = price.to_f
@body[:quantity] = quantity.to_f
@body[:sum] = @body[:price] * @body[:quantity]
\ No newline at end of file