on 09-30-2014 12:26 PM
Hi, I am making a custom Aging Report. Right now I have a query to Get all the AR Invoice/AR Credit Memo balance of Customers By Sales Employee but It's not tally when I compare It on B1 Aging Report because Journal Entry/Incoming/Outgoing are included In B1 Aging Report. How can I tally the balance due on B1 Aging Report? This my my query right know.
Select SUM(BalanceDue),SlpCode from (select Sum(DocTotal-a.PaidToDate)As BalanceDue,a.SlpCode from
oinv a inner join oslp b on a.slpcode=b.slpcode
inner join JDT1 c on c.TransId=a.TransId
inner join OCRD d on d.cardcode=a.cardcode
where a.CANCELED='N'
and a.DocTotal-a.PaidToDate<>0
and a.DocDate between '01/01/1990'
and '09/25/2014'
and c.ShortName=a.CardCode and d.Balance<>0 Group By a.SlpCode
union all
select Sum(DocTotal-a.PaidToDate)*-1 As BalanceDue,a.SlpCode from
ORIN a inner join oslp b on a.slpcode=b.slpcode
inner join JDT1 c on c.TransId=a.TransId
inner join OCRD d on d.cardcode=a.cardcode
where a.CANCELED='N'
and a.DocTotal-a.PaidToDate<>0
and a.DocDate between '01/01/1990'
and '09/25/2014'
and c.ShortName=a.CardCode and d.Balance<>0 Group By a.SlpCode)A group by SlpCode
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
103 | |
14 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.