class Quote < Sequel::Model(:'quotes - original') # Many to one associations through composite keys n_to_o :trip, :class=>:Trip, :prefix=>'trip' n_to_o :requester, :class=>:Passenger, :prefix=>'pax' n_to_o :group_cost, :class=>:GroupCost, :prefix=>'costgroup' # One to many associations through composite keys o_to_n :quote_legs, :class=>:QuoteLeg, :prefix=>'quotes' o_to_n :audit_trails, :class=>:AuditTrail, :prefix=>'owner' # Many to one associations with atomic primary keys many_to_one :aircraft, :class=>:Aircraft, :key=>:'aircraft id', :primary_key=>:'aircraft id' # Many to one associations with custom treatment many_to_one :quote_comment, :class=>:Comment, :key=>nil, :dataset=>proc{Comment.filter( :kid_date=>kid_date, :kid_time=>kid_time, :kid_user=>kid_user, :kid_mult=>kid_mult, :kid_comm=>kid_comm )} many_to_one :client_invoice_comment, :class=>:Comment, :key=>nil, :dataset=>proc{Comment.filter( :kid_date=>kid_date, :kid_time=>kid_time, :kid_user=>kid_user, :kid_mult=>kid_mult, :kid_comm=>((kid_comm*10)+3) )} many_to_one :internal_invoice_comment, :class=>:Comment, :key=>nil, :dataset=>proc{Comment.filter( :kid_date=>kid_date, :kid_time=>kid_time, :kid_user=>kid_user, :kid_mult=>kid_mult, :kid_comm=>((kid_comm*10)+2) )} many_to_one :quote_history_comment, :class=>:Comment, :key=>nil, :dataset=>proc{Comment.filter( :kid_date=>kid_date, :kid_time=>kid_time, :kid_user=>kid_user, :kid_mult=>kid_mult, :kid_comm=>history_comment )} # One to many asociations with custom treatment one_to_many :all_comments, :class=>:Comment, :dataset=>proc{Comment.filter( :kid_date=>kid_date, :kid_time=>kid_time, :kid_user=>kid_user, :kid_mult=>kid_mult, :kid_comm=>(kid_comm*10)..(kid_comm*10+9))} # Code associations code_association :purpose, :trip_purpose, :purpose code_association :trip_type_value, :trip_type, :trip_type code_association :rate_type_value, :rate_type_code, :aircraft_rate code_association :reason_not_booked_code, :reason_not_booked, :reason_not_booked code_association :ac_company_code_value, :ac_company_code, :company code_association :ac_base_code_value, :ac_base_code, :location # Column views column_view :trip_departure_date, :date, :quoted_trip_departure_date column_view :trip_arrival_date, :date, :quoted_trip_arrival_date column_def_datetime :quoted_date_time_gmt, :'kid - date', :'kid - time' #### BEGIN GENERATED SECTION #### set_primary_key [:'kid - user', :'kid - mult', :'kid - comm', :'kid - date', :'kid - time'] column_alias :ac_cost_total, :'a/c cost total' column_alias :ac_base_code, :'ac base code' column_alias :ac_company_code, :'ac company code' column_alias :ac_cost_subtotal, :'ac cost subtotal' column_alias :ac_rate, :'ac rate' column_alias :ac_rate_ac_id, :'ac rate ac id' column_alias :ac_rate_fixed, :'ac rate fixed' column_alias :ac_size, :'ac size' column_alias :ac_cost_rate_ft, :'ac cost rate ft' column_alias :ac_type_filter, :'ac type filter' column_alias :ac_vendor_filter, :'ac vendor filter' column_alias :accost_kid_comm, :'accost kid - comm' column_alias :accost_kid_date, :'accost kid - date' column_alias :accost_kid_mult, :'accost kid - mult' column_alias :accost_kid_time, :'accost kid - time' column_alias :accost_kid_user, :'accost kid - user' column_alias :acrate_kid_comm, :'acrate kid - comm' column_alias :acrate_kid_date, :'acrate kid - date' column_alias :acrate_kid_mult, :'acrate kid - mult' column_alias :acrate_kid_time, :'acrate kid - time' column_alias :acrate_kid_user, :'acrate kid - user' column_alias :action_required, :'action required' column_alias :actual_times, :'actual times' column_alias :add_position_legs, :'add position legs' column_alias :add_position_type, :'add position type' column_alias :additional_cost, :'additional cost' column_alias :addl_cost_fix, :'addl cost fix' column_alias :aircraft_cost_fixed, :'aircraft cost fixed' column_alias :aircraft_id, :'aircraft id' column_alias :aircraft_type_id, :'aircraft type id' column_alias :approved, :'approved' column_alias :base_code, :'base code' column_alias :base_cost, :'base cost' column_alias :category_code, :'category code' column_alias :charter_ac_only, :'charter ac only' column_alias :client_invoice_com, :'client invoice com' column_alias :company_code, :'company code' column_alias :company_key, :'company key' column_alias :confirmation_number, :'confirmation number' column_alias :confirmed, :'confirmed' column_alias :contact, :'contact' column_alias :contact_address, :'contact address' column_alias :contact_apt_suite, :'contact apt./suite' column_alias :contact_city, :'contact city' column_alias :contact_country, :'contact country' column_alias :contact_fax, :'contact fax' column_alias :contact_kid_comm, :'contact kid - comm' column_alias :contact_kid_date, :'contact kid - date' column_alias :contact_kid_mult, :'contact kid - mult' column_alias :contact_kid_time, :'contact kid - time' column_alias :contact_kid_user, :'contact kid - user' column_alias :contact_key, :'contact key' column_alias :contact_pager, :'contact pager' column_alias :contact_phone, :'contact phone' column_alias :contact_state, :'contact state' column_alias :contact_zip, :'contact zip' column_alias :costgroup_kid_comm, :'costgroup kid - comm' column_alias :costgroup_kid_date, :'costgroup kid - date' column_alias :costgroup_kid_mult, :'costgroup kid - mult' column_alias :costgroup_kid_time, :'costgroup kid - time' column_alias :costgroup_kid_user, :'costgroup kid - user' column_alias :credit, :'credit' column_alias :crew, :'crew' column_alias :crew_fixed, :'crew fixed' column_alias :currency_rate, :'currency rate' column_alias :currency_total_cost, :'currency total cost' column_alias :currency_total_fixed, :'currency total fixed' column_alias :currency_type, :'currency type' column_alias :dh_legs_addon, :'dh legs addon' column_alias :dh_legs_cost, :'dh legs cost' column_alias :dh_rate, :'dh rate' column_alias :dh_rate_fixed, :'dh rate fixed' column_alias :dh_taxi, :'dh taxi' column_alias :date_quoted, :'date quoted' column_alias :day_trip_addon_cost, :'day/trip addon cost' column_alias :deadhead_bt, :'deadhead bt' column_alias :deadhead_ft, :'deadhead ft' column_alias :deadhead_ft_fixed, :'deadhead ft fixed' column_alias :deadhead_flight_time, :'deadhead flight time' column_alias :delta_leg_cost, :'delta leg cost' column_alias :delta_leg_fixed, :'delta leg fixed' column_alias :delta_trip_cost, :'delta trip cost' column_alias :delta_trip_fixed, :'delta trip fixed' column_alias :dept_code, :'dept code' column_alias :div_code, :'div code' column_alias :eft, :'eft' column_alias :email, :'email' column_alias :ete, :'ete' column_alias :equivalent_rate_cost, :'equivalent rate cost' column_alias :equivalent_rate_fix, :'equivalent rate fix' column_alias :equivalent_rate_unit, :'equivalent rate unit' column_alias :exchange_ac_tail, :'exchange ac tail' column_alias :exchange_value, :'exchange value' column_alias :federal_tax, :'federal tax' column_alias :federal_tax_fixed, :'federal tax fixed' column_alias :federal_tax_rate, :'federal tax rate' column_alias :flog_expense_cost, :'flog expense cost' column_alias :flog_expense_taxable, :'flog expense taxable' column_alias :fuel_cost, :'fuel cost' column_alias :group_number, :'group number' column_alias :history_comment, :'history comment' column_alias :internal_10, :'internal 10' column_alias :internal_11, :'internal 11' column_alias :internal_12, :'internal 12' column_alias :internal_13, :'internal 13' column_alias :internal_14, :'internal 14' column_alias :internal_15, :'internal 15' column_alias :internal_16, :'internal 16' column_alias :internal_17, :'internal 17' column_alias :internal_18, :'internal 18' column_alias :internal_19, :'internal 19' column_alias :internal_20, :'internal 20' column_alias :internal_21, :'internal 21' column_alias :internal_22, :'internal 22' column_alias :internal_23, :'internal 23' column_alias :internal_24, :'internal 24' column_alias :internal_27, :'internal 27' column_alias :internal_28, :'internal 28' column_alias :internal_29, :'internal 29' column_alias :internal_3, :'internal 3' column_alias :internal_30, :'internal 30' column_alias :internal_31, :'internal 31' column_alias :internal_32, :'internal 32' column_alias :internal_33, :'internal 33' column_alias :internal_34, :'internal 34' column_alias :internal_35, :'internal 35' column_alias :internal_36, :'internal 36' column_alias :internal_37, :'internal 37' column_alias :internal_4, :'internal 4' column_alias :internal_40, :'internal 40' column_alias :internal_5, :'internal 5' column_alias :internal_6, :'internal 6' column_alias :internal_7, :'internal 7' column_alias :internal_8, :'internal 8' column_alias :internal_9, :'internal 9' column_alias :internal_invoice_com, :'internal invoice com' column_alias :internal_report, :'internal report' column_alias :internal01, :'internal01' column_alias :internal02, :'internal02' column_alias :internal03, :'internal03' column_alias :internal04, :'internal04' column_alias :invoice_date, :'invoice date' column_alias :invoice_number, :'invoice number' column_alias :invoice_ready, :'invoice ready' column_alias :invoice_time, :'invoice time' column_alias :invoiced, :'invoiced' column_alias :invoiced_by, :'invoiced by' column_alias :kid_comm, :'kid - comm' column_alias :kid_date, :'kid - date' column_alias :kid_mult, :'kid - mult' column_alias :kid_time, :'kid - time' column_alias :kid_user, :'kid - user' column_alias :last_invoice_date, :'last invoice date' column_alias :last_invoice_time, :'last invoice time' column_alias :last_update_date, :'last update date' column_alias :last_update_time, :'last update time' column_alias :layover_cost, :'layover cost' column_alias :layover_days, :'layover days' column_alias :layovers_fixed, :'layovers fixed' column_alias :local_tax, :'local tax' column_alias :local_tax_fixed, :'local tax fixed' column_alias :local_tax_rate, :'local tax rate' column_alias :locked, :'locked' column_alias :margin, :'margin' column_alias :nautical_miles, :'nautical miles' column_alias :no_rons, :'no rons' column_alias :note, :'note' column_alias :num_flight_days, :'num flight days' column_alias :op_inv_paid_date, :'op inv paid date' column_alias :op_inv_received_date, :'op inv received date' column_alias :op_invoice, :'op invoice' column_alias :op_invoice_date, :'op invoice date' column_alias :op_invoice_paid, :'op invoice paid' column_alias :op_invoice_received, :'op invoice received' column_alias :owner_ac_cost, :'owner ac cost' column_alias :owner_ac_cost_fixed, :'owner ac cost fixed' column_alias :owner_ac_rate_ac_id, :'owner ac rate ac id' column_alias :owner_addl_cost, :'owner addl cost' column_alias :owner_addl_cost_fix, :'owner addl cost fix' column_alias :owner_code, :'owner code' column_alias :owner_flog_exp_cost, :'owner flog exp cost' column_alias :owner_fuel_cost, :'owner fuel cost' column_alias :owner_fuel_cost_fix, :'owner fuel cost fix' column_alias :owner_total_cost, :'owner total cost' column_alias :ownercost_kid_comm, :'ownercost kid - comm' column_alias :ownercost_kid_date, :'ownercost kid - date' column_alias :ownercost_kid_mult, :'ownercost kid - mult' column_alias :ownercost_kid_time, :'ownercost kid - time' column_alias :ownercost_kid_user, :'ownercost kid - user' column_alias :ownerrate_kid_comm, :'ownerrate kid - comm' column_alias :ownerrate_kid_date, :'ownerrate kid - date' column_alias :ownerrate_kid_mult, :'ownerrate kid - mult' column_alias :ownerrate_kid_time, :'ownerrate kid - time' column_alias :ownerrate_kid_user, :'ownerrate kid - user' column_alias :paid, :'paid' column_alias :pass_ft_fixed, :'pass. ft fixed' column_alias :pass_flight_time, :'pass. flight time' column_alias :passenger_legs_units, :'passenger legs units' column_alias :pax, :'pax' column_alias :pax_fixed, :'pax fixed' column_alias :pax_kid_comm, :'pax kid - comm' column_alias :pax_kid_date, :'pax kid - date' column_alias :pax_kid_mult, :'pax kid - mult' column_alias :pax_kid_time, :'pax kid - time' column_alias :pax_kid_user, :'pax kid - user' column_alias :pax_legs_addon, :'pax legs addon' column_alias :pax_legs_cost, :'pax legs cost' column_alias :payment_1, :'payment 1' column_alias :payment_2, :'payment 2' column_alias :payment_3, :'payment 3' column_alias :payment_4, :'payment 4' column_alias :payment_date_1, :'payment date 1' column_alias :payment_date_2, :'payment date 2' column_alias :payment_date_3, :'payment date 3' column_alias :payment_date_4, :'payment date 4' column_alias :payment_type_1, :'payment type 1' column_alias :payment_type_2, :'payment type 2' column_alias :payment_type_3, :'payment type 3' column_alias :payment_type_4, :'payment type 4' column_alias :plus_fuel, :'plus fuel' column_alias :position_legs_units, :'position legs units' column_alias :quote_currency, :'quote currency' column_alias :quote_dh_fuelburn, :'quote dh fuelburn' column_alias :quote_fuelburn, :'quote fuelburn' column_alias :quote_language, :'quote language' column_alias :quote_total_cost, :'quote total cost' column_alias :quoted_by, :'quoted by' column_alias :quoted_for_company, :'quoted for - company' column_alias :rfq_id, :'rfq id' column_alias :rfq_source, :'rfq source' column_alias :rfq_str, :'rfq str' column_alias :ron_cost, :'ron cost' column_alias :rons_fixed, :'rons fixed' column_alias :rate_actual_times, :'rate actual times' column_alias :rate_percent, :'rate percent' column_alias :rate_percent_adjust, :'rate percent adjust' column_alias :rate_type_code, :'rate type code' column_alias :reason_not_booked, :'reason not booked' column_alias :regulation, :'regulation' column_alias :report_format, :'report format' column_alias :runway_endurance_prb, :'runway/endurance prb' column_alias :salutation, :'salutation' column_alias :sched_date, :'sched date' column_alias :scheduled, :'scheduled' column_alias :scheduled_itinerary, :'scheduled itinerary' column_alias :short_leg_count, :'short leg count' column_alias :short_leg_count_fix, :'short leg count fix' column_alias :short_leg_t_d_fixed, :'short leg t/d fixed' column_alias :short_leg_t_d_units, :'short leg t/d units' column_alias :short_legs_cost, :'short legs cost' column_alias :short_leg_time_dist, :'short leg time/dist' column_alias :source_code, :'source code' column_alias :standby_cost, :'standby cost' column_alias :standby_elap_time, :'standby elap time' column_alias :standby_fixed, :'standby fixed' column_alias :state_tax, :'state tax' column_alias :state_tax_fixed, :'state tax fixed' column_alias :state_tax_rate, :'state tax rate' column_alias :statute_miles, :'statute miles' column_alias :tax_rate_cargo, :'tax rate cargo' column_alias :tax_rate_intl, :'tax rate intl' column_alias :tax_rate_local, :'tax rate local' column_alias :tax_rate_none, :'tax rate none' column_alias :tax_rate_state, :'tax rate state' column_alias :taxi, :'taxi' column_alias :time_quoted, :'time quoted' column_alias :total_cost_fixed, :'total cost fixed' column_alias :total_tax, :'total tax' column_alias :trip_arrival_date, :'trip arrival date' column_alias :trip_departure_date, :'trip departure date' column_alias :trip_kid_comm, :'trip kid - comm' column_alias :trip_kid_date, :'trip kid - date' column_alias :trip_kid_mult, :'trip kid - mult' column_alias :trip_kid_time, :'trip kid - time' column_alias :trip_kid_user, :'trip kid - user' column_alias :trip_purpose, :'trip purpose' column_alias :trip_type, :'trip type' column_alias :user_id, :'user id' column_alias :vendor_id, :'vendor id' column_alias :key0, :'key0' column_alias :key1, :'key1' column_alias :key10, :'key10' column_alias :key11, :'key11' column_alias :key12, :'key12' column_alias :key13, :'key13' column_alias :key14, :'key14' column_alias :key2, :'key2' column_alias :key3, :'key3' column_alias :key4, :'key4' column_alias :key5, :'key5' column_alias :key6, :'key6' column_alias :key7, :'key7' column_alias :key8, :'key8' column_alias :key9, :'key9' column_alias :unused_quote_number, :'unused quote number' #### END GENERATED SECTION #### end