Process task rate cards

The business rule Process Task Rate Cards runs when tasks close and checks to see if any task rate cards apply. If they do, an expense line is created according to the rate card.

The process flow of the "Process Task Rate Cards" business rule is:

  1. Task closes.
  2. Business rule runs.
  3. Query active task rate cards in order looking for a matching condition.
  4. Qualifying rate card not using time worked.
    1. Generate expense line linked to the task using the task rate value.
  5. Qualifying rate card using time worked.
    1. Get task time worked entries for the task grouped by user (worker).
    2. For each user, check to see if they match conditions in any of the labor rate cards.
      1. Labor rate card found, generate expense line using the time worked and labor rate.
      2. Labor rate card not found, generate expense line using the default labor rate from the task rate card.