70: BEGIN
71: IF PG_DEBUG in ('Y', 'C') THEN
72: arp_util.debug('AR_Revenue_Adjustment_PVT.Unearn_Revenue()+');
73: END IF;
74: -- Standard Start of API savepoint
75: SAVEPOINT Unearn_Revenue_PVT;
76: -- Standard call to check for call compatibility.
77: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
78: p_api_version ,
72: arp_util.debug('AR_Revenue_Adjustment_PVT.Unearn_Revenue()+');
73: END IF;
74: -- Standard Start of API savepoint
75: SAVEPOINT Unearn_Revenue_PVT;
76: -- Standard call to check for call compatibility.
77: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
78: p_api_version ,
79: l_api_name ,
80: G_PKG_NAME )
114: THEN
115: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
116: END IF;
117:
118: -- Standard check of p_commit.
119: IF FND_API.To_Boolean( p_commit )
120: THEN
121: COMMIT WORK;
122: END IF;
119: IF FND_API.To_Boolean( p_commit )
120: THEN
121: COMMIT WORK;
122: END IF;
123: -- Standard call to get message count and if count is 1, get message info.
124: FND_MSG_PUB.Count_And_Get
125: (p_encoded => FND_API.G_FALSE,
126: p_count => x_msg_count,
127: p_data => x_msg_data);
226: arp_util.debug('AR_Revenue_Adjustment_PVT.Earn_Revenue()+');
227: arp_util.debug(' p_rev_adj_rec.sales_credit_type = ' ||
228: p_rev_adj_rec.sales_credit_type);
229: END IF;
230: -- Standard Start of API savepoint
231: SAVEPOINT Earn_Revenue_PVT;
232: -- Standard call to check for call compatibility.
233: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
234: p_api_version ,
228: p_rev_adj_rec.sales_credit_type);
229: END IF;
230: -- Standard Start of API savepoint
231: SAVEPOINT Earn_Revenue_PVT;
232: -- Standard call to check for call compatibility.
233: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
234: p_api_version ,
235: l_api_name ,
236: G_PKG_NAME )
269: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR
270: THEN
271: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
272: END IF;
273: -- Standard check of p_commit.
274: IF FND_API.To_Boolean( p_commit )
275: THEN
276: COMMIT WORK;
277: END IF;
274: IF FND_API.To_Boolean( p_commit )
275: THEN
276: COMMIT WORK;
277: END IF;
278: -- Standard call to get message count and if count is 1, get message info.
279: FND_MSG_PUB.Count_And_Get
280: (p_encoded => FND_API.G_FALSE,
281: p_count => x_msg_count,
282: p_data => x_msg_data);
361: -- Version : Current version 2.0
362: -- Initial version 1.0
363: --
364: -- Notes : AutoAccounting used for both debits and credits
365: -- This procedure is an overlay of the standard Unearn_Revenue
366: -- API which does not write out NOCOPY a revenue adjustment record or
367: -- entries into ra_cust_trx_line_gl_dist. Instead it outputs
368: -- the distributions to a pl/sql table which is passed out NOCOPY to
369: -- the calling routine
1284: BEGIN
1285: IF PG_DEBUG in ('Y', 'C') THEN
1286: arp_util.debug('AR_Revenue_Adjustment_PVT.Transfer_Sales_Credits()+');
1287: END IF;
1288: -- Standard Start of API savepoint
1289: SAVEPOINT Transfer_Sales_Credits_PVT;
1290: -- Standard call to check for call compatibility.
1291: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
1292: p_api_version ,
1286: arp_util.debug('AR_Revenue_Adjustment_PVT.Transfer_Sales_Credits()+');
1287: END IF;
1288: -- Standard Start of API savepoint
1289: SAVEPOINT Transfer_Sales_Credits_PVT;
1290: -- Standard call to check for call compatibility.
1291: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
1292: p_api_version ,
1293: l_api_name ,
1294: G_PKG_NAME )
1996: --
1997: -- End of Inner Block
1998: --
1999:
2000: -- Standard check of p_commit.
2001: IF FND_API.To_Boolean( p_commit )
2002: THEN
2003: COMMIT WORK;
2004: END IF;
2001: IF FND_API.To_Boolean( p_commit )
2002: THEN
2003: COMMIT WORK;
2004: END IF;
2005: -- Standard call to get message count and if count is 1, get message info.
2006: FND_MSG_PUB.Count_And_Get
2007: (p_encoded => FND_API.G_FALSE,
2008: p_count => x_msg_count,
2009: p_data => x_msg_data);
2212:
2213: IF PG_DEBUG in ('Y', 'C') THEN
2214: arp_util.debug('AR_Revenue_Adjustment_PVT.Add_Non_Revenue_Sales_Credits()+');
2215: END IF;
2216: -- Standard Start of API savepoint
2217: SAVEPOINT Add_Non_Rev_Sales_Credits_PVT;
2218: -- Standard call to check for call compatibility.
2219: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
2220: p_api_version ,
2214: arp_util.debug('AR_Revenue_Adjustment_PVT.Add_Non_Revenue_Sales_Credits()+');
2215: END IF;
2216: -- Standard Start of API savepoint
2217: SAVEPOINT Add_Non_Rev_Sales_Credits_PVT;
2218: -- Standard call to check for call compatibility.
2219: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
2220: p_api_version ,
2221: l_api_name ,
2222: G_PKG_NAME )
2411: --
2412: -- End of Inner Block
2413: --
2414:
2415: -- Standard check of p_commit.
2416: IF FND_API.To_Boolean( p_commit )
2417: THEN
2418: COMMIT WORK;
2419: END IF;
2416: IF FND_API.To_Boolean( p_commit )
2417: THEN
2418: COMMIT WORK;
2419: END IF;
2420: -- Standard call to get message count and if count is 1, get message info.
2421: FND_MSG_PUB.Count_And_Get
2422: (p_encoded => FND_API.G_FALSE,
2423: p_count => x_msg_count,
2424: p_data => x_msg_data);
2982: values(
2983: rec.customer_trx_line_id, /* customer_trx_line_id */
2984: rec.customer_trx_id, /* customer_trx_id */
2985: l_ccid, /* code_combination_id */
2986: arp_standard.sysparm.set_of_books_id, /* set_of_books_id */
2987: rec.account_class, /* account_class */
2988: 'N', /* account_set_flag */
2989: rec.percent, /* percent */
2990: rec.amount, /* Amount */
2990: rec.amount, /* Amount */
2991: rec.acctd_amount, /* Acctd_amount */
2992: rec.derived_gl_date, /* Derived gl_date */ --Bug 10159505
2993: rec.cust_trx_line_salesrep_id, /* Srep ID */
2994: arp_standard.profile.request_id,
2995: arp_standard.application_id,
2996: arp_standard.profile.program_id,
2997: sysdate,
2998: sysdate,
2991: rec.acctd_amount, /* Acctd_amount */
2992: rec.derived_gl_date, /* Derived gl_date */ --Bug 10159505
2993: rec.cust_trx_line_salesrep_id, /* Srep ID */
2994: arp_standard.profile.request_id,
2995: arp_standard.application_id,
2996: arp_standard.profile.program_id,
2997: sysdate,
2998: sysdate,
2999: arp_standard.profile.user_id,
2992: rec.derived_gl_date, /* Derived gl_date */ --Bug 10159505
2993: rec.cust_trx_line_salesrep_id, /* Srep ID */
2994: arp_standard.profile.request_id,
2995: arp_standard.application_id,
2996: arp_standard.profile.program_id,
2997: sysdate,
2998: sysdate,
2999: arp_standard.profile.user_id,
3000: sysdate,
2995: arp_standard.application_id,
2996: arp_standard.profile.program_id,
2997: sysdate,
2998: sysdate,
2999: arp_standard.profile.user_id,
3000: sysdate,
3001: arp_standard.profile.user_id,
3002: -3,
3003: rec.gl_date, /* original_gl_date */
2997: sysdate,
2998: sysdate,
2999: arp_standard.profile.user_id,
3000: sysdate,
3001: arp_standard.profile.user_id,
3002: -3,
3003: rec.gl_date, /* original_gl_date */
3004: ra_cust_trx_line_gl_dist_s.NEXTVAL, /* cust_trx_line_gl_dist_id */
3005: p_adjustment_id,
3003: rec.gl_date, /* original_gl_date */
3004: ra_cust_trx_line_gl_dist_s.NEXTVAL, /* cust_trx_line_gl_dist_id */
3005: p_adjustment_id,
3006: p_user_generated_flag,
3007: arp_standard.sysparm.org_id);
3008:
3009: rows := rows+sql%rowcount;
3010:
3011: end loop;
4369: BEGIN
4370: IF PG_DEBUG in ('Y', 'C') THEN
4371: arp_util.debug('AR_Revenue_Adjustment_PVT.Transfer_Revenue_Between_Lines()+');
4372: END IF;
4373: -- Standard Start of API savepoint
4374: SAVEPOINT Transfer_Rev_Between_Lines_PVT;
4375: -- Standard call to check for call compatibility.
4376: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
4377: p_api_version ,
4371: arp_util.debug('AR_Revenue_Adjustment_PVT.Transfer_Revenue_Between_Lines()+');
4372: END IF;
4373: -- Standard Start of API savepoint
4374: SAVEPOINT Transfer_Rev_Between_Lines_PVT;
4375: -- Standard call to check for call compatibility.
4376: IF NOT FND_API.Compatible_API_Call ( l_api_version ,
4377: p_api_version ,
4378: l_api_name ,
4379: G_PKG_NAME )
4660: --
4661: -- End of Inner Block
4662: --
4663:
4664: -- Standard check of p_commit.
4665: IF FND_API.To_Boolean( p_commit )
4666: THEN
4667: COMMIT WORK;
4668: END IF;
4665: IF FND_API.To_Boolean( p_commit )
4666: THEN
4667: COMMIT WORK;
4668: END IF;
4669: -- Standard call to get message count and if count is 1, get message info.
4670: FND_MSG_PUB.Count_And_Get
4671: (p_encoded => FND_API.G_FALSE,
4672: p_count => x_msg_count,
4673: p_data => x_msg_data);
4921: ,SYSDATE
4922: ,FND_GLOBAL.user_id
4923: ,SYSDATE
4924: ,FND_GLOBAL.user_id
4925: ,arp_standard.sysparm.org_id ); -- Bug 4607673
4926: IF PG_DEBUG in ('Y', 'C') THEN
4927: arp_util.debug('AR_Revenue_Adjustment_PVT.create_adjustment()-');
4928: END IF;
4929:
5252: ,p_acctd_amount
5253: ,-3
5254: ,p_adjustment_id
5255: ,p_user_generated_flag
5256: ,arp_standard.sysparm.org_id
5257: ,p_rounding_flag); -- Bug 4607673
5258:
5259: --{BUG#5064609 call XLA event
5260: OPEN cu_trx;
5403: ,DECODE(p_type,'N',p_amount,NULL)
5404: ,DECODE(p_type,'R',p_percent,NULL)
5405: ,DECODE(p_type,'N',p_percent,NULL)
5406: ,p_adjustment_id
5407: ,arp_standard.sysparm.org_id);
5408:
5409: IF PG_DEBUG in ('Y', 'C') THEN
5410: arp_util.debug(' Inserted salescredit row w/ ID = ' ||
5411: p_sales_credit_id);
5521: VALUES
5522: ( p_cust_trx_line_id,
5523: p_customer_trx_id,
5524: l_ccid,
5525: arp_standard.sysparm.set_of_books_id,
5526: l_account_class,
5527: 'Y',
5528: p_percent,
5529: NULL,
5529: NULL,
5530: NULL,
5531: NULL,
5532: p_sales_credit_id,
5533: arp_standard.profile.request_id,
5534: arp_standard.application_id,
5535: arp_standard.profile.program_id,
5536: sysdate,
5537: sysdate,
5530: NULL,
5531: NULL,
5532: p_sales_credit_id,
5533: arp_standard.profile.request_id,
5534: arp_standard.application_id,
5535: arp_standard.profile.program_id,
5536: sysdate,
5537: sysdate,
5538: l_user_id,
5531: NULL,
5532: p_sales_credit_id,
5533: arp_standard.profile.request_id,
5534: arp_standard.application_id,
5535: arp_standard.profile.program_id,
5536: sysdate,
5537: sysdate,
5538: l_user_id,
5539: sysdate,
5542: NULL,
5543: l_gl_dist_id,
5544: p_adjustment_id,
5545: 'Y',
5546: arp_standard.sysparm.org_id
5547: );
5548:
5549: IF PG_DEBUG in ('Y', 'C') THEN
5550: arp_util.debug(' Inserted ' || l_account_class ||