Loading...
 
Skip to main content

History: Work_Custom_Pricing

Source of version: 107

Copy to clipboard
            This profile is a showcase of how to setup trackers to allow defining work orders in one tracker, and linked them to billable tasks from another one, allowing to define a custom price  aside of the guide and get some of the items selected summed in another field of tracker1. The tracker also demonstrates how item link field currently allows to create and link items in a second tracker on the fly and get them stored while adding the new item in the first tracker.

^::{img src="https://profiles.tiki.org/display5" width=600}::^

These pages will be created:
* [http://profiles.tiki.org/Profile_Work_Custom_Pricing_page|Profile_Work_Custom_Pricing_page]
* [http://profiles.tiki.org/Profile_Work_Custom_Pricing_clients_homepage|Profile_Work_Custom_Pricing_clients_homepage]
* [http://profiles.tiki.org/Profile_Work_Custom_Pricing_contractors_homepage|Profile_Work_Custom_Pricing_contractors_homepage]
* [https://profiles.tiki.org/Profile_Work_Custom_Pricing_instructions_page|Profile_Work_Custom_Pricing_instructions_page]
* [https://profiles.tiki.org/Profile_Work_Custom_Pricing_menupage_include|Profile_Work_Custom_Pricing_menupage_include]

Some tracker items are created for the price guide to ease the usage of the system.

{CODE(caption="YAML", wrap="0", colors="tiki")}
permissions: 
preferences:
 feature_trackers: y
 feature_search: y
 feature_search_fulltext: n
 feature_wiki_argvariable: y
 feature_syntax_highlighter: y
 feature_jquery_tablesorter: y
 feature_fullscreen: y
 ajax_inline_edit: y
 ajax_inline_edit_trackerlist: y
 unified_incremental_update: y
 wikiplugin_tabs: y
 wikiplugin_button: y
 wikiplugin_param: y
 wikiplugin_tracker: y
 wikiplugin_trackerlist: y
 wikiplugin_list: y
 wikiplugin_listexecute: y
 wikiplugin_pivottable: y
 wikiplugin_jq: y
 trackerfield_dropdownother: y
 trackerfield_autoincrement: y
 trackerfield_currency: y
 trackerfield_dynamiclist: y
 trackerfield_itemslist: y
 trackerfield_math: y
 ajax_inline_edit: y
 ajax_inline_edit_trackerlist: y
 useGroupHome: y
 limitedGoGroupHome: y
{CODE}

!! File Gallery
To store images associated with the tasks performed to reclaim the price for the work done.
{CODE(caption="YAML", wrap="0", colors="tiki")}
objects:
 -
  type: file_gallery
  ref: work_orders_fgal_id
  data:
   name: Images from Work Orders done
   description: Images from the tasks performed associated to Work Orders.
   owner: admin
   archives: 0
   flags: [ public, visible, lockable ]
   column: [ icon, name, created, creator, files ]
   image_max_size_x: 800
   image_max_size_y: 600
{CODE}

!! Tracker 1: Work Orders
{CODE(caption="YAML", wrap="0", colors="tiki")}
objects:
  - 
    type: tracker
    ref: work_orders
    data: 
      name: Work orders
      description: >
        This is where the work orders are stored
      sort_default_order: desc
      list_default_status: opc
      hide_list_empty_fields: y
      restrict_end: 0
      form_classes: 
      section_format: tab
      restrict_start: 0
      allow: 
        - user_see_own
        - creator_modification
      show: 
        - status
  - 
    type: tracker_field
    ref: work_orders_general
    data: 
      name: General
      permname: general
      tracker: $profileobject:work_orders$
      options: 
        level: 3
        toggle: o
      type: header
      order: 5
      flags: 
        - public
  - 
    type: tracker_field
    ref: work_orders_WOID
    data: 
      name: 'WO#'
      permname: woWOID
      tracker: $profileobject:work_orders$
      options: 
        samerow: 1
        autocomplete: n
        exact: n
      type: text_field
      order: 10
      flags: 
        - list
        - searchable
        - public
        - mandatory
  - 
    type: tracker_field
    ref: work_orders_name
    data: 
      name: Name
      permname: woName
      tracker: $profileobject:work_orders$
      options: 
        samerow: 1
      type: text_field
      order: 15
      flags: 
        - link
        - list
        - searchable
        - public
        - mandatory
  - 
    type: tracker_field
    ref: work_orders_users
    data: 
      name: WO Users
      permname: woUsers
      tracker: $profileobject:work_orders$
      options: 
        autoassign: 1
        multiple: 1
        groupIds: 
          - 0
        canChangeGroupIds: 
          - 0
      type: user
      order: 20
      description: >
        Field needed to select the specific 
        client that requested the job and 
        specific contractor that has been 
        assigned to do the job, so that special 
        permissions can be granted to those 
        users to see this Work Order.
      visby: 
        - Staff
      editby: 
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: work_orders_AutoSyncUsers
    data: 
      name: Auto sync users
      permname: woAutoSyncUsers
      tracker: $profileobject:work_orders$
      options: 
        wikiparse: 1
        max: 1000
      type: static
      order: 25
      description: |
        {JQ()}
        var user_fields = ['$profileobject:work_orders_client$', '$profileobject:work_orders_contractor$'];
        $.map(user_fields, function(f){
        $('#user_selector_'+f).change(function(sel){
        var users = [];
        jQuery.map(user_fields, function(f){
        users = users.concat($('#user_selector_'+f).val());
        });
        $('#user_selector_$profileobject:work_orders_users$').val(users);
        $('input[name="ins_$profileobject:work_orders_workPrice$[]"]').map(function(i,el){
        $.ajax({
        type: 'POST',
        url: 'tiki-ajax_services.php',
        dataType: 'json',
        data: {
        controller: 'tracker',
        action: 'update_item',
        trackerId: $profileobject:work_order_line_items$,
        itemId: $(el).val(),
        ins_$profileobject:work_order_line_items_BatchStatus$: 1
        }
        });
        });
        });
        });
        $('#user_selector_$profileobject:work_orders_users$').closest('.form-group').hide();
        $('#trackerinput_work_orders_AutoSyncUsers_ID').closest('.form-group').hide();
        {JQ}
        
      visby: 
      editby: 
      descparsed: y
      flags: 
        - list
        - public
  - 
    type: tracker_field
    ref: work_orders_client
    data: 
      name: Requested by (Client)
      permname: woClient
      tracker: $profileobject:work_orders$
      options: 
        groupIds: 
          - 0
        canChangeGroupIds: 
          - 0
      type: user
      order: 30
      visby: 
      editby: 
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: work_orders_status
    data: 
      name: Status
      permname: woStatus
      tracker: $profileobject:work_orders$
      options: 
        options: 
          - 0-Received from client
          - 0-Received from client
          - 1-Confirmed by us
          - 2-Assigned to Account Manager
          - 3-Bid by contractor
          - 4-Assigned to contractor
          - 5-Work done by contractor
          - 6-Work accepted by our company
          - 7-Invoice Received from Contractor
          - 8-Contractor Paid
          - 9-Client Invoiced
          - 10-Client payment received
          - 11-Postponed until further notice
      type: dropdown
      order: 40
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: work_orders_contractor
    data: 
      name: Assigned to (Contractor)
      permname: woContractor
      tracker: $profileobject:work_orders$
      options: 
        groupIds: 
          - 0
        canChangeGroupIds: 
          - 0
      type: user
      order: 50
      visby: 
      editby: 
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: work_orders_workPrice
    data: 
      name: Work Price
      permname: woWorkPrice
      tracker: $profileobject:work_orders$
      options: 
        trackerId: $profileobject:work_order_line_items$
        displayFieldsList: 
          - $profileobject:work_order_line_items_WO$
          - $profileobject:work_order_line_items_WorkDescription$
          - $profileobject:work_order_line_items_QtyBid$
          - $profileobject:work_order_line_items_Units$
          - $profileobject:work_order_line_items_Client$
          - $profileobject:work_order_line_items_ClientPricePerUnit$
          - $profileobject:work_order_line_items_OverridePriceForClient$
          - $profileobject:work_order_line_items_KeywordsClient$
          - $profileobject:work_order_line_items_Contractor$
          - $profileobject:work_order_line_items_ContractorPricePerUnit$
          - $profileobject:work_order_line_items_OverridePriceForContractor$
          - $profileobject:work_order_line_items_KeywordsContractor$
        displayFieldsListType: table
        status: opc
        addItems: Add
        preSelectFieldHere: $profileobject:work_orders_WOID$
        preSelectFieldThere: $profileobject:work_order_line_items_WO$
        preSelectFieldMethod: crossSelect
        displayOneItem: multi
        selectMultipleValues: 1
        indexRemote: 
          - 0
      type: item_link
      order: 60
      flags: 
        - public
  - 
    type: tracker_field
    ref: work_orders_workPriceFinalForClient
    data: 
      name: Work Price, final (Client)
      permname: woWorkPriceFinalForClient
      tracker: $profileobject:work_orders$
      options: 
        calculation: |
          (add
            (for-each
              (list
                (split-list
                  (content woWorkPrice)
                  (separator ,)
                  (key id)
                )
              )
              (formula
                (tracker-field
                  (object "trackeritem" id)
                  (field woliTotalPriceForClient)
                )
              )
            )
          )
        recalculate: save
      type: math
      order: 70
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: work_orders_workPriceFinalForContractor
    data: 
      name: Work Price, final (Contractor)
      permname: woWorkPriceFinalForContractor
      tracker: $profileobject:work_orders$
      options: 
        calculation: |
          (add
            (for-each
              (list
                (split-list
                  (content woWorkPrice)
                  (separator ,)
                  (key id)
                )
              )
              (formula
                (tracker-field
                  (object "trackeritem" id)
                  (field woliTotalPriceForContractor)
                )
              )
            )
          )
        recalculate: save
      type: math
      order: 80
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: work_orders_location
    data: 
      name: Location
      permname: woLocation
      tracker: $profileobject:work_orders$
      options: 
        level: 3
        toggle: o
      type: header
      order: 90
      flags: 
        - public
  - 
    type: tracker_field
    ref: work_orders_address
    data: 
      name: Address
      permname: woAddress
      tracker: $profileobject:work_orders$
      options: 
        samerow: 1
      type: text_field
      order: 100
      flags: 
        - public
        - searchable
  - 
    type: tracker_field
    ref: work_orders_zipCode
    data: 
      name: Zip Code
      permname: woZipCode
      tracker: $profileobject:work_orders$
      options: 
        samerow: 1
      type: numeric
      order: 110
      flags: 
        - public
        - searchable
  - 
    type: tracker_field
    ref: work_orders_map
    data: 
      name: Map
      permname: woMap
      tracker: $profileobject:work_orders$
      options: 
        use_as_item_location: 1
        list_width: 200
        list_height: 200
        item_width: 500
        item_height: 400
        sourceFieldsList: 
          - >
            $profileobject:work_orders_address$
        sourceSearchEvent: save
      type: map
      order: 120
      flags: 
        - public
  - 
    type: tracker_field
    ref: work_orders_otherInfos
    data: 
      name: Other infos
      permname: woOtherInfos
      tracker: $profileobject:work_orders$
      options: 
        level: 3
        toggle: o
      type: header
      order: 200
      flags: 
        - public
  - 
    type: tracker_field
    ref: work_orders_workOrderInstructions
    data: 
      name: work order instructions
      permname: woWorkOrderInstructions
      tracker: $profileobject:work_orders$
      options: 
        distinct: n
        wysiwyg: n
        samerow: 1
      type: text_area
      order: 210
      flags: 
        - public
        - searchable
  - 
    type: tracker_field
    ref: work_orders_estimatedCompletionDate
    data: 
      name: Estimated Completion Date
      permname: woEstimatedCompletionDate
      tracker: $profileobject:work_orders$
      options: 
        datetime: d
        blankdate: blank
      type: datetime
      order: 250
      flags: 
        - list
        - public
  - 
    type: tracker_option
    ref: work_orders_sort_default_field
    data: 
      tracker: $profileobject:work_orders$
      name: sort_default_field
      value: >
        $profileobject:work_orders_WOID$
  - 
    type: tracker_option
    ref: work_orders_popup_fields
    data: 
      tracker: $profileobject:work_orders$
      name: popup_fields
      value: >
        $profileobject:work_orders_workOrderInstructions$
{CODE}

!! Tracker 2: Work Price Guide
{CODE(caption="YAML", wrap="0", colors="tiki")}
objects: 
  - 
    type: tracker
    ref: work_price_guide
    data: 
      name: Work Price Guide
      description: 
      list_default_status: opc
      hide_list_empty_fields: y
      restrict_end: 0
      form_classes: 
      restrict_start: 0
  - 
    type: tracker_field
    ref: work_price_guide_workCategory
    data: 
      name: Work category
      permname: wpgWorkCategory
      tracker: $profileobject:work_price_guide$
      options: 
        options: 
          - |
            Appliance - remove
          - |
            Appliance - replace
          - Boarding
          - |
            Cap - dryer vent
          - |
            Cap - exposed drain
          - |
            Cap - exposed wire
          - |
            Cap - gas/water line
          - |
            Carpet - clean
          - |
            Clean - fireplace & chimney
          - |
            Clean - gutters
          - Garden work
      type: dropdown
      order: 0
      flags: 
        - list
        - public
  - 
    type: tracker_field
    ref: work_price_guide_workDescription
    data: 
      name: Work description
      permname: wpgWorkDescription
      tracker: $profileobject:work_price_guide$
      options: 
        samerow: 1
      type: text_field
      order: 10
      flags: 
        - link
        - list
        - public
        - mandatory
  - 
    type: tracker_field
    ref: work_price_guide_uM
    data: 
      name: U/M
      permname: wpgUM
      tracker: $profileobject:work_price_guide$
      options: 
        options: 
          - Unit
          - HRS
      type: dropdown
      order: 20
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: work_price_guide_clientPricePerUnit
    data: 
      name: Price Per Unit (Client)
      permname: wpgClientPricePerUnit
      tracker: $profileobject:work_price_guide$
      options: 
        samerow: 1
        size: 7
        locale: en_US.UTF-8
        currency: USD
        symbol: i
        all_symbol: 1
      type: currency
      order: 30
      description: >
        What you will get paid by your client
        for the work to do once done (that you
        subcontracted to a Contractor)
      flags: 
        - list
        - public
  - 
    type: tracker_field
    ref: work_price_guide_contractorPricePerUnit
    data: 
      name: Price Per Unit (Contractor)
      permname: wpgContractorPricePerUnit
      tracker: $profileobject:work_price_guide$
      options: 
        samerow: 1
        size: 7
        locale: en_US.UTF-8
        currency: USD
        symbol: i
        all_symbol: 1
      type: currency
      order: 40
      description: >
        What you will pay the contractor for the
        work done (subcontracted to them, based
        on the request of your client)
      flags: 
        - list
        - public
  - 
    type: tracker_option
    ref: work_price_guide_sort_default_field
    data: 
      tracker: $profileobject:work_price_guide$
      name: sort_default_field
      value: modification
{CODE}

!! Tracker 3: Work Order Line Items
{CODE(caption="YAML", wrap="0", colors="tiki")}
objects: 
  - 
    type: tracker
    ref: >
      work_order_line_items
    data: 
      name: >
        Bid/Completion Notes (Work Order Line
        Items)
      description: 
      restrict_end: 0
      form_classes: 
      section_format: tab
      restrict_start: 0
  - 
    type: tracker_field
    ref: >
      work_order_line_items_WorkInfo
    data: 
      name: Work Info
      permname: woliWorkInfo
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        level: 2
        toggle: o
      type: header
      order: 0
      flags: 
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_WO
    data: 
      name: WO
      permname: woliWO
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        samerow: 1
        dec_point: .
        thousands: ,
      type: numeric
      order: 10
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_WorkDescription
    data: 
      name: Work description
      permname: woliWorkDescription
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        trackerId: $profileobject:work_price_guide$
        fieldId: $profileobject:work_price_guide_workDescription$
        displayFieldsList: 
          - 0
        displayFieldsListType: dropdown
        status: opc
        preSelectFieldMethod: exact
        displayOneItem: multi
        indexRemote: 
          - 0
      type: item_link
      order: 20
      flags: 
        - link
        - list
        - searchable
        - public
        - mandatory
  - 
    type: tracker_field
    ref: >
      work_order_line_items_BidInfo
    data: 
      name: Bid Info
      permname: woliBidInfo
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        level: 2
        toggle: o
      type: header
      order: 30
      flags: 
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_Units
    data: 
      name: Units
      permname: woliUnits
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        trackerId: $profileobject:work_price_guide$
        filterFieldIdThere: $profileobject:work_price_guide_workDescription$
        filterFieldIdHere: >
          $profileobject:work_order_line_items_WorkDescription$
        listFieldIdThere: $profileobject:work_price_guide_uM$
        statusThere: opc
        hideBlank: 1
      type: item_list_dynamic
      order: 40
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_QtyBid
    data: 
      name: Qty (Bid)
      permname: woliQtyBid
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        samerow: 1
        dec_point: .
        thousands: ,
      type: numeric
      order: 50
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_ClientSide
    data: 
      name: ...Client Side
      permname: woliClientSide
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        level: 3
        toggle: o
      type: header
      order: 60
      visby: 
        - Clients
        - Staff
      editby: 
        - Staff
      flags: 
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_Client
    data: 
      name: Requested by (Client)
      permname: woliClient
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        trackerId: $profileobject:work_orders$
        fieldIdThere: $profileobject:work_orders_WOID$
        fieldIdHere: >
          $profileobject:work_order_line_items_WO$
        displayFieldIdThere: 
          - $profileobject:work_orders_client$
        status: opc
      type: item_list
      order: 70
      visby: 
        - Clients
        - Staff
      editby: 
        - Staff
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_ClientPricePerUnit
    data: 
      name: Price Per Unit (Client)
      permname: woliClientPricePerUnit
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        trackerId: $profileobject:work_price_guide$
        filterFieldIdThere: $profileobject:work_price_guide_workDescription$
        filterFieldIdHere: >
          $profileobject:work_order_line_items_WorkDescription$
        listFieldIdThere: $profileobject:work_price_guide_clientPricePerUnit$
        statusThere: opc
        hideBlank: 1
      type: item_list_dynamic
      order: 80
      visby: 
        - Clients
        - Staff
      editby: 
        - Staff
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_OverridePriceForClient
    data: 
      name: Override Price/U (Client)
      permname: woliOverridePriceForClient
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        samerow: 1
        size: 7
        locale: en_US.UTF-8
        currency: USD
        symbol: i
        all_symbol: 1
      type: currency
      order: 90
      visby: 
        - Clients
        - Staff
      editby: 
        - Staff
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_TotalPriceForClient
    data: 
      name: Total Price (Client)
      permname: woliTotalPriceForClient
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        calculation: >
          (mul woliQtyBid
          woliOverridePriceForClient)
        recalculate: save
      type: math
      order: 100
      visby: 
        - Clients
        - Staff
      editby: 
        - Staff
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_KeywordsClient
    data: 
      name: Bid Comments (Client)
      permname: woliKeywordsClient
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        samerow: 1
        autocomplete: n
        exact: n
      type: text_field
      order: 110
      visby: 
        - Clients
        - Staff
      editby: 
        - Staff
      description: >
        Reason to Override for Client 
        (Keywords), i.e. free text to 
        facilitate aggregating in a later stage 
        the work items with overidden prices to 
        Clients due to a common reason (client, 
        type of work, special promotion, etc.)
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_ContractorSide
    data: 
      name: ...Contractor Side
      permname: woliContractorSide
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        level: 3
        toggle: o
      type: header
      order: 120
      visby: 
        - Contractors
        - Staff
      editby: 
        - Staff
      flags: 
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_Contractor
    data: 
      name: Assigned to (Contractor)
      permname: woliContractor
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        trackerId: $profileobject:work_orders$
        fieldIdThere: $profileobject:work_orders_WOID$
        fieldIdHere: >
          $profileobject:work_order_line_items_WO$
        displayFieldIdThere: 
          - $profileobject:work_orders_contractor$
        status: opc
      type: item_list
      order: 130
      visby: 
        - Contractors
        - Staff
      editby: 
        - Staff
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_ContractorPricePerUnit
    data: 
      name: Price Per Unit (Contractor)
      permname: woliContractorPricePerUnit
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        trackerId: $profileobject:work_price_guide$
        filterFieldIdThere: $profileobject:work_price_guide_workDescription$
        filterFieldIdHere: >
          $profileobject:work_order_line_items_WorkDescription$
        listFieldIdThere: $profileobject:work_price_guide_contractorPricePerUnit$
        statusThere: opc
        hideBlank: 1
      type: item_list_dynamic
      order: 140
      visby: 
        - Contractors
        - Staff
      editby: 
        - Staff
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_OverridePriceForContractor
    data: 
      name: Override Price/U (Contractor)
      permname: woliOverridePriceForContractor
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        samerow: 1
        size: 7
        locale: en_US.UTF-8
        currency: USD
        symbol: i
        all_symbol: 1
      type: currency
      order: 150
      visby: 
        - Contractors
        - Staff
      editby: 
        - Staff
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_TotalPriceForContractor
    data: 
      name: Total Price (Contractor)
      permname: woliTotalPriceForContractor
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        calculation: >
          (mul woliQtyBid
          woliOverridePriceForContractor)
        recalculate: save
      type: math
      order: 160
      visby: 
        - Contractors
        - Staff
      editby: 
        - Staff
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_KeywordsContractor
    data: 
      name: Bid Comments (Contractor)
      permname: woliKeywordsContractor
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        samerow: 1
        autocomplete: n
        exact: n
      type: text_field
      order: 170
      visby: 
        - Contractors
        - Staff
      editby: 
        - Staff
      description: >
        Reason to Override for Contractor 
        (Keywords), i.e. free text to 
        facilitate aggregating in a later stage 
        the work items with overidden prices 
        to Contractors due to a common 
        reason (contractor, type of work, 
        special promotion, etc.)
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_CompletionInfo
    data: 
      name: Completion Info
      permname: woliCompletionInfo
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        level: 2
        toggle: o
      type: header
      order: 180
      flags: 
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_QtyCompleted
    data: 
      name: Qty (Completed)
      permname: woliQtyCompleted
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        samerow: 1
        dec_point: .
        thousands: ,
      type: numeric
      order: 190
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_CommentsCompletion
    data: 
      name: Comments (Completion)
      permname: woliCommentsCompletion
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        distinct: n
        wysiwyg: n
        samerow: 1
      type: text_area
      order: 200
      flags: 
        - list
        - searchable
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_Photos
    data: 
      name: ...Photos
      permname: woliPhotos
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        level: 3
        toggle: o
      type: header
      order: 210
      flags: 
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_PhotosBefore
    data: 
      name: Photos Before
      permname: woliPhotosBefore
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        galleryId: $profileobject:work_orders_fgal_id$
        displayMode: img
        replace: n
        uploadInModal: y
        image_x: 640
        image_y: 480
      type: files
      order: 220
      flags: 
        - list
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_PhotosDuring
    data: 
      name: Photos During
      permname: woliPhotosDuring
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        galleryId: $profileobject:work_orders_fgal_id$
        displayMode: img
        replace: n
        uploadInModal: y
        image_x: 820
        image_y: 620
      type: files
      order: 230
      flags: 
        - list
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_PhotosAfter
    data: 
      name: Photos After
      permname: woliPhotosAfter
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        galleryId: $profileobject:work_orders_fgal_id$
        displayMode: img
        replace: n
        uploadInModal: y
      type: files
      order: 240
      flags: 
        - list
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_MirrorWOUsers
    data: 
      name: Mirror WO Users
      permname: woliMirrorWOUsers
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        trackerId: $profileobject:work_orders$
        fieldIdThere: $profileobject:work_orders_WOID$
        fieldIdHere: >
          $profileobject:work_order_line_items_WO$
        displayFieldIdThere: 
          - $profileobject:work_orders_users$
        status: opc
      type: item_list
      order: 250
      visby: 
      editby: 
      flags: 
        - list
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_users
    data: 
      name: Users
      permname: woliUsers
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        autoassign: 1
        multiple: 1
        groupIds: 
          - 0
        canChangeGroupIds: 
          - 0
      type: user
      order: 260
      description: >
        Item owners with the right to edit the
        information of the item. Mainly the
        contractor assigned to do the job, so
        that they can edit the item to add their
        bid
      visby: 
      editby: 
      flags: 
        - list
        - public
  - 
    type: tracker_field
    ref: >
      work_order_line_items_BatchStatus
    data: 
      name: Batch Status
      permname: woliBatchStatus
      tracker: >
        $profileobject:work_order_line_items$
      options: 
        options: 
          - |
            1=1 - Unprocessed
          - |
            1=1 - Unprocessed
          - |
            2=2 - Item Owners Sync'ed
      type: dropdown_other
      order: 270
      visby: 
      editby: 
      flags: 
        - list
        - public
  - 
    type: tracker_option
    ref: >
      work_order_line_items_sort_default_field
    data: 
      tracker: >
        $profileobject:work_order_line_items$
      name: sort_default_field
      value: modification
{CODE}

!! Modules
{CODE(caption=>YAML,wrap=>0)}
objects: 
 - 
  type: module
  ref: module_menupage_wcp
  data: 
   name: menupage
   params: 
    pagemenu: $wcp_menupage_include
   groups: 
    - Anonymous
    - Registered
   order: 2
   position: left
{CODE}


!! Groups
Create a group "Clients" which has permission to view some fields related to them, but not visible by others. The other group "Contractors" will have the tracker field permission to see the other fields corresponding to them also, but not to Clients. And "Staff" will be able to edit the Work Orders and assign it to Contractors.

{CODE(caption="YAML" wrap="1")}
permissions:
 Staff:
  home:  $profileobject:wcp_page$
  description: Employees of your company to handle the data. They will assign work orders fro clients to contractors 
  allow:
   - edit
   - view
  include: [ Registered ]
  objects:
   -
    type: tracker
    id: $profileobject:work_orders$
    allow:
     - list_trackers
     - view_trackers
     - view_trackers_pending
     - view_trackers_closed
     - modify_tracker_items
     - modify_tracker_items_pending
     - modify_tracker_items_closed
   -
    type: tracker
    id: $profileobject:work_price_guide$
    allow:
     - list_trackers
     - view_trackers
     - view_trackers_pending
     - view_trackers_closed
     - modify_tracker_items
     - modify_tracker_items_pending
     - modify_tracker_items_closed
   -
    type: tracker
    id: $profileobject:work_order_line_items$
    allow:
     - create_tracker_items
     - list_trackers
     - view_trackers
     - view_trackers_pending
     - view_trackers_closed
     - modify_tracker_items
     - modify_tracker_items_pending
     - modify_tracker_items_closed
 Clients:
  home:  $profileobject:wcp_clients_homepage$
  description: Clients of your company. They will assign work orders to you to be done (by you or your contractors)
  allow:
  include: [ Registered ]
  objects:
   -
    type: tracker
    id: $profileobject:work_orders$
    allow:
     - create_tracker_items
     - list_trackers
     - view_trackers
     - view_trackers_pending
     - view_trackers_closed
   -
    type: tracker
    id: $profileobject:work_price_guide$
    allow:
     - list_trackers
     - view_trackers
   -
    type: tracker
    id: $profileobject:work_order_line_items$
    allow:
     - create_tracker_items
     - list_trackers
     - view_trackers
     - view_trackers_pending
     - view_trackers_closed
   -
    type: wiki_page
    id: $profileobject:wcp_page$
    allow: 
   -
    type: wiki_page
    id: $profileobject:wcp_clients_homepage$
    allow: 
     - edit
     - view
 Contractors:
  home:  $profileobject:wcp_contractors_homepage$
  description: Members of the companies you request some work to be done associated with the Work Orders that you have received by your Clients. 
  allow:
  include: [ Registered ]
  objects:
   -
    type: tracker
    id: $profileobject:work_orders$
    allow:
     - list_trackers
     - view_trackers
     - modify_tracker_items
     - modify_tracker_items_pending
   -
    type: tracker
    id: $profileobject:work_price_guide$
    allow:
     - list_trackers
     - view_trackers
   -
    type: tracker
    id: $profileobject:work_order_line_items$
    allow:
     - list_trackers
     - view_trackers
     - modify_tracker_items
     - modify_tracker_items_pending
   -
    type: wiki_page
    id: $profileobject:wcp_contractors_homepage$
    allow: 
     - edit
     - view
{CODE}


!! Users
Add a user to the group Members
{CODE(caption=>YAML)}
objects:
 -
  type: user
  data: 
    name: staff1
    pass: staff1
    email: staff1@example.com
    change: n
    groups: [ Staff ]
 -
  type: user
  data: 
    name: client1
    pass: client1
    email: client1@example.com
    change: n
    groups: [ Clients ]
 -
  type: user
  data: 
    name: client2
    pass: client2
    email: client2@example.com
    change: n
    groups: [ Clients ]
 -
  type: user
  data: 
    name: contractorA
    pass: contractorA
    email: contractorA@example.com
    change: n
    groups: [ Contractors ]
 -
  type: user
  data: 
    name: contractorB
    pass: contractorB
    email: contractorB@example.com
    change: n
    groups: [ Contractors ]
{CODE}

!! Sample data
!!! In Tracker1: Work orders
{CODE(caption=>YAML,wrap=>1)}
objects:
 -
  type: tracker_item
  ref: wo_001
  data:
   tracker: $Work_Custom_Pricing:work_orders
   status: open
   values:
    - [ $Work_Custom_Pricing:work_orders_WOID, 1 ]
    - [ $Work_Custom_Pricing:work_orders_name, "Check current status of the abandoned house ABC (The first Work Order: take pics, etc)" ]
    - [ $Work_Custom_Pricing:work_orders_status, "1-Confirmed by us" ]
    - [ $Work_Custom_Pricing:work_orders_address, "Avinguda de Vallcarca, 118. Barcelona. Spain" ]
    - [ $Work_Custom_Pricing:work_orders_users, "client1, contractorA, staff1" ]
    - [ $Work_Custom_Pricing:work_orders_client, client1 ]
    - [ $Work_Custom_Pricing:work_orders_contractor, contractorA ]
 -
  type: tracker_item
  ref: wo_002
  data:
   tracker: $Work_Custom_Pricing:work_orders
   status: pending
   values:
    - [ $Work_Custom_Pricing:work_orders_WOID, 2 ]
    - [ $Work_Custom_Pricing:work_orders_name, "Clean the house (from corruption)" ]
    - [ $Work_Custom_Pricing:work_orders_status, "0-Received from client" ]
    - [ $Work_Custom_Pricing:work_orders_address, "Calle de Génova, 13, 28004 Madrid" ]
    - [ $Work_Custom_Pricing:work_orders_users, "client1, contractorB, staff1" ]
    - [ $Work_Custom_Pricing:work_orders_client, client1 ]
    - [ $Work_Custom_Pricing:work_orders_contractor, contractorB ]
 -
  type: tracker_item
  ref: wo_003
  data:
   tracker: $Work_Custom_Pricing:work_orders
   status: closed
   values:
    - [ $Work_Custom_Pricing:work_orders_WOID, 3 ]
    - [ $Work_Custom_Pricing:work_orders_name, "Extend Rurban Gardens near the farm house XYZ" ]
    - [ $Work_Custom_Pricing:work_orders_status, "11-Postponed until further notice" ]
    - [ $Work_Custom_Pricing:work_orders_address, "Can Masdéu, 08035 Barcelona" ]
    - [ $Work_Custom_Pricing:work_orders_users, "client2, contractorA, staff2" ]
    - [ $Work_Custom_Pricing:work_orders_client, client2 ]
    - [ $Work_Custom_Pricing:work_orders_contractor, contractorA ]
 -
  type: tracker_item
  ref: wo_004
  data:
   tracker: $Work_Custom_Pricing:work_orders
   status: open
   values:
    - [ $Work_Custom_Pricing:work_orders_WOID, 4 ]
    - [ $Work_Custom_Pricing:work_orders_name, "Clean the Central Bank Office from Speculation as warned by the 'Occupy the Street' movement" ]
    - [ $Work_Custom_Pricing:work_orders_status, "0-Received from client" ]
    - [ $Work_Custom_Pricing:work_orders_address, "Can Masdéu, 08035 Barcelona" ]
    - [ $Work_Custom_Pricing:work_orders_users, "client2, contractorB, staff2" ]
    - [ $Work_Custom_Pricing:work_orders_client, client2 ]
    - [ $Work_Custom_Pricing:work_orders_contractor, contractorB ]
{CODE}

!!! In Tracker2: Work Price Guide
{CODE(caption=>YAML,wrap=>1)}
objects:
 -
  type: tracker_item
  ref: wpg_001
  data:
   tracker: $Work_Custom_Pricing:work_price_guide
   status: open
   values:
    - [ $Work_Custom_Pricing:work_price_guide_workCategory, "Appliance - remove" ]
    - [ $Work_Custom_Pricing:work_price_guide_workDescription, "Remove old appliances from the abandoned house" ]
    - [ $Work_Custom_Pricing:work_price_guide_uM, "HRS" ]
    - [ $Work_Custom_Pricing:work_price_guide_clientPricePerUnit, "20" ]
    - [ $Work_Custom_Pricing:work_price_guide_contractorPricePerUnit, "10" ]
 -
  type: tracker_item
  ref: wpg_002
  data:
   tracker: $Work_Custom_Pricing:work_price_guide
   status: open
   values:
    - [ $Work_Custom_Pricing:work_price_guide_workCategory, "Carpet - clean" ]
    - [ $Work_Custom_Pricing:work_price_guide_workDescription, "Clear carpets of each room of the house" ]
    - [ $Work_Custom_Pricing:work_price_guide_uM, "HRS" ]
    - [ $Work_Custom_Pricing:work_price_guide_clientPricePerUnit, "30" ]
    - [ $Work_Custom_Pricing:work_price_guide_contractorPricePerUnit, "15" ]
 -
  type: tracker_item
  ref: wpg_003
  data:
   tracker: $Work_Custom_Pricing:work_price_guide
   status: open
   values:
    - [ $Work_Custom_Pricing:work_price_guide_workCategory, "Fix structures" ]
    - [ $Work_Custom_Pricing:work_price_guide_workDescription, "Fix wooden fence at the garden" ]
    - [ $Work_Custom_Pricing:work_price_guide_uM, "HRS" ]
    - [ $Work_Custom_Pricing:work_price_guide_clientPricePerUnit, "16" ]
    - [ $Work_Custom_Pricing:work_price_guide_contractorPricePerUnit, "8" ]
{CODE}

!!! In Tracker3: Work Order Line Items
{CODE(caption=>YAML,wrap=>1)}
objects:
 -
  type: tracker_item
  ref: woli_001
  data:
   tracker: $Work_Custom_Pricing:work_order_line_items
   status: open
   values:
    - [ $Work_Custom_Pricing:work_order_line_items_WO, 1 ]
    - [ $Work_Custom_Pricing:work_order_line_items_WorkDescription, $Work_Custom_Pricing:wpg_002 ]
    - [ $Work_Custom_Pricing:work_order_line_items_Units, $Work_Custom_Pricing:wpg_002 ]
    - [ $Work_Custom_Pricing:work_order_line_items_ClientPricePerUnit, $Work_Custom_Pricing:wpg_002 ]
    - [ $Work_Custom_Pricing:work_order_line_items_QtyBid, 5 ]
    - [ $Work_Custom_Pricing:work_order_line_items_Client, client1 ]
    - [ $Work_Custom_Pricing:work_order_line_items_OverridePriceForClient, "28" ]
    - [ $Work_Custom_Pricing:work_order_line_items_KeywordsClient, "lower price after delay" ]
    - [ $Work_Custom_Pricing:work_order_line_items_Contractor, contractorA ]
    - [ $Work_Custom_Pricing:work_order_line_items_ContractorPricePerUnit, $Work_Custom_Pricing:wpg_002 ]
    - [ $Work_Custom_Pricing:work_order_line_items_OverridePriceForContractor, "16" ]
    - [ $Work_Custom_Pricing:work_order_line_items_KeywordsContractor, "special deal 2016 Fall" ]
 -
  type: tracker_item
  ref: woli_002
  data:
   tracker: $Work_Custom_Pricing:work_order_line_items
   status: open
   values:
    - [ $Work_Custom_Pricing:work_order_line_items_WO, 1 ]
    - [ $Work_Custom_Pricing:work_order_line_items_WorkDescription, $Work_Custom_Pricing:wpg_003 ]
    - [ $Work_Custom_Pricing:work_order_line_items_Units, $Work_Custom_Pricing:wpg_003 ]
    - [ $Work_Custom_Pricing:work_order_line_items_ClientPricePerUnit, $Work_Custom_Pricing:wpg_003  ]
    - [ $Work_Custom_Pricing:work_order_line_items_QtyBid, 2 ]
    - [ $Work_Custom_Pricing:work_order_line_items_Client, client1 ]
    - [ $Work_Custom_Pricing:work_order_line_items_OverridePriceForClient, "15" ]
    - [ $Work_Custom_Pricing:work_order_line_items_KeywordsClient, "lower price after delay" ]
    - [ $Work_Custom_Pricing:work_order_line_items_Contractor, contractorA ]
    - [ $Work_Custom_Pricing:work_order_line_items_ContractorPricePerUnit, $Work_Custom_Pricing:wpg_003  ]
    - [ $Work_Custom_Pricing:work_order_line_items_OverridePriceForContractor, "10" ]
    - [ $Work_Custom_Pricing:work_order_line_items_KeywordsContractor, "friends" ]
 -
  type: tracker_item
  ref: woli_003
  data:
   tracker: $Work_Custom_Pricing:work_order_line_items
   status: open
   values:
    - [ $Work_Custom_Pricing:work_order_line_items_WO, 2 ]
    - [ $Work_Custom_Pricing:work_order_line_items_WorkDescription, $Work_Custom_Pricing:wpg_003 ]
    - [ $Work_Custom_Pricing:work_order_line_items_Units, $Work_Custom_Pricing:wpg_003 ]
    - [ $Work_Custom_Pricing:work_order_line_items_ClientPricePerUnit, $Work_Custom_Pricing:wpg_003  ]
    - [ $Work_Custom_Pricing:work_order_line_items_QtyBid, 8 ]
    - [ $Work_Custom_Pricing:work_order_line_items_Client, client1 ]
    - [ $Work_Custom_Pricing:work_order_line_items_OverridePriceForClient, "12" ]
    - [ $Work_Custom_Pricing:work_order_line_items_KeywordsClient, "campaign to get more clients" ]
    - [ $Work_Custom_Pricing:work_order_line_items_Contractor, contractorB ]
    - [ $Work_Custom_Pricing:work_order_line_items_ContractorPricePerUnit, $Work_Custom_Pricing:wpg_003  ]
    - [ $Work_Custom_Pricing:work_order_line_items_OverridePriceForContractor, "7" ]
    - [ $Work_Custom_Pricing:work_order_line_items_KeywordsContractor, "adjusted prices during campaign to get more clients" ]
{CODE}


!! Wiki pages
Add a page to allow adding items, and the instructions page

This will include: ((Profile_Work_Custom_Pricing_page))

{CODE(caption=>YAML)}
instructions: Work Custom Pricing Instructions
preferences:
  enable: [ feature_wiki ]
objects:
  -
    type: wiki_page
    ref:  wcp_page
    data:
      name: Homepage for Staff
      description: Interface to manage all work orders
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_Work_Custom_Pricing_page
  -
    type: wiki_page
    ref:  wcp_clients_homepage
    data:
      name: Homepage for Clients
      description: Interface to manage your work orders (requested)
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_Work_Custom_Pricing_clients_homepage
  -
    type: wiki_page
    ref:  wcp_contractors_homepage
    data:
      name: Homepage for Contractors
      description: Interface to manage your work orders (Assigned to do)
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_Work_Custom_Pricing_contractors_homepage
  -
    type: wiki_page
    ref:  wcp_instructions_page
    data:
      name: Work Custom Pricing Instructions
      description: Instructions on how to use this profile
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_Work_Custom_Pricing_instructions_page
  -
    type: wiki_page
    ref:  wcp_menupage_include
    data:
      name: Menu from WCP
      description: Custom Wiki Menu for the Work Custom Pricing Profile
      lang: en
      mode: create_or_update
      content: wikicontent:Profile_Work_Custom_Pricing_menupage_include
{CODE}


        

History

Information Version
Tue 14 of Feb, 2023 04:26 GMT-0000 Marc Laporte Profile tester reported There were some errors while trying to load the profile definition Could not parse YAML in profile: "Duplicate key "ajax_inline_edit" detected at line 29 (near "ajax_inline_edit: y")." 110
Tue 14 of Feb, 2023 02:54 GMT-0000 Marc Laporte Broken here: https://tikiwiki.gitlab.io/ci-helpers/tiki-profiles-tester/ 109
Wed 10 of Jul, 2019 09:22 GMT-0000 Xavi (as xavidp - admin) added profile_autoapprove_wikiplugins 108
Wed 10 of Jul, 2019 09:17 GMT-0000 Xavi (as xavidp - admin) plugin jq was used 107
Wed 10 of Jul, 2019 08:40 GMT-0000 Xavi (as xavidp - admin) full path of image to allow display from remote tiki profiles control panel 106
Wed 10 of Jul, 2019 08:39 GMT-0000 Xavi (as xavidp - admin) replaced $profileobject:work_orders_AutoSyncUsers$ with work_orders_AutoSyncUsers_ID to prevent circular reference and profile application failing 105
Sun 07 of Jul, 2019 18:18 GMT-0000 Xavier de Pedro added screenshot 104
Mon 28 of Nov, 2016 13:31 GMT-0000 Xavier de Pedro fixed positions 103
Mon 28 of Nov, 2016 13:28 GMT-0000 Xavier de Pedro typo 102
Mon 28 of Nov, 2016 13:26 GMT-0000 Xavier de Pedro fixed referencs in formula to auxotsyncuserowners between trackers 101
Mon 28 of Nov, 2016 13:23 GMT-0000 Xavier de Pedro added a few fields in trakcer woli, plus field to autosyncowners 100
Fri 04 of Nov, 2016 01:32 GMT-0000 Marc Laporte typo 99
Wed 26 of Oct, 2016 11:58 GMT-0000 Xavier de Pedro added inline edit to the profile 98
Tue 25 of Oct, 2016 13:22 GMT-0000 Xavier de Pedro fixed object perms for staff, clients and contractors 97
Tue 25 of Oct, 2016 13:15 GMT-0000 Xavier de Pedro added perms global local to test issues in show instances so far 96
Tue 25 of Oct, 2016 13:06 GMT-0000 Xavier de Pedro added itemslist 95
Tue 25 of Oct, 2016 10:11 GMT-0000 Xavier de Pedro added local perm for staff to edit his own homepage for the pivot table to work and test local perm but not global issue 94
Tue 25 of Oct, 2016 09:51 GMT-0000 Xavier de Pedro added a couple extra plugins 93
Sat 22 of Oct, 2016 22:43 GMT-0000 Xavier de Pedro minor extra info 92
Sat 22 of Oct, 2016 22:40 GMT-0000 Xavier de Pedro typo 91
Fri 21 of Oct, 2016 21:43 GMT-0000 Xavier de Pedro converted user seleectro in tracker woli to items_list get the data from the corresponding tracker item in WO with the same work order number 90
Fri 21 of Oct, 2016 20:10 GMT-0000 Xavier de Pedro added staff1 or 2 to each default WO tracker item to allow them to edit the corresponding tracker items. 89
Fri 21 of Oct, 2016 20:08 GMT-0000 Xavier de Pedro added default values for woUSers multiple select, make one tracker item as closed, and new woStatus 88
Fri 21 of Oct, 2016 17:27 GMT-0000 Xavier de Pedro added new options for tracker work order to allow a creator to modify his/her items 87
Fri 21 of Oct, 2016 17:22 GMT-0000 Xavier de Pedro added wo users as multiple selction and autoassign as creator for the special permissions to be applicable later on. 86