AI Automation Prompt: Check Timesheet Hours

Easily create AI Automation prompts by copying and pasting instructions from this page into the LLM Prompts form (ML202000). These prompts instructions help you get started. For best results, customise them for your company's requirements and the data you have available. For detailed steps on how to create prompts in MYOB Acumatica, see Integration with LLM Providers: Creation of LLM Prompts.

When your payroll team imports timesheet batches, they can use an AI prompt to calculate total hours per employee, flag those with regular hours under 40, and generate a clear exceptions summary. That way, payroll can quickly identify and follow up on under-reported time without manually tallying each record.
Tip:
Speed up creating this prompt by importing it as an XML file. For instructions, see To Import Data from XML. Right-click this link and choose Save link as to download the XML file: MYOB-TIMESHEETS.xml

Summary Area

Field What to Enter
Prompt ID MYOB-TIMESHEETS
Prompt Name Timesheets Hours Checks
LLM Connection MYOB-MANAGED
Source Form MPPP7030 (Import Timesheets)
Button Name Check Base Hours

Instructions Tab

Section Instructions
Context Instructions You are an AI assistant working with MYOB Acumatica ERP payroll data. Your role is to review the lines of the Import Timesheets batch, calculate total hours per employee, and flag exceptions where an employee's Regular Hours are less than 40.
Instructions with Input Data

Review the data fields below and calculate the total quantity per employee.

<foreach view="TimesheetDetails">

Employee Name - ((TimesheetDetails.EmployeeName))

External Employee ID - ((TimesheetDetails.ExternalEmployeeID))

Pay Item Description - ((TimesheetDetails.ExternalPayItemDescription))

Quantity - ((TimesheetDetails.Quantity))

</foreach>

Calculation & Filtering Rules
  1. Sum ALL rows for each employee separately by Pay Item Description

  2. A single employee may appear across multiple rows with the same Pay Item — add all rows of the same Pay Item together to get the total for that pay item

  3. Regular Hours total = sum of ALL rows where Pay Item Description = "Regular Hours" for that employee

  4. Total Hours = sum of ALL rows across ALL pay items for that employee
  5. Only include employees where Regular Hours total is less than 40

  6. Employees with Regular Hours equal to or above 40 should be excluded entirely

  7. If no employees have Regular Hours under 40, output "No exceptions found."

Output Data Field

Using the filtered results above, generate a neat, professional, and concise exceptions summary and write it to the Summary field. @((TimesheetBatches.UsrTimesheetSummary))

Output Format Tab

Section Instructions
Output Format Example

{ }

## Important Note:

The output must contain only the JSON object, without additional text, explanations, or comments. Make sure that the JSON object is properly formatted: Use double quotes for keys and string values, and place commas and braces correctly.