Simplicty and flexibility!


Printe All Invoices


Started by Garry O'Driscoll
Search
You will need to Sign In to be able to add or comment on the forum!

Printe All Invoices

Hi, I have inherited a system built on Dataease and have no experience using it so would be hugely greatful for a little advice.

We have a procedure that prints a single invoice which works fine but I need to create new procendure that will print every invoice in the DB

see below current procedure for printing a single invoice:

define temp "tInvNo" text 6 .
tinvno := GetArray(1) .
define "retval" text .
for InvoiceHeader with InvNo = tinvno ;
list records
Address1 ;
Address2 ;
Address3 ;
Address4 ;
Postcode ;
CustomerName ;
InvNo ;
InvDate ;
TOTvatexempt ;
TOTvatable ;
TOTvat ;
Post ;
INVOICETOTAL ;
PaymentMethod ;
all InvoiceItems ProductCode ;
all InvoiceItems Description ;
all InvoiceItems UnitPrice ;
all InvoiceItems Qty ;
all InvoiceItems NettLineTotal .
end


Written by Garry O'Driscoll 06/09/16 at 10:33:54 LegEasy 6 Windows

Re:Printe All Invoices

Hi Gary

If you genuinely want ALL Invoices to be printed then change the line

for InvoiceHeader with invno = tinvno ;

to

for InvoiceHeader ;

But if you want just some of the Invoices to be printed, find the procedure that is currently setting the array value using the command SetArray, add another SetArray statement to place another value into a different element of the array (2 say, if it does not interfere with anything else) and use the following line (You will need another define temp and  GetArray to obtain the other value into tinvno2 say)

for InvoiceHeader with invno >= tinvno and invno <= tinvno2 ;

where the elements set into the array and obtained by the two GetArray statements are the first and last Invoice numbers required.

PB Associates

Please call us if this is not clear.


Written by Peter Birney, PB Associates 06/09/16 at 12:55:47 LegEasy 6 Windows

Re:Re:Printe All Invoices

Thanks that's done it, yes I wanted to print all invoices as a one off so have done that and then changed the line back.


Written by Garry O'Driscoll 07/09/16 at 14:34:18 LegEasy 6 Windows
DG3_ForumList