tsubaiso-sdk 1.2.13 → 1.2.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/tsubaiso_sdk.rb +81 -21
- data/test/tsubaiso_sdk/test_ap_reason_masters.rb +40 -0
- data/test/tsubaiso_sdk/test_ar_reason_masters.rb +39 -0
- data/test/tsubaiso_sdk/test_bank_reason_master.rb +6 -3
- data/test/tsubaiso_sdk/test_petty_cash_reason_master.rb +9 -5
- data/test/tsubaiso_sdk/test_reimbursement_reason_master.rb +52 -0
- data/test/tsubaiso_sdk/test_reimbursements.rb +31 -25
- data/test/tsubaiso_sdk/test_sale.rb +8 -8
- data/test/tsubaiso_sdk/test_staff_data.rb +3 -3
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 79db8171ac5d76cbd13949507c7f0bc17f70c56b845321b64437c90d9dfe6706
|
|
4
|
+
data.tar.gz: 8b3e07cf9d7f03f4fdcda153464745d5e2cae9fc4e1b63ac997149f8beba2354
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2fbb6a4aba086ceb613cfd60493ecf24a06e95b751e3b974619454f8d3bfe98e64f31fa9735b78602e5db6ccdb916a4b18338387c0a0aabd349a62526f5acfca
|
|
7
|
+
data.tar.gz: 8149d29eb5e6f6108eb6b36131763d1bc6e4aec7d68cef73e28514afe05ee7437fd535b6cf70fb5c9952600d5c2a2ba934dca0e03406b0c1da39bd65da8c1094
|
data/lib/tsubaiso_sdk.rb
CHANGED
|
@@ -15,6 +15,7 @@ class TsubaisoSDK
|
|
|
15
15
|
def initialize(options = {})
|
|
16
16
|
@base_url = options[:base_url] || 'https://tsubaiso.net'
|
|
17
17
|
@access_token = options[:access_token] || "Fake_Token"
|
|
18
|
+
@http_option = options[:http_option] || {}
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
def list_bank_account_masters
|
|
@@ -166,6 +167,14 @@ class TsubaisoSDK
|
|
|
166
167
|
api_request(uri, 'POST', params)
|
|
167
168
|
end
|
|
168
169
|
|
|
170
|
+
def setup_account_assignments
|
|
171
|
+
params = {
|
|
172
|
+
'format' => 'json',
|
|
173
|
+
}
|
|
174
|
+
uri = URI.parse(@base_url + '/account_assignments/initial_setup')
|
|
175
|
+
api_request(uri, 'POST', params)
|
|
176
|
+
end
|
|
177
|
+
|
|
169
178
|
def index_api_history
|
|
170
179
|
params = { 'format' => 'json' }
|
|
171
180
|
uri = URI.parse(@base_url + '/api_histories/index')
|
|
@@ -617,6 +626,7 @@ class TsubaisoSDK
|
|
|
617
626
|
'is_valid' => options[:is_valid],
|
|
618
627
|
'memo' => options[:memo],
|
|
619
628
|
'account_code' => options[:account_code],
|
|
629
|
+
'bank_reason_taxes' => options[:bank_reason_taxes],
|
|
620
630
|
'format' => 'json'
|
|
621
631
|
}
|
|
622
632
|
uri = URI.parse(@base_url + '/bank_reason_masters/create')
|
|
@@ -750,7 +760,8 @@ class TsubaisoSDK
|
|
|
750
760
|
'corporate_master_type' => options[:corporate_master_type],
|
|
751
761
|
'email_to' => options[:email_to],
|
|
752
762
|
'name' => options[:name],
|
|
753
|
-
'freeze_login' => options[:freeze_login]
|
|
763
|
+
'freeze_login' => options[:freeze_login],
|
|
764
|
+
'not_personalize_account' => options[:not_personalize_account]
|
|
754
765
|
}
|
|
755
766
|
uri = URI.parse(@base_url + '/corporate_masters/create')
|
|
756
767
|
api_request(uri, 'POST', params)
|
|
@@ -899,7 +910,8 @@ class TsubaisoSDK
|
|
|
899
910
|
'is_valid' => options[:is_valid],
|
|
900
911
|
'memo' => options[:memo],
|
|
901
912
|
'port_type' => options[:port_type],
|
|
902
|
-
'sort_number' => options[:sort_number]
|
|
913
|
+
'sort_number' => options[:sort_number],
|
|
914
|
+
'petty_cash_reason_taxes' => options[:petty_cash_reason_taxes],
|
|
903
915
|
}
|
|
904
916
|
uri = URI.parse(@base_url + '/petty_cash_reason_masters/create')
|
|
905
917
|
api_request(uri, 'POST', params)
|
|
@@ -1012,7 +1024,8 @@ class TsubaisoSDK
|
|
|
1012
1024
|
:dc,
|
|
1013
1025
|
:is_valid,
|
|
1014
1026
|
:memo,
|
|
1015
|
-
:account_code
|
|
1027
|
+
:account_code,
|
|
1028
|
+
:bank_reason_taxes
|
|
1016
1029
|
]
|
|
1017
1030
|
|
|
1018
1031
|
params = create_parameters(candidate_keys,options)
|
|
@@ -1144,7 +1157,8 @@ class TsubaisoSDK
|
|
|
1144
1157
|
:is_valid,
|
|
1145
1158
|
:memo,
|
|
1146
1159
|
:port_type,
|
|
1147
|
-
:sort_number
|
|
1160
|
+
:sort_number,
|
|
1161
|
+
:petty_cash_reason_taxes
|
|
1148
1162
|
]
|
|
1149
1163
|
params = create_parameters(candidate_keys,options)
|
|
1150
1164
|
params['format'] = 'json'
|
|
@@ -1352,16 +1366,18 @@ class TsubaisoSDK
|
|
|
1352
1366
|
end
|
|
1353
1367
|
|
|
1354
1368
|
def update_ar_reason_masters(id, options)
|
|
1355
|
-
params = {
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1369
|
+
params = {}
|
|
1370
|
+
candidate_keys = [
|
|
1371
|
+
:reason_code,
|
|
1372
|
+
:reason_name,
|
|
1373
|
+
:dc,
|
|
1374
|
+
:sort_number,
|
|
1375
|
+
:is_valid,
|
|
1376
|
+
:memo,
|
|
1377
|
+
:ar_reason_taxes
|
|
1378
|
+
]
|
|
1379
|
+
params = create_parameters(candidate_keys,options)
|
|
1380
|
+
params['format'] = 'json'
|
|
1365
1381
|
uri = URI.parse(@base_url + "/ar_reason_masters/update/#{id}")
|
|
1366
1382
|
api_request(uri, 'POST', params)
|
|
1367
1383
|
end
|
|
@@ -1384,17 +1400,56 @@ class TsubaisoSDK
|
|
|
1384
1400
|
end
|
|
1385
1401
|
|
|
1386
1402
|
def update_ap_reason_masters(id, options)
|
|
1403
|
+
params = {}
|
|
1404
|
+
candidate_keys = [
|
|
1405
|
+
:reason_code,
|
|
1406
|
+
:reason_name,
|
|
1407
|
+
:dc,
|
|
1408
|
+
:port_type,
|
|
1409
|
+
:sort_number,
|
|
1410
|
+
:is_valid,
|
|
1411
|
+
:memo,
|
|
1412
|
+
:ap_reason_taxes
|
|
1413
|
+
]
|
|
1414
|
+
params = create_parameters(candidate_keys,options)
|
|
1415
|
+
params['format'] = 'json'
|
|
1416
|
+
uri = URI.parse(@base_url + "/ap_reason_masters/update/#{id}")
|
|
1417
|
+
api_request(uri, 'POST', params)
|
|
1418
|
+
end
|
|
1419
|
+
|
|
1420
|
+
def create_reimbursement_reason_masters(options)
|
|
1387
1421
|
params = {
|
|
1388
1422
|
'format' => 'json',
|
|
1389
1423
|
'reason_code' => options[:reason_code],
|
|
1390
1424
|
'reason_name' => options[:reason_name],
|
|
1391
1425
|
'dc' => options[:dc],
|
|
1392
|
-
'
|
|
1426
|
+
'account_code' => options[:account_code],
|
|
1393
1427
|
'sort_number' => options[:sort_number],
|
|
1394
1428
|
'is_valid' => options[:is_valid],
|
|
1395
1429
|
'memo' => options[:memo],
|
|
1430
|
+
'port_type' => options[:port_type],
|
|
1431
|
+
'reimbursement_reason_taxes' => options[:reimbursement_reason_taxes],
|
|
1396
1432
|
}
|
|
1397
|
-
uri = URI.parse(@base_url +
|
|
1433
|
+
uri = URI.parse(@base_url + '/reimbursement_reason_masters/create')
|
|
1434
|
+
api_request(uri, 'POST', params)
|
|
1435
|
+
end
|
|
1436
|
+
|
|
1437
|
+
def update_reimbursement_reason_masters(id, options)
|
|
1438
|
+
params = {}
|
|
1439
|
+
candidate_keys = [
|
|
1440
|
+
:sort_number,
|
|
1441
|
+
:reason_code,
|
|
1442
|
+
:reason_name,
|
|
1443
|
+
:dc,
|
|
1444
|
+
:account_code,
|
|
1445
|
+
:is_valid,
|
|
1446
|
+
:memo,
|
|
1447
|
+
:port_type,
|
|
1448
|
+
:reimbursement_reason_taxes
|
|
1449
|
+
]
|
|
1450
|
+
params = create_parameters(candidate_keys,options)
|
|
1451
|
+
params['format'] = 'json'
|
|
1452
|
+
uri = URI.parse(@base_url + "/reimbursement_reason_masters/update/#{id}")
|
|
1398
1453
|
api_request(uri, 'POST', params)
|
|
1399
1454
|
end
|
|
1400
1455
|
|
|
@@ -1404,11 +1459,11 @@ class TsubaisoSDK
|
|
|
1404
1459
|
api_request(uri, 'GET', params)
|
|
1405
1460
|
end
|
|
1406
1461
|
|
|
1407
|
-
def list_depts
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
end
|
|
1462
|
+
# def list_depts
|
|
1463
|
+
# params = { 'format' => 'json' }
|
|
1464
|
+
# uri = URI.parse(@base_url + '/depts/list/')
|
|
1465
|
+
# api_request(uri, 'GET', params)
|
|
1466
|
+
# end
|
|
1412
1467
|
|
|
1413
1468
|
def update_system_managements(options)
|
|
1414
1469
|
params = {
|
|
@@ -1442,6 +1497,7 @@ class TsubaisoSDK
|
|
|
1442
1497
|
'enable' => options[:enable],
|
|
1443
1498
|
'name' => options[:name],
|
|
1444
1499
|
'description' => options[:description],
|
|
1500
|
+
'no' => options[:no]
|
|
1445
1501
|
}
|
|
1446
1502
|
uri = URI.parse(@base_url + '/ar_segment_masters/create')
|
|
1447
1503
|
api_request(uri, 'POST', params)
|
|
@@ -1455,6 +1511,7 @@ class TsubaisoSDK
|
|
|
1455
1511
|
'enable' => options[:enable],
|
|
1456
1512
|
'name' => options[:name],
|
|
1457
1513
|
'description' => options[:description],
|
|
1514
|
+
'no' => options[:no],
|
|
1458
1515
|
}
|
|
1459
1516
|
uri = URI.parse(@base_url + '/ap_segment_masters/create')
|
|
1460
1517
|
api_request(uri, 'POST', params)
|
|
@@ -1900,6 +1957,9 @@ class TsubaisoSDK
|
|
|
1900
1957
|
|
|
1901
1958
|
def api_request(uri, http_verb, params)
|
|
1902
1959
|
http = Net::HTTP.new(uri.host, uri.port)
|
|
1960
|
+
http.open_timeout = @http_option[:open_timeout] if @http_option[:open_timeout]
|
|
1961
|
+
http.read_timeout = @http_option[:read_timeout] if @http_option[:read_timeout]
|
|
1962
|
+
|
|
1903
1963
|
initheader = { 'Content-Type' => 'application/json' }
|
|
1904
1964
|
http.use_ssl = true if @base_url =~ /^https/
|
|
1905
1965
|
if http_verb == 'GET'
|
|
@@ -5,6 +5,17 @@ class ApReasonMasterTest < Minitest::Test
|
|
|
5
5
|
include CommonSetupAndTeardown
|
|
6
6
|
|
|
7
7
|
def setup
|
|
8
|
+
@ap_reason_master_1 = {
|
|
9
|
+
reason_code: 'sdk_test_create',
|
|
10
|
+
reason_name: 'SDK before update',
|
|
11
|
+
dc: 'd',
|
|
12
|
+
account_code: '100',
|
|
13
|
+
is_valid: '0',
|
|
14
|
+
memo: 'this is test before update',
|
|
15
|
+
port_type: '0',
|
|
16
|
+
sort_number: '0',
|
|
17
|
+
ap_reason_taxes: '免税・簡易・本則/国内/1/3001/210'
|
|
18
|
+
}
|
|
8
19
|
super("ap_reason_masters")
|
|
9
20
|
end
|
|
10
21
|
|
|
@@ -23,4 +34,33 @@ class ApReasonMasterTest < Minitest::Test
|
|
|
23
34
|
assert ap_reason_masters_list[:json]
|
|
24
35
|
assert !ap_reason_masters_list[:json].empty?
|
|
25
36
|
end
|
|
37
|
+
|
|
38
|
+
def test_create_ap_reason_master
|
|
39
|
+
created_apm = @api.create_ap_reason_masters(@ap_reason_master_1)
|
|
40
|
+
assert_equal 200, created_apm[:status].to_i, created_apm.inspect
|
|
41
|
+
assert_equal @ap_reason_master_1[:reason_code], created_apm[:json][:reason_code]
|
|
42
|
+
assert_equal @ap_reason_master_1[:ap_reason_taxes], created_apm[:json][:ap_reason_taxes]
|
|
43
|
+
|
|
44
|
+
shown_apm = @api.show_ap_reason_master(created_apm[:json][:id].to_i)
|
|
45
|
+
assert_equal 200, shown_apm[:status].to_i, shown_apm.inspect
|
|
46
|
+
@ap_reason_master_1.each_pair do |key,val|
|
|
47
|
+
assert_equal val, shown_apm[:json][key], "col :#{key}, #{val} was expected but #{shown_apm[:json][key]} was found."
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def test_update_ap_reason_master
|
|
52
|
+
old_ap_reason_master = @api.create_ap_reason_masters(@ap_reason_master_1)
|
|
53
|
+
options = {
|
|
54
|
+
reason_name: "updating from API",
|
|
55
|
+
memo: "updating memo from API",
|
|
56
|
+
ap_reason_taxes: "免税・簡易・本則/国内/1/3001/210"
|
|
57
|
+
}
|
|
58
|
+
updated_ap_reason_master = @api.update_ap_reason_masters(old_ap_reason_master[:json][:id], options)
|
|
59
|
+
|
|
60
|
+
assert_equal 200, updated_ap_reason_master[:status].to_i, updated_ap_reason_master.inspect
|
|
61
|
+
assert_equal options[:reason_name], updated_ap_reason_master[:json][:reason_name]
|
|
62
|
+
assert_equal options[:memo], updated_ap_reason_master[:json][:memo]
|
|
63
|
+
assert_equal options[:ap_reason_taxes], updated_ap_reason_master[:json][:ap_reason_taxes]
|
|
64
|
+
assert_equal old_ap_reason_master[:json][:reason_code], updated_ap_reason_master[:json][:reason_code]
|
|
65
|
+
end
|
|
26
66
|
end
|
|
@@ -5,6 +5,16 @@ class ArReasonMasterTest < Minitest::Test
|
|
|
5
5
|
include CommonSetupAndTeardown
|
|
6
6
|
|
|
7
7
|
def setup
|
|
8
|
+
@ar_reason_master_1 = {
|
|
9
|
+
reason_code: 'sdk_test_create',
|
|
10
|
+
reason_name: 'SDK before update',
|
|
11
|
+
dc: 'd',
|
|
12
|
+
account_code: '100',
|
|
13
|
+
is_valid: '0',
|
|
14
|
+
memo: 'this is test before update',
|
|
15
|
+
sort_number: '0',
|
|
16
|
+
ar_reason_taxes: '免税・簡易・本則/国内/1/3001/210'
|
|
17
|
+
}
|
|
8
18
|
super("ar_reason_masters")
|
|
9
19
|
end
|
|
10
20
|
|
|
@@ -23,4 +33,33 @@ class ArReasonMasterTest < Minitest::Test
|
|
|
23
33
|
assert_equal 200, ar_reason_master[:status].to_i, ar_reason_master.inspect
|
|
24
34
|
assert_equal ar_reason_master[:json][:id], ar_reason_master_id
|
|
25
35
|
end
|
|
36
|
+
|
|
37
|
+
def test_create_ar_reason_master
|
|
38
|
+
created_arm = @api.create_ar_reason_masters(@ar_reason_master_1)
|
|
39
|
+
assert_equal 200, created_arm[:status].to_i, created_arm.inspect
|
|
40
|
+
assert_equal @ar_reason_master_1[:reason_code], created_arm[:json][:reason_code]
|
|
41
|
+
assert_equal @ar_reason_master_1[:ar_reason_taxes], created_arm[:json][:ar_reason_taxes]
|
|
42
|
+
|
|
43
|
+
shown_arm = @api.show_ar_reason_master(created_arm[:json][:id].to_i)
|
|
44
|
+
assert_equal 200, shown_arm[:status].to_i, shown_arm.inspect
|
|
45
|
+
@ar_reason_master_1.each_pair do |key,val|
|
|
46
|
+
assert_equal val, shown_arm[:json][key], "col :#{key}, #{val} was expected but #{shown_arm[:json][key]} was found."
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def test_update_ar_reason_master
|
|
51
|
+
old_ar_reason_master = @api.create_ar_reason_masters(@ar_reason_master_1)
|
|
52
|
+
options = {
|
|
53
|
+
reason_name: "updating from API",
|
|
54
|
+
memo: "updating memo from API",
|
|
55
|
+
ar_reason_taxes: "免税・簡易・本則/国内/1/3001/210"
|
|
56
|
+
}
|
|
57
|
+
updated_ar_reason_master = @api.update_ar_reason_masters(old_ar_reason_master[:json][:id], options)
|
|
58
|
+
|
|
59
|
+
assert_equal 200, updated_ar_reason_master[:status].to_i, updated_ar_reason_master.inspect
|
|
60
|
+
assert_equal options[:reason_name], updated_ar_reason_master[:json][:reason_name]
|
|
61
|
+
assert_equal options[:memo], updated_ar_reason_master[:json][:memo]
|
|
62
|
+
assert_equal options[:ar_reason_taxes], updated_ar_reason_master[:json][:ar_reason_taxes]
|
|
63
|
+
assert_equal old_ar_reason_master[:json][:reason_code], updated_ar_reason_master[:json][:reason_code]
|
|
64
|
+
end
|
|
26
65
|
end
|
|
@@ -12,7 +12,8 @@ class BankReasonMasterTest < Minitest::Test
|
|
|
12
12
|
dc: "d",
|
|
13
13
|
is_valid: 0,
|
|
14
14
|
memo: "This reason has been created form API",
|
|
15
|
-
account_code: 1
|
|
15
|
+
account_code: 1,
|
|
16
|
+
bank_reason_taxes: "免税・簡易・本則/1/3001/210"
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
@bank_reason_master_2 = {
|
|
@@ -22,7 +23,8 @@ class BankReasonMasterTest < Minitest::Test
|
|
|
22
23
|
dc: "c",
|
|
23
24
|
is_valid: 0,
|
|
24
25
|
memo: "This reason has been created form API2",
|
|
25
|
-
account_code: 1
|
|
26
|
+
account_code: 1,
|
|
27
|
+
bank_reason_taxes: "免税・簡易・本則/1/3001/210"
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
@bank_reason_master_3 = {
|
|
@@ -32,7 +34,8 @@ class BankReasonMasterTest < Minitest::Test
|
|
|
32
34
|
dc: "d",
|
|
33
35
|
is_valid: 0,
|
|
34
36
|
memo: "This reason has been created form API3",
|
|
35
|
-
account_code: 1
|
|
37
|
+
account_code: 1,
|
|
38
|
+
bank_reason_taxes: "免税・簡易・本則/1/3001/210"
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
super("bank_reason_masters")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require 'minitest/autorun'
|
|
2
|
-
require_relative 'common_setup_and_teardown'
|
|
2
|
+
require_relative './common_setup_and_teardown.rb'
|
|
3
3
|
|
|
4
4
|
class PettyCashReasonMaster < Minitest::Test
|
|
5
5
|
include CommonSetupAndTeardown
|
|
@@ -13,7 +13,8 @@ class PettyCashReasonMaster < Minitest::Test
|
|
|
13
13
|
is_valid: '0',
|
|
14
14
|
memo: 'this is test before update',
|
|
15
15
|
port_type: '0',
|
|
16
|
-
sort_number: '0'
|
|
16
|
+
sort_number: '0',
|
|
17
|
+
petty_cash_reason_taxes: '免税・簡易・本則/国内/1/3001/210'
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
@petty_cash_reason_master_2 = {
|
|
@@ -24,7 +25,8 @@ class PettyCashReasonMaster < Minitest::Test
|
|
|
24
25
|
is_valid: "0",
|
|
25
26
|
memo: "This is Test reason.",
|
|
26
27
|
port_type: "0",
|
|
27
|
-
sort_number: "0"
|
|
28
|
+
sort_number: "0",
|
|
29
|
+
petty_cash_reason_taxes: "免税・簡易・本則/国内/1/3001/210"
|
|
28
30
|
}
|
|
29
31
|
super("petty_cash_reason_masters")
|
|
30
32
|
end
|
|
@@ -33,6 +35,7 @@ class PettyCashReasonMaster < Minitest::Test
|
|
|
33
35
|
created_pcrm = @api.create_petty_cash_reason_master(@petty_cash_reason_master_1)
|
|
34
36
|
assert_equal 200, created_pcrm[:status].to_i, created_pcrm.inspect
|
|
35
37
|
assert_equal @petty_cash_reason_master_1[:reason_code], created_pcrm[:json][:reason_code]
|
|
38
|
+
assert_equal @petty_cash_reason_master_1[:petty_cash_reason_taxes], created_pcrm[:json][:petty_cash_reason_taxes]
|
|
36
39
|
|
|
37
40
|
shown_prcm = @api.show_petty_cash_reason_master(created_pcrm[:json][:id].to_i)
|
|
38
41
|
assert_equal 200, created_pcrm[:status].to_i, created_pcrm.inspect
|
|
@@ -45,13 +48,15 @@ class PettyCashReasonMaster < Minitest::Test
|
|
|
45
48
|
old_petty_cash_reason_master = @api.create_petty_cash_reason_master(@petty_cash_reason_master_1)
|
|
46
49
|
options = {
|
|
47
50
|
reason_name: 'updating from API',
|
|
48
|
-
memo: 'updating memo from API'
|
|
51
|
+
memo: 'updating memo from API',
|
|
52
|
+
petty_cash_reason_taxes: '免税・簡易・本則/国内/0/0/30'
|
|
49
53
|
}
|
|
50
54
|
updated_petty_cash_reason_master = @api.update_petty_cash_reason_master(old_petty_cash_reason_master[:json][:id], options)
|
|
51
55
|
|
|
52
56
|
assert_equal 200, updated_petty_cash_reason_master[:status].to_i, updated_petty_cash_reason_master.inspect
|
|
53
57
|
assert_equal options[:reason_name], updated_petty_cash_reason_master[:json][:reason_name]
|
|
54
58
|
assert_equal options[:memo], updated_petty_cash_reason_master[:json][:memo]
|
|
59
|
+
assert_equal options[:petty_cash_reason_taxes], updated_petty_cash_reason_master[:json][:petty_cash_reason_taxes]
|
|
55
60
|
assert_equal old_petty_cash_reason_master[:json][:reason_code], updated_petty_cash_reason_master[:json][:reason_code]
|
|
56
61
|
end
|
|
57
62
|
|
|
@@ -69,4 +74,3 @@ class PettyCashReasonMaster < Minitest::Test
|
|
|
69
74
|
end
|
|
70
75
|
end
|
|
71
76
|
end
|
|
72
|
-
|
|
@@ -5,6 +5,30 @@ class ReimbursementReasonMasterTest < Minitest::Test
|
|
|
5
5
|
include CommonSetupAndTeardown
|
|
6
6
|
|
|
7
7
|
def setup
|
|
8
|
+
@reimbursement_reason_master_1 = {
|
|
9
|
+
reason_code: 'sdk_test_create',
|
|
10
|
+
reason_name: 'SDK before update',
|
|
11
|
+
dc: 'd',
|
|
12
|
+
account_code: '100',
|
|
13
|
+
is_valid: '0',
|
|
14
|
+
memo: 'this is test before update',
|
|
15
|
+
port_type: '0',
|
|
16
|
+
sort_number: '0',
|
|
17
|
+
reimbursement_reason_taxes: '免税・簡易・本則/国内/1/3001/210'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@reimbursement_reason_master_2 = {
|
|
21
|
+
reason_code: "sdk_test_create2",
|
|
22
|
+
reason_name: "TEST_REASON",
|
|
23
|
+
dc: "d",
|
|
24
|
+
account_code: "999",
|
|
25
|
+
is_valid: "0",
|
|
26
|
+
memo: "This is Test reason.",
|
|
27
|
+
port_type: "0",
|
|
28
|
+
sort_number: "0",
|
|
29
|
+
reimbursement_reason_taxes: "免税・簡易・本則/国内/1/3001/210"
|
|
30
|
+
}
|
|
31
|
+
|
|
8
32
|
super("reimbursement_reason_masters")
|
|
9
33
|
end
|
|
10
34
|
|
|
@@ -24,4 +48,32 @@ class ReimbursementReasonMasterTest < Minitest::Test
|
|
|
24
48
|
assert_equal reim_reason_mst[:json][:id], reim_reason_mst_id
|
|
25
49
|
end
|
|
26
50
|
|
|
51
|
+
def test_create_reimbursement_reason_master
|
|
52
|
+
created_rrm = @api.create_reimbursement_reason_masters(@reimbursement_reason_master_1)
|
|
53
|
+
assert_equal 200, created_rrm[:status].to_i, created_rrm.inspect
|
|
54
|
+
assert_equal @reimbursement_reason_master_1[:reason_code], created_rrm[:json][:reason_code]
|
|
55
|
+
assert_equal @reimbursement_reason_master_1[:reimbursement_reason_taxes], created_rrm[:json][:reimbursement_reason_taxes]
|
|
56
|
+
|
|
57
|
+
shown_rrm = @api.show_reimbursement_reason_master(created_rrm[:json][:id].to_i)
|
|
58
|
+
assert_equal 200, created_rrm[:status].to_i, created_rrm.inspect
|
|
59
|
+
@reimbursement_reason_master_1.each_pair do |key,val|
|
|
60
|
+
assert_equal val, shown_rrm[:json][key], "col :#{key}, #{val} was expected but #{shown_rrm[:json][key]} was found."
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
def test_update_reimbursement_reason_master
|
|
65
|
+
old_reimbursement_reason_master = @api.create_reimbursement_reason_masters(@reimbursement_reason_master_1)
|
|
66
|
+
options = {
|
|
67
|
+
reason_name: "updating from API",
|
|
68
|
+
memo: "updating memo from API",
|
|
69
|
+
reimbursement_reason_taxes: "免税・簡易・本則/国内/1/3001/210"
|
|
70
|
+
}
|
|
71
|
+
updated_reimbursement_reason_master = @api.update_reimbursement_reason_masters(old_reimbursement_reason_master[:json][:id], options)
|
|
72
|
+
|
|
73
|
+
assert_equal 200, updated_reimbursement_reason_master[:status].to_i, updated_reimbursement_reason_master.inspect
|
|
74
|
+
assert_equal options[:reason_name], updated_reimbursement_reason_master[:json][:reason_name]
|
|
75
|
+
assert_equal options[:memo], updated_reimbursement_reason_master[:json][:memo]
|
|
76
|
+
assert_equal options[:reimbursement_reason_taxes], updated_reimbursement_reason_master[:json][:reimbursement_reason_taxes]
|
|
77
|
+
assert_equal old_reimbursement_reason_master[:json][:reason_code], updated_reimbursement_reason_master[:json][:reason_code]
|
|
78
|
+
end
|
|
27
79
|
end
|
|
@@ -5,18 +5,44 @@ class ReimbursementsTest < Minitest::Test
|
|
|
5
5
|
include CommonSetupAndTeardown
|
|
6
6
|
|
|
7
7
|
def setup
|
|
8
|
+
txhash = {}
|
|
9
|
+
txhash[:transaction_timestamp] = '2016-03-01'
|
|
10
|
+
txhash[:price_value] = 20000
|
|
11
|
+
txhash[:reason_code] = 'CONFERENCE_EXPENSES_SGA'
|
|
12
|
+
txhash[:dc] = 'd'
|
|
13
|
+
txhash[:brief] = '会議費'
|
|
14
|
+
txhash[:memo] = 'memo'
|
|
15
|
+
txhash[:tax_type] = '租税公課'
|
|
16
|
+
|
|
8
17
|
@reimbursement_1 = {
|
|
9
18
|
applicant: 'Irfan',
|
|
10
19
|
application_term: '2016-03-01',
|
|
11
20
|
staff_code: 'EP2000',
|
|
12
|
-
memo: 'aaaaaaaa'
|
|
21
|
+
memo: 'aaaaaaaa',
|
|
22
|
+
dept_code: 'SETSURITSU',
|
|
23
|
+
applicant_staff_code: 'EP2001',
|
|
24
|
+
pay_date: '2016-02-01'
|
|
13
25
|
}
|
|
14
26
|
|
|
15
27
|
@reimbursement_2 = {
|
|
16
28
|
applicant: 'Matsuno',
|
|
17
29
|
application_term: '2016-03-01',
|
|
18
30
|
staff_code: 'EP2000',
|
|
19
|
-
memo: 'aaaaaaaa'
|
|
31
|
+
memo: 'aaaaaaaa',
|
|
32
|
+
dept_code: 'SETSURITSU',
|
|
33
|
+
applicant_staff_code: 'EP2001',
|
|
34
|
+
pay_date: '2016-02-01'
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@reimbursement_3 = {
|
|
38
|
+
applicant: 'Matsuno',
|
|
39
|
+
application_term: '2016-03-01',
|
|
40
|
+
staff_code: 'EP2000',
|
|
41
|
+
memo: 'aaaaaaaa',
|
|
42
|
+
dept_code: 'SETSURITSU',
|
|
43
|
+
applicant_staff_code: 'EP2001',
|
|
44
|
+
pay_date: '2016-02-01',
|
|
45
|
+
transactions: txhash
|
|
20
46
|
}
|
|
21
47
|
super("reimbursements")
|
|
22
48
|
end
|
|
@@ -61,30 +87,10 @@ class ReimbursementsTest < Minitest::Test
|
|
|
61
87
|
end
|
|
62
88
|
|
|
63
89
|
def test_create_reimbursement_and_transactions
|
|
64
|
-
|
|
65
|
-
applicant: 'Matsuno',
|
|
66
|
-
application_term: '2016-03-01',
|
|
67
|
-
staff_code: 'EP2000',
|
|
68
|
-
memo: 'aaaaaaaa',
|
|
69
|
-
pay_date: '2020-1-13',
|
|
70
|
-
applicant_staff_code: 'test_applicant_code',
|
|
71
|
-
transactions: [
|
|
72
|
-
{
|
|
73
|
-
transaction_timestamp: '2020-1-1',
|
|
74
|
-
price_value: 1000,
|
|
75
|
-
reason_code: 'SUPPLIES'
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
reimbursement = @api.create_reimbursement(request)
|
|
90
|
+
reimbursement = @api.create_reimbursement(@reimbursement_3)
|
|
81
91
|
assert_equal 200, reimbursement[:status].to_i, reimbursement.inspect
|
|
82
|
-
assert_equal
|
|
83
|
-
assert_equal
|
|
84
|
-
assert_equal request_body[:applicant_staff_code], reimbursement[:json][:applicant_staff_code]
|
|
92
|
+
assert_equal @reimbursement_3[:applicant], reimbursement[:json][:applicant]
|
|
93
|
+
assert_equal @reimbursement_3[:pay_date], reimbursement[:json][:pay_date]
|
|
85
94
|
|
|
86
|
-
reimbursement_transactions = @api.list_reimbursement_transactions(reimbursement[:json][:id])
|
|
87
|
-
assert_equal 200, reimbursement_transactions[:status].to_i, reimbursement_transactions.inspect
|
|
88
|
-
assert_equal 1, reimbursement_transactions[:json].size
|
|
89
95
|
end
|
|
90
96
|
end
|
|
@@ -75,14 +75,14 @@ class SaleTest < Minitest::Test
|
|
|
75
75
|
assert(sales_list[:json].none? { |x| x[:id] == september_sale_id })
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
def test_update_sale
|
|
79
|
+
sale = @api.create_sale(@sale_201608)
|
|
80
|
+
options = {
|
|
81
|
+
id: sale[:json][:id].to_i,
|
|
82
|
+
price_including_tax: 25_000,
|
|
83
|
+
memo: 'Updated memo',
|
|
84
|
+
data_partner: { id_code: "100" }
|
|
85
|
+
}
|
|
86
86
|
|
|
87
87
|
updated_sale = @api.update_sale(options)
|
|
88
88
|
assert_equal 200, updated_sale[:status].to_i, updated_sale[:json]
|
|
@@ -58,14 +58,14 @@ class StaffDataTest < Minitest::Test
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def test_update_staff_data
|
|
61
|
+
staff_id = 0
|
|
61
62
|
options = {
|
|
62
|
-
staff_id: 0,
|
|
63
63
|
value: 'Programmer'
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
updated_staff_data = @api.update_staff_data(options)
|
|
66
|
+
updated_staff_data = @api.update_staff_data(staff_id,options)
|
|
67
67
|
assert_equal 200, updated_staff_data[:status].to_i, updated_staff_data.inspect
|
|
68
|
-
assert_equal
|
|
68
|
+
assert_equal staff_id, updated_staff_data[:json][:id].to_i
|
|
69
69
|
assert_equal 'Programmer', updated_staff_data[:json][:value]
|
|
70
70
|
end
|
|
71
71
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tsubaiso-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tsubaiso, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-08-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: json
|
|
@@ -16,20 +16,20 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '2.6'
|
|
20
20
|
- - ">="
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version:
|
|
22
|
+
version: 2.6.3
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
26
|
requirements:
|
|
27
27
|
- - "~>"
|
|
28
28
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: '
|
|
29
|
+
version: '2.6'
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
32
|
+
version: 2.6.3
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
34
|
name: minitest
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
117
|
version: '0'
|
|
118
118
|
requirements: []
|
|
119
|
-
rubygems_version: 3.
|
|
119
|
+
rubygems_version: 3.1.6
|
|
120
120
|
signing_key:
|
|
121
121
|
specification_version: 4
|
|
122
122
|
summary: SDK for the Tsubaiso API
|