rnsap 0.4.8 → 0.4.13
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/auth.rb +132 -0
- data/lib/helper/rfc_helper.rb +19 -15
- data/lib/helper/util_helper.rb +1 -1
- data/lib/po_detail/all.rb +27 -0
- data/lib/po_detail/po_account.rb +93 -0
- data/lib/po_detail/po_addrdelivery.rb +115 -0
- data/lib/po_detail/po_all_versions.rb +55 -0
- data/lib/po_detail/po_components.rb +53 -0
- data/lib/po_detail/po_cond.rb +91 -0
- data/lib/po_detail/po_cond_header.rb +91 -0
- data/lib/po_detail/po_confirmation.rb +39 -0
- data/lib/po_detail/po_contract_limits.rb +21 -0
- data/lib/po_detail/po_exp_imp_header.rb +7 -0
- data/lib/po_detail/po_exp_imp_item.rb +21 -0
- data/lib/po_detail/po_extension_out.rb +13 -0
- data/lib/po_detail/po_header.rb +131 -0
- data/lib/po_detail/po_history.rb +107 -0
- data/lib/po_detail/po_history_ma.rb +37 -0
- data/lib/po_detail/po_history_totals.rb +51 -0
- data/lib/po_detail/po_inv_plan_header.rb +49 -0
- data/lib/po_detail/po_inv_plan_item.rb +51 -0
- data/lib/po_detail/po_item.rb +359 -0
- data/lib/po_detail/po_limits.rb +47 -0
- data/lib/po_detail/po_partner.rb +11 -0
- data/lib/po_detail/po_schedule.rb +59 -0
- data/lib/po_detail/po_serial_number.rb +13 -0
- data/lib/po_detail/po_services.rb +137 -0
- data/lib/po_detail/po_shipping_exp.rb +53 -0
- data/lib/po_detail/po_srv_access_values.rb +17 -0
- data/lib/po_detail/po_text_header.rb +13 -0
- data/lib/po_detail/po_text_item.rb +13 -0
- data/lib/po_release_info/all.rb +1 -0
- data/lib/po_release_info/po_release_final.rb +53 -0
- data/lib/preq_detail/all.rb +8 -0
- data/lib/preq_release_info/all.rb +4 -0
- data/lib/rnsap.rb +141 -40
- metadata +35 -2
data/lib/rnsap.rb
CHANGED
@@ -2,19 +2,15 @@
|
|
2
2
|
|
3
3
|
require 'nwrfc'
|
4
4
|
require 'read_table/table_column'
|
5
|
-
|
6
|
-
require 'preq_detail/preq_acct_assignment'
|
7
|
-
require 'preq_detail/preq_text'
|
8
|
-
require 'preq_detail/preq_limits'
|
9
|
-
require 'preq_detail/preq_contract_limits'
|
10
|
-
require 'preq_detail/preq_services'
|
11
|
-
require 'preq_detail/preq_services_texts'
|
12
|
-
require 'preq_detail/preq_srv_accass_values'
|
13
|
-
require 'preq_release_info/preq_gen_release_info'
|
14
|
-
require 'preq_release_info/preq_release_prerequisites'
|
15
|
-
require 'preq_release_info/preq_release_posted'
|
16
|
-
require 'preq_release_info/preq_release_final'
|
5
|
+
|
17
6
|
require 'return'
|
7
|
+
|
8
|
+
require 'preq_detail/all'
|
9
|
+
require 'preq_release_info/all'
|
10
|
+
|
11
|
+
require 'po_detail/all'
|
12
|
+
require 'po_release_info/all'
|
13
|
+
|
18
14
|
require 'helper/rfc_helper'
|
19
15
|
require 'helper/util_helper'
|
20
16
|
|
@@ -165,19 +161,21 @@ module RnSap
|
|
165
161
|
value = wa[pos].to_f
|
166
162
|
eval("obj.#{field} = #{value}")
|
167
163
|
elsif DATE_TYPES.include?(column.type)
|
168
|
-
value
|
169
|
-
if value == '00000000'
|
164
|
+
if value.nil? || value == '00000000'
|
170
165
|
eval("obj.#{field} = nil")
|
171
166
|
else
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
)
|
177
|
-
eval("obj.#{field} = #{value}")
|
167
|
+
year = value[0..3].to_i
|
168
|
+
month = value[4..5].to_i
|
169
|
+
day = value[6..7].to_i
|
170
|
+
# value = Date.new(year, month, day)
|
171
|
+
eval("obj.#{field} = Date.new(#{year}, #{month}, #{day}) ")
|
178
172
|
end
|
179
173
|
else
|
180
|
-
|
174
|
+
begin
|
175
|
+
value = wa[pos].strip
|
176
|
+
rescue
|
177
|
+
value = ''
|
178
|
+
end
|
181
179
|
eval("obj.#{field} = '#{value}'")
|
182
180
|
end
|
183
181
|
|
@@ -202,15 +200,15 @@ module RnSap
|
|
202
200
|
fc_preq_detail.invoke
|
203
201
|
|
204
202
|
#-- Execute conversions for returned tables to a designated list (array)
|
205
|
-
preq_items = get_object_list(fc_preq_detail[:REQUISITION_ITEMS], PreqItem
|
206
|
-
preq_acct_assignment = get_object_list(fc_preq_detail[:REQUISITION_ACCOUNT_ASSIGNMENT], PreqAcctAssignment
|
207
|
-
preq_text = get_object_list(fc_preq_detail[:REQUISITION_TEXT], PreqText
|
208
|
-
preq_limits = get_object_list(fc_preq_detail[:REQUISITION_LIMITS], PreqLimits
|
209
|
-
preq_contract_limits = get_object_list(fc_preq_detail[:REQUISITION_CONTRACT_LIMITS], PreqContractLimits
|
210
|
-
preq_services = get_object_list(fc_preq_detail[:REQUISITION_SERVICES], PreqItem
|
211
|
-
preq_services_texts = get_object_list(fc_preq_detail[:REQUISITION_SERVICES_TEXTS], PreqServicesText
|
212
|
-
preq_srv_accass_values = get_object_list(fc_preq_detail[:REQUISITION_SRV_ACCASS_VALUES], PreqServicesAccassValues
|
213
|
-
tb_return = get_object_list(fc_preq_detail[:RETURN], Return
|
203
|
+
preq_items = get_object_list(fc_preq_detail[:REQUISITION_ITEMS], PreqItem)
|
204
|
+
preq_acct_assignment = get_object_list(fc_preq_detail[:REQUISITION_ACCOUNT_ASSIGNMENT], PreqAcctAssignment)
|
205
|
+
preq_text = get_object_list(fc_preq_detail[:REQUISITION_TEXT], PreqText)
|
206
|
+
preq_limits = get_object_list(fc_preq_detail[:REQUISITION_LIMITS], PreqLimits)
|
207
|
+
preq_contract_limits = get_object_list(fc_preq_detail[:REQUISITION_CONTRACT_LIMITS], PreqContractLimits)
|
208
|
+
preq_services = get_object_list(fc_preq_detail[:REQUISITION_SERVICES], PreqItem)
|
209
|
+
preq_services_texts = get_object_list(fc_preq_detail[:REQUISITION_SERVICES_TEXTS], PreqServicesText)
|
210
|
+
preq_srv_accass_values = get_object_list(fc_preq_detail[:REQUISITION_SRV_ACCASS_VALUES], PreqServicesAccassValues)
|
211
|
+
tb_return = get_object_list(fc_preq_detail[:RETURN], Return)
|
214
212
|
|
215
213
|
retcode = tb_return.detect{|r| r.type == 'E'}
|
216
214
|
|
@@ -244,11 +242,11 @@ module RnSap
|
|
244
242
|
fn_preq_rel_strat_info.invoke
|
245
243
|
|
246
244
|
#-- Execute conversions for returned tables to a designated list (array)
|
247
|
-
preq_gen_release_info = get_object_list(fn_preq_rel_strat_info[:GENERAL_RELEASE_INFO], PreqGenReleaseInfo
|
248
|
-
preq_release_prerequisites = get_object_list(fn_preq_rel_strat_info[:RELEASE_PREREQUISITES], PreqReleasePrerequisites
|
249
|
-
preq_release_posted = get_object_list(fn_preq_rel_strat_info[:RELEASE_ALREADY_POSTED], PreqReleasePosted
|
250
|
-
preq_release_final = get_object_list(fn_preq_rel_strat_info[:RELEASE_FINAL], PreqReleaseFinal
|
251
|
-
tb_return = get_object_list(fn_preq_rel_strat_info[:RETURN], Return
|
245
|
+
preq_gen_release_info = get_object_list(fn_preq_rel_strat_info[:GENERAL_RELEASE_INFO], PreqGenReleaseInfo)
|
246
|
+
preq_release_prerequisites = get_object_list(fn_preq_rel_strat_info[:RELEASE_PREREQUISITES], PreqReleasePrerequisites)
|
247
|
+
preq_release_posted = get_object_list(fn_preq_rel_strat_info[:RELEASE_ALREADY_POSTED], PreqReleasePosted)
|
248
|
+
preq_release_final = get_object_list(fn_preq_rel_strat_info[:RELEASE_FINAL], PreqReleaseFinal)
|
249
|
+
tb_return = get_object_list(fn_preq_rel_strat_info[:RETURN], Return)
|
252
250
|
|
253
251
|
retcode = tb_return.detect{|r| r.type == 'E'}
|
254
252
|
|
@@ -285,7 +283,7 @@ module RnSap
|
|
285
283
|
|
286
284
|
fn_preq_exec_release.invoke
|
287
285
|
|
288
|
-
tb_return = get_object_list(fn_preq_exec_release[:RETURN], Return
|
286
|
+
tb_return = get_object_list(fn_preq_exec_release[:RETURN], Return)
|
289
287
|
|
290
288
|
retcode = tb_return.detect{|r| r.type == 'E'}
|
291
289
|
|
@@ -300,12 +298,115 @@ module RnSap
|
|
300
298
|
end
|
301
299
|
end
|
302
300
|
|
303
|
-
def po_detail(po = 0)
|
304
|
-
|
301
|
+
def po_detail(po = 0, acc_assignment = "", item_text = "", header_text = "", delivery_address = "", version = "", services = "", serialnumbers = "", invoiceplan = "")
|
302
|
+
#-- Execute BAPI_PO_GETDETAIL1
|
303
|
+
fn_po_detail = @conn.get_function('BAPI_PO_GETDETAIL1')
|
304
|
+
fc_po_detail = fn_po_detail.get_function_call
|
305
|
+
|
306
|
+
fc_po_detail[:PURCHASEORDER] = po
|
307
|
+
fc_po_detail[:ACCOUNT_ASSIGNMENT] = acc_assignment
|
308
|
+
fc_po_detail[:ITEM_TEXT] = item_text
|
309
|
+
fc_po_detail[:HEADER_TEXT] = header_text
|
310
|
+
fc_po_detail[:DELIVERY_ADDRESS] = delivery_address
|
311
|
+
fc_po_detail[:VERSION] = version
|
312
|
+
fc_po_detail[:SERVICES] = services
|
313
|
+
fc_po_detail[:SERIALNUMBERS] = serialnumbers
|
314
|
+
fc_po_detail[:INVOICEPLAN] = invoiceplan
|
315
|
+
|
316
|
+
fc_po_detail.invoke
|
317
|
+
|
318
|
+
#-- Execute conversions for returned tables to a designated list (array)
|
319
|
+
po_item = get_object_list(fc_po_detail[:POITEM], PoItem)
|
320
|
+
po_addrdelivery = get_object_list(fc_po_detail[:POADDRDELIVERY], PoAddrDelivery)
|
321
|
+
po_schedule = get_object_list(fc_po_detail[:POSCHEDULE], PoSchedule)
|
322
|
+
po_account = get_object_list(fc_po_detail[:POACCOUNT], PoAccount)
|
323
|
+
po_cond_header = get_object_list(fc_po_detail[:POCONDHEADER], PoCondHeader)
|
324
|
+
po_cond = get_object_list(fc_po_detail[:POCOND], PoCond)
|
325
|
+
po_limits = get_object_list(fc_po_detail[:POLIMITS], PoLimits)
|
326
|
+
po_contract_limits = get_object_list(fc_po_detail[:POCONTRACTLIMITS], PoContractLimits)
|
327
|
+
po_services = get_object_list(fc_po_detail[:POSERVICES], PoServices)
|
328
|
+
po_srv_access_values = get_object_list(fc_po_detail[:POSRVACCESSVALUES], PoSrvAccessValues)
|
329
|
+
po_text_header = get_object_list(fc_po_detail[:POTEXTHEADER], PoTextHeader)
|
330
|
+
po_text_item = get_object_list(fc_po_detail[:POTEXTITEM], PoTextItem)
|
331
|
+
po_exp_imp_item = get_object_list(fc_po_detail[:POEXPIMPITEM], PoExpImpItem)
|
332
|
+
po_components = get_object_list(fc_po_detail[:POCOMPONENTS], PoComponents)
|
333
|
+
po_shipping_exp = get_object_list(fc_po_detail[:POSHIPPINGEXP], PoShippingExp)
|
334
|
+
po_history = get_object_list(fc_po_detail[:POHISTORY], PoHistory)
|
335
|
+
po_history_totals = get_object_list(fc_po_detail[:POHISTORY_TOTALS], PoHistoryTotals)
|
336
|
+
po_confirmation = get_object_list(fc_po_detail[:POCONFIRMATION], PoConfirmation)
|
337
|
+
po_all_versions = get_object_list(fc_po_detail[:ALLVERSIONS], PoAllVersions)
|
338
|
+
po_partner = get_object_list(fc_po_detail[:POPARTNER], PoPartner)
|
339
|
+
po_extension_out = get_object_list(fc_po_detail[:EXTENSIONOUT], PoExtensionOut)
|
340
|
+
po_serial_number = get_object_list(fc_po_detail[:SERIALNUMBER], PoSerialNumber)
|
341
|
+
po_inv_plan_header = get_object_list(fc_po_detail[:INVPLANHEADER], PoInvPlanHeader)
|
342
|
+
po_inv_plan_item = get_object_list(fc_po_detail[:INVPLANITEM], PoInvPlanItem)
|
343
|
+
po_history_ma = get_object_list(fc_po_detail[:POHISTORY_MA], PoHistoryMa)
|
344
|
+
po_header = get_object(fc_po_detail[:POHEADER], PoHeader)
|
345
|
+
po_exp_imp_header = get_object(fc_po_detail[:POEXPIMPHEADER], PoExpImpHeader)
|
346
|
+
tb_return = get_object_list(fc_po_detail[:RETURN], Return)
|
347
|
+
|
348
|
+
retcode = tb_return.detect{|r| r.type == 'E'}
|
349
|
+
|
350
|
+
if retcode
|
351
|
+
api_return_error(retcode)
|
352
|
+
else
|
353
|
+
api_return_success({
|
354
|
+
po_item: po_item,
|
355
|
+
po_addrdelivery: po_addrdelivery,
|
356
|
+
po_schedule: po_schedule,
|
357
|
+
po_account: po_account,
|
358
|
+
po_cond_header: po_cond_header,
|
359
|
+
po_cond: po_cond,
|
360
|
+
po_limits: po_limits,
|
361
|
+
po_contract_limits: po_contract_limits,
|
362
|
+
po_services: po_services,
|
363
|
+
po_srv_access_values: po_srv_access_values,
|
364
|
+
po_text_header: po_text_header,
|
365
|
+
po_text_item: po_text_item,
|
366
|
+
po_exp_imp_item: po_exp_imp_item,
|
367
|
+
po_components: po_components,
|
368
|
+
po_shipping_exp: po_shipping_exp,
|
369
|
+
po_history: po_history,
|
370
|
+
po_history_totals: po_history_totals,
|
371
|
+
po_confirmation: po_confirmation,
|
372
|
+
po_all_versions: po_all_versions,
|
373
|
+
po_partner: po_partner,
|
374
|
+
po_extension_out: po_extension_out,
|
375
|
+
po_serial_number: po_serial_number,
|
376
|
+
po_inv_plan_header: po_inv_plan_header,
|
377
|
+
po_inv_plan_item: po_inv_plan_item,
|
378
|
+
po_history_ma: po_history_ma,
|
379
|
+
po_header: po_header,
|
380
|
+
po_exp_imp_header: po_exp_imp_header,
|
381
|
+
tb_return: tb_return,
|
382
|
+
})
|
383
|
+
end
|
305
384
|
end
|
306
385
|
|
307
|
-
def po_release_strategy_info(po =
|
308
|
-
|
386
|
+
def po_release_strategy_info(po = 0, po_rel_code = "")
|
387
|
+
#-- Execute BAPI_PO_GETRELINFO
|
388
|
+
fn_po_rel_strat_info = @conn.get_function('BAPI_PO_GETRELINFO')
|
389
|
+
fc_po_rel_strat_info = fn_po_rel_strat_info.get_function_call
|
390
|
+
|
391
|
+
fc_po_rel_strat_info[:PURCHASEORDER] = po
|
392
|
+
fc_po_rel_strat_info[:PO_REL_CODE] = po_rel_code
|
393
|
+
|
394
|
+
fc_po_rel_strat_info.invoke
|
395
|
+
|
396
|
+
#-- Execute conversions for returned tables to a designated list (array)
|
397
|
+
po_release_final = get_object_list(fc_po_rel_strat_info[:RELEASE_FINAL], PoReleaseFinal.to_s)
|
398
|
+
tb_return = get_object_list(fc_po_rel_strat_info[:RETURN], Return.to_s)
|
399
|
+
|
400
|
+
retcode = tb_return.detect{|r| r.type == 'E'}
|
401
|
+
|
402
|
+
if retcode
|
403
|
+
api_return_error(retcode)
|
404
|
+
else
|
405
|
+
api_return_success({
|
406
|
+
po_release_final: po_release_final,
|
407
|
+
tb_return: tb_return,
|
408
|
+
})
|
409
|
+
end
|
309
410
|
end
|
310
411
|
|
311
412
|
# Performs SAP Authority check on a certain authorization
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rnsap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rogerio Nascimento
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nwrfc
|
@@ -45,8 +45,40 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
+
- lib/auth.rb
|
48
49
|
- lib/helper/rfc_helper.rb
|
49
50
|
- lib/helper/util_helper.rb
|
51
|
+
- lib/po_detail/all.rb
|
52
|
+
- lib/po_detail/po_account.rb
|
53
|
+
- lib/po_detail/po_addrdelivery.rb
|
54
|
+
- lib/po_detail/po_all_versions.rb
|
55
|
+
- lib/po_detail/po_components.rb
|
56
|
+
- lib/po_detail/po_cond.rb
|
57
|
+
- lib/po_detail/po_cond_header.rb
|
58
|
+
- lib/po_detail/po_confirmation.rb
|
59
|
+
- lib/po_detail/po_contract_limits.rb
|
60
|
+
- lib/po_detail/po_exp_imp_header.rb
|
61
|
+
- lib/po_detail/po_exp_imp_item.rb
|
62
|
+
- lib/po_detail/po_extension_out.rb
|
63
|
+
- lib/po_detail/po_header.rb
|
64
|
+
- lib/po_detail/po_history.rb
|
65
|
+
- lib/po_detail/po_history_ma.rb
|
66
|
+
- lib/po_detail/po_history_totals.rb
|
67
|
+
- lib/po_detail/po_inv_plan_header.rb
|
68
|
+
- lib/po_detail/po_inv_plan_item.rb
|
69
|
+
- lib/po_detail/po_item.rb
|
70
|
+
- lib/po_detail/po_limits.rb
|
71
|
+
- lib/po_detail/po_partner.rb
|
72
|
+
- lib/po_detail/po_schedule.rb
|
73
|
+
- lib/po_detail/po_serial_number.rb
|
74
|
+
- lib/po_detail/po_services.rb
|
75
|
+
- lib/po_detail/po_shipping_exp.rb
|
76
|
+
- lib/po_detail/po_srv_access_values.rb
|
77
|
+
- lib/po_detail/po_text_header.rb
|
78
|
+
- lib/po_detail/po_text_item.rb
|
79
|
+
- lib/po_release_info/all.rb
|
80
|
+
- lib/po_release_info/po_release_final.rb
|
81
|
+
- lib/preq_detail/all.rb
|
50
82
|
- lib/preq_detail/preq_acct_assignment.rb
|
51
83
|
- lib/preq_detail/preq_contract_limits.rb
|
52
84
|
- lib/preq_detail/preq_item.rb
|
@@ -55,6 +87,7 @@ files:
|
|
55
87
|
- lib/preq_detail/preq_services_texts.rb
|
56
88
|
- lib/preq_detail/preq_srv_accass_values.rb
|
57
89
|
- lib/preq_detail/preq_text.rb
|
90
|
+
- lib/preq_release_info/all.rb
|
58
91
|
- lib/preq_release_info/preq_gen_release_info.rb
|
59
92
|
- lib/preq_release_info/preq_release_final.rb
|
60
93
|
- lib/preq_release_info/preq_release_posted.rb
|