GM-X ERP for Blockchain - The WORK-EFFORT subsystem

By Tony Marston

21st March 2008
Amended 13th October 2023

Introduction
1. Work Efforts
2. Timesheets
3. Expenses
4. Events
5. Constructing Journal Entries for Timesheets
JOURNAL_ENTRY_HEADER
JOURNAL_ENTRY_ITEM
Journal Entries constructed for timesheets
Segment 1a - Revenue, Work in Progress and Direct Cost
Segment 1b - Indirect Expense, Inventory and Acquisition of Other Assets
Segment 2 - Employer Pension Expense
Determine the account_id from an account_usage value
Fixed-Fee Services
is_summary_journal Property
Amendment History

Introduction

As well as selling goods an organisation may sell services which may require the completion of some sort of work effort. Businesses may also perform work efforts within their internal organisations to accomplish tasks, such as completing a project, producing inventory for sale, or maintaining some corporate asset.

Some questions that enterprises need to answer in the course of doing business include the following:


Work Efforts

Work efforts are used to track the work needed to fix or produce something and involve the allocation of resources. A work effort may be scheduled to take place at a specific location (facility), and may involve the assignment of several parties with particular roles. Each work effort is categorised by type and purpose.

Figure 1 - Work Effort

work-effort-01 (2K)

WORK_EFFORT_TYPE table

This identifies the work effort type.

FieldTypeDescription
work_effort_type_id string Identity
work_effort_type_desc string Description

Here are some examples:

WORK_EFFORT_PURPOSE table

This identifies the work effort purpose.

FieldTypeDescription
work_effort_purpose_id string Identity
work_effort_purpose_desc string Description

Here are some examples:

WORK_EFFORT table

This identifies work that needs to be done. It may be scheduled to take place at a particular location (facility), or may involve parties who are located across several facilities.

It is also possible to create a hierarchy of work efforts, such as a project which has several phases, and each phase has several tasks, et cetera. These are arranged in a senior-to-junior or parent-to-child relationship where a "child" can have only one "parent", but a "parent" can have an number of "children".

The actual_hours value is updated automatically from the input of timesheet entries.

FieldTypeDescription
work_effort_id number Identity number generated by the system.
work_effort_name string Short name.
work_effort_desc string Optional. Long description.
start_date datetime The date on which this work effort starts.
end_date datetime Optional. The date on which this work effort ends.
is_all_day_event boolean Optional. Identifies if this is an all day event. If this is a partial day then the start_date and end_date values must include the actual times.
estimated_hours number Optional. The estimated number of hours allowed for this work effort.
actual_hours number Optional. The actual number of hours which have been spent on this work effort. This is the aggregate of entries on the TIMESHEET_ENTRY table.
invoiced_hours number Optional. The actual number of hours which have been invoiced for this work effort. Invoicing of timesheet entries requires an entry on the WORK_EFFORT_ORDER_ITEM table.
special_terms string Optional. Any special terms regarding this work effort.
work_effort_id_snr number Optional. Links to the senior (parent) entry on the WORK_EFFORT table.
party_id_private number Optional. Links to an entry on the WORK_EFFORT_PARTY table. This is only used when the entry was generated for a particular person, such as a Leave Request. This prevents a record which has been approved for one person from being used by another person.
facility_id number Optional. Links to an entry on the FACILITY table. Identifies where this work effort will take place.
work_effort_type_id string Links to an entry on the WORK_EFFORT_TYPE table.
work_effort_purpose_id string Links to an entry on the WORK_EFFORT_PURPOSE table.
schedule_id number Links to an entry on the PM_SCHEDULE table.
schedule_seq_no number Links to an entry on the PM_SCHEDULE table.
qty_to_be_produced number Optional. The quantity to be produced.
quantity_produced number Optional. The quantity actually produced.
quantity_rejected number Optional. The quantity rejected.
asset_id number Optional. Identifies the asset being built or maintained. Links to an entry on the ASSET table. If not blank, creation of a related TIMESHEET_ENTRY will also create a new entry for the asset_id on the ASSET_BOOK_EVENT table.

WORK_EFFORT_STATUS_TYPE table

This identifies all the possible states through which a work effort may be progressed.

FieldTypeDescription
work_effort_status_type_id string Identity
work_effort_status_type_desc string Description
sort_seq number Sort sequence when loading into the dropdown list.
email_template string Optional. This contains an email message which may have certain keywords enclosed in '#' characters. These keywords will be replaced with proper values at runtime as follows:
  • #party_name# - the recipient's name
is_email_auto boolean If 'Yes' the email will be sent automatically, otherwise the user will be prompted first.

Here are some examples:

WORK_EFFORT_STATUS_HIST table

This keeps a history of all changes in status for a work effort. The entry with the highest sequence number is the latest.

FieldTypeDescription
work_effort_id number Links to an entry on the WORK_EFFORT table.
seq_no number Sequence number generated by the system.
work_effort_status_type_id string Links to an entry on the WORK_EFFORT_STATUS_TYPE table.
status_date date The date on which this change was made.

