460: end if;
461:
462: if(l_document_status is null or
463: l_document_status in ('IN PROCESS', 'INCOMPLETE', 'REQUIRES REAPPROVAL')) then
464: WF_NOTIFICATION.WriteToClob(document, ' ');
465: return;
466: end if;
467:
468:
1726:
1727: END IF;
1728:
1729: /* writing the email body into a clob variable */
1730: WF_NOTIFICATION.WriteToClob(document, l_document);
1731: l_document := null;
1732:
1733: end loop;
1734:
1762: end if;
1763:
1764: l_document := l_document || '
2312: -- l_document := l_document || 'Shipment-level attachment' || NL;
2313:
2314: l_document := l_document || NL;
2315:
2316: WF_NOTIFICATION.WriteToClob(document, l_document);
2317: l_document := null;
2318: end loop;
2319:
2320: IF (l_document_type = 'PO') THEN
2333: l_document := l_document || '(' || l_currency_code || ')' ||
2334: nvl(to_char(l_extension_total, FND_CURRENCY.GET_FORMAT_MASK(l_currency_code, 30)), ' ') --bug 3405085
2335: || NL;
2336: l_document := l_document || NL;
2337: WF_NOTIFICATION.WriteToClob(document, l_document);
2338: end if;
2339:
2340: END IF;
2341:
2343:
2344: EXCEPTION
2345: WHEN OTHERS THEN
2346:
2347: WF_NOTIFICATION.WriteToClob(document, 'failed');
2348:
2349: RAISE;
2350:
2351: END;
4142:
4143:
4144: /* EMAILPO FPH START
4145: set the context so fnd_profile.get methods work correctly
4146: For older wf notifications that send in documentid and documenttypecode instead of
4147: itemtype and itemkey combination the following code to get the user_id, app_id and
4148: resp_id will fail. Will trap and ignore it. The consequence is that tandc profile
4149: options will only be considered at site level(consistent with Previous Behaviour/Bug)
4150: */
4180: end if;
4181:
4182: if(l_document_status is null or
4183: l_document_status in ('IN PROCESS', 'INCOMPLETE', 'REQUIRES REAPPROVAL')) then
4184: WF_NOTIFICATION.WriteToClob(document, ' ');
4185: return;
4186: end if;
4187:
4188:
4225: l_document := '
';
4260: /* write the contents into the document */
4261: UTL_FILE.GET_LINE(v_filehandle,v_terms);
4262: l_document := l_document || v_terms || NL;
4263: l_document := l_document || '
' || NL;
4264: WF_NOTIFICATION.WriteToClob(document, l_document);
4265: l_document := null;
4266:
4267: x_progress := '004';
4268:
4273:
4274: end loop;
4275:
4276: if l_document is null then
4277: WF_NOTIFICATION.WriteToClob(document, '
4285: x_progress := '003';
4286: /* write the contents into the document */
4287: UTL_FILE.GET_LINE(v_filehandle,v_terms);
4288: l_document := l_document || v_terms || NL;
4289: WF_NOTIFICATION.WriteToClob(document, l_document);
4290: x_progress := '004';
4291:
4292: exception
4293: when no_data_found then
4311: -- in the FND_LOG_MESSAGES table.
4312: EXCEPTION
4313: WHEN UTL_FILE.INVALID_PATH THEN
4314: l_document := '
4320: UTL_FILE.FCLOSE(v_filehandle);
4321:
4322: WHEN UTL_FILE.INVALID_MODE THEN
4323: l_document := '
4329: UTL_FILE.FCLOSE(v_filehandle);
4330:
4331: WHEN UTL_FILE.INTERNAL_ERROR THEN
4332: l_document := '
4338: UTL_FILE.FCLOSE(v_filehandle);
4339:
4340: WHEN UTL_FILE.INVALID_FILEHANDLE THEN
4341: l_document := '
4347: UTL_FILE.FCLOSE(v_filehandle);
4348:
4349: WHEN UTL_FILE.INVALID_OPERATION THEN
4350: l_document := '
4356: UTL_FILE.FCLOSE(v_filehandle);
4357:
4358: WHEN UTL_FILE.READ_ERROR THEN
4359: l_document := '
4365: UTL_FILE.FCLOSE(v_filehandle);
4366:
4367: WHEN OTHERS THEN
4368: l_document := '