king_dtaus 2.0.2.pre → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ module KingDta
2
+ VERSION='2.0.2'
3
+ end
@@ -8,71 +8,122 @@ describe KingDta::Account do
8
8
  end
9
9
 
10
10
  it "should initialize a new account" do
11
- lambda{ KingDta::Account.new(:account_number => @ba.account_number, :bank_number => @ba.bank_number, :client_name => @ba.client_name) }.should_not raise_error
11
+ lambda{
12
+ KingDta::Account.new(:bank_account_number => @ba.bank_account_number,
13
+ :bank_number => @ba.bank_number,
14
+ :owner_name => @ba.owner_name)
15
+ }.should_not raise_error
12
16
  end
13
17
 
14
18
  it "should initialize a new dtazv account" do
15
- lambda{
19
+ lambda{
16
20
  KingDta::Account.new(sender_opts)
17
21
  }.should_not raise_error
18
22
  end
19
23
 
24
+ it "should convert bank_account_number to integer" do
25
+ opts = {:bank_account_number => '0123456',
26
+ :bank_number => @ba.bank_number,
27
+ :owner_name => @ba.owner_name}
28
+ anct = KingDta::Account.new(opts)
29
+ anct.bank_account_number.should == 123456
30
+
31
+ anct2 = KingDta::Account.new(opts.merge(:bank_account_number=>'012 345 6'))
32
+ anct2.bank_account_number.should == 123456
33
+ end
34
+
35
+ it "should convert bank_number to integer" do
36
+ opts = {:bank_account_number => @ba.bank_account_number,
37
+ :bank_number => '0123',
38
+ :owner_name => @ba.owner_name}
39
+ anct = KingDta::Account.new(opts)
40
+ anct.bank_number.should == 123
41
+
42
+ anct2 = KingDta::Account.new(opts.merge(:bank_number=>'012 34 5'))
43
+ anct2.bank_number.should == 12345
44
+ end
45
+
20
46
  it "should fail if bank account number is invalid" do
21
- # lambda{ KingDta::Account.new(0, @ba.bank_number, @ba.client_name) }.should raise_error(ArgumentError)
22
- lambda{ KingDta::Account.new(:account_number => 123456789011123456789011123456789011123456789011123456789011123456789011, :bank_number => @ba.bank_number, :client_name => @ba.client_name) }.should raise_error(ArgumentError, 'Account number too long, max 35 allowed')
47
+ lambda{
48
+ KingDta::Account.new(:bank_account_number => 123456789011123456789011123456789011,
49
+ :bank_number => @ba.bank_number,
50
+ :owner_name => @ba.owner_name)
51
+
52
+ }.should raise_error(ArgumentError, 'Bank account number too long, max 10 allowed')
23
53
  end
24
54
 
25
55
  it "should fail if bank number is invalid" do
26
- lambda{ KingDta::Account.new(:account_number => @ba.account_number, :bank_number => 0, :client_name => @ba.client_name) }.should raise_error(ArgumentError)
27
- lambda{ KingDta::Account.new(:account_number => @ba.account_number, :bank_number => 123456789101112, :client_name => @ba.client_name) }.should raise_error(ArgumentError, 'Bank number too long, max 11 allowed')
56
+ lambda{
57
+ KingDta::Account.new( :bank_account_number => @ba.bank_account_number,
58
+ :bank_number => 0,
59
+ :owner_name => @ba.owner_name)
60
+ }.should raise_error(ArgumentError)
61
+
62
+ lambda{
63
+ KingDta::Account.new( :bank_account_number => @ba.bank_account_number,
64
+ :bank_number => 123456789101112,
65
+ :owner_name => @ba.owner_name)
66
+ }.should raise_error(ArgumentError, 'Bank number too long, max 8 allowed')
28
67
  end
29
68
 
30
- it "should fail if clent number is too long" do
31
- lambda{ KingDta::Account.new(:account_number => @ba.account_number, :bank_number => @ba.bank_number, :client_name => @ba.client_name, :client_number => 12345678901) }.should raise_error(ArgumentError, 'Client number too long, max 10 allowed')
69
+ it "should fail if owner number is too long" do
70
+ lambda{
71
+ KingDta::Account.new( :bank_account_number => @ba.bank_account_number,
72
+ :bank_number => @ba.bank_number,
73
+ :owner_name => @ba.owner_name,
74
+ :owner_number => 12345678901)
75
+ }.should raise_error(ArgumentError, 'Owner number too long, max 10 allowed')
32
76
  end
33
77
 
34
- it "should fail if street and/or Zip Code is too long" do
78
+ it "should fail if street and/or Zip Code is too long" do
35
79
  opts = sender_opts.merge( :bank_street => "Lorem ipsum dolor sit amet, consectetur")
36
80
  lambda{
37
81
  KingDta::Account.new(opts)
38
- }.should raise_error(ArgumentError, 'Bank Street too long, max 35 allowed')
82
+ }.should raise_error(ArgumentError, 'Bank street too long, max 35 allowed')
39
83
  end
40
84
 
41
85
  it "should fail if city is too long" do
42
86
  opts = sender_opts.merge( :bank_city => "Lorem ipsum dolor sit amet, consecte")
43
- lambda{
87
+ lambda{
44
88
  KingDta::Account.new opts
45
- }.should raise_error(ArgumentError, 'Bank City too long, max 35 allowed')
89
+ }.should raise_error(ArgumentError, 'Bank city too long, max 35 allowed')
46
90
  end
47
91
 
48
92
  it "should fail if bank name is too long" do
49
93
  opts = sender_opts.merge( :bank_name => "Lorem ipsum dolor sit amet, consecte")
50
94
  lambda{
51
95
  KingDta::Account.new opts
52
- }.should raise_error(ArgumentError, 'Bank Name too long, max 35 allowed')
96
+ }.should raise_error(ArgumentError, 'Bank name too long, max 35 allowed')
53
97
  end
54
98
 
55
99
  it "should fail if client street is too long" do
56
- opts = sender_opts.merge( :client_street => "Lorem ipsum dolor sit amet, consecte")
100
+ opts = sender_opts.merge( :owner_street => "Lorem ipsum dolor sit amet, consecte")
57
101
  lambda{
58
102
  KingDta::Account.new opts
59
- }.should raise_error(ArgumentError, 'Client Street too long, max 35 allowed')
103
+ }.should raise_error(ArgumentError, 'Owner street too long, max 35 allowed')
60
104
  end
61
105
 
62
106
  it "should fail if city is too long" do
63
- opts = sender_opts.merge( :client_city => "Lorem ipsum dolor sit amet, consecte")
107
+ opts = sender_opts.merge( :owner_city => "Lorem ipsum dolor sit amet, consecte")
64
108
  lambda{
65
109
  KingDta::Account.new opts
66
- }.should raise_error(ArgumentError, 'Client City too long, max 35 allowed')
110
+ }.should raise_error(ArgumentError, 'Owner city too long, max 35 allowed')
67
111
  end
68
112
 
69
113
  it "should return account street and zip" do
70
- konto = KingDta::Account.new( sender_opts )
71
- konto.zip_city.should == "51063 BANK KOELN"
114
+ acnt = KingDta::Account.new( sender_opts )
115
+ acnt.bank_zip_city.should == "51063 BANK KOELN"
72
116
  end
73
117
 
74
118
  it "should return sender street and zip" do
75
- konto = KingDta::Account.new( sender_opts )
76
- konto.client_zip_city.should == "51063 MEINE KOELN"
119
+ acnt = KingDta::Account.new( sender_opts )
120
+ acnt.owner_zip_city.should == "51063 MEINE KOELN"
121
+ end
122
+
123
+ it "should set owner country code from iban" do
124
+ opts = receiver_opts
125
+ opts[:owner_country_code] = nil
126
+ acnt = KingDta::Account.new( opts )
127
+ acnt.owner_country_code.should == "PL"
77
128
  end
78
129
  end
@@ -8,9 +8,9 @@ describe KingDta::Dtaus do
8
8
  @dtaus_gk = KingDta::Dtaus.new('GK', Date.today)
9
9
  @kto1 = test_kto1
10
10
  @kto2 = test_kto2
11
- @dtaus.account = KingDta::Account.new(:account_number => @kto1.account_number, :bank_number => @kto1.bank_number, :client_name => @kto1.client_name, :bank_name => @kto1.bank_name)
12
- @dtaus_gk.account = KingDta::Account.new(:account_number => @kto1.account_number, :bank_number => @kto1.bank_number, :client_name => @kto1.client_name, :bank_name => @kto1.bank_name)
13
- @booking = KingDta::Booking.new(KingDta::Account.new(:account_number => @kto2.account_number, :bank_number => @kto2.bank_number, :client_name => @kto2.client_name, :bank_name => @kto2.bank_name), 220.25 )
11
+ @dtaus.account = KingDta::Account.new(:bank_account_number => @kto1.bank_account_number, :bank_number => @kto1.bank_number, :owner_name => @kto1.owner_name, :bank_name => @kto1.bank_name)
12
+ @dtaus_gk.account = KingDta::Account.new(:bank_account_number => @kto1.bank_account_number, :bank_number => @kto1.bank_number, :owner_name => @kto1.owner_name, :bank_name => @kto1.bank_name)
13
+ @booking = KingDta::Booking.new(KingDta::Account.new(:bank_account_number => @kto2.bank_account_number, :bank_number => @kto2.bank_number, :owner_name => @kto2.owner_name, :bank_name => @kto2.bank_name), 220.25 )
14
14
  end
15
15
 
16
16
  it "should not init without values" do
@@ -41,7 +41,7 @@ describe KingDta::Dtaus do
41
41
 
42
42
  it "should not add a booking if closed" do
43
43
  @dtaus.add(@booking)
44
- negative_booking = KingDta::Booking.new(KingDta::Account.new(:account_number => @kto2.account_number, :bank_number => @kto2.bank_number, :client_name => @kto2.client_name, :bank_name => @kto2.bank_name ), -120.25 )
44
+ negative_booking = KingDta::Booking.new(KingDta::Account.new(:bank_account_number => @kto2.bank_account_number, :bank_number => @kto2.bank_number, :owner_name => @kto2.owner_name, :bank_name => @kto2.bank_name ), -120.25 )
45
45
  lambda{ @dtaus.add(negative_booking) }.should raise_error(KingDta::Exception)
46
46
  end
47
47
 
@@ -55,7 +55,7 @@ describe KingDta::Dtaus do
55
55
  out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"
56
56
  str.should == out
57
57
  #60-70 kontonummer mit nullen aufgefüllt - hier nicht da ktnr == 10 stellen
58
- str[60...70].should == "#{test_kto1.account_number}"
58
+ str[60...70].should == "#{test_kto1.bank_account_number}"
59
59
  str.should include(test_kto1.bank_number)
60
60
  end
61
61
 
@@ -85,17 +85,31 @@ describe KingDta::Dtaus do
85
85
  @dtaus.add_c(@booking)
86
86
  str = @dtaus.dta_string
87
87
  str.length.should == 256
88
- str.should include(@kto2.client_name.upcase)
88
+ str.should include(@kto2.owner_name.upcase)
89
89
  out = "0216C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGSALESKING MONATSBEITRAG 08/1 010210 FREELANCER VERSION "
90
90
  str.should == out
91
91
  end
92
92
 
93
+ it "should create c-sektion with long account owner name in extension" do
94
+ @dtaus.account = KingDta::Account.new(:bank_account_number => @kto1.bank_account_number, :bank_number => @kto1.bank_number,
95
+ :owner_name => 'A very long name exeeding 27 characters even longer 54 chars', :bank_name => @kto1.bank_name)
96
+
97
+ @dtaus.add(@booking)
98
+ @dtaus.bookings.first.text = 'SalesKing Monatsbeitrag 08/10 Freelancer Version'
99
+ @dtaus.add_c(@booking)
100
+ str = @dtaus.dta_string
101
+ str.length.should == 256
102
+ str.should include(@kto2.owner_name.upcase)
103
+ out = "0245C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH A VERY LONG NAME EXEEDING 2SALESKING MONATSBEITRAG 08/1 020210 FREELANCER VERSION 037 CHARACTERS EVEN LONGER 54 "
104
+ str.should == out
105
+ end
106
+
93
107
  it "should create c-sektion with default booking text" do
94
108
  @dtaus.default_text = 'Default verwendungszweck'
95
109
  @dtaus.add_c(@booking)
96
110
  str = @dtaus.dta_string
97
111
  str.length.should == 256
98
- str.should include(@kto2.client_name.upcase)
112
+ str.should include(@kto2.owner_name.upcase)
99
113
  out = "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "
100
114
  str.should == out
101
115
  end
@@ -105,8 +119,8 @@ describe KingDta::Dtaus do
105
119
  @dtaus.add(@booking)
106
120
  str = @dtaus.create
107
121
  str.length.should == 512
108
- str.should include(@kto1.client_name.upcase)
109
- str.should include(@kto2.client_name.upcase)
122
+ str.should include(@kto1.owner_name.upcase)
123
+ str.should include(@kto2.owner_name.upcase)
110
124
  str.should include(@dtaus.default_text.upcase)
111
125
  out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"+
112
126
  "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
@@ -114,12 +128,21 @@ describe KingDta::Dtaus do
114
128
  str.should == out
115
129
  end
116
130
 
131
+ it "should create whole dta string with long texts exeeding extension" do
132
+ @dtaus.account = KingDta::Account.new(:bank_account_number => @kto1.bank_account_number, :bank_number => @kto1.bank_number,
133
+ :owner_name => 'A very long name exeeding 27 characters even longer 54 chars', :bank_name => @kto1.bank_name)
134
+ @dtaus.add(@booking)
135
+ @dtaus.bookings.first.text = 'Rgn R-3456-0102220 Monatsbeitrag 08/10 Freelancer Version Vielen Dank Ihre SalesKing GmbH' * 20
136
+ @dtaus.bookings.first.account.owner_name = 'A very long name exeeding 27 characters even longer 54 chars'
137
+ str = @dtaus.create ## should not raise error
138
+ end
139
+
117
140
  it "should create whole dta string with long booking text in extension" do
118
141
  @dtaus.add(@booking)
119
142
  @dtaus.bookings.first.text = 'Rgn R-3456-0102220 Monatsbeitrag 08/10 Freelancer Version Vielen Dank Ihre SalesKing GmbH'
120
143
  str = @dtaus.create
121
144
  str.length.should == 640
122
- str.should include(@kto2.client_name.upcase)
145
+ str.should include(@kto2.owner_name.upcase)
123
146
  out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"+
124
147
  "0274C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGRGN R-3456-0102220 MONATSBE1 0302ITRAG 08/10 FREELANCER VERS02ION VIELEN DANK IHRE SALESK 02ING GMBH "+
125
148
  "0128E 0000001000000000000000000000002787777000000000370400440000000022025 "
@@ -131,8 +154,8 @@ describe KingDta::Dtaus do
131
154
  6.times { @dtaus.add(@booking) }
132
155
  str = @dtaus.create
133
156
  str.length.should == 1792
134
- str.should include(@kto1.client_name.upcase)
135
- str.should include(@kto2.client_name.upcase)
157
+ str.should include(@kto1.owner_name.upcase)
158
+ str.should include(@kto2.owner_name.upcase)
136
159
  str.should include(@dtaus.default_text.upcase)
137
160
  out = "0128ALK3704004400000000GIMME YOUR MONEY AG #{Date.today.strftime("%d%m%y")} 78289700370000000000 #{Date.today.strftime("%d%m%Y")} 1"+
138
161
  "0187C00000000370400440002787777000000000000005000 0000000000037040044782897003700000022025 PETER & MAY GMBH GIMME YOUR MONEY AGDEFAULT VERWENDUNGSZWECK 1 00 "+
@@ -9,7 +9,6 @@ describe KingDta::Dtazv do
9
9
  @dtazv = KingDta::Dtazv.new(Date.parse('2011-08-28'))
10
10
  @dtazv.account = KingDta::Account.new sender_opts
11
11
  @booking = KingDta::Booking.new( KingDta::Account.new( receiver_opts ), 220.25)
12
-
13
12
  end
14
13
 
15
14
  it "should init without values" do
@@ -35,9 +34,7 @@ describe KingDta::Dtazv do
35
34
  filename = File.join(File.dirname(__FILE__), 'test_output.dta')
