Occupation Management Process
Learn to manage occupation.
Overview
Basically the occupation management process can be used by every user to create records for a month (A032 record). Below there are B2 records which represents single days. To each day there can be added random B4 records, which represent expenses receipts.
There is a 1-n link between A032 and B2; B2 and B4 in the data model.
Callable from
- Application menu > Daily business > Occupation Management
- Management start page
Buttons
- TE_A032_ApproveMonth [CRM: (70000700)]
Calls the “TE_A032_UPD_ReleaseExpenses” trigger. Is used in the search result header on the start page to set a submitted month to “approved”.
-
TE_A032_ExpensesManagement_Back [CRM: (70000700)]
Execute the “Command” action template with the “Proceed.Back” command. This command is used on several masks within the process to jump back a process step.
-
TE_A032_ExpensesManagement_New [CRM: (70000700)]
Calls the “TE_A032_Expenses_SelectYearAndMonth” form to create a new month in the process phase.
-
TE_A032_ExpReport [CRM: (70000700)]
Calls the “TE_A032_ExpReport” query and creates the report as PDF in a separate browser tab.
-
TE_A032_RejectMonth [CRM: (70000700)]
Calls the “TE_A032_UPD_RejectExpenses” trigger. Is used in the search result header on the start page to set a submitted month to “rejected”.
-
TE_B2_ExpensesManagement_Submit [CRM: (70000700)]
Calls the “u8.TeLSI.QueryStates.checkSubmitPermission($.source)” JS function. This function calls the “TE_A032_SetStatusToSubmitted” trigger which sets the A032 approval status to submitted.
-
TE_A032_UpdateRecords [CRM: (70000700)]
Calls the “u8.TeLSI.QueryStates.updateB2reocrds()”JS function. This function calls the “TE_Expenses - Update Records_v3” workflow.
-
TE_B2_ExpensesManagement_UpdateRecords [CRM: (70000700)]
Calls the “TE_Expenses - Fill Occupation” workflow. This workflow updates all existing A3, U011 and MA records to the selected month in phase 2.
-
TE_B4_NewFromExpensesManagement [CRM: (70000700)]
Executes the “Command” action template with the “Proceed.NewB4” command. This command is used in phase 2 if a user wants to create a new receipt.
Menu Actions
-
TE_ID_NET_ExpensesManagement [CRM: (70000700)]
The main application menu action which is used in application menu for calling the
“TE_A032_ExpensesManagement” process.
-
CORE_A_B2_Workflow_CreateMonth [CRM: (70000700)]
Calls the “CORE_A023_Generate_B2_for_Month” workflow. This workflow creates an A032 record and all B2 child records.
-
TE_A_A032_CallTriggerSubmit [CRM: (70000700)]
Calls the “TE_A032_SetStatusToSubmitted” trigger. This trigger is used in the
“checkSubmitPermission” JS function and sets the status of an A032 record to submitted.
-
TE_A_A032_ChekSubmitPermission [CRM: (70000700)]
Calls the “u8.TeLSI.QueryStates.checkSubmitPermission” JS function. Action for checking if A032 records have been created by the currently logged in user. An error message is displayed if this is not the case. TE_A_A032_ClosePopUp
-
TE_A_A032_OpenRecord [CRM: (70000700)]
Execute the “Command” action template with the “Proceed.OpenA032” Command. This command is used in phases 1 and 3 to open A032 records by double-clicking or opening the action in the context menu within the process as a separate step.
-
TE_A_A032_OpenRecordInProcess [CRM: (70000700)]
The main context menu action which is used in the context menu for calling the “TE_A032_ExpensesManagement” process.
-
TE_A_B2_UpdateRecords [CRM: (70000700)]
Action which is executing the 'TE_Expenses - Update Records_v3' workflow to update all current B2 records with Activities (MA), Other Appointments (A3) and Call Expenses (U011).
-
TE_A_B4_OpenFromExpensesManagement [CRM: (70000700)]
Action which is executing the 'Proceed.OpenB4' command which is used in the expenses management process to open B4 records from sublist.
Filters
-
A032.TE_A032_Expenses_Phase1
Used in process phase 1 to show only new and rejected months.
-
A032.TE_A032_Expenses_Phase3
Used in process phase 3 to show only approved and submitted months.
-
A032.TE_ExpensesToApprove
Used on the start page for superior to filter the list of months which must be approved.
Queries
• TE_A032_ExpReport
• TE_A032_MyExpensesApprovals
• TE_Report_WPR_Expenses
Processes
• TE_A032_Expenses
Process Storage Variables
Name | Description |
---|---|
activePhase | This variable is used in the initial step of each phase. It is used to handle which phase are displayed as active phase. |
TXTphase1 |
$t('TXT_TE_ExpensesManagement_18') Get value from the TE_ExpensesManagement text group at index 18 (“Rejected months:”) |
TXTphase2 |
$t('TXT_TE_ExpensesManagement_7') Get value from the TE_ExpensesManagement text group at index 7 (“Entered days:”) |
TXTphase3 |
$t('TXT_TE_ExpensesManagement_19') Get value from the TE_ExpensesManagement text group at index 19 (“Approved months:”) |
curRepName | This variable includes the currently logged in user name. u8.session.identity.repName |
processMetric_getOpe nA032 | This variable includes the number of records from the result of the query in data provider getOpenA032forProcessMetric. With $.getNumberOfRows() the records are counted and set to processMetric_getOpen variable. |
phaseMetric_getRejec tedA032 | This variable includes the number of records from the result of the query in data provider getA032forProcessPhase3. With $.getNumberOfRows() the records are counted and set to phaseMetric_getRejectedA032 variable. Will be used in phase 3 in phase metric. |
TXTprocess1 |
$t('TXT_TE_ExpensesManagement_8') Get value from the TE_ExpensesManagement text group at index 8 (“Receipts approved:”) |
TXTprocess2 |
$t('TXT_TE_ExpensesManagement_6') Get value from the TE_ExpensesManagement text group at index 6 (“Open months:”) |
TXTprocess3 |
$t('TXT_TE_ExpensesManagement_9') Get value from the TE_ExpensesManagement text group at index 9 (“Receipts submitted:”) |
ParentRecord | The record Uid is set from the input message to the process storage. It is available in every step of the process. |
Process Metrics
View | Description |
---|---|
Text | $.get("TXTprocess2")+" "+$.get("processMetric_getOpenA032") |
Text | $.get("TXTprocess1") |
Text | $.get("TXTprocess3") |
Data Provider
Name | Description |
---|---|
Text | This data provider is using the UsingDataProvider action template and loads the TE_ExpensesManagement designer text group which includes all necessary texts for the process. |
getOpenA032forProce ssMetric | This data provider is using the ExecuteQueryDataProvider action template and executes the “select (RecCount) from (A032) where (F6000="$curRep" AND F6007<>"#9" AND F6007<>"#10" AND F6007<>"#7")” query statement. This query selects the number of records where the field user is the currently logged in user and approval status is not rejected, approved and submitted. It is used for the process metric on the right side of the process header to display all open months. |
getA032forProcessPha se3 |
Process Phases
- Expenses_Create
The first phase is active and is displayed as active phase if the activePhase variable is “1”. The phase can be activated by clicking without a condition. Therefore, the condition is set to “true” which means that it can be activated anytime.
The phase metric is composed of two values from the process storage. The text Rejected months: and the value of the count_openA032Phase1 variable from the process storage is displayed.
-
Expenses_Edit
The second phase is active and is displayed as active phase if the activePhase variable is “2”.
The phase can be activated if a record in phase 1 is selected or if a user selects a record from the list on the start page.
The phase metric is composed of two values from the process storage. The text Rejected months: and the value of the count_openA032Phase1 variable from the process storage is displayed.
-
Expenses_Check
The third phase is active and is displayed as active phase if the activePhase variable is “3”. The phase can be activated by clicking without a condition. Therefore, the condition is set to “true” which means that it can be activated anytime.
The phase metric is composed of two values from the process storage. The text Approved months: and the value of the phaseMetric_getRejectedA032 variable from the process storage is displayed.
Process steps
• TE_A032_Create_Initial
This is a $nop step. It is used to retrieve the number of all rejected months which is displayed in the phase metric in Phase 1. Therefore a separate data provider is defined. It executes a query which delivers all records which match the following condition: select (RecCount) from (A032) where (F6000="$curRep" AND F6007="#9").
You can select any field of the A032 info area because you only need the records to count them afterwards. F6000 (User) is currently the logged in user and F6007 (approval status) is rejected.
If a new data provider is defined it needs to be initialized before further operations is executed. Therefore a new variable (any name) with the new data provider as the source is set to null. In this case the Init variable is set to null.
The activePhase variable is used to handle which phase is shown as active phase. As the user can switch between the phases without any conditions, each phase defines this variable in it’s initial step. In this case it is set to 1 because the first phase should be displayed as the active phase. The count_openA032Phase1 variable includes the result of the data provider query action. With getNumberOfRows() all records is counted and summed up to this variable. It is pushed to the process storage in order to access it in every point of the process.
This step dispatches to the TE_A032_Calculation step in each case, because there is only one condition and it is set to true.
Action template: $nop
- Data Provider
Name Action getOpenA032forPhaseMetric ExecuteQueryDataProvider -
Input arguments:
Name Value Source Init null getOpenA032forPhaseMetric -
Output arguments:
Name Value Target activePhase 1 Process Storage count_openA032Phas e1 step.get("getOpenA032forPhaseMetric.$").getN umberOfRows() Process Storage -
Dispatching:
Next step Condition Arguments TE_A032_Calculation true none
• TE_A032_Create
This step is the main search in phase 1 to display all created or rejected months. If the user double- clicks in the list then the process dispatches to phase 2 and show all related B2 records (days). In the “TE_M_ExpensesManagement” context menu there is the “TE_A_A032_OpenRecord” action which executes a command which is used to dispatch to the next step where an A032 record is displayed in detail view.
The curA032 variable is pushed to the process storage, it includes the uid or the selected record in A032 search in Phase 1. This variable is used in several further steps and scripts.
Action template: Search
- Input arguments:
Name Value Source fixedFilterName A032.TE_A032_Expenses_Phase1 constant value searchAndListName A032 constant value showSearch false constant value selectionMode single constant value listParams showContextMenu,TE_M_ExpensesManagement constant value autoSearch true constant value -
Output arguments:
Name Value Target curA032 uid Process Storage -
Dispatching:
Next step Condition Arguments TE_A032_Edit_Initial $.get('command')=='Select' none TE_A032_ExpandA032 $.get('command')=='Proceed.OpenA032' uid = $.get('uid')
• TE_A032_Initial
This step handles the dispatching if a new parent record was selected or clicked on the management start page. In this case the curA032 variable is not set by selecting a record in phase 1 but set with the uid from the record selected on the start page or in other words with the value from the ParentRecord variable.
ParentRecord is defined in the main process view as process storage variable and is set if a user starts the process from a record list (e.g. start page). It is necessary to set this variable to null after copying it to the curA032 variable. This step dispatchs to the TE_a032_edit_Initial step in each case.
Action template: $nop
Output arguments:
Name | Value | Target |
---|---|---|
curA032 | process.get("ParentRecord") | Process Storage |
ParentRecord | null | Process Storage |
Dispatching:
Next step | Condition | Arguments |
---|---|---|
TE_A032_Edit_Initial | true | none |
• TE_A032_Edit_Initial
This is a $nop step. It is used to retrieve the number of all entered days which is displayed in the phase metric in phase 2. Therefore a separate data provider is defined. It executes a query action which delivers all records which match the following condition: select (Occupation2, Occupation3, Occupation4, Occupation5) from (B2) where (Occupation2 <> "" OR Occupation3 <> "" OR Occupation4 <> "" OR Occupation5 <> ""). Furthermore, the link / attribute link in this action has to be set. Only B2 records that are linked to selected A032 record in phase 1 have to be counted. So this attribute must be set to $.get("curA032"). The source is process storage.
If a new data provider is defined, it needs to be initialized before further operations is executed. Therefore a new variable (any name) with the new data provider as source is set to null. In this case the init variable is set to null.
The activePhase variable is used to handle which phase is shown as the active phase. As the user can switch between the phases without any conditions, each phase defines this variable in its initial step. In this case it is set to 2 because the second phase should be displayed as the active phase. The Count_B2forPhaseMetric variable includes the result of the data provider query action. With getNumberOfRows() all records are counted and summed up to this variable. It is pushed to the process storage in order to access it in every point of the process.
This step dispatchs to the TE_A032_Edit step in each case, because there is only one condition and it is set to true. No other conditions are necessary.
Action template: $nop
-
Data Provider
Name Action getEnteredB2forPhaseMetric ExecuteQueryDataProvider -
Input arguments:
Name Value Source init null getEnteredB2forPhaseMetric -
Output arguments:
Name Value Target activePhase 2 Process Storage Count_B2forPhaseMetri c step.get("getEnteredB2forPhaseMetric.$").get NumberOfRows() Process Storage -
Dispatching:
Next step Condition Arguments TE_A032_Edit true none
• TE_A032_Edit
This step is the main search in phase 2 to display all related B2 records for the selected A032 record
in phase 1.
To show only B2 records linked to this one A032 record the attribute link is set and filled with the uid from the curA032 variable from process storage. “MaxRows” is set to 31 because a month cannot include more than 31 days. “Mini Details” and “QuickView” is disabled.
The curB2 variable is pushed to the process storage, it includes the uid of the selected record in the B2 search in phase 2. This variable is used in some further steps.
Action template: Search
-
Input arguments:
Name Value Source searchAndListName B2 constant value createNewTab false constant value DisableFilter true constant value link $.get('curA032') Process Storage showSearch false constant value listParams showMiniDetails,false;showQuickViewAction,false; constant value autoSearch true constant value maxRows 31 constant value link $.get('curA032') Process Storage createnewPopup false constant value -
Output arguments:
Name Value Target curB2 uid Process Storage -
Dispatching:
Next step Condition Arguments TE_A032_Edit_Expand_B2 $.get('command')=='Select' none
• TE_A032_Edit_Expand_B2
Action template: Expand
-
Input arguments:
Name Value Source expandName B2 C.V. uid $.get('curB2') Process Storage -
Dispatching:
Next step Condition Arguments TE_A032_Edit_Initial $.get('command')=='Select' none TE_A032_Edit_New_B4 $.get('command')=='Select' none TE_A032_Edit_Expand_B4 $.get('command')=='Select' uid = $.get("uid") TE_A032_Edit_Expand_B4 $.get('command')=='Select' uid = $.get("uid") TE_A032_Edit_Initial $.get('command')=='Select' none
• TE_A032_Edit_New_B4
Action template: ExpandNew
-
Input arguments:
Name Value Source expandName
TE_B4_ExpensesManangement constant value info areaId
B4 constant value link
$.get('curB2')
Process Storage
onProceed
$back
constant value -
Dispatching:
Next step Condition Arguments TE_A032_Edit_Expand_B2 $.get("command")=="Save" uid = $.get('curB2')
• TE_A032_Edit_Expand_B4
DESCRIPTION
Action template: Expand
-
Input arguments:
Name Value Source expandName TE_B4_ExpensesManangement constant value uid as is Input Message -
Dispatching:
Next step Condition Arguments TE_A032_Edit_Expand_B2 $.get('command')=='Proceed.Back' uid = $.get("curB2") TE_A032_Edit_Expand_B2 $.get('command')=='Save' uid = $.get("curB2") TE_A032_Edit_Expand_B2 $.get('command')=='Cancel' uid = $.get("curB2")
• TE_A032_Check_Initial
This is a $nop step. It is used to retrieve the number of all approved months which is displayed in the phase metric in phase 3. Therefore a separate data provider is defined. It executes a query which delivers all records which match the following condition: select (UpdUserName, F6007) from (A032) where ((F6007="#7" OR F6007="#10") AND F6000="$curRep")
You can select any field of the A032 info area because you only need the records to count them afterwards. F6000 (user) is the currently logged in user and F6007 (approval status) is approved.
If a new data provider is defined, it needs to be initialized before further operatations are executed. Therefore a new variable (any name) with the new data provider as the source is set to null. In this case the variable init is set to null.
The activePhase variable is used to handle what phase is to be shown as active phase. As the user can switch between the phases without any conditions, each phase defines this variable in its initial step. In this case it is set to 3 because the third phase should be displayed as the active phase. The Count_A032forProcessPhase3 variable includes the result of the data provider query action. With getNumberOfRows() all records is counted and summed up in this variable. It is pushed to the process storage in order to access it in every point of the process.
This step dispatches to the TE_A032_Check step in each case, because there is only one condition and it is set to true.
Action template: $nop
-
Data Provider
Name Action getA032forProcessPhase3 ExecuteQueryDataProvider -
Input arguments:
Name Value Source init null getA032forProcessPhase3 -
Output arguments:
Name Value Target activePhase 3 Process Storage Count_A032forProcessPhase 3 step.get("getA032forProcessPhase3.$").g etNumberOfRows() Process Storage -
Dispatching:
Next step Condition Arguments TE_A032_Check true none
• TE_A032_Check
This step is the main search in phase 3 to display all A032 records which meet the condition of the
A032.TE_A032_Expenses_Phase3 fixed filter.
Action template: Search
-
Input arguments:
Name Value Source fixedFilterName A032.TE_A032_Expenses_Phase3 searchAndListName TE_A032_ExpensesManagement constant value disableFilter true constant value showSearch false constant value listParams showContextMenu,TE_M_ExpensesManagement constant value autoSearch true constant value Selection mode single constant value createnewPopup false constant value -
Dispatching:
Next step Condition Arguments TE_A032_ExpandA032_readonly $.get('command')=='Select' uid = $.get('uid') TE_A032_ExpandA032_readonly $.get('command')=='Proceed.OpenA032' uid = $.get('uid')
• TE_A032_ExpandA032_readonly
Action template: Expand
-
Input arguments:
Name Value Source expandName TE_A032_ExpensesManagement_readonly constant value uid as is Input Message createNewTab false constant value createNewPopup false constant value viewMode Read constant value -
Dispatching:
Next step Condition Arguments TE_A032_Check_Initial $.get('command')=='Proceed.Back' TE_A032_Check_Initial $.get('command')=='Save'
• TE_A032_ExpandA032
Action template: Expand
-
Input arguments:
Name Value Source expandName TE_A032_ExpensesManagement constant value uid as is Input Message createNewTab false constant value createNewPopup false constant value viewMode Edit constant value -
Dispatching:
Next step Condition Arguments TE_A032_Create_Initial $.get('command')=='Proceed.Back' TE_A032_Create_Initial $.get('command')=='Save' TE_A032_Create_Initial $.get('command')=='Cancel'
Forms
• TE_A032_Expenses_SelectYearAndMonth
This form is used in phase 1 to add new months. The user has to select the year and the month and click “Create”. The CORE_A023_Generate_B2_for_Month workflow is then executed. The form is shown in a popup which is automatically closed after clicking the “Create” button.
Elements:
Type | Description |
---|---|
GroupPanel | This group panel includes all further form elements. The group panel title is defined by {TXT_TE_ExpensesManagement_1} = “Select year and month ... “ |
TablePanel | 2 columns, 4 rows |
Label | The label text is defined by {TXT_net_core_texts_106} = “Year” |
Label | The label text is defined by {TXT_net_core_texts_124} = “Month” |
CatalogInput | Uses the field 6005 from the A032 workflow.(year catalog) To use the
selected value (year) by clicking the “Create” button, the attribute value
is defined with #Year.
|
CatalogInput | Uses the field 6022 from the A032 info area.(month catalog) To use the
selected value (month) by clicking the “Create” button, the attribute value
is defined with #Month.
|
Button | This button is used to call the workflow which creates the A032 and related B2 records. The button text is {TXT_processask_text_5} = “Create”. |
“onClick Event” is defined as follows:
This function executes a context menu action which calls the CORE_A023_Generate_B2_for_Month workflow. Predefined values #Month and #Year are used as input arguments for the workflow.
Triggers
• TE_A032_UPD_RejectExpenses
Info area: A032 ; Action: Edit/update
This trigger set the approval status to rejected. It is used at the management startpage and is a available for superior users.
Will be called in button TE_A032_RejectMonth.
Used to set a submitted month to rejected by superior after checking all related data. (B2 and B4
records)
• TE_A032_UPD_ReleaseExpenses
Info area: A032 ; Action: Edit/update
This trigger sets the approval status to approved. It is used on the management start page and is available for superior users.
Will be called in the TE_A032_ApproveMonth button.
Used to set a submitted month to approved by the superior after checking all the related data. (B2 and B4 records)
• TE_A032_SetStatusToSubmitted
Info area: A032 ; Action: Edit/update
This trigger sets the approval status to submitted. It is used in the checkSubmitPermission javascript function after clicking on the “Submit” button in phase 2.
Will be called in the checkSubmitPermission javascript function.
Used to set a month to submitted by any user after creating all data within this month. (B2 and B4 records)
• TE_B2_DeleteAllLinkedRecords
Info area: B2 ; Action: Edit/update
Deletes the selected A032 record and all linked B2 records.
Will be called in the TE_SR_Template Main – LSI rights in the A032 info area at Delete (properties: transfers the settings from the child rights).
Used to delete all related B2 records if a user wants to delete a A032 record (month). There could be some problems if the user wants to create a month which was added but which was deleted afterwards.
• TE_A032_UPD_SetExpensesApprovalStatus
Info area: A032 ; Action: Edit/update
Copies the field values from the “Approval status” field to the “Approval status” (TE) field. The second field is used in some business logic structures.
Will be called in the TE_SR_Template Main – LSI rights in the A032 info area at New and Update.
• TE_B2_PLAUSI_Expenses Occupation 1
Info area: B2 ; Action: Edit/update
Copies the field content from the “Occupation 1⁄4” field to the “Occupation 2/4”, “Occupation 3⁄4” and “Occupation 4/4” fields if the “Occupation 1⁄4” field is updated.
Will be called in the TE_SR_Template Main – LSI rights in the B2 info area at New and Update fields (Occupation 1/4).
Used if a user sets the “Occupation” field to fill all other successive Occupation fields with the same value.
• TE_B2_PLAUSI_Expenses Occupation 2
Info area: B2 ; Action: Edit/update
Copies the field content from the “Occupation 2/4” field to the “Occupation 3⁄4” and “Occupation 4/4” fields if the “Occupation 2/4” field is updated.
Will be called in the TE_SR_Template Main – LSI rights in the B2 info area at New and Update fields (Occupation 2/4).
Used if a user sets the “Occupation” field to fill all other successive “Occupation” fields with the same value.
• TE_B2_PLAUSI_Expenses Occupation 3
Info area: B2 ; Action: Edit/update
Copies the field content from the “Occupation 3⁄4” field to the “Occupation 4/4” field if the “Occupation 3⁄4” field is updated.
Will be called in the TE_SR_Template Main – LSI rights in the B2 info area at New and Update fields (Occupation 3/4).
Used if a user sets the “Occupation” field to fill all other successive “Occupation” fields with the same value.
• TE_B2_PLAUSI_Expenses Overnight Stay
Info area: B2 ; Action: Edit/update
If the user sets the “Overnight stay” field to “Yes”, then the field content of “Arrival date” is copied to the “Departure date” field. The value “1” is added to the field. If the “Overnight stay” field is set to No, then the arrival date is copied to the departure date, the arrival time is copied to the departure time and the travel duration is set to 00:01.
Is called in the TE_SR_Template Main – LSI rights in the B2 info area at New, Update and Update fields (Overnight stay).
Used if a user sets the “Overnight stay” field to handle arrival and departure date / time.
• TE_B2_PLAUSI_Fill Mileage Charge
Info area: B2 ; Action: Edit/update
If the “Company car” field is set to “No”, the “Mileage Charge” field is set to null (empty). If the “Company car” field is set to “Yes”, then the “Mileage Charge” field is filled with content from the TE_Occupations.MileageCharge variable.
Will be called in the TE_SR_Template Main – LSI rights in the B2 info area at Update and Update fields (Mileage begin, Mileage end, Private mileage, Business mileage, Company cat, Private car)
• TE_B2_UPD_Expenses Overnight Stay
Info area: B2 ; Action: Edit/update
If the “Overnight stay” field is set to Yes or No, then the field content of the “Departure date” is copied to the “Arrival date” field. If the “Overnight stay” field is set to “Yes”, the “Arrival date” field is set to “1” and the “Arrival time” field is set to null (empty).
Is called in the TE_SR_Template Main – LSI rights in the B2 info area at Update.
• TE_B2_UPD_Fill Rates
Info area: B2 ; Action: Edit/update
The “Daily rate” field is set with the value from the TE_Occupations.DailyRate01 - TE_Occupations.DailyRate12 variable depending on the “Travel duration” field. The condition checks if travel duration >= variable TE_Occupations.ConditiondailyRate01 - TE_Occupations.ConditiondailyRate12.
Will be called in rights TE_SR_Template Main – LSI in info area B2 at New, Update and Update fields (Accommodation private, Travel duration, Reduction breakfast, Reduction lunch, Reduction dinner, No allowance calculation) with Condition (No allowance calculation = No)
• TE_B2_UPD_Calc Allowance
Info area: B2 ; Action: Edit/update
Content of field Daily rate is copied to field Daily allowance. Then values from fields Reduction breakfast (amount), Reduction lunch (amount) and Reduction dinner (amount) is subtracted from value of field Daily allowance.
Will be called in rights TE_SR_Template Main – LSI in info area B2 at Aurea CRM and Aurea CRM fields (Daily rate, Reduction breakfast, Reduction lunch, Reduction dinner, No allowance calculation) with Condition (No allowance calculation = No)
• TE_B2_UPD_Calc Allowance=0
Info area: B2 ; Action: Edit/update
Set value of field Daily allowance to null (empty) if Daily allowance < null (empty)
Will be called in the TE_SR_Template Main – LSI rights in the B2 info area at Aurea CRM and Aurea CRM fields (Daily allowance) with Condition (No allowance calculation = No)
• TE_B2_UPD_SetFixCat_ApprovalStatus
Info area: B2 ; Action: Edit/update
Sets the value of the “Approval status” field (TE fixed catalog) to the value of the “Approval status” field.
Will be called in the TE_SR_Template Main – LSI rights in the B2 info area at New, Update and Update fields (Approval status)
• TE_B4_UPD_SetApprovalStatusFromB2
Info area: B4 ; Action: Edit/update
Sets the “Approval status” field in B4 with the field content of the “Approval status” field from the B2 info area.
Will be called in the TE_SR_Template Main – LSI rights in the B2 info area at Update and Update fields (Approval status).
• TE_B2_UPD_SetValidate
Info area: B2 ; Action: Edit/update
Set the “TE:Validated” field to Y if in every field (Occupation 1/4 - Occupation 4/4) is a value entered and the “Workday” field is set to Yes. Set the “TE:Validated” field to N if every field (Occupation 1/4 - Occupation 4/4) is empty and the “Workday” field is set to Yes.
Will be called in the TE_SR_Template Main – LSI rights in the B2 info area at New, Update and Update fields (Occupation 1⁄4, Occupation 2/4, Occupation 3⁄4, Occupation 4/4, Workday).
• TE_B2_UPD_Update Occupation (TE)
Info area: B2 ; Action: Edit/update
For detailed information please have a look at the trigger in the win module.
Will be called in the TE_SR_Template Main – LSI rights in the B2 info area at New, Update and Update fields (Occupation 1⁄4, Occupation 2/4, Occupation 3⁄4, Occupation 4/4, Workday).
• CORE_Expenses_sum_B2_to_A032
Info area: A032 ; Action: Edit/update
The “Total receipts” field is filled with the sum of the “Total receipts” field of all linked B2 records.
The “Private Mileage” field is filled with the sum of the “Private Mileage” field of all linked B2 records.
The “Business Mileage” field is filled with the sum of the “Business Mileage” field of all linked B2 records.
The “Mileage allowance” field is filled with the sum of the “Mileage allowance” field of all linked B2 records.
The “Total Flat Rates” field is filled with the sum of the “Total Flat Rates” field of all linked B2 records.
Will be called in the TE_SR_Template Main – LSI rights in the B2 info area at New, Update and Update fields (Total receipts, total Flat Rates, Provate Mileage, Business Mileage, Mileage Allowance).
• TE_B4_DV_Receipt
Info area: B4 ; Action: Edit/update
The “Receipt date” field is filled with the value from the “Date” field from B2.
The “Approval status” field is filled with the value from the “Approval status” field from B2.
The “Cost center” field is filled with the value from the “Cost center” field from B2.
Will be called in the TE_SR_Template Main – LSI rights in the B4 info area at New.
• TE_B4_UPD_SetFixCat_ApprovalStatus
Info area: B4 ; Action: Edit/update
Set “TE:Occupation Approval status” field to “New” if Approval status = New
Set “TE:Occupation Approval status” field to “Submitted” if Approval status = Submitted Set “TE:Occupation Approval status” field to “Reviewed” if Approval status = Reviewed Set “TE:Occupation Approval status” to “Rejected” if Approval status = Rejected
Set “TE:Occupation Approval status” field to “Approved” if Approval status = Approved
Will be called in the TE_SR_Template Main – LSI rights in the B4 info area at New, Update and Update fields (Approval status).
• TE_B4_UPD_No Compensation
Info area: B4 ; Action: Edit/update
Set “Amount compensated” field to the value of the “Amount” field if No compensation = No. Set the “Amount compensated” field to null (empty) if No compensation = Yes.
Will be called in the TE_SR_Template Main – LSI rights in the B4 info area at New, Update and Update (No compensation, Amount).
• TE_B4_UPD_SetYearFromReceiptDate
Info area: B4 ; Action: Edit/update
Set the “Year” field to the value of the receipt date. The reference function is “Year”.
Will be called in the TE_SR_Template Main – LSI rights in the B4 info area at New, Update and Update fields (Receipt date).
• TE_A3_PLAUSI_WF_Fill Occupation=Call
Info area: A3 ; Action: Edit/update
Set the “Occupation” field to the Visit value.
Will be called in the TE_ Expenses - Fill Occupation workflow in Occupation=Call.
• TE_U059_UPD_Calculate_UsedUntilNow
Will be called in the TE_B4_CalculateQuotas workflow in the Find suitable contingent process.
• TE_U059_EMAIL_Send email to Superior
Will be called in the TE_B4_CalculateQuotas workflow in the Call Email Trigger process.
Workflows
• CORE_A023_Generate_B2_for_Month
Will be called in the CORE_A_B2_Workflow_CreateMonth menu action and in the
TE_A032_Expenses_SelectYearAndMonth form.
Processes:
o Month Mapping
o Input value is a A032 record
o Get year and month and see if the A032 dataset exists
o Get A032 amd set parameter
o Check month and call process “B2 create”
o Create B2 datasets
• TE_A032_CD_GenerateHolidayForB2
Will be called in the CORE_A032_Generate_B2_for_Month workflow in the Create B2 datasets process.
Processes:
o getInfo()
o Input value is an A032 record.
o Update B2 records
• TE_B4_CalculateQuotas
Will be called in the TE_SR_Template Main – LSI rights in the B4 info area at New, Update and Delete with Condition Year is not null (empty), Amount is not bull (empty) and Type is not null (empty).
Processes:
o Fill intern variables
o Search for B2 records depending on rep o Set B4 records
o Calculate amount
o Find suitable contingent
o Call E-mail trigger
• TE_Expenses - Update Records_v3
Will be called in button TE_A032_UpdateRecords.
Processes :
o Start
o Loop Occupations
Used to loop all Occupation records (B2 – days). Walk through each related B2 record and execute the TE_Expenses – Fill Occupation and TE_Expenses Receipt – Create Records workflows with currently selected B2 record Uid as the input parameter. This is part of the operation which is executed if a user clicks on the “Update” button in phase 2.
• TE_Expenses - Fill Occupation
Will be called in TE_Expenses - Update Records_v3 workflow in the Loop Occupations process.
Processes :
o Start
o Loop Other Appointments or Loop Calls
o Occupation=Call
Used to check if there are related Other appointments and Activity (calls) records. If yes, this workflow automatically fills the “Occupation 1⁄4” – “Occupation 4/4” fields for the respective day in a month. This is part of the operation which is executed if a user clicks on the “Update” button in phase 2.
• TE_Expenses Receipt - Create Records
Will be called in the TE_Expenses - Update Records_v3 workflow in the Loop Occupations process.
Processes :
o Loop Calls
o Loop Call Expenses o Create Receipt
Used to check if there are related Call Expenses records from the Call documentation process. If yes, this workflow automatically creates receipts for the respective day in a month. This is part of the operation which is executed if a user clicks on the “Update” button in phase 2.
Rights
• TE_SR Template Main – LSI (Station right)
Info Area | Deny Access | Deny New | Deny Update | Deny Deletion |
---|---|---|---|---|
A032 | X | X | X | |
B2 | X | X | X | |
B4 | X | X | X |
JavaScript
-
checkSubmitPermission: function(o){}
This function is used in phase 2 in the TE_B2_ExpensesManagement_Submit button.
- The function first reads the value of the curA032 variable from the process storage.
- Checks if the currently logged in user = user from A032 record, if not then disable button!
- Checks if superior is entered, if not then create an MD record with the following text: “You cannot submit this month”.
- Calls the trigger to submit a record! Trigger name: TE_A032_SetStatusToSubmitted
- Dispatch to phase 3, step TE_A032_Check_Initial!
This function is used in phase 2 if a user clicks the on the “Submit” button. Some checks need to be carried out before submitting a month if the user is allowed to submit the selected month.
- updateB2reocrds: function(o){}
This function is used in phase 2 in the TE_A032_UpdateRecord button. The function first reads the value of the curA032 variable from the process storage. This record Uid is used as input parameter for the TE_Expenses – Update Records_v3 workflow.
This function is used in phase 2 if a user clicks on the “Update” button.
-
A032_calculateSummedReceipts: function () {}
Basically this function handles the process metrics on the right side of the process header. There have to be 2 values which is calculated and set to the header. Amount of all added and approved receipts (so that the user knows how much is already approved by the superior).
1. Amount of all added and submitted receipts (so that the user knows how much is already submitted but needs to be approved by the superior).
Therefore the function uses two different AQL statements within separate queries.
1. select (F6000, B2.TotalAmount) from (A032) where (F6000='$curRep' AND F6007 ='#10') withsummed (B2 using link 301) where (TotalAmount<>'0')
2. select (F6000, B2.TotalAmount) from (A032) where (F6000='$curRep' AND F6007='#7') withsummed (B2 using link 301) where (TotalAmount<>'0')
The function uses the following syntax to set calculated values to the process metric:
var old_text = $w("work").page.process.metrics[2].getValue(); var new_text = old_text + " " + sumReceipts + " €"; $w("work").page.process.metrics[2].setValue(new_text);
First the function needs to get the text of the metric which is entered by designer configuration. Then the new ‘complete’ text is assembled and set to the process metric with setValue.
Other
• Variables
o TE_Occupations.MileageCharge
Defines the mileage allowance for private cars.
o TE_Occupations.DailyRate01 - TE_Occupations.DailyRate12
Defines the daily rate for the corresponding time frame.
o TE_Occupations.ConditionDailyRate01 - TE_Occupations.ConditionDailyRate12
Defines a time frame in hours for the calculation of the daily allowance, a day can be split into 12 parts.
o TE_Occupations.AccommodationRate
Defines the private accommodation rate.
o TE_Occupations.ReductionBreakfast
Defines the breakfast reduction.
o TE_Occupations.ReductionDinner
Defines the lunch reduction.
o TE_Occupations.ReductionLunch
Defines the dinner reduction.
• Special Header
o TE_A032_ExpensesManagement
This special header is used in the process header on the right side. It includes the info area image and the text “Occupation Management”.