Re: [Emerald] voiding invoices for inactive MBRs

Dale E. Reed Jr. ( (no email) )
Mon, 17 May 1999 21:40:24 -0700

Josh Hillman wrote:
>
> Would the following script work if I wanted to void all unpaid, non-voided
> invoices associated with MBRs that have been deactivated? I'm guessing this
> may change the status of an invoice a few times in a row if there are
> multiple InvoiceItems associated with that InvoiceID.
> This is relative to Emerald 2.1.11, not 2.5.
>
> update i
> set i.Type = 'Void',
> i.LastModifyDate=getdate(),
> i.LastModifyUser=user_name()
> from invoices i, invoiceitems ii, masteraccounts ma
> where i.invoiceid = ii.invoiceid
> and ma.customerid = i.customerid
> and ii.paymentid is null
> and i.type != 'void'
> and ma.active = 0

Looks like it should work. Not sure if you care to update the
balances for it, though.

-- 

Dale E. Reed Jr. Emerald and RadiusNT__________________________________________IEA Software, Inc. www.iea-software.com