<% *RETURN dbclocation crlf=CHR(13)+CHR(10) SET DATE ymd set mark to '-' SET CENTURY ON SELECT TOP 1 *, VAL(transid) as vtr FROM (dbclocation+'payment') ORDER BY date desc, vtr desc, transid DESC INTO CURSOR x SCATTER NAME SearchResults if empty(date) thedatestring=transform(date()) else thedatestring=transform(date) endif openingbalance=[] if BETWEEN(val(left(SearchResults.customer,2)),1,8) select sum(debit-credit) as dayopening from (dbclocation+[acctran]) where accountid=SearchResults.customer and date]+ALLTRIM(accounts.name)+[] =SEEK(SearchResults.depositid,[accounts],[accountid]) cdebitor=[]+ALLTRIM(accounts.name)+[] CLOSE TABLES CLOSE DATABASES %>
Receipt

Credit | Debit
Date | Amount
Cheaque Number | Cheaque Date
Details
<>

Date | Voucher | Number | Total | Paid | Balance | Amount | Details
--- | --- | --- | --- | --- | --- | --- | ---
<% set deleted on select recno() as therecord, date, cvtype,invoiceid,total,paid,(total-paid) as balance,credit, descp,allt(cvtype)+[-]+allt(invoiceid) as thetrid ; from (dbclocation+[jcredits]) where ACCOUNTID+VTYPE+TRANSID=SearchResults.customer+Padr("Receipt",10)+SearchResults.transid into cursor thedetails set date british TemporaryGrid='' select [thedetails] go top do while not eof() TemporaryGrid=TemporaryGrid+[
]+crlf TemporaryGrid=TemporaryGrid+[]+dtoc(date)+[] TemporaryGrid=TemporaryGrid+[ | ]+cvtype+[] TemporaryGrid=TemporaryGrid+[ | ]+invoiceid+[] TemporaryGrid=TemporaryGrid+[ | ]+transform(total)+[] TemporaryGrid=TemporaryGrid+[ | ]+transform(paid)+[] TemporaryGrid=TemporaryGrid+[ | ]+transform(balance)+[] TemporaryGrid=TemporaryGrid+[ | ] TemporaryGrid=TemporaryGrid+[] TemporaryGrid=TemporaryGrid+[ | ]+transform(descp)+[] TemporaryGrid=TemporaryGrid+[
]+crlf skip enddo go top close tables close DATABASES %> <%=TemporaryGrid%>