WORK_EFFORT_ORDER_ITEM table

This links a WORK_EFFORT with an ORDER_ITEM so that invoices can be generated at intervals for the outstanding hours and expenses.

In order to create multiple invoices over a period of time it is first necessary to create a sales order with the 'Repeating' status, with a separate order item for each work effort which identifies the rate to be charged for each hour's work. At the end of week after the timesheets have been filled in and approved an invoice can be created for the outstanding hours, which is calculated as the difference between actual_hours and invoiced_hours. After the invoice is produced the outstanding hours will be added to invoiced_hours. The amounts from any uninvoiced expense items will also be added to the invoice, after which their is_invoiced value will be changed from 'N' to 'Y'.

FieldTypeDescription
work_effort_id number Links to an entry on the WORK_EFFORT table.
order_type string Links to an entry on the ORDER_ITEM table.
order_id number Links to an entry on the ORDER_ITEM table.
order_item_seq_no number Links to an entry on the ORDER_ITEM table.

WORK_EFFORT_COMPONENT table

This contains bills of material (BOM) for Work Efforts. Each Work Effort BOM identifies all the material required to complete a particular Work Effort, and the quantities which have been staged for that purpose.

Here are some Work Effort BOM examples:

Generally, when the Add Work Effort Components from BOM (Create from BOM) task is activated, only the Current entries on the PRODUCT_COMPONENT table which are directly linked to the senior (parent) product_id will be copied to the Work Effort BOM. Additional PRODUCT_COMPONENT entries for the components of the copied components, if any, will not be copied to the Work Effort BOM, unless a copied component is a Phantom. In that case, the component will not be copied to the Work Effort BOM, but its Current components on the PRODUCT_COMPONENT table will be copied instead, and that process will continue recursively if any of the phantom's components is also a Phantom. This technique is known as a "single-level BOM explosion with phantom blow-through."

When copying PRODUCT_COMPONENT entries to a Work Effort BOM, the Add Work Effort Components from BOM (Create from BOM) task will explode (gross up) the quantity_required as follows:

  1. Divide the Engineering BOM quantity by the senior (parent) product's yield percentage, if any, found on the PRODUCT_BOM_TYPE table. If no yield percentage exists, Quantity (1) is the same as the Engineering BOM quantity.
  2. Add 100 to the component (junior) product's scrap percentage, if any, and then multiply Quantity (1) by the result as a percentage. If no scrap percentage exists, Quantity (2) is the same as Quantity (1).
  3. If the product is a component of an Engineering BOM for a Phantom, multiply Quantity (2) by the quantity of the Phantom where that Phantom is used as the junior (component) product on the PRODUCT_COMPONENT table; otherwise, Quantity (3) is the same as Quantity (2). If a Phantom product has a multi-level Engineering BOM consisting of junior (component) entries that are also Phantom products, multiplication will be done recursively at each level of the Engineering BOM.
  4. If the Work Effort is linked to a Sales Order Item by way of the WORK_EFFORT_ORDER_ITEM table, multiply Quantity (3) by the quantity of the ORDER_ITEM to which the Work Effort is linked; otherwise Quantity (4) is the same as Quantity (3).
  5. If Quantity (4) is a fractional quantity having more decimal digits than allowed by the scale of the UNIT_OF_MEASURE to which the component (junior) product_id is linked on the PRODUCT table, then increase Quantity (4) to the next whole decimal digit (or, when the scale is zero, to the next whole number); otherwise, Quantity (4) is the same as Quantity (3).

This technique will provide sufficient quantities of material to complete the Work Effort, taking into consideration quantities which are expected to be scrapped before consumption, or consumed but then scrapped due to expected yield losses. Upon completion of the Work Effort, any excess material which is still in useable condition can be returned from the staging location before the staged quantities are consumed. On the other hand, if actual scrap exceeds expectation or actual yield falls below expectation, and the Work Effort is fully completed as originally intended, it will be necessary to manually increase the quantity_required for the affected components, and stage additional material, before the Work Effort can be completed.

FieldTypeDescription
work_effort_id number Links to an entry on the WORK_EFFORT table.
seq_no number Sequence number generated by the system.
product_id string The identity of the component Product. Links to an entry on the PRODUCT table.
revision_id string Optional. The identity of the component Revision. Together with product_id, links to an entry on the PRODUCT_REVISION table. Required if the component Product is revision-controlled.
quantity_required number The quantity of this component required to complete this Work Effort. This includes any material which is expected or known to be scrapped before consumption, or consumed but then scrapped due to expected or known yield losses.
quantity_staged number Optional. The quantity of this component which has been staged for this Work Effort. The entire quantity_required must be staged before it can be consumed or scrapped as the work is completed.

Timesheets

Timesheets are used to record the number of hours worked by a particular party on a particular work effort. Each timesheet covers a whole week for a single party, with separate entries for each day and each work effort. Timesheet details can be entered at the end of each day, but should be completed by the end of the working week which is a Friday.

Figure 2 - Timesheets

work-effort-02 (2K)

ASSIGNMENT_ROLE table

This identifies a party's role when assigned to a work effort.

FieldTypeDescription
assignment_role_id string Identity
assignment_role_desc string Description

Here are some examples:

WORK_EFFORT_PARTY table

This identifies those parties who can be assigned to take part in work efforts. This is a subset of all those entries which exist on the PARTY table, and may be a person as well as an organisation.

FieldTypeDescription
party_id number Links to an entry on the PARTY table.
party_type string Possible choices are:
  • Employee
  • Contractor
start_date date Identifies the date on which this party was or will be eligible to be given work effort assignments.
end_date date Optional. Identifies the date on which this eligibility ended or is due to end.
cost_per_hour numeric Optional. The estimated cost per hour for the party_id to carry out work efforts.
currency_code string Optional. The currency in which the cost_per_hour is denominated. Links to an entry on the CURRENCY_CODE table. An entry is required if cost_per_hour is not blank.

WORK_EFFORT_ASSIGNMENT table

This identifies those parties who are assigned to work on particular work efforts, and in what roles. A party may be assigned to the same work effort more than once, either to cover different time periods or different roles. Each assignment may be carried out at a particular location or facility.

A party may only create timesheet entries for those work efforts for which there is a current assignment record.

FieldTypeDescription
party_id number Links to an entry on the WORK_EFFORT_PARTY table.
work_effort_id number Links to an entry on the WORK_EFFORT table.
seq_no number Sequence number which is automatically generated by the system.
assignment_role_id string Links to an entry on the ASSIGNMENT_ROLE table.
facility_id number Optional. Links to an entry on the FACILITY table. Identifies where this work effort will take place.
start_date datetime Identifies the date on which this party was or will be assigned to this work effort.
end_date datetime Optional. Identifies the date on which this assignment ended or is due to end.
estimated_hours numeric Optional. While the WORK_EFFORT table provides a total value, this identifies a value which applies only to this party.
assignment_comment string Optional comment on this party's assignment.
party_id_internal numeric The party who assigned the work effort to the party_id. This identifies the party for whom the work is performed. Links to an entry on the PARTY table.
order_type string Optional. Links to an entry on the ORDER_ITEM table. An entry of 'P' (purchase order) is allowed only if the party_type is 'Contractor'.
order_id numeric Optional. Links to an entry on the ORDER_ITEM table. An entry is allowed only if the party_type is 'Contractor'.
order_item_seq_no numeric Optional. Links to an entry on the ORDER_ITEM table. An entry is allowed only if the party_type is 'Contractor'.

TIMESHEET table

This identifies a grouping of timesheet entries for a particular party for a particular week.

Amendments can only take place while the status is 'pending'. When the details are complete for the week the status should be updated from 'pending' to 'submitted', after which it can be reviewed by a manager/supervisor before being changed to 'approved'.

FieldTypeDescription
party_id number Links to an entry on the WORK_EFFORT_PARTY table.
timesheet_id number Identity number which is automatically generated by the system.
week_ending_date date Identifies the week which is covered by this timesheet.
timesheet_status string The status of this timesheet. Possible values are:
  • Pending
  • Submitted
  • Approved
timesheet_comment string Optional comment.
The following fields are display only, and are used only when posting to the General Ledger subsystem.
is_postable boolean A YES/NO switch with an initial value of NO. Indicates if the timesheet is associated with an event which triggers the creation and posting of journal entries, or not. Set to YES by the system if:
is_posted boolean A YES/NO switch with an initial value of NO. Indicates if a journal entry has been created and posted for the variance, or not. Once is_posted is YES for a timesheet, the timesheet cannot be posted again.
posting_date date Optional. This is the date which determines the fiscal period affected by the timesheet. Blank if is_postable is NO and is_posted is NO.
fiscal_calendar_id numeric Optional. This identifies the fiscal calendar. Links to an entry on the FISCAL_CALENDAR_PERIOD table. Blank if is_postable is NO or is_posted is NO.
fiscal_year number Optional. This identifies the Gregorian year when the end of the fiscal year occurs for this posting_date. Links to an entry on the FISCAL_CALENDAR_PERIOD table. Blank if is_postable is NO or is_posted is NO.
fiscal_period number Optional. This identifies the fiscal period for this posting_date. Links to an entry on the FISCAL_CALENDAR_PERIOD table. Blank if is_postable is NO or is_posted is NO.
party_id_functional number Optional. This identifies the functional unit to which party_id belongs. Blank if is_postable is NO or is_posted is NO. Links to an entry on the JOURNAL_ENTRY_HEADER table.
journal_number number Optional. This is the journal entry number which is generated by the system. Blank if is_postable is NO or is_posted is NO. Links to an entry on the JOURNAL_ENTRY_HEADER table.

TIMESHEET_ENTRY table

This identifies the number of hours worked by a particular party for a particular work effort on a particular date. Although there is a separate entry for each day the online screens will show all entries for the same week in a single group.

When a timesheet is approved all the hours spent are accumulated in the actual_hours value for the relevant WORK_EFFORT.

