--信用报表
begin
fnd_client_info.set_org_context(81);
end;
FND_PROFILE.VALUE('USER_ID')
SELECT APPS.SECOM_CUSTOMER_CREDIT_PKG.GET_INVOICE_BAL(O104480.CUSTOMER_ID,1,TO_DATE('2011-10-18','YYYY-MM-DD'),1), O104480.CUSTOMER_NUMBER, O104480.CUSTOMER_NAME, O104480.SALES_REP, O104480.DEPT, O104480.PAYMENT_NAME, O104480.ORG_NAME, O104480.AMOUNT, O104480.HOLD_CREDIT_MOUNT, O104480.HOLD_CREDIT_MOUNT_OUT, O104480.HOLD_SYS_MOUNT, O104480.AMOUNT_OUT, O104480.HOLD_SYS_MOUNT_OUT, APPS.SECOM_CUSTOMER_CREDIT_PKG.GET_INVOICE_BAL(O104480.CUSTOMER_ID,-1,TO_DATE('2011-10-18','YYYY-MM-DD')), APPS.SECOM_CUSTOMER_CREDIT_PKG.GET_INVOICE_BAL(O104480.CUSTOMER_ID,2,TO_DATE('2011-10-18','YYYY-MM-DD'),1,30), APPS.SECOM_CUSTOMER_CREDIT_PKG.GET_INVOICE_BAL(O104480.CUSTOMER_ID,2,TO_DATE('2011-10-18','YYYY-MM-DD'),31,60), APPS.SECOM_CUSTOMER_CREDIT_PKG.GET_INVOICE_BAL(O104480.CUSTOMER_ID,2,TO_DATE('2011-10-18','YYYY-MM-DD'),61,90), APPS.SECOM_CUSTOMER_CREDIT_PKG.GET_INVOICE_BAL(O104480.CUSTOMER_ID,2,TO_DATE('2011-10-18','YYYY-MM-DD'),91,180), APPS.SECOM_CUSTOMER_CREDIT_PKG.GET_INVOICE_BAL(O104480.CUSTOMER_ID,2,TO_DATE('2011-10-18','YYYY-MM-DD'),181,360), APPS.SECOM_CUSTOMER_CREDIT_PKG.GET_INVOICE_BAL(O104480.CUSTOMER_ID,2,TO_DATE('2011-10-18','YYYY-MM-DD'),361,720), APPS.SECOM_CUSTOMER_CREDIT_PKG.GET_INVOICE_BAL(O104480.CUSTOMER_ID,1,TO_DATE('2011-10-18','YYYY-MM-DD'),721), O104480.INVOICE_BAL-O104480.RECEIPT_BAL, O104480.CREDIT, O104480.INVOICE_BAL, O104480.OPEN_SO, O104480.OVER_CREDIT, O104480.RECEIPT_BAL
FROM APPS.SECOM_DIS_CUSTOMER_CREDIT_V O104480
WHERE ( O104480.CUSTOMER_NUMBER = 78382 )