Requisition (SPB)
Module: spb, labelled Requisition in the menu. The first document of the procurement chain: a request to buy goods or services, with its items, that is approved through Document Routing and then feeds RFQs and Purchase Orders.
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. This is a map of the module, not a line-by-line trace: the module has 31 files and about 520 database calls.
Where it sits in the chain
Requisition (spb) → RFQ (rfq) → Purchase Order (purchase_order)
↓
Expediting (expedite) → Goods Received Report (mrr)Every step is a separate module with the same shape: a header row, an items table, an approval through routing, a generated PDF filed under Procurement Documents. The downstream documents point back: ts_rfq.spb_id and ts_purchase_order.spb_id. The requisition keeps a summary of what was raised from it in list_rfq_number, list_rfq_status, list_powosc_number and list_powosc_status.
Who has it
The procurement chain is installed by seed, but read on 2026-09-06 from the QA databases only the master sites (inact-mysql, inact-psql, inact-sqlsrv) and JOTRE have spb, rfq, purchase_order, procurement_documents, bid_evaluation, mrr, expedite and vendor_management switched on. Jadestone, Medco, Timas and KTP run the document-management modules only. See Instance differences.
The data
| Table | Holds |
|---|---|
ts_spb | the header: spb_no, spb_date, project_id, vendor_id, client_id, person_in_charge, person_prepare_by, deliver_to_id, delivery_address, request_item, terms (incoterms_id, payment_terms_id, packing_type_id, mode_transport_id, currency_code), the printed-form fields (no_form, rev_form, tanggal_form, subyek, lokasi_kerja, dibuat_oleh, diketahui_oleh, authorization_by), approval state, revision, the downstream lists, type_module, client_requisition_ref, department_org_function |
ts_spb_item | the requested items |
ts_spb_bid | vendor quotations captured against the requisition, used by the tabulation screens |
ts_spb_doc | attached documents |
ts_file_reference | the generated PDF and uploads |
The screen
spb.php with spb_browse.htm: a grid of requisitions per project, a header form (spb_main_form.htm), an items grid, attached documents, a search, the printed form preview (spb_preview.htm) and the send-by-email dialog. Toolbar: New, Edit, Delete, Cancel, Print, Export, Import from XLS, Help. The header form has a revision and a Submit for approval action.
Approval
Submitting posts the routing with 'rout_group_mod' => 'procurement' (spb_handler_post.php). That creates an ordinary Document Routing whose inbox rows carry routing_procure = 1, so the Sign Off flow applies with the procurement variant of the response form. The header tracks it in submit_approval (submitted), status_approval (result), fg_approval, approve_by and submit_approval_date.
When the routing finishes, RoutingProcurementUc in modules/routing/ calls the module's class spb.class.php, which implements RoutingProcurementInterface (contracts/routing_procurement.interfaces.php):
ProcessProcurement(): update the header state.GenerateDocument(): render the requisition PDF through the print process and the procurement print flavour (procure_print_template_code).StoreDocumentsToProcumentDocs(): register the PDF in Procurement Documents (ts_procurement_documents,ts_map_procurement_doc_file) under a folder created per requisition ints_procurement_doc_library.NotificationProcurement(): notify.
The same interface is implemented by the RFQ, bid, Purchase Order and Goods Received classes.
What still runs on the legacy helper
Counted on 2026-09-06 over live lines: 365 calls to iw_mysql_query() against 157 uses of $pdo. Per file:
| Path | State where the legacy helper throws |
|---|---|
spb.php, spb_handler_main_form.php, spb_print_process.php, spb_preview.php | on $pdo, work |
spb_handler_form.php (75 legacy, 44 PDO) and spb_handler_post.php (59 legacy, 84 PDO) | mixed; some form loads and actions die |
spb.inc.php (14 legacy, 0 PDO) | helpers die where reached |
bid tabulation (spb_handler_tabulation_*, spb_handler__tabulation_form.php) | dead |
send by email (spb_sendmail_*) | dead |
multi-file upload (spb_multiupload_upload.php) | dead |
spb_handler_form_041214.php (119 legacy) | a dated backup of the form handler, not routed |
On master this is consistent with the module being exercised on the QA sites only for the PDO paths. Anyone taking a requisition ticket should expect to move the touched path to $pdo first.
Gotchas
- The form has two names. Menu and grid say Requisition; the code, tables and printed form say SPB and use Indonesian field names (
subyek,lokasi_kerja,dibuat_oleh). _041214files are backups, not alternate handlers. Ignore them when tracing.- Numbering is per year and per type (
increment_spb,increment_spb_a,increment_spb_t,years), with a temporary number (proc_number_temp) until the document is saved. is_usedmarks a requisition consumed by a downstream document.
Instance differences
Checked on 2026-09-06.
| Instance | Difference |
|---|---|
| JOTRE | The only client instance with the chain switched on. Adds spb_ajax.php, spb_ajax_direct.php and spb_handler_ajax_form.php, and its spb_handler_post.php pushes approved requisitions to the Accurate accounting system (see the accurate_* crons on the JOTRE page). The legacy paths above work there. |
| Jadestone, Medco, Timas | Module code present but not installed in their QA databases. |
Related
- RFQ and Purchase Order: what a requisition turns into.
- Sign Off: the approval mechanics.
- Reporting: the Procurement Status Report reads this chain.