view · edit · sidebar · attach · print · history

20120505-update-mail-order-price-oddb-mail-recipients

<< | Index | >>


Summary

  • Updated mail_order_price_logo, legend and import job

Commits

  • Updated mail_order_price_logo
    • Removed logo_file_name form data (move to view).
    • Updated job/import_mali_order_price.
    • Created insert_mail_order_price in Package.
    • Added legend for new logo.

Index


Updated mail_order_price

current job flow

  • jobs/import_mail_order_price:13: Updater.new(system).update_mail_order_prices(ARGV[0], ARGV[1])
  • src/util/updater.rb:343: def update_mail_order_prices(csv_file_path, logo_file_path)
  • src/util/updater.rb:344: update_notify_simple(MailOrderPricePlugin, 'Update Mail Order Prices', :update, [csv_file_path, logo_file_path])
  • src/plugin/mail_order_price.rb:21: def update(csv_file_path, logo_file_path)

Check via bin/admin

ch.oddb> registration('41810').sequence('01')
-> Inderal retard, Kapseln
ch.oddb> registration('41810').sequence('01').packages.first
-> ["017", #<ODBA::Stub:108070940#223670 @odba_class=ODDB::Package @odba_container=108061210#98756>]
ch.oddb> registration('41810').sequence('01').packages.values.first
-> #<ODDB::Package:0xce2d6a8>
ch.oddb> registration('41810').sequence('01').packages.values.first.mail_order_prices
-> [#<struct ODDB::PackageCommon::MailOrderPrice price="3 - 12% Rabatt", url="http://www.ywesee.com", logo="Logo_R.jpg">]
ch.oddb> registration('41810').sequence('01').packages.values.first.update_mail_order_price(0, '3 - 12 % Rabatt', 'http://www.ywesee.com')
-> #<ODDB::Package:0xce2d6a8>
ch.oddb> registration('41810').sequence('01').packages.values.first.mail_order_prices
-> [#<struct ODDB::PackageCommon::MailOrderPrice price="3 - 12 % Rabatt", url="http://www.ywesee.com", logo=nil>]
ch.oddb>

for legend.

      def explain_mail_order_price_discount(model, session=@session)
        [   
          HtmlGrid::Image.new(:logo_rose_orange, model, @session, self),
          @lookandfeel.lookup(:explain_mail_order_price_discount)
        ]   
      end 
      def explain_mail_order_price_normal(model, session=@session)
        [   
          HtmlGrid::Image.new(:logo_rose_green, model, @session, self),
          @lookandfeel.lookup(:explain_mail_order_price_normal)
        ]   
      end
comment out

Updated job without logo_file_name.

$ jobs/import_mail_order_price path/to/file.csv 

Refs


oddb_mail_recipients

continue next ...

  • Module#const_set
  • Module#remove_const
  • eval
view · edit · sidebar · attach · print · history
Page last modified on May 05, 2012, at 04:59 PM