app/models/extface/driver/base/fiscal.rb in extface-0.5.3 vs app/models/extface/driver/base/fiscal.rb in extface-0.5.4a

- old
+ new

@@ -52,10 +52,12 @@ #fiscal basket session of Extface::Driver::Base::Fiscal::SaleItem instances def sale_and_pay_items_session(sale_items = [], operator = '', password = '') raise_not_implemented end #other def payed_recv_account(value = 0.00, payment_type_num = 0) raise_not_implemented end + + def autofix_unclosed_doc() nil end #if applicable class SaleItem include ActiveModel::Validations attr_reader :price, # Float :text1, :text2, # String @@ -76,10 +78,11 @@ return nil unless bill.kind_of?(Billing::Bill) && bill.valid? operator_mapping = bill.find_operator_mapping_for(self) if detailed device.session("Fiscal Doc") do |s| s.notify "Fiscal Doc Start" + s.autofix_unclosed_doc s.open_fiscal_doc(operator_mapping.try(:mapping), operator_mapping.try(:pwd)) s.notify "Register Sale" bill.charges.each do |charge| neto, percent_ratio = nil, nil, nil if modifier = charge.modifier @@ -115,9 +118,10 @@ s.notify "Fiscal Doc End" end else #not detailed device.session("Fiscal Doc") do |s| s.notify "Fiscal Doc Start" + s.autofix_unclosed_doc s.open_fiscal_doc(operator_mapping.try(:mapping), operator_mapping.try(:pwd)) s.notify "Register Sale" total_modifier = nil # send payments sum, so modifier make no sence! think # if global_modifier_value = bill.global_modifier_value # s.notify "Register Global Modifier" \ No newline at end of file