[Emerald] paying certain invoices pays old voided invoices

Josh Hillman ( (no email) )
Wed, 28 Jul 1999 12:35:51 -0400

Yesterday, I created an invoice of Type='Invoice' for 6 months of service ($5.00/month), totalling -$30.00 (credit). Because you
can't pay invoices if the amount is negative, I had to mark it paid as 30.00, then run the following to fix it:
update payments set amount = 0-amount where paymentid = 17310

Today we realized that there are now 3 invoices that have this payment associated with them and there's supposed to be only one.
The invoice above, is fine, but the 2 others were old voided, never-paid invoices. Why were those two old ones associated with this
paymentid??

Invoiceitems:
ItemID InvoiceID Amount PaymentID Quantity
----------- ----------- -------- ----------- -----------
579 385 19.95 17310 1
17462 10848 19.95 17310 1
32635 20141 -5.00 17310 6

Invoices:
InvoiceID CustomerID Type Amount Date StartDate EndDate Months LastModifyDate SentDate
--------- ---------- -------- -------- ----------- ---------- ---------- ------ -------------- -----------
385 97 VOID 19.95 Jan 13 1997 Feb 3 1997 Mar 3 1997 1 Jan 13 1997 (null)
10848 97 VOID 19.95 Oct 1 1998 Nov 1 1998 Dec 1 1998 1 Oct 1 1998 Oct 1 1998
20141 97 Invoice -30.00 Jul 27 1999 Jan 1 2000 Jul 1 2000 6 Jul 27 1999 Jul 27 1999

Payments:
PaymentID CustomerID Amount Date LastModifyDate
----------- ----------- -------- ----------- --------------
17310 97 -30.00 Jul 27 1999 Jul 27 1999

Apparently, this behavior has popped up in the past also since we've been using Emerald 2.5

Emerald 2.5.278

Josh

For more information about this list (including removal) go to:
http://www.iea-software.com/support/maillists/liststart