[Home] [Help]
3213: AND shipment_type IN ('PRICE BREAK', 'STANDARD', 'PREPAYMENT')) AND ad.entity_name = 'PO_SHIPMENTS') OR
3214: (ad.pk2_value IN (SELECT To_Char(item_id)
3215: FROM po_lines_all
3216: WHERE po_header_id = l_po_header_id
3217: AND TO_CHAR(PO_COMMUNICATION_PVT.getInventoryOrgId()) = ad.pk1_value
3218: AND item_id IS NOT NULL ) AND ad.entity_name = 'MTL_SYSTEM_ITEMS') )
3219: AND d.document_id = ad.document_id
3220: AND dcu.category_id = d.category_id
3221: AND dcu.attachment_function_id = af.attachment_function_id
3298: BEGIN
3299: -- Get the 'Maximum Attachment Size' value from Purchasing Options
3300: -- A value of 0 means Zip Attachments are not supported
3301: l_progress := '040';
3302: l_max_attachment_size := PO_COMMUNICATION_PVT.get_max_zip_size(itemtype, itemkey);
3303:
3304: IF l_max_attachment_size > 0 THEN
3305: -- If PO has no 'To Supplier' file attachments then 'Zip Attachment' link
3306: -- should not show up in the notifications and Zip file should not be generated
3310: PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Checking for supplier file attachments');
3311: END IF;
3312:
3313: BEGIN
3314: l_attachments_exist := PO_COMMUNICATION_PVT.check_for_attachments(p_document_type => l_document_type, p_document_id => l_document_id);
3315: EXCEPTION
3316: WHEN no_data_found THEN
3317: IF (g_po_wf_debug = 'Y') THEN
3318: PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' No Supplier file attachments');
3326:
3327: IF l_attachments_exist = 'Y' THEN
3328: l_progress := '050';
3329: po_wf_util_pkg.SetItemAttrText (aname => 'ZIP_ATTACHMENT',
3330: avalue => 'PLSQLBLOB:PO_COMMUNICATION_PVT.ZIP_ATTACH/' || itemtype || ':' || itemkey);
3331:
3332: /*---------------------------------------------------------------------------------
3333: An error condition is when two or more file attachments have the same file name
3334: but different file sizes. In this case a zip error notification should be sent
3386: --
3387: (ad.pk2_value IN (SELECT item_id
3388: FROM po_lines_all
3389: WHERE po_header_id = l_document_id
3390: AND TO_CHAR(PO_COMMUNICATION_PVT.getInventoryOrgId()) = ad.pk1_value
3391: AND item_id IS NOT NULL) AND ad.entity_name = 'MTL_SYSTEM_ITEMS'))
3392: AND d.document_id = ad.document_id
3393: AND dcu.category_id = d.category_id
3394: AND dcu.attachment_function_id = af.attachment_function_id
3440: PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_error_flag:'||l_error_flag);
3441: END IF;
3442:
3443: IF l_error_flag = 1 THEN
3444: PO_COMMUNICATION_PVT.set_zip_error_code(itemtype, itemkey, 'DUPLICATE_FILENAME');
3445: l_max_attachment_size := 0; --No need to generate the pdf
3446: END IF;
3447: END IF; --IF l_duplicate_filenames = 'Y'
3448: END IF; --IF l_attachments_exist = 'Y'
3453: IF (g_po_wf_debug = 'Y') THEN
3454: PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||'Exception when detecting duplicates');
3455: PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' sqlerrm:'||sqlerrm);
3456: END IF;
3457: PO_COMMUNICATION_PVT.set_zip_error_code(itemtype, itemkey, 'UNEXPECTED');
3458: l_max_attachment_size := 0; --No need to generate the pdf
3459: END;
3460:
3461: l_progress := '070';