Class: ODDB::OdbaExporter::AcLine

Inherits:
PackageLine show all
Defined in:
ext/export/src/oddbdat.rb

Constant Summary

LENGTH =
55

Instance Method Summary (collapse)

Methods inherited from PackageLine

#initialize

Methods inherited from Line

#content, #empty?, #initialize, #to_s

Constructor Details

This class inherits a constructor from ODDB::OdbaExporter::PackageLine

Instance Method Details

- (Object) generic_code(registration)



325
326
327
328
329
# File 'ext/export/src/oddbdat.rb', line 325

def generic_code(registration)
  if registration.generic_type == :generic
    'Y'
  end
end

- (Object) iks_date(registration)



330
331
332
333
334
# File 'ext/export/src/oddbdat.rb', line 330

def iks_date(registration)
  if(date = registration.registration_date)
    date.strftime("%Y%m%d")
  end
end

- (Object) ikskey



335
336
337
338
339
# File 'ext/export/src/oddbdat.rb', line 335

def ikskey
  ikskey = @package.iksnr.dup
  ikskey << @package.ikscd
  ikskey
end

- (Object) inscode



340
341
342
343
344
# File 'ext/export/src/oddbdat.rb', line 340

def inscode
  if @package.sl_entry
    '1'
  end
end

- (Object) limitation



345
346
347
348
349
# File 'ext/export/src/oddbdat.rb', line 345

def limitation
  if((sl = @package.sl_entry) && (sl.limitation))
    'Y'
  end
end

- (Object) limitation_points



350
351
352
353
354
# File 'ext/export/src/oddbdat.rb', line 350

def limitation_points
  if(sl = @package.sl_entry)
    sl.limitation_points
  end
end

- (Object) structure



304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'ext/export/src/oddbdat.rb', line 304

def structure
  {
    1    =>  '01',
    2    =>  @date,
    3    =>  '1',
    4    =>  @package.oid,
    5    =>  '4',
    7    =>  ikskey,
    14 =>  @package.ikscat,
    # @package hat immer eine registration, da
    # Registration::create_package die Verknüpfung erstellt
    20 =>  generic_code(@package.registration),
    22 =>  iks_date(@package.registration),
    29 =>  (@package.sl_entry) ? '3' : nil,
    32 =>  (@package.public?) ? nil : 'H',
    39 =>  inscode,
    40 =>  limitation,
    41 =>  limitation_points,
    47 =>  (@package.narcotics.empty?) ? nil : 'y',
  }
end