[Home] [Help]
2121: l_stmt_num := 50;
2122:
2123: l_io_receivable_acct := l_acct;
2124:
2125: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
2126: sign(-1 * i_p_qty),
2127: l_acct_line_type,
2128: NULL, NULL, i_subinv,
2129: 0, NULL, l_err_num, l_err_code,
2173:
2174: IF l_value <> 0
2175: THEN
2176:
2177: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
2178: -1, l_acct_line_type,
2179: NULL, NULL, i_subinv,
2180: 0, NULL, l_err_num, l_err_code,
2181: l_err_msg);
2783: then
2784: -- shipping txn, trp_cost
2785: l_value := i_trp_cost;
2786:
2787: l_acct := CSTPACHK.get_account_id(l_from_org, i_txn_id, -1, 12,
2788: NULL, NULL, l_subinv,0, l_snd_rcv,
2789: l_err_num, l_err_code, l_err_msg);
2790:
2791: if (l_err_num <> 0) then
2821: l_value := i_txf_price * l_snd_qty;
2822:
2823: fnd_file.put_line(fnd_file.log,'Receivables amount: ' || l_value);
2824:
2825: l_acct := CSTPACHK.get_account_id(l_from_org, i_txn_id, 1, 10,
2826: NULL, NULL, l_subinv,0, l_snd_rcv,
2827: l_err_num, l_err_code, l_err_msg);
2828:
2829: if (l_err_num <> 0) then
2910: ;
2911:
2912: fnd_file.put_line(fnd_file.log,'InterOrg Profit amount: ' || l_value);
2913:
2914: l_acct := CSTPACHK.get_account_id(l_from_org, i_txn_id, 1, 34,
2915: NULL, NULL, l_subinv,0, l_snd_rcv,
2916: l_err_num, l_err_code, l_err_msg);
2917:
2918: if (l_err_num <> 0) then
3084:
3085: fnd_file.put_line(fnd_file.log,'Transfer Credit account: ' || l_value);
3086:
3087: /* Credit sending org transfer credit */
3088: l_acct := CSTPACHK.get_account_id(l_from_org, i_txn_id, -1, 11,
3089: NULL, NULL, l_subinv,0, l_snd_rcv,
3090: l_err_num, l_err_code, l_err_msg);
3091:
3092: if (l_err_num <> 0) then
3130: end if;
3131:
3132: fnd_file.put_line(fnd_file.log,'Freight account: ' || l_value);
3133:
3134: l_acct := CSTPACHK.get_account_id(l_from_org, i_txn_id, -1, 12,
3135: NULL, NULL, l_subinv,0, l_snd_rcv,
3136: l_err_num, l_err_code, l_err_msg);
3137:
3138: if (l_err_num <> 0) then
3186: end if;
3187:
3188: fnd_file.put_line(fnd_file.log,'receivables account: ' || l_value);
3189:
3190: l_acct := CSTPACHK.get_account_id(l_from_org, i_txn_id, 1, 10,
3191: NULL, NULL, l_subinv,0, l_snd_rcv,
3192: l_err_num, l_err_code, l_err_msg);
3193:
3194: if (l_err_num <> 0) then
3247: ;
3248:
3249: fnd_file.put_line(fnd_file.log,'InterOrg profit account: ' || l_value);
3250:
3251: l_acct := CSTPACHK.get_account_id(l_from_org, i_txn_id, 1,
3252: G_INTERORG_PROFIT_ACCT,
3253: NULL, NULL, l_subinv,0, l_snd_rcv,
3254: l_err_num, l_err_code, l_err_msg);
3255:
3426: * Inventory AP Accrual account rather than the Inter-Org Payables Account *
3427: ************************************************************************************/
3428:
3429: IF nvl(l_io_invoicing, 2) = 1 AND i_src_type_id = 7 AND l_org_ou <> l_txf_org_ou THEN /* INVCONV Bug#5498133/5498041 ANTHIYAG 30-Aug-2006 */
3430: l_acct := CSTPACHK.get_account_id(l_to_org, i_txn_id, -1, 2,
3431: NULL, NULL, l_subinv,0, l_snd_rcv,
3432: l_err_num, l_err_code, l_err_msg);
3433:
3434: if (l_err_num <> 0) then
3453:
3454: ELSE
3455: /* INVCONV Bug#5471471 ANTHIYAG 18-Aug-2006 End */
3456:
3457: l_acct := CSTPACHK.get_account_id(l_to_org, i_txn_id, -1, 9,
3458: NULL, NULL, l_subinv,0, l_snd_rcv,
3459: l_err_num, l_err_code, l_err_msg);
3460:
3461: if (l_err_num <> 0) then
3485: if (i_trp_cost <> 0) then
3486:
3487: l_value := i_trp_cost;
3488:
3489: l_acct := CSTPACHK.get_account_id(l_to_org, i_txn_id, -1, 12,
3490: NULL, NULL, l_subinv,0, l_snd_rcv,
3491: l_err_num, l_err_code, l_err_msg);
3492:
3493: if (l_err_num <> 0) then
3609: and organization_id = l_std_org;
3610:
3611: if (l_ppv <> 0)
3612: then
3613: l_acct := CSTPACHK.get_account_id(l_to_org, i_txn_id, sign(l_ppv), 6,
3614: NULL, NULL, l_subinv,0, l_snd_rcv,
3615: l_err_num, l_err_code, l_err_msg);
3616:
3617: if (l_err_num <> 0) then
3877: where transaction_id = i_txn_id
3878: and organization_id = l_std_org;
3879:
3880: if (l_ppv <> 0) then
3881: l_acct := CSTPACHK.get_account_id(l_to_org, i_txn_id, sign(l_ppv), 6,
3882: NULL, NULL, l_subinv,0, l_snd_rcv,
3883: l_err_num, l_err_code, l_err_msg);
3884:
3885: if (l_err_num <> 0) then
3991: * If Intercompany invoicing is enabled, then the booking should be made against the *
3992: * Inventory AP Accrual account rather than the Inter-Org Payables Account *
3993: ************************************************************************************/
3994: IF nvl(l_io_invoicing, 2) = 1 AND i_src_type_id IN (7, 8) AND l_org_ou <> l_txf_org_ou THEN /* INVCONV Bug#5498133/5498041 ANTHIYAG 30-Aug-2006 */
3995: l_acct := CSTPACHK.get_account_id(l_to_org, i_txn_id, -1, 2,
3996: NULL, NULL, l_subinv,0, l_snd_rcv,
3997: l_err_num, l_err_code, l_err_msg);
3998:
3999: if (l_err_num <> 0) then
4020:
4021: ELSE
4022: /* INVCONV Bug#5476815 ANTHIYAG 21-Aug-2006 End */
4023:
4024: l_acct := CSTPACHK.get_account_id(l_to_org, i_txn_id, -1, 9,
4025: NULL, NULL, l_subinv,0, l_snd_rcv,
4026: l_err_num, l_err_code, l_err_msg);
4027: if (l_err_num <> 0) then
4028: raise process_error;
4059: if (l_to_org <> i_txn_org_id) then
4060: l_value := i_trp_cost * l_conv_rate;
4061: end if;
4062:
4063: l_acct := CSTPACHK.get_account_id(l_to_org, i_txn_id, -1, 12,
4064: NULL, NULL, l_subinv,0, l_snd_rcv,
4065: l_err_num, l_err_code, l_err_msg);
4066:
4067: if (l_err_num <> 0) then
4451:
4452: if (l_cost <> 0) then -- 4706781 This applies to INV accounting only
4453:
4454: -- First post to inventory.
4455: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
4456: sign(l_cost), 1,
4457: cost_element, NULL, NULL,
4458: 0, NULL, l_err_num, l_err_code,
4459: l_err_msg);
4494: if (l_cost <> 0 OR l_var <> 0 OR l_onhand_var <> 0) then -- 4706781 Adj has to be posted if variance exists
4495:
4496: -- Second post to adjustment.
4497: l_cost := -1 * l_cost;
4498: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
4499: sign((i_qty * l_cost) - l_var-l_onhand_var), 2,
4500: cost_element, NULL, NULL,
4501: 0, NULL, l_err_num, l_err_code,
4502: l_err_msg);
4535:
4536: end if; -- (l_cost <> 0 and l_var <> 0)
4537: if (l_onhand_var <> 0) then
4538:
4539: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
4540: sign(l_onhand_var), 20,
4541: cost_element, NULL, NULL,
4542: 0, NULL, l_err_num, l_err_code,
4543: l_err_msg);
4582: and organization_id = i_org_id;
4583:
4584: if (l_var <> 0) then
4585:
4586: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
4587: sign(l_var), 13,
4588: NULL, NULL, NULL,
4589: 0, NULL, l_err_num, l_err_code,
4590: l_err_msg);
5583: fnd_file.put_line(fnd_file.log, 'org-txn-i_p_qty-cost_element-i_subinv');
5584: fnd_file.put_line(fnd_file.log, i_org_id || '-' || i_txn_id || '-' ||
5585: i_p_qty || '-' || i_subinv);
5586: end if;
5587: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
5588: sign(i_p_qty), l_acct_line_type,
5589: cost_element, NULL, i_subinv,
5590: l_exp, i_snd_rcv,
5591: l_err_num, l_err_code, l_err_msg);
5643:
5644:
5645: if (l_exp <> 1 and l_var <> 0) then /* Not expense */
5646: -- Insert into variance account.
5647: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
5648: sign(i_p_qty), 13,
5649: NULL, NULL, i_subinv,
5650: 0, i_snd_rcv, l_err_num, l_err_code,
5651: l_err_msg);
5707: and organization_id = i_org_id
5708: and layer_id = l_layer_id
5709: and cost_element_id = cost_element;
5710:
5711: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
5712: sign(i_p_qty), 13,
5713: cost_element, NULL, i_subinv,
5714: 0, i_snd_rcv,
5715: l_err_num, l_err_code, l_err_msg);
5961: if (l_elemental_cost(cost_element) is not null) then
5962:
5963: -- dropshipment changes
5964: if (l_cost_method <> 1) then
5965: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
5966: sign(i_p_qty),
5967: i_acct_line_type,
5968: cost_element, NULL, i_subinv,
5969: 0, i_snd_rcv, l_err_num, l_err_code,
6110:
6111: l_stmt_num := 60;
6112:
6113: if (l_cost_method <> 1) then
6114: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
6115: sign(i_p_qty),
6116: i_acct_line_type,
6117: NULL, NULL, i_subinv,
6118: 0, i_snd_rcv, l_err_num, l_err_code,
6267: and cost_element_id = cost_element;
6268: end if;
6269:
6270: if (l_cost is not null AND cost_element <> 2) then
6271: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
6272: sign(i_p_qty),
6273: i_acct_line_type,
6274: cost_element, NULL, i_subinv,
6275: 0, i_snd_rcv, l_err_num, l_err_code,
6375: loop
6376: fetch mat_ovhds into l_res_id, l_cost;
6377: exit when mat_ovhds%NOTFOUND;
6378:
6379: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
6380: sign(i_p_qty), 3,
6381: 2, l_res_id, i_subinv,
6382: 0, i_snd_rcv, l_err_num, l_err_code,
6383: l_err_msg);
6478: l_act_flag := 0; -- 0 means that encumbrance is being used
6479:
6480: l_stmt_num := 10;
6481:
6482: l_acct := CSTPACHK.get_account_id(i_org_id, i_txn_id,
6483: sign(i_enc_amount), l_acct_line_type,
6484: NULL, NULL, NULL,
6485: 0, NULL, l_err_num, l_err_code,
6486: l_err_msg);