multicash 0.0.3 → 0.0.4

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: 82a2eb079904b7f749e89c682740f34d9cd9794c
4
- data.tar.gz: 3847c1756f0745763e8ffbdabdb4277f699e366d
3
+ metadata.gz: 6d245ece852ed962113e40b05202f0526fe03708
4
+ data.tar.gz: af5aafce8aa5e763f7552384ae62dfea3fdcdcaa
5
5
  SHA512:
6
- metadata.gz: ffcc2887d1a901eedafd445e45fd07583aecf4ec008218624f2b7a1c53cb9fbfd498f624512dd64bba668577d6260afd6068cce98e9ea3e88a848a6b33e61169
7
- data.tar.gz: 305177c4f9fb018f68ff8f0d4fb5ca1dad68f605c6d4344c0a7fd33ad063f1937610a0183f78867b07d1651e81247626124b097e249245a59cb46774de320daa
6
+ metadata.gz: fc8a89ad85f98e10db1ff60c63c7b9ff3835c061ffa6d206656cba3387d5553894e5a5bd63f9a520fee6f31ad063745023e0d5a43ec0ef7e7c442490a8f784a0
7
+ data.tar.gz: e6dce9bd9b7362d5fbbfc0309cd53cb19adc59144143475c3cc99430b1270f4a7c29cdc33b64435cb177adee0597555a3040df7e45430c35f1616a21ba11a2c4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -46,7 +46,7 @@ module Multicash
46
46
  lines << transfer_labels.label_72_footer
47
47
  lines << "-}"
48
48
 
49
- lines.join("\n")
49
+ lines.join("\x0D\x0A")
50
50
  end
51
51
 
52
52
  def order_reference
@@ -29,7 +29,7 @@ module Multicash
29
29
  value = ""
30
30
  value << transfer.today
31
31
  value << transfer.currency
32
- value << print_currency_with_comma(transfer.ammount, -15)
32
+ value << print_currency_with_comma(transfer.ammount, -10)
33
33
 
34
34
  "#{label}#{print_string((value), -22)}"
35
35
  end
@@ -38,7 +38,7 @@ module Multicash
38
38
  label = ":50K:"
39
39
  value = "/"
40
40
  value << transfer.ordering_iban
41
- value << "\n"
41
+ value << "\r\n"
42
42
  value << transfer.ordering_name
43
43
 
44
44
  "#{label}#{value}"
@@ -46,8 +46,8 @@ module Multicash
46
46
 
47
47
  def label_52D
48
48
  label = ":52D:"
49
- value = print_string(transfer.ordering_bae, -35)
50
- value << "\n"
49
+ value = transfer.ordering_bae
50
+ value << "\r\n"
51
51
  value << print_string(transfer.ordering_bank_name, -35)
52
52
 
53
53
  "#{label}#{value}"
@@ -55,8 +55,8 @@ module Multicash
55
55
 
56
56
  def label_57D
57
57
  label = ":57D:"
58
- value = print_string(transfer.destination_bae, -35)
59
- value << "\n"
58
+ value = transfer.destination_bae
59
+ value << "\r\n"
60
60
  value << print_string(transfer.destination_bank_name, -35)
61
61
 
62
62
  "#{label}#{value}"
@@ -66,7 +66,7 @@ module Multicash
66
66
  label = ":59:"
67
67
  value = '/'
68
68
  value << transfer.destination_iban
69
- value << "\n"
69
+ value << "\r\n"
70
70
  value << print_string(transfer.destination_name, -35)
71
71
 
72
72
  "#{label}#{value}"
@@ -80,9 +80,10 @@ module Multicash
80
80
  end
81
81
 
82
82
  def label_70_footer
83
- value = "\n/"
83
+ value = "/"
84
+ value << "\r\n"
84
85
  value << "/NTYPE/000000000000"
85
- value << "\n/"
86
+ value << "\r\n"
86
87
  value << "/OPNAT/J"
87
88
 
88
89
  value
@@ -98,14 +99,14 @@ module Multicash
98
99
 
99
100
  def label_72
100
101
  label = ":72:"
101
- value = print_string(transfer.payment_system, -35)
102
+ value = transfer.payment_system
102
103
 
103
104
  "#{label}#{value}"
104
105
  end
105
106
 
106
107
  def label_72_footer
107
108
  value = "/BAEREF/000000000000000000"
108
- value << "\n/"
109
+ value << "\r\n"
109
110
  value << "/PROL/NORM"
110
111
  end
111
112
  end
@@ -34,8 +34,8 @@ module Multicash
34
34
  end
35
35
 
36
36
  def label_B1T
37
- label = ":B1T:006"
38
- value = ""
37
+ label = ":B1T:"
38
+ value = sprintf("%03d", payment_order.transfers.size)
39
39
  value << payment_order.currency
40
40
  value << print_currency_with_comma(payment_order.total_ammount.to_s, -9)
41
41
 
@@ -48,7 +48,7 @@ module Multicash
48
48
  lines << payment_labels.label_77E
49
49
  lines << payment_labels.label_B1T
50
50
 
51
- lines.join("\n") + "\n-}"
51
+ lines.join("\x0D\x0A") + "\x0D\x0A-}"
52
52
  end
53
53
 
54
54
  def body
@@ -70,7 +70,7 @@ module Multicash
70
70
  return false unless self.errors.blank?
71
71
 
72
72
  bank_file = File.join(Dir.tmpdir, "#{Time.now.strftime('%Y-%m-%d')}.txt")
73
- File.open(bank_file, "w+", cr_newline: true, external_encoding: Encoding::CP1251) do |file|
73
+ File.open(bank_file, "w+", cr_newline: false, external_encoding: Encoding::CP1251) do |file|
74
74
  file.write generate.encode("CP1251")
75
75
  end
76
76
 
@@ -2,15 +2,15 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: multicash 0.0.3 ruby lib
5
+ # stub: multicash 0.0.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "multicash"
9
- s.version = "0.0.3"
9
+ s.version = "0.0.4"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["Anton Yordanov"]
13
- s.date = "2014-02-04"
13
+ s.date = "2014-02-05"
14
14
  s.description = "Generate payment order under the multicash spec"
15
15
  s.email = "anton.yordnaov@gmail.com"
16
16
  s.extra_rdoc_files = [
@@ -28,31 +28,31 @@ describe "Multicash::Labels::CreditTransfer" do
28
28
  let(:transfer_labels) { Multicash::Labels::CreditTransfer.new(credit_transfer) }
29
29
 
30
30
  specify "label_20" do
31
- expect(transfer_labels.label_20.size).to eq(20) # + 4 for label
31
+ expect(transfer_labels.label_20.size).to eq(20)
32
32
  end
33
33
 
34
34
  specify "label_23B" do
35
- expect(transfer_labels.label_23B.size).to eq(9) # + 4 for label
35
+ expect(transfer_labels.label_23B.size).to eq(9)
36
36
  end
37
37
 
38
38
  specify "label_32A" do
39
- expect(transfer_labels.label_32A.size).to eq(29) # + 4 for label
39
+ expect(transfer_labels.label_32A.size).to eq(27)
40
40
  end
41
41
 
42
42
  specify "label_50K" do
43
- expect(transfer_labels.label_50K.size).to eq(37)
43
+ expect(transfer_labels.label_50K.size).to eq(38)
44
44
  end
45
45
 
46
46
  specify "label_52D" do
47
- expect(transfer_labels.label_52D.size).to eq(76)
47
+ expect(transfer_labels.label_52D.size).to eq(50)
48
48
  end
49
49
 
50
50
  specify "label_57D" do
51
- expect(transfer_labels.label_57D.size).to eq(76)
51
+ expect(transfer_labels.label_57D.size).to eq(50)
52
52
  end
53
53
 
54
54
  specify "label_59" do
55
- expect(transfer_labels.label_59.size).to eq(64) # 4 + 1 + 22 + 1 + 35
55
+ expect(transfer_labels.label_59.size).to eq(65)
56
56
  end
57
57
 
58
58
  specify "label_71A" do
@@ -60,7 +60,7 @@ describe "Multicash::Labels::CreditTransfer" do
60
60
  end
61
61
 
62
62
  specify "label_72" do
63
- expect(transfer_labels.label_72.size).to eq(39)
63
+ expect(transfer_labels.label_72.size).to eq(5)
64
64
  end
65
65
  end
66
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: multicash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Yordanov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-04 00:00:00.000000000 Z
11
+ date: 2014-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel