From 05dfe5aa17bed397fdae0b7d69772b3267202d2d Mon Sep 17 00:00:00 2001 From: louispaulb Date: Sat, 6 Jun 2026 09:34:18 -0400 Subject: [PATCH] =?UTF-8?q?feat:=20champ=20Dispatch=20Job.legacy=5Fticket?= =?UTF-8?q?=5Fid=20(idempotence=20du=20pont=20legacy=E2=86=92dispatch)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renseigné par services/targo-hub/lib/legacy-dispatch-sync.js (repo gigafibre-fsm) : 1 ticket osTicket legacy = 1 Dispatch Job. read_only + search_index. Co-Authored-By: Claude Opus 4.8 (1M context) --- frappe-setup/setup_dispatch_custom_fields.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frappe-setup/setup_dispatch_custom_fields.py b/frappe-setup/setup_dispatch_custom_fields.py index 9eb4299..32c8f2e 100644 --- a/frappe-setup/setup_dispatch_custom_fields.py +++ b/frappe-setup/setup_dispatch_custom_fields.py @@ -24,6 +24,10 @@ FIELDS = [ {"description": "1.0 = normal · 1.10 = +10% (plus lent) · 0.90 = -10% (plus rapide)"}), ("Dispatch Technician", "skills", "Compétences", "Data", None, None, "tech_group", {"description": "Séparées par des virgules, ex: fibre,cuivre,aerien"}), + ("Dispatch Technician", "skill_levels", "Niveaux de compétence (JSON)", "Small Text", None, None, "skills", + {"description": "Maîtrise 1-5 par compétence (JSON, ex: {\"installation\":4}). Distinct de l'efficacité (=vitesse). Édité dans la grille Planification."}), + ("Dispatch Technician", "skill_eff", "Efficacité par compétence (JSON)", "Small Text", None, None, "skill_levels", + {"description": "Facteur de vitesse PAR compétence (JSON, ex: {\"installation\":0.9}). Défaut = efficacité globale. Édité dans la grille Planification."}), ("Dispatch Technician", "cost_salary_h", "Salaire horaire ($/h)", "Float", None, "0", "efficiency", {}), ("Dispatch Technician", "cost_charges_pct", "Charges sociales (%)", "Float", None, "0", "cost_salary_h", {}), ("Dispatch Technician", "cost_other_h", "Autres coûts/h ($ véhicule, outils, frais)", "Float", None, "0", "cost_charges_pct", {}), @@ -38,6 +42,10 @@ FIELDS = [ ("Dispatch Job", "booking_status", "Statut RDV", "Select", "À planifier\nProposé\nConfirmé\nAnnulé\nÀ reporter", "À planifier", "booking_prefs", {}), ("Dispatch Job", "booking_token", "Jeton RDV client", "Data", None, None, "booking_status", {"read_only": 1, "no_copy": 1}), + # ── Dispatch Job : pont de synchro avec la DB legacy (osTicket) ── + ("Dispatch Job", "legacy_ticket_id", "ID ticket legacy (pont)", "Data", None, None, "ticket_id", + {"read_only": 1, "no_copy": 1, "search_index": 1, + "description": "ID du ticket osTicket legacy (table `ticket`). Renseigné par le pont legacy→dispatch (lib/legacy-dispatch-sync.js) → idempotence : 1 ticket legacy = 1 Dispatch Job."}), # ── Service Contract : installation financée (conformité CRTC 2026-43, pas de clawback) ── ("Service Contract", "monthly_regular", "Forfait — prix original (barré)", "Currency", None, None, "monthly_rate", {"description": "Prix mensuel de référence barré (marketing). Le montant facturé reste monthly_rate. Vide/≤ = aucun barré."}),