Case Study
A POS system vendor is upgrading his system to integrate with our accounting software, which will allow the users to post the daily sales to the pre-configured accounts. The retail outlets using this POS system accept payment by cash, credit card, and debit card.
Answer:
Yes, the third party software vendor can now easily integrate with QNE Optimum with the API from QNE Optimum.
Please visit http://qnehelp.azurewebsites.net/default.htm#cshid=1091 for more information.
Analysis
Create a journal voucher with the following posting entries
Challenge
ϒ Access chart of accounts.
ϒ Post a journal voucher to system from the daily sales report.
ϒ Generate the GL posting entries base on the posted journal voucher.
Example in Action(C#)
ϒ Create a new Windows Application project, for demo purpose, I will name it Sample_POS
ϒ Add web reference http://qneapi.azurewebsites.net/v1.svc to the project
ϒ Add a new windows form and add the necessary controls to the form.
Optionally, you can add the following settings to the project, to reduce human effort base of your chart of account.
Http Request Reference:
ϒ Get authentication user cookie
Request
Path:
Response
{
odata.metadata: "http://qneapi.azurewebsites.net/v1.svc/$metadata#Edm.String"
value: "B16CF1994992FDCAEDFB75826FE4DEE2B7D9E0C2244832C2DD7FD8F6E72D7E1560BCF63A25894E6D470AC130B23DA0C2DBE168C966936C28E1281FE261C06C65D2EF2258A7E2D192EEF6BFFBBA94ACF63E875375937425A732CE111279EA17A24B29BEA62D697D9B768DAAD5BB8BAE0973562E80FA1AD4CF745B7AA62E4333E1958A5DC3A50907485198871D7207658AC07889917675C7CB1377EDA5BE247EB4BE0D3E747234F647406CE536F126A20925F3A74B63182E40A2728AE3FDDF924DE4752962CB17BC5C599016C2EDD34BECA9A76ECAF189D40EC5A1EAC5ADC72329DFD4C114204F17580ED6D1F679C5F0FC"
}
ϒ Get GLAccounts information by GLAccountCode
[Request]
Path:
GET http://qneapi.azurewebsites.net/v1.svc/GL_GLAccount?$filter=GLAccountCode eq '700-0400' or GLAccountCode eq '700-0310' or GLAccountCode eq '700-0320' or GLAccountCode eq '100-0100' &$format=application/json&$select=Id,GLAccountCode
Header:
userCookie:B16CF1994992FDCAEDFB75826FE4DEE2B7D9E0C2244832C2DD7FD8F6E72D7E1560BCF63A25894E6D470AC130B23DA0C2DBE168C966936C28E1281FE261C06C65D2EF2258A7E2D192EEF6BFFBBA94ACF63E875375937425A732CE111279EA17A24B29BEA62D697D9B768DAAD5BB8BAE0973562E80FA1AD4CF745B7AA62E4333E1958A5DC3A50907485198871D7207658AC07889917675C7CB1377EDA5BE247EB4BE0D3E747234F647406CE536F126A20925F3A74B63182E40A2728AE3FDDF924DE4752962CB17BC5C599016C2EDD34BECA9A76ECAF189D40EC5A1EAC5ADC72329DFD4C114204F17580ED6D1F679C5F0FC
[Response]
{
odata.metadata: "http://qneapi.azurewebsites.net/v1.svc/$metadata#GL_GLAccount&$select=Id,GLAccountCode"
value: [4]
0: {
Id: "c166cb8d-68c9-4e9b-b87f-2cfe4a90f7e9"
GLAccountCode: "100-0100"
}-
1: {
Id: "8e373d4a-86d5-47a2-93e9-9e2b87b5a7b3"
GLAccountCode: "700-0310"
}-
2: {
Id: "d3dae956-7b69-4284-8fd7-5ce93e27af76"
GLAccountCode: "700-0320"
}-
3: {
Id: "f88246ed-dc30-4ee4-b3d5-a074685d1c65"
GLAccountCode: "700-0400"
}-
-
}
ϒ Create Journal voucher with details
[Request]
Path:
POST http://qneapi.azurewebsites.net/v1.svc/GL_Journal
Header:
userCookie: B16CF1994992FDCAEDFB75826FE4DEE2B7D9E0C2244832C2DD7FD8F6E72D7E1560BCF63A25894E6D470AC130B23DA0C2DBE168C966936C28E1281FE261C06C65D2EF2258A7E2D192EEF6BFFBBA94ACF63E875375937425A732CE111279EA17A24B29BEA62D697D9B768DAAD5BB8BAE0973562E80FA1AD4CF745B7AA62E4333E1958A5DC3A50907485198871D7207658AC07889917675C7CB1377EDA5BE247EB4BE0D3E747234F647406CE536F126A20925F3A74B63182E40A2728AE3FDDF924DE4752962CB17BC5C599016C2EDD34BECA9A76ECAF189D40EC5A1EAC5ADC72329DFD4C114204F17580ED6D1F679C5F0FC
Content-Type: application/json
Payload:
{
DocDate: "2015-01-01",
Description: "POSTED FROM POS SAMPLE",
Details:
[
{Pos:1, Description:"CASH FROM POS", DebitForeign:"1000.00", "GLAccount@odata.bind": "http://qneapi.azurewebsites.net/v1.svc/GL_GLAccount(guid'f88246ed-dc30-4ee4-b3d5-a074685d1c65')"},
{Pos:2, Description:"CASH FROM POS", DebitForeign:"2000.00", "GLAccount@odata.bind": "http://qneapi.azurewebsites.net/v1.svc/GL_GLAccount(guid'8e373d4a-86d5-47a2-93e9-9e2b87b5a7b3')"},
{Pos:3, Description:"CASH FROM POS", DebitForeign:"3000.00", "GLAccount@odata.bind": "http://qneapi.azurewebsites.net/v1.svc/GL_GLAccount(guid'd3dae956-7b69-4284-8fd7-5ce93e27af76')"},
{Pos:4, "Description":"CASH SALES", "CreditForeign": "6000.00", "GLAccount@odata.bind": "http://qneapi.azurewebsites.net/v1.svc/GL_GLAccount(guid'c166cb8d-68c9-4e9b-b87f-2cfe4a90f7e9')"}
]
}
[Response]
{
odata.metadata: "http://qneapi.azurewebsites.net/v1.svc/$metadata#GL_Journal/@Element"
Id: "983bf7f9-b96c-4137-b0a6-9313a5c1f6c1"
IsCancelled: false
JournalEntryType: 0
DocCode: "JV1501/013"
DocDate: "2015-01-01T00:00:00"
Description: "POSTED FROM POS SAMPLE"
CurrencyRate: "1"
Notes: null
TotalDebit: "0"
TotalCredit: "0"
IsBadDebtRelief: false
IsBadDebtRecovery: false
IsUnpaidPurchase: false
IsPaymentForUnpaidPurchase: false
IsTaxInclusive: false
}
ϒ Post financial entries for the created jounal
[Request]
Path:
POST http://qneapi.azurewebsites.net/v1.svc/PostGL?key=guid'983bf7f9-b96c-4137-b0a6-9313a5c1f6c1'
Header:
userCookie: B16CF1994992FDCAEDFB75826FE4DEE2B7D9E0C2244832C2DD7FD8F6E72D7E1560BCF63A25894E6D470AC130B23DA0C2DBE168C966936C28E1281FE261C06C65D2EF2258A7E2D192EEF6BFFBBA94ACF63E875375937425A732CE111279EA17A24B29BEA62D697D9B768DAAD5BB8BAE0973562E80FA1AD4CF745B7AA62E4333E1958A5DC3A50907485198871D7207658AC07889917675C7CB1377EDA5BE247EB4BE0D3E747234F647406CE536F126A20925F3A74B63182E40A2728AE3FDDF924DE4752962CB17BC5C599016C2EDD34BECA9A76ECAF189D40EC5A1EAC5ADC72329DFD4C114204F17580ED6D1F679C5F0FC
Content-Type: application/json
[Response]
{
odata.metadata: "http://qneapi.azurewebsites.net/v1.svc/$metadata#Edm.Boolean"
value: true
}
Final Output
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article