Re: [Emerald] voiding invoices for inactive MBRs

Don Barron ( (no email) )
Tue, 18 May 1999 15:50:56 +0930

How would I got about starting invoices from scratch.

We have not been using invoicing but now we wont to start using it and the
system thinks xxx amount of people owe us money etc.

But the main thing I dont want to do is scrap any users current time as in
the expiry date and amount of hours they have left.

>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