Job & Quotation Management

Business perspective: Job & Quotation Management

1. Business Summary

Jobs encode the actual work to be performed: language pair, job type, mode/modality, content type, subject matter, DTP/QC levels, units, amounts, dates, files, weighted-words, plus auto-plan and TMS sync flags.

2. Business Value

Translates customer demand into actionable production records that drive tasks, costs, vendor invoices, client invoices, and TMS workflows.

3. Users / Stakeholders

PMs, sales, account managers, finance, clients (indirectly via PO).

4. Workflows

A. Job creation (most common)
- Trigger: AutomationController::createJob() (or Common/Mobile entry).
- Steps in AutomationComponent::jobAutomation() (Component/AutomationComponent.php):
1. Optional auto-create PO (poAutomation) if poArray.create_po=1.
2. Optional create Contact (contactAutomation) if contactArray.create_contact=1.
3. Optional create Project (projectAutomation) if projctArray.create_project=1.
4. getJobSpecification() fills missing job specs from account's most-common patterns or default sort_order=1.
5. CommandController::createEntity(2, fieldsArray, mustSelect) inserts the Job.
6. Source files copied from upload area to /data/admin/files/Jobs/Job_{id}/Source (file count updated).
7. AutoPlanning triggered when jobOptions.autoPlaning=1.
8. TMS sync: if jobOptions.tms_sync=1 move source to TMS IN folder; if =2 Memsource path with sleep(120) to allow analysis.

B. Job lifecycle
- Status transitions via job_status_id.
- Source files counted; weighted-word analysis stored in JobWeightedWord.

C. Quotation reuse
- OpportunityJob → Job spec.
- Account-pattern-driven defaults.

5. Sub-Features

  • Cascading creation of PO/Project/Contact alongside Job.
  • File ingest into source folder structure.
  • TMS / Memsource handoff.
  • Auto-planning trigger.
  • Tags via JobsTag (HABTM).

6. Business Rules

  • Brand isolation: JobBrandId = currentUser.brand_id.
  • Source file count must match expected; updated post-upload.
  • TMS Memsource path adds 120-second delay before next steps.
  • Default specifications inferred from account history if not provided.

7. Data Entities

Job, JobsTag, Tag, JobWeightedWord, JobWeightedWordsDetail, Phase, Sub-Job, Activity, FollowUp, Note, Ticket.

8. Entry Points

  • automation/createJob, automation/createPo, automation/createProject.
  • projects/jobs (CRUD).
  • command/mail_submit (email-driven).
  • mobile_apis/* for job-related mobile actions.

9. Inputs & Outputs

  • Inputs: account/opportunity context, language pair, units/amounts, files, jobOptions.
  • Outputs: Job record, file structure, optional PO/Project/Contact, auto-planned tasks.

10. Integrations

  • TMS / Memsource (file ingest, analysis).
  • ownCloud (file storage).
  • Email (notifications).

11. Calculations / Logic

  • Risk factor reduces available time (getRiskFactor).
  • Weighted words from TM analysis.
  • Total price computed in EngineFunctions::getJobTotalPrice and getTotalPriceMainCurrency.
  • Tax computed via getJobTaxAmount (20+ params).
  • Gross profit via getJobGrossProfit.

12. Status Lifecycle

  • JobStatus (e.g., new → in production → delivered → closed/cancelled).

13. Permissions

  • Brand-scoped, PM/sales-creator-driven, security-engine row-level checks.

14. Reports & KPIs

  • Jobs by brand/account/type, weighted-word volumes, gross profit, on-time delivery.

15. Risks & Observations

  • 120-second hard sleep on Memsource flow blocks request thread.
  • File count validation only post-fact.
  • Many specs inferred silently — risk of mis-specification.
  • Hard-coded default folder paths (/data/admin/files/...).
  • Bulk auto-creation not transactional.

16. Source Code Evidence

  • app/Plugin/projects/Model/Job.php, JobsTag.php.
  • app/Plugin/projects/Controller/JobsController.php.
  • app/Controller/Component/AutomationComponent.php :: jobAutomation(), getJobSpecification(), poAutomation(), contactAutomation().
  • app/Controller/AutomationController.php.

← Deep dives index