<% if type([user_rcptadd])=[U] user_rcptadd=.t. endif if type([user_rcptedit])=[U] user_rcptedit=.t. endif if type([user_rcptview])=[U] user_rcptview=.t. endif if type([user_rcptdelete])=[U] user_rcptdelete=.t. endif if type([logedin])=[U] logedin=[Admin] endif %> <% *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 dateSearchResults.date INTO CURSOR opening select sum(debit-credit) as allclosing from (dbclocation+[acctran]) where ; accountid=SearchResults.customer INTO CURSOR allclosing openingbalance=[On ]+transform(DAY(SearchResults.date))+[ ]+LEFT(CMONTH(SearchResults.date),3)+[ ]+ALLTRIM(TRANSFORM(YEAR(SearchResults.date))) openingbalance=openingbalance+[ Opening: ]+allt(transform(nvl(opening.dayopening,0)))+[ add debits: ]+allt(transform(closing.debits))+[ less credits: ]+; ALLTRIM(transform(closing.credits))+[ closing: ]+ALLTRIM(TRANSFORM(nvl(opening.dayopening,0)+closing.debits-closing.credits)) overallclosing=[Overall closing balance: ]+transform(nvl(allclosing.allclosing,0)) openingbalance=openingbalance+[
]+overallclosing ENDIF USE (dbclocation+[accounts]) IN SELECT([accounts]) =SEEK(SearchResults.customer,[accounts],[accountid]) ccreditor=[]+ALLTRIM(accounts.name)+[] =SEEK(SearchResults.depositid,[accounts],[accountid]) cdebitor=[]+ALLTRIM(accounts.name)+[] CLOSE TABLES CLOSE DATABASES %>
Receipt
Creditor
Debitor
Date
Amount
Discount
Cheaque Number
Cheaque Date
Payer Information
Remarks
<>
<% 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 TemporaryGrid='' set date british 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 %>

Date | Voucher | Number | Total | Paid | Balance | Amount | Details
--- | --- | --- | --- | --- | --- | --- | ---
<%=TemporaryGrid%>