36
35
  @dtazv.create_file(filename)
37
36
  str = ''
38
- File.open(filename, 'r').each do |ln|
39
- str << ln
40
- end
37
+ File.open(filename, 'r').each { |ln| str << ln }
41
38
  str.length.should == 5120
42
39
  #remove testfile
43
40
  File.delete(filename)
@@ -63,8 +60,8 @@ describe KingDta::Dtazv do
63
60
  @dtazv.add(@booking)
64
61
  str = @dtazv.create
65
62
  str.length.should == 1280
66
- str.should include(receiver_opts[:client_name].upcase)
67
- out = "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN 11082801110828N0000000000 0768T37050299EUR132604963411082800000000 0000000000MARKF1100 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /GR1601101250000000012300695 EUR00000000000220250 00000000 0013 0 000256Z000000000000220000000000000001 "
63
+ str.should include(receiver_opts[:owner_name].upcase)
64
+ out = "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN 11082801110828N0000000000 0768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000256Z000000000000220000000000000001 "
68
65
  str.should == out
69
66
  end
70
67
 
@@ -73,8 +70,8 @@ describe KingDta::Dtazv do
73
70
  @dtazv.bookings.first.text = 'Rgn R-3456-0102220 Monatsbeitrag 08/10 Freelancer Version Vielen Dank Ihre SalesKing GmbH'
74
71
  str = @dtazv.create
75
72
  str.length.should == 1280
76
- str.should include(receiver_opts[:client_name].upcase)
77
- out = "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN 11082801110828N0000000000 0768T37050299EUR132604963411082800000000 0000000000MARKF1100 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /GR1601101250000000012300695 EUR00000000000220250 RGN R-3456-0102220 MONATSBEITRAG 08/10 FREELANCER VERSION VIELEN DANK IHRE SALESKING GMBH00000000 0013 0 000256Z000000000000220000000000000001 "
73
+ str.should include(receiver_opts[:owner_name].upcase)
74
+ out = "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN 11082801110828N0000000000 0768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250RGN R-3456-0102220 MONATSBEITRAG 08/10 FREELANCER VERSION VIELEN DANK IHRE SALESKING GMBH 00000000 0013 0 000256Z000000000000220000000000000001 "
78
75
  str.should == out
79
76
  end
80
77
 
@@ -82,9 +79,9 @@ describe KingDta::Dtazv do
82
79
  6.times { @dtazv.add(@booking) }
83
80
  str = @dtazv.create
84
81
  str.length.should == 5120
85
- str.should include(receiver_opts[:client_name].upcase)
86
- str.should include(sender_opts[:client_name].upcase)
87
- out = "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN 11082801110828N0000000000 0768T37050299EUR132604963411082800000000 0000000000MARKF1100 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /GR1601101250000000012300695 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000MARKF1100 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /GR1601101250000000012300695 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000MARKF1100 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /GR1601101250000000012300695 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000MARKF1100 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /GR1601101250000000012300695 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000MARKF1100 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /GR1601101250000000012300695 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000MARKF1100 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /GR1601101250000000012300695 EUR00000000000220250 00000000 0013 0 000256Z000000000001320000000000000006 "
82
+ str.should include(receiver_opts[:owner_name].upcase)
83
+ str.should include(sender_opts[:owner_name].upcase)
84
+ out = "0256Q370502991326049634JAN KUS MEINE EINE STRASSE 2 51063 MEINE KOELN 11082801110828N0000000000 0768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000768T37050299EUR132604963411082800000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 000256Z000000000001320000000000000006 "
88
85
  str.should == out
89
86
  end
90
87
 
@@ -120,7 +117,7 @@ describe "KingDta::DtazvSegments" do
120
117
  end
121
118
 
122
119
  it "should return the proper T segment" do
123
- @dtazv.add_t(@booking).should == "0768T37050299EUR1326049634#{@date.strftime("%y%m%d")}00000000 0000000000MARKF1100 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /GR1601101250000000012300695 EUR00000000000220250 00000000 0013 0 00"
120
+ @dtazv.add_t(@booking).should == "0768T37050299EUR1326049634#{@date.strftime("%y%m%d")}00000000 0000000000COBADEFF366 DE DALAI LAMA BUSH-AVENUE 55 445555 INDIA /PL10105013151000002308622378 EUR00000000000220250 00000000 0013 0 00"
124
121
  end
