1342: l_acct_rec.res_account,
1343: l_acct_rec.osp_account,
1344: l_acct_rec.ovhd_account,
1345: l_acct_class
1346: from wip_discrete_jobs
1347: where organization_id = i_ae_txn_rec.organization_id
1348: and wip_entity_id = i_ae_txn_rec.txn_src_id;
1349: END IF;
1350:
8576: SELECT decode(l_cost_element, 1, nvl(material_account,-1),
8577: 3, nvl(resource_account, -1),
8578: 4, nvl(outside_processing_account, -1), -1)
8579: INTO l_ae_line_rec.account
8580: FROM wip_discrete_jobs
8581: WHERE wip_entity_id = l_ae_line_rec.wip_entity_id;
8582:
8583: /* Set Debit Flag properly.
8584: -- ------------------------ */
9002: -- ------------------------------------------------------------------------------------------------
9003: l_stmt_num := 40;
9004: select count(wip_entity_id) /* Changed for Bug No. 4586534 */
9005: into l_acct_exist
9006: from wip_discrete_jobs
9007: where wip_entity_id = l_wip_entity_id;
9008:
9009: if (l_acct_exist = 0) then
9010: raise no_dj_acct_error;
9027: 5, nvl(overhead_variance_account,-1)),
9028: o_acct_id2)
9029: into o_acct_id1,
9030: o_acct_id2
9031: from wip_discrete_jobs
9032: where wip_entity_id = l_wip_entity_id;
9033: elsif l_entity_type = 2 then
9034:
9035: -- Get Elemental Accounts from WRS.
9308: l_stmt_num := 58;
9309: -------------------------------------------------------------------------
9310: -- Get the Variance Accounts based Job type
9311: -- If Job type is Repetitive then get from table WIP_REPETITIVE_SCHEDULES
9312: -- If Job type is Discrete then get from table WIP_DISCRETE_JOBS
9313: -------------------------------------------------------------------------
9314: IF ((i_ae_txn_rec.wip_entity_type = 1) OR (i_ae_txn_rec.wip_entity_type = 3)) THEN
9315:
9316: SELECT decode(cost_element, 1, material_variance_account,
9318: 3, resource_variance_account,
9319: 4, outside_proc_variance_account,
9320: 5, overhead_variance_account)
9321: INTO l_ae_line_rec.account
9322: FROM WIP_DISCRETE_JOBS
9323: WHERE organization_id = i_ae_txn_rec.organization_id
9324: AND wip_entity_id = i_ae_txn_rec.txn_src_id;
9325: ELSE
9326: SELECT decode(cost_element, 1, material_variance_account,