From 2a8e059e3b9ad2c38d06d3ccb7a3255c47ce488a Mon Sep 17 00:00:00 2001 From: "AzureAD\\SylvainDUVERNAY" Date: Sat, 30 May 2026 14:26:39 +0200 Subject: [PATCH] ITSA Workflow --- .../purchase_trade/process_documentation.py | 27 + .../purchase_trade/process_documentation.xml | 3 + .../ITSA/Operations_Workflow.html | 621 ++++++++++++++++++ .../process_documentation/README.md | 2 +- 4 files changed, 652 insertions(+), 1 deletion(-) create mode 100644 modules/purchase_trade/process_documentation/ITSA/Operations_Workflow.html diff --git a/modules/purchase_trade/process_documentation.py b/modules/purchase_trade/process_documentation.py index cb591fc..52a3180 100644 --- a/modules/purchase_trade/process_documentation.py +++ b/modules/purchase_trade/process_documentation.py @@ -10,6 +10,7 @@ from pathlib import Path from urllib.parse import unquote from trytond.model import ModelSingleton, ModelSQL, ModelView, fields +from trytond.transaction import Transaction DOCUMENTATION_ROOT = Path(__file__).with_name('process_documentation') @@ -31,6 +32,10 @@ class ProcessDocumentation(ModelSingleton, ModelSQL, ModelView): def _html_content(): + html_file = Transaction().context.get('process_documentation_html') + if html_file: + return _html_file_content(html_file) + document = HTML_TEMPLATE % { 'content': _documentation_content(), } @@ -39,6 +44,28 @@ def _html_content(): } +def _html_file_content(filename): + path = (DOCUMENTATION_ROOT / Path(*filename.split('/'))).resolve() + root = DOCUMENTATION_ROOT.resolve() + common_path = os.path.commonpath([str(root), str(path)]) + if path != root and common_path == str(root): + if path.exists() and path.is_file() and path.suffix.lower() == '.html': + return IFRAME_TEMPLATE % { + 'document': html.escape(path.read_text(encoding='utf-8'), + quote=True), + } + return _html_error('Documentation page not found: %s' % filename) + + +def _html_error(message): + document = HTML_TEMPLATE % { + 'content': '

%s

' % html.escape(message), + } + return IFRAME_TEMPLATE % { + 'document': html.escape(document, quote=True), + } + + def _documentation_content(): sections = [] index = DOCUMENTATION_ROOT / 'README.md' diff --git a/modules/purchase_trade/process_documentation.xml b/modules/purchase_trade/process_documentation.xml index c3b381b..e8714df 100644 --- a/modules/purchase_trade/process_documentation.xml +++ b/modules/purchase_trade/process_documentation.xml @@ -22,6 +22,9 @@ this repository contains the full copyright notices and license terms. --> ITSA Operations Workflow purchase_trade.process.documentation + diff --git a/modules/purchase_trade/process_documentation/ITSA/Operations_Workflow.html b/modules/purchase_trade/process_documentation/ITSA/Operations_Workflow.html new file mode 100644 index 0000000..9d0e739 --- /dev/null +++ b/modules/purchase_trade/process_documentation/ITSA/Operations_Workflow.html @@ -0,0 +1,621 @@ + + + + + +Purchase Flow – 30,000 MT / Quarter · Interacid + + + + + +
+
Operational Workflow · CTRM Process Mapping
+

Purchase Flow — 30,000 MT per Quarter
FOB Laizhou → CFR Mejillones (Interacid)

+
+ Contract: PC-001 · FA2025-Q3 + Supplier: CHIN1 + Customer: ITC Chile + Vessel: INTHIRA NAREE + BL Date: 20 Jul 2025 +
+
+ + +

Workflow Scenario Summary

+
+

This workflow describes the end-to-end operational flow for a physical aluminum trading transaction involving a purchase of 30,000 MT per quarter from a Chinese supplier (CHIN1), shipped FOB Laizhou and delivered CFR Mejillones, Chile, to the end customer ITC Chile. The transaction is structured around three sale lots: SC-001 (10,000 MT at fixed USD 165/mt), SC-002 (8,000 MT at fixed USD 162/mt), and SC-003 (~11,890 MT at a floating price indexed on weekly FOB China publications) — all discharging at the Interacid terminal in Mejillones.

+

The purchase price is determined by the average of four weekly FOB Laizhou publications immediately prior to the Bill of Lading date (Thursday publications). Payment on the purchase side is governed by a Letter of Credit (LC Sight), while sales are settled at BL + 30 days. The shipping leg is managed through broker Clarksons, with vessel INTHIRA NAREE operated by MOL Chemtankers, with an estimated BL date of 20 July 2025 and an ETA at destination of 30 August 2025.

+

The workflow covers the full lifecycle from contract entry and lot allocation in the CTRM system, through freight booking, voyage start, invoicing (provisional and final), supplier and freight payments, physical receipt at the terminal, and final settlement of the floating-price lot.

+
+ + +
+
Total Volume
30,000 MT ±10%
+
Purchase Price
87.50 USD/mt
+
Payment Terms
LC Sight
+
Incoterm (Buy)
FOB Laizhou
+
Incoterm (Sell)
CFR Mejillones
+
Sales Terms
BL + 30 days
+
ETA Destination
30 Aug 2025
+
+ + +
+ Phase 1 + Contract Setup +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
StepActorProcess Framework
+
Enter the Purchase Contract (PC-001)
+
Menu Purchases → validate → add line → freight fee → estimated BL date → price formula → [Confirm]
+
Back-office / CTRM +
7 · Trade & Commodity
+
Trade capture · Contract terms management
+
+
Enter the Sale Contracts (SC-001 / 002 / 003)
+
Client: ITC Chile · CFR Mejillones · NCSW · BL+30d · auto-allocation [VALIDATE]
+
Trading / Back-office +
7 · Trade & Commodity
+
Trade capture · Pricing & tolerance · Contract terms management
+
+
Enter budgeted costs on sale contracts
+
FRT 80.00 · BRK 0.50 · LC Fees 0.35 USD/mt · Template: FOB China – CFR Chile
+
Trading / Back-office +
7 · Trade & Commodity5 · R2R
+
Settlements & final P&L · Cost centre accounting
+
+
+ + +
+ Phase 2 + Lot Management & Freight +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StepActorProcess Framework
+
Lots Management — link to transport
+
Select open qty to ship → link to transport (MEJILLONES – no fees)
+
Operations / Back-office +
7 · Trade & Commodity
+
Logistics & shipping instruction management · Execution & allocation
+
+
Create sub-lots matching 3 sale contracts
+
L1: 10 kmt @ 165 (fixed) · L2: 8 kmt @ 162 (fixed) · L3: ~12 kmt floating {Price Formula} · ETA: 30 Aug
+
Operations / Back-office +
7 · Trade & Commodity
+
Execution & allocation · Position management
+
+
Complete Freight Booking
+
Ref: PC-1 CHIN1 Q3 · Supplier: Clarksons · Shipping period: 10–22 Jul · Est. BL: 20 Jul · 30,000 mt
+
Operations +
7 · Trade & Commodity2 · P2P
+
Logistics & shipping instruction management · Purchase order creation
+
+
Confirm booking (CLARKSONS / INTHIRA NAREE)
+
Ref: WXYZ123456 · Carrier: MOL Chemtankers · Enter ETA POL + ETD
+
Operations +
7 · Trade & Commodity2 · P2P
+
Logistics & shipping instruction management · Goods receipt & inspection
+
+
+ + +
+ Phase 3 + Shipment & Bill of Lading +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StepActorProcess Framework
+
Process Voyage Start (shipped)
+
BL Date: 20/07 · ETA: 30/08 · Lots: L1=10kt · L2=8kt · L3=11.89kt · Ordered costs: FRT 82.50 · COM 0.50 · LC 0.375 USD/mt → [START]
+
Operations / Back-office +
7 · Trade & Commodity4 · Inventory & WH
+
Logistics · Provisional invoicing · Goods receipt · Batch management
+
+
Enter final purchase invoice (P-INV001)
+
Final price: 87.50 USD/mt (avg. 4 weekly publications) · LC Sight · Move Effective: 20/07 → Service accruals generated
+
Back-office / Finance +
2 · P2P7 · Trade & Commodity
+
Invoice receipt & verification (3-way match) · Invoicing (final)
+
+
Generate sale invoices
+
L1: direct (fixed price) · L2: direct (fixed price) · L3: provisional (avg. 2 prior publications before BL)
+
Back-office +
1 · O2C7 · Trade & Commodity
+
Customer invoicing & billing · Invoicing (provisional & final)
+
+
Enter freight invoice received (FRT Invoice)
+
From shipment → create FRT Invoice · Due date: 01/09/2025 · Vessel: INTHIRA NAREE
+
Finance / Ops +
2 · P2P
+
Invoice receipt & verification · Accounts payable management
+
+
+ + +
+ Phase 4 + Payments +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
StepActorProcess Framework
+
Pay the purchase invoice (LC Sight)
+
Check open items · check fund availability · check party position · pay in full · Value Date: 26/07/2025
+
Finance / Treasury +
2 · P2P6 · Treasury
+
Payment run & disbursement · Letters of credit & bank guarantees
+
+
Collect client payment (L1, L2 final + L3 provisional)
+
Enter Payment from Client + bank charges
+
Finance +
1 · O2C
+
Cash application & payment matching · Collections management
+
+
Pay freight — Service Order (INTHIRA NAREE)
+
Detect FRT Invoice to pay → [Pay Service Order]
+
Finance +
2 · P2P6 · Treasury
+
Payment run & disbursement · Cash positioning & daily liquidity management
+
+
+ + +
+ Phase 5 + Physical Receipt +
+
+
+ + + + + + + + + + + + + + + +
StepActorProcess Framework
+
Receive goods — Interacid Terminal Mejillones
+
Enter actual receipt date + receipt reference → [Receive] → creates move to terminal at Eff. Date = receipt date (HC001)
+
Operations +
4 · Inventory & WH7 · Trade & Commodity
+
Goods receipt processing · Sampling & quality management
+
+
+ + +
+ Phase 6 + Finalisation & Settlement +
+
+
+ + + + + + + + + + + + + + + + + + + + +
StepActorProcess Framework
+
Finalise provisional invoice SC-003
+
Detect full fixation status · all July fixations known → Make Final Sale Invoice (Lot 3) · final price calculated
+
Back-office +
7 · Trade & Commodity1 · O2C
+
Invoicing (final) · Settlements & final P&L · Revenue recognition
+
+
Collect balance payment — Lot 3 finalisation
+
Customer Invoices or Age Balance → Enter payment from Client · balance of Lot 3
+
Finance +
1 · O2C
+
Cash application & payment matching · Customer dispute & deduction management
+
+
+ + + + + + diff --git a/modules/purchase_trade/process_documentation/README.md b/modules/purchase_trade/process_documentation/README.md index 0b7d1f3..7603205 100644 --- a/modules/purchase_trade/process_documentation/README.md +++ b/modules/purchase_trade/process_documentation/README.md @@ -1,6 +1,6 @@ # Tradon Process Documentation -This folder contains the process documentation used by the Tryton Help & Processes menu. +This folder contains the Trad'On process documentation. The structure below is organised by end-to-end business process, with one Markdown file per subprocess. ## Index