1: PACKAGE BODY PO_SIGNATURE_PVT AS
2: /* $Header: POXVSIGB.pls 120.42.12020000.3 2013/02/10 22:53:23 vegajula ship $ */
3:
4: -- Read the profile option that enables/disables the debug log
5: g_po_wf_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('PO_SET_DEBUG_WORKFLOW_ON'),'N');
3:
4: -- Read the profile option that enables/disables the debug log
5: g_po_wf_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('PO_SET_DEBUG_WORKFLOW_ON'),'N');
6:
7: c_log_head CONSTANT VARCHAR2(30) := 'po.plsql.PO_SIGNATURE_PVT.';
8: g_pkg_name CONSTANT VARCHAR2(30) := 'PO_SIGNATURE_PVT'; --
9: g_debug_stmt CONSTANT BOOLEAN := PO_DEBUG.is_debug_stmt_on;
10: g_debug_unexp CONSTANT BOOLEAN := PO_DEBUG.is_debug_unexp_on;
11:
4: -- Read the profile option that enables/disables the debug log
5: g_po_wf_debug VARCHAR2(1) := NVL(FND_PROFILE.VALUE('PO_SET_DEBUG_WORKFLOW_ON'),'N');
6:
7: c_log_head CONSTANT VARCHAR2(30) := 'po.plsql.PO_SIGNATURE_PVT.';
8: g_pkg_name CONSTANT VARCHAR2(30) := 'PO_SIGNATURE_PVT'; --
10: g_debug_unexp CONSTANT BOOLEAN := PO_DEBUG.is_debug_unexp_on;
11:
12: -- Read the profile option that determines whether the promise date will be defaulted with need-by date or not
105: l_po_itemkey PO_HEADERS_ALL.wf_item_key%TYPE;
106: BEGIN
107:
108: IF (g_po_wf_debug = 'Y') THEN
109: l_progress := 'PO_SIGNATURE_PVT.Set_Startup_Values: 01';
110: PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
111: END IF;
112:
113: -- Do nothing in cancel or timeout mode
270: PO_WF_UTIL_PKG.SetItemAttrText(itemtype => itemtype,
271: itemkey => itemkey,
272: aname => 'PO_SUP_SIGNATURE_MSG_BODY',
273: avalue =>
274: 'PLSQLCLOB:PO_SIGNATURE_PVT.get_signature_notfn_body /'|| l_document_id ||':'||itemtype||':'||itemkey);
275:
276: /*Bug 9865162. Included fund_user check while deriving the supplier user name*/
277: BEGIN
278: SELECT fu.user_name
313: l_esigner_exists := po_wf_util_pkg.GetItemAttrText (itemtype => itemtype, itemkey => l_po_itemkey, aname => 'E_SIGNER_EXISTS');
314: PO_WF_UTIL_PKG.SetItemAttrText(itemtype => itemtype, itemkey => itemkey, aname => 'E_SIGNER_EXISTS', avalue => l_esigner_exists);
315:
316: IF (g_po_wf_debug = 'Y') THEN
317: l_progress := 'PO_SIGNATURE_PVT.Set_Startup_Values: 02 with E_SIGNER_EXISTS '|| l_esigner_exists;
318: PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
319: END IF;
320:
321: EXCEPTION
321: EXCEPTION
322: WHEN l_binding_exception then
323: l_doc_string := PO_REQAPPROVAL_INIT1.get_error_doc(itemtype, itemkey);
324: l_preparer_user_name := PO_REQAPPROVAL_INIT1.get_preparer_user_name(itemtype, itemkey);
325: WF_CORE.context('PO_SIGNATURE_PVT','Set_Startup_Values',l_progress);
326: PO_REQAPPROVAL_INIT1.send_error_notif(itemtype, itemkey, l_preparer_user_name, l_doc_string, 'l_binding_exception - '||sqlerrm, 'PO_SIGNATURE_PVT.SET_STARTUP_VALUES');
327: RAISE;
328:
329: WHEN OTHERS THEN
322: WHEN l_binding_exception then
323: l_doc_string := PO_REQAPPROVAL_INIT1.get_error_doc(itemtype, itemkey);
324: l_preparer_user_name := PO_REQAPPROVAL_INIT1.get_preparer_user_name(itemtype, itemkey);
325: WF_CORE.context('PO_SIGNATURE_PVT','Set_Startup_Values',l_progress);
326: PO_REQAPPROVAL_INIT1.send_error_notif(itemtype, itemkey, l_preparer_user_name, l_doc_string, 'l_binding_exception - '||sqlerrm, 'PO_SIGNATURE_PVT.SET_STARTUP_VALUES');
327: RAISE;
328:
329: WHEN OTHERS THEN
330: l_doc_string := PO_REQAPPROVAL_INIT1.get_error_doc(itemType, itemkey);
328:
329: WHEN OTHERS THEN
330: l_doc_string := PO_REQAPPROVAL_INIT1.get_error_doc(itemType, itemkey);
331: l_preparer_user_name := PO_REQAPPROVAL_INIT1.get_preparer_user_name(itemType, itemkey);
332: WF_CORE.context('PO_SIGNATURE_PVT','Set_Startup_Values',l_progress);
333: PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'PO_SIGNATURE_PVT.SET_STARTUP_VALUES');
334: RAISE;
335:
336: END SET_STARTUP_VALUES;
329: WHEN OTHERS THEN
330: l_doc_string := PO_REQAPPROVAL_INIT1.get_error_doc(itemType, itemkey);
331: l_preparer_user_name := PO_REQAPPROVAL_INIT1.get_preparer_user_name(itemType, itemkey);
332: WF_CORE.context('PO_SIGNATURE_PVT','Set_Startup_Values',l_progress);
333: PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'PO_SIGNATURE_PVT.SET_STARTUP_VALUES');
334: RAISE;
335:
336: END SET_STARTUP_VALUES;
337:
401: l_item_type := substr(document_id, l_firstcolon + 1, l_secondcolon - l_firstcolon - 1);
402: l_item_key := substr(document_id, l_secondcolon+1,length(document_id) - l_secondcolon);
403:
404: IF (g_po_wf_debug = 'Y') THEN
405: l_progress := 'PO_SIGNATURE_PVT.get_signature_notfn_body: 01';
406: PO_WF_DEBUG_PKG.insert_debug(l_item_type,l_item_key,l_progress);
407: END IF;
408:
409: l_buyer_name := PO_WF_UTIL_PKG.GetItemAttrText (itemtype => l_item_type,
522:
523: l_msgbody := l_msgbody || '