RE: voiding a payment

Bill Bongiorno ( (no email) )
Fri, 31 Jul 1998 17:15:53 -0400

Thanks, Josh. The problem I found with Dale's solution of checking for a
voided invoice is, to relate a payment to an invoice requires linking
payment id via the invoice items table. If there are multiple items for an
invoice, the payment is listed more than once. It's probably possible to
avoid this, but I can't figure out how.

Bill Bongiorno
SysTec Computer Associates, Inc.

> -----Original Message-----
> From: emerald-request@iea-software.com
> [mailto:emerald-request@iea-software.com]On Behalf Of Josh Hillman
> Sent: Friday, July 31, 1998 12:56 PM
> To: emerald@iea-software.com
> Subject: Re: voiding a payment
>
>
> > From: Bill Bongiorno <bill@systec.com>
> > Occassionally we apply a payment to the wrong invoice. Dale said voiding
> the
> > invoice will effectively void the payment. But it still appears on
> reports,
> > for example the Daily Payment Register. How do others handle this
> problem?
>
> /* Delete a payment from the database */
> /* This does NOT subtract the payment from MasterAccounts.Balance */
> /* Or modify the expiration, paidthru, last-received dates */
>
> DECLARE @PaymentID int
> SELECT @PaymentID = /* Enter PaymentID to be deleted */
>
> UPDATE InvoiceItems
> SET PaymentID = NULL
> WHERE PaymentID = @PaymentID
>
> DELETE FROM Payments
> WHERE PaymentID = @PaymentID
>
>
> Josh Hillman
> hillman@talstar.com
>