Forum Discussion

The_Doc's avatar
The_Doc
Ultimate Partner
4 years ago
Solved

API dropping a line in an invoice

Hi MYOB API 

 

I will post directly to you but thought I would drop this on the general post forum for the developers and API people for interesting information.

 

I have a client using a Job Costing package I developed in 2007 - modernised to the latest AR & API.

 

It was modernised to use the latest API previously using the ODBC drivers to connect to the MYOB file.

 

All has been working fine - 100% perfectly - and suddenly the API cannot see a particular line in a Service invoice.

 

The program imports all Sales - Service only - Job Numbers - Purchases

 

It does a cost analysis on a quoted job vs actual costs - and also informs of payments by the customer on the job - identified by 3 digit job numbers.

 

All has been working perfectly since May last year - but suddenly - the API cannot see a particular line in a service sales invoice.

 

Change the description in the description field; change the job number; change the amount - the API will not see it. Delete the description - i.e. make it Null - and it sees it.

 

So to be precise - a customer - who has a lot of jobs running may pay 280,000 - and an invoice (service) is raised and this total may be split over 10 jobs

 

varn 40: remove this item from estimates - $4300    job 322

varn 39: .............                                                  $2300    job 318

varn 40

varn xx:                                                              $15,000  job 317

Varn 40: remove angle on window               $1138    job 322

 

The $1138 will not import - delete the line and rebuild - doesn't work

Reduce description - doesn't work

All other lines are imported fine

I have deleted the line entirely added it to the end or front - it will not import.

Change the job number - will not import.

Delete the description (only on this line) - and it imports fine

 

This sort of bug has me worried - I cannot identify what is causing the API to drop it.

 

I have yet to check the JSON page to see if it is there - and my JSON read code is missing it for some strange reason.

 

I am most concerned about this bug - dropping a line in an invoice is strange behaviour.

 

The Doc

  • Hi Komal_S 

     

    Problem solved - minor bug in my JSON dictionary - my coding loop to decide whether a line in a service invoice was a "Type: Header" or "Type: Transaction" - however my lookup only said - if the word in this line is "Header" then ignore

    instead of - if word in this line is "Type: Header" - 

    and the bug was if the line description had a word in there ........... header ........    then that line was ignored.

     

    And the 1 in 1000 invoices - a description had the word ... header in there which resulted that line being ignored.

    The bug has been fixed.

     

    The Doc 

3 Replies

Replies have been turned off for this discussion
  • Komal_S's avatar
    Komal_S
    MYOB Moderator

    Hi The_Doc 

     

    Thank you for providing that information. 
     
    The API team will look into these notes, if you do want to set up a ticket with them to investigate it further, they will be able to track it in their support system. Alternatively, we can move this post to the API board so it can be responded to here.

    Let us know how you wish to proceed. 
    • The_Doc's avatar
      The_Doc
      Ultimate Partner

      Hi Komal_S 

       

      Thanks for the reply - yes move the post to API board please - ticket 'not yet'

       

      I have done some further investigation this morning - and have noted that the API DOES download both versions - and am now stepping through my JSON to data code to see why this particular transaction line is being missed.

       

      I had thought that by removing the description this particular line is triggering over some variable length in my code - but this isn't it.

       

      I will keep you advised but I think MYOB this is a bug in my code - but not sure! Interesting though!

       

      Regards The Doc

      • The_Doc's avatar
        The_Doc
        Ultimate Partner

        Hi Komal_S 

         

        Problem solved - minor bug in my JSON dictionary - my coding loop to decide whether a line in a service invoice was a "Type: Header" or "Type: Transaction" - however my lookup only said - if the word in this line is "Header" then ignore

        instead of - if word in this line is "Type: Header" - 

        and the bug was if the line description had a word in there ........... header ........    then that line was ignored.

         

        And the 1 in 1000 invoices - a description had the word ... header in there which resulted that line being ignored.

        The bug has been fixed.

         

        The Doc