extface 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c376f952a40571a4428da1a0f64923c183cdb20c
4
- data.tar.gz: 0c1192e818ff8576fbc8661a031da9dcdf9bbe31
3
+ metadata.gz: 60a5c13ea7832ea917b771bc58f42fb69031d39a
4
+ data.tar.gz: 6778dd8fe350283c619d2aab6de1effaa84721a7
5
5
  SHA512:
6
- metadata.gz: 71b0f1023fce0cdcff96e8f941e7987f9c8035a52f5a4d7c3e04bb3ec37afec60abc62dbabd4025fffe5c7d96a6b5842469340d294a8711131005892c8dccdaa
7
- data.tar.gz: d80e0dd0ad4beb9067f2216c9e19708b88a4dafde875c462709494e214b33e2ecb9cc215a969b21f1a1cad19a13a8f7f5d7af4d935c983aa3900eeacc9e96910
6
+ metadata.gz: cd875f694faacaff16f33db5da5ac17864b61b56aa292aebca2bdf3e3f989205376edc903e2b7d3aecb1797f977b53c1c8d2a9ff18269595690d8eafcd1fa6f2
7
+ data.tar.gz: 4668e9efc26f1b931840d9ed05abe644fde07e8a3a2c56605694796a266507d74d6264f7e6de201129497fe6ec13f64780d695b4e353bcaa1c7d70b001b2d2e2
@@ -107,7 +107,7 @@ module Extface
107
107
  end
108
108
  if global_modifier_value = bill.global_modifier_value
109
109
  s.notify "Register Global Modifier"
110
- s.add_total_modifier global_modifier_value.to_f
110
+ s.add_total_modifier global_modifier_value.to_f, global_modifier.percent_ratio.try(:to_f)
111
111
  end
112
112
  s.notify "Register Payment"
113
113
  bill.payments.each do |payment|
@@ -136,6 +136,20 @@ module Extface
136
136
  end
137
137
  fsend(Sales::TOTAL, payment_data)
138
138
  end
139
+
140
+ def add_total_modifier(fixed_value = nil, percent_ratio = nil)
141
+ raise "Not in fiscal session" unless @fiscal_session
142
+ subtotal_data = "".tap() do |data|
143
+ data << "1" #One byte, which if ‘1’ the sum of the subtotal will be printed out.
144
+ data << "1" #One byte which if ‘1’ the sum of the subtotal will appear on the display.
145
+ if percent_ratio.nil?
146
+ data << (";%.2f" % fixed_value) unless fixed_value.blank?
147
+ else
148
+ data << (",%d" % (percent_ratio*100).to_i) unless percent_ratio.blank?
149
+ end
150
+ end
151
+ fsend(Sales::SUBTOTAL, subtotal_data)
152
+ end
139
153
 
140
154
  def total_payment
141
155
  raise "Not in fiscal session" unless @fiscal_session
@@ -1,3 +1,3 @@
1
1
  module Extface
2
- VERSION = "0.6.8"
2
+ VERSION = "0.6.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: extface
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Vangelov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-27 00:00:00.000000000 Z
11
+ date: 2018-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis