87: | Update BR to UNPAID |
88: | |
89: +=======================================*/
90: IF PG_DEBUG in ('Y', 'C') THEN
91: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> Calling AR_BILLS_MAINTAIN_PUB.unpaid_br');
92: END IF;
93: AR_BILLS_MAINTAIN_PUB.unpaid_BR (
94:
95: p_api_version => 1.0 ,
105: p_status => x_bill_status );
106:
107: IF (x_return_status <> 'S') then
108: IF PG_DEBUG in ('Y', 'C') THEN
109: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>>>>>>>>> PROBLEM DURING BR unpaid');
110: END IF;
111: IF (x_msg_count > 1) then
112: x_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
113: END IF;
112: x_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
113: END IF;
114:
115: IF PG_DEBUG in ('Y', 'C') THEN
116: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'x_msg_data : '|| x_msg_data);
117: END IF;
118: RAISE unpaid_br_error;
119: END IF;
120: IF PG_DEBUG in ('Y', 'C') THEN
117: END IF;
118: RAISE unpaid_br_error;
119: END IF;
120: IF PG_DEBUG in ('Y', 'C') THEN
121: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> Finished UNPAID CALL, new status '||x_bill_status);
122: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> Successfully Unpaid');
123: END IF;
124:
125: ELSIF p_cancel_flag ='Y'then
118: RAISE unpaid_br_error;
119: END IF;
120: IF PG_DEBUG in ('Y', 'C') THEN
121: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> Finished UNPAID CALL, new status '||x_bill_status);
122: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> Successfully Unpaid');
123: END IF;
124:
125: ELSIF p_cancel_flag ='Y'then
126: /*======================================+
129: | |
130: +=======================================*/
131: IF p_reason IS NOT NULL then
132: IF PG_DEBUG in ('Y', 'C') THEN
133: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> WARNING >>> Cancel_BR requires no reason, Bill '||p_customer_trx_id||' reason not used.');
134: END IF;
135: END IF;
136: IF PG_DEBUG in ('Y', 'C') THEN
137: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> Calling AR_BILLS_MAINTAIN_PUB.cancel_br');
133: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> WARNING >>> Cancel_BR requires no reason, Bill '||p_customer_trx_id||' reason not used.');
134: END IF;
135: END IF;
136: IF PG_DEBUG in ('Y', 'C') THEN
137: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> Calling AR_BILLS_MAINTAIN_PUB.cancel_br');
138: END IF;
139: AR_BILLS_MAINTAIN_PUB.Cancel_BR (
140:
141: p_api_version => 1.0 ,
150: p_status => x_bill_status );
151:
152: IF (x_return_status <> 'S') then
153: IF PG_DEBUG in ('Y', 'C') THEN
154: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>>>>>>>>> PROBLEM DURING BR Cancel');
155: END IF;
156: IF (x_msg_count > 1) then
157: x_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
158: END IF;
157: x_msg_data := FND_MSG_PUB.Get(FND_MSG_PUB.G_NEXT,FND_API.G_FALSE);
158: END IF;
159:
160: IF PG_DEBUG in ('Y', 'C') THEN
161: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'x_msg_data : '|| x_msg_data);
162: END IF;
163: RAISE cancel_br_error;
164: END IF;
165:
163: RAISE cancel_br_error;
164: END IF;
165:
166: IF PG_DEBUG in ('Y', 'C') THEN
167: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> Successfully Cancelled');
168: END IF;
169: ELSE
170: RAISE invalid_flag;
171: END IF;
170: RAISE invalid_flag;
171: END IF;
172:
173: IF PG_DEBUG in ('Y', 'C') THEN
174: arp_standard.debug('------ END OF AR_BR_CANCEL_UNPAID_PKG.Cancel_or_unpaid -------');
175: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'RETURN STATUS : ' || x_return_status);
176: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'BR IDENTIFIER : ' || p_customer_trx_id);
177: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'STATUS : ' || x_bill_status);
178: END IF;
171: END IF;
172:
173: IF PG_DEBUG in ('Y', 'C') THEN
174: arp_standard.debug('------ END OF AR_BR_CANCEL_UNPAID_PKG.Cancel_or_unpaid -------');
175: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'RETURN STATUS : ' || x_return_status);
176: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'BR IDENTIFIER : ' || p_customer_trx_id);
177: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'STATUS : ' || x_bill_status);
178: END IF;
179: END IF;
172:
173: IF PG_DEBUG in ('Y', 'C') THEN
174: arp_standard.debug('------ END OF AR_BR_CANCEL_UNPAID_PKG.Cancel_or_unpaid -------');
175: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'RETURN STATUS : ' || x_return_status);
176: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'BR IDENTIFIER : ' || p_customer_trx_id);
177: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'STATUS : ' || x_bill_status);
178: END IF;
179: END IF;
180:
173: IF PG_DEBUG in ('Y', 'C') THEN
174: arp_standard.debug('------ END OF AR_BR_CANCEL_UNPAID_PKG.Cancel_or_unpaid -------');
175: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'RETURN STATUS : ' || x_return_status);
176: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'BR IDENTIFIER : ' || p_customer_trx_id);
177: arp_standard.debug('CANCEL_OR_UNPAID: ' || 'STATUS : ' || x_bill_status);
178: END IF;
179: END IF;
180:
181: EXCEPTION
181: EXCEPTION
182: WHEN unpaid_BR_ERROR THEN
183: x_return_status := FND_API.G_RET_STS_ERROR;
184: IF PG_DEBUG in ('Y', 'C') THEN
185: arp_standard.debug('>>>>> CANCEL_OR_UNPAID, Unpaid BR EXCEPTION - ROLLBACK, return_status ='||x_return_status);
186: END IF;
187: Rollback to BR_B4;
188: app_exception.raise_exception;
189:
189:
190: WHEN cancel_BR_ERROR THEN
191: x_return_status := FND_API.G_RET_STS_ERROR;
192: IF PG_DEBUG in ('Y', 'C') THEN
193: arp_standard.debug('>>>>> CANCEL_OR_UNPAID, Cancel BR EXCEPTION - ROLLBACK, return_status ='||x_return_status);
194: END IF;
195: Rollback to BR_B4;
196: app_exception.raise_exception;
197:
197:
198: WHEN invalid_flag THEN
199: x_return_status := FND_API.G_RET_STS_ERROR;
200: IF PG_DEBUG in ('Y', 'C') THEN
201: arp_standard.debug('>>>>> CANCEL_OR_UNPAID, Invalid value for p_cancel_flag - ROLLBACK');
202: END IF;
203: Rollback to BR_B4;
204: app_exception.raise_exception;
205:
204: app_exception.raise_exception;
205:
206: WHEN no_setup_error THEN
207: IF PG_DEBUG in ('Y', 'C') THEN
208: arp_standard.debug('>>>>> CANCEL_OR_UNPAID, Setup of org id not correctly performed');
209: END IF;
210: app_exception.raise_exception;
211:
212: WHEN OTHERS THEN
211:
212: WHEN OTHERS THEN
213: x_return_status := FND_API.G_RET_STS_ERROR;
214: IF PG_DEBUG in ('Y', 'C') THEN
215: arp_standard.debug('>>>>> CANCEL_OR_UNPAID, Others EXCEPTION - ROLLBACK, return_status ='||x_return_status);
216: END IF;
217: Rollback to BR_B4;
218: l_error_code := SQLCODE;
219: l_error_msg := substr(SQLERRM,1,255);
217: Rollback to BR_B4;
218: l_error_code := SQLCODE;
219: l_error_msg := substr(SQLERRM,1,255);
220: IF PG_DEBUG in ('Y', 'C') THEN
221: arp_standard.debug('CANCEL_OR_UNPAID: ' || '>>> Code: '||l_error_code||' Msg: '||l_error_msg);
222: END IF;
223: app_exception.raise_exception;
224:
225: