[Home] [Help]
17: v_register_meaning ja_lookups.meaning%type;
18: v_order_type ra_batch_sources_all.name%type; --Ramananda bug#4171671
19: v_invoice_type ra_batch_sources_all.name%type;
20: v_start_number Number;
21: v_prefix JAI_CMN_RG_EXC_INV_NOS.prefix%type;
22: v_jump_by Number;
23: v_end_number Number;
24: v_ec_code Varchar2(50);
25: v_master_org_flag char(1);
33:
34: v_order_type_temp ra_batch_sources_all.name%type; --Added by nprashar for bug#13854640
35: v_order_type_dom_exp ra_batch_sources_all.name%type; --Added by nprashar for bug#13854640
36: v_register_meaning_dom_exp so_lookups.meaning%type; --Added by nprashar for bug#13854640
37: v_register_code_temp JAI_CMN_RG_EXC_INV_NOS.register_code%type; --Added by nprashar for bug#13854640
38:
39:
40: v_act_organization_id Number; -- these variables hold the value of organization id
41: v_act_location_id Number; -- location id which will be used for excise invoice generation
79: AND lookup_code = v_lookup_code;
80:
81: Cursor c_def_excise_cur(p_orgn_id Number , p_loc_id number) is
82: Select start_number , prefix , jump_by , end_number , order_invoice_type, register_code /*Column order_invoice_type added for bug # 13854640*/
83: From JAI_CMN_RG_EXC_INV_NOS
84: where organization_id = p_orgn_id
85: and location_id = p_loc_id
86: and fin_year = p_fin_year
87: and (order_invoice_type= v_order_type_dom_exp OR order_invoice_type = v_order_type) -- Added by nprashar for bug#13854640
116:
117:
118: Cursor c_excise_cur(p_orgn_id Number , p_loc_id number) is
119: Select nvl(gp1,0) , nvl(gp2,0)
120: From JAI_CMN_RG_EXC_INV_NOS
121: where organization_id = p_orgn_id
122: and location_id = p_loc_id
123: and fin_year = p_fin_year
124: AND order_invoice_type IS NULL
189: FP: Modified the code to generate excise invoice number for Projects Billing.
190:
191: 3. 28-Jan-2009 JMEENA for bug#7719911
192: 1) Removed the condition of EXCISE_INVNO_AT_EC_CODE flag from cursor c_tr_ec_code_cur as this should not be checked for trading organizations.
193: 2) Added if condition to update table JAI_CMN_RG_EXC_INV_NOS for the records where EXCISE_INVNO_AT_EC_CODE = 'N'
194: for the manufacturing organizations because such records will not be fetched by cursor c_ec_code_cur so invoice number
195: will not be updated to next number for that organization.
196: 3) FP of bug#7505975
197: Issue: Excise Invoice Number for a Trading organization with Master-- Child setup
371: Fetch c_register_meaning_cur into v_register_meaning;
372: Close c_register_meaning_cur;
373:
374: elsif P_CALLED_FROM = 'P' then
375: -- in the case of RTV transactions , the value 'RTV' is hard coded in the JAI_CMN_RG_EXC_INV_NOS
376: -- when preferences are setup for a RTV transaction.
377: v_register_code := 'RTV';
378: v_order_type := 'RTV';
379: v_register_meaning := 'RTV';
393: -- get updated after excise invoice generation has occured and this is used to prevent a deadlock.
394:
395: Fnd_File.PUT_LINE(Fnd_File.LOG,'Before update time is ' || to_char(sysdate,'dd-mon-yyyy hh:mi:ss'));
396:
397: update JAI_CMN_RG_EXC_INV_NOS
398: set last_update_date = last_update_date
399: where fin_year = p_fin_year
400: AND order_invoice_type IS NULL
401: AND register_code IS NULL
662: end if;
663:
664: IF v_trans_type_up IN ('DOM','EXP','ITF','DEX') THEN --added 'ITF' for bug#11886787
665:
666: UPDATE JAI_CMN_RG_EXC_INV_NOS
667: SET start_number = v_start_number,
668: last_update_date = sysdate
669: WHERE organization_id = v_act_organization_id
670: AND location_id = v_act_location_id
675: AND register_code = v_register_code_temp -- Added by nprashar for bug#13854640
676: AND transaction_type = v_trans_type_up;
677:
678: ELSIF NVL(v_ec_code_gen,'N') = 'N' Then /*Added by nprashar for bug 7344638*/
679: UPDATE JAI_CMN_RG_EXC_INV_NOS
680: SET start_number = v_start_number
681: WHERE organization_id = v_act_organization_id
682: AND location_id = v_act_location_id
683: AND fin_year = p_fin_year
698:
699: -- End of bug 3071342
700: FOR master_org_rec IN c_tr_ec_code_cur(v_act_organization_id, v_act_location_id) LOOP
701:
702: UPDATE JAI_CMN_RG_EXC_INV_NOS
703: SET start_number = v_start_number
704: WHERE organization_id = master_org_rec.organization_id
705: AND location_id = master_org_rec.location_id
706: AND fin_year = p_fin_year
712: END LOOP;
713:
714: ELSE
715: IF NVL(v_ec_code_gen,'N') = 'N' Then --Added by JMEENA for bug#7719911
716: UPDATE JAI_CMN_RG_EXC_INV_NOS
717: SET start_number = v_start_number
718: WHERE organization_id = v_act_organization_id
719: AND location_id = v_act_location_id
720: AND fin_year = p_fin_year
721: AND order_invoice_type = v_order_type_temp
722: AND register_code = v_register_code_temp;
723: ELSE
724: FOR master_org_rec IN c_ec_code_cur(v_act_organization_id, v_act_location_id) LOOP
725: UPDATE JAI_CMN_RG_EXC_INV_NOS
726: SET start_number = v_start_number
727: WHERE organization_id = master_org_rec.organization_id
728: AND location_id = master_org_rec.location_id
729: AND fin_year = p_fin_year
748: -- Start of bug 3071342
749: IF v_register_code IN ('23D_DOMESTIC_EXCISE') OR (p_Called_from = 'INTERORG_XFER' AND r_org_type.trading = 'Y' )/* vkaranam for bug #6030615*/THEN
750: -- End of bug 3071342
751: FOR master_org_rec IN c_tr_ec_code_cur(v_act_organization_id, v_act_location_id) LOOP
752: UPDATE JAI_CMN_RG_EXC_INV_NOS
753: SET gp1 = v_gp1,
754: gp2 = v_gp2
755: WHERE organization_id = master_org_rec.organization_id
756: AND location_id = master_org_rec.location_id
760: END LOOP;
761:
762: ELSE
763: IF NVL(v_ec_code_gen,'N') = 'N' Then --Added by JMEENA for bug#7719911
764: UPDATE JAI_CMN_RG_EXC_INV_NOS
765: SET gp1 = v_gp1,
766: gp2 = v_gp2
767: WHERE organization_id =v_act_organization_id
768: AND location_id = v_act_location_id
770: AND order_invoice_type IS NULL
771: AND register_code IS NULL;
772: ELSE
773: FOR master_org_rec IN c_ec_code_cur(v_act_organization_id, v_act_location_id) LOOP
774: UPDATE JAI_CMN_RG_EXC_INV_NOS
775: SET gp1 = v_gp1,
776: gp2 = v_gp2
777: WHERE organization_id = master_org_rec.organization_id
778: AND location_id = master_org_rec.location_id