Skip to content

Procurement Documents

Module: procurement_documents. The procurement side's document register: a library tree, a document grid with revisions, uploads, routing, send-by-email and a set of printed status reports. The approved PDFs of every procurement form (Requisition, RFQ, bid evaluation, PO, MRR) are filed here by their *.class.php.

How this page was verified

Written from master on 2026-09-06 and compared with the big five the same day. No earlier page existed. A map, not a line-by-line trace: 32 files, about 300 database calls.

Where it sits

Procurement Doc Library (tree)  →  Procurement Documents (grid, revisions)  →  routing  →  send / print
          ↑ StoreDocumentsToProcumentDocs() from spb, rfq, bid, po, mrr

It is the procurement twin of the DMS Document Library: the same shape, its own tables, its own privilege file.

The data

TableHolds
ts_procurement_documentsone row per document revision: proc_doc_number, proc_doc_title, proc_doc_rev, proc_doc_originator, proc_doc_ref, ctr_number, loc_code, sub_loc_code, system_code, equipment_id, phase_code, file_no, proc_doc_submission_number, dates (proc_doc_appdate, proc_doc_due_date, proc_doc_issued_date, proc_doc_send_received), proc_doc_attachment
ts_procurement_doc_librarythe tree: library_code, library_desc, library_parent, contract_ref
ts_map_procurement_documents_librarywhich document sits in which folder, with stat_id
ts_map_procurement_doc_filethe files behind a revision
ts_file_referencethe shared file store

The screen

procurement_documents.php with procurement_documents_browse.htm: tree, grid, sub-grid of revisions (procurement_documents_subgrid.inc.php), group-by, header form. Toolbar: New, Edit, Delete, Copy, Upload, Send, Print, Export CSV / Excel, Download, Search, Sort, Ungroup. Commands: add, edit, routdetail, routing_this_doc, batchdownload, countAttachDoc, printgrid, getProjCodeByTreeId. Actions: add, edit, editdata, deletedata, upload, selectDoc, selectLibIdx, unpublish, sendemail and the email-composer helpers.

Privileges are read in procurement_documents_privilege.inc.php (on $pdo), separate from the DMS library privileges.

Printed reports

Eight report scripts hang off the Print button: document status, outstanding, outstanding-publish, revision status, sub-document progress, vendor document progress, vendor overdue, and CPECC procurement. All eight are on the legacy helper and dead where it throws.

What still runs on the legacy helper

Counted on 2026-09-06: 106 calls to iw_mysql_query() against 198 uses of $pdo.

PathState where the legacy helper throws
procurement_documents.php, _details.php, _header.inc.php, _subgrid.inc.php, _groupby.inc.php, _privilege.inc.php, _multiupload_upload.php, _createdocidx.php, _get_attach_doc.php, _send_attachment.inc.php, _send_docprjcontact.phpon $pdo, work
procurement_documents_handler_form.php (16 legacy, 53 PDO), _handler_post.php (39 legacy, 31 PDO), procurement_documents.inc.php (29 legacy, 24 PDO)mixed
file_explorer.php, the eight print reportsdead

Gotchas

  • Two libraries with the same look. A folder created here is not visible in the DMS library and the other way round. Check which cid the user was on before hunting a "missing" folder.
  • unpublish and the email path share the mixed handler. The action may reach a legacy query after the first PDO write, leaving a half-done state.
  • The class files file documents here on approval. If an approved PO has no row, the failure is in StoreDocumentsToProcumentDocs() of that module, not in this one.

Instance differences

Checked on 2026-09-06.

InstanceDifference
JOTREInstalled. Six files differ (.inc.php, main page, details, form, multi-upload, sub-grid). Legacy paths work there.
Jadestone, Medco, TimasNot installed in their QA databases. Four or five files differ, the same set as JOTRE minus .inc.php.