DBA Data[Home] [Help]

PACKAGE BODY: APPS.AR_TRX_BULK_PROCESS_HEADER

Source


1 PACKAGE BODY AR_TRX_BULK_PROCESS_HEADER AS
2 /* $Header: ARINBLHB.pls 120.8.12000000.2 2007/06/15 21:09:48 mraymond ship $ */
3 
4 pg_debug                VARCHAR2(1) := nvl(fnd_profile.value('AFLOG_ENABLED'),'N');
5 
6 PROCEDURE INSERT_ROW (
7         p_trx_header_id         IN      NUMBER,
8         x_errmsg                    OUT NOCOPY  VARCHAR2,
9         x_return_status             OUT NOCOPY  VARCHAR2 ) IS
10 
11 l_pmt_trxn_id  NUMBER;
12 BEGIN
13     IF pg_debug = 'Y'
14     THEN
15         ar_invoice_utils.debug ('AR_TRX_BULK_PROCESS_HEADER.INSERT_ROW (+)');
16     END IF;
17     x_return_status := FND_API.G_RET_STS_SUCCESS;
18 
19   BEGIN
20    arp_util.debug ( 'insert header ' || p_trx_header_id );
21 
22      select payment_trxn_extension_id
23      into l_pmt_trxn_id
24      FROM ar_trx_header_gt
25      WHERE  trx_header_id = nvl(p_trx_header_id, trx_header_id);
26 
27    arp_util.debug ( 'insert header ' || p_trx_header_id );
28    arp_util.debug ( 'insert header trxn _id ' || l_pmt_trxn_id );
29  EXCEPTION WHEN OTHERS THEN
30     l_pmt_trxn_id := null;
31  END;
32 
33     INSERT INTO ra_customer_trx (
34                  customer_trx_id,
35                  trx_number,
36                  created_by,
37                  creation_date,
38                  last_updated_by,
39                  last_update_date,
40                  last_update_login,
41                  set_of_books_id,
42                  program_application_id,
43                  program_id,
44                  program_update_date,
45                  posting_control_id,
46                  ra_post_loop_number,
47                  complete_flag,
48                  related_customer_trx_id,
49                  cust_trx_type_id,
50                  batch_id,
51                  batch_source_id,
52                  agreement_id,
53                  trx_date,
54                  bill_to_customer_id,
55                  bill_to_contact_id,
56                  bill_to_site_use_id,
57                  ship_to_customer_id,
58                  ship_to_contact_id,
59                  ship_to_site_use_id,
60                  sold_to_customer_id,
61                  sold_to_site_use_id,
62                  sold_to_contact_id,
63                  customer_reference,
64                  customer_reference_date,
65                  credit_method_for_installments,
66                  credit_method_for_rules,
67                  start_date_commitment,
68                  end_date_commitment,
69                  exchange_date,
70                  exchange_rate,
71                  exchange_rate_type,
72                  customer_bank_account_id,
73                  finance_charges,
74                  fob_point,
75                  comments,
76                  internal_notes,
77                  invoice_currency_code,
78                  invoicing_rule_id,
79                  orig_system_batch_name,
80                  primary_salesrep_id,
81                  printing_count,
82                  printing_last_printed,
83                  printing_option,
84                  printing_original_date,
85                  printing_pending,
86                  purchase_order,
87                  purchase_order_date,
88                  purchase_order_revision,
89                  receipt_method_id,
90                  remit_to_address_id,
91                  shipment_id,
92                  ship_date_actual,
93                  ship_via,
94                  term_due_date,
95                  term_id,
96                  territory_id,
97                  waybill_number,
98                  status_trx,
99                  reason_code,
100                  doc_sequence_id,
101                  doc_sequence_value,
102                  paying_customer_id,
103                  paying_site_use_id,
104                  default_tax_exempt_flag,
105                  created_from,
106                  default_ussgl_trx_code_context,
107                  default_ussgl_transaction_code,
108                  old_trx_number,
109                  interface_header_context,
110                  interface_header_attribute1,
111                  interface_header_attribute2,
112                  interface_header_attribute3,
113                  interface_header_attribute4,
114                  interface_header_attribute5,
115                  interface_header_attribute6,
116                  interface_header_attribute7,
117                  interface_header_attribute8,
118                  interface_header_attribute9,
119                  interface_header_attribute10,
120                  interface_header_attribute11,
121                  interface_header_attribute12,
122                  interface_header_attribute13,
123                  interface_header_attribute14,
124                  interface_header_attribute15,
125                  attribute_category,
126                  attribute1,
127                  attribute2,
128                  attribute3,
129                  attribute4,
130                  attribute5,
131                  attribute6,
132                  attribute7,
133                  attribute8,
134                  attribute9,
135                  attribute10,
136                  attribute11,
137                  attribute12,
138                  attribute13,
139                  attribute14,
140                  attribute15,
141                  br_amount,
142                  br_unpaid_flag,
143                  br_on_hold_flag,
144                  drawee_id,
145                  drawee_contact_id,
146                  drawee_site_use_id,
147                  drawee_bank_account_id,
148                  remit_bank_acct_use_id,
149                  override_remit_account_flag,
150                  special_instructions,
151                  remittance_batch_id,
152                  address_verification_code,
153                  approval_code,
154                  bill_to_address_id,
155                  edi_processed_flag,
156                  edi_processed_status,
157                  payment_server_order_num,
158                  post_request_id,
159                  request_id,
160                  ship_to_address_id,
161                  global_attribute_category,
162                  global_attribute1,
163                  global_attribute2,
164                  global_attribute3,
165                  global_attribute4,
166                  global_attribute5,
167                  global_attribute6,
168                  global_attribute7,
169                  global_attribute8,
170                  global_attribute9,
171                  global_attribute10,
172                  global_attribute11,
173                  global_attribute12,
174                  global_attribute13,
175                  global_attribute14,
176                  global_attribute15,
177                  global_attribute16,
178                  global_attribute17,
179                  global_attribute18,
180                  global_attribute19,
181                  global_attribute20,
182                  global_attribute21,
183                  global_attribute22,
184                  global_attribute23,
185                  global_attribute24,
186                  global_attribute25,
187                  global_attribute26,
188                  global_attribute27,
189                  global_attribute28,
190                  global_attribute29,
191                  global_attribute30,
192                  ct_reference,org_id,
193                  legal_entity_id,
194                  payment_trxn_extension_id,
195                  billing_date
196                  -- Late Charges
197                  ,interest_header_id
198                  ,late_charges_assessed
199                  )
200                  SELECT  customer_trx_id,
201                          trx_number,
202                          created_by,
203                          creation_date,
204                          last_updated_by,
205                          last_update_date,
206                          last_update_login,
207                          set_of_books_id,
208                          program_application_id,
209                          program_id,
210                          program_update_date,
211                          posting_control_id,
212                          ra_post_loop_number,
213                          'Y', -- 5921925
214                          RELATED_CUSTOMER_TRX_ID,
215                          cust_trx_type_id,
216                          batch_id,
217                          batch_source_id,
218                          agreement_id,
219                          trx_date,
220                          bill_to_customer_id,
221                          bill_to_contact_id,
222                          bill_to_site_use_id,
223                          ship_to_customer_id,
224                          ship_to_contact_id,
225                          ship_to_site_use_id,
226                          sold_to_customer_id,
227                          sold_to_site_use_id,
228                          sold_to_contact_id,
229                          customer_reference,
230                          customer_reference_date,
231                          credit_method_for_installments,
232                          credit_method_for_rules,
233                          start_date_commitment,
234                          end_date_commitment,
235                          exchange_date,
236                          exchange_rate,
237                          exchange_rate_type,
238                          customer_bank_account_id,
239                          finance_charges,
240                          fob_point,
241                          comments,
242                          internal_notes,
243                          trx_currency,
244                          invoicing_rule_id,
245                          orig_system_batch_name,
246                          primary_salesrep_id,
247                          printing_count,
248                          printing_last_printed,
249                          printing_option,
250                          printing_original_date,
251                          printing_pending,
252                          purchase_order,
253                          purchase_order_date,
254                          purchase_order_revision,
255                          receipt_method_id,
256                          remit_to_address_id,
257                          shipment_id,
258                          ship_date_actual,
259                          ship_via,
260                          term_due_date,
261                          term_id,
262                          territory_id,
263                          waybill_number,
264                          status_trx,
265                          reason_code,
266                          doc_sequence_id,
267                          doc_sequence_value,
268                          nvl(paying_customer_id,bill_to_customer_id),
269                          paying_site_use_id,
270                          default_tax_exempt_flag,
271                          created_from,
272                          default_ussgl_trx_code_context,
273                          default_ussgl_transaction_code,
274                          old_trx_number,
275                          interface_header_context,
276                          interface_header_attribute1,
277                          interface_header_attribute2,
278                          interface_header_attribute3,
279                          interface_header_attribute4,
280                          interface_header_attribute5,
281                          interface_header_attribute6,
282                          interface_header_attribute7,
283                          interface_header_attribute8,
284                          interface_header_attribute9,
285                          interface_header_attribute10,
286                          interface_header_attribute11,
287                          interface_header_attribute12,
288                          interface_header_attribute13,
289                          interface_header_attribute14,
290                          interface_header_attribute15,
291                          attribute_category,
292                          attribute1,
293                          attribute2,
294                          attribute3,
295                          attribute4,
296                          attribute5,
297                          attribute6,
298                          attribute7,
299                          attribute8,
300                          attribute9,
301                          attribute10,
302                          attribute11,
303                          attribute12,
304                          attribute13,
305                          attribute14,
306                          attribute15,
307                          br_amount,
308                          br_unpaid_flag,
309                          br_on_hold_flag,
310                          drawee_id,
311                          drawee_contact_id,
312                          drawee_site_use_id,
313                          drawee_bank_account_id,
314                          -- will leave the column name alone for gts
315                          remittance_bank_account_id,
316                          override_remit_account_flag,
317                          special_instructions,
318                          remittance_batch_id,
319                          address_verification_code,
320                          approval_code,
324                          payment_server_order_num,
321                          bill_to_address_id,
322                          edi_processed_flag,
323                          edi_processed_status,
325                          post_request_id,
326                          request_id,
327                          ship_to_address_id,
328                          global_attribute_category,
329                          global_attribute1,
330                          global_attribute2,
331                          global_attribute3,
332                          global_attribute4,
333                          global_attribute5,
334                          global_attribute6,
335                          global_attribute7,
336                          global_attribute8,
337                          global_attribute9,
338                          global_attribute10,
339                          global_attribute11,
340                          global_attribute12,
341                          global_attribute13,
342                          global_attribute14,
343                          global_attribute15,
344                          global_attribute16,
345                          global_attribute17,
346                          global_attribute18,
347                          global_attribute19,
348                          global_attribute20,
349                          global_attribute21,
350                          global_attribute22,
351                          global_attribute23,
352                          global_attribute24,
353                          global_attribute25,
354                          global_attribute26,
355                          global_attribute27,
356                          global_attribute28,
357                          global_attribute29,
358                          global_attribute30,
359                          ct_reference,arp_standard.sysparm.org_id,
360                          legal_entity_id,
361                          payment_trxn_extension_id,
362                          billing_date
363                       -- Late Charges
364                        ,interest_header_id
365                        ,late_charges_assessed
366                          FROM ar_trx_header_gt
367                          WHERE  trx_header_id = nvl(p_trx_header_id, trx_header_id);
368 
369         IF pg_debug = 'Y'
370         THEN
371             ar_invoice_utils.debug ('AR_TRX_BULK_PROCESS_HEADER.INSERT_ROW (+)');
372         END IF;
373         EXCEPTION
374             WHEN OTHERS THEN
375                 x_errmsg := 'Error in AR_TRX_BULK_PROCESS_HEADER.INSERT_ROW '||sqlerrm;
376                 x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
377                 return;
378 
379 END INSERT_ROW;
380 
381 END AR_TRX_BULK_PROCESS_HEADER;