125
122
 
126
123
  it "should return the proper length of T segment" do
@@ -4,10 +4,10 @@ $:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
4
 
5
5
  require 'simplecov'
6
6
  SimpleCov.start 'rails'
7
- SimpleCov.coverage_dir 'coverage/rspec'
7
+ SimpleCov.coverage_dir 'coverage'
8
8
 
9
9
  require 'rubygems'
10
- require "king_dtaus"
10
+ require 'king_dtaus'
11
11
  require 'rspec'
12
12
  require 'ostruct'
13
13
  require 'date'
@@ -15,75 +15,76 @@ require 'date'
15
15
  RSpec.configure do |config|
16
16
  end
17
17
 
18
-
18
+ # a full account, address infos are only needed if BIC or IBAN is unknown
19
19
  def sender_opts
20
20
  {
21
- :account_number => '1326049634',
21
+ :bank_account_number => '1326049634',
22
22
  :bank_number => '37050299',
23
23
  :bank_name => 'Kreissparkasse Köln',
24
- :bank_street => "Bank Eine Straße 2",
25
- :bank_city => "Bank Köln",
26
- :bank_zip_code => "51063",
27
- :client_number => "",
28
- :client_name =>'Jan Kus',
29
- :client_street => "Meine Eine Straße 2",
30
- :client_city => "Meine Köln",
31
- :client_zip_code => "51063",
32
- :bank_country_code => "DE",
33
- :client_country_code => "DE"
24
+ :bank_street => 'Bank Eine Straße 2',
25
+ :bank_city => 'Bank Köln',
26
+ :bank_zip => '51063',
27
+ :bank_country_code => 'DE',
28
+ :owner_number => '',
29
+ :owner_name =>'Jan Kus',
30
+ :owner_street => 'Meine Eine Straße 2',
31
+ :owner_city => 'Meine Köln',
32
+ :owner_zip_code => '51063',
33
+ :owner_country_code => 'DE'
34
34
  }
35
35
  end
36
36
 
37
37
  def receiver_opts
38
38
  {
39
- :account_number => 'GR1601101250000000012300695',
40
- :bank_number => 'MARKF1100',
41
- :bank_name => 'Dalai Lamas Bank',
42
- :bank_street => "5th avenue",
43
- :bank_city => "los angeles",
44
- :bank_zip_code => "55323",
45
- :client_number => "",
46
- :client_name =>'Dalai Lama',
47
- :client_street => "Bush-Avenue 55",
48
- :client_city => "India",
49
- :client_zip_code => "445555",
50
- :bank_country_code => "DE",
51
- :client_country_code => "DE"
39
+ :bank_iban => 'PL10105013151000002308622378',
40
+ :bank_bic => 'COBADEFF366',
41
+ :owner_name =>'Dalai Lama',
42
+ :owner_street => 'Bush-Avenue 55',
43
+ :owner_city => 'India',
44
+ :owner_zip_code => '445555',
45
+ :owner_country_code => 'DE' # actually wrong since iban is in poland
46
+ # only needed if no bic present
47
+ # :bank_name => 'Dalai Lamas Bank',
48
+ # :bank_street => "5th avenue",
49
+ # :bank_city => "Pulheim",
50
+ # :bank_zip => "55323",
51
+ # :owner_number => "",
52
+ # :bank_country_code => "DE",
52
53
  }
53
54
  end
54
55
 
55
56
  def test_kto1
56
57
  opts = {
57
- :account_number => '7828970037',
58
+ :bank_account_number => '7828970037',
58
59
  :bank_number => '37040044',
59
- :client_name =>'Gimme your Money AG',
60
+ :owner_name =>'Gimme your Money AG',
60
61
  :bank_name => 'Commerzbank Köln',
61
62
  :zweck => 'Monatsbeitrag',
62
- :client_number => ""
63
+ :owner_number => ""
63
64
  }
64
65
  TestKonto.new(opts)
65
66
  end
66
67
 
67
68
  def test_kto2
