tsubaiso-sdk 1.2.7 → 1.2.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 394ff46b866be9b88b3f3240d749d5981ae40c659f08c388adc763908f15b861
4
- data.tar.gz: caa5951cfbc2dbcb16a72f240e5ebdfb3f70151eb7b763bb2c52a158fa72200d
3
+ metadata.gz: 02ffb9f6d4a5da8eefd188c1d7ca232c73d5a42a2ea237201b74acac5cce2745
4
+ data.tar.gz: 20ff873540ceea55967a9c3c18545f9d161af350b8c64b3b75441e6f32fa70c0
5
5
  SHA512:
6
- metadata.gz: 7681bd9b474bf300e774b8d4594dd99580924af1563e8bafe2e605503023f8f66b87aaf976bf3539038240c74e67b817466e6eafb87127e603d2cb7a638d5a92
7
- data.tar.gz: 8f8b1b847e9e876a5be43ea21826bd72144c26c4b2a45d67d732fd25a7d3d373129e20e1ea9120a762451f1fdf6bd53b40f765444420ae5f9b52462adb05ea88
6
+ metadata.gz: a9f8e72a3412f54b8a6d9a08425ea79d13e0f2d87379235a05675db979f877215c9a002912d57c699541cdf4581d9a04735f38f275e538740f09e760adfb7891
7
+ data.tar.gz: '0958aacab1ee600c7ab06701c6dc89d1677b3a808668d34d8b3a4a078c096c36881a7b89c94301e7a9170e950569d8e3303a567aa41f308f16a51b79b69d3113'
data/lib/tsubaiso_sdk.rb CHANGED
@@ -590,7 +590,9 @@ class TsubaisoSDK
590
590
  'zip',
591
591
  'pay_date_if_holiday',
592
592
  'receive_date_if_holiday',
593
- 'data_partner'
593
+ 'data_partner',
594
+ 'corporate_mynumber',
595
+ 'pay_method',
594
596
  ]
595
597
  params = {}
596
598
  params = create_parameters(available_keys.map{|x| x.to_sym},options)
@@ -731,6 +733,67 @@ class TsubaisoSDK
731
733
  api_request(uri, 'POST', params)
732
734
  end
733
735
 
736
+ def create_corp(options)
737
+ params = {
738
+ 'format' => 'json',
739
+ 'stage' => options[:stage],
740
+ 'corporate_master_type' => options[:corporate_master_type],
741
+ 'email_to' => options[:email_to],
742
+ 'name' => options[:name],
743
+ 'freeze_login' => options[:freeze_login]
744
+ }
745
+ uri = URI.parse(@base_url + '/corporate_masters/create')
746
+ api_request(uri, 'POST', params)
747
+ end
748
+
749
+ def create_user(options)
750
+ params = {
751
+ 'format' => 'json'
752
+ }
753
+ uri = URI.parse(@base_url + '/users/create')
754
+ api_request(uri, 'POST', params)
755
+ end
756
+
757
+ def update_user(options)
758
+ params = {
759
+ 'format' => 'json',
760
+ 'id' => options[:id],
761
+ 'email' => options[:email],
762
+ 'firstname' => options[:firstname],
763
+ 'lastname' => options[:lastname],
764
+ 'permitted_address' => options[:permitted_address],
765
+ 'dept_codes' => options[:dept_codes],
766
+ 'lang' => options[:lang],
767
+ 'inuse' => options[:inuse],
768
+ }
769
+ uri = URI.parse(@base_url + '/users/update')
770
+ api_request(uri, 'POST', params)
771
+ end
772
+
773
+ def add_domains(options)
774
+ params = {
775
+ 'format' => 'json',
776
+ 'id' => options[:id],
777
+ 'domains' => options[:domains]
778
+ }
779
+ uri = URI.parse(@base_url + '/users/add_domains')
780
+ api_request(uri, 'POST', params)
781
+ end
782
+
783
+ def create_fiscal_master(options)
784
+ params = {
785
+ 'format' => 'json',
786
+ 'term' => options[:term],
787
+ 'start_timestamp' => options[:start_timestamp],
788
+ 'finish_timestamp' => options[:finish_timestamp],
789
+ 'launch_timestamp' => options[:launch_timestamp],
790
+ 'status' => options[:status],
791
+ 'sales_tax_system' => options[:sales_tax_system]
792
+ }
793
+ uri = URI.parse(@base_url + '/fiscal_masters/create')
794
+ api_request(uri, 'POST', params)
795
+ end
796
+
734
797
  def create_reimbursement(options)
