app/models/extface/driver/daisy_fx1200.rb in extface-0.4.6k vs app/models/extface/driver/daisy_fx1200.rb in extface-0.4.6
- old
+ new
@@ -222,11 +222,11 @@
errors.add :base, "#{NAKS_MAX_COUNT} NAKs Received. Abort!"
break
end
elsif !resp.ack?
invalid_frames += 1
- if invalid_frames > INVALID_FRAME_RETRIES
+ if nak_messages > 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 << "$#{'%.2f' % item.neto}" unless item.neto.blank?
+ data << "$#{neto}" unless item.neto.blank?
end
end
def bcc(buffer)
sum = 0
@@ -281,10 +281,10 @@
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 & 0x01).zero?
+ errors.add :base, "Syntax Error" unless (status[0].ord & 0x02).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?
\ No newline at end of file