sprAllocations

Prev Next

Represents allocations (spr) in Business Central.

Methods

Method Return Type Description
GET sprAllocations sprAllocations Gets an allocation object.
DELETE sprAllocations none Deletes an allocation object.
POST sprAllocations sprAllocations Creates an allocation object.
PATCH sprAllocations sprAllocations Updates an allocation object.

Bound Actions

The allocation resource type offers bound actions:

  1. newUsingCurrent which creates a new allocation using the current allocation data. This is illustrated in the following example: POST ..companies({id})/sprAllocations({id})/Microsoft.NAV.newUsingCurrent The response contains the new allocation ID.
  2. deleteWScheduleEntries which deletes work schedule entries for the allocation. This is illustrated in the following example: POST ..companies({id})/sprAllocations({id})/Microsoft.NAV.deleteWScheduleEntries The response has no content; the response code is 204.
  3. refillWScheduleEntries which refills work schedule entries for the allocation. This is illustrated in the following example: POST ..companies({id})/sprAllocations({id})/Microsoft.NAV.refillWScheduleEntries The response has no content; the response code is 204.

Navigation

Navigation Return Type Description
sprContract sprContract Gets the contract associated with the allocation.
sprEmployee sprEmployee Gets the employee associated with the allocation.
sprPosition sprPosition Gets the position associated with the allocation.
sprEmployeePostingGroup sprEmployeePostingGroup Gets the employee posting group associated with the allocation.
sprWorkScheduleFormula sprWorkScheduleFormula Gets the work schedule formula associated with the allocation.
sprDimensionSetLines Collection(sprDimensionSetLine) Gets the dimension set lines of the allocation.
sprAllocationSalary sprAllocationSalary Gets the allocation salary associated with the allocation.

Properties

Property Type Description Relation to
id Guid Specifies the allocation's ID. Non-editable.
previousAllocationId Guid Specifies the previous allocation's ID.
employeeId Guid Specifies the employee's ID. sprEmployees.id
employeeNumber String[20] Specifies the employee's number. sprEmployees.number
contractId Guid Specifies the contract's ID. sprContracts.id
contractNumber String[20] Specifies the contract's number. sprContracts.number
number Int32 Specifies the allocation's number.
lastContractSeqAllocation Boolean Specifies the allocation's last contract sequence allocation value.
startDate Date Specifies the allocation's start date.
endDate Date Specifies the allocation's end date.
positionId Guid Specifies the position's ID. sprPositions.id
positionCode String[10] Specifies the position's code. sprPositions.code
positionDescription String[80] Specifies the position's description. sprPositions.description
emplPostGroupId Guid Specifies the employee posting group's ID. sprEmployeePostingGroups.id
emplPostGroupCode String[10] Specifies the employee posting group's code. sprEmployeePostingGroups.code
workScheduleFormulaId Guid Specifies the work schedule formula's ID. sprWorkScheduleFormulas.id
wScheduleFormulaCode String[10] Specifies the work schedule formula's code. sprWorkScheduleFormulas.code
staff Decimal Specifies the staff's number.
vacationScheme Decimal Specifies the vacation scheme's number.
pensionAccumMethod NAV.sprPensionAccumMethod Specifies the pension accumulation method's enum. It can be:
0- " "
1- Not Accumulate
2- Maximum
3- Growing
tEAType Option Specifies the TEA type's option. It can be:
0- " "
1- Apply
2- Don't Apply
orderNo String[20] Specifies the order's number.
managerNo String[20] Specifies the manager's number. sprEmployee.no
managerId Guid Specifies the employee's ID. sprEmployee.id
workCountryCode String[10] Specifies the country code. Country/Region.code
workPostCode String[20] Specifies the work post's code.
workCity String[30] Specifies the work city.
workAddress String[60] Specifies the work address.
workAddress2 String[60] Specifies the second work address.
skipSPRAllocationSalaryAutoCreation Boolean Specifies the allocation salary's auto-creation skipping.
lastModifiedDateTime DateTimeOffset Specifies the allocation's last modified date. Read-Only.

Examples

Create sprAllocations

POST URI: /companies({{companyId}})/sprAllocations?$expand=sprDimensionSetLines,sprAllocationSalary

Request

{
    "contractId": "{{contractId}}",
    "startDate": "2023-07-13",
    "endDate": "0001-01-01",
    "positionId": "{{positionId}}",
    "emplPostGroupId": "{{employeePostingGroupId}}",
    "workScheduleFormulaId": "{{workScheduleFormulaId}}",
    "staff": 1,
    "vacationScheme": 20,
    "tEAType": "Apply",
    "skipSPRAllocationSalaryAutoCreation": false
}

Response

{
    "@odata.context": "http://bc220-2:7048/BC/api/softera/softeraPayroll/v1.0/$metadata#companies(fb9142f3-361f-ee11-a396-ce5b49aea574)/sprAllocations/$entity",
    "@odata.etag": "W/\"JzE5Ozg1MzMwNjA5MTAyMzMyNzQ1MjAxOzAwOyc=\"",
    "id": "505b2a47-162a-ee11-a395-fe66e2afdfa9",
    "previousAllocationId": "00000000-0000-0000-0000-000000000000",
    "employeeId": "a102cb47-1e27-ee11-a395-fe66e2afdfa9",
    "employeeNumber": "D0019",
    "contractId": "a302cb47-1e27-ee11-a395-fe66e2afdfa9",
    "contractNumber": "S0006",
    "number": 20,
    "lastContractSeqAllocation": true,
    "startDate": "2023-07-13",
    "endDate": "0001-01-01",
    "positionId": "3e2bbeaf-381f-ee11-a396-ce5b49aea574",
    "positionCode": "DARB01",
    "positionDescription": "Darbuotojas 01",
    "emplPostGroupId": "aa640e59-381f-ee11-a396-ce5b49aea574",
    "emplPostGroupCode": "DARB",
    "workScheduleFormulaId": "13650e59-381f-ee11-a396-ce5b49aea574",
    "wScheduleFormulaCode": "A5",
    "staff": 1,
    "vacationScheme": 20,
    "pensionAccumMethod": " ",
    "tEAType": "Apply",
    "orderNo": "",
    "managerNo": "",
    "managerId": "00000000-0000-0000-0000-000000000000",
    "workCountryCode": "",
    "workPostCode": "",
    "workCity": "",
    "workAddress": "",
    "workAddress2": "",
    "skipSPRAllocationSalaryAutoCreation": false,
    "lastModifiedDateTime": "2023-07-24T11:36:07.75Z",
    "sprDimensionSetLines": [],
    "sprAllocationSalary": null
}

Create sprAllocations and sprAllocationSalary at once

POST URI: /companies({{companyId}})/sprAllocations?$expand=sprAllocationSalary

Request

{
    "contractId": "{{contractId}}",
    "startDate": "2023-07-19",
    "endDate": "0001-01-01",
    "positionId": "{{positionId}}",
    "emplPostGroupId": "{{employeePostingGroupId}}",
    "workScheduleFormulaId": "{{workScheduleFormulaId}}",
    "staff": 1,
    "vacationScheme": 20,
    "tEAType": "Apply",
    "skipSPRAllocationSalaryAutoCreation": true,
    "sprAllocationSalary": {
        "salaryType": "Timesheet",
        "basePayType": "Monthly",
        "basePayAmountType": "Amount",
        "basePayAmount": 1200,
        "advanceType": "Amount",
        "advanceAmount": 0
    }
}

Response

{
    "@odata.context": "http://bc220-2:7048/BC/api/softera/softeraPayroll/v1.0/$metadata#companies(fb9142f3-361f-ee11-a396-ce5b49aea574)/sprAllocations/$entity",
    "@odata.etag": "W/\"JzE5OzIxNTcxMTI3Mjg3NDM4MzMxNTgxOzAwOyc=\"",
    "id": "377617f6-242a-ee11-a395-fe66e2afdfa9",
    "previousAllocationId": "00000000-0000-0000-0000-000000000000",
    "employeeId": "a102cb47-1e27-ee11-a395-fe66e2afdfa9",
    "employeeNumber": "D0019",
    "contractId": "a302cb47-1e27-ee11-a395-fe66e2afdfa9",
    "contractNumber": "S0006",
    "number": 23,
    "lastContractSeqAllocation": true,
    "startDate": "2023-07-19",
    "endDate": "0001-01-01",
    "positionId": "3e2bbeaf-381f-ee11-a396-ce5b49aea574",
    "positionCode": "DARB01",
    "positionDescription": "Darbuotojas 01",
    "emplPostGroupId": "aa640e59-381f-ee11-a396-ce5b49aea574",
    "emplPostGroupCode": "DARB",
    "workScheduleFormulaId": "13650e59-381f-ee11-a396-ce5b49aea574",
    "wScheduleFormulaCode": "A5",
    "staff": 1,
    "vacationScheme": 20,
    "pensionAccumMethod": " ",
    "tEAType": "Apply",
    "orderNo": "",
    "managerNo": "",
    "managerId": "00000000-0000-0000-0000-000000000000",
    "workCountryCode": "",
    "workPostCode": "",
    "workCity": "",
    "workAddress": "",
    "workAddress2": "",
    "skipSPRAllocationSalaryAutoCreation": true,
    "lastModifiedDateTime": "2023-07-24T13:21:23.59Z",
    "sprAllocationSalary": {
        "@odata.etag": "W/\"JzE5OzgyNzI1OTY1MDEwMjUwMjIwMTUxOzAwOyc=\"",
        "id": "387617f6-242a-ee11-a395-fe66e2afdfa9",
        "employeeNumber": "D0019",
        "employeeId": "a102cb47-1e27-ee11-a395-fe66e2afdfa9",
        "contractNumber": "S0006",
        "contractId": "a302cb47-1e27-ee11-a395-fe66e2afdfa9",
        "allocationNumber": 23,
        "allocationId": "377617f6-242a-ee11-a395-fe66e2afdfa9",
        "startDate": "2023-07-19",
        "endDate": "0001-01-01",
        "salaryType": "Timesheet",
        "basePayType": "Monthly",
        "basePayAmountType": "Amount",
        "basePayAmount": 1200,
        "advanceType": "Amount",
        "advanceAmount": 0,
        "lastModifiedDateTime": "2023-07-24T13:21:23.597Z"
    }
}