FieldTypeDescription
timesheet_id number Links to an entry on the TIMESHEET table.
work_effort_id number Links to an entry on the WORK_EFFORT and WORK_EFFORT_ASSIGNMENT tables.
seq_no number Links to an entry on the WORK_EFFORT_ASSIGNMENT table. This is because it is possible for a user to have more than one assignment_role_id in a WORK_EFFORT.
day_no number Identifies the day-of-week for this entry where 1=Monday and 7=Sunday.
entry_date datetime Identifies the date on which this entry applies.
hours number Identifies the number of hours spent on this work effort on this date. Note that records will zero hours will not be written to the database.
entry_comment string Optional comment.

NOTE: The link to the WORK_EFFORT_ASSIGNMENT table requires the party_id from the parent TIMESHEET table.

TIMESHEET_ROLE_TYPE table

This identifies the various roles which parties may have in relation to timesheets.

FieldTypeDescription
timesheet_role_type_id string Identity
timesheet_role_type_desc string Description

Here are some examples:

TIMESHEET_ROLE table

This identifies the various parties that may be associated with a particular timesheet, and their roles.

FieldTypeDescription
timesheet_id number Links to an entry on the TIMESHEET table.
timesheet_role_type_id string Links to an entry on the TIMESHEET_ROLE_TYPE table.
party_id number Links to an entry on the WORK_EFFORT_PARTY table.

Expenses

As well as recording the number of hours worked against a work effort it may also be necessary to record any expenses which were incurred.

Figure 3 - Expenses

work-effort-03 (2K)

EXPENSE_TYPE table

This identifies the various types of expense item which may be recorded. Some types may also require the input of a quantity. For example, to claim travel expenses at so much per mile it is necessary to input the number of miles.

FieldTypeDescription
expense_type_id string Identity
expense_type_desc string Description
quantity_reqd boolean Indicates if an expense entry of this type requires a value for quantity.
uom_id string Optional. Links to an entry on the UNIT_OF_MEASURE table. If quantity_reqd is TRUE then this indicates the units in which the quantity is measured.

EXPENSE_ITEM table

This identifies a particular item of expenditure that was incurred against a particular work item by a particular party on a particular date.

An item may need to be reimbursed to the originating party, and may also need to be recharged to the client with or without a percentage markup.

Amendments can only take place while the status is 'pending'. When the details have been entered and checked the status should be updated from 'pending' to 'submitted', after which it can be reviewed by a manager/supervisor before being changed to 'approved'.

Expense amounts always have values which are expressed in the party's functional currency but may be entered in a different currency known as the transaction currency, in which case an exchange rate must also be provided. For a description of the multi-currency features please refer to FAQ04.

FieldTypeDescription
expense_id number Identity number which is generated automatically by the system.
expense_desc string Description
expense_type_id string Links to an entry on the EXPENSE_TYPE table.
party_id number Links to an entry on the WORK_EFFORT_PARTY table. This identifies the person on whose behalf this expense item is being raised.
party_id_functional number Links to an entry on the PARTY table. This identifies the Functional Unit to which this person belongs.
work_effort_id number Links to an entry on the WORK_EFFORT table.
expense_date date Date on which this expense was incurred.
expense_status string The status of this expense item. Possible values are:
  • Pending
  • Submitted
  • Approved
quantity number Only required if the expense_type_id specifies it.
amount_net number The net amount being claimed. This is the value in home currency.
amount_tax number Optional. The amount of tax in the amount being claimed. This is the value in home currency.
markup number Optional. The percentage markup before this amount is reclaimed from the client.
reimburse boolean Indicates if this amount is to be reimbursed to the claiming party.
charge_to_client boolean Indicates if this expense item should be reclaimed from the client.
ref_number string Optional. A reference number or purchase order number.
is_invoiced boolean Indicates if this item has been invoiced or not. The initial value is 'N'. Invoicing of expense entries requires an entry on the WORK_EFFORT_ORDER_ITEM table. Once an expense entry has been included in an invoice the value is changed to 'Y'.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
currency_code string Links to an entry on the CURRENCY_CODE table. This identifies the transaction currency. This defaults to the operating/home currency of the party identified in party_id_functional, but may be changed by the user.
exchange_rate number Optional. The exchange rate which allows values to be converted from functional currency to transaction currency. This is only required if the two currencies are different.
amount_net_tx number This is the same as amount_net, but expressed in transaction currency.
amount_tax_tx number This is the same as amount_tax, but expressed in transaction currency.
The following fields are display only, and are used only when posting to the Accounts Payable or Accounts Receivable subsystems.
is_postable boolean A YES/NO switch with an initial value of NO. Indicates if the expense item is associated with an event which triggers the creation and posting of invoices, or not. Set to YES by the system if the party_id_functional exists on the FUNCTIONAL_UNIT table.
is_posted boolean A YES/NO switch with an initial value of NO. Indicates if a Vendor Invoice or Customer Invoice has been created and posted for the expense item, or not. Once is_posted is YES for an expense item, the expense item cannot be posted again.
posting_date date Optional. This is the date which determines the fiscal period affected by this expense item. Blank if is_postable is NO, is_posted is NO, or both reimburse and charge_to_client are NO.
invoice_type_v string Optional. Links to an entry on the INVOICE_ITEM table. Blank if is_postable is NO, is_posted is NO, or reimburse is NO; otherwise 'V' denoting Vendor Invoice.
invoice_id_v number Optional. This is the corresponding vendor invoice number which is generated by the system. Links to an entry on the INVOICE_ITEM table. Blank if is_postable is NO, is_posted is NO, or reimburse is NO.
invoice_item_seq_no_v number Optional. This is the corresponding vendor invoice number which is generated by the system. Links to an entry on the INVOICE_ITEM table. Blank if is_postable is NO, is_posted is NO, or reimburse is NO.
invoice_type_c string Optional. Links to an entry on the INVOICE_ITEM table. Blank if is_postable is NO, is_posted is NO, or INVOICE_ITEM is NO; otherwise 'I' denoting Customer Invoice.
invoice_id_c number Optional. This is the corresponding vendor invoice number which is generated by the system. Links to an entry on the INVOICE_ITEM table. Blank if is_postable is NO, is_posted is NO, or charge_to_client is NO.
invoice_item_seq_no_c number Optional. This is the corresponding vendor invoice item sequence number which is generated by the system. Links to an entry on the INVOICE_ITEM table. Blank if is_postable is NO, is_posted is NO, or charge_to_client is NO.

