This catalog details the standard console commands supported by the GOAL Backend runtime (php artisan ...).
For SAP master data identity (remote_id / DocEntry) and architecture, see SAP B1 master data sync.
Synchronizes business partners, price lists, items, and credit lines from SAP B1.
# Full partner synchronization for company 1
php artisan sap:sync-partners --companyId=1
# Synchronize product catalog and price lists
php artisan sap:sync-products --companyId=1 --update-prices
OITMSynchronizes items into products, persisting SAP DocEntry as remote_id for stable matching when ItemCode changes in the ERP.
# Full initial load: every row in SAP OITM (company 9)
php artisan goal:products:sync-from-sap --company=9
# Single ItemCode
php artisan goal:products:sync-from-sap --company=9 --code=7750106001201
# Chunked scan (SQL Server OFFSET/FETCH)
php artisan goal:products:sync-from-sap --company=9 --offset=0 --limit=500
| Option | Description |
|---|---|
--company |
Required. Operating company ID. |
--code |
Optional SAP ItemCode. When set, only this item is synced. |
--offset |
OITM row offset (default 0). |
--limit |
Max OITM rows to process (0 = all). |
Migration-queue import (legacy DW table) remains available via:
php artisan goal:sync products --company=9
php artisan goal:sync products --company=9 --force
OCRDSynchronizes partners into business_partners, persisting SAP DocEntry as remote_id for stable matching when CardCode changes in the ERP.
# Full initial load: every row in SAP OCRD (company 9)
php artisan goal:business-partners:sync-from-sap --company=9
# Single CardCode
php artisan goal:business-partners:sync-from-sap --company=9 --code=C00001
# Filter by CardType (e.g. customers or suppliers)
php artisan goal:business-partners:sync-from-sap --company=9 --card-type=C
# Chunked scan (SQL Server OFFSET/FETCH)
php artisan goal:business-partners:sync-from-sap --company=9 --offset=0 --limit=500
| Option | Description |
|---|---|
--company |
Required. Operating company ID. |
--code |
Optional SAP CardCode. When set, only this partner is synced. |
--card-type |
Optional OCRD CardType filter (C, S, L, …). |
--offset |
OCRD row offset (default 0). |
--limit |
Max OCRD rows to process (0 = all). |
Legacy migration-queue import (dw.dbo.partners_migration) uses ImportBusinessPartnerFromSapAction (same canonical sync). Customer-only bulk via goal:sync bps still runs ImporAllCustomerFromSAPAction (CardType = C).
Synchronizes customer visits, delivery windows, and item catalogs for the BEES B2B mobile portal.
# Sync BEES delivery windows and horizon schedules
php artisan bees:sync-windows --companyId=1
# Full master data sync
php artisan bees:sync-master --full
Queries and pulls proposal tickets from SUNAT SIRE.
# Sync SIRE tickets for a specific fiscal period
php artisan sire:sync-tickets --period=202610 --companyId=1
Processes standard asynchronous transactional emails, report exports, and event webhooks.
php artisan queue:work redis --queue=default,high,notifications --tries=3 --timeout=90
Dedicated consumer processing mobile GPS coordinate streams into TimescaleDB.
php artisan telemetry:consume-queue --batch-size=100
# Run pending migrations
php artisan migrate --force
# Seed master catalogs for development/test
php artisan db:seed --class=MasterCatalogsSeeder
# Clear application route, config, and view cache
php artisan cache:clear
php artisan config:clear
Registers Eloquent models as goal_modules and syncs permissions from each model’s OBJECT_CODE and OBJECT_ACTIONS.
# Full pipeline (models → modules/permissions → enum hashes)
composer sync-permissions
# Individual steps
php artisan goal:sync-models
php artisan goal:sync-models --write-uuids
php artisan goal:register-modules -f
# CI: fail on duplicate OBJECT_CODE across models
php artisan goal:register-modules -f --fail-on-duplicates
# Preview orphan MODEL modules (no writes)
php artisan goal:register-modules -f --prune-orphans --dry-run
# Remove MODEL modules with no matching scanned model (not part of sync-permissions)
php artisan goal:register-modules -f --prune-orphans
OBJECT_CODE on the class (not inherited from BaseModel / BaseSAPModel).OBJECT_ACTIONS: standard CRUD and/or custom actions; read-only views typically ['LIST'] only.goal:sync-models reports missing or duplicate codes before application_models upsert.See also: goal-backend/docs/security/MODEL_PERMISSIONS_SYSTEM.md, goal-front/docs/security/MODEL_PERMISSIONS.md.
Export/import Spanish (or other locale) display strings for modules and permissions. Does not change permissions.code or role grants.
# Export full catalog (default path under storage/app/translations/)
php artisan goal:permissions:export-translations --locale=es
# Import (merge translation_labels by code)
php artisan goal:permissions:import-translations storage/app/translations/goal-permissions-catalog.v1.json --locale=es
php artisan goal:permissions:import-translations {path} --dry-run
# Backfill empty labels after register (never overwrites imported text)
php artisan goal:register-modules -f --refresh-labels
REST: GET/POST /api/v1/backend/auth/permissions/translations/* — see Permissions Translation Catalog API.
Docs: goal-backend/docs/security/PERMISSION_CATALOG_TRANSLATIONS.md · Skill: goal-backend/.agents/skills/permission-catalog-translations/SKILL.md
Incremental sync of companies from goal-db to goal-data-db. Scheduled every 5 minutes when the scheduler app label is enabled.
php artisan goal:companies:sync-to-goal-database
php artisan goal:companies:sync-to-goal-database --company=8
php artisan goal:companies:sync-to-goal-database --force --dry-run --json
Full reference: goal:companies:sync-to-goal-database.
publish schema)Change-aware refresh for all materialized views in schema publish on goal-data-db (goal) and goal-db (goalCore). Scheduled every 5 minutes when the scheduler app label is enabled.
php artisan goal:refresh-materialized-views --target=all --dry-run --json
php artisan goal:refresh-materialized-views --target=goal --force
Full reference: goal:refresh-materialized-views.
Two separate SQL Server stacks and CouchDB catalogs:
| Stack | Connection | Artisan | CouchDB database |
|---|---|---|---|
| SAP ERP DDL (GOAL-owned) | DB_SB1_MASTER |
sb1:manage |
integrations-sb1-master-migrations |
| Receipts / CPE / GRE batches | DB_SB1_CPE |
receipt:manage |
integrations-sb1-receipt-migrations |
# ERP master (per company)
php artisan sb1:manage register-migrations
php artisan sb1:manage run-migrations --company=1
php artisan sb1:manage rollback-migrations --company=1 --step=1
# Receipt / CPE (per company)
php artisan receipt:manage register-migrations
php artisan receipt:manage run-migrations --company=1
php artisan receipt:manage rollback-migrations --company=1 --step=1
Both stacks record applied scripts in gproc.migrations on their respective company databases. ERP DDL migrations (sb1:manage) and runtime ERP business access share the same Company::getSB1Adapter() instance; receipt queries use Company::getReceiptAdapter(). Master migrations include bootstrap gproc.migrations and idempotent gproc.syncronization_profiles / gproc.syncronizations for incremental sync.
Materializes sellable product presentations (sales_team_group_product_measures) and KPI-backed assortment dimensions (products, brands, classifications, categories, suppliers) + customer enforcements for sales team groups:
# Sync sellable product presentations for a company, sales team, group, or product
php artisan sales-team:manage sync-product-measures -c 8 [-t 4] [--group=12] [--product=100] [--no-prune] [--json]
# Incrementally rebuild KPI-backed sales team group promotion assortments & customer enforcements
php artisan promotions:build-sales-team-assortment --company=8 [--sales-team=4] [--group=12] [--enforcements-only] [--force] [--dry-run]
# Generate calendarized portfolio & customer visits for the next 7 days (scheduled every Sunday 22:00 America/Lima)
php artisan sales:visits:generate-weekly --days=7 [--company=8] [--from=2026-11-30] [--to=2026-12-06] [--portfolio=42]
# Audit and reconcile product_unit_measures.for_sale (only CF=1 and products.sale_product_unit_measure_id)
php artisan goal:products:reconcile-sale-measures --company=8 [--product=100] [--dry-run] [--sync-channels]
See Sales Team Group Product Measures API and Sales Master API for REST triggers, geolocation fan-out, hierarchical customer configuration, and 2-level parent-to-child catalog inheritance details.