# Server Exports

{% hint style="info" %}
Here you will find the list of usable exports for DOJ MDT, you can use them if you have basic or advanced programming knowledge, we do not recommend using these if you do not have such knowledge.
{% endhint %}

{% hint style="warning" %}
REMEMBER ABOUT CLIENT SIDE AND SERVER SIDE IN CHOOSING EXPORT!
{% endhint %}

***

## createInvoice

Use following export to create invoice for company

```lua
local societyName = 'society_police' -- must be name from doj_companies in database
local employee = 'John Doe'
local customer = 'Jane Smith'
local title = 'Mechanic Service'
local price = 1000

exports['p_dojmdt']:createInvoice(societyName, employee, customer, title, price)
```

***

## getEmployeeLicenses

Use following export to get employee current licenses

```lua
local identifier = 'char1:123456' -- replace with existing player identifier
local licenses = exports['p_dojmdt']:getEmployeeLicenses(identifier)

print(licenses['lawyer']) -- index license name from config.employees
```

Return:

* licenses: `{[key: string]: boolean | nil}`

***

## getMoney

Use following export to check balance of society doj account

```lua
local jobName = 'doj'
local money = exports['p_dojmdt']:getMoney(jobName)
print(money)
```

Return:

* money: `number`

***

## addMoney

Use following export to add money into society doj account

```lua
local data = {from = 'John Doe', amount = 10, jobName = 'doj', jobLabel = 'DOJ'}
local success = exports['p_dojmdt']:addMoney(data)
print(success)
```

Return:

* success: `boolean`

***

## removeMoney

Use following export to remove money from society doj account

```lua
local data = {to = 'John Doe', amount = 10, jobName = 'doj', jobLabel = 'DOJ'}
local success = exports['p_dojmdt']:removeMoney(data)
print(success)
```

Return:

* success: `boolean`

***

## payTax

Use following export to pay tax \[It will add money to doj society account and return amount without tax]

```lua
local taxType = 'income' -- tax type from config.taxes
local bruttoAmount = 1000
local success = exports['p_dojmdt']:payTax(taxType, bruttoAmount)
if success then
   -- remove player money
end
```