Events

This identifies when a particular event occurred, who completed it, and optionally how long it took.It differs from a TIMESHEET_ENTRY in that it can show how many times an event occurred in a day rather than just the total time taken for that event.

There is an optional link to the ITEM_RECEIPT table whichs allows an event, such as a process or operation which adds to inventory, to be linked with that inventory event.

Figure 4 - Events

work-effort-04 (1K)

EVENT table

This shows when an event (operation or process) took place, who performed it, and optionally how long it took.

FieldTypeDescription
event_id number Identity number generated by the system.
timesheet_id number Links to an entry on the TIMESHEET_ENTRY table. This identifies the person who completed the event.
work_effort_id number Links to an entry on the TIMESHEET_ENTRY and WORK_EFFORT tables. This identifies the operation that took place.
day_no number Links to an entry on the TIMESHEET_ENTRY table. Identifies the day-of-week for this entry where 1=Monday and 7=Sunday.
start_time time Optional. The start time for this event. If entered can be used to calculate the time taken to complete this event.
end_time time The actual time on which this event was completed. Defaults to the current time.
item_receipt_id number Optional. Links to an entry on the ITEM_RECEIPT table. This is the result of a process or operation which causes new stock to be added to inventory.
entry_comment string Optional. A comment regarding this event.

 


Constructing Journal Entries for Timesheets

The wrk_timesheet(upd4)post and wrk_timesheet(batch)post tasks will create JOURNAL_ENTRY_HEADER from the TIMESHEET, and JOURNAL_ENTRY_ITEM entries from the TIMESHEET_ENTRY entries related to each selected or qualified TIMESHEET entry

A timesheet cannot be posted to the General Ledger unless the TIMESHEET entry has the following values:

After the timesheet has been posted the is_posted column is set to 'Y' so that it cannot be posted again.

JOURNAL_ENTRY_HEADER (timesheets)

The following table shows the field mappings for constructing JOURNAL_ENTRY_HEADER entries.

JOURNAL_ENTRY_HEADER Document Component or Constant
party_id_functional Refer Note 1, below
fiscal_calendar_id fiscal_calendar_id
fiscal_year fiscal_year
fiscal_period fiscal_period
journal_number Refer Note 2, below
posting_date posting_date. Refer Note 3, below
transaction_date transaction_date. Refer Note 3, below
journal_desc journal_desc
uom_id_statistic uom_id_statistic
recurring_je_number NULL
processing_seq NULL
repeat_count NULL
je_status_type_id 'PEND'
is_posted 'N'
subsys_id 'WORK-EFFORT'
je_template_id Refer Note 4, below
  1. From the value of party_id_functional on the TIMESHEET entry.
  2. Automatically generated by the system when inserting a new journal entry into the database.
  3. Will be set to posting_date on the TIMESHEET entry if non-blank, otherwise today's date.
  4. From the je_template_id_invoice field on either of the following:

JOURNAL_ENTRY_ITEM (timesheets)

The following table shows the field mappings for constructing JOURNAL_ENTRY_ITEM entries.

