Page 1 of 2

GET Invoice

PostPosted: Thu Mar 15, 2018 4:08 pm
by enueca
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?

Re: GET Invoice  Topic is solved

PostPosted: Thu Mar 15, 2018 4:11 pm
by Mike.Sheen
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

Re: GET Invoice

PostPosted: Thu Mar 15, 2018 4:14 pm
by enueca
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?

Re: GET Invoice

PostPosted: Thu Mar 15, 2018 4:20 pm
by Mike.Sheen
The GET is the invoice details - we actually treat a sales order and invoice as the same document - just with different statuses.

Re: GET Invoice

PostPosted: Fri Mar 16, 2018 12:19 pm
by enueca
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!

Re: GET Invoice

PostPosted: Fri Mar 23, 2018 2:49 pm
by enueca
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!

Re: GET Invoice

PostPosted: Sat Mar 24, 2018 3:36 pm
by Mike.Sheen
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

Re: GET Invoice

PostPosted: Sun Mar 25, 2018 2:35 pm
by Mike.Sheen
FYI - I've added improvement DEV-6544 to change the date serialisation to use ISO8601 format by default.

Re: GET Invoice

PostPosted: Tue Mar 27, 2018 11:36 am
by enueca
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.

Re: GET Invoice

PostPosted: Wed Mar 28, 2018 12:11 pm
by enueca
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.