Class: OLE_QA::Framework::OLEFS::Payment_Request

Inherits:
PURAP_Document show all
Defined in:
lib/olefs/pages/payment_request.rb

Overview

An OLE Financial System Payment Request Document.

Instance Attribute Summary

Attributes inherited from Page

#url

Attributes inherited from Common_Object

#elements, #functions, #ole

Instance Method Summary collapse

Methods inherited from PURAP_Document

#create_line, #remove_line

Methods inherited from E_Doc

#get_error_array, #wait_for_elements

Methods inherited from Page

#open, #set_functions, #wait_for_element, #wait_for_elements, #wait_for_page_to_load

Methods inherited from Common_Object

#set_functions

Methods included from Helpers

#browser, #load_yml, #set_element, #set_function

Constructor Details

#initialize(ole_session) ⇒ Payment_Request

Returns a new instance of Payment_Request.



18
19
20
21
# File 'lib/olefs/pages/payment_request.rb', line 18

def initialize(ole_session)
  new_preq_url = ole_session.url + 'portal.do?channelTitle=Payment Request&channelUrl=selectOlePaymentRequest.do?methodToCall=docHandler&command=initiate&docTypeName=OLE_PREQ'
  super(ole_session, new_preq_url)
end

Instance Method Details

#create_line_item(which = 1) ⇒ Object Also known as: add_line_item



57
58
59
# File 'lib/olefs/pages/payment_request.rb', line 57

def create_line_item(which = 1)
  create_line("line_item_#{which}","PREQ_Line_Item",which)
end

#remove_line_item(which = 1) ⇒ Object Also known as: delete_line_item



62
63
64
# File 'lib/olefs/pages/payment_request.rb', line 62

def remove_line_item(which = 1)
  remove_line("line_item_#{which}")
end

#set_elementsObject

Set Payment Request document screen elements.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/olefs/pages/payment_request.rb', line 29

def set_elements
  super
  # Invoice Info Tab
  element(:invoice_number_field)                        {b.td(:xpath => "//h3[contains(text(),'Invoice Info')]/following-sibling::table/tbody/tr[1]/td[1]")}
  element(:pay_date_field)                              {b.text_field(:id => "document.paymentRequestPayDate")}
  element(:invoice_date_field)                          {b.td(:xpath => "//h3[contains(text(),'Invoice Info')]/following-sibling::table/tbody/tr[3]/td[1]")}
  element(:immediate_pay_checkbox)                      {b.checkbox(:id => "document.immediatePaymentIndicator")}
  element(:payment_attachment_checkbox)                 {b.checkbox(:id => "document.paymentAttachmentIndicator")}
  element(:invoice_type_field)                          {b.text_field(:id => "document.oleInvoiceType.invoiceType")}
  element(:invoice_subtype_field)                       {b.text_field(:id => "document.oleInvoiceSubType.invoiceSubType")}
  element(:payment_method_selector)                     {b.select_list(:id => "document.paymentMethod.paymentMethodId")}
  # Titles Tab
  element(:grand_total_field)                           {b.b(:xpath => "//div[@id='tab-Titles-div']/descendant::th[div[contains(text(),'Grand Total')]]/following-sibling::td/div/b")}
  element(:additional_charges_toggle)                   {b.input(:id => "tab-AdditionalCharges-imageToggle")}
  element(:freight_extended_cost_field)                 {b.text_field(:id => "document.item[1].itemUnitPrice")}
  element(:freight_description_field)                   {b.text_field(:id => "document.item[1].description")}
  element(:shipping_handling_extended_cost_field)       {b.text_field(:id => "document.item[2].itemUnitPrice")}
  element(:shipping_handling_description_field)         {b.text_field(:id => "document.item[2].description")}
  element(:minimum_order_extended_cost_field)           {b.text_field(:id => "document.item[3].itemUnitPrice")}
  element(:minimum_order_description_field)             {b.text_field(:id => "document.item[3].description")}
  element(:misc_overhead_extended_cost_field)           {b.text_field(:id => "document.item[4].itemUnitPrice")}
  element(:misc_overhead_description_field)             {b.text_field(:id => "document.item[4].description")}
  element(:prorate_by_quantity_checkbox)                {b.checkbox(:id => "document.prorateQty")}
  element(:prorate_by_dollar_checkbox)                  {b.checkbox(:id => "document.prorateDollar")}
  element(:prorate_manual_checkbox)                     {b.checkbox(:id => "document.prorateManual")}
  element(:close_po_checkbox)                           {b.checkbox(:id => "document.closePurchaseOrderIndicator")}
end

#set_linesObject

Create a new payment request line item on the payment request document.



24
25
26
# File 'lib/olefs/pages/payment_request.rb', line 24

def set_lines
  create_line("new_line_item","New_PREQ_Line_Item")
end