735
798
  params = {
736
799
  'format' => 'json',
@@ -738,7 +801,10 @@ class TsubaisoSDK
738
801
  'application_term' => options[:application_term],
739
802
  'staff_code' => options[:staff_code],
740
803
  'dept_code' => options[:dept_code],
741
- 'memo' => options[:memo]
804
+ 'memo' => options[:memo],
805
+ 'applicant_staff_code' => options[:applicant_staff_code],
806
+ 'transactions' => options[:transactions],
807
+ 'pay_date' => options[:pay_date]
742
808
  }
743
809
  uri = URI.parse(@base_url + '/reimbursements/create')
744
810
  api_request(uri, 'POST', params)
@@ -945,8 +1011,9 @@ class TsubaisoSDK
945
1011
  api_request(uri, "POST",params)
946
1012
  end
947
1013
 
948
- def update_staff_data(options)
1014
+ def update_staff_data(staff_data_id, options)
949
1015
  params = {
1016
+ 'code' => options[:code],
950
1017
  'memo' => options[:memo],
951
1018
  'value' => options[:value],
952
1019
  'start_timestamp' => options[:start_timestamp],
@@ -959,7 +1026,7 @@ class TsubaisoSDK
959
1026
  params[:no_finish_timestamp] = options[:no_finish_timestamp]
960
1027
  end
961
1028
 
962
- uri = URI.parse(@base_url + "/staff_data/update/#{options[:staff_id]}")
1029
+ uri = URI.parse(@base_url + "/staff_data/update/#{staff_data_id}")
963
1030
  api_request(uri, 'POST', params)
964
1031
  end
965
1032
 
@@ -1174,6 +1241,512 @@ class TsubaisoSDK
1174
1241
  api_request(uri, 'GET', params)
1175
1242
  end
1176
1243
 
1244
+ def create_account_masters(options)
1245
+ candidate_keys = [
1246
+ :account_code,
1247
+ :account_name,
1248
+ :descid,
1249
+ :account_kana,
1250
+ :dc,
1251
+ :bspl,
1252
+ :sum_no,
1253
+ :brief,
1254
+ :inputtable,
1255
+ :use_in_balance,
1256
+ :status,
1257
+ ]
1258
+ params = create_parameters(candidate_keys,options)
1259
+ uri = URI.parse(@base_url + '/account_masters/create')
1260
+ api_request(uri, 'POST', params)
1261
+ end
1262
+
1263
+ def update_account_masters(options)
1264
+ candidate_keys = [
1265
+ :id,
1266
+ :account_code,
1267
+ :account_name,
1268
+ :account_kana,
1269
+ :descid,
1270
+ :brief,
1271
+ :sum_no,
1272
+ :dc,
1273
+ :bspl,
1274
+ :inputtable,
1275
+ :use_in_balance,
1276
+ :status,
1277
+ ]
1278
+ params = create_parameters(candidate_keys,options)
1279
+ uri = URI.parse(@base_url + '/account_masters/update')
1280
+ api_request(uri, 'POST', params)
1281
+ end
1282
+
1283
+ def list_account_masters
1284
+ params = {
1285
+ 'format' => 'json',
1286
+ }
1287
+ uri = URI.parse(@base_url + "/account_masters/list")
1288
+ api_request(uri, 'GET', params)
1289
+ end
1290
+
1291
+ def create_corporate_data(options)
1292
+ params = {
1293
+ 'format' => 'json',
1294
+ 'code' => options[:code],
1295
+ 'start_timestamp' => options[:start_timestamp],
1296
+ 'finish_timestamp' => options[:finish_timestamp],
1297
+ 'value' => options[:value],
1298
+ 'memo' => options[:memo]
1299
+ }
1300
+ uri = URI.parse(@base_url + '/corporate_data/create')
1301
+ api_request(uri, 'POST', params)
1302
+ end
1303
+
1304
+ def create_petty_cash_masters(options)
1305
+ params = {
1306
+ 'format' => 'json',
1307
+ 'name' => options[:name],
1308
+ 'start_ymd' => options[:start_ymd],
1309
+ 'finish_ymd' => options[:finish_ymd],
1310
+ 'memo' => options[:memo],
1311
+ }
1312
+ uri = URI.parse(@base_url + '/petty_cash_masters/create')
1313
+ api_request(uri, 'POST', params)
1314
+ end
1315
+
1316
+ def create_ar_reason_masters(options)
1317
+ params = {
1318
+ 'format' => 'json',
1319
+ 'reason_code' => options[:reason_code],
1320
+ 'reason_name' => options[:reason_name],
1321
+ 'dc' => options[:dc],
1322
+ 'account_code' => options[:account_code],
1323
+ 'sort_number' => options[:sort_number],
1324
+ 'is_valid' => options[:is_valid],
1325
+ 'memo' => options[:memo],
1326
+ 'ar_reason_taxes' => options[:ar_reason_taxes],
1327
+ }
1328
+ uri = URI.parse(@base_url + '/ar_reason_masters/create')
1329
+ api_request(uri, 'POST', params)
1330
+ end
1331
+
1332
+ def update_ar_reason_masters(id, options)
1333
+ params = {
1334
+ 'format' => 'json',
1335
+ 'reason_code' => options[:reason_code],
1336
+ 'reason_name' => options[:reason_name],
1337
+ 'dc' => options[:dc],
1338
+ 'sort_number' => options[:sort_number],
1339
+ 'is_valid' => options[:is_valid],
1340
+ 'memo' => options[:memo],
1341
+ 'ar_reason_taxes' => options[:ar_reason_taxes],
1342
+ }
1343
+ uri = URI.parse(@base_url + "/ar_reason_masters/update/#{id}")
1344
+ api_request(uri, 'POST', params)
1345
+ end
1346
+
1347
+ def create_ap_reason_masters(options)
1348
+ params = {
1349
+ 'format' => 'json',
1350
+ 'reason_code' => options[:reason_code],
1351
+ 'reason_name' => options[:reason_name],
1352
+ 'dc' => options[:dc],
1353
+ 'account_code' => options[:account_code],
1354
+ 'sort_number' => options[:sort_number],
1355
+ 'is_valid' => options[:is_valid],
1356
+ 'memo' => options[:memo],
1357
+ 'port_type' => options[:port_type],
1358
+ 'ap_reason_taxes' => options[:ap_reason_taxes],
1359
+ }
1360
+ uri = URI.parse(@base_url + '/ap_reason_masters/create')
1361
+ api_request(uri, 'POST', params)
1362
+ end
1363
+
1364
+ def update_ap_reason_masters(id, options)
1365
+ params = {
1366
+ 'format' => 'json',
1367
+ 'reason_code' => options[:reason_code],
1368
+ 'reason_name' => options[:reason_name],
1369
+ 'dc' => options[:dc],
1370
+ 'port_type' => options[:port_type],
1371
+ 'sort_number' => options[:sort_number],
1372
+ 'is_valid' => options[:is_valid],
1373
+ 'memo' => options[:memo],
1374
+ }
1375
+ uri = URI.parse(@base_url + "/ap_reason_masters/update/#{id}")
1376
+ api_request(uri, 'POST', params)
1377
+ end
1378
+
1379
+ def list_users
1380
+ params = { 'format' => 'json' }
1381
+ uri = URI.parse(@base_url + '/users/list')
1382
+ api_request(uri, 'GET', params)
1383
+ end
1384
+
1385
+ def list_depts
1386
+ params = { 'format' => 'json' }
1387
+ uri = URI.parse(@base_url + '/depts/list/')
1388
+ api_request(uri, 'GET', params)
1389
+ end
1390
+
1391
+ def update_system_managements(options)
1392
+ params = {
1393
+ 'format' => 'json',
1394
+ 'code' => options[:code],
1395
+ 'enable' => options[:enable],
1396
+ }
1397
+ uri = URI.parse(@base_url + '/system_managements/update')
1398
+ api_request(uri, 'POST', params)
1399
+ end
1400
+
1401
+ def create_tags(options)
1402
+ params = {
1403
+ 'format' => 'json',
1404
+ 'code' => options[:code],
1405
+ 'name' => options[:name],
1406
+ 'sort_no' => options[:sort_no],
1407
+ 'tag_group_code' => options[:tag_group_code],
1408
+ 'start_ymd' => options[:start_ymd],
1409
+ 'finish_ymd' => options[:finish_ymd],
1410
+ }
1411
+ uri = URI.parse(@base_url + '/tags/create')
1412
+ api_request(uri, 'POST', params)
1413
+ end
1414
+
1415
+ def create_ar_segment_masters(options)
1416
+ params = {
1417
+ 'format' => 'json',
1418
+ 'account_descid' => options[:account_descid],
1419
+ 'priority_order' => options[:priority_order],
1420
+ 'enable' => options[:enable],
1421
+ 'name' => options[:name],
1422
+ 'description' => options[:description],
1423
+ }
1424
+ uri = URI.parse(@base_url + '/ar_segment_masters/create')
1425
+ api_request(uri, 'POST', params)
1426
+ end
1427
+
1428
+ def create_ap_segment_masters(options)
1429
+ params = {
1430
+ 'format' => 'json',
1431
+ 'account_descid' => options[:account_descid],
1432
+ 'priority_order' => options[:priority_order],
1433
+ 'enable' => options[:enable],
1434
+ 'name' => options[:name],
1435
+ 'description' => options[:description],
1436
+ }
1437
+ uri = URI.parse(@base_url + '/ap_segment_masters/create')
1438
+ api_request(uri, 'POST', params)
1439
+ end
1440
+
1441
+ def list_fiscal_masters
1442
+ params = {
1443
+ 'format' => 'json',
1444
+ }
1445
+ uri = URI.parse(@base_url + "/fiscal_masters/list")
1446
+ api_request(uri, 'GET', params)
1447
+ end
1448
+
1449
+ def list_balance_plan_masters
1450
+ params = {
1451
+ 'format' => 'json',
1452
+ }
1453
+ uri = URI.parse(@base_url + "/balance_plan_masters/list")
1454
+ api_request(uri, 'GET', params)
1455
+ end
1456
+
1457
+ def create_balance_plan_masters(options)
1458
+ params = {
1459
+ 'format' => 'json',
1460
+ 'code' => options[:code],
1461
+ 'name' => options[:name],
1462
+ 'memo' => options[:memo],
1463
+ 'start_ymd' => options[:start_ymd],
1464
+ 'finish_ymd' => options[:finish_ymd],
1465
+ 'in_use' => options[:in_use],
1466
+ 'is_default' => options[:is_default],
1467
+ }
1468
+ uri = URI.parse(@base_url + '/balance_plan_masters/create')
1469
+ api_request(uri, 'POST', params)
1470
+ end
1471
+
1472
+ def update_staffs(id, options)
1473
+ candidate_keys = [
1474
+ :code,
1475
+ :status,
1476
+ :dept_codes,
1477
+ ]
1478
+ params = create_parameters(candidate_keys,options)
1479
+ uri = URI.parse(@base_url + "/staffs/update/#{id}")
1480
+ api_request(uri, 'POST', params)
1481
+ end
1482
+
1483
+ def create_personalized_asset_type_masters(options)
1484
+ candidate_keys = [
1485
+ :code,
1486
+ :name,
1487
+ :asset_account_code,
1488
+ :contra_account_code,
1489
+ :contra_mc_account_code,
1490
+ :impairment_account_code,
1491
+ :impairment_mc_account_code,
1492
+ :accumulated_depreciation_account_code,
1493
+ :local_tax_segment_code,
1494
+ :corporate_tax_segment_name,
1495
+ :sort_no
1496
+ ]
1497
+ params = create_parameters(candidate_keys, options)
1498
+ uri = URI.parse(@base_url + '/personalized_asset_type_masters/create')
1499
+ api_request(uri, 'POST', params)
1500
+ end
1501
+
1502
+ def bulk_create_or_update_balance_plans(options)
1503
+ candidate_keys = [
1504
+ :balance_plans
1505
+ ]
1506
+ params = create_parameters(candidate_keys, options)
1507
+ uri = URI.parse(@base_url + '/balance_plans/bulk_create_or_update')
1508
+ api_request(uri, 'POST', params)
1509
+ end
1510
+
1511
+ def list_petty_cash_masters
1512
+ params = { 'format' => 'json' }
1513
+ uri = URI.parse(@base_url + '/petty_cash_masters/list')
1514
+ api_request(uri, 'GET', params)
1515
+ end
1516
+
1517
+ def create_petty_cashes(options)
1518
+ candidate_keys = [
1519
+ :petty_cash_master_id,
1520
+ :start_ymd,
1521
+ :finish_ymd,
1522
+ :start_balance_fixed,
1523
+ ]
1524
+ params = create_parameters(candidate_keys, options)
1525
+ uri = URI.parse(@base_url + '/petty_cashes/create')
1526
+ api_request(uri, 'POST', params)
1527
+ end
1528
+
1529
+ def create_petty_cash_transactions(options)
1530
+ candidate_keys = [
1531
+ :petty_cash_id,
1532
+ :journal_timestamp,
1533
+ :price_value,
1534
+ :reason_code,
1535
+ :dc,
1536
+ :tax_type,
1537
+ :brief,
1538
+ :memo,
1539
+ :tag_list,
1540
+ :dept_code,
1541
+ ]
1542
+ params = create_parameters(candidate_keys, options)
1543
+ uri = URI.parse(@base_url + '/petty_cash_transactions/create')
1544
+ api_request(uri, 'POST', params)
1545
+ end
1546
+
1547
+ def list_ar_reconciliations(year, month)
1548
+ params = { 'format' => 'json' }
1549
+ uri = URI.parse(@base_url + "/ar_reconciliations/list/#{year}/#{month}")
1550
+ api_request(uri, 'GET', params)
1551
+ end
1552
+
1553
+ def reconcile_ar_reconciliations(options)
1554
+ candidate_keys = [
1555
+ :reconciliation_id, # (BankAccount Transaction / PettyCash Transaction / Reimbursement Transaction) JournalDc ID.
1556
+ :reconcile_transactions
1557
+ ]
1558
+ params = create_parameters(candidate_keys, options)
1559
+ uri = URI.parse(@base_url + "/ar_reconciliations/reconcile")
1560
+ api_request(uri, 'POST', params)
1561
+ end
1562
+
1563
+ def reconcile_ap_reconciliations(options)
1564
+ candidate_keys = [
1565
+ :reconciliation_id, # (BankAccount Transaction / PettyCash Transaction / Reimbursement Transaction) JournalDc ID.
1566
+ :reconcile_transactions
1567
+ ]
1568
+ params = create_parameters(candidate_keys, options)
1569
+ uri = URI.parse(@base_url + "/ap_reconciliations/reconcile")
1570
+ api_request(uri, 'POST', params)
1571
+ end
1572
+
1573
+ # @param [String] arap 'ar' または 'ap'
1574
+ def search_customer_masters_by_reconcile_keyword(keyword, arap)
1575
+ params = {
1576
+ 'format' => 'json',
1577
+ 'keyword' => keyword,
1578
+ 'arap' => arap,
1579
+ }
1580
+ uri = URI.parse(@base_url + "/customer_masters/search_by_reconcile_keyword")
1581
+ api_request(uri, 'GET', params)
1582
+ end
1583
+
1584
+ def list_ar_cashflow_schedule(year, month)
1585
+ params = { 'format' => 'json' }
1586
+ uri = URI.parse(@base_url + "/ar_reports/list_cashflow_schedule/#{year}/#{month}")
1587
+ api_request(uri, 'GET', params)
1588
+ end
1589
+
1590
+ def list_ap_cashflow_schedule(year, month)
1591
+ params = { 'format' => 'json' }
1592
+ uri = URI.parse(@base_url + "/ap_reports/list_cashflow_schedule/#{year}/#{month}")
1593
+ api_request(uri, 'GET', params)
1594
+ end
1595
+
1596
+ def standardize_payroll_column_masters(year, month)
1597
+ params = {
1598
+ 'format' => 'json',
1599
+ 'year' => year,
1600
+ 'month' => month,
1601
+ }
1602
+ uri = URI.parse(@base_url + "/payroll_column_masters/standardize")
1603
+ api_request(uri, 'POST', params)
1604
+ end
1605
+
1606
+ def show_payroll_column_masters(year, month)
1607
+ params = {
1608
+ 'format' => 'json',
1609
+ 'year' => year,
1610
+ 'month' => month,
1611
+ }
1612
+ uri = URI.parse(@base_url + "/payroll_column_masters/show")
1613
+ api_request(uri, 'GET', params)
1614
+ end
1615
+
1616
+ def update_payrolls(options)
1617
+ candidate_keys = [
1618
+ :year,
1619
+ :month,
1620
+ :only_save,
1621
+ :update_journal,
1622
+ :staffs
1623
+ ]
1624
+ params = create_parameters(candidate_keys, options)
1625
+ uri = URI.parse(@base_url + "/payrolls/update")
1626
+ api_request(uri, 'POST', params)
1627
+ end
1628
+
1629
+ def list_ap_reconciliations(year, month)
1630
+ params = { 'format' => 'json' }
1631
+ uri = URI.parse(@base_url + "/ap_reconciliations/list/#{year}/#{month}")
1632
+ api_request(uri, 'GET', params)
1633
+ end
1634
+
1635
+ def update_boy_adjusts(options)
1636
+ candidate_keys = [
1637
+ :term,
1638
+ :dept_code,
1639
+ :fixed_balances
1640
+ ]
1641
+ params = create_parameters(candidate_keys, options)
1642
+ uri = URI.parse(@base_url + "/adjusts/update_boy")
1643
+ api_request(uri, 'POST', params)
1644
+ end
1645
+
1646
+ def brought_forward_adjusts(options)
1647
+ candidate_keys = [
1648
+ :term,
1649
+ :dept_code,
1650
+ :calc_common
1651
+ ]
1652
+ params = create_parameters(candidate_keys, options)
1653
+ uri = URI.parse(@base_url + "/adjusts/brought_forward")
1654
+ api_request(uri, 'POST', params)
1655
+ end
1656
+
1657
+ def update_bank_adjusts(options)
1658
+ candidate_keys = [
1659
+ :bank_term_balances
1660
+ ]
1661
+ params = create_parameters(candidate_keys, options)
1662
+ uri = URI.parse(@base_url + "/adjusts/update_bank")
1663
+ api_request(uri, 'POST', params)
1664
+ end
1665
+
1666
+ def create_fixed_assets(options)
1667
+ candidate_keys = [
1668
+ :acquire_method,
1669
+ :acquire_source_journal_dc_id,
1670
+ :acquire_ymd,
1671
+ :asset_type_master_id,
1672
+ :brief,
1673
+ :code,
1674
+ :depreciation_entry_method,
1675
+ :depreciation_method,
1676
+ :dept_code,
1677
+ :durable_years,
1678
+ :ignore_immediate_depreciation_limit,
1679
+ :initial_depreciated_amount,
1680
+ :installed_place,
1681
+ :is_product_cost,
1682
+ :name,
1683
+ :quantity,
1684
+ :start_ymd,
1685
+ :tag_list,
1686
+ :target_ym,
1687
+ :amount_inclusive,
1688
+ :tax_code
1689
+ ]
1690
+ params = create_parameters(candidate_keys, options)
1691
+ uri = URI.parse(@base_url + "/fixed_assets/create")
1692
+ api_request(uri, 'POST', params)
1693
+ end
1694
+
1695
+ def list_personalized_asset_type_masters
1696
+ params = { 'format' => 'json' }
1697
+ uri = URI.parse(@base_url + '/personalized_asset_type_masters/list')
1698
+ api_request(uri, 'GET', params)
1699
+ end
1700
+
1701
+ def update_journals_payrolls(options)
1702
+ candidate_keys = [
1703
+ :year,
1704
+ :month
1705
+ ]
1706
+ params = create_parameters(candidate_keys, options)
1707
+ uri = URI.parse(@base_url + "/payrolls/update_journals")
1708
+ api_request(uri, 'POST', params)
1709
+ end
1710
+
1711
+ def calc_balances_queues(options)
1712
+ candidate_keys = [
1713
+ :dept_code,
1714
+ :account_code,
1715
+ :ym_from,
1716
+ :ym_until
1717
+ ]
1718
+ params = create_parameters(candidate_keys, options)
1719
+ uri = URI.parse(@base_url + "/balances/calc_queues")
1720
+ api_request(uri, 'POST', params)
1721
+ end
1722
+
1723
+ def default_fixed_assets_revaluations(id)
1724
+ params = { 'format' => 'json' }
1725
+ uri = URI.parse(@base_url + "/fixed_assets/default_revaluations/#{id}")
1726
+ api_request(uri, 'GET', params)
1727
+ end
1728
+
1729
+ def create_fixed_assets_revaluations(options)
1730
+ candidate_keys = [
1731
+ :id,
1732
+ :asset_revaluations
1733
+ ]
1734
+ params = create_parameters(candidate_keys, options)
1735
+ uri = URI.parse(@base_url + "/fixed_assets/create_revaluations")
1736
+ api_request(uri, 'POST', params)
1737
+ end
1738
+
1739
+ def create_fixed_assets_journal(options)
1740
+ candidate_keys = [
1741
+ :id,
1742
+ :year,
1743
+ :month
1744
+ ]
1745
+ params = create_parameters(candidate_keys, options)
1746
+ uri = URI.parse(@base_url + "/fixed_assets/create_journal")
1747
+ api_request(uri, 'POST', params)
1748
+ end
1749
+
1177
1750
  private
1178
1751
 
1179
1752
 
@@ -1197,14 +1770,17 @@ class TsubaisoSDK
1197
1770
  request['Access-Token'] = @access_token
1198
1771
  request.body = params.to_json
1199
1772
  response = http.request(request)
1200
- if response.body
1773
+ if response.body && !response.body.empty?
1201
1774
  begin
1202
1775
  { :status => response.code, :json => recursive_symbolize_keys(JSON.parse(response.body)) }
1203
1776
  rescue
1777
+ puts "rescue"
1778
+ puts "response.code:#{response.code}"
1779
+ puts "response.body:#{response.body}"
1204
1780
  response.body
1205
1781
  end
1206
1782
  else
1207
- response.code
1783
+ { :status => response.code }
1208
1784
  end
1209
1785
  end
1210
1786
 
@@ -60,4 +60,31 @@ class ReimbursementsTest < Minitest::Test
60
60
  assert_equal @reimbursement_1[:applicant], reimbursement[:json][:applicant]
61
61
  end
62
62
 
63
+ def test_create_reimbursement_and_transactions
64
+ request_body = {
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)
81
+ assert_equal 200, reimbursement[:status].to_i, reimbursement.inspect
82
+ assert_equal request_body[:applicant], reimbursement[:json][:applicant]
83
+ assert_equal request_body[:pay_date], reimbursement[:json][:pay_date]
84
+ assert_equal request_body[:applicant_staff_code], reimbursement[:json][:applicant_staff_code]
85
+
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
+ end
63
90
  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.7
4
+ version: 1.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tsubaiso, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-11 00:00:00.000000000 Z
11
+ date: 2021-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -72,7 +72,6 @@ files:
72
72
  - test/tsubaiso_sdk/test_bank_account_transaction.rb
73
73
  - test/tsubaiso_sdk/test_bank_reason_master.rb
74
74
  - test/tsubaiso_sdk/test_bonus.rb
75
- - test/tsubaiso_sdk/test_bulk_scheduled_dates.rb
76
75
  - test/tsubaiso_sdk/test_corporate_master.rb
77
76
  - test/tsubaiso_sdk/test_customer.rb
78
77
  - test/tsubaiso_sdk/test_dept.rb
@@ -1,24 +0,0 @@
1
- require 'minitest/autorun'
2
- require_relative './common_setup_and_teardown.rb'
3
-
4
- class BulkScheduledDatesTest < Minitest::Test
5
- include CommonSetupAndTeardown
6
-
7
- def setup
8
- super('scheduled_dates')
9
- end
10
-
11
- def test_calc_scheduled_dates
12
- input_scheduled_dates = [
13
- { target_date: '2019-01-02', sight: '1m10', closing_day: '5', shift: 'before' },
14
- { target_date: nil, sight: '1m10', closing_day: '5', shift: 'before' }
15
- ]
16
- response = @api.bulk_scheduled_date(input_scheduled_dates)
17
- assert_equal '200', response[:status]
18
- assert_equal '2019-01-10', response[:json][0][:scheduled_date]
19
- assert_equal '200', response[:json][0][:status]
20
-
21
- assert_equal '422', response[:json][1][:status]
22
- assert_equal 'target date is required', respoonse[:json][1][:error]
23
- end
24
- end