10. Expense Report
Interface
It allows you:
to insert new expense report (master&details in one json file)
to view expense report (master&details in one json file)
to print
Prerequisites:
In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:
to have an Organization active
to have an Warehouse active
to have Business Partners active
to have Employees active
to have a price list active
Columns that can be used as filters:
Organization
DocType
DocumentNo
BPartner (Employee)
DocumentStatus
IsSOTrx ("true/false"):
true - means document has a sales price list on it (the document is an estimate or a quotation for customer);
false - means document has a purchase price list on it (the document is an expense report from an employee)
DateExpense - Range
StartDate - Range
EndDate - Range
Actions can be done:
list
create
print
Expense Report fields (Master&Details)
A Expense Report in SocrateCloud has the following structure:
Master document (see Expense Report Master) which contains data about header document:
Organization
Document Type
Document No.
Expense Report Date
Employee
Warehouse
Price list
Description
Document details (see Expense Report Details) which contains the epenses with informations about:
Product
Quantity
Selling price
VAT
To update only master data, or a specific expense line see Expense Report Master, Expense Report Details chapters.
API Methods:
List:
URL: https://api.socratecloud.com/webapi/rest/expense_report/full/list/0?startRow={0}&endRow={100}&accessToken={access_token}
Method: GET
Available filter parameters:
Organization
DocType
DocumentNo
BPartner
DocumentStatus
IsSOTrx ("true/false") - if is it true - filter will be applied on sales price list and if it is false filter will be applied on non-sales price list
DateExpense - Range
StartDate - Range
EndDate - Range
Return: JSON object with next format:
{
"Organization": "Test A SRL",
"Created": "2020-06-05 13:19:51+0000",
"CreatedBy": "TESTBEBE_Admin",
"Updated": "2020-06-05 13:27:46+0000",
"UpdatedBy": "Bebe-BIT 1",
"DocType": "Decont",
"DocumentNo": "1000315",
"Description": "Decont din expense app",
"ExpenseDate": "2020-06-04 00:00:00+0000",
"StartDate": null,
"EndDate": null,
"BPartner_ID": 1000379,
"BPartner": "Florin David",
"BPartnerName": "Florin David",
"Warehouse": "Depozit A-10",
"Warehouse_ID": 1000006,
"PriceList": "RON CMP cu TVA",
"Currency": "RON",
"TotalLines": 558.44,
"DocumentStatus": "Completed",
"DocumentAction": "Close",
"TaskDocumentNo": null,
"TimeExpense_ID": 1005265,
"IsPaid": false,
"lines": [
{
"Organization": "Test A SRL",
"Created": "2020-06-05 13:19:51+0000",
"CreatedBy": "TESTBEBE_Admin",
"Updated": "2020-06-05 13:19:51+0000",
"UpdatedBy": "TESTBEBE_Admin",
"Active": true,
"TimeExpenseLine_ID": 1004623,
"Line": 10,
"DateExpense": "2020-06-04 00:00:00+0000",
"SourceDocNo": "PRL 3856",
"Product": "CH-001",
"SKU": "accommodation",
"Product_ID": 1121556,
"ProductName": "Accommodation",
"Description": "Cazare",
"QtyEntered": 1,
"UOM": "Each",
"Price": 234,
"Amount": 234,
"BPartner": "MILEXIM",
"BPartnerName": "MILEXIM SRL",
"BPartner_ID": 1000838,
"User_ID": 1000873,
"UserName": "Florin David",
"VendorName": "FOND EXIM S.R.L.",
"TaxID": "400350",
"IsTimeReport": false,
"IsInvoiced": false,
"Project": "T01-2020 - proiect cu finanțare externă",
"Project_ID": 1007503,
"ProjectPhase": "T01-2020-PERSONAL",
"ProjectPhase_ID": 1004068,
"ProjectSubPhase": null,
"ProjectSubPhase_ID": null,
"Activity": "Activitate 0",
"TrxOrganization": null,
"Asset_ID": null,
"AssetValue": null,
"Summary": null,
"InvoicePrice": 0
},
{
"Organization": "Test A SRL",
"Created": "2020-06-05 13:19:51+0000",
"CreatedBy": "TESTBEBE_Admin",
"Updated": "2020-06-05 13:19:51+0000",
"UpdatedBy": "TESTBEBE_Admin",
"Active": true,
"TimeExpenseLine_ID": 1004624,
"Line": 20,
"DateExpense": "2020-06-04 00:00:00+0000",
"SourceDocNo": "PRL 3856",
"Product": "CH-004",
"SKU": "protocol",
"Product_ID": 1121559,
"ProductName": "Protocol",
"Description": "Masă ",
"QtyEntered": 1,
"UOM": "Each",
"Price": 324.44,
"Amount": 324.44,
"BPartner": "MILEXIM",
"BPartnerName": "MILEXIM SRL",
"BPartner_ID": 1000838,
"User_ID": 1000873,
"UserName": "Florin David",
"VendorName": "FOND EXIM S.R.L.",
"TaxID": "400350",
"IsTimeReport": false,
"IsInvoiced": false,
"Project": "T01-2020 - proiect cu finanțare externă",
"Project_ID": 1007503,
"ProjectPhase": "T01-2020-PERSONAL",
"ProjectPhase_ID": 1004068,
"ProjectSubPhase": null,
"ProjectSubPhase_ID": null,
"Activity": "Activitate 0",
"TrxOrganization": null,
"Asset_ID": null,
"AssetValue": null,
"Summary": null,
"InvoicePrice": 0
}
]
}
Create:
URL: https://api.socratecloud.com/webapi/rest/expense_report/full/create/{version}?accessToken={access_token}
Method: POST
Return: document no for success or error message (start with "ERROR: ")
Data format:
{
"Organization":"Demo SRL",
"DocType": "Decont",
"DocumentNo":null,
"Description":null,
"ExpenseDate":"2014-07-22 00:00:00+0000",
"BPartner":"EMPLCODE",
"Warehouse":"DEP7",
"PriceList":"EUR Prices",
"DocumentAction":null,
"lines": [
{
"Organization":"Demo SRL",
"Active":true,
"DateExpense":"2014-07-20 00:00:00+0000",
"SourceDocNo":"1000042",
"Product":"Prod1",
"Description":null,
"QtyEntered":5,
"Price":null,
"BPartner":null,
"VendorName":null,
"TaxID":null,
"IsTimeReport":false,
"IsInvoiced":false,
"Project":"Test",
"ProjectPhase":null,
"ProjectSubPhase":null,
"Activity":null
}
]
}
Print:
URL: https://api.socratecloud.com/webapi/rest/expense_report/print/{version}?accessToken={access_token}&DocumentNo={document_no}
Method: GET
Return: PDF file