[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AR Reports
- Subject: Re: AR Reports
- From: Ian Goodacre <..hidden..>
- Date: Thu, 11 Mar 2010 08:20:33 +1300
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.
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.
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.
The number in the paid column is also incorrect but I haven't yet looked
at it in detail.
Given the data in ar, acc_trans and chart, the SQL in LedgerSMB/AA.pm
appears to be incorrect in many respects.
I can "correct" the paid amount in the detail report by changing
'a.amount - sum(acs.amount)' to 'a.amount + sum(acs.amount)' in the
relevant queries. But I wonder if the sign error is in my data rather
than the query.
Correcting the summary report seems more problematic. The join of ar to
acc_trans produces several records for each invoice, with more records
produced as the number of partial payments increases. The amount field
is the sum of the amount field in all these joined records where it
should be one amount for each summarized invoice and there is a similar
"multiplication" in the calculation of the amount paid.
At this point I am assuming the data is correct and changing the SQL.
The detail report is easy to fix, as noted above, and I have made this
change throughout LedgerSMB/AA.pm.
I am not working on the summary report. What I am trying is to
encapsulate the detail report query into an outer query that summarizes
it. I'll let you know how it goes.
But, as I am so new to LedgerSMB, I may be entirely wrong in my
assumptions and (mis-)understanding of what is wrong, so i would be
happy to be redirected.
Regards,
Ian Goodacre
On Wed, 2010-03-10 at 10:51 -0800, Chris Travers wrote:
> On Wed, Mar 10, 2010 at 3:28 AM, Ian Goodacre <..hidden..> wrote:
> > Hi,
> >
> > Is it possible that there are many errors in LedgerSMB/AA.pm affecting
> > the AR reports of outstanding invoices in a recent checkout from CVS?
>
> I assume you are talking about svn trunk here?
>
> I haven't checked the AR outstanding report too closely but it shares
> the same code with the AP outstanding report which has been fairly
> thoroughly tested.
> >
> > The detail report indicates the amount paid incorrectly for outstanding
> > invoices and the summary report indicates the count of invoices
> > summarized (I assume this is what the Invoice column is intended to
> > indicate) total and amount paid all incorrectly.
>
> Which report is this exactly? What are you doing to get there? What
> do you expect to see? What are you seeing?
>
> Best Wishes,
> Chris Travers
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Ledger-smb-devel mailing list
> ..hidden..
> https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel