Class: OLE_QA::Framework::OLEFS::Receiving_Line

Inherits:
Line_Object show all
Defined in:
lib/olefs/objects/receiving_line.rb

Overview

A single line on an OLE Financial System Receiving Document

Instance Attribute Summary

Attributes inherited from Line_Object

#line_id, #line_number

Attributes inherited from Common_Object

#elements, #functions, #ole

Instance Method Summary collapse

Methods inherited from Line_Object

#create_subline, #initialize, #remove_subline

Methods inherited from Line_Object

#initialize

Methods inherited from Common_Object

#initialize, #set_functions

Methods included from Helpers

#browser, #load_yml, #set_element, #set_function

Constructor Details

This class inherits a constructor from OLE_QA::Framework::OLEFS::Line_Object

Instance Method Details

#create_copies_line(which = 1) ⇒ Object Also known as: add_copies_line



58
59
60
# File 'lib/olefs/objects/receiving_line.rb', line 58

def create_copies_line(which = 1)
  create_subline("copies_line_#{which}","Copies_Line", which)
end

#create_exception_notes_line(which = 1) ⇒ Object Also known as: add_exception_notes_line



48
49
50
# File 'lib/olefs/objects/receiving_line.rb', line 48

def create_exception_notes_line(which = 1)
  create_subline("exception_notes_line_#{which}","Exception_Notes_Line", which)
end

#create_processing_line(which = 1) ⇒ Object Also known as: add_processing_line



63
64
65
# File 'lib/olefs/objects/receiving_line.rb', line 63

def create_processing_line(which = 1)
  create_subline("processing_line_#{which}","Processing_Line", which)
end

#create_receipt_notes_line(which = 1) ⇒ Object Also known as: add_receipt_notes_line



53
54
55
# File 'lib/olefs/objects/receiving_line.rb', line 53

def create_receipt_notes_line(which = 1)
  create_subline("receipt_notes_line_#{which}","Receipt_Notes_Line", which)
end

#remove_copies_line(which = 1) ⇒ Object Also known as: delete_copies_line



78
79
80
# File 'lib/olefs/objects/receiving_line.rb', line 78

def remove_copies_line(which = 1)
  remove_subline("copies_line_#{which}")
end

#remove_exception_notes_line(which = 1) ⇒ Object Also known as: delete_exception_notes_line



68
69
70
# File 'lib/olefs/objects/receiving_line.rb', line 68

def remove_exception_notes_line(which = 1)
  remove_subline("exception_notes_line_#{which}")
end

#remove_processing_line(which = 1) ⇒ Object Also known as: delete_processing_line



83
84
85
# File 'lib/olefs/objects/receiving_line.rb', line 83

def remove_processing_line(which = 1)
  remove_subline("processing_line_#{which}")
end

#remove_receipt_notes_line(which = 1) ⇒ Object Also known as: delete_receipt_notes_line



73
74
75
# File 'lib/olefs/objects/receiving_line.rb', line 73

def remove_receipt_notes_line(which = 1)
  remove_subline("receipt_notes_line_#{which}")
end

#set_elementsObject

Set receiving line elements.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/olefs/objects/receiving_line.rb', line 26

def set_elements
  super
  element(:description_field)                         {b.td(:xpath => "//table[@summary='Items Section']/tbody/tr/td[1][b[contains(text(),'#{@line_number}')]]/following-sibling::td[2]")}
  element(:quantity_ordered_field)                    {b.td(:xpath => "//table[@summary='Items Section']/tbody/tr/td[1][b[contains(text(),'#{@line_number}')]]/following-sibling::td[4]")}
  element(:parts_ordered_field)                       {b.td(:xpath => "//table[@summary='Items Section']/tbody/tr/td[1][b[contains(text(),'#{@line_number}')]]/following-sibling::td[5]")}
  element(:prior_quantity_received_field)             {b.td(:xpath => "//table[@summary='Items Section']/tbody/tr/td[1][b[contains(text(),'#{@line_number}')]]/following-sibling::td[6]")}
  element(:prior_parts_received_field)                {b.td(:xpath => "//table[@summary='Items Section']/tbody/tr/td[1][b[contains(text(),'#{@line_number}')]]/following-sibling::td[7]")}
  element(:quantity_to_be_received_field)             {b.td(:xpath => "//table[@summary='Items Section']/tbody/tr/td[1][b[contains(text(),'#{@line_number}')]]/following-sibling::td[8]")}
  element(:parts_to_be_received_field)                {b.td(:xpath => "//table[@summary='Items Section']/tbody/tr/td[1][b[contains(text(),'#{@line_number}')]]/following-sibling::td[9]")}
  element(:item_received_quantity_field)              {b.text_field(:id => "document.item[#{@line_id}].oleItemReceivedTotalQuantity")}
  element(:item_received_parts_field)                 {b.text_field(:id => "document.item[#{@line_id}].oleItemReceivedTotalParts")}
  element(:item_returned_quantity_field)              {b.text_field(:id => "document.item[#{@line_id}].oleItemReturnedTotalQuantity")}
  element(:item_returned_parts_field)                 {b.text_field(:id => "document.item[#{@line_id}].oleItemReturnedTotalParts")}
  element(:item_damaged_quantity_field)               {b.text_field(:id => "document.item[#{@line_id}].oleItemDamagedTotalQuantity")}
  element(:item_damaged_parts_field)                  {b.text_field(:id => "document.item[#{@line_id}].oleItemDamagedTotalParts")}
  element(:available_to_public_checkbox)              {b.checkbox(:id => "document.item[#{@line_id}].availableToPublic")}
  element(:public_view_checkbox)                      {b.checkbox(:id => "document.item[#{@line_id}].availableToPublic")}
  element(:exception_notes_toggle)                    {b.input(:xpath => "//tr[td/b[contains(text(),'#{@line_number}')]]/following-sibling::tr[2]/td[1]/table/tbody/tr[1]/th/div/input")}
  element(:receipt_notes_toggle)                      {b.input(:xpath => "//tr[td/b[contains(text(),'#{@line_number}')]]/following-sibling::tr[3]/td[1]/table/tbody/tr[1]/th/div/input")}
  element(:special_processing_instructions_toggle)    {b.input(:xpath => "//tr[td/b[contains(text(),'#{@line_number}')]]/following-sibling::tr[4]/td[1]/table/tbody/tr[1]/th/div/input")}
end

#set_sublinesObject

Create accessor methods for new subline objects.



19
20
21
22
23
# File 'lib/olefs/objects/receiving_line.rb', line 19

def set_sublines
  create_subline("new_exception_notes_line","New_Exception_Notes_Line")
  create_subline("new_receipt_notes_line","New_Receipt_Notes_Line")
  create_subline("new_copies_line","New_Copies_Line")
end