Production Reference Public

Compliance Documents

Advanced Manufacturing Compliance Documents A register for your factory's Philippine regulatory permits, licenses, and certificates — record each document's number, issuing…

Guide version: r1 Module version: 1.0.0 Updated: 2026-07-22 Estimated time: 17 min 1 views
Advanced Manufacturing

Compliance Documents

A register for your factory's Philippine regulatory permits, licenses, and certificates — record each document's number, issuing agency, and expiry, then get warned before anything lapses so you can renew on time.

ℹ️
Where this lives. Compliance Documents is part of the Advanced Manufacturing sub-area (production/ComplianceDocs). It is gated by the manufacturing_compliance permission and requires the manufacturing module to be enabled. See Getting Started to switch the module on and Permissions & Roles for the access matrix.
This tool tracks evidence — it does not certify you. Registering a permit here helps you stay audit-ready and renew on time, but it does not by itself grant ISO/GMP certification, FDA product approval, DTI product registration, or any regulatory sign-off. Those are decisions of the regulator or accredited body and require your own SOPs, qualified staff, and validated processes.

What the register is for

Every manufacturer holds a stack of government permits and certificates — a DTI business-name registration, a BIR permit, DOLE compliance certificates, an FDA license for regulated products, a DENR environmental permit, ISO or GMP certificates, and more. Each one has a number, an issuing agency, an issue date, and — usually — an expiry date. When one lapses unnoticed, production can be halted or fined. The Compliance Documents register is where you keep all of them in one place and let ERPat colour-code and count the ones that are about to expire.

7
Document types
4
Status labels
30
Default expiring window (days)
90
Longest colour horizon (days)
????
Think of this as a renewal watch-list, not a filing cabinet. The File Path field is just a text reference to where a scan lives — it is not a file-upload control, so the register points at your documents rather than storing them.

Philippine regulatory context

The seven document types map onto the agencies a Philippine SME manufacturer typically answers to. The register is deliberately agency-agnostic — you can record any permit under Other — but the built-in types cover the common cases:

AgencyWhat it regulatesTypical document type here
DTI — Dept. of Trade and IndustryBusiness-name registration.DTI Registration
BIR — Bureau of Internal RevenueTax registration / permits (the tax authority).BIR Permit
DOLE — Dept. of Labor and EmploymentLabour standards & occupational safety-and-health compliance certificates.DOLE Certificate
FDA — Food and Drug AdministrationLicenses for regulated food, drug, and cosmetic products (e.g. LTO / CPR).FDA License
DENR — Dept. of Environment and Natural ResourcesEnvironmental permits (e.g. ECC, pollution permits).DENR Permit
ISO / certifying bodiesInternational management-system certification (quality, environment, etc.).ISO Certificate
Any other bodyAnything not covered above (local LGU permits, industry bodies…).Other
ℹ️
The broader Production module positions itself as compliance evidence gathering for these same regulators. This register is the concrete, shipped part of that story — a simple, reliable expiry watch-list. Grander compliance features (per-agency scorecards, automated e-mail alerts, BIR form generation) are described in the specs but are not wired up here.

The screens

The feature is four connected pages, all reached from the main list:

Compliance Documents list

production/ComplianceDocs — the landing page. A DataTable of every document with Type and Status filters, a New Document button, and an Expiring Soon shortcut.

New / Edit modal

production/ComplianceDocs/modal_form — the popup form used for both creating and editing. Posts to …/save.

Expiring Compliance Documents

production/ComplianceDocs/expiring — a focused report of active documents due within a window (default 30 days, override with ?days=N).

Document detail / view

production/ComplianceDocs/view/{id} — read-only detail plus an audit trail. Reached only by clicking a document number on the Expiring page.

List columns & filters

