#
#= receivings モデル
# Authors:: Sumiyo Yamamoto
# Copyright:: Copyright (C) OrbusNeich Medical K.K.  2010.
#--
# date        name                   note
# 2010.12.6   Sumiyo Yamamoto        新規登録
#-------------------------------------------------------------------------------
#++
class Receiving < CommLogistics::Base::Model::AccountPayment
  include Comm::Module::Model::Logging
  has_many :child_details,
           :class_name => 'ReceivingDetail',
           :dependent => :destroy,
           :order => 'seq_number'
  
  def init_accounting(details)
    @acnt_target_id       = customer_id
    @acnt_target_group_id = customer_group_id
    @acnt_type            = MCODE_DEAL_TYPE_PAYMENT
    @acnt_timing          = credit_timing_code
    @acnt_target_class    = Customer
    @target_key = 'customer'
    
    @rp_cls        = Receivable
    @rp_detail_cls = ReceivableDetail
    
    @ledger_cls        = CustomerLedger
    @ledger_detail_cls = CustomerLedgerDetail
    @ledger_details       = get_price_params_payment(details)
  end
end
