457: IS
458: SELECT
459: transaction_id
460: FROM
461: ar_gta_transfer_temp
462: WHERE SUCCEEDED='Y';
463:
464: -- for add the gta inv number
465: CURSOR get_gta_inv_number_c(p_ra_trx_id IN NUMBER)
525:
526: -- sum the count of successed , failed and warning trx
527: SELECT COUNT(*), SUM(nvl(amount, 0))
528: INTO l_succ_rows, l_succ_amount
529: FROM AR_gta_transfer_temp
530: WHERE SUCCEEDED = 'Y';
531:
532: --12/04/2006 Jogen Hu bug 5144561
533: /*
569: CLOSE get_gta_inv_number_c;--jogen Hu Apr-4, 2006 bug 5135169
570:
571: BEGIN
572: UPDATE
573: ar_gta_transfer_temp
574: SET
575: gta_invoice_num = l_gta_inv_num_all
576: WHERE
577: transaction_id = l_transaction_id;
598: --end insert the gta invoice number into temp
599:
600: SELECT COUNT(*), SUM(nvl(amount, 0))
601: INTO l_failed_rows, l_failed_amount
602: FROM AR_gta_transfer_temp
603: WHERE SUCCEEDED = 'N';
604:
605: SELECT COUNT(*), SUM(nvl(amount, 0))
606: INTO l_warning_rows, l_warning_amount
603: WHERE SUCCEEDED = 'N';
604:
605: SELECT COUNT(*), SUM(nvl(amount, 0))
606: INTO l_warning_rows, l_warning_amount
607: FROM ar_gta_transfer_temp
608: WHERE SUCCEEDED = 'W';
609:
610: SELECT COUNT(*)
611: INTO l_GTA_rows
608: WHERE SUCCEEDED = 'W';
609:
610: SELECT COUNT(*)
611: INTO l_GTA_rows
612: FROM ar_gta_transfer_temp
613: WHERE SUCCEEDED = 'W'
614: OR SUCCEEDED = 'Y';
615:
616: -- generate validate xml string
667: Amount AS "Amount",
668: FailedReason AS
669: "FailedReason"))))
670: INTO l_failed
671: FROM AR_gta_transfer_temp
672: WHERE SUCCEEDED = 'N';
673:
674: -- generate the xmltype for warning inv
675: SELECT XMLElement("Invoices",
684: Amount AS "Amount",
685: FailedReason AS
686: "WarningReason"))))
687: INTO l_warning
688: FROM AR_gta_transfer_temp
689: WHERE SUCCEEDED = 'W';
690:
691: --generate the xmltype for succ inv
692: SELECT XMLElement("Invoices",
705: "GTAInvoiceNum"
706: --12/04/2006 Jogen Hu bug 5144561
707: ))))
708: INTO l_succeeded
709: FROM AR_gta_transfer_temp
710: WHERE SUCCEEDED = 'Y';
711:
712: --generate the final report
713: SELECT xmlelement("TransferReport",
3316: l_error_string);
3317: END IF;
3318: END IF; --l_cm_warn2 = TRUE
3319:
3320: DELETE FROM ar_gta_transfer_temp temp
3321: WHERE temp.transaction_id = l_customer_trx_id
3322: AND temp.succeeded = 'W'
3323: --and temp.tax_reg_num=l_tp_registration_number;--Modified by Yao Zhang for bug 7684662
3324: AND (temp.tax_reg_num = l_tp_registration_number OR
3325: decode(l_tp_registration_number,
3326: NULL,
3327: temp.tax_reg_num,
3328: l_tp_registration_number) IS NULL); --Yao Zhang changed for bug 8241752
3329: INSERT INTO ar_gta_transfer_temp t
3330: (t.seq,
3331: t.transaction_id,
3332: t.succeeded,
3333: t.transaction_num,
3336: t.amount,
3337: t.failedreason,
3338: t.gta_invoice_num,
3339: t.tax_reg_num)
3340: SELECT ar_gta_transfer_temp_s.NEXTVAL,
3341: l_customer_trx_id,
3342: 'W',
3343: l_trx_number,
3344: l_ctt_class,
4204: */
4205: --Jogen Hu 2006.2.17
4206: EXCEPTION
4207: WHEN l_normal_exception THEN
4208: --delete warning data from ar_gta_transfer_temp
4209: DELETE ar_gta_transfer_temp temp
4210: WHERE temp.transaction_id = l_customer_trx_id
4211: AND temp.succeeded = 'W';
4212:
4205: --Jogen Hu 2006.2.17
4206: EXCEPTION
4207: WHEN l_normal_exception THEN
4208: --delete warning data from ar_gta_transfer_temp
4209: DELETE ar_gta_transfer_temp temp
4210: WHERE temp.transaction_id = l_customer_trx_id
4211: AND temp.succeeded = 'W';
4212:
4213: INSERT INTO ar_gta_transfer_temp t
4209: DELETE ar_gta_transfer_temp temp
4210: WHERE temp.transaction_id = l_customer_trx_id
4211: AND temp.succeeded = 'W';
4212:
4213: INSERT INTO ar_gta_transfer_temp t
4214: (t.seq,
4215: t.transaction_id,
4216: t.succeeded,
4217: t.transaction_num,
4219: t.customer_name,
4220: t.amount,
4221: t.failedreason,
4222: t.gta_invoice_num)
4223: SELECT ar_gta_transfer_temp_s.NEXTVAL,
4224: l_customer_trx_id,
4225: 'N',
4226: l_trx_number,
4227: l_ctt_class,