Guide API documentation Community Applications
Introduction
Authentication
Using the API
Filtering Hypermedia Troubleshooting Dimensions Files Statistics Webhooks Custom fields
Guides
Payroll
Legal

Project and department dimension

Introduction

In this article you will see how Projects and Departments are used in Unimicro.

You can attach a project or a department to other entities in Unimicro.

While Project and Department are their own entities, you need to create a Dimensions-object to attach it to other entities. The dimensions-object will hold the IDs and let you group several dimensions to a single entity, such as Project or Department.

How to create Project

In order to create new project use the API request below

Endpoint : [ POST : api/biz/projects ]

{
	"Name":"<project-name>",
	"ProjectNumber":"<project-number>, (ex: "EM-1234")",
	"ProjectNumberNumeric":" <project-number-numeric> (ex: "1234")"
}

How to create Department

In order to create new department use the api request below.

Endpoint : [ POST : api/biz/departments ]

{
	"Name": "<project-name>",
	"DepartmentNumber":"<project-number>, (ex: "EM-1234")",
	"DepartmentNumberNumeric":" <project-number-numeric> (ex: "1234")"
}

How to create Dimensions

Create Dimensions for the JournalEntryLine entity (voucher)

In the JournalEntry object we have DimensionsID and Dimensions properties.

In order to add new Dimensions, we need to create a new dimensions object and assign that in to JournalEntryLine Dimensions property.

If you already have created the Dimension you can assign it's ID to property DimensionsID in JournalEntryLine, that Dimensions will then be linked to that JournalEntryLine.

Dimensions object :

{
	"ID": 0,
	"ProjectID": 12,
	"DepartmentID": 0,
	"_createguid": "<shoud add new GUID here>"
}

New Dimensions object attached to JournalEntryLine:

 {
          ...journalentryline,
          "JournalEntryID": 0,
          "ID": 0,
          "FinancialDate": "2020-06-24",
          "JournalEntryNumber": "string",
          "Dimensions": {
            "ID": 0,
            "ProjectID": 12,
            "DepartmentID": 0,
            " _createguid" : "55fb7ade-6141-41bb-b246-5055d60161d5"
          }
}

Attach existing Dimensions to JournalEntryLine

In this scenario we don't assign a new object because Dimensions already exists. We don't need to create one in order to link that dimension to JournalEntryLine, just assign the ID of the Dimensions to property "DimensionsID".

 {
          ...journalentryline,
          "JournalEntryID": 0,
          "ID": 0,
          "FinancialDate": "2020-06-24",
          "JournalEntryNumber": "string",
          "Dimensions": null,
          "DimensionsID": 12
}

Create Dimension in SalaryTransaction (Payroll)

In salary Transaction object we use DimensionsID and Dimensions properties in order to add new Dimensions. We also need to create new dimensions object and assign that in to Salary Transaction Dimensions property.

If you already have created the Dimensions you can assign its ID to property DimensionsID in SalaryTransaction, and then that Dimension will be linked to that SalaryTransaction.

Dimensions object:

{
	"ID": 0,
	"ProjectID": 12,
	"DepartmentID": 0,
	"_createguid": "<shoud add new GUID here>"
}

New Dimensions object attached to SalaryTransaction

 {
          ...salarytransaction,
          "PayrollRunID": 0,
          "ID": 0,
          "ToDate": "2020-06-24",
          "EmployeeNumber": "string",
          "Dimensions": {
                 "ID": 0,
                 "ProjectID": 12,
                 "DepartmentID": 0,
                 " _createguid" : "55fb7ade-6141-41bb-b246-5055d60161d5"
          }
}

Attach existing dimension to SalaryTransaction

In this scenario we don't assign a new object because dimensions already exists so we don't need to create one. In order to link that dimensions to SalaryTransaction, just assign the dimensions ID to property "DimensionsID".

 {
          ...salarytransaction,
          "PayrollRunID": 0,
          "ID": 0,
          "ToDate": "2020-06-24",
          "EmployeeNumber": "string",
          "Dimensions": null,
          "DimensionsID": 12
}