100: modvat_rm_account_id cenvat_rm_accnt,
101: excise_edu_cess_rm_account cenvat_edu_cess_rm_accnt,
102: modvat_cg_account_id cenvat_cg_accnt,
103: excise_edu_cess_cg_account cenvat_edu_cess_cg_accnt
104: FROM jai_cmn_inventory_orgs
105: WHERE organization_id = cp_organization_id
106: AND location_id = cp_location_id;
107: */
108:
509: pv_process_message OUT NOCOPY VARCHAR2
510: ) is
511:
512: CURSOR c_same_inv_no(
513: cp_organization_id JAI_CMN_INVENTORY_ORGS.organization_id%TYPE,
514: cp_location_id JAI_CMN_INVENTORY_ORGS.location_id%TYPE,
515: cp_regime_id JAI_RGM_DEFINITIONS.regime_id%type
516: ) IS
517: SELECT attribute_value
510: ) is
511:
512: CURSOR c_same_inv_no(
513: cp_organization_id JAI_CMN_INVENTORY_ORGS.organization_id%TYPE,
514: cp_location_id JAI_CMN_INVENTORY_ORGS.location_id%TYPE,
515: cp_regime_id JAI_RGM_DEFINITIONS.regime_id%type
516: ) IS
517: SELECT attribute_value
518: FROM jai_rgm_org_regns_v
722: , jai_constants.tax_type_sh_exc_edu_cess /*budget07*/
723: );
724:
725:
726: cursor c_JAI_CMN_INVENTORY_ORGS (cpn_organization_id number, cpn_location_id number) is
727: select
728: excise_rcvble_account excise_debit_accnt ,
729: cess_paid_payable_account_id excise_edu_cess_debit_accnt,
730: modvat_rm_account_id cenvat_rm_accnt,
735: /*budget07*/
736: sh_cess_paid_payable_acct_id exc_sh_cess_debit_accnt,
737: sh_cess_rm_account exc_sh_cess_rm_accnt,
738: sh_cess_cg_account_id exc_sh_cess_cg_accnt
739: from JAI_CMN_INVENTORY_ORGS
740: where organization_id = cpn_organization_id
741: and (
742: (cpn_location_id is not null and location_id = cpn_location_id)
743: or
752: and fin_active_flag = 'Y';
753: */
754:
755: r_jai_pa_draft_invoices c_draft_invoice_dtls%rowtype;
756: r_jai_cmn_inventory_orgs c_jai_cmn_inventory_orgs%rowtype;
757: r_jai_cmn_inventory_orgs1 c_jai_cmn_inventory_orgs%rowtype;
758:
759:
760: lv_exists_excise_tax varchar2(1);
753: */
754:
755: r_jai_pa_draft_invoices c_draft_invoice_dtls%rowtype;
756: r_jai_cmn_inventory_orgs c_jai_cmn_inventory_orgs%rowtype;
757: r_jai_cmn_inventory_orgs1 c_jai_cmn_inventory_orgs%rowtype;
758:
759:
760: lv_exists_excise_tax varchar2(1);
761: ln_basic_excise_amt number;
924: end if;
925:
926: /* Derive the required accounts */
927: /* Accounts for the required location */
928: open c_jai_cmn_inventory_orgs(r_jai_pa_draft_invoices.organization_id, r_jai_pa_draft_invoices.location_id);
929: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs;
930: close c_jai_cmn_inventory_orgs;
931:
932: /* Accounts for the null location */
925:
926: /* Derive the required accounts */
927: /* Accounts for the required location */
928: open c_jai_cmn_inventory_orgs(r_jai_pa_draft_invoices.organization_id, r_jai_pa_draft_invoices.location_id);
929: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs;
930: close c_jai_cmn_inventory_orgs;
931:
932: /* Accounts for the null location */
933: open c_jai_cmn_inventory_orgs(r_jai_pa_draft_invoices.organization_id, null);
926: /* Derive the required accounts */
927: /* Accounts for the required location */
928: open c_jai_cmn_inventory_orgs(r_jai_pa_draft_invoices.organization_id, r_jai_pa_draft_invoices.location_id);
929: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs;
930: close c_jai_cmn_inventory_orgs;
931:
932: /* Accounts for the null location */
933: open c_jai_cmn_inventory_orgs(r_jai_pa_draft_invoices.organization_id, null);
934: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
929: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs;
930: close c_jai_cmn_inventory_orgs;
931:
932: /* Accounts for the null location */
933: open c_jai_cmn_inventory_orgs(r_jai_pa_draft_invoices.organization_id, null);
934: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
935: close c_jai_cmn_inventory_orgs;
936:
937: ln_debit_account_id := nvl(r_jai_cmn_inventory_orgs.excise_debit_accnt,
930: close c_jai_cmn_inventory_orgs;
931:
932: /* Accounts for the null location */
933: open c_jai_cmn_inventory_orgs(r_jai_pa_draft_invoices.organization_id, null);
934: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
935: close c_jai_cmn_inventory_orgs;
936:
937: ln_debit_account_id := nvl(r_jai_cmn_inventory_orgs.excise_debit_accnt,
938: r_jai_cmn_inventory_orgs1.excise_debit_accnt);
931:
932: /* Accounts for the null location */
933: open c_jai_cmn_inventory_orgs(r_jai_pa_draft_invoices.organization_id, null);
934: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
935: close c_jai_cmn_inventory_orgs;
936:
937: ln_debit_account_id := nvl(r_jai_cmn_inventory_orgs.excise_debit_accnt,
938: r_jai_cmn_inventory_orgs1.excise_debit_accnt);
939:
933: open c_jai_cmn_inventory_orgs(r_jai_pa_draft_invoices.organization_id, null);
934: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
935: close c_jai_cmn_inventory_orgs;
936:
937: ln_debit_account_id := nvl(r_jai_cmn_inventory_orgs.excise_debit_accnt,
938: r_jai_cmn_inventory_orgs1.excise_debit_accnt);
939:
940:
941: /* Update RG Registers */
934: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
935: close c_jai_cmn_inventory_orgs;
936:
937: ln_debit_account_id := nvl(r_jai_cmn_inventory_orgs.excise_debit_accnt,
938: r_jai_cmn_inventory_orgs1.excise_debit_accnt);
939:
940:
941: /* Update RG Registers */
942: if lv_register IN ('RG23A', 'RG23C') then
1128:
1129: if ln_register_id is not null then
1130:
1131: if lv_register = 'RG23A' then
1132: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_rm_accnt, r_jai_cmn_inventory_orgs1.cenvat_rm_accnt);
1133: elsif lv_register = 'RG23C' then
1134: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_cg_accnt, r_jai_cmn_inventory_orgs1.cenvat_cg_accnt);
1135: elsif lv_register = 'PLA' then
1136: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt, r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1130:
1131: if lv_register = 'RG23A' then
1132: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_rm_accnt, r_jai_cmn_inventory_orgs1.cenvat_rm_accnt);
1133: elsif lv_register = 'RG23C' then
1134: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_cg_accnt, r_jai_cmn_inventory_orgs1.cenvat_cg_accnt);
1135: elsif lv_register = 'PLA' then
1136: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt, r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1137: end if;
1138:
1132: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_rm_accnt, r_jai_cmn_inventory_orgs1.cenvat_rm_accnt);
1133: elsif lv_register = 'RG23C' then
1134: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_cg_accnt, r_jai_cmn_inventory_orgs1.cenvat_cg_accnt);
1135: elsif lv_register = 'PLA' then
1136: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt, r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1137: end if;
1138:
1139: if ln_credit_ccid is null then
1140: pv_process_flag := jai_constants.expected_error;
1143: ||'/'||r_jai_pa_draft_invoices.location_id;
1144: goto exit_from_procedure;
1145: end if;
1146:
1147: ln_debit_ccid := nvl(r_jai_cmn_inventory_orgs.excise_debit_accnt, r_jai_cmn_inventory_orgs1.excise_debit_accnt);
1148: if ln_debit_ccid is null then
1149: pv_process_flag := jai_constants.expected_error;
1150: pv_process_message := 'Excise account not defined for '||lv_register
1151: ||' register of Org/Loc:'||r_jai_pa_draft_invoices.organization_id
1202: /* Entry 2 for ExciseEducation Cess */
1203: ln_debit_ccid := null;
1204: ln_credit_ccid := null;
1205: if lv_register = 'RG23A' then
1206: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_edu_cess_rm_accnt,
1207: r_jai_cmn_inventory_orgs1.cenvat_edu_cess_rm_accnt);
1208: elsif lv_register = 'RG23C' then
1209: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_edu_cess_cg_accnt,
1210: r_jai_cmn_inventory_orgs1.cenvat_edu_cess_cg_accnt);
1203: ln_debit_ccid := null;
1204: ln_credit_ccid := null;
1205: if lv_register = 'RG23A' then
1206: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_edu_cess_rm_accnt,
1207: r_jai_cmn_inventory_orgs1.cenvat_edu_cess_rm_accnt);
1208: elsif lv_register = 'RG23C' then
1209: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_edu_cess_cg_accnt,
1210: r_jai_cmn_inventory_orgs1.cenvat_edu_cess_cg_accnt);
1211: elsif lv_register = 'PLA' then
1205: if lv_register = 'RG23A' then
1206: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_edu_cess_rm_accnt,
1207: r_jai_cmn_inventory_orgs1.cenvat_edu_cess_rm_accnt);
1208: elsif lv_register = 'RG23C' then
1209: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_edu_cess_cg_accnt,
1210: r_jai_cmn_inventory_orgs1.cenvat_edu_cess_cg_accnt);
1211: elsif lv_register = 'PLA' then
1212: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt,
1213: r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1206: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_edu_cess_rm_accnt,
1207: r_jai_cmn_inventory_orgs1.cenvat_edu_cess_rm_accnt);
1208: elsif lv_register = 'RG23C' then
1209: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_edu_cess_cg_accnt,
1210: r_jai_cmn_inventory_orgs1.cenvat_edu_cess_cg_accnt);
1211: elsif lv_register = 'PLA' then
1212: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt,
1213: r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1214: end if;
1208: elsif lv_register = 'RG23C' then
1209: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_edu_cess_cg_accnt,
1210: r_jai_cmn_inventory_orgs1.cenvat_edu_cess_cg_accnt);
1211: elsif lv_register = 'PLA' then
1212: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt,
1213: r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1214: end if;
1215:
1216: if ln_credit_ccid is null then
1209: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_edu_cess_cg_accnt,
1210: r_jai_cmn_inventory_orgs1.cenvat_edu_cess_cg_accnt);
1211: elsif lv_register = 'PLA' then
1212: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt,
1213: r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1214: end if;
1215:
1216: if ln_credit_ccid is null then
1217: pv_process_flag := jai_constants.expected_error;
1220: ||'/'||r_jai_pa_draft_invoices.location_id;
1221: goto exit_from_procedure;
1222: end if;
1223:
1224: ln_debit_ccid := nvl(r_jai_cmn_inventory_orgs.excise_edu_cess_debit_accnt,
1225: r_jai_cmn_inventory_orgs1.excise_edu_cess_debit_accnt);
1226: if ln_debit_ccid is null then
1227: pv_process_flag := jai_constants.expected_error;
1228: pv_process_message := 'Excise education cess account not defined for '||lv_register
1221: goto exit_from_procedure;
1222: end if;
1223:
1224: ln_debit_ccid := nvl(r_jai_cmn_inventory_orgs.excise_edu_cess_debit_accnt,
1225: r_jai_cmn_inventory_orgs1.excise_edu_cess_debit_accnt);
1226: if ln_debit_ccid is null then
1227: pv_process_flag := jai_constants.expected_error;
1228: pv_process_message := 'Excise education cess account not defined for '||lv_register
1229: ||' register of Org/Loc:'||r_jai_pa_draft_invoices.organization_id
1257: /* Entry 3 for Secondary Higher Excise Education Cess */
1258: ln_debit_ccid := null;
1259: ln_credit_ccid := null;
1260: if lv_register = 'RG23A' then
1261: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_rm_accnt,
1262: r_jai_cmn_inventory_orgs1.exc_sh_cess_rm_accnt);
1263: elsif lv_register = 'RG23C' then
1264: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_cg_accnt,
1265: r_jai_cmn_inventory_orgs1.exc_sh_cess_cg_accnt);
1258: ln_debit_ccid := null;
1259: ln_credit_ccid := null;
1260: if lv_register = 'RG23A' then
1261: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_rm_accnt,
1262: r_jai_cmn_inventory_orgs1.exc_sh_cess_rm_accnt);
1263: elsif lv_register = 'RG23C' then
1264: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_cg_accnt,
1265: r_jai_cmn_inventory_orgs1.exc_sh_cess_cg_accnt);
1266: elsif lv_register = 'PLA' then
1260: if lv_register = 'RG23A' then
1261: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_rm_accnt,
1262: r_jai_cmn_inventory_orgs1.exc_sh_cess_rm_accnt);
1263: elsif lv_register = 'RG23C' then
1264: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_cg_accnt,
1265: r_jai_cmn_inventory_orgs1.exc_sh_cess_cg_accnt);
1266: elsif lv_register = 'PLA' then
1267: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt,
1268: r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1261: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_rm_accnt,
1262: r_jai_cmn_inventory_orgs1.exc_sh_cess_rm_accnt);
1263: elsif lv_register = 'RG23C' then
1264: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_cg_accnt,
1265: r_jai_cmn_inventory_orgs1.exc_sh_cess_cg_accnt);
1266: elsif lv_register = 'PLA' then
1267: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt,
1268: r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1269: end if;
1263: elsif lv_register = 'RG23C' then
1264: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_cg_accnt,
1265: r_jai_cmn_inventory_orgs1.exc_sh_cess_cg_accnt);
1266: elsif lv_register = 'PLA' then
1267: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt,
1268: r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1269: end if;
1270:
1271: if ln_credit_ccid is null then
1264: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_cg_accnt,
1265: r_jai_cmn_inventory_orgs1.exc_sh_cess_cg_accnt);
1266: elsif lv_register = 'PLA' then
1267: ln_credit_ccid := nvl(r_jai_cmn_inventory_orgs.cenvat_pla_accnt,
1268: r_jai_cmn_inventory_orgs1.cenvat_pla_accnt);
1269: end if;
1270:
1271: if ln_credit_ccid is null then
1272: pv_process_flag := jai_constants.expected_error;
1275: ||'/'||r_jai_pa_draft_invoices.location_id;
1276: goto exit_from_procedure;
1277: end if;
1278:
1279: ln_debit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_debit_accnt,
1280: r_jai_cmn_inventory_orgs1.exc_sh_cess_debit_accnt);
1281: if ln_debit_ccid is null then
1282: pv_process_flag := jai_constants.expected_error;
1283: pv_process_message := 'SH education cess account not defined for '||lv_register
1276: goto exit_from_procedure;
1277: end if;
1278:
1279: ln_debit_ccid := nvl(r_jai_cmn_inventory_orgs.exc_sh_cess_debit_accnt,
1280: r_jai_cmn_inventory_orgs1.exc_sh_cess_debit_accnt);
1281: if ln_debit_ccid is null then
1282: pv_process_flag := jai_constants.expected_error;
1283: pv_process_message := 'SH education cess account not defined for '||lv_register
1284: ||' register of Org/Loc:'||r_jai_pa_draft_invoices.organization_id
1357: pv_process_message OUT NOCOPY varchar2
1358: )
1359: IS
1360:
1361: cursor c_jai_cmn_inventory_orgs (cpn_organization_id number, cpn_location_id number) is
1362: select pref_rg23a
1363: ,pref_rg23c
1364: ,pref_pla
1365: ,nvl(export_oriented_unit ,'N') export_oriented_unit
1363: ,pref_rg23c
1364: ,pref_pla
1365: ,nvl(export_oriented_unit ,'N') export_oriented_unit
1366: ,ssi_unit_flag
1367: from jai_cmn_inventory_orgs
1368: where organization_id = cpn_organization_id
1369: and (
1370: (cpn_location_id is not null and location_id = cpn_location_id)
1371: or
1382: from jai_cmn_rg_balances
1383: where organization_id = cpn_organization_id
1384: and location_id = cpn_location_id;
1385:
1386: r_jai_cmn_inventory_orgs c_jai_cmn_inventory_orgs%rowtype;
1387: r_jai_cmn_inventory_orgs1 c_jai_cmn_inventory_orgs%rowtype;
1388: r_jai_cmn_rg_balances c_jai_cmn_rg_balances%rowtype;
1389:
1390: ln_pref_rg23a jai_cmn_inventory_orgs.pref_rg23a%type;
1383: where organization_id = cpn_organization_id
1384: and location_id = cpn_location_id;
1385:
1386: r_jai_cmn_inventory_orgs c_jai_cmn_inventory_orgs%rowtype;
1387: r_jai_cmn_inventory_orgs1 c_jai_cmn_inventory_orgs%rowtype;
1388: r_jai_cmn_rg_balances c_jai_cmn_rg_balances%rowtype;
1389:
1390: ln_pref_rg23a jai_cmn_inventory_orgs.pref_rg23a%type;
1391: ln_pref_rg23c jai_cmn_inventory_orgs.pref_rg23c%type;
1386: r_jai_cmn_inventory_orgs c_jai_cmn_inventory_orgs%rowtype;
1387: r_jai_cmn_inventory_orgs1 c_jai_cmn_inventory_orgs%rowtype;
1388: r_jai_cmn_rg_balances c_jai_cmn_rg_balances%rowtype;
1389:
1390: ln_pref_rg23a jai_cmn_inventory_orgs.pref_rg23a%type;
1391: ln_pref_rg23c jai_cmn_inventory_orgs.pref_rg23c%type;
1392: ln_pref_pla jai_cmn_inventory_orgs.pref_pla%type;
1393: lv_export_oriented_unit jai_cmn_inventory_orgs.export_oriented_unit%type;
1394: lv_ssi_unit_flag jai_cmn_inventory_orgs.ssi_unit_flag%type;
1387: r_jai_cmn_inventory_orgs1 c_jai_cmn_inventory_orgs%rowtype;
1388: r_jai_cmn_rg_balances c_jai_cmn_rg_balances%rowtype;
1389:
1390: ln_pref_rg23a jai_cmn_inventory_orgs.pref_rg23a%type;
1391: ln_pref_rg23c jai_cmn_inventory_orgs.pref_rg23c%type;
1392: ln_pref_pla jai_cmn_inventory_orgs.pref_pla%type;
1393: lv_export_oriented_unit jai_cmn_inventory_orgs.export_oriented_unit%type;
1394: lv_ssi_unit_flag jai_cmn_inventory_orgs.ssi_unit_flag%type;
1395: ln_delivery_id number;
1388: r_jai_cmn_rg_balances c_jai_cmn_rg_balances%rowtype;
1389:
1390: ln_pref_rg23a jai_cmn_inventory_orgs.pref_rg23a%type;
1391: ln_pref_rg23c jai_cmn_inventory_orgs.pref_rg23c%type;
1392: ln_pref_pla jai_cmn_inventory_orgs.pref_pla%type;
1393: lv_export_oriented_unit jai_cmn_inventory_orgs.export_oriented_unit%type;
1394: lv_ssi_unit_flag jai_cmn_inventory_orgs.ssi_unit_flag%type;
1395: ln_delivery_id number;
1396: ln_tot_excise_amt number;
1389:
1390: ln_pref_rg23a jai_cmn_inventory_orgs.pref_rg23a%type;
1391: ln_pref_rg23c jai_cmn_inventory_orgs.pref_rg23c%type;
1392: ln_pref_pla jai_cmn_inventory_orgs.pref_pla%type;
1393: lv_export_oriented_unit jai_cmn_inventory_orgs.export_oriented_unit%type;
1394: lv_ssi_unit_flag jai_cmn_inventory_orgs.ssi_unit_flag%type;
1395: ln_delivery_id number;
1396: ln_tot_excise_amt number;
1397:
1390: ln_pref_rg23a jai_cmn_inventory_orgs.pref_rg23a%type;
1391: ln_pref_rg23c jai_cmn_inventory_orgs.pref_rg23c%type;
1392: ln_pref_pla jai_cmn_inventory_orgs.pref_pla%type;
1393: lv_export_oriented_unit jai_cmn_inventory_orgs.export_oriented_unit%type;
1394: lv_ssi_unit_flag jai_cmn_inventory_orgs.ssi_unit_flag%type;
1395: ln_delivery_id number;
1396: ln_tot_excise_amt number;
1397:
1398: BEGIN
1397:
1398: BEGIN
1399:
1400: /* Getthe details from the organization, location */
1401: open c_jai_cmn_inventory_orgs(pn_organization_id, pn_location_id);
1402: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs;
1403: close c_jai_cmn_inventory_orgs;
1404:
1405: /* Getthe details from the organization, null location */
1398: BEGIN
1399:
1400: /* Getthe details from the organization, location */
1401: open c_jai_cmn_inventory_orgs(pn_organization_id, pn_location_id);
1402: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs;
1403: close c_jai_cmn_inventory_orgs;
1404:
1405: /* Getthe details from the organization, null location */
1406: open c_jai_cmn_inventory_orgs(pn_organization_id, null);
1399:
1400: /* Getthe details from the organization, location */
1401: open c_jai_cmn_inventory_orgs(pn_organization_id, pn_location_id);
1402: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs;
1403: close c_jai_cmn_inventory_orgs;
1404:
1405: /* Getthe details from the organization, null location */
1406: open c_jai_cmn_inventory_orgs(pn_organization_id, null);
1407: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
1402: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs;
1403: close c_jai_cmn_inventory_orgs;
1404:
1405: /* Getthe details from the organization, null location */
1406: open c_jai_cmn_inventory_orgs(pn_organization_id, null);
1407: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
1408: close c_jai_cmn_inventory_orgs;
1409:
1410: ln_pref_rg23a :=
1403: close c_jai_cmn_inventory_orgs;
1404:
1405: /* Getthe details from the organization, null location */
1406: open c_jai_cmn_inventory_orgs(pn_organization_id, null);
1407: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
1408: close c_jai_cmn_inventory_orgs;
1409:
1410: ln_pref_rg23a :=
1411: nvl(r_jai_cmn_inventory_orgs.pref_rg23a, r_jai_cmn_inventory_orgs1.pref_rg23a);
1404:
1405: /* Getthe details from the organization, null location */
1406: open c_jai_cmn_inventory_orgs(pn_organization_id, null);
1407: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
1408: close c_jai_cmn_inventory_orgs;
1409:
1410: ln_pref_rg23a :=
1411: nvl(r_jai_cmn_inventory_orgs.pref_rg23a, r_jai_cmn_inventory_orgs1.pref_rg23a);
1412:
1407: fetch c_jai_cmn_inventory_orgs into r_jai_cmn_inventory_orgs1;
1408: close c_jai_cmn_inventory_orgs;
1409:
1410: ln_pref_rg23a :=
1411: nvl(r_jai_cmn_inventory_orgs.pref_rg23a, r_jai_cmn_inventory_orgs1.pref_rg23a);
1412:
1413: ln_pref_rg23c :=
1414: nvl(r_jai_cmn_inventory_orgs.pref_rg23c, r_jai_cmn_inventory_orgs1.pref_rg23c);
1415:
1410: ln_pref_rg23a :=
1411: nvl(r_jai_cmn_inventory_orgs.pref_rg23a, r_jai_cmn_inventory_orgs1.pref_rg23a);
1412:
1413: ln_pref_rg23c :=
1414: nvl(r_jai_cmn_inventory_orgs.pref_rg23c, r_jai_cmn_inventory_orgs1.pref_rg23c);
1415:
1416: ln_pref_pla :=
1417: nvl(r_jai_cmn_inventory_orgs.pref_pla, r_jai_cmn_inventory_orgs1.pref_pla);
1418:
1413: ln_pref_rg23c :=
1414: nvl(r_jai_cmn_inventory_orgs.pref_rg23c, r_jai_cmn_inventory_orgs1.pref_rg23c);
1415:
1416: ln_pref_pla :=
1417: nvl(r_jai_cmn_inventory_orgs.pref_pla, r_jai_cmn_inventory_orgs1.pref_pla);
1418:
1419: lv_export_oriented_unit :=
1420: nvl(r_jai_cmn_inventory_orgs.export_oriented_unit,
1421: r_jai_cmn_inventory_orgs1.export_oriented_unit);
1416: ln_pref_pla :=
1417: nvl(r_jai_cmn_inventory_orgs.pref_pla, r_jai_cmn_inventory_orgs1.pref_pla);
1418:
1419: lv_export_oriented_unit :=
1420: nvl(r_jai_cmn_inventory_orgs.export_oriented_unit,
1421: r_jai_cmn_inventory_orgs1.export_oriented_unit);
1422:
1423: lv_ssi_unit_flag :=
1424: nvl(r_jai_cmn_inventory_orgs.ssi_unit_flag, r_jai_cmn_inventory_orgs1.ssi_unit_flag);
1417: nvl(r_jai_cmn_inventory_orgs.pref_pla, r_jai_cmn_inventory_orgs1.pref_pla);
1418:
1419: lv_export_oriented_unit :=
1420: nvl(r_jai_cmn_inventory_orgs.export_oriented_unit,
1421: r_jai_cmn_inventory_orgs1.export_oriented_unit);
1422:
1423: lv_ssi_unit_flag :=
1424: nvl(r_jai_cmn_inventory_orgs.ssi_unit_flag, r_jai_cmn_inventory_orgs1.ssi_unit_flag);
1425:
1420: nvl(r_jai_cmn_inventory_orgs.export_oriented_unit,
1421: r_jai_cmn_inventory_orgs1.export_oriented_unit);
1422:
1423: lv_ssi_unit_flag :=
1424: nvl(r_jai_cmn_inventory_orgs.ssi_unit_flag, r_jai_cmn_inventory_orgs1.ssi_unit_flag);
1425:
1426:
1427:
1428: /* Validations */