Class: Toolhound::PurchaseOrder

Inherits:
Base
  • Object
show all
Defined in:
lib/toolhound-ruby/purchase_order.rb

Overview

Class to parse GitHub repository owner and name from URLs and to generate URLs

Constant Summary

Constants inherited from Base

Base::DATE_TIME_FORMAT, Base::DB_TYPE_REGEX

Instance Attribute Summary

Attributes inherited from Base

#client, #connection

Instance Method Summary collapse

Methods inherited from Base

#_build_joins, #_build_selects, #_build_where, #all, #build_and_query, #build_group, #build_joins, #build_selects, #build_sql, #build_update_attributes, #build_update_sql, #build_where, #default_wheres, #find, #formatted_table_and_column, #formatted_table_name, #formmatted_column_name, #get_operator, #initialize, #insert, #locale, #merge_options, #parse_time, primary_key, #primary_key, primary_key=, #procedure, #query, rename_attributes, renamed_attributes, #table_name, table_name, table_name=, #transform_attribute_key, #transform_attributes, #transform_procedure_key, #transform_procedure_value, #transform_procedure_variables, #update, #update_query

Methods included from Util

#acronym_regex, #acronyms, #camelize, #demodulize, #underscore

Constructor Details

This class inherits a constructor from Toolhound::Base

Instance Method Details

#default_joinsObject



24
25
26
27
28
29
30
# File 'lib/toolhound-ruby/purchase_order.rb', line 24

def default_joins
  arr = []
  arr << "INNER JOIN tblPurchaseOrderText ON (tblPurchaseOrderText.intPOID = tblPurchaseOrder.intPOID AND varLocaleID = '#{locale}')"
  # arr << "INNER JOIN tblRentalDetail ON (tblRentalDetail.intRentalDetailID = tblRentalItem.intRentalDetailID)"

  arr
end

#default_selectsObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/toolhound-ruby/purchase_order.rb', line 11

def default_selects
  {
    purchase_order:   [
      "intPOID", {"varPONO" => :po_no}, :int_vendor_id, :int_location_id, :int_payment_term_id, :bol_closed, :bol_approved,
      :dte_created_date, :dte_modified_date, :dte_cancelled_date, :bol_cancelled, :var_revision_no
    ],
    purchase_order_text: [:txt_notes]

    # rental_item_detail: [:var_status, :status_date, ],
    # rental_detail: [:int_rental_id, :int_inventory_id, :int_quantity, :dec_daily, :dec_weekly, :dec_monthly, :dec_selling_price],
  }
end