...
 
Commits (3)
#!/usr/bin/env ruby
require 'active_support/core_ext/hash/conversions'
#require 'pp'
# Referenznummer (kann mehrfach auftauchen)
# BkToCstmrDbtCdtNtfctn.Ntfctn.Ntry.NtryDtls
......@@ -16,20 +17,21 @@ module CamtToV11
entries = doc['Document']['BkToCstmrDbtCdtNtfctn']['Ntfctn']['Ntry']
result = []
#edetails = nil
#edetail = nil
entries.each do |entry|
entry_ref = entry['NtryRef']
book_date = entry['BookgDt']['Dt'].tr_s('-', '').slice(2,6)
value_date = entry['ValDt']['Dt'].tr_s('-', '').slice(2,6)
details = entry['NtryDtls']['TxDtls']
details = [details] if details.is_a?(Hash)
#edetails = details
details.each do |detail|
#edetail = detail
#puts edetail
tp = detail['Refs']['Prtry']['Tp']
begin
ref = detail['RmtInf']['Strd']['CdtrRefInf']['Ref']
rescue e
puts e
puts detail
throw e
end
amount = (detail['Amt'].to_f * 100).to_i
tmp = detail['Refs']['Prtry']['Ref']
dat1 = tmp.slice(2,6)
......@@ -65,6 +67,19 @@ module CamtToV11
end
result * "\n"
#rescue => e
# puts e.message
# puts e.backtrace
# puts
# puts 'DETAILS'
# puts
# pp edetails
# puts
# puts 'DETAIL'
# puts
# puts edetail.inspect
# exit
end
end
......