506: end if;
507:
508: if(l_document_status is null or
509: l_document_status in ('IN PROCESS', 'INCOMPLETE', 'REQUIRES REAPPROVAL')) then
510: WF_NOTIFICATION.WriteToClob(document, ' ');
511: return;
512: end if;
513:
514: --
1920:
1921: END IF;
1922:
1923: /* writing the email body into a clob variable */
1924: WF_NOTIFICATION.WriteToClob(document, l_document);
1925: l_document := null;
1926:
1927: end loop;
1928:
1956: end if;
1957:
1958: l_document := l_document || '
2533: -- l_document := l_document || 'Shipment-level attachment' || NL;
2534:
2535: l_document := l_document || NL;
2536:
2537: WF_NOTIFICATION.WriteToClob(document, l_document);
2538: l_document := null;
2539: end loop;
2540:
2541: IF (l_document_type = 'PO') THEN
2554: l_document := l_document || '(' || l_currency_code || ')' ||
2555: nvl(to_char(l_extension_total, FND_CURRENCY.GET_FORMAT_MASK(l_currency_code, 30)), ' ') --bug 3405085
2556: || NL;
2557: l_document := l_document || NL;
2558: WF_NOTIFICATION.WriteToClob(document, l_document);
2559: end if;
2560:
2561: END IF;
2562:
2564:
2565: EXCEPTION
2566: WHEN OTHERS THEN
2567:
2568: WF_NOTIFICATION.WriteToClob(document, 'failed');
2569:
2570: RAISE;
2571:
2572: END;
4609:
4610:
4611: /* EMAILPO FPH START
4612: set the context so fnd_profile.get methods work correctly
4613: For older wf notifications that send in documentid and documenttypecode instead of
4614: itemtype and itemkey combination the following code to get the user_id, app_id and
4615: resp_id will fail. Will trap and ignore it. The consequence is that tandc profile
4616: options will only be considered at site level(consistent with Previous Behaviour/Bug)
4617: */
4673: --
4674:
4675: if(l_document_status is null or
4676: l_document_status in ('IN PROCESS', 'INCOMPLETE', 'REQUIRES REAPPROVAL')) then
4677: WF_NOTIFICATION.WriteToClob(document, ' ');
4678: return;
4679: end if;
4680:
4681:
4725: l_document := '
';
4760: /* write the contents into the document */
4761: UTL_FILE.GET_LINE(v_filehandle,v_terms);
4762: l_document := l_document || v_terms || NL;
4763: l_document := l_document || '
' || NL;
4764: WF_NOTIFICATION.WriteToClob(document, l_document);
4765: l_document := null;
4766:
4767: x_progress := '004';
4768:
4773:
4774: end loop;
4775:
4776: if l_document is null then
4777: WF_NOTIFICATION.WriteToClob(document, '
4785: x_progress := '003';
4786: /* write the contents into the document */
4787: UTL_FILE.GET_LINE(v_filehandle,v_terms);
4788: l_document := l_document || v_terms || NL;
4789: WF_NOTIFICATION.WriteToClob(document, l_document);
4790: x_progress := '004';
4791:
4792: exception
4793: when no_data_found then
4811: -- in the FND_LOG_MESSAGES table.
4812: EXCEPTION
4813: WHEN UTL_FILE.INVALID_PATH THEN
4814: l_document := '
4820: UTL_FILE.FCLOSE(v_filehandle);
4821:
4822: WHEN UTL_FILE.INVALID_MODE THEN
4823: l_document := '
4829: UTL_FILE.FCLOSE(v_filehandle);
4830:
4831: WHEN UTL_FILE.INTERNAL_ERROR THEN
4832: l_document := '
4838: UTL_FILE.FCLOSE(v_filehandle);
4839:
4840: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4841: l_document := '
4847: UTL_FILE.FCLOSE(v_filehandle);
4848:
4849: WHEN UTL_FILE.INVALID_OPERATION THEN
4850: l_document := '
4856: UTL_FILE.FCLOSE(v_filehandle);
4857:
4858: WHEN UTL_FILE.READ_ERROR THEN
4859: l_document := '
4865: UTL_FILE.FCLOSE(v_filehandle);
4866:
4867: WHEN OTHERS THEN
4868: l_document := '