Re: [Emerald] payment / invoice associations

Josh Hillman ( (no email) )
Wed, 16 Jun 1999 11:38:21 -0400

>Josh Hillman wrote:
>> On Friday night, I finally upgraded our production server from Emerald
>> to Emerald 2.5.278 and from what I can tell, everything is running pretty
>> smoothly (excluding a few minor bugs). Yesterday was the first day that
>> payments were entered in using 2.5 and I noticed sometime today, that
>> between today's and yesterday's payments, a couple were made
>> but they were never associated with an invoice for some reason. Any idea
>> why this occurred?
>From: Dale E. Reed Jr. <>
>A couple. Typically this is when the total of the line items doesn't
>matcht the amount of the payment (regardless of the invoice amount
>itself). This roots to the bug that has been discussed about 278 and
>earlier where the invoice items total doesn't match the invoice total.

That makes sense for the $109.72 6/month invoice (created by Emerald 2.1.11)
because the setup charge was $10.00, but when viewing the invoice details in
Emerald 2.5.278, the line total displays $60.00, eventhough the invoice
total is correctly displayed as $99.72 + $10.00.

>The other (and more likely as a read below) is that Emerald 2.1 didn't
>have a quantity per line item, like 2.5 does. Therefore, the Invoice
>quantity is copired to all the Invoice Item quantities, which works most
>of the time, except when you have some like a charge on the account
>has a quantity different than the Old 2.1 invoice, causing the
>line item total I noted above to be calculated wrong, and Emerald
>doesn't stampl the paymentid.

I can see how that would happen. I know that all charges in the system
(originating from the charges table) should have a quantity of one, so the
following script would fix all of them, right?

update ii
set ii.quantity = 1
from invoiceitems ii, charges c
where exists (select c.itemid
from charges c, invoiceitems ii
where c.itemid = ii.itemid)
and c.itemid = ii.itemid
and quantity > 1

>Its really not a big deal. In Emerald 2.5, the balance is really the
>most important thing, not whether line items are associated to payments,
>like 2.1 did. In 278 and higher, if you bring the balance to 0 or a
>credit, it should update all non-paid line items with the payment that
>brought the balance to a 0 or credit. This should help for those
>people meticulous about the payment tracking.

Balances are all fine. I fixed them immediately after upgrading, using a
script that you wrote a while back. The bean-counters like the reports I
give them, associating payments with invoices, etc. so that's why this is
somewhat of a slight issue.