Class: Cetustek::Models::InvoiceData
- Inherits:
-
Object
- Object
- Cetustek::Models::InvoiceData
- Defined in:
- lib/cetustek/models/invoice_data.rb
Constant Summary collapse
- DEFAULT_TAX_RATE =
0.05- DEFAULT_INVOICE_TYPE =
07: 一般稅額, 08: 特種稅額
'07'
Instance Attribute Summary collapse
-
#buyer_email ⇒ Object
readonly
Returns the value of attribute buyer_email.
-
#buyer_identifier ⇒ Object
readonly
Returns the value of attribute buyer_identifier.
-
#buyer_name ⇒ Object
readonly
Returns the value of attribute buyer_name.
-
#carrier_id ⇒ Object
readonly
Returns the value of attribute carrier_id.
-
#carrier_id2 ⇒ Object
readonly
Returns the value of attribute carrier_id2.
-
#carrier_type ⇒ Object
readonly
Returns the value of attribute carrier_type.
-
#donate_mark ⇒ Object
readonly
Returns the value of attribute donate_mark.
-
#invoice_type ⇒ Object
readonly
Returns the value of attribute invoice_type.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#npo_ban ⇒ Object
readonly
Returns the value of attribute npo_ban.
-
#order_date ⇒ Object
readonly
Returns the value of attribute order_date.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#payment_type ⇒ Object
readonly
Returns the value of attribute payment_type.
-
#tax_rate ⇒ Object
readonly
Returns the value of attribute tax_rate.
-
#tax_type ⇒ Object
readonly
Returns the value of attribute tax_type.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ InvoiceData
constructor
A new instance of InvoiceData.
-
#mixed_tax? ⇒ Boolean
混合稅率發票 (限收銀機):每筆明細需標註 DType。.
Constructor Details
#initialize(attributes = {}) ⇒ InvoiceData
Returns a new instance of InvoiceData.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/cetustek/models/invoice_data.rb', line 24 def initialize(attributes = {}) @order_id = attributes[:order_id] @order_date = attributes[:order_date] @buyer_identifier = attributes[:buyer_identifier] @buyer_name = attributes[:buyer_name] @buyer_email = attributes[:buyer_email] @donate_mark = attributes[:donate_mark] @carrier_type = attributes[:carrier_type] @carrier_id = attributes[:carrier_id] @carrier_id2 = attributes[:carrier_id2] @npo_ban = attributes[:npo_ban] @items = attributes[:items] || [] @payment_type = attributes[:payment_type] @tax_type = attributes[:tax_type] || TaxType::TAXABLE @tax_rate = attributes.fetch(:tax_rate, DEFAULT_TAX_RATE) @invoice_type = attributes[:invoice_type] || DEFAULT_INVOICE_TYPE end |
Instance Attribute Details
#buyer_email ⇒ Object (readonly)
Returns the value of attribute buyer_email.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def buyer_email @buyer_email end |
#buyer_identifier ⇒ Object (readonly)
Returns the value of attribute buyer_identifier.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def buyer_identifier @buyer_identifier end |
#buyer_name ⇒ Object (readonly)
Returns the value of attribute buyer_name.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def buyer_name @buyer_name end |
#carrier_id ⇒ Object (readonly)
Returns the value of attribute carrier_id.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def carrier_id @carrier_id end |
#carrier_id2 ⇒ Object (readonly)
Returns the value of attribute carrier_id2.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def carrier_id2 @carrier_id2 end |
#carrier_type ⇒ Object (readonly)
Returns the value of attribute carrier_type.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def carrier_type @carrier_type end |
#donate_mark ⇒ Object (readonly)
Returns the value of attribute donate_mark.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def donate_mark @donate_mark end |
#invoice_type ⇒ Object (readonly)
Returns the value of attribute invoice_type.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def invoice_type @invoice_type end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def items @items end |
#npo_ban ⇒ Object (readonly)
Returns the value of attribute npo_ban.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def npo_ban @npo_ban end |
#order_date ⇒ Object (readonly)
Returns the value of attribute order_date.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def order_date @order_date end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def order_id @order_id end |
#payment_type ⇒ Object (readonly)
Returns the value of attribute payment_type.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def payment_type @payment_type end |
#tax_rate ⇒ Object (readonly)
Returns the value of attribute tax_rate.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def tax_rate @tax_rate end |
#tax_type ⇒ Object (readonly)
Returns the value of attribute tax_type.
19 20 21 |
# File 'lib/cetustek/models/invoice_data.rb', line 19 def tax_type @tax_type end |