PicERP Module

Integration Filament Jobs

The PicERP module integrates Tempr with PIC ERP. It handles configurator proxy routes, datasource imports, prompt answer validation, purchase order transmission, and quote-related sync jobs.

Location

src/Modules/PicERP

Main Responsibilities

  • Proxy selected PIC ERP API requests through Tempr.
  • Serve PIC configurator JavaScript from local storage.
  • Import and validate datasource files.
  • Sync customers, quotes, and purchase orders.
  • Broadcast PIC ERP sync events.
  • Provide Filament resources for PIC sync administration.

Runtime Registration

PicERPServiceProvider registers:

  • Config under the pic key.
  • Module migrations.
  • Module views under the pic-erp namespace.
  • Web and API routes.
  • The PIC sync Filament panel provider.

Web Routes

The module registers routes under:

modules/pic

Important routes include:

GET modules/pic/picce.js
ANY modules/pic/proxy/Customer
ANY modules/pic/proxy/Customer/{customerId}
ANY modules/pic/proxy/ProductGroup
ANY modules/pic/proxy/Product/{productId}/Model
ANY modules/pic/proxy/Configurator/Datasource/{productId}/{modelId?}
ANY modules/pic/proxy/PromptAnswers/Customer
ANY modules/pic/proxy/PromptAnswers/Order
POST modules/pic/proxy/Validate

Important Config

The main config file is:

src/Modules/PicERP/config/pic.php

Important environment variables include:

PICERP_ENABLED=true
PICERP_BASE_URL=https://demo.picbusiness.com
PICERP_CLIENT_ID=
PICERP_CLIENT_SECRET=
PICERP_GRANT_TYPE=client_credentials

The config also defines datasource storage paths, event channel names, and job timeouts.

Key Classes

AreaClasses
ControllersProxyController, DatasourceController, PicDataBroker
JobsGetDatasourceFromServer, HandleHook, RunDsChecksum, ValidateMeasurement
Sync JobsSyncCustomer, TransmitPO, CreateQuoteFromPO, AddItemToQuote, AddAllItemsToQuote
EventsPullComplete, PullFailed, OrderSubmissionSucceeded, OrderSubmissionFailed
FilamentPicSyncManagerPanelProvider and resources for customers, products, projects, purchase orders, and datasource files

Operational Notes

If the configurator cannot load, first verify PICERP_ENABLED, PICERP_BASE_URL, and the modules/pic/picce.js route.

If datasource imports fail, start with the datasource jobs and the datasource disk/path settings in config/pic.php.