Skip to content

Goods Received Report (MRR)

Module: mrr, shown in the menu as Goods Received Report. The code and the tables call it MRR, the Material Receiving Report. It records what arrived against a Purchase Order: the shipment, the items, the quantities received and what was returned.

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: 14 files, about 320 database calls.

Where it sits

Purchase Order (po_id)  →  MRR  →  approval  →  Procurement Documents
                                  ↘  returned items (ts_mrr_item_return)

The PO is picked in the header form; its items are read from ts_purchase_order_item and copied into the MRR grid, where the received quantity, heat number and remarks are filled per item (updateQtyDelivered, addNewItemd).

The data

TableHolds
ts_mrrthe header: mrr_no, mrr_date, po_id, vendor_id, arrival_date, reception_date, person_in_charge, person_prepare_by, origin_country, mode_transport_id, packing_type_id, lc_number, shipping_mark, desc_goods, revision, status_mrr, and the approval pair submit_approval / status_approval
ts_mrr_itemone row per received item: po_item_id, mrr_item_qty, recv_qty, unit_id, item_code_id, storage_area, heat_number_item, manufature_item, the inspection flags is_visual_check, result_item, is_ncr, and parent_item_id for split items
ts_mrr_item_returnitems sent back: return_date, return_qty, mrr_receive_qty
ts_procurement_documentsthe approved MRR document, filed by mrr.class.php

The mrr_no_temp and po_id_temp columns hold the values while a row is unsaved; increment_mrr* feeds the number generator.

The screen

mrr.php with mrr_browse.htm: grid, header form, item grid, attachments, print preview (mrr_print_preview_3.php and mrr_print_process.php, both on $pdo) and a send-by-email dialog. mrr_handler_post.php carries the actions: addOrder, editOrder, deleteOrder, editMRR, edit_Header, updateQtyDelivered, addNewItemd, del_item, moveRow, saveattach, submitApproval, and a set of client, project and delivery-company helpers shared with the other procurement forms.

Approval

submitApproval posts a routing with 'rout_group_mod' => 'procurement'. On approval mrr.class.php implements the procurement interface: ProcessProcurement() sets the status, GenerateDocument() renders the MRR PDF, StoreDocumentsToProcumentDocs() files it under Procurement Documents and NotificationProcurement() mails the people on the routing. The same four-step interface the Requisition uses.

What still runs on the legacy helper

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

PathState where the legacy helper throws
mrr.php, mrr.class.php, mrr_print_preview_3.php, mrr_print_process.phpon $pdo, work
mrr_handler_form.php (80 legacy, 64 PDO) and mrr_handler_post.php (69 legacy, 69 PDO)mixed
mrr.inc.php (7 legacy, 2 PDO)mixed helpers
mrr_add_order_item.php, mrr_sendmail_form.php, mrr_sendmail_post.phpdead
mrr_print_preview(2).phpan old copy, not routed

Gotchas

  • The item grid is a copy of the PO items. Changing the PO after the MRR is created does not refresh the MRR rows. Re-select the PO.
  • recv_qty and mrr_item_qty are two columns. The first is what arrived, the second what the PO said. Reports that show a shortfall compare the two.
  • Returns are a separate table, so the received quantity on ts_mrr_item is not reduced by a return.

Instance differences

Checked on 2026-09-06.

InstanceDifference
JOTREInstalled. Six files differ from master and a Functions/Function_mrr.php helper was added. Legacy paths work there.
Jadestone, Medco, TimasNot installed in their QA databases. One file differs from master.