Class: OLE_QA::Framework::OLEFS::Invoice_Line

Inherits:
Invoice_Line_Object show all
Defined in:
lib/olefs/objects/invoice_line.rb

Overview

A single Purchase Order line on an OLE Financial System Invoice E-Document.

  • This class represents a slight departure from the normal method for creating line objects. Instead of setting a line number only once, the line object can be redefined to point at other lines. This departure represents a more flexible approach and prevents the necessity of extra recursion to address the multiple sub-objects of an Invoice E-Document.

  • The future structure of Invoice documents is presently uncertain, so this is a temporary measure. If necessary, the framework may be restructured to follow this model.

Instance Attribute Summary collapse

Attributes inherited from Invoice_Line_Object

#line_number

Attributes inherited from Common_Object

#elements, #functions, #ole

Instance Method Summary collapse

Methods inherited from Invoice_Line_Object

#line_id

Methods included from Helpers

#browser, #load_yml, #set_element, #set_function

Constructor Details

#initialize(ole_session, line_number = 1) ⇒ Invoice_Line

Set OLE instance & line number, instantiate line item for PO line on Invoice document.



29
30
31
32
# File 'lib/olefs/objects/invoice_line.rb', line 29

def initialize(ole_session, line_number = 1)
  super(ole_session, line_number)
  @line_item = OLE_QA::Framework::OLEFS::Invoice_Line_Item.new(@ole, self, 1)
end

Instance Attribute Details

#line_itemObject (readonly)

A flexible PO line item object with dynamic ID element definitions on an Invoice document.



26
27
28
# File 'lib/olefs/objects/invoice_line.rb', line 26

def line_item
  @line_item
end

Instance Method Details

#set_elementsObject

Set invoice line elements.



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/olefs/objects/invoice_line.rb', line 35

def set_elements
  super
  element(:po_number)                         {b.span(:id => "process_item_po_doc_line#{line_id}_control")}
  element(:po_end_date)                       {b.text_field(:id => "invoice-poEndDate_line#{line_id}_control")}
  element(:close_po_checkbox)                 {b.checkbox(:id => "CurrentItem_closePO_line#{line_id}_control")}
  element(:delete_po_button)                  {b.button(:id => "CurrentItem_deletePurchaseOrder_line#{line_id}")}
  element(:requisitions_toggle)               {b.a(:id => "po-requisition-view_line#{line_id}_toggle")}
  element(:purchase_orders_toggle)            {b.a(:id => "po-po-view_line#{line_id}_toggle")}
  element(:line_item_receiving_toggle)        {b.a(:id => "po-relatedReceiving-view_line#{line_id}_toggle")}
  element(:correction_receiving_toggle)       {b.a(:id => "po-relatedCorrectionReceiving-view_line#{line_id}_toggle")}
  element(:payment_requests_toggle)           {b.a(:id => "po-relatedPayment-view_line#{line_id}_toggle")}
  element(:credit_memos_toggle)               {b.a(:id => "po-relatedCreditMemo-view_line#{line_id}_toggle")}
  element(:add_button)                        {b.button(:id => "addPOItems_button_line#{line_id}")}
end

#set_functionsObject

Set invoice line functions (for elements with IDs that require numerical inputs).



51
52
53
# File 'lib/olefs/objects/invoice_line.rb', line 51

def set_functions
  super
end