68
69
  opts = {
69
- :account_number => '2787777',
70
+ :bank_account_number => '2787777',
70
71
  :bank_number => '37040044',
71
- :client_name =>'Peter & May GmbH',
72
+ :owner_name =>'Peter & May GmbH',
72
73
  :bank_name => 'Commerzbank Köln',
73
74
  :zweck => 'Monatsbeitrag',
74
- :client_number => ""
75
+ :owner_number => ""
75
76
  }
76
77
  TestKonto.new(opts)
77
78
  end
78
79
 
79
80
  def test_kto3
80
81
  opts = {
81
- :account_number => '2787777',
82
+ :bank_account_number => '2787777',
82
83
  :bank_number => '37040044',
83
- :client_name =>'Andrew Müller',
84
+ :owner_name =>'Andrew Müller',
84
85
  :bank_name => 'Commerzbank Köln',
85
86
  :zweck => 'Monatsbeitrag',
86
- :client_number => ""
87
+ :owner_number => ""
87
88
  }
88
89
  TestKonto.new(opts)
89
90
  end
metadata CHANGED
@@ -1,128 +1,134 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: king_dtaus
3
- version: !ruby/object:Gem::Version
4
- hash: 961916012
5
- prerelease: 6
6
- segments:
7
- - 2
8
- - 0
9
- - 2
10
- - pre
11
- version: 2.0.2.pre
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.2
5
+ prerelease:
12
6
  platform: ruby
13
- authors:
7
+ authors:
14
8
  - Georg Leciejewski
15
9
  - Georg Ledermann
16
10
  - Jan Kus
17
11
  autorequire:
18
12
  bindir: bin
19
13
  cert_chain: []
20
-
21
- date: 2011-09-02 00:00:00 +02:00
22
- default_executable:
23
- dependencies:
24
- - !ruby/object:Gem::Dependency
25
- type: :runtime
26
- requirement: &id001 !ruby/object:Gem::Requirement
14
+ date: 2011-11-15 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: i18n
18
+ requirement: !ruby/object:Gem::Requirement
27
19
  none: false
28
- requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- hash: 3
32
- segments:
33
- - 0
34
- version: "0"
35
- name: king_dtaus
36
- version_requirements: *id001
20
+ requirements:
21
+ - - ! '>='
22
+ - !ruby/object:Gem::Version
23
+ version: '0'
24
+ type: :runtime
37
25
  prerelease: false
38
- - !ruby/object:Gem::Dependency
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ! '>='
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ - !ruby/object:Gem::Dependency
33
+ name: rdoc
34
+ requirement: !ruby/object:Gem::Requirement
35
+ none: false
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
39
40
  type: :development
40
- requirement: &id002 !ruby/object:Gem::Requirement
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
41
43
  none: false
42
- requirements:
43
- - - ">="
44
- - !ruby/object:Gem::Version
45
- hash: 3
46
- segments:
47
- - 0
48
- version: "0"
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ - !ruby/object:Gem::Dependency
49
49
  name: rspec
50
- version_requirements: *id002
51
- prerelease: false
52
- - !ruby/object:Gem::Dependency
53
- type: :development
54
- requirement: &id003 !ruby/object:Gem::Requirement
50
+ requirement: !ruby/object:Gem::Requirement
55
51
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
- version: "0"
63
- name: jeweler
64
- version_requirements: *id003
65
- prerelease: false
66
- - !ruby/object:Gem::Dependency
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
67
56
  type: :development
68
- requirement: &id004 !ruby/object:Gem::Requirement
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
69
59
  none: false
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- hash: 3
74
- segments:
75
- - 0
76
- version: "0"
60
+ requirements:
61
+ - - ! '>='
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ - !ruby/object:Gem::Dependency
77
65
  name: simplecov
78
- version_requirements: *id004
79
- prerelease: false
80
- - !ruby/object:Gem::Dependency
66
+ requirement: !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ! '>='
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
81
72
  type: :development
82
- requirement: &id005 !ruby/object:Gem::Requirement
73
+ prerelease: false
74
+ version_requirements: !ruby/object:Gem::Requirement
83
75
  none: false
84
- requirements:
85
- - - ">="
86
- - !ruby/object:Gem::Version
87
- hash: 3
88
- segments:
89
- - 0
90
- version: "0"
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ - !ruby/object:Gem::Dependency
91
81
  name: mocha
