app/models/extface/driver/daisy_fx1200.rb in extface-0.4.6 vs app/models/extface/driver/daisy_fx1200.rb in extface-0.4.7
- old
+ new
@@ -222,11 +222,11 @@
errors.add :base, "#{NAKS_MAX_COUNT} NAKs Received. Abort!"
break
end
elsif !resp.ack?
invalid_frames += 1
- if nak_messages > INVALID_FRAME_RETRIES
+ if invalid_frames > INVALID_FRAME_RETRIES
errors.add :base, "#{INVALID_FRAME_RETRIES} Broken Packets Received. Abort!"
break
end
end
push packet_data unless resp.ack?
@@ -254,11 +254,11 @@
data << "\t"
data << TAX_GROUPS_MAP[item.tax_group || 2]
data << ("%.2f" % item.price)
data << "*#{item.qty.to_s}" unless item.qty.blank?
data << ",#{item.percent}" unless item.percent.blank?
- data << "$#{neto}" unless item.neto.blank?
+ data << "$#{'%.2f' % item.neto}" unless item.neto.blank?
end
end
def bcc(buffer)
sum = 0
@@ -281,11 +281,11 @@
def human_status_errors(status) #6 bytes status
errors.add :base, "Fiscal Device General Error" unless (status[0].ord & 0x20).zero?
errors.add :base, "Invalid Command" unless (status[0].ord & 0x02).zero?
errors.add :base, "Date & Time Not Set" unless (status[0].ord & 0x04).zero?
- errors.add :base, "Syntax Error" unless (status[0].ord & 0x02).zero?
+ errors.add :base, "Syntax Error" unless (status[0].ord & 0x01).zero?
errors.add :base, "Wrong Password" unless (status[1].ord & 0x40).zero?
errors.add :base, "Cutter Error" unless (status[1].ord & 0x20).zero?
errors.add :base, "Unpermitted Command In This Mode" unless (status[1].ord & 0x02).zero?
errors.add :base, "Field Overflow" unless (status[1].ord & 0x01).zero?
@@ -315,10 +315,41 @@
when 20 then errors.add :base, "Service not allowed"
when 21 then errors.add :base, "Wrong Value"
when 22 then errors.add :base, "Disabled operation"
when 23 then errors.add :base, "Deep void after discount"
when 24 then errors.add :base, "Deep void for not existing record"
- when 24 then errors.add :base, "Payment without sale"
+ when 25 then errors.add :base, "Payment without sale"
+ when 26 then errors.add :base, "Qty more than stock"
+ when 41 then errors.add :base, "Invalid barcode"
+ when 42 then errors.add :base, "Sale with null barcode"
+ when 43 then errors.add :base, "Wight barcode attempt"
+ when 44 then errors.add :base, "Missing barcode sale"
+ when 45 then errors.add :base, "Duplicate barcode"
+ when 66 then errors.add :base, "Invalid password"
+ when 71 then errors.add :base, "!!!Invalid FP data!!!"
+ when 72 then errors.add :base, "!!!Error writing FP!!!"
+ when 76 then errors.add :base, "NAP server info required"
+ when 90 then errors.add :base, "Non zero period report"
+ when 91 then errors.add :base, "Non zero daily report"
+ when 92 then errors.add :base, "Non zero operator report"
+ when 93 then errors.add :base, "Non zero items report"
+ when 94 then errors.add :base, "Field can not be programmed"
+ when 81 then errors.add :base, "Daily report overflow"
+ when 82 then errors.add :base, "24 without daily report"
+ when 83 then errors.add :base, "Oerators report overflow"
+ when 84 then errors.add :base, "Items report overflow"
+ when 85 then errors.add :base, "Period report overflow"
+ when 88 then errors.add :base, "KLEN overflow"
+ when 102 then errors.add :base, "TAX terminal connection missing"
+ when 104 then errors.add :base, "TAX terminal connection error"
+ when 108 then errors.add :base, "3 attempts wrong password"
+ when 110 then errors.add :base, "SIM card changed"
+ when 111 then errors.add :base, "TAX terminal - NAP server error"
+ when 113 then errors.add :base, "NAP rejected data"
+ when 117 then errors.add :base, "Unable to register TAX terminal into mobile network"
+ when 118 then errors.add :base, "Forbidden operation"
+ when 119 then errors.add :base, "Invalid value"
+ when 120 then errors.add :base, "Missing value"
end
errors.add :base, "General Fiscal Memory Error" unless (status[4].ord & 0x20).zero?
errors.add :base, "Fiscal Memory Full" unless (status[4].ord & 0x10).zero?
errors.add :base, "Less Than 50 Fiscal Records" unless (status[4].ord & 0x08).zero?
\ No newline at end of file