on 2024 Aug 07 1:54 PM
can you help me? about this Query:
I want to get Withholding Tax data against A/P Advance payment.
Select
t0."DocNum" "OutGoing_DocNum",
T0."DocDate" Outgoing_Doc_date,
t5."DocNum" "ADV_DocNum",
T5."DocDate" ADV_Doc_date,
t6."Account" ,
t7."AcctName",
x."WTCode",
-- t6."U_Sec" "Section",
T3."LicTradNum" "Federal Tax ID",
T3."AddID" AS "CNIC",
T3."CardCode",
T3."CardName",
T3."City",
T3."Address" ,
null "DocType",
(CASE t3."CmpPrivate"
WHEN 'C' THEN 'Company'
WHEN 'I' THEN 'Private'
WHEN 'G' THEN 'Government'
WHEN 'E' THEN 'Employee'
ELSE t3."CmpPrivate"
END)
"Status", T1."SumApplied" OUTGOING_Line_total,
t5."DocTotal" ADV_Doc_total, T6."Rate",
X."WTSum" AS"WTAmnt"
FROM
OVPM T0
Inner join VPM2 t1 on T0."DocEntry" = t1."DocNum"
Inner join VPM6 X on T0."DocEntry" = X."DocNum"
INNER JOIN ODPO T5 ON T5."DocEntry" = T1."baseAbs"
left Join OCRD T3 on T3."CardCode" = T0."CardCode"
Inner join OWHT T6 on X."WTCode" = T6."WTCode"
INNER JOIN OACT t7 ON t6."Account" = t7."AcctCode"
inner join OJDT T8 ON T8."TransId" = T0."TransId"
INNER JOIN JDT1 T9 ON T8."TransId" = T9."TransId"
and t9."Account" = t6."Account"
--Where T2."DocDate" >= [%0] and T2."DocDate" <= [%1]
Where T8."BaseRef" = '325'
User | Count |
---|---|
9 | |
4 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.