rs.ge 0.1.10 → 0.1.11

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: ac581151418ca530b173ecff8ee7c3af51e01403
4
- data.tar.gz: 431258966af3e3eaf31c165760ce3245101b9cfb
3
+ metadata.gz: a7944161b26fa648b4223add24c0993e8b81f33b
4
+ data.tar.gz: a9bbd3388a369f57c3b4ad00422bfe80befa632c
5
5
  SHA512:
6
- metadata.gz: 1b1890c28796f8e39db0d5a5fec819451b76b141563c6a256daece716b5a8bb0740e2518d784210879bb763d6dfeaca386d992e593628741ce5e18bada8786ba
7
- data.tar.gz: dcc929d4b17105573d407a62c29d4afcea3c2e03bc0c33c211af4cafd63a71be3920d2611e35b749246e6823318c28c978a3867336513f9947680b829b1c1400
6
+ metadata.gz: 09dcb692438b2b1cd86c462926bc3ea91c0906852a4b626cb6de747d87cd88fac4178c27320d9ea54a88d8b6ec88a6b5becf5e5acbaa9719e89a970cf212a2be
7
+ data.tar.gz: 1255c4a8131c922c9fc97791ca28e288d0e6b950827dbffaefd662b9e7805f8d8a8413b89ee2e131ca84c35a1c6d50d1ff31dd737d8a9694c3b2c91076b1fc4c
@@ -180,17 +180,9 @@ class RS::Waybill < RS::Validable
180
180
  # Service user ID, who created this waybill.
181
181
  attr_accessor :user_id
182
182
 
183
- def transport_vehicle?
184
- self.transport_type_id == RS::TRANS_VEHICLE || self.transport_type_id == RS::TRANS_VEHICLE_FRGN
185
- end
186
-
187
- def buyer_required?
188
- self.type != RS::WAYBILL_TYPE_DISTR
189
- end
190
-
191
- def seller_required?
192
- self.type != RS::WAYBILL_TYPE_SUBWB
193
- end
183
+ def transport_vehicle?; self.transport_type_id == RS::TRANS_VEHICLE || self.transport_type_id == RS::TRANS_VEHICLE_FRGN end
184
+ def buyer_required?; self.type != RS::WAYBILL_TYPE_DISTR end
185
+ def seller_required?; self.type != RS::WAYBILL_TYPE_SUBWB end
194
186
 
195
187
  # Convert this waybill to XML.
196
188
  def to_xml(xml)
@@ -203,13 +195,17 @@ class RS::Waybill < RS::Validable
203
195
  b.ID (self.id ? self.id : 0)
204
196
  b.TYPE self.type
205
197
 
206
- # buyer not sent for distrib order
207
- if buyer_required?
198
+ if self.type == RS::WAYBILL_TYPE_INNER # inner
199
+ b.BUYER_TIN ''
200
+ b.CHEK_BUYER_TIN 1
201
+ b.BUYER_NAME ''
202
+ b.END_ADDRESS self.end_address
203
+ elsif buyer_required? # default
208
204
  b.BUYER_TIN self.buyer_tin
209
205
  b.CHEK_BUYER_TIN (self.check_buyer_tin ? 1 : 0)
210
206
  b.BUYER_NAME self.buyer_name
211
207
  b.END_ADDRESS self.end_address
212
- else
208
+ else # distribution
213
209
  b.BUYER_TIN ''
214
210
  b.CHEK_BUYER_TIN 1
215
211
  b.BUYER_NAME ''
@@ -11,7 +11,7 @@ class RS::BaseRequest
11
11
  INVOICE_SERVICE_URL = 'http://www.revenue.mof.ge/ntosservice/ntosservice.asmx?WSDL'
12
12
 
13
13
  # Defaults
14
- DEFAULTS = {su: 'dimitri1979', sp: '123456', payer_id: 731937, user_id: 783}
14
+ DEFAULTS = {su: 'DIMITRI1979:206322102', sp: '123456', payer_id: 731937, user_id: 783}
15
15
 
16
16
  # Last error code.
17
17
  attr_accessor :last_error_code
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module RS
3
- VERSION = '0.1.10'
3
+ VERSION = '0.1.11'
4
4
  end
@@ -66,7 +66,7 @@ describe 'create factura with items' do
66
66
  its(:unit) { should == 'kg' }
67
67
  its(:quantity) { should == 10 }
68
68
  its(:total) { should == 100 }
69
- its(:vat) { should == 18 }
69
+ its(:vat) { should == 15.25 }
70
70
  its(:excise) { should == 0 }
71
71
  its(:excise_id) { should == 0 }
72
72
  end
@@ -125,7 +125,7 @@ describe 'get factura' do
125
125
  its(:registration_date) { should_not be_nil }
126
126
  its(:seller_id) { should == 731937 }
127
127
  #its(:status) { should == RS::Factura::STATUS_START }
128
- its(:status) { should == RS::Factura::STATUS_SENT }
128
+ its(:status) { should == RS::Factura::STATUS_CONFIRMED }
129
129
  its(:correction_of) { should be_nil }
130
130
  end
131
131
  context do
@@ -23,8 +23,9 @@ describe 'Save invoice' do
23
23
  @waybill = RS.wb.get_waybill(id: @waybill.id)
24
24
  end
25
25
  subject { @waybill }
26
+ specify { @resp.should == -1042 } # cannot update waybill with invoice
26
27
  its(:error_code) { should be_nil }
27
- its(:total) { should == 50 }
28
+ its(:total) { should == 1 }
28
29
  end
29
30
  context 'update invoice' do
30
31
  before(:all) do
@@ -17,27 +17,24 @@ describe 'working with service user' do
17
17
  @password = '123456'
18
18
  @new_password = 'new_password_123456'
19
19
  @ip = RS.sys.what_is_my_ip
20
- # @resp = RS.sys.create_user(USER01.merge(ip: @ip, name: 'test', su: @username, sp: @password))
21
20
  end
22
- # subject { @resp }
23
- # it { should == true }
24
21
  describe 'update service user' do
25
22
  before(:all) do
26
- @resp = RS.sys.update_user(USER01.merge(ip: @ip, name: 'test', su: @username, sp: @new_password))
23
+ @resp = RS.sys.update_user(USER01.merge(ip: @ip, name: 'test', su: RS.config.su, sp: RS.config.sp))
27
24
  end
28
25
  subject { @resp }
29
26
  it { should == true }
30
27
  end
31
28
  describe 'check service user: illegal user/password' do
32
29
  before(:all) do
33
- @resp = RS.sys.check_user(su: @username, sp: @password)
30
+ @resp = RS.sys.check_user(su: RS.config.su, sp: 'illegal password')
34
31
  end
35
32
  subject { @resp }
36
33
  it { should be_nil }
37
34
  end
38
35
  describe 'check service user: legal user/password' do
39
36
  before(:all) do
40
- @resp = RS.sys.check_user(su: @username, sp: @new_password)
37
+ @resp = RS.sys.check_user(su: RS.config.su, sp: RS.config.sp)
41
38
  end
42
39
  subject { @resp }
43
40
  it { should_not be_nil }
@@ -65,5 +62,5 @@ describe 'get service users list' do
65
62
  end
66
63
  subject { @users }
67
64
  it { should_not be_empty }
68
- its(:size) { should == 190 }
65
+ its(:size) { should > 50 }
69
66
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rs.ge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitri Kurashvili
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-01 00:00:00.000000000 Z
11
+ date: 2014-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
132
  version: '0'
133
133
  requirements: []
134
134
  rubyforge_project: rs
135
- rubygems_version: 2.0.3
135
+ rubygems_version: 2.2.2
136
136
  signing_key:
137
137
  specification_version: 4
138
138
  summary: rs.ge web services