Re: voiding a payment

Josh Hillman ( (no email) )
Fri, 31 Jul 1998 12:56:28 -0400

> 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