view · edit · sidebar · attach · print · history

PI FI Invoicer

23-12-2011

How to rebuild annual patinfo invoices (examples)

 ch.oddb> rebuild_slates(:patinfo, :annual_fee)
 ch.oddb> rebuild_slates(:fachinfo, :processing)

Rebuild only one invoice data

 ch.oddb> rebuild_patinfo_slate_item(ODBA.cache.fetch(odba_id), :annual)
 ch.oddb> rebuild_fachinfo_slate_item(ODBA.cache.fetch(odba_id), type)

Note

ch.oddb> slates.keys
-> [:patinfo, :download, :fachinfo]
ch.oddb> slate(:patinfo).items.values.map{|i| i.type}.uniq
-> [:annual_fee, :processing]
ch.oddb> slate(:fachinfo).items.values.map{|i| i.type}.uniq
-> [:annual_fee, :processing]
ch.oddb> slate(:download).items.values.map{|i| i.type}.uniq
-> [:csv_export]
  • rebuild method for :download invoice is not implemented yet, so the following command does not work
 ch.oddb> rebuild_slates(:download, :csv_export)

22-12-2011

Error (mail_patinfo_invoices, send_annual_invoices)

Error: TypeError
Message: can't convert Symbol into Integer
Backtrace:
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.0.5/lib/odba/stub.rb:112:in `[]='
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.0.5/lib/odba/stub.rb:112:in `method_missing'
/home/masa/ywesee/oddb.org/src/plugin/info_invoicer.rb:164:in `block in group_by_company'
/home/masa/ywesee/oddb.org/src/plugin/info_invoicer.rb:158:in `each'
Error: NoMethodError
Message: undefined method `keys' for #<Array:0x0000000496deb8>
Backtrace:
/usr/local/lib/ruby/gems/1.9.1/gems/odba-1.0.5/lib/odba/stub.rb:112:in `method_missing'
/home/masa/ywesee/oddb.org/src/plugin/info_invoicer.rb:164:in `block in group_by_company'
/home/masa/ywesee/oddb.org/src/plugin/info_invoicer.rb:159:in `each'

Check

ch.oddb> ODBA.cache.fetch('688721').data.class
-> Hash
ch.oddb> ODBA.cache.fetch('688721').data.odba_id
-> 28222583
ch.oddb> ODBA.cache.fetch('688721').data.inspect
-> #<ODBA::Stub:105721960#28222583 @odba_class=Hash @odba_container=104350220#688721>
ch.oddb> ODBA.cache.fetch('28222583').class
-> Array

Note

  • The data structure (InvoiceItem@data) looks strange
view · edit · sidebar · attach · print · history
Page last modified on December 23, 2011, at 03:02 PM