Data Objects in Salesforce
The JustOn Connector for DATEV application adds a number of new data objects to your Salesforce environment. These objects allow storing the accounting document, transferring the data to DATEV, and checking the progress of the transfer.
Accounting Document
A record of the class Accounting Document represents a purchase or sales invoice or a cash document.
The data structure is as follows:
An accounting document contains
- accounting document data like the document date, the invoice number and the currency, and for purchase and sales invoices also business partner data (name, city, business partner number and bank data)
- attachments to the accounting document that represent the document image (see Document Images)
- at least one accounting document item
If a data transfer has already been made for one or more accounting document items of the accounting document, the latest data transfer is linked to the accounting document.
Some fields have a special meaning:
| Field name | Possible values | Description |
|---|---|---|
| Record Type |
accountsPayableLedger accountsReceivableLedger cashLedger |
Type of the accounting document (purchase invoice, sales invoice, cash book). The type determines fields and field values, validations, and the creation of the data structure for the transfer to DATEV. The name of the field cannot be changed because it is a record type that models the type-specific manual creation of accounting documents. |
| Accounting Job | ID of and link to the data transfer | Link to the data transfer if a data transfer has already been created for one or more accounting document items of the accounting document (this says nothing about the status of the data transfer!) |
| Currency Code | All selectable values | The currency code must always be set. If the Salesforce organization in which you use JustOn Connector for DATEV has multiple currencies enabled, this field must contain the same value as the CurrencyIsoCode in Salesforce. |
| Document Amount | Calculated from the amounts of the accounting document items | Total amount of the accounting document |
| Locked | true or false |
Specifies whether the accounting document can be changed or not. This field is true if the accounting document was transferred from an upstream system, or if manually created accounting documents (caution, only permitted for dummy purposes!) are linked to a data transfer and are currently being transferred or have been successfully transferred to DATEV. |
| From Third Party | true or false |
Specifies whether the accounting document was transferred to JustOn Connector for DATEV from an upstream system. |
| Client | Combination of consultant number and client number, joined with a minus sign, for example, 12345-98765 |
If this value is set, the accounting document is transferred to DATEV only if the value matches the combination of consultant number and client number of the data transfer. |
The attachments to the accounting document represent the document image. They are transferred to DATEV with the first accounting document item of the accounting document. For the transfer to DATEV, attachments should not be larger than 4 MB and must be of certain file types (see Document Images).
There are numerous validation rules for accounting documents. They ensure that the data meets DATEV's requirements for the data transfer.
Info
For an overview of all fields of the accounting document, see the object reference for the Accounting Document object.
Accounting Document Item
An accounting document has at least one, but can also have several accounting document items.
Accounting document items are grouped by an accounting document. All accounting document items of an accounting document must therefore be of the same type (accounting document type). Each accounting document item must be assigned to exactly one accounting document and can be assigned to exactly one data transfer.
Info
When transferring an accounting document with several accounting document items that have different dates, the most recent date is used for all accounting document items.
If an accounting document has accounting document items with different accounting dates that belong to different accounting months, the accounting document items can only be transferred in several data transfers – one per accounting month.
Some fields have a special meaning:
| Field name | Possible values | Description |
|---|---|---|
| Accounting Document | ID of and link to the accounting document | The accounting document to which the accounting document item belongs |
| Accounting Job | ID of and link to the data transfer | Link to the data transfer if a data transfer has already been created for the accounting document item (this says nothing about the status of the data transfer!) |
| Record Type |
accountsPayableLedger accountsReceivableLedger cashLedger |
Type of the accounting document (purchase invoice, sales invoice, cash book). The type determines fields and field values, validations, and the creation of the data structure for the transfer to DATEV. This field is taken from the accounting document. |
| Accounting Period | Date of the format YYYY-mm | Month in which the accounting document item is to be posted |
| Accounting Year | Date of the format YYYY | The fiscal year in which the accounting document item is to be posted |
| Document Date | Date of the format dd.mm.YYYY | Document date of the accounting document This field is taken from the accounting document. |
| Date | Date of the format dd.mm.YYYY | Formula field that determines which date is transferred to the DATEV accounting program – Accounting Date if available, otherwise Document DateThe field Delivery Date plays no role in determining the date for the accounting document item. |
| Accounting Date | Date of the format dd.mm.YYYY | Accounting date of the accounting document item Depending on the implemented integration, this field can be populated separately, for example, with the booking date of a booking detail as the source record. |
Which date is transferred to DATEV?
The DATEV interface Rechnungsdatenservice 1.0 supports only one booking-relevant date and cannot itself distinguish between document date and accounting date.
Accounting document items therefore have three relevant date fields:
| Field | Description |
|---|---|
| Document Date | The document date taken from the accounting document |
| Accounting Date | Accounting date of the accounting document item Depending on the implemented integration, this field can be populated separately, for example, with the booking date of a booking detail as the source record. |
| Date | The date to be transferred to DATEV Formula field that determines which date is transferred to the DATEV accounting program – Accounting Date if available, otherwise Document Date |
For the transfer to the field Datum in the DATEV accounting program, the value is taken from the field Date of the accounting document item. This can be either the document date taken from the accounting document or – with a corresponding integration – the booking date of a booking detail.
The field Delivery Date plays no role in determining the date for the accounting document item.
For the integration with JustOn Billing & Invoice Management, there are the following options to determine the accounting date:
By default, the date of the invoice is used as the accounting date. For an invoice issued on 2022-05-12, revenue and input tax liability arise in May 2022:
| Invoice | Booking detail | Accounting document item | DATEV | |||
|---|---|---|---|---|---|---|
DateInvoice.Date |
→ | Booking DateBookingDetail.BookingDate |
→ | Accounting DateAccountingDetail.AccountingDate |
→ | Datum |
12.05.2022 |
12.05.2022 |
12.05.2022 |
12.05.2022 |
Using a custom field ON_BookingDate, you can define dates other than the invoice date as the booking date. For an invoice issued on 2022-05-12 with an additional field Booking Date that custom logic sets to 2022-04-30, revenue and input tax liability arise in April 2022 instead:
| Invoice | Booking detail | Accounting document item | DATEV | |||
|---|---|---|---|---|---|---|
Booking DateInvoice.ON_BookingDate |
→ | Booking DateBookingDetail.BookingDate |
→ | Accounting DateAccountingDetail.AccountingDate |
→ | Datum |
30.04.2022 |
30.04.2022 |
30.04.2022 |
30.04.2022 |
Note
If an accounting document is deleted, all associated accounting document items are deleted as well. An accounting document item cannot be reassigned to another accounting document.
Many fields of the accounting document also apply to the assigned accounting document items. To avoid specifying them several times, they are assigned to the accounting document.
There are numerous validation rules for accounting document items. They ensure that the data meets DATEV's requirements for the data transfer.
Info
For an overview of all fields of the accounting document item, see the object reference for the Accounting Document Item object.
Data Transfer
Data Transfer is the class for the data transfer to DATEV.
Some fields have a special meaning:
| Field name | Possible values | Description |
|---|---|---|
| Data Transfer ID | Technical ID | Value from the DATEV data center: Specifies the technical ID of the transfer in the DATEV data center. |
| Folder Name | TEXT(255) | Value from the DATEV data center: Specifies the name of the folder or cash book in Unternehmen online to which the accounting document items were transferred. |
| Consultant Number | 4- to 7-digit number | Value from the DATEV data center: Number of your tax advisor |
| Client Number | 1- to 5-digit number | Value from the DATEV data center: Your client number |
| Client Name | TEXT | Value from the DATEV data center: The name of your company as stored in DATEV Unternehmen online |
| Salesforce Status |
New Preparing Ready For Transfer In Transfer Closed |
The status of the data transfer in Salesforce. |
| DATEV Status |
Open In Progress Finished Aborted Needs Checking Successfully Canceled Canceled with Error Unavailable |
Specifies the status of the data transfer at DATEV. Users can refresh the status only manually using the button Refresh Data Transfer Status. Users can delete data transfers only if they have the status Open.If a data transfer is no longer available on the DATEV side, the status is set to Unavailable, and the locally stored data transfer can be deleted. |
| Accounting Document Item | ID of and link to the Accounting Detail | Link to the accounting document items assigned to the data transfer. |
| Max number of files for Data Transfer | empty or 1- to 4-digit number, max. 4999 |
Taken from the settings when the data transfer is created |
| Max file limitation reached | true or false |
Specifies whether the number of accounting documents in the data transfer was limited because the maximum number of files was exceeded |
To transfer data to DATEV, a Salesforce user must actively log in to DATEV through JustOn Connector for DATEV and grant JustOn Connector for DATEV access to DATEV.
Because this authentication is required and only possible through the user interface, you can perform data transfers only through the Salesforce user interface. It is possible to transfer accounting documents through an API, but it is not possible to create data transfers through an API.
Each data transfer has accounting document items and attachments associated. The accounting document items are references to the objects that can also be accessed through accounting documents. The attachments are copies of the document images from the accounting documents and the metadata (XML files) of the accounting documents as they were transferred to DATEV.
If you have deleted accounting documents containing accounting document items that are assigned to this data transfer (only possible if the data transfer is completed on the DATEV side or has the Salesforce status New, that is, before a transfer is started), you can still see in the attached XML file which accounting document items were transferred to DATEV.
Info
For an overview of all fields of the data transfer, see the object reference for the Data Transfer object.