Class: OLE_QA::Framework::OLEFS::Line_Item
- Inherits:
-
Line_Object
- Object
- Common_Object
- Data_Object
- Line_Object
- Line_Object
- OLE_QA::Framework::OLEFS::Line_Item
- Defined in:
- lib/olefs/objects/line_item.rb
Overview
A single Line Item in an OLE Financial System PURAP E-Document.
Instance Attribute Summary
Attributes inherited from Line_Object
Attributes inherited from Common_Object
Instance Method Summary collapse
- #create_accounting_line(which = 1) ⇒ Object (also: #add_accounting_line)
- #create_copies_line(which = 1) ⇒ Object (also: #add_copies_line)
- #create_notes_line(which = 1) ⇒ Object (also: #add_notes_line)
- #remove_accounting_line(which = 1) ⇒ Object (also: #delete_accounting_line)
- #remove_copies_line(which = 1) ⇒ Object (also: #delete_copies_line)
- #remove_notes_line(which = 1) ⇒ Object (also: #delete_notes_line)
-
#set_elements ⇒ Object
Set line item elements.
-
#set_sublines ⇒ Object
Create accessor methods for new subline objects.
Methods inherited from Line_Object
#create_subline, #initialize, #remove_subline
Methods inherited from Line_Object
Methods inherited from Common_Object
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_accounting_line(which = 1) ⇒ Object Also known as: add_accounting_line
75 76 77 |
# File 'lib/olefs/objects/line_item.rb', line 75 def create_accounting_line(which = 1) create_subline("accounting_line_#{which}","Accounting_Line", which) end |
#create_copies_line(which = 1) ⇒ Object Also known as: add_copies_line
85 86 87 |
# File 'lib/olefs/objects/line_item.rb', line 85 def create_copies_line(which = 1) create_subline("copies_line_#{which}","Copies_Line", which) end |
#create_notes_line(which = 1) ⇒ Object Also known as: add_notes_line
80 81 82 |
# File 'lib/olefs/objects/line_item.rb', line 80 def create_notes_line(which = 1) create_subline("notes_line_#{which}","Notes_Line", which) end |
#remove_accounting_line(which = 1) ⇒ Object Also known as: delete_accounting_line
90 91 92 |
# File 'lib/olefs/objects/line_item.rb', line 90 def remove_accounting_line(which = 1) remove_subline("accounting_line_#{which}") end |
#remove_copies_line(which = 1) ⇒ Object Also known as: delete_copies_line
100 101 102 |
# File 'lib/olefs/objects/line_item.rb', line 100 def remove_copies_line(which = 1) remove_subline("copies_line_#{which}") end |
#remove_notes_line(which = 1) ⇒ Object Also known as: delete_notes_line
95 96 97 |
# File 'lib/olefs/objects/line_item.rb', line 95 def remove_notes_line(which = 1) remove_subline("notes_line_#{which}") end |
#set_elements ⇒ Object
Set line item elements.
26 27 28 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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/olefs/objects/line_item.rb', line 26 def set_elements super # Fields element(:copies_field) {b.text_field(:id => "document.item[#{@line_id}].oleItemQuantity")} element(:parts_field) {b.text_field(:id => "document.item[#{@line_id}].itemNoOfParts")} element(:list_price_field) {b.text_field(:id => "document.item[#{@line_id}].itemListPrice")} element(:discount_field) {b.text_field(:id => "document.item[#{@line_id}].itemDiscount")} element(:description_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[1]/td[2]")} element(:item_type_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[1]/td[3]")} element(:extended_cost_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[2]/td[3]")} element(:receipt_status_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[3]/td[1]")} # Selectors element(:item_price_source_selector) {b.select_list(:id => "document.item[#{@line_id}].itemPriceSourceId")} element(:request_source_selector) {b.select_list(:id => "document.item[#{@line_id}].requestSourceId")} element(:item_type_selector) {b.select_list(:id => "document.item[#{@line_id}].itemTypeDescription")} element(:format_selector) {b.select_list(:id => "document.item[#{@line_id}].formatTypeId")} element(:category_selector) {b.select_list(:id => "document.item[#{@line_id}].categoryId")} element(:discount_type_selector) {b.select_list(:id => "document.item[#{@line_id}].itemDiscountType")} # Buttons, Checkboxes, Etc. element(:delete_button) {b.input(:title => "Delete Item #{@line_number}")} element(:route_to_requestor_checkbox) {b.checkbox(:id => "document.item[#{@line_id}].itemRouteToRequestor")} element(:public_view_checkbox) {b.checkbox(:id => "document.item[#{@line_id}].itemPublicViewIndicator")} # Readonly Elements # Use these for closed, uneditable fields as with a pre-existing line item on a purchase order. element(:closed_description_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[1]/td[2]")} element(:closed_item_type_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[1]/td[3]")} element(:closed_extended_cost_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[2]/td[3]")} element(:closed_list_price_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[2]/td[4]")} element(:closed_copies_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[2]/td[1]")} element(:closed_parts_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[2]/td[2]")} element(:closed_receipt_status_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[3]/td[1]")} element(:closed_copies_received_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[3]/td[2]")} element(:closed_parts_received_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[3]/td[3]")} element(:closed_item_price_source_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[3]/td[4]")} element(:closed_request_source_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[3]/td[5]")} element(:closed_format_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[4]/td[1]")} element(:closed_category_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[4]/td[2]")} element(:closed_vendor_item_id_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[4]/td[3]")} element(:closed_requestor_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[4]/td[4]")} element(:closed_route_to_requestor_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[4]/td[5]")} element(:closed_unit_cost_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[5]/td[1]")} element(:closed_discount_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[5]/td[2]")} element(:closed_discount_type_field) {b.td(:xpath => "//tr[td[@class='tab-subhead'][contains(text(),'Item #{@line_number}')]]/following-sibling::tr[5]/td[4]")} # Subtab Toggle Buttons # Matches all of type, then selects by index = @line_id (i.e. if @line_num is 1, index is 0) element(:accounting_lines_toggle) {b.input(:id => /tab-AccountingLines[0-9]+-imageToggle/, :index => @line_id)} #element(:notes_toggle) #TBD - The notes and copies lines are treated as the same line for ID purposes. #element(:copies_toggle) # There is no reliable way of knowing which index either should have without being state-aware. end |
#set_sublines ⇒ Object
Create accessor methods for new subline objects.
19 20 21 22 23 |
# File 'lib/olefs/objects/line_item.rb', line 19 def set_sublines create_subline("new_accounting_line","New_Accounting_Line") create_subline("new_notes_line","New_Notes_Line") create_subline("new_copies_line","New_Copies_Line") end |