DBA Data[Home] [Help]

PACKAGE BODY: APPS.WMA_UTIL

Source


1 PACKAGE BODY wma_util AS
2 /* $Header: wmacutlb.pls 115.7 2004/05/11 22:33:48 kboonyap ship $ */
3 
4   /**
5    * This function returns the scrap account id for the specified orgnization.
6    * The scrap account id is used as the default scrap account for scrap trx.
7    */
8   FUNCTION getScrapAcctID(orgID        IN     NUMBER,
9                           scrapAcctID  OUT NOCOPY NUMBER,
10                           errMsg       OUT NOCOPY VARCHAR2) return boolean IS
11     mandatoryScrapFlag NUMBER;
12   BEGIN
13     select mandatory_scrap_flag, default_scrap_account_id
14       into mandatoryScrapFlag, scrapAcctID
15     from wip_parameters
16     where organization_id = orgID;
17 
18     if ( mandatoryScrapFlag = 1 and scrapAcctID IS null ) then
19       fnd_message.set_name('WIP', 'WMA SCRAP ACCT REQUIRED');
20       errMsg := fnd_message.get;
21       return false;
22     end if;
23 
24     return true;
25   END getScrapAcctID;
26 
27   PROCEDURE getNegBalanceParams(p_org_id IN NUMBER,
28                                 x_neg_inv_allowed OUT NOCOPY NUMBER,
29                                 x_neg_bkflsh_allowed OUT NOCOPY NUMBER,
30                                 x_return_status OUT NOCOPY VARCHAR2,
31                                 x_err_msg OUT NOCOPY VARCHAR2) is
32   begin
33     x_return_status := fnd_api.g_ret_sts_success;
34 
35     select negative_inv_receipt_code
36       into x_neg_inv_allowed
37       from mtl_parameters
38      where organization_id = p_org_id;
39 
40     x_neg_bkflsh_allowed := to_number(fnd_profile.value_wnps('INV_OVERRIDE_NEG_FOR_BACKFLUSH'));
41   exception
42     when others then
43       x_return_status := fnd_api.g_ret_sts_error;
44       x_err_msg := SQLERRM;
45   end getNegBalanceParams;
46 
47   procedure getOverMovOrCplPickingWarning(p_wipEntityID number,
48                                           p_orgID number,
49                                           x_warningMsg out nocopy varchar2,
50                                           x_displayWarning out nocopy varchar2) is
51   begin
52     if(wip_picking_pub.is_job_pick_released(p_wip_entity_id => p_wipEntityID,
53                                             p_org_id => p_orgID)) then
54       x_displayWarning := fnd_api.g_true;
55       fnd_message.set_name('WIP', 'WIP_PICK_SCRAP_WARNING');
56       x_warningMsg := fnd_message.get;
57     else
58       x_displayWarning := fnd_api.g_false;
59     end if;
60   end;
61 
62 END wma_util;