Created
March 11, 2021 19:12
-
-
Save ranafaraz/23487e7dc37537c2f30f365fec7e3298 to your computer and use it in GitHub Desktop.
Query to get withholdings in iDempiere
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
wh.documentno AS wh_docno, | |
i.documentno AS invioce_docno, | |
(SELECT t.name FROM adempiere.c_tax t WHERE t.c_tax_id = wh.c_tax_id) AS tax, | |
(SELECT wt.name FROM adempiere.lco_withholdingtype wt WHERE wt.lco_withholdingtype_id = wh.lco_withholdingtype_id) AS wh_type, | |
wh.wh_other_baseamt as base_amt, | |
wh.wh_other_percent as wh_percent, | |
wh.other_charge as deducted_amt, | |
wh.description | |
FROM | |
((adempiere.f_withholding wh | |
INNER JOIN adempiere.c_invoice i ON (( i.c_invoice_id = wh.c_invoice_id ))) | |
INNER JOIN adempiere.gl_budget b ON (( b.gl_budget_id = i.gl_budget_id ))) | |
WHERE | |
wh.isactive = 'Y' | |
AND | |
wh.ad_client_id = 1000000 | |
AND | |
b.ad_client_id = 1000000 | |
AND | |
b.isactive = 'Y' | |
AND | |
b.isprimary = 'Y' | |
AND | |
b.budgetstatus = 'A' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment