GET Invoice  Topic is solved

Discussions relating to the REST API of Jiwa 7.

GET Invoice

Postby enueca » Thu Mar 15, 2018 4:08 pm

Hi, if I use the GET SalesOrder/{InvoiceID} API and the Status of the order is "e_SalesOrderClosed", is the returned information the invoice details?
enueca
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Fri Mar 09, 2018 11:55 am

Re: GET Invoice  Topic is solved

Postby Mike.Sheen » Thu Mar 15, 2018 4:11 pm

enueca wrote:Hi, if I use the GET SalesOrder/{InvoiceID} API and the Status of the order is "e_SalesOrderClosed", is the returned information the invoice details?


Hi enueca,

Either processed or closed is considered invoiced. A closed order is certainly invoiced, a processed one may be part invoiced, or not invoiced at all if nothing was shipped yet.

Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: GET Invoice

Postby enueca » Thu Mar 15, 2018 4:14 pm

Hi enueca,

Either processed or closed is considered invoiced. A closed order is certainly invoiced, a processed one may be part invoiced, or not invoiced at all if nothing was shipped yet.

Mike


Thanks Mike, as we only need the final invoice, will consider "Closed" as the final invoice. But is the response from the GET SalesOrder/{InvoiceID} the invoice details? Or do I have to do further GET for more information?
Last edited by enueca on Thu Mar 15, 2018 4:21 pm, edited 1 time in total.
enueca
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Fri Mar 09, 2018 11:55 am

Re: GET Invoice

Postby Mike.Sheen » Thu Mar 15, 2018 4:20 pm

The GET is the invoice details - we actually treat a sales order and invoice as the same document - just with different statuses.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: GET Invoice

Postby enueca » Fri Mar 16, 2018 12:19 pm

Mike.Sheen wrote:The GET is the invoice details - we actually treat a sales order and invoice as the same document - just with different statuses.


Thanks Mike.

There are several information required by the buyer but I cannot easily find in the GET response message and the API documentation. Can you help clarify and advise how I can retrieve these info?
1. Freight Charge - according to Austlink contact, there might be freight charges for the sales order, but I cannot find any freight related charges, only some freight descriptions.
2. Total Tax Amount - I can only see a HistoryTotal which seems to be the Total Order amount with GST. I can get the 10% of the total as the Tax amount or add the TaxToCharge in each line, but they seem not to total.
"HistoryTotal": 2015.53 * .10 = 201.55
"TaxToCharge": 46.9, + "TaxToCharge": 9.33, + "TaxToCharge": 127, = 183.23
3. Invoice Date - can I use the DateProcessed as the Invoiced Date? The values returned by the API is not the expected format:
"DateProcessed": "/Date(1520977074570-0000)/",
4. Invoiced Qty - can you confirm if "QuantityThisDel" is also the invoiced qty?

Thanks!
enueca
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Fri Mar 09, 2018 11:55 am

Re: GET Invoice

Postby enueca » Fri Mar 23, 2018 2:49 pm

Hi, can anyone help with these questions? Thanks.

enueca wrote:
Mike.Sheen wrote:The GET is the invoice details - we actually treat a sales order and invoice as the same document - just with different statuses.


Thanks Mike.

There are several information required by the buyer but I cannot easily find in the GET response message and the API documentation. Can you help clarify and advise how I can retrieve these info?
1. Freight Charge - according to Austlink contact, there might be freight charges for the sales order, but I cannot find any freight related charges, only some freight descriptions.
2. Total Tax Amount - I can only see a HistoryTotal which seems to be the Total Order amount with GST. I can get the 10% of the total as the Tax amount or add the TaxToCharge in each line, but they seem not to total.
"HistoryTotal": 2015.53 * .10 = 201.55
"TaxToCharge": 46.9, + "TaxToCharge": 9.33, + "TaxToCharge": 127, = 183.23
3. Invoice Date - can I use the DateProcessed as the Invoiced Date? The values returned by the API is not the expected format:
"DateProcessed": "/Date(1520977074570-0000)/",
4. Invoiced Qty - can you confirm if "QuantityThisDel" is also the invoiced qty?