92
- version_requirements: *id005
93
- prerelease: false
94
- - !ruby/object:Gem::Dependency
82
+ requirement: !ruby/object:Gem::Requirement
83
+ none: false
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
95
88
  type: :development
96
- requirement: &id006 !ruby/object:Gem::Requirement
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
97
91
  none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- hash: 3
102
- segments:
103
- - 0
104
- version: "0"
105
- name: i18n
106
- version_requirements: *id006
92
+ requirements:
93
+ - - ! '>='
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ - !ruby/object:Gem::Dependency
97
+ name: rake
98
+ requirement: !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: 0.9.2
104
+ type: :development
107
105
  prerelease: false
108
- description: DTAUS is a text-based format, to create bank transfers for german banks. This gem helps with the creation of those transfer files.
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ none: false
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: 0.9.2
112
+ description: ! 'DTA/DTAUS and DTAZV are text-based formats to create bank transfers
113
+ for german banks.
114
+
115
+ This gem creates DTA/DATAUS files for inner german credit and debit(Gutschrift/Lastschrift)
116
+ transfers.
117
+
118
+ It is also capable of creating DTAZV credit-files for transfers from Germany to
119
+ European SEPA region.'
109
120
  email: gl@salesking.eu
110
121
  executables: []
111
-
112
122
  extensions: []
113
-
114
- extra_rdoc_files:
123
+ extra_rdoc_files:
115
124
  - README.markdown
116
- files:
125
+ files:
126
+ - .gitignore
117
127
  - .travis.yml
118
128
  - Gemfile
119
129
  - MIT-LICENSE
120
130
  - README.markdown
121
131
  - Rakefile
122
- - VERSION
123
- - docs/dtazv.pdf
124
- - docs/dtazv_bank_bbk.pdf
125
- - docs/example.output
126
132
  - king_dtaus.gemspec
127
133
  - lib/king_dta/account.rb
128
134
  - lib/king_dta/booking.rb
@@ -131,49 +137,39 @@ files:
131
137
  - lib/king_dta/dtazv.rb
132
138
  - lib/king_dta/exception.rb
133
139
  - lib/king_dta/helper.rb
140
+ - lib/king_dta/version.rb
134
141
  - lib/king_dtaus.rb
135
142
  - spec/account_spec.rb
136
143
  - spec/booking_spec.rb
137
144
  - spec/dtaus_spec.rb
138
145
  - spec/dtazv_spec.rb
139
- - spec/dtazv_test.rb
140
146
  - spec/helper_spec.rb
141
147
  - spec/spec_helper.rb
142
- has_rdoc: true
143
148
  homepage: http://github.com/salesking/king_dtaus
144
149
  licenses: []
145
-
146
150
  post_install_message:
147
151
  rdoc_options: []
148
-
149
- require_paths:
152
+ require_paths:
150
153
  - lib
151
- required_ruby_version: !ruby/object:Gem::Requirement
154
+ required_ruby_version: !ruby/object:Gem::Requirement
152
155
  none: false
153
- requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- hash: 3
157
- segments:
156
+ requirements:
157
+ - - ! '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ segments:
158
161
  - 0
159
- version: "0"
160
- required_rubygems_version: !ruby/object:Gem::Requirement
162
+ hash: 1476023920337176562
163
+ required_rubygems_version: !ruby/object:Gem::Requirement
161
164
  none: false
162
- requirements:
163
- - - ">"
164
- - !ruby/object:Gem::Version
165
- hash: 25
166
- segments:
167
- - 1
168
- - 3
169
- - 1
170
- version: 1.3.1
165
+ requirements:
166
+ - - ! '>='
167
+ - !ruby/object:Gem::Version
168
+ version: '0'
171
169
  requirements: []
172
-
173
170
  rubyforge_project:
174
- rubygems_version: 1.6.2
171
+ rubygems_version: 1.8.24
175
172
  signing_key:
176
173
  specification_version: 3
177
- summary: Generate DTAUS strings and files
174
+ summary: Generate DTA/DTAUS and DTAZV bank transfer files .. the easy way
178
175
  test_files: []
179
-