[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AR Reports



On Wed, Mar 10, 2010 at 11:20 AM, Ian Goodacre <..hidden..> wrote:
> Sorry for being so vague. Yes, CVS Trunk.
>
> >From the menu I am navigating through AR, Reports and Outstanding. I am
> not setting any search fields but selecting either summary or detail
> report. I am working with a test database containing only two invoices:
> one paid in full and the other with a couple of partial payments against
> it.
>
> I am expecting only the invoice that has not been paid in full to be
> reported and this is what I see.
>
> In the detail report I am expecting to see one line item where the
> amount is the total amount of the invoice and paid is the sum of the
> partial payments. The amount is correct but initially (before receiving
> any payments) the amount in the paid column was twice the total amount
> of the invoice. As the payments were received the amount in the paid
> column decreased towards the total amount.

Sounds like not properly multiplying by -1 or not depending on AR vs
AP.  yes, this would be in the db query.
>
> In the summary report, I am expecting to see one line item where the
> number in the invoice column is the number of invoices summarized (one
> in this case), the number in the amount column is the sum of the total
> values of all the invoices summarized and the number in the paid column
> is the sum of the amounts paid against each of the invoices. But what I
> see is quite different:
>
> The number in the invoices column is the number of (excuse my
> terminology) transactions against the AR account, summed across all the
> invoices summarized (only one in my test data). Each time I record a
> payment against the invoice the number in the invoice column goes up by
> one.

Ok, so it's probably hitting the number of acc_trans records against
the AR account.  Also a DB query issue.

>
> The number in the amount column is the total amount of the invoice
> multiplied by the number of transactions against the AR account for the
> invoice. Each time I record another payment against the invoice, the
> amount goes up by the total amount of the invoice.

This sounds like a join projection issue.
>
> The number in the paid column is also incorrect but I haven't yet looked
> at it in detail.

Ok...
>
> Given the data in ar, acc_trans and chart, the SQL in LedgerSMB/AA.pm
> appears to be incorrect in many respects.

Ok....  in the details report case, the issue is almost certainly that
it is getting debits and credits confused.  This is why it would word
without issue for AP reports but add instead of subtract for AR
reports.

On the summary report, I have less test data on that (and
unfortunately anything that is still on pseudo-SL code is impossible
to automatically test...)  These issues sound like they may include:

1) Join projection issues
and/or
2)  Debit/Credit confusion

The summary report might also be ignoring the approved flag on both
the acc_trans and ar/ap tables.

Hope this helps!
Best Wishes,
Chris Travers