Class: Suretax::Api::RequestItem
- Inherits:
-
Object
- Object
- Suretax::Api::RequestItem
- Includes:
- Concerns::Validatable
- Defined in:
- lib/suretax/api/request_item.rb
Instance Attribute Summary collapse
-
#bill_to_number ⇒ Object
Returns the value of attribute bill_to_number.
-
#customer_number ⇒ Object
Returns the value of attribute customer_number.
-
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
-
#line_number ⇒ Object
Returns the value of attribute line_number.
-
#orig_number ⇒ Object
Returns the value of attribute orig_number.
-
#p_to_p_plus_four ⇒ Object
Returns the value of attribute p_to_p_plus_four.
-
#p_to_p_zipcode ⇒ Object
Returns the value of attribute p_to_p_zipcode.
-
#plus_four ⇒ Object
Returns the value of attribute plus_four.
-
#regulatory_code ⇒ Object
Returns the value of attribute regulatory_code.
-
#revenue ⇒ Object
Returns the value of attribute revenue.
-
#sales_type_code ⇒ Object
Returns the value of attribute sales_type_code.
-
#seconds ⇒ Object
Returns the value of attribute seconds.
-
#tax_exemption_codes ⇒ Object
Returns the value of attribute tax_exemption_codes.
-
#tax_included_code ⇒ Object
Returns the value of attribute tax_included_code.
-
#tax_situs_rule ⇒ Object
Returns the value of attribute tax_situs_rule.
-
#term_number ⇒ Object
Returns the value of attribute term_number.
-
#trans_date ⇒ Object
Returns the value of attribute trans_date.
-
#trans_type_code ⇒ Object
Returns the value of attribute trans_type_code.
-
#unit_type ⇒ Object
Returns the value of attribute unit_type.
-
#units ⇒ Object
Returns the value of attribute units.
-
#zipcode ⇒ Object
Returns the value of attribute zipcode.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ RequestItem
constructor
A new instance of RequestItem.
- #params ⇒ Object
Methods included from Concerns::Validatable
Constructor Details
#initialize(args = {}) ⇒ RequestItem
Returns a new instance of RequestItem.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/suretax/api/request_item.rb', line 42 def initialize(args = {}) args.each_pair do |key,value| self.send("#{key.to_s}=",value.to_s) end @tax_exemption_codes = [] unless args[:tax_exemption_codes].nil? args[:tax_exemption_codes].each do |code| @tax_exemption_codes << code.to_s end end validate! end |
Instance Attribute Details
#bill_to_number ⇒ Object
Returns the value of attribute bill_to_number.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def bill_to_number @bill_to_number end |
#customer_number ⇒ Object
Returns the value of attribute customer_number.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def customer_number @customer_number end |
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def invoice_number @invoice_number end |
#line_number ⇒ Object
Returns the value of attribute line_number.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def line_number @line_number end |
#orig_number ⇒ Object
Returns the value of attribute orig_number.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def orig_number @orig_number end |
#p_to_p_plus_four ⇒ Object
Returns the value of attribute p_to_p_plus_four.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def p_to_p_plus_four @p_to_p_plus_four end |
#p_to_p_zipcode ⇒ Object
Returns the value of attribute p_to_p_zipcode.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def p_to_p_zipcode @p_to_p_zipcode end |
#plus_four ⇒ Object
Returns the value of attribute plus_four.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def plus_four @plus_four end |
#regulatory_code ⇒ Object
Returns the value of attribute regulatory_code.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def regulatory_code @regulatory_code end |
#revenue ⇒ Object
Returns the value of attribute revenue.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def revenue @revenue end |
#sales_type_code ⇒ Object
Returns the value of attribute sales_type_code.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def sales_type_code @sales_type_code end |
#seconds ⇒ Object
Returns the value of attribute seconds.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def seconds @seconds end |
#tax_exemption_codes ⇒ Object
Returns the value of attribute tax_exemption_codes.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def tax_exemption_codes @tax_exemption_codes end |
#tax_included_code ⇒ Object
Returns the value of attribute tax_included_code.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def tax_included_code @tax_included_code end |
#tax_situs_rule ⇒ Object
Returns the value of attribute tax_situs_rule.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def tax_situs_rule @tax_situs_rule end |
#term_number ⇒ Object
Returns the value of attribute term_number.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def term_number @term_number end |
#trans_date ⇒ Object
Returns the value of attribute trans_date.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def trans_date @trans_date end |
#trans_type_code ⇒ Object
Returns the value of attribute trans_type_code.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def trans_type_code @trans_type_code end |
#unit_type ⇒ Object
Returns the value of attribute unit_type.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def unit_type @unit_type end |
#units ⇒ Object
Returns the value of attribute units.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def units @units end |
#zipcode ⇒ Object
Returns the value of attribute zipcode.
8 9 10 |
# File 'lib/suretax/api/request_item.rb', line 8 def zipcode @zipcode end |
Instance Method Details
#params ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/suretax/api/request_item.rb', line 57 def params { "LineNumber" => line_number, "InvoiceNumber" => invoice_number, "CustomerNumber" => customer_number, "OrigNumber" => orig_number || '', "TermNumber" => term_number || '', "BillToNumber" => bill_to_number || '', "Zipcode" => zipcode, "Plus4" => plus_four, "P2PZipcode" => p_to_p_zipcode || '', "P2PPlus4" => p_to_p_plus_four || '', "TransDate" => trans_date || Date.today.strftime('%m-%d-%Y'), "Revenue" => revenue.to_f, "Units" => units.to_i, "UnitType" => unit_type || '00', "Seconds" => seconds.to_i, "TaxIncludedCode" => tax_included_code, "TaxSitusRule" => tax_situs_rule, "TransTypeCode" => trans_type_code, "SalesTypeCode" => sales_type_code, "RegulatoryCode" => regulatory_code, "TaxExemptionCodeList" => tax_exemption_codes } end |