The main list is an appTable DataTable (#compliance-table) with these columns:

ColumnShowsNotes
Document #The permit/license number.Colour-coded by expiry (see Expiry tracking). Shows - if empty.
TypeThe document type label.One of the seven types.
Issuing AgencyThe body that issued it.Free text as entered.
Issue DateWhen it was issued.
Expiry DateWhen it lapses.Shows No expiry / N/A when blank; drives all warnings.
StatusThe manual lifecycle label.Colour badge — see the status legend.
ResponsibleThe accountable person's name.Shows - when unset (there is no field to set it in the form — see the gotcha below).
ActionsPer-row gear (cogs) menu.Contains Edit and Delete.

Two dropdown filters sit above the table:

FilterOptionsEffect
Type (w150)– Type –, DTI Registration, BIR Permit, DOLE Certificate, FDA License, DENR Permit, ISO Certificate, OtherRe-queries the list, narrowing by document type.
Status (w150)– Status –, Active, Expired, Pending Renewal, SuspendedRe-queries the list, narrowing by status. Rows are sorted by expiry date, soonest first.

The form fields

The New / Edit modal is the same form for both create and edit; on edit it opens pre-filled via the row's data-post-id. Every field it exposes is listed below, followed by the fields the record carries that the form does not let you set.

Fields you fill in

FieldMeaningRequiredNotes
document_type — Type Kind of regulatory document: DTI Registration, BIR Permit, DOLE Certificate, FDA License, DENR Permit, ISO Certificate, or Other. Required Select2 dropdown. Defaults to DTI Registration on a new form.
document_number — Document # The permit/license/certificate number exactly as printed on the document. Required Free text, max 100 chars. Enforced client-side (data-rule-required) and server-side.
issuing_agency — Issuing Agency The government body or certifier that issued it (e.g. DTI, BIR, FDA). Required Free text, max 200 chars. Client + server required.
issue_date — Issue Date Date the document was issued. Required HTML date picker (YYYY-MM-DD).
expiry_date — Expiry Date Date the document lapses. Drives every expiry warning and the Expiring Soon report. Optional Date picker. If blank, the record shows No expiry / N/A, is saved as null, and never appears in Expiring Soon.
alert_days_before_expiry — Alert Days Before Expiry Your intended renewal lead time — how many days before expiry the document should be flagged. Optional Number input, defaults to 30. Stored and shown on the detail Audit Trail only — see the warning under Expiry tracking.
status — Status Current lifecycle label: Active, Pending Renewal, Expired, or Suspended. Optional Select2 dropdown, defaults to Active. Set by you; never changed automatically.
file_path — File Path A path or reference to the stored scan of the document. Optional Free text, max 500 chars. Not an upload control — type or paste a reference. Shown on the detail view only if set.
notes — Notes Free-form remarks about the document. Optional Textarea (2 rows). Rendered with line breaks on the detail view.
⚠️
File Path is text, not an upload. There is no browse/attach widget. To keep the register useful, store your scans in a consistent, shared location and paste the same path pattern into every record.

Fields on the record you can't set from the form

A few columns exist on the record but have no input in the modal. The controller would save them if they were posted, but because the form never posts them they stay null unless populated by other means. The rest are set automatically by the system.

FieldMeaningRequiredNotes
responsible_person — Responsible Person The user accountable for maintaining/renewing this document; joined to users to show a name. Optional Displayed in the Responsible column, on the Expiring page, and on the detail view — but no input exists in the modal, so it shows - / N/A in practice.
product_id — (Product) Optional link to a specific product this document applies to; null means it applies to the whole facility. Optional Filterable in the model, but no input exists in the modal, so it stays null.
days_until_expiry — Days Until Expiry Computed count of days from today to the expiry date (negative once expired). Computed Read-only; shown on the detail view's Audit Trail.
uuid — (system) Unique identifier auto-generated on create. System Set once via UUID v4; not editable.
created_by — Created By The user who created the record. System Set to the logged-in user on create; shown as a name on the Audit Trail.
created_at — Created At When the record was created (UTC). System Set on create; shown on the Audit Trail.
updated_at — (system) Timestamp of the last update (UTC). System Set on every save.
ℹ️
Responsible Person and Product are set elsewhere, if at all. The columns and labels exist throughout the UI, but the modal offers no way to fill them. Do not expect the Responsible column to populate just by editing a document.

Document status — pipeline & legend

Every document carries a Status label that you set by hand. There are no automatic transitions — the system never flips a document from Active to Expired for you. All four statuses can move to any other status by editing the record; the lifecycle below shows the typical renewal flow.

Active
valid & in force (default)
Pending Renewal
renewal in progress
Active
renewed & valid again
Expired / Suspended
no longer valid
ActiveDocument is currently valid/in force. The default on creation, and the only status eligible for the Expiring Soon report.
Pending RenewalRenewal is underway with the agency. Set this while you wait, then move it back to Active once renewed.
ExpiredManually marked as no longer valid. Independent of the automatic date-based "EXPIRED" colour warning.
SuspendedSuspended (e.g. by the issuing agency).
⚠️
Status is a manual label, separate from the expiry colour. A document whose expiry date has passed still reads Status = Active until someone edits it — only the date-based colour/badge changes on its own. And because Expiring Soon lists only Active documents, moving one to Pending Renewal, Expired, or Suspended removes it from that report even if its date is imminent.

Expiry tracking — the colour thresholds

Separately from the manual status, ERPat colours each document by how close its expiry date is. These colours are computed from the date itself, on a set of fixed thresholds, and update automatically. They appear on the list, the detail view, and the Expiring page.

> 90 days
plenty of time (no highlight)
31–90 days
on the horizon (blue)
≤ 30 days
action needed (amber)
Past due
expired (red)
Within 90 daysList: between 30 and 90 days remain — shown as informational blue text with (N days).
Within 30 daysList: fewer than 30 days remain — bold amber text with (N days).
ExpiredList/detail: the expiry date is in the past — bold red text with (EXPIRED), regardless of the status field.

On the detail view, the expiry date carries its own badge:

Expires in N days30 or fewer days remain (detail page).
ExpiredThe expiry date is in the past (detail page).
"Alert Days Before Expiry" does not drive the colours. The field is stored per document and shown on the Audit Trail, but the visible warning colours use the fixed 30/90-day thresholds (list & detail) and the Expiring page's ?days parameter. There is no e-mail or cron notification wired to this field — treat the register as something you check, not something that pings you.

The "Expiring Soon" view

The dedicated Expiring Compliance Documents page (production/ComplianceDocs/expiring) is the working screen for renewals. It lists active documents whose expiry falls within a window — 30 days by default, overridable by adding ?days=N to the URL (e.g. ?days=90 for a quarter-ahead view). Rows are sorted soonest-first and highlighted by urgency.

ColumnShowsNotes
Document #The number.A link — the only in-UI link to the detail view.
TypeThe document type.
Expiry DateWhen it lapses.
Days LeftA coloured badge counting down.See the badge legend below.
Issuing AgencyThe issuing body.
ResponsibleAccountable person.Shows - when unset.
StatusThe status label.Always Active here (only Active documents appear).
ActionsAn edit icon.Opens the same edit modal as the list.

The page opens with a banner and highlights rows:

No documents expiringGreen success banner: "No documents expiring within the next 30 days." Nothing to do.
N document(s) expiringYellow warning banner with the count: "N document(s) expiring within 30 days."
Row highlight — dangerRed row: the document is expired (0 or fewer days left).
Row highlight — warningYellow row: 7 or fewer days left.

The Days Left badge itself is colour-coded:

Expired N days agoThe document is already past due.
≤ 7 daysSeven or fewer days remain — top priority.
Within windowMore than 7 days but inside the chosen window.
⚠️
The banner wording is hard-coded to "30 days." If you pass ?days=90, the page filters correctly on 90 days, but the empty/summary banner text still says "…within the next 30 days." — trust the rows, not the sentence.

SOP — Register a permit and monitor its expiry

????
Goal: onboard a regulatory document into the register and keep it renewed on time. Who: Compliance Officer / Manufacturing Supervisor. Precondition: you have manufacturing_compliance access and the physical or scanned document in hand.

Step 1 — Onboard the document

  1. Open the register

    Go to Manufacturing → Compliance Documents (production/ComplianceDocs).

  2. Start a new record

    Click New Document. The blank create modal opens. Nothing is saved until you click Save.

  3. Choose the type and enter the identity

    Set Type (e.g. FDA License), then enter the exact Document # and the Issuing Agency (e.g. FDA). All three are required.

  4. Enter the dates

    Pick the Issue Date (required). Enter the Expiry Date whenever the document expires — without it, the document can never be tracked or appear in Expiring Soon.

  5. Set your renewal lead time and status

    Adjust Alert Days Before Expiry to your renewal lead time (default 30). Leave Status = Active for a valid document.

  6. Add references (optional)

    Record the File Path of the stored scan and any Notes.

  7. Save and verify

    Click Save and confirm the record appears in the list.

ℹ️
On save, ERPat validates document_type, document_number, issuing_agency, and issue_date as required. On a new record it also generates the uuid and sets created_by / created_at; every save updates updated_at. A blank Expiry Date is saved as null. Success shows "Record saved successfully"; a failure shows "An error occurred".

Step 2 — Monitor and renew (weekly)

  1. Open the watch-list

    From the list, click Expiring Soon (or open production/ComplianceDocs/expiring). For a longer horizon add ?days=90 to the URL.

  2. Triage by colour

    If the green "No documents expiring" banner shows, you are done. Otherwise work the red rows first (expired or ≤ 7 days left), then the yellow rows.

  3. Open the document

    Click the Document # link to open its read-only detail view, or click the edit icon in the Actions column.

  4. Start the renewal

    Begin the renewal with the issuing agency. Edit the document and set Status = Pending Renewal while it is in progress, then Save.

  5. Close the loop

    Once renewed, edit again: update the Issue Date and Expiry Date and set Status back to Active. For a permanently lapsed document, set Status = Expired (or Suspended if the agency suspended it).

⚠️
While a document sits at Pending Renewal it disappears from Expiring Soon (that report is Active-only). Keep a note of in-flight renewals separately, and move the document back to Active the moment the new certificate is in hand.

Auditing a document's history

  1. Reach the detail view

    Open the Expiring Soon page and click the document number (the only in-UI link to the detail view), or navigate directly to production/ComplianceDocs/view/{id}.

  2. Read the two panels

    The Document Details panel shows the number, type, responsible person, agency, dates, the expiry badge, status, file path, and notes. The Audit Trail panel shows Created By, Created At, Alert Days Before Expiry, and Days Until Expiry.

  3. Correct if needed

    Click Edit to open the modal and fix any details.

Opening view/{id} with a missing or unknown id returns a 404 (Not Found) — the detail view exists only for records that are present and not deleted.

Actions & confirmations

What each button does, and when you are asked to confirm:

ActionEffectConfirm?
New DocumentOpens the blank create modal. No data change until Save.None
SavePosts the form, validates the required fields, persists the record, and inserts/updates the row in the list.None
Edit (row gear)Opens the modal pre-filled with the selected document; saving overwrites it.None
Delete (row gear)Soft-deletes the document (sets deleted = 1). It vanishes from every list and from the Expiring report.Yes — standard delete-confirmation dialog.
Expiring SoonNavigates to the Expiring report (read-only).None
Document # link (Expiring page)Opens the read-only detail view; 404 if not found.None
Back / All DocumentsReturns to the main list. No data change.None
Close (modal)Dismisses the modal without saving.None
Type / Status filtersRe-query the list to narrow it. View-only.None
⚠️
Delete asks first. Choosing Delete raises the standard confirmation dialog. On success it flashes "Record deleted"; if it cannot be removed it shows "Record cannot be deleted". This is a soft delete — the row is hidden everywhere in the UI but remains recoverable in the database.

Validation & messages

The messages you may see, and what triggers them:

WhenMessage
Saving with a missing required field (Type, Document #, Issuing Agency, or Issue Date)The field is rejected server-side; Document # and Issuing Agency also flag client-side.
Save succeeds"Record saved successfully."
Save fails"An error occurred."
Delete succeeds"Record deleted."
Delete fails"Record cannot be deleted."
Expiring page — nothing due"No documents expiring within the next 30 days."
Expiring page — items due"N document(s) expiring within 30 days."
Opening view/{id} with a bad/unknown idReturns a 404 page.

Permissions

The whole controller is gated by a single permission. Finer-grained keys exist in configuration but are not separately enforced.

PermissionGatesEnforced?
manufacturing_complianceThe entire ComplianceDocs controller — list, create, edit, delete, expiring, and view. Also requires the manufacturing module to be enabled.Yes — in the constructor.
manufacturing_compliance_createLabelled "Create Compliance Document".Defined, not checked — creation is gated only by manufacturing_compliance.
manufacturing_compliance_updateLabelled "Update Compliance Document".Defined, not checked
manufacturing_compliance_deleteLabelled "Delete Compliance Document".Defined, not checked
ℹ️
In practice, anyone with manufacturing_compliance can create, edit, and delete documents. If you need to restrict who can change the register, restrict who holds that single permission. See Permissions & Roles.

How it connects

Compliance Documents is deliberately standalone within the module:

AreaRelationship
InventoryNone. This feature does not read or write items, variants, or stock. The product_id column can tag a document to a product but is not populated from the UI.
UsersRead-only join to resolve names for Created By and Responsible Person.
Manufacturing moduleCo-created with the other manufacturing tables and surfaced in the Manufacturing left menu. Independent of BOMs, Work Orders, and Manufacturing Orders.

Watch-outs

A document past its expiry date still reads Status = Active until someone edits it. Only the date-based colour/badge changes automatically. Marking a document "Expired" is always a manual choice.
The report lists only documents where status = active and an expiry date is set and the days-to-expiry is within the window. Anything at Pending Renewal, Expired, or Suspended — or with no expiry date — is invisible there, even if its date is imminent.
It is stored and shown on the Audit Trail, but it does not drive the visible colours (those use fixed 30/90-day thresholds and the Expiring page's ?days), and no e-mail or cron notification is wired to it.
The row gear offers only Edit and Delete. The only in-UI link to the detail page is the Document # link on the Expiring Soon page; otherwise navigate to production/ComplianceDocs/view/{id} directly.
There is no input for either in the modal, so both stay null (showing - / N/A) even though the columns and labels appear across the UI.
Passing ?days=90 filters on 90 days, but the empty/summary banner wording is hard-coded to 30. Read the rows, not the sentence.
Deleting sets deleted = 1; the record is hidden everywhere in the UI but remains in the database.
Expiry maths uses whole-day rounding, so a document with a fraction of a day left may show a slightly rounded "N days" figure, and the number can differ marginally across the list, detail, and Expiring pages.

See also

Was this guide helpful?

Report a content problem