Thanks!
enueca
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Fri Mar 09, 2018 11:55 am

Re: GET Invoice

Postby Mike.Sheen » Sat Mar 24, 2018 3:36 pm

Hi enueca,

1. Freight Charge - according to Austlink contact, there might be freight charges for the sales order, but I cannot find any freight related charges, only some freight descriptions.


You want to look at the Cartage fields in the DTO - Cartage1ExGst, Cartage1Gst, Cartage2ExGst, Cartage2Gst, Cartage3ExGst, Cartage3Gst. The freight description fields you are probably seeing is the carrier information.

2. Total Tax Amount - I can only see a HistoryTotal which seems to be the Total Order amount with GST. I can get the 10% of the total as the Tax amount or add the TaxToCharge in each line, but they seem not to total.
"HistoryTotal": 2015.53 * .10 = 201.55


Tax on the history total may not be exactly 10% for a number of reasons - there might be non-taxed items included on the order, or there may be a tax rounding adjustment line (based on a system setting).

The total tax is available by SUMing the TaxToCharge of each sales order line, and then adding on Cartage1Gst, Cartage2Gst and Cartage3Gst from the history object.

3. Invoice Date - can I use the DateProcessed as the Invoiced Date? The values returned by the API is not the expected format:
"DateProcessed": "/Date(1520977074570-0000)/"


The DatePosted of the History is the date the invoice was posted to the general ledger. This will always be an accurate reflection of the invoice date. Other date fields, such as the DateProcessed of the sales order history may not be the true invoice date - depending on system settings and business logic - so always use the DatePosted of the history. DateProcessed is just the date the order was processed, whereas DatePosted is the date it impacts the financial accounts in the system - which is probably what you want.

As for the date format, the Date(1520977074570-0000) format is the default format for dates in our REST API - it's the .NET DataContractSerializer format, but you can override that in responses as I describe here - you can force our API to provide dates in ISO8601 format (e.g.: 2018-03-23T22:20:58+00:00).

4. Invoiced Qty - can you confirm if "QuantityThisDel" is also the invoiced qty?

If it is not a partial delivery, then yes - that is the quantity invoiced. If it is a partial delivery then it will be the amount invoiced if using the sales order has the BillType SalesOrderBillTypes.ShipAndBill (one invoice for each delivery). If using SalesOrderBillTypes.BillComplete then only the final history of the order is billed, and you would need to SUM all the QuantityThisDel lines for each history to arrive at the quantity invoiced.

Mike
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: GET Invoice

Postby Mike.Sheen » Sun Mar 25, 2018 2:35 pm

FYI - I've added improvement DEV-6544 to change the date serialisation to use ISO8601 format by default.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2445
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 757

Re: GET Invoice

Postby enueca » Tue Mar 27, 2018 11:36 am

Mike.Sheen wrote:FYI - I've added improvement DEV-6544 to change the date serialisation to use ISO8601 format by default.


hi Mike

Thanks, we are looking at the other post about forcing API to return in ISO. If not, we will need to wait for the change to default it to ISO8601.
enueca
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Fri Mar 09, 2018 11:55 am

Re: GET Invoice

Postby enueca » Wed Mar 28, 2018 12:11 pm

Hi Mike

As advised by Austlink, we need to append the DocketNumHeader and History as part of the invoice number.

The ‘D01’ is a combination of the Jiwa system setting SY_SysValues.Contents where IDKey = DocketNumHeader and SO_History.HistoryNo.


I can find the History No in the API response, but not able to locate the DocketNumHeader. Can you help confirm if this is available in the json file? Thanks.
enueca
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Fri Mar 09, 2018 11:55 am

Next

Return to REST API

Who is online

Users browsing this forum: No registered users and 2 guests