Project with backlog Amount and Agreement amount and funding Amount:
SELECT DISTINCT PPA.SEGMENT1 PROJECT_NUMBER,
PPA.NAME PROJECT_NAME,
PPC.CUSTOMER_NAME,
--PPA.PROJECT_ID,
paa.AGREEMENT_NUM CONTRACT_NUMBER,
paa.AGREEMENT_TYPE CONTRACT_TYPE,
pspf.FUNDING_CURRENCY_CODE,
PAA.AMOUNT CONTRACT_AMOUNT,
(SELECT SUM(PROJECT_ALLOCATED_AMOUNT)
FROM PA_PROJECT_FUNDINGS
WHERE PROJECT_ID = PPA.PROJECT_ID) PROJECT_FUNDING_AMOUNT,
(pspf.TOTAL_BASELINED_AMOUNT - pspf.INVPROC_BILLED_AMOUNT) BACKLOG_AMOUNT
FROM PA_PROJECTS_ALL PPA,
PA_EVENTS PE,
HR_ALL_ORGANIZATION_UNITS_TL HOU,
--PA_PROJECT_CUSTOMERS_V PPC,
PAFV_CUSTOMERS PPC,
HZ_CUST_ACCOUNTS HCA,
HZ_PARTIES HP,
PA_SUMMARY_PROJECT_FUNDINGS pspf,
PA_AGREEMENTS_ALL paa
WHERE PE.PROJECT_ID = PPA.PROJECT_ID
AND PPA.PROJECT_ID = PPC.PROJECT_ID
AND HOU.ORGANIZATION_ID = PE.ORGANIZATION_ID
AND HCA.CUST_ACCOUNT_ID =PPC.CUSTOMER_ID
AND HP.PARTY_ID =HCA.PARTY_ID
--AND PPA.PROJECT_ID=3738
AND PSPF.PROJECT_ID =PPA.PROJECT_ID
AND HCA.CUST_ACCOUNT_ID =PAA.CUSTOMER_ID
AND PAA.AGREEMENT_ID =PsPF.AGREEMENT_ID;
SELECT DISTINCT PPA.SEGMENT1 PROJECT_NUMBER,
PPA.NAME PROJECT_NAME,
PPC.CUSTOMER_NAME,
--PPA.PROJECT_ID,
paa.AGREEMENT_NUM CONTRACT_NUMBER,
paa.AGREEMENT_TYPE CONTRACT_TYPE,
pspf.FUNDING_CURRENCY_CODE,
PAA.AMOUNT CONTRACT_AMOUNT,
(SELECT SUM(PROJECT_ALLOCATED_AMOUNT)
FROM PA_PROJECT_FUNDINGS
WHERE PROJECT_ID = PPA.PROJECT_ID) PROJECT_FUNDING_AMOUNT,
(pspf.TOTAL_BASELINED_AMOUNT - pspf.INVPROC_BILLED_AMOUNT) BACKLOG_AMOUNT
FROM PA_PROJECTS_ALL PPA,
PA_EVENTS PE,
HR_ALL_ORGANIZATION_UNITS_TL HOU,
--PA_PROJECT_CUSTOMERS_V PPC,
PAFV_CUSTOMERS PPC,
HZ_CUST_ACCOUNTS HCA,
HZ_PARTIES HP,
PA_SUMMARY_PROJECT_FUNDINGS pspf,
PA_AGREEMENTS_ALL paa
WHERE PE.PROJECT_ID = PPA.PROJECT_ID
AND PPA.PROJECT_ID = PPC.PROJECT_ID
AND HOU.ORGANIZATION_ID = PE.ORGANIZATION_ID
AND HCA.CUST_ACCOUNT_ID =PPC.CUSTOMER_ID
AND HP.PARTY_ID =HCA.PARTY_ID
--AND PPA.PROJECT_ID=3738
AND PSPF.PROJECT_ID =PPA.PROJECT_ID
AND HCA.CUST_ACCOUNT_ID =PAA.CUSTOMER_ID
AND PAA.AGREEMENT_ID =PsPF.AGREEMENT_ID;
No comments:
Post a Comment