Forum Discussion

Deon071371's avatar
2 years ago

Invalid Amount - Solved

Update: Solved the formula for that quantity.

 

===========

 

Hi Everyone,

 

A client requested me to develop a software that will later export invoices to MYOB AccountRight.  She has another software currently in use but that has several limitations and is making her consume a lot of time, so we designed a new one based on her requests.  Everything is okay until we go to the importing side of MYOB.  All items under EACH goes through but those that are per week don't.   In my software, the formula to get a total amount is this (based on her formula given to me as well). Factor is the divisor of the unit price so since the sample is m/week, factor there is 7

 

total = ((unit price/ factor) * quantity) * duration
 
total = ((.93/7 days)*35) * 30 days
 

But as mentioned, I am getting invalid amount on items that are not on EACH measurement.  She sent me a set of records that went in properly under the current software she is using for later export.  And I am wondering where the Quantity (see attached) is coming from there or how it is being recalculated.  In data entry, it is just 47.5 (first data) but on the exported file, it is 203.571429.   When I reverse the formula to get the qty:

 

qty = (total/(up/factor))/duration

 

That still resulted to 47.4996415770609 which is 47.50.  So I am wondering where that 203.671429 on the imported text file is coming from.  As that was accepted by MYOB

 

So my question boils down to how does AccountRight calculates the quantity being imported?  I suspect that is the reason why I am getting invalid amount as it seems AccountRight recalculates values during import.  

 

I have tried variations of the values on my end, such as "$1,500.45" and 1500.45, to no avail.  Test.txt is the latest variation I have

 

Many thanks to those who can guide me.