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
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.