app/models/extface/driver/base/fiscal.rb in extface-0.6.2 vs app/models/extface/driver/base/fiscal.rb in extface-0.6.3

- old
+ new

@@ -68,11 +68,11 @@ :number #Fixnum (Eltrade PLU code) def initialize(attributes) @price, @text1, @text2, @tax_group, @qty, @percent, @neto, @number = attributes[:price], attributes[:text1].to_s, attributes[:text2].to_s, attributes[:tax_group], attributes[:qty], attributes[:percent], attributes[:neto], attributes[:number] raise "invalid price" unless price.kind_of?(Float) raise "invalid tax group" if tax_group.present? && !tax_group.kind_of?(Fixnum) - raise "invalid qty" if qty.present? && !qty.kind_of(Float) + raise "invalid qty" if qty.present? && !qty.kind_of?(Float) end end def fiscalize(bill, detailed = false) return nil unless bill.kind_of?(Billing::Bill) && bill.valid? @@ -96,10 +96,10 @@ SaleItem.new( price: charge.price.to_f, text1: charge.name, text2: charge.description, tax_group: charge.find_tax_group_mapping_for(self), #find tax group mapping by ratio , not nice - qty: charge.qty, + qty: charge.qty.try(:to_f), neto: neto, percent_ratio: percent_ratio #TODO check format ) ) end \ No newline at end of file