Forum Discussion

TamworthIT's avatar
6 years ago

Sales Item / Service incorrect

Hi,

 

I have developed a small application that pulls data using the API to generate a timber cut list for a client.  This has been working fine until recently where I have found that I am missing some Invoice Numbers.  I have identified the issue as that the Invoice Number shows if I call

 

http://localhost:8080/accountright/cf_uri/Sale/Order/service/?$top=1000

but not

http://localhost:8080/accountright/cf_uri/Sale/Order/item/?$top=1000

 

When I look at the affected Invoice Numbers in the sales register the Layout is set to Item and everything appears correct.

 

If I call http://localhost:8080/accountright/cf_uri/Sale/Order I am able to see the invoice numbers are listed as "URI": "http://localhost:8080/AccountRight/cf_uri/Sale/Order/Service/uri",

 

I have attempted to recreate from the original quote the Invoice however each time it becomes a service rather than an item.  This is further an issue as the service fails to return values for UnitCount which prevents me from correctly generating the required cut lists.

 

Is there a way to force an Invoice to be an Item rather than a Service?  It should be an Item in the first place. 

 

Thanks

 

10 Replies

Replies have been turned off for this discussion
  • dlarosa's avatar
    dlarosa
    Contributing User
    6 years ago

    I am experiencing a nearly identical issue with Purchases. Within the MYOB application, it is an Item Purchase Order with an item line, but through the API it does not come through the ItemPurchaseService, it comes through the ServicePurchaseService.. and as the original poster mentions, the lines from the API do not contain item codes because the API believes it is a ServicePurchase. In addition, it also comes through the generic PurchaseService, but with order type "Service".

    I need access to the Item Lines.

    All other Item Purchase Orders come through correctly, not sure why the API believes this particular Purchase is a Service Purchase.

     

  • dlarosa's avatar
    dlarosa
    Contributing User
    6 years ago

    Hi John.. Thanks for the link... Last week, I stumbled across the issue you bring up on that post, but as you mention, it's a simply fact of ignoring it. In other words, I assumed that the ItemPurchase endpoint returning ItemPurchase objects with the status of Service was just a bug.. This did not prevent me from using the ItemPurchaseLines as they were all correct. So even though, the ItemPurchase had a status of "Service", this was easy enough to ignore and still do work we required. I have no trouble processing the majority of our purchases.

     

    The issue I am describing, and also described on the post by the poster that you link is a different issue than just an incorrect status. Namely, no purchase is returned when querying the ItemPurchase Endpoint for a specific item purchase. The only way to get the purchase, is by querying the ServicePurchase endpoint, or the Purchase endpoint.. both of which don't give you lines you can use.. I am yet to find the specific conditions for a purchase to get incorrectly placed via endpoint... funnily enough, after conversion to bill, it then gets correctly positioned, in other words, i can successfully get it from the ItemBill endpoint.

  • John_Dinning's avatar
    John_Dinning
    Trusted User
    6 years ago

    Ah ok. So you are having this problem with one particular Item Purchase Order and not all of them is that correct?

     

    I am using the SDK/API and am able to return an Item Purchase Order (and its lines) using the ItemPurchaseOrderService and ItemPurchaseOrderSvc.GetRange with this filter (e.g.):

    $filter = Number eq '00000012'

     

    I have not noticed it fail yet, but that doesn't necessily mean that it hasn't.

     

     

     

  • dlarosa's avatar
    dlarosa
    Contributing User
    6 years ago

    Hi John. Correct, the problem is only with some Item Purchase Orders. Out of the last 30 Item Purchase Orders, I have had the problem with about 3 of them.

     

    Like you, we are also using the ItemPurchaseOrderSvc.GetRange function.. filtering specifially for the invoice number like you mention... it returns nothing for the problem item purchase orders... because of this, I went hunting for it, and found out it returns from the ServicePurchaseOrderSvc instead.

  • Hi dlarosa,

     

    It sounds like we are having the same issue with Sales rather than Purchases.  I am not using the SDK/API but have been testing using Insomnia to look at the raw returns for various GETs.  I have also been in touch with the apisupport team and they have confirmed that there is a bug with Items / Services.

     

    As suggested by John, I have attempted to return the line items using a filter, but again the return only works if I request Service types and I am missing specifically the ShipQuantity line.  Looking at the documentation the Service GET doesn't return ShipQuantity. 

     

    So far it has only happened for 2 Items that I have found, but there doesn't appear to be a reason for it.  API support have suggested recreating the Invoice in MYOB but for us this hasn't worked as the recreated Invoice is still a Service type when it should be an Item.

  • dlarosa's avatar
    dlarosa
    Contributing User
    6 years ago

    Hi TamworthIT

     

    to summarise, there appears to be three issues:

     

    1) some (only some) item invoices are not available through the item invoice endpoint, no matter how you try and query for it... Querying by invoice number, by client, by all invoices - none of these methods will retrieve the effected invoice.. this only effects some invoices, and it is not obvious why this happens.. MYOB application shows as an item invoice correctly.. you can get the invoice from the service invoice endpoint instead and also from the generic invoice endpoint, neither of which has item lines.. the service invoice returns service lines, and the generic invoice returns no lines..

     

    2) indentical to problem 1), but in the realm of purchases.

     

    3) the item purchase endpoint incorrectly returns OrdeyType as OrderLayoutType of Service instead of Item.

     

  • DLarosa,

     

    ARMH is no longer withus so your query was forwarded to me. 

     

    We encountered this issue for a particular supplier and no matter what we tried we could not resolve.  We contacted MYOB and got them to investigate and the only advice offered was to create a new supplier card.

     

    This we did and since then we have had no issues with the orders being picked up as a Item type.

     

    So, whatever MYOB spotted, it had to be an issue with the supplier and creating a new supplier card for going forward with solved the issue.

     

    Cheers

    Steve

  • dlarosa's avatar
    dlarosa
    Contributing User
    6 years ago

    Hi Steve

     

    Thanks for the reply.. We have the issue with multiple suppliers, but I will try make a brand new supplier card and see if it resolves the issue.

     

    Thanks, and I will let you know how our test goes.

     

    Cheers

  • dlarosa's avatar
    dlarosa
    Contributing User
    6 years ago

    We created a new Supplier Card and the issue still happens.

    We have now narrowed down the scenario that causes the issue.

     

    Step 1) Create a Sale Order in MYOB.

    Step 2) Click the "Create PO" button from the Sale Order.

    Step 3) Save the PO that MYOB creates.

     

    In other words, the issue occurs if you use the "Create PO" button from a Sale Order.

    This "Item" PO will not be available from the Item Purchase Endpoint, and will only be available from the Service Purchase Endpoint and the Generic Purchase endpoint, neither of which gives you the Item Lines, as described earlier in this post.