diff --git a/modules/purchase_trade/docs/business-rules.md b/modules/purchase_trade/docs/business-rules.md index 9c33897..21a3bdc 100644 --- a/modules/purchase_trade/docs/business-rules.md +++ b/modules/purchase_trade/docs/business-rules.md @@ -886,3 +886,27 @@ Pour cette regle, couvrir au minimum: meme quand le filtre `Side` vaut `All`. - Les lots physiques ne doivent pas etre masques par ce flag; ils restent visibles pour conserver l'historique execute. + +### Session 2026-05-17 - Tolerances, jauges et Go to matching + +- `Apply matching` est remplace cote utilisateur par `Go to matching`; l'action + legacy est conservee mais masquee. +- `Go to matching` precharge les lignes `lot.qt` ouvertes selectionnees depuis + `Lots Management`. +- Le matching ouvert peut depasser le solde ouvert strict si la quantite + projetee reste dans la tolerance de la ligne (`Qt max`). +- Les lignes de matching affichent `Qt min`, `Qt max` et une jauge + `Tolerance used`. +- Dans `Go to matching`, la jauge est dynamique: elle projette + `deja matche + Qt to match` contre `quantity_theorical`, avec bornes + `-tol_min` / `tol_max`. +- Les jauges de `purchase.line` et `sale.line` utilisent: + - la somme des lots physiques s'il en existe sur la ligne; + - sinon la somme des `lot.qt` rattaches a la ligne. +- Les jauges header `purchase.purchase` / `sale.sale` representent la moyenne + ponderee des jauges de lignes, au prorata de `quantity_theorical`. +- Cote `sale`, les quantites `lot.qt` sont lues en valeur absolue pour les + jauges de tolerance. +- Le widget SAO `tolerance_gauge` est autorise dans les schemas de vues + `form` et `tree` avec `min`, `max`, `min_field`, `max_field`, `center` et + `digits`. diff --git a/modules/purchase_trade/docs/business/lots-and-quantities.en.md b/modules/purchase_trade/docs/business/lots-and-quantities.en.md index 8d487a7..b0b0b65 100644 --- a/modules/purchase_trade/docs/business/lots-and-quantities.en.md +++ b/modules/purchase_trade/docs/business/lots-and-quantities.en.md @@ -323,6 +323,22 @@ them with Python guards and SQL diagnostics. Under-execution Mechanically restores tolerance available to other lines on the next recalculation. + +Open matching +Go to matching may match above the strict open balance if the projected quantity remains within Qt max. + + +Line gauge +On a line with physical lots, the gauge uses the sum of physical lots; without physical lots, it uses the sum of linked lot.qt. + + +Header gauge +The purchase/sale gauge is the weighted average of line gauges, weighted by quantity_theorical. + + +Matching gauge +In Go to matching, the gauge projects already matched + Qt to match against quantity_theorical, with -tol_min / tol_max bounds. + @@ -367,7 +383,7 @@ them with Python guards and SQL diagnostics.
  • Packing: lot.lot.lot_qt, lot.lot.lot_unit
  • -
  • Tolerances: tol_min, tol_max, tol_min_qt, tol_max_qt, tol_min_v, tol_max_v +
  • Tolerances: tol_min, tol_max, tol_min_qt, tol_max_qt, tol_min_v, tol_max_v, tolerance_used, tolerance_min, tolerance_max
  • diff --git a/modules/purchase_trade/docs/business/lots-and-quantities.md b/modules/purchase_trade/docs/business/lots-and-quantities.md index 124cfbd..54d5766 100644 --- a/modules/purchase_trade/docs/business/lots-and-quantities.md +++ b/modules/purchase_trade/docs/business/lots-and-quantities.md @@ -322,6 +322,22 @@ puis les sécuriser par des checks Python et des diagnostics SQL. Sous-consommation Restitue mécaniquement de la tolérance disponible aux autres lignes lors du recalcul suivant. + +Matching ouvert +Go to matching peut matcher au-delà du solde ouvert strict si la quantité projetée reste dans Qt max. + + +Jauge ligne +Sur une ligne avec lots physiques, la jauge utilise la somme des physiques ; sans physique, elle utilise la somme des lot.qt liés. + + +Jauge header +La jauge purchase/sale est la moyenne pondérée des jauges de lignes au prorata de quantity_theorical. + + +Jauge matching +Dans Go to matching, la jauge projette déjà matché + Qt to match contre quantity_theorical, avec bornes -tol_min / tol_max. + @@ -366,7 +382,7 @@ puis les sécuriser par des checks Python et des diagnostics SQL.
  • Packing : lot.lot.lot_qt, lot.lot.lot_unit
  • -
  • Tolerances : tol_min, tol_max, tol_min_qt, tol_max_qt, tol_min_v, tol_max_v +
  • Tolerances : tol_min, tol_max, tol_min_qt, tol_max_qt, tol_min_v, tol_max_v, tolerance_used, tolerance_min, tolerance_max
  • diff --git a/modules/purchase_trade/docs_source/business/lots-and-quantities.en.md b/modules/purchase_trade/docs_source/business/lots-and-quantities.en.md index 6edcc2b..3d864b6 100644 --- a/modules/purchase_trade/docs_source/business/lots-and-quantities.en.md +++ b/modules/purchase_trade/docs_source/business/lots-and-quantities.en.md @@ -123,6 +123,10 @@ quantity_theorical | Over-execution | A line exceeding the header tolerance keeps a `+` tolerance at least equal to its actual excess. | | Other lines | Their `+` tolerance is reduced according to the remaining envelope. | | Under-execution | Mechanically restores tolerance available to other lines on the next recalculation. | +| Open matching | `Go to matching` may match above the strict open balance if the projected quantity remains within `Qt max`. | +| Line gauge | On a line with physical lots, the gauge uses the sum of physical lots; without physical lots, it uses the sum of linked `lot.qt`. | +| Header gauge | The purchase/sale gauge is the weighted average of line gauges, weighted by `quantity_theorical`. | +| Matching gauge | In `Go to matching`, the gauge projects `already matched + Qt to match` against `quantity_theorical`, with `-tol_min` / `tol_max` bounds. | ## Developer Section @@ -147,7 +151,8 @@ quantity_theorical - Weight basis state: `purchase.weight.basis.qt_type` - Packing: `lot.lot.lot_qt`, `lot.lot.lot_unit` - Tolerances: `tol_min`, `tol_max`, `tol_min_qt`, `tol_max_qt`, - `tol_min_v`, `tol_max_v` + `tol_min_v`, `tol_max_v`, `tolerance_used`, `tolerance_min`, + `tolerance_max` ### Line / Virtual Lot Creation diff --git a/modules/purchase_trade/docs_source/business/lots-and-quantities.md b/modules/purchase_trade/docs_source/business/lots-and-quantities.md index c4772ca..216e3cf 100644 --- a/modules/purchase_trade/docs_source/business/lots-and-quantities.md +++ b/modules/purchase_trade/docs_source/business/lots-and-quantities.md @@ -122,6 +122,10 @@ quantity_theorical | Surconsommation | Une ligne qui dépasse la tolérance header garde une tolérance `+` au moins égale à son dépassement réel. | | Autres lignes | Leur tolérance `+` est réduite selon l'enveloppe restante. | | Sous-consommation | Restitue mécaniquement de la tolérance disponible aux autres lignes lors du recalcul suivant. | +| Matching ouvert | `Go to matching` peut matcher au-delà du solde ouvert strict si la quantité projetée reste dans `Qt max`. | +| Jauge ligne | Sur une ligne avec lots physiques, la jauge utilise la somme des physiques ; sans physique, elle utilise la somme des `lot.qt` liés. | +| Jauge header | La jauge purchase/sale est la moyenne pondérée des jauges de lignes au prorata de `quantity_theorical`. | +| Jauge matching | Dans `Go to matching`, la jauge projette `déjà matché + Qt to match` contre `quantity_theorical`, avec bornes `-tol_min` / `tol_max`. | ## Section développeur @@ -146,7 +150,8 @@ quantity_theorical - État Weight basis : `purchase.weight.basis.qt_type` - Packing : `lot.lot.lot_qt`, `lot.lot.lot_unit` - Tolerances : `tol_min`, `tol_max`, `tol_min_qt`, `tol_max_qt`, - `tol_min_v`, `tol_max_v` + `tol_min_v`, `tol_max_v`, `tolerance_used`, `tolerance_min`, + `tolerance_max` ### Création ligne / lot virtuel