1 PACKAGE okc_rep_num_hook AUTHID CURRENT_USER AS
2 /* $Header: OKCREPNHKS.pls 120.0.12020000.2 2013/02/02 04:02:52 harchand noship $ */
3
4
5 /* FUNCTION get_rep_contract_number
6
7 USAGE
8 This function is used to derive custom contract numbers for repository contract documents.
9
10 With this method implementation in place, Autonumbering logic per contract type can be implemented
11 - Typical choice is to have different custom sequences per/required contract type and/or OU
12 - Any custom string can be prepended to the above derived sequence eg: 'FY01-001'
13 - Always ensure that the generated contract number is unique for a given combination of OU and contract type.
14
15 Existing behaviour:
16 Profile Contract Repository Auto-Numbering Enabled(site level) decides whether the contract number is system defined or manual.
17 Profile value is Yes
18 - Sequence OKC_REP_CONTRACTS_ALL_S2 is used for generating sequences for the contract number.
19 - Contract number will be unique across contract type, operating unit i.e. same contract number will not repeat across OU/contract types
20
21 Profile value is No
22 - User has the choice for manual entry and user needs to ensure that contract number is unique.
23
24 How this method and Contract Repository Auto-Numbering Enabled Profile work together:
25 Profile Contract Repository Auto-Numbering Enabled is Yes
26 - the value returned by this method for a given contract type, OU will be treated as the autogenerated sequence number
27 - the logic is used during manual authoring and contract import
28
29 Profile Contract Repository Auto-Numbering Enabled is No
30 - The value returned by this method for a given contract type, OU will be treated as a default and user can manually override it.
31 - Manual authoring user can override the default value.
32 - During Contract import user provided values are taken and this method is not used.
33
34 Exception handling
35 Ascertain the required behaviour and handle exceptions accordingly
36 - When the profile value is set to No, you can choose to return an empty/null value for the contract number since user can always enter value
37 - When the profile value is set to Yes, if you choose to return empty value then auto generated sequence will take effect.
38
39 INPUT PARAMETERS
40
41 p_doc_type Document Type of Contract
42 p_org_id Organization id
43
44 RETURN VALUE
45
46 contract number that is generated by this method.
47
48 */
49
50 Function get_rep_contract_number
51 (
52 p_doc_type IN VARCHAR2 ,
53 p_org_id IN number
54 ) RETURN VARCHAR2;
55
56 END okc_rep_num_hook;