[Home] [Help]
1997:
1998: /* Numerator (Sysdate - Invoice date) * Invoice Amount */
1999: cursor c_invoices_party (p_party_id number) is
2000: select (sysdate-gl_date)* amount_due_original amount, to_char(gl_date,'MM') month,payment_schedule_id
2001: from ar_payment_schedules_all a, hz_cust_accounts b
2002: where a.customer_id = b.cust_account_id
2003: AND b.party_id = p_party_id
2004: AND a.CLASS IN ('INV','DEP','DM','CB')
2005: and a.gl_date between trunc(sysdate-365) AND TRUNC(sysdate);
2005: and a.gl_date between trunc(sysdate-365) AND TRUNC(sysdate);
2006:
2007: cursor c_invoices_acct (p_cust_account_id number) is
2008: select (sysdate-gl_date)* amount_due_original amount, to_char(gl_date,'MM') month,payment_schedule_id
2009: from ar_payment_schedules_all
2010: where customer_id = p_cust_account_id
2011: AND CLASS IN ('INV','DEP','DM','CB')
2012: and gl_date between trunc(sysdate-365) AND TRUNC(sysdate);
2013:
2012: and gl_date between trunc(sysdate-365) AND TRUNC(sysdate);
2013:
2014: cursor c_invoices_site (p_customer_site_use_id number) is
2015: select (sysdate-gl_date)* amount_due_original amount, to_char(gl_date,'MM') month,payment_schedule_id
2016: from ar_payment_schedules_all
2017: where customer_site_use_id = p_customer_site_use_id
2018: AND CLASS IN ('INV','DEP','DM','CB')
2019: and gl_date between trunc(sysdate-365) AND TRUNC(sysdate);
2020: