JournalEntryLine

Even though there are a lot of entities used in the accounting module, the most important, and the one that stores the actual numbers we are interested in is the JournalEntryLine table (Bilagslinje). It is UE’s transaction table, and values in this table cannot be changed (most of them anyway).

From journalentryline we find what account/sub account the transaction applies to, the amount and what period it belongs to.

Journalentrylines are normally generated based on a journalentrylinedraft. The journalentryservices will create minimum one journalentryline per draftline - e.g. create journalentrylines for VAT, accruals and agio - so in some cases one draft line can create a lot of journalentrylines. We’ll get back to the details later on. A JournalEntry is a collection of draft lines and journalentrylines, and is normally what will be used as a reference to other parts of the system, e.g. invoices, payments, etc..

Creating a journal-entry

POST

POST /api/biz/journalentries?action=book-journal-entries

Payload

[{
	"DraftLines": [{
		"AccountID": 359,
		"Amount": 10.0,
		"Description": "TestKjøp 1",
		"FinancialDate": "2017-09-05"
	}, {
		"AccountID": 173,
		"Amount": -10.0,
		"Description": "Betaling testkjøp 1",
		"FinancialDate": "2017-09-05"
	}]
}]

Account lookup

Accounts are referenced in the draftlines by their ID (not their Accountnumber). This requires you to fetch the correct ID before you post your draftlines.

Fetch single account

GET /api/biz/accounts?filter=accountnumber eq 1920&select=ID,AccountNumber,AccountName,VatTypeID

Example response:

[{"ID":173,"AccountNumber":1920,"AccountName":"Bankinnskudd","VatTypeID":null}]

Vat / Tax

To add vat-/taxcalculations to the draftline you must add a reference to valid vattype in the “VatTypeID” property of the draftline. You can use the vattype returned with the account (if not null), or you can lookup all vattypes from the API.

Fetch vattypes

GET /api/biz/vattypes?select=ID,Name,VatPercent,VatCode,OutputVat

Example response:

[{
	"ID": 1,
	"Name": "Ingen mvabehandling (anskaffelser)",
	"VatPercent": 0.0000,
	"VatCode": "0",
	"OutputVat": false,		
}, {
	"ID": 2,
	"Name": "Fradrag for inngående mva",
	"VatPercent": 25.0000,
	"VatCode": "1",
	"OutputVat": false,		
}, {
	"ID": 3,
	"Name": "Fradrag for inngående mva",
	"VatPercent": 15.0000,
	"VatCode": "11",
	"OutputVat": false,		
}, {
	"ID": 4,
	"Name": "Fradrag for inngående mva",
	"VatPercent": 11.1100,
	"VatCode": "12",
	"OutputVat": false,		
}
]