-
TYPE DOC_COMMENT_TABLE_TYPE PL/SQL TABLE
Table type for comments to documents.
-
TYPE DOC_PERIOD_TABLE_TYPE PL/SQL TABLE
Table type for documents with their periods.
-
TYPE DOC_STATES_LIST PL/SQL TABLE
Table type for document statuses.
-
TYPE SD_DOC_BINDS_LIST_TABLE_TYPE PL/SQL TABLE
Table type for bindings between documents.
-
TYPE SD_DOC_FILES_TABLE_TYPE PL/SQL TABLE
Table type for document print templates.
-
TYPE SD_DOC_LIST_TABLE_TYPE PL/SQL TABLE
Table type for documents bound to a specific document.
-
PROCEDURE CHECK_SINGLE_DOC_PERIOD_CLN
Check a document period.
The procedure searches for a document with the same type, provider and client as the specified one, and a period
that overlaps the document period. If such a document is found, an error message is added to the temporary table
TT_MESSAGE_LOGS.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| b_Errors |
OUT |
MAIN.BOOL |
NUMBER |
|
CONST.b_TRUE when there are documents with overlapping periods, otherwise CONST.b_FALSE |
| num_N_ERR_LEVEL |
IN |
NUMBER |
NUMBER |
SS_CONSTANTS_PKG_S.ERR_LEVEL_Warning |
Error level for a message to be added to TT_MESSAGE_LOGS (CONST.ERR_LEVEL_Warning or CONST.ERR_LEVEL_Error) |
-
FUNCTION DOCUMENT_ADDRESSES_HISTORY
Get a list of changes in addresses bound to a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_PRIMARY_KEY_VALUE |
IN |
NUMBER |
NUMBER |
NULL |
Primary key value (when searching for a specific binding) |
| dt_D_BEGIN |
IN |
DATE |
DATE |
ADD_MONTHS(SYSDATE -3) |
Start date of a search period |
| dt_D_END |
IN |
DATE |
DATE |
SYSDATE |
End date of the search period |
| RETURN SS_AUDIT_PKG_S.TABLE_HISTORY_LIST_TABLE_TYPE |
Table with changes in addresses |
| PIPELINED |
-
FUNCTION DOCUMENT_SUBJECTS_HISTORY
Get a list of changes in subjects bound to a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_PRIMARY_KEY_VALUE |
IN |
NUMBER |
NUMBER |
NULL |
Primary key value (when searching for a specific binding between a subject and the document) |
| dt_D_BEGIN |
IN |
DATE |
DATE |
ADD_MONTHS(SYSDATE -3) |
Start date of a search period |
| dt_D_END |
IN |
DATE |
DATE |
SYSDATE |
End date of the search period |
| RETURN SS_AUDIT_PKG_S.TABLE_HISTORY_LIST_TABLE_TYPE |
Table with changes in subjects |
| PIPELINED |
-
FUNCTION DOCUMENT_VALUES_HISTORY
Get a list of changes in document custom fields values.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_PRIMARY_KEY_VALUE |
IN |
NUMBER |
NUMBER |
NULL |
Primary key value (when searching for a specific value) |
| dt_D_BEGIN |
IN |
DATE |
DATE |
ADD_MONTHS(SYSDATE -3) |
Start date of a search period |
| dt_D_END |
IN |
DATE |
DATE |
SYSDATE |
End date of the search period |
| RETURN SS_AUDIT_PKG_S.TABLE_HISTORY_LIST_TABLE_TYPE |
Table with changes in document custom fields values |
| PIPELINED |
-
PROCEDURE GENERATE_DOC_CODE_NAME
Generate a document code and name.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_TYPE_ID |
IN |
SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
NUMBER |
|
Document type (REF_TYPE_Document_Type reference data) |
| dt_D_DOC |
IN |
SD_DOCUMENTS.D_DOC%TYPE |
DATE |
|
Document date |
| vch_VC_DOC_NO |
IN |
SD_DOCUMENTS.VC_DOC_NO%TYPE |
VARCHAR2 |
|
Document number |
| vch_VC_NAME |
OUT |
SD_DOCUMENTS.VC_NAME%TYPE |
VARCHAR2 |
|
Document name |
| vch_VC_CODE |
OUT |
SD_DOCUMENTS.VC_CODE%TYPE |
VARCHAR2 |
|
Document code |
-
FUNCTION GET_DOC_CL_VALUE
Get a CLOB value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_VALUE_TYPE_ID |
IN |
SD_DOC_VALUES.N_DOC_VALUE_TYPE_ID%TYPE |
NUMBER |
|
Custom field |
| RETURN SD_DOC_VALUES.CL_VALUE%TYPE |
CLOB value |
-
FUNCTION GET_DOC_CL_VALUE
Get a CLOB value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| vch_VC_DOC_VALUES_TYPE_CODE |
IN |
SD_DOC_VALUES_TYPE.VC_CODE%TYPE |
VARCHAR2 |
|
Custom field code |
| RETURN SD_DOC_VALUES.CL_VALUE%TYPE |
CLOB value |
-
FUNCTION GET_DOC_C_FL_VALUE
Get a value of a check box custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_VALUE_TYPE_ID |
IN |
SD_DOC_VALUES.N_DOC_VALUE_TYPE_ID%TYPE |
NUMBER |
|
Custom field |
| RETURN SD_DOC_VALUES.C_FL_VALUE%TYPE |
Value of the check box |
-
FUNCTION GET_DOC_C_FL_VALUE
Get a value of a check box custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| vch_VC_DOC_VALUES_TYPE_CODE |
IN |
SD_DOC_VALUES_TYPE.VC_CODE%TYPE |
VARCHAR2 |
|
Custom field code |
| RETURN SD_DOC_VALUES.C_FL_VALUE%TYPE |
Value of the check box |
-
FUNCTION GET_DOC_PERIOD_INTERSECT
Check whether periods of two documents intersect.
Warning: please avoid using this function in SELECT statements since no indexes for period start and end dates
are used.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| dt_D_BEGIN_1 |
IN |
SD_DOCUMENTS.D_BEG%TYPE |
DATE |
|
Period start date for a first document |
| dt_D_END_1 |
IN |
SD_DOCUMENTS.D_END%TYPE |
DATE |
|
Period end date for the first document |
| dt_D_BEGIN_2 |
IN |
SD_DOCUMENTS.D_BEG%TYPE |
DATE |
|
Period start date for a second document |
| dt_D_END_2 |
IN |
SD_DOCUMENTS.D_END%TYPE |
DATE |
|
Period end date for the second document |
| RETURN CHAR |
'Y' when the periods intersect, otherwise 'N' |
-
FUNCTION GET_DOC_PERIOD_INTERSECT
Check whether periods of two documents overlap.
Warning: please avoid using this function in SELECT statements since no indexes for period start and end dates
are used.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID_1 |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
First document |
| num_N_DOC_ID_2 |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Second document |
| RETURN CHAR |
'Y' when the periods intersect, otherwise 'N' |
-
FUNCTION GET_HIGHER_DOC_LIST
Get a list of parent documents.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| dt_D_OPER |
IN |
DATE |
DATE |
SYSDATE |
Operation date |
| RETURN SD_DOC_LIST_TABLE_TYPE |
Table with parent documents |
| PIPELINED |
-
FUNCTION GET_NEXT_DOC_NO
Get the next available number by a document type.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_TYPE_ID |
IN |
SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
NUMBER |
|
Document type (REF_TYPE_Document_Type reference data) |
| num_N_PARENT_DOC_ID |
IN |
SD_DOCUMENTS.N_PARENT_DOC_ID%TYPE |
NUMBER |
|
Parent document |
| dt_D_DOC |
IN |
SD_DOCUMENTS.D_DOC%TYPE |
DATE |
NULL |
Document date |
| RETURN SD_DOCUMENTS.VC_DOC_NO%TYPE |
Next available number |
-
FUNCTION GET_N_DOC_STATE_ID
Get a document status.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.N_DOC_STATE_ID%TYPE |
Document status |
-
FUNCTION GET_N_PARENT_DOC_ID
Get a parent document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.N_PARENT_DOC_ID%TYPE |
Parent document |
-
FUNCTION GET_OBJ_VALUE_BY_ROLE
Get a record for a binding between an object and a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| RETURN SI_DOC_OBJECTS%ROWTYPE |
Binding record |
-
FUNCTION DOCUMENT_GOODS_HISTORY
Get a list of changes in services bound to a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_PRIMARY_KEY_VALUE |
IN |
NUMBER |
NUMBER |
NULL |
Primary key value (when searching for a specific binding) |
| dt_D_BEGIN |
IN |
DATE |
DATE |
ADD_MONTHS(SYSDATE -3) |
Start date of a search period |
| dt_D_END |
IN |
DATE |
DATE |
SYSDATE |
End date of the search period |
| RETURN SS_AUDIT_PKG_S.TABLE_HISTORY_LIST_TABLE_TYPE |
Table with changes in services |
| PIPELINED |
-
FUNCTION DOCUMENT_HISTORY
Get a list of changes in document parameters common for all documents.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| dt_D_BEGIN |
IN |
DATE |
DATE |
ADD_MONTHS(SYSDATE -3) |
Start date of a search period |
| dt_D_END |
IN |
DATE |
DATE |
SYSDATE |
End date of the search period |
| RETURN SS_AUDIT_PKG_S.TABLE_HISTORY_LIST_TABLE_TYPE |
Table with changes in document parameters |
| PIPELINED |
-
FUNCTION GET_ACCOUNT_BY_ROLE
Get a subject's account by a role in a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SI_DOC_SUBJECTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_ROLE_ID |
IN |
SI_DOC_SUBJECTS.N_DOC_ROLE_ID%TYPE |
NUMBER |
|
Subject role (REF_TYPE_Subj_Roles reference data) |
| ch_C_ACTIVE |
IN |
SI_DOC_SUBJECTS.C_ACTIVE%TYPE |
CHAR |
'Y' |
'Y' when searching among active bindings between subjects and the document, otherwise 'N' |
| RETURN SI_DOC_SUBJECTS.N_ACCOUNT_ID%TYPE |
Account |
-
FUNCTION GET_DOC_BY_BIND
Get a document bound to a specified one.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_BIND_TYPE_ID |
IN |
SD_DOC_DOCUMENTS.N_DOC_BD_TYPE_ID%TYPE |
NUMBER |
|
Binding type (REF_TYPE_Docs_Bind_Type reference data) |
| num_N_DOC_TYPE_ID |
IN |
SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
NUMBER |
NULL |
Bound document type (REF_TYPE_Document_Type reference data) |
| RETURN SD_DOC_DOCUMENTS.N_DOC_BIND_ID%TYPE |
Bound document |
-
FUNCTION GET_DOC_C_VALUE
Get a char value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_VALUE_TYPE_ID |
IN |
SD_DOC_VALUES.N_DOC_VALUE_TYPE_ID%TYPE |
NUMBER |
|
Custom field |
| RETURN SD_DOC_VALUES.C_VALUE%TYPE |
Char value |
-
FUNCTION GET_DOC_C_VALUE
Get a char value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| vch_VC_DOC_VALUES_TYPE_CODE |
IN |
SD_DOC_VALUES_TYPE.VC_CODE%TYPE |
VARCHAR2 |
|
Custom field code |
| RETURN SD_DOC_VALUES.C_VALUE%TYPE |
Char value |
-
FUNCTION GET_DOC_VC_VALUE
Get a string value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_VALUE_TYPE_ID |
IN |
SD_DOC_VALUES.N_DOC_VALUE_TYPE_ID%TYPE |
NUMBER |
|
Custom field |
| RETURN SD_DOC_VALUES.VC_VALUE%TYPE |
String value |
-
FUNCTION GET_DOC_VC_VALUE
Get a string value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| vch_VC_DOC_VALUES_TYPE_CODE |
IN |
SD_DOC_VALUES_TYPE.VC_CODE%TYPE |
VARCHAR2 |
|
Custom field code |
| RETURN SD_DOC_VALUES.VC_VALUE%TYPE |
String value |
-
FUNCTION GET_N_CONTRACT_ID
Get a service contract by an annex or an addendum.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_TYPE_ID |
IN |
SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
NUMBER |
NULL |
Document type (REF_TYPE_Document_Type reference data) |
| RETURN SD_DOCUMENTS.N_DOC_ID%TYPE |
Service contract, if the document is an annex (CONST.DOC_TYPE_ContractAPP) or an addendum (CONST.DOC_TYPE_AddAgreement), otherwise the document itself |
-
FUNCTION GET_N_DOC_WORKFLOW_ID
Get a document workflow.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.N_WORKFLOW_ID%TYPE |
Document workflow |
-
FUNCTION GET_SUBJECT_BY_PARENT_ROLE
Get a subject by a role either in a document or one of its parent documents.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SI_DOC_SUBJECTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_ROLE_ID |
IN |
SI_DOC_SUBJECTS.N_DOC_ROLE_ID%TYPE |
NUMBER |
|
Subject role (REF_TYPE_Subj_Roles reference data) |
| ch_C_ACTIVE |
IN |
SI_DOC_SUBJECTS.C_ACTIVE%TYPE |
CHAR |
'Y' |
'Y' when searching among active bindings between subjects and the document, otherwise 'N' |
| RETURN SI_DOC_SUBJECTS.N_SUBJECT_ID%TYPE |
Subject in the role |
-
FUNCTION IS_DOCUMENT_UNLOCKED_BY_PASSWORD
Verification that the document is temporarily unlocked
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
ID of document to check |
| RETURN MAIN.BOOL |
CONST.b_TRUE if the document is temporary unlocked, otherwise CONST.b_FALSE |
-
PROCEDURE UNLOCK_DOCUMENT_BY_PASSWORD
Temporary unlolocking of the document
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
ID of document to unlock |
| vch_ISSUE_CODE |
IN |
VARCHAR2 |
VARCHAR2 |
|
Issue code |
| vch_HASH |
IN |
VARCHAR2 |
VARCHAR2 |
|
Hash |
-
PROCEDURE CLEAR_DUBS_TT_V_DOC_BINDS
Delete duplicates with data on bound documents from the temporary table TT_V_DOC_BINDS.
-
FUNCTION DOCUMENT_SPECIAL_HISTORY
Get a list of changes in document parameters specific for this type of documents.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| dt_D_BEGIN |
IN |
DATE |
DATE |
ADD_MONTHS(SYSDATE -3) |
Start date of a search period |
| dt_D_END |
IN |
DATE |
DATE |
SYSDATE |
End date of the search period |
| RETURN SS_AUDIT_PKG_S.TABLE_HISTORY_LIST_TABLE_TYPE |
Table with changes in document parameters |
| PIPELINED |
-
FUNCTION GET_DOC_D_VALUE
Get a date value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_VALUE_TYPE_ID |
IN |
SD_DOC_VALUES.N_DOC_VALUE_TYPE_ID%TYPE |
NUMBER |
|
Custom field |
| RETURN SD_DOC_VALUES.D_VALUE%TYPE |
Date value |
-
FUNCTION GET_DOC_D_VALUE
Get a date value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| vch_VC_DOC_VALUES_TYPE_CODE |
IN |
SD_DOC_VALUES_TYPE.VC_CODE%TYPE |
VARCHAR2 |
|
Custom field code |
| RETURN SD_DOC_VALUES.D_VALUE%TYPE |
Date value |
-
FUNCTION GET_DOC_PATTERN_FILES_LIST
Get a list of document print templates.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOC_FILES_TABLE_TYPE |
Table with document print templates |
| PIPELINED |
-
FUNCTION GET_DOC_PERIOD_STRING
Get a document validity period as a string.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN VARCHAR2 |
Document period as a string |
-
FUNCTION GET_DOC_VALUE_ROW
Get a record with a value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| RETURN SD_DOC_VALUES%ROWTYPE |
Record with the field value |
-
FUNCTION GET_D_TIME
Get a document time.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.D_TIME%TYPE |
Document time |
-
FUNCTION GET_LAST_COMMENT
Get the last comment to a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN DOC_COMMENT_TABLE_TYPE |
Last comment |
| PIPELINED |
-
FUNCTION GET_PAYMENT_HISTORY_COMMENT
Get a comment on a payment by a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOC_COMMENTS.CL_COMMENT%TYPE |
Comment on the payment |
-
FUNCTION GET_VC_DOC_CODE
Get a document code.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.VC_CODE%TYPE |
Document code |
-
FUNCTION GET_VC_DOC_NO
Get a document number.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.VC_DOC_NO%TYPE |
Document number |
-
FUNCTION IS_EXIST_DOC_NO
Check whether an uncanceled document with the same number as the specified document exists.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| vch_VC_DOC_NO |
IN |
SD_DOCUMENTS.VC_DOC_NO%TYPE |
VARCHAR2 |
|
|
| num_N_DOC_EXCLUDE_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
NULL |
Document to be excluded from the search |
| num_N_PARENT_DOC_ID |
IN |
SD_DOCUMENTS.N_PARENT_DOC_ID%TYPE |
NUMBER |
NULL |
Parent document |
| num_N_DOC_TYPE_ID |
IN |
SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
NUMBER |
|
Document type (REF_TYPE_Document_Type reference data) |
| dt_D_DOC |
IN |
SD_DOCUMENTS.D_DOC%TYPE |
DATE |
SYSDATE |
Document date |
| RETURN MAIN.BOOL |
CONST.b_TRUE when such a document exists, otherwise CONST.b_FALSE |
-
PROCEDURE CHK_DOC_CONTAINDED_PERIOD
Check for a document period to be nested in a period of another (basic) document.
Start dates of the document periods are to be non-empty.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_BASE_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Basic document |
-
FUNCTION DOCUMENT_OBJECTS_HISTORY
Get a list of changes in objects bound to a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_PRIMARY_KEY_VALUE |
IN |
NUMBER |
NUMBER |
NULL |
Primary key value (when searching for a specific binding) |
| dt_D_BEGIN |
IN |
DATE |
DATE |
ADD_MONTHS(SYSDATE -3) |
Start date of a search period |
| dt_D_END |
IN |
DATE |
DATE |
SYSDATE |
End date of the search period |
| RETURN SS_AUDIT_PKG_S.TABLE_HISTORY_LIST_TABLE_TYPE |
Table with changes in objects |
| PIPELINED |
-
PROCEDURE FILL_TT_V_DOC_BINDS
Fill the temporary table TT_V_DOC_BINDS with data on bound documents.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| b_ExcludeDraft |
IN |
MAIN.BOOL |
NUMBER |
MAIN.b_TRUE |
Exclude draft documents from the table? {*} CONST.b_TRUE — exclude draft documents {*} CONST.b_FALSE — include draft documents |
| dt_D_OPER |
IN |
DATE |
DATE |
SYSDATE |
Operation date |
| b_ClearTemps |
IN |
MAIN.BOOL |
NUMBER |
MAIN.b_TRUE |
Delete old data from the table? {*} CONST.b_TRUE — delete {*} CONST.b_FALSE — do not delete |
-
FUNCTION GET_AVAILABLE_DOC_TRANSITIONS
Get a list of statuses a document can be transferred to from its current status.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_USER_ID |
IN |
SI_SUBJECTS.N_SUBJECT_ID%TYPE |
NUMBER |
SYS_CONTEXT('MAIN' 'N_USER_ID') |
Current user |
| RETURN DOC_STATES_LIST |
Table with available statuses |
| PIPELINED |
-
FUNCTION GET_D_BEGIN
Get a start date of a document validity period.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.D_BEGIN%TYPE |
Period start date |
-
FUNCTION GET_NEIGHBOR_DOC_LIST
Get a list of documents with the same type and provider as a specified one, ordered by document periods
start dates. You can restrict start and end dates in document periods.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
NUMBER |
|
Document |
| dt_D_BEGIN_MIN |
IN |
SD_DOCUMENTS.D_BEG%TYPE |
DATE |
NULL |
Minimum start date |
| dt_D_END_MIN |
IN |
SD_DOCUMENTS.D_END%TYPE |
DATE |
NULL |
Minimum end date |
| dt_D_BEGIN_MAX |
IN |
SD_DOCUMENTS.D_BEG%TYPE |
DATE |
NULL |
Maximum start date |
| dt_D_END_MAX |
IN |
SD_DOCUMENTS.D_END%TYPE |
DATE |
NULL |
Maximum end date |
| ch_C_INCLUDE_SELF |
IN |
CHAR |
CHAR |
'Y' |
Include the specified document into the list? {*} 'Y' — include the document {*} 'N' - exclude the document |
| ch_C_CHECK_WORKFLOW |
IN |
CHAR |
CHAR |
'N' |
Search only among documents with the same workflow? {*} 'Y' — search only among documents with the same workflow {*} 'N' — ignore workflows |
| RETURN DOC_PERIOD_TABLE_TYPE |
Table with documents with the same type and provider as the specified one |
| PIPELINED |
-
FUNCTION GET_N_FIRM_ID
Get a division a document belongs to.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.N_FIRM_ID%TYPE |
Division the document belongs to |
-
FUNCTION GET_OBJECT_BY_ROLE
Get an object by a role in a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SI_DOC_SUBJECTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_ROLE_ID |
IN |
SI_DOC_SUBJECTS.N_DOC_ROLE_ID%TYPE |
NUMBER |
|
Object role (REF_TYPE_Obj_Roles reference data) |
| ch_C_ACTIVE |
IN |
SI_DOC_SUBJECTS.C_ACTIVE%TYPE |
CHAR |
'Y' |
'Y' when searching among active bindings between objects and the document, otherwise 'N' |
| RETURN SI_DOC_OBJECTS.N_OBJECT_ID%TYPE |
Object in the role |
-
FUNCTION GET_STORNO_PROC_BY_DOC
Get a procedure for copying a document and check whether the document can be reversed.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_TYPE_ID |
IN |
SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
NUMBER |
|
Document type (REF_TYPE_Document_Type reference data) |
| vch_CopyProc |
OUT |
VARCHAR2 |
VARCHAR2 |
|
Procedure for copying |
| RETURN MAIN.BOOL |
CONST.b_TRUE when the document can be reversed, otherwise CONST.b_FALSE |
-
FUNCTION GET_VC_DOC_NAME
Get a document name.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.VC_NAME%TYPE |
Document name |
-
PROCEDURE CHK_DOCS_SUBJECTS
Check if a subject that is assigned a specified role in a document has a role in another (basic) document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_BASE_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Basic document |
| num_N_SUBJ_ROLE_ID |
IN |
SI_DOC_SUBJECTS.N_SUBJECT_ID%TYPE |
NUMBER |
SS_CONSTANTS_PKG_S.SUBJ_ROLE_Provider |
Subject role in the document (REF_TYPE_Subj_Roles reference data) |
| num_N_BASE_SUBJ_ROLE_ID |
IN |
SI_DOC_SUBJECTS.N_SUBJECT_ID%TYPE |
NUMBER |
SS_CONSTANTS_PKG_S.SUBJ_ROLE_Provider |
Subject role in the basic document (REF_TYPE_Subj_Roles reference data) |
-
FUNCTION DOCUMENT_CONTENT_HISTORY
Get a list of changes in document contents.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_PRIMARY_KEY_VALUE |
IN |
NUMBER |
NUMBER |
NULL |
Primary key value (when searching for a specific content line) |
| dt_D_BEGIN |
IN |
DATE |
DATE |
ADD_MONTHS(SYSDATE -3) |
Start date of a search period |
| dt_D_END |
IN |
DATE |
DATE |
SYSDATE |
End date of the search period |
| RETURN SS_AUDIT_PKG_S.TABLE_HISTORY_LIST_TABLE_TYPE |
Table with changes in document contents |
| PIPELINED |
-
FUNCTION GET_DOC_BINDS_DOC_LIST
Get a list of all bound documents.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| b_ExcludeDraft |
IN |
MA.BOOL |
NUMBER |
MAIN.b_TRUE |
Exclude draft documents from the list? {*} CONST.b_TRUE — exclude draft documents {*} CONST.b_FALSE — include draft documents |
| dt_D_OPER |
IN |
DATE |
DATE |
SYSDATE |
Operation date |
| RETURN SD_DOC_BINDS_LIST_TABLE_TYPE |
Table with bound documents |
| PIPELINED |
-
FUNCTION GET_DOC_NEAREST_DOC_LIST
Get a list of closest bound documents.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| b_ExcludeDraft |
IN |
MA.BOOL |
NUMBER |
MAIN.b_TRUE |
Exclude draft documents from the list? {*} CONST.b_TRUE — exclude draft documents {*} CONST.b_FALSE — include draft documents |
| dt_D_OPER |
IN |
DATE |
DATE |
SYSDATE |
Operation date |
| num_N_INCLUDE_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
NULL |
Document to be included in the list regardless of its status |
| RETURN SD_DOC_LIST_TABLE_TYPE |
Table with closest bound documents |
| PIPELINED |
-
FUNCTION GET_DOC_N_REF_ID
Get a value of a drop-down list (a reference value).
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_VALUE_TYPE_ID |
IN |
SD_DOC_VALUES.N_DOC_VALUE_TYPE_ID%TYPE |
NUMBER |
|
Custom field |
| RETURN SD_DOC_VALUES.N_REF_ID%TYPE |
Value of the drop-down list |
-
FUNCTION GET_DOC_N_REF_ID
Get a value of a drop-down list (a reference value).
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| vch_VC_DOC_VALUES_TYPE_CODE |
IN |
SD_DOC_VALUES_TYPE.VC_CODE%TYPE |
VARCHAR2 |
|
Custom field code |
| RETURN SD_DOC_VALUES.N_REF_ID%TYPE |
Value of the drop-down list |
-
FUNCTION GET_N_DOC_TYPE_ID
Get a document type.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
Document type (REF_TYPE_Document_Type reference data) |
-
FUNCTION GET_N_SUBDOC_WORKFLOW_ID
Get a service contract workflow by a basic contract.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Basic contract |
| RETURN SD_CONTRACTS.N_SUBDOC_WORKFLOW_ID%TYPE |
Service contract workflow |
-
FUNCTION GET_SUBJECT_BY_ROLE
Get a subject by a role in a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SI_DOC_SUBJECTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_ROLE_ID |
IN |
SI_DOC_SUBJECTS.N_DOC_ROLE_ID%TYPE |
NUMBER |
|
Subject role (REF_TYPE_Subj_Roles reference data) |
| ch_C_ACTIVE |
IN |
SI_DOC_SUBJECTS.C_ACTIVE%TYPE |
CHAR |
'Y' |
'Y' when searching among active bindings between subjects and the document, otherwise 'N' |
| RETURN SI_DOC_SUBJECTS.N_SUBJECT_ID%TYPE |
Subject in the role |
-
PROCEDURE GEN_DOC_CODE_NAME_IF_NEEDED
Generate a document code and name (if not generated yet).
-
FUNCTION GET_DOC_VALUE
Get a document record.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| RETURN SD_DOCUMENTS%ROWTYPE |
Document record |
-
FUNCTION GET_N_SINGLE_DOC_ID
Get a document by a provider.
Warning: the function works only for documents that are unique in terms of periods and providers.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_PROVIDER_ID |
IN |
SI_SUBJECTS.N_SUBJECT_ID%TYPE |
NUMBER |
|
Provider |
| num_N_DOC_TYPE_ID |
IN |
SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
NUMBER |
|
Document type (REF_TYPE_Document_Type reference data) |
| dt_D_OPER |
IN |
SD_DOCUMENTS.D_BEG%TYPE |
DATE |
NULL |
Operation date |
| b_RAISE_EXCEPTIONS |
IN |
MA.BOOL |
NUMBER |
MAIN.b_TRUE |
Raise an exception when no document or too many documents found? {*} CONST.b_TRUE — raise the exception {*} CONST.b_FALSE — return NULL |
| RETURN SD_DOCUMENTS.N_DOC_ID%TYPE |
Document |
-
PROCEDURE CHK_DOC_PERIOD
Check (and adjust if needed) a document period.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_TYPE_ID |
IN |
SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
NUMBER |
|
Document type (REF_TYPE_Document_Type reference data) |
| num_N_DOC_STATE_ID |
IN |
SD_DOCUMENTS.N_DOC_STATE_ID%TYPE |
NUMBER |
|
Document status (REF_TYPE_Document_State reference data) |
| dt_D_DOC |
IN |
SD_DOCUMENTS.D_DOC%TYPE |
DATE |
|
Document date |
| vch_VC_NAME |
IN |
SD_DOCUMENTS.VC_NAME%TYPE |
VARCHAR2 |
|
Document name |
| num_N_PARENT_DOC_ID |
IN |
SD_DOCUMENTS.N_PARENT_DOC_ID%TYPE |
NUMBER |
|
Parent document |
| dt_D_BEGIN |
IN/OUT |
SD_DOCUMENTS.D_BEGIN%TYPE |
DATE |
|
Period start date |
| dt_D_END |
IN/OUT |
SD_DOCUMENTS.D_END%TYPE |
DATE |
|
Period end date |
-
FUNCTION GET_DOC_N_VALUE
Get a numerical value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_DOC_VALUE_TYPE_ID |
IN |
SD_DOC_VALUES.N_DOC_VALUE_TYPE_ID%TYPE |
NUMBER |
|
Custom field |
| RETURN SD_DOC_VALUES.N_VALUE%TYPE |
Numerical value |
-
FUNCTION GET_DOC_N_VALUE
Get a numerical value of a custom field.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOC_VALUES.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| vch_VC_DOC_VALUES_TYPE_CODE |
IN |
SD_DOC_VALUES_TYPE.VC_CODE%TYPE |
VARCHAR2 |
|
Custom field code |
| RETURN SD_DOC_VALUES.N_VALUE%TYPE |
Numerical value |
-
FUNCTION GET_INTERSECT_DOC_LIST
Get a list of documents which periods overlap with a specified one.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_PROVIDER_ID |
IN |
SI_SUBJECTS.N_SUBJECT_ID%TYPE |
NUMBER |
|
Provider |
| num_N_DOC_TYPE_ID |
IN |
SD_DOCUMENTS.N_DOC_TYPE_ID%TYPE |
NUMBER |
|
Document type (REF_TYPE_Document_Type reference data) |
| dt_D_BEGIN |
IN |
DATE |
DATE |
|
Period start date |
| dt_D_END |
IN |
DATE |
DATE |
|
Period end date |
| RETURN DOC_PERIOD_TABLE_TYPE |
Table with documents which periods overlap with the specified one |
| PIPELINED |
-
FUNCTION GET_N_REASON_DOC_ID
Get a reason document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.N_REASON_DOC_ID%TYPE |
Reason document |
-
FUNCTION DOCUMENT_GOOD_AUTHORS
Get a list of users who created subscriptions.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| num_N_SUBJ_GOOD_ID |
IN |
SI_SUBSCRIPTIONS.N_SUBSCRIPTION_ID%TYPE |
NUMBER |
NULL |
Subscription (when searching for a specific one) |
| dt_D_BEGIN |
IN |
DATE |
DATE |
ADD_MONTHS(SYSDATE -3) |
Start date of a search period |
| dt_D_END |
IN |
DATE |
DATE |
SYSDATE |
End date of the search period |
| RETURN SS_AUDIT_PKG_S.TABLE_AUTHOR_LIST |
Table with users who created subscriptions |
| PIPELINED |
-
FUNCTION GET_D_END
Get an end date of a document validity period.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN SD_DOCUMENTS.D_END%TYPE |
Period end date |
-
FUNCTION GET_ROOT_BASE_CONTRACT_ID
Get a top-level basic contract for a contract.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Contract |
| RETURN SD_DOCUMENTS.N_DOC_ID%TYPE |
Top-level basic contract |
-
FUNCTION GET_VALUE_BY_ROLE
Get a record for a binding between a subject and a document.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| RETURN SI_DOC_SUBJECTS%ROWTYPE |
Binding record |
-
FUNCTION IS_DOC_DRAFT
Check whether a document is a draft.
| Argument |
Direction |
Reference type |
Type |
Default value |
Description |
| num_N_DOC_ID |
IN |
SD_DOCUMENTS.N_DOC_ID%TYPE |
NUMBER |
|
Document |
| RETURN MAIN.BOOL |
CONST.b_TRUE, when the document status is "Draft" CONST.b_FALSE otherwise |