Class: Cetustek::Models::AllowanceData

Inherits:
Object
  • Object
show all
Defined in:
lib/cetustek/models/allowance_data.rb

Overview

Request data for CreateAllowance (開立折讓單), spec AVM-26-03 Table 15/16. Line items reuse InvoiceItem (code/name/quantity/unit/unit_price).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AllowanceData

Returns a new instance of AllowanceData.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cetustek/models/allowance_data.rb', line 14

def initialize(attributes = {})
  @allowance_number = attributes[:allowance_number]
  @allowance_date = attributes[:allowance_date]
  @invoice_number = attributes[:invoice_number]
  @invoice_year = attributes[:invoice_year]
  @buyer_address = attributes[:buyer_address]
  @buyer_email = attributes[:buyer_email]
  @tax_type = attributes[:tax_type] || TaxType::TAXABLE
  @reason = attributes[:reason]
  @round_num = attributes[:round_num] # optional 金額計算位數
  @items = attributes[:items] || []
end

Instance Attribute Details

#allowance_dateObject (readonly)

Returns the value of attribute allowance_date.



10
11
12
# File 'lib/cetustek/models/allowance_data.rb', line 10

def allowance_date
  @allowance_date
end

#allowance_numberObject (readonly)

Returns the value of attribute allowance_number.



10
11
12
# File 'lib/cetustek/models/allowance_data.rb', line 10

def allowance_number
  @allowance_number
end

#buyer_addressObject (readonly)

Returns the value of attribute buyer_address.



10
11
12
# File 'lib/cetustek/models/allowance_data.rb', line 10

def buyer_address
  @buyer_address
end

#buyer_emailObject (readonly)

Returns the value of attribute buyer_email.



10
11
12
# File 'lib/cetustek/models/allowance_data.rb', line 10

def buyer_email
  @buyer_email
end

#invoice_numberObject (readonly)

Returns the value of attribute invoice_number.



10
11
12
# File 'lib/cetustek/models/allowance_data.rb', line 10

def invoice_number
  @invoice_number
end

#invoice_yearObject (readonly)

Returns the value of attribute invoice_year.



10
11
12
# File 'lib/cetustek/models/allowance_data.rb', line 10

def invoice_year
  @invoice_year
end

#itemsObject (readonly)

Returns the value of attribute items.



10
11
12
# File 'lib/cetustek/models/allowance_data.rb', line 10

def items
  @items
end

#reasonObject (readonly)

Returns the value of attribute reason.



10
11
12
# File 'lib/cetustek/models/allowance_data.rb', line 10

def reason
  @reason
end

#round_numObject (readonly)

Returns the value of attribute round_num.



10
11
12
# File 'lib/cetustek/models/allowance_data.rb', line 10

def round_num
  @round_num
end

#tax_typeObject (readonly)

Returns the value of attribute tax_type.



10
11
12
# File 'lib/cetustek/models/allowance_data.rb', line 10

def tax_type
  @tax_type
end