JOURNAL_ENTRY_ITEM Document Component or Constant
party_id_functional Refer Note 1, above
fiscal_calendar_id fiscal_calendar_id
fiscal_year fiscal_year
fiscal_period fiscal_period
journal_number journal_number. Refer Note 2, above
journal_line_item journal_line_item. Refer Note 2, above
journal_item_desc journal_item_desc
party_id_transacting Refer Note 5, below
document_reference Refer Note 6, below
chart_id chart_id
account_id account_id
debit_functional debit_functional. Refer Note 7, below
credit_functional credit_functional. Refer Note 7, below
statistic statistic. Refer Note 7, below
uom_id_statistic uom_id_statistic
order_type order_type. Refer Note 8, below
order_id order_id. Refer Note 8, below
order_item_seq_no order_item_seq_no. Refer Note 8, below
schedule_id schedule_id. Refer Note 9, below
activity_seq_no schedule_seq_no. Refer Note 9, below
timesheet_id timesheet_id
work_effort_id work_effort_id
day_no day_no
event_id event_id. Refer Note 10, below
asset_id asset_id. Refer Note 11, below
asset_seq_no asset_seq_no. Refer Note 12, below
<all other fields>
(except created_date and created_user)
NULL
  1. From the value of party_id on the TIMESHEET entry.
  2. When constructing a Segment 1a for the 'sales_service' account usage, this value comes from the value of po_number on the ORDER_HEADER entry linked to the WORK_EFFORT_ORDER_ITEM entry; otherwise this entry is blank.
  3. These values accumulate for summary journal entries (refer to is_summary_journal Property, below).
  4. These come from one of the following:
  5. These values come from the values of schedule_id and schedule_seq_no (if any) on the WORK_EFFORT entry linked to work_effort_id on TIMESHEET_ENTRY.
  6. These values come from the value of event_id on the EVENT entry linked to the TIMESHEET_ENTRY by way of the timesheet_id, work_effort_id and day_no values.
  7. This value comes from the value of asset_id (if any) on the WORK_EFFORT entry linked to work_effort_id on TIMESHEET_ENTRY.
  8. This value comes from the value of asset_seq_no on the ASSET_BOOK_EVENT entry that is created when the TIMESHEET_ENTRY concerns the construction or servicing of an asset.

Journal Entries constructed for timesheets

Journal entries constructed from timesheet entries can have as many as 2 segments. Segment 1 is required, and Segment 2 is optional depending upon the circumstances described below.

SegmentOptionFirst Side Column UsageContra Column Usage
1 a. Revenue, Work in Progress and Direct Cost direct_labour accrued_expense
wip sales_service
b. Indirect Expense, Inventory and Acquisition of Other Assets auc
inventory
staff_indirect_other
(see Note 1 below)
accrued_expense
2 Employer Pension Expense pension_expense pension_payable

Note 1: the account to use depends on the value of the accrual_type field in the FUNC_UNIT_WRK_EFF_PURPOSE table.

The amounts will be recorded in the JOURNAL_ENTRY_ITEM table after converting the account usage into a chart_id and account_id using the procedure described in Determine the account_id from an account_usage value. Note that the detailed entries may need to be consolidated into summary entries as described in is_summary_journal Property.


Segment 1a - Revenue, Work in Progress and Direct Cost

A separate Segment 1a is constructed for each qualifying timesheet item. A timesheet item is a row on the TIMESHEET_ENTRY table which is linked to the current TIMESHEET. An entry qualifies if it meets the following conditions:

Note that all entries on the TIMESHEET_ENTRY table will have a non-zero value for hours. Entries with a zero value will not be written to the database.

If an entry on the ORDER_ITEM table exists then a lookup must be performed on the AR_PARTY_RELATIONSHIP table using the following values:

If the AR_PARTY_RELATIONSHIP record contains a value for je_template_id_invoice then this must be used to retrieve data from the SUBSYSTEM_JE_TEMPLATE_HEADER and SUBSYSTEM_JE_TEMPLATE_ITEM tables.

  1. Monetary amounts for the 'direct_labour' and 'accrued_expense' accounts are based upon standard cost per hour and are calculated as follows:
    1. Obtain a value for cost_per_unit using the procedure identified in Lookup Product Cost.
    2. If the uom_id for the product_id on the ORDER_ITEM is *NOT* 'HOUR' or 'EACH' then convert the hours value on the TIMESHEET_ENTRY record using an entry on the UOM_CONVERSION table, where uom_id_to is the uom_id for the product_id on the ORDER_ITEM, and uom_id_from is 'HOUR'. If no conversion_factor exists then display the error message "Cannot find factor to convert from 'xxx' to 'yyy'".
    3. Calculate the monetary amount for 'direct_labour' and 'accrued_expense' as: hours x cost_per_unit (after converting hours, if necessary, at Step 1b above) and then round the result to the scale of the functional currency from the CURRENCY_CODE table.
    4. If this amount calculated at Step 1c is greater than zero then do the following:
      • Create a debit (DR) entry for the 'direct_labour' account.
      • Create a credit (CR) entry for the 'accrued_expense' account.
      • Create a statistical quantity entry for the 'direct_labour' account using hours on the TIMESHEET_ENTRY (before converting hours at Step 1b above).
  2. Monetary amounts for the 'sales_service' and 'wip' accounts are based upon the adjusted item price per hour and are calculated as follows:
    1. If the quantity on the ORDER_ITEM is 1 and the uom_id for the product_id on the ORDER_ITEM is 'EACH' then:
      1. Calculate the amount to be posted using the procedure described in Fixed-Fee Services.
      2. Skip to Step 2c below.
    2. ELSE
      1. If the uom_id for the product_id on the ORDER_ITEM is *NOT* 'HOUR' then perform the conversion as per Step 1b above.
      2. Calculate the monetary amount for 'sales_service' and 'wip' as: hours x adjusted_price (after converting hours, if necessary), round the result to the scale of the functional currency from the CURRENCY_CODE table.
      3. Skip to Step 2c below.
    3. If this amount calculated at Step 2a or 2b is greater than zero then do the following:
      • Create a debit (DR) entry for the 'wip' account.
      • Create a credit (CR) entry for the 'sales_service' account.
      • Create a statistical quantity entry for the 'sales_service' account using hours on the TIMESHEET_ENTRY (before converting hours at Step 1b above).

Segment 1b - Indirect Expense, Inventory and Acquisition of Other Assets

A separate Segment 1b is constructed for each qualifying timesheet item. A timesheet item is a row on the TIMESHEET_ENTRY table which is linked to the current TIMESHEET. An entry qualifies if it meets the following conditions:

If an entry on the ORDER_ITEM table exists then a lookup must be performed on the AP_PARTY_RELATIONSHIP table using the following values:

If the AP_PARTY_RELATIONSHIP record contains a value for je_template_id_invoice then this must be used to retrieve data from the SUBSYSTEM_JE_TEMPLATE_HEADER and SUBSYSTEM_JE_TEMPLATE_ITEM tables.

Monetary amounts for the 'auc', 'inventory' or 'staff_indirect_other' and 'accrued_expense' accounts are based upon estimated cost per hour and are calculated as follows:

  1. If the value of party_type is 'Contractor' on the WORK_EFFORT_PARTY entry for the party_id on the TIMESHEET table, then:
    1. If the order_type, order_id and order_item_seq_no on the WORK_EFFORT_ASSIGNMENT entry are blank then skip to Step 2 below.
    2. If the quantity on the ORDER_ITEM is 1 and the uom_id for the product_id on the ORDER_ITEM is 'EACH' then:
      1. Calculate the amount to be posted using the procedure described in Fixed-Fee Services.
      2. Skip to step 4 below.
    3. ELSE:
      1. If the uom_id for the product_id on the ORDER_ITEM is *NOT* 'HOUR' then convert the hours value on the TIMESHEET_ENTRY record using an entry on the UOM_CONVERSION table, where uom_id_to is the uom_id for the product_id on the ORDER_ITEM, and uom_id_from is 'HOUR'. If no conversion_factor exists then display the error message "Cannot find factor to convert from 'xxx' to 'yyy'".
      2. Calculate the monetary amount for 'auc', 'inventory' or 'staff_indirect_other' and 'accrued_expense' as: hours x adjusted_price (after converting hours, if necessary), and then round the result to the scale of the functional currency from the CURRENCY_CODE table.
      3. Skip to Step 4, below.
  2. ELSE If cost_per_hour is not blank on the WORK_EFFORT_PARTY entry for the party_id on the TIMESHEET table, then:
    1. Use the cost_per_hour value on the WORK_EFFORT_PARTY entry for the party_id on the TIMESHEET table. This value is denominated in the currency_code on that WORK_EFFORT_PARTY entry.
    2. If the currency_code differs from the functional currency then convert cost_per_hour into functional currency using an EXCHANGE_RATE table lookup FROM the currency_code TO the functional currency as at the entry_date.
    3. Calculate the monetary amount for 'auc', 'inventory' or 'staff_indirect_other' and 'accrued_expense' as: hours x cost_per_hour (after converting cost_per_hour to functional currency, if necessary) and then round the result to the scale of the functional currency from the CURRENCY_CODE table.
    4. Skip to Step 4, below.
  3. ELSE If cost_per_hour is blank on the WORK_EFFORT_PARTY entry for the party_id on the TIMESHEET table, then output an error message saying "No cost is available for Timesheet xxx, Work Effort yyy".
  4. If this amount calculated at Step 1b, 1c or 2 above is greater than zero then do the following:

Segment 2 - Employer Pension Expense

This segment accounts for any employer-paid pension expenses incurred and accrued when parties perform work efforts.

To convert the 'pension_expense' and 'pension_payable' account usages into their respective account_id values, search records in the following sequence:

Records are only written to the JOURNAL_ENTRY_ITEM table for each TIMESHEET_ENTRY if the following conditions are met:

The monetary amount posted as a debit (DR) entry to the 'pension_expense' and a credit (CR) entry to the 'pension_payable' accounts are the same values that were posted to one of the following:

Each of these amounts must be multiplied by the value of the pension_percent field.


Lookup Product Cost

This uses values for VALUATION_TYPE, COST_ELEMENT_ID and PRODUCT_BOM_TYPE which are defined in Accounts Payable Control Data.

Lookup on the PRODUCT_COST table using the following:

If the currency_code_costing differs from the functional currency then convert cost_per_unit into functional currency using an EXCHANGE_RATE table lookup FROM the currency_code_costing TO the functional currency as at the entry_date.


Determine the account_id from an account_usage value

This procedure is used to convert an account_usage into an account_id. This value may be provided on any one of a number of records which must be searched in the following sequence:

  1. SUBSYSTEM_JE_TEMPLATE_ITEM using the je_template_id_invoice from one of the following (if it exists):
  2. FUNC_UNIT_PRICE_COMPONENT (if a value for price_component_id exists)
  3. FUNC_UNIT_PROD_CAT (if a value for prod_cat_id exists - note that an ORDER_ITEM may provide more than one value, in which case only the first account_id will be used)
  4. FUNCTIONAL_UNIT table.

Note that some of these tables can only be read if the input record from the ORDER subsystem contains the primary key for that table.

As soon as the first non-blank value for account_id is found then the account determination process will be terminated. If at the end there is no value for account_id then thean error message "Cannot determine account_id for usage 'xxx'" will be produced.

Please note the following exceptions for Segment 1a:

Please note the following exceptions for Segment 1b:

Please note the following exceptions for Segment 2:


Fixed-Fee Services

This procedure is used for services provided on a fixed-fee basis which is signified when the quantity on the ORDER_ITEM entry is 1 and the uom_id is 'EACH'. It is used to reduce the amount which will be posted to the Ledger so that is does not exceed the adjusted_price on the ORDER_ITEM entry.

  1. Calculate the accrued revenue and hours by accumulating the monetary amounts and hours previously posted to the 'sales_service' account for this WORK_EFFORT entry.
  2. Calculate the remaining amount by subtracting accrued revenue from the adjusted_price on the ORDER_ITEM entry.
  3. Calculate the estimated hourly rate as: adjusted_price / estimated_hours on the WORK_EFFORT entry.
  4. Calculate the monetary amount as the estimated hourly rate (from step 3 above) x hours (on the TIMESHEET_ENTRY record), and then round the result to the scale of the functional currency from the CURRENCY_CODE table.
  5. The monetary amount is the amount calculated at Step 4, above, or the remaining amount calculated at Step 2, above, whichever is less.
  6. Calculate the remaining hours by subtracting accumulated hours from estimated_hours on the WORK_EFFORT entry.
  7. The statistical quantity is hours on the TIMESHEET_ENTRY (before converting hours at Step 1, above) or the remaining hours (from step 6, above), whichever is less.

is_summary_journal Property

By default the value of is_summary_journal is 'NO'. When wrk_timesheet(upd4)post is run it will remain at 'NO'. When wrk_timesheet(batch)post is runit may be set to 'YES' if the conditions identified in point #1 of Determine the account_id from an account_usage value identify a record on the SUBSYSTEM_JE_TEMPLATE_HEADER table with a different value for is_summary_journal.

Following the processing described for Segment 1a, Segment 1b and Segment 2 all records destined for the JOURNAL_ENTRY_ITEM table will exist in memory. If the value for is_summary_journal has been changed to 'YES' then these records will need to be consolidated so that only one record is produced for each account_id. This will invovle accumulating the values for debit_functional, credit_functional and statistic. Thus instead of having separate sets of records for each day these will be consolidated into a single set of records for the entire week.


Date created: 3rd September 2007

Amendment history:

13 Oct 2023 Added the WORK_EFFORT_COMPONENT table.
08 May 2023 Added Constructing Journal Entries for Timesheets.
13 Apr 2023 Updated the EXPENSE_ITEM table to include the is_postable, is_posted, posting_date, invoice_type_v, invoice_id_v, invoice_item_seq_no_v, invoice_type_c, invoice_id_c and invoice_item_seq_no_c columns.
Updated the TIMESHEET table to include the is_postable, is_posted, posting_date, fiscal_calendar_id, fiscal_year, fiscal_period and journal_number columns.
Updated the TIMESHEET_ENTRY table to include the seq_no column.
Updated the WORK_EFFORT table to include the asset_id column.
Updated the WORK_EFFORT_ASSIGNMENT table to include the party_id_internal, order_type, order_id and order_item_seq_no columns.
Updated the WORK_EFFORT_PARTY table to include the cost_per_hour and currency_code columns.
06 May 2018 Updated the EXPENSE_ITEM table to include the party_id_functional column.
Updated the EXPENSE_ITEM table to remove the currency_code_fn column.
29 Apr 2018 Updated the EXPENSE_TYPE table to replace the unit_of_measure column with uom_id.
01 May 2016 Added the EVENT table.
22 Sep 2014 Amended the WORK_EFFORT table to include invoiced_hours, schedule_id and schedule_seq_no.
Amended the EXPENSE_ITEM table to include is_invoiced, currency_code, currency_code_fn, exchange_rate, amount_net_tx and amount_tax_tx.
Added the WORK_EFFORT_ORDER_ITEM table
23 Aug 2014 Amended the WORK_EFFORT table to include work_effort_status_type_id and party_id_private.
Amended the WORK_EFFORT_STATUS_TYPE table to include email_template and is_email_auto.
16 Jul 2014 Amended the WORK_EFFORT_ASSIGNMENT table to include estimated_hours and is_all_day_event.

Copyright © 1999-2023 by Geoprise Technologies Licensing, All Rights Reserved.