Implement toggle for read/write mode across entity pages and enhance Documents and Divers functionality

- Added a toggle for switching between read and write modes on the Articles, Documents, Journaux, Tiers, and Divers pages, allowing users to access both data retrieval and data submission endpoints.
- Updated the Documents page to cover all 9 documented endpoints, including 7 for reading and 2 for writing, with appropriate error handling.
- Created a new Divers page to handle three endpoints: getserialnumber, codes_list, and custom_geninv_updatestock (the latter being non-functional).
- Introduced new methods in LogisticsService for handling PDF generation and stock updates, with corresponding updates in the API documentation.
- Improved form field components for better visual spacing in input fields.
This commit is contained in:
2026-02-20 15:51:58 +01:00
parent 8637dcc7cb
commit 7df94b64fa
22 changed files with 1777 additions and 376 deletions

View File

@@ -1,6 +1,6 @@
# Tech Context
Dernière mise à jour : 2026-02-20
Dernière mise à jour : 2026-02-21
## Stack technique
@@ -92,27 +92,31 @@ Fichier de config : `config/logistics.php`
Réponse `tables_list` : chaque table a `name` et `columnCount`.
Réponse `column_list` : chaque colonne a `name`, `dataType` (C/N/T/D/L/M), `length`, `precision`. Les colonnes sont retournées en double par l'API (dédupliquées côté client).
### Endpoints
### Endpoints (19 méthodes dans LogisticsService)
| Endpoint | Description | Paramètres principaux |
|----------|-------------|-----------------------|
| `tables_list` | Liste des tables | - |
| `column_list/{table}` | Colonnes d'une table | table (URL) |
| `art_list` | Liste d'articles | select, results, search, barcode |
| `art_getstk` | Stock d'un article | ARTID |
| `jnl_list` | Liste des journaux | select, results, TYPE |
| `document_list` | Liste des documents | select, thirdid |
| `document_detail` | Détail d'un document | jnl, number |
| `document_add` | Ajout d'un document | ThirdId, Date, Artid[], Qty[], Saleprice[], JNL, ... |
| `document_mod` | Modification d'un document | number, Thirdid, Artid[], Qty[], Saleprice[], JNL, ... |
| `Document_GetStatusList` | Statuts d'un journal | jnl |
| `Document_GetUnitPriceAndVat` | Prix et TVA | ARTID, QTY, JNL, THIRDID, DATE |
| `Document_GetDueDate` | Échéance | paydelay, date |
| `Document_GetAttachListThumbnail` | Miniatures annexes | JNL, NUMBER |
| `third_list` | Liste des tiers | select, results, search |
| `third_GetArtHistory` | Historique articles tiers | thirdid |
| `getserialnumber` | Numéro de série | - |
| `codes_list` | Données par code | code |
| Endpoint | Méthode service | Type | Description | Paramètres principaux |
|----------|----------------|------|-------------|-----------------------|
| `tables_list` | `tablesList()` | Lecture | Liste des tables | - |
| `column_list/{table}` | `columnList(string)` | Lecture | Colonnes d'une table | table (URL) |
| `art_list` | `artList(array)` | Lecture | Liste d'articles | select, results, search, barcode |
| `art_getstk` | `artGetStock(string)` | Lecture | Stock d'un article | ARTID |
| `jnl_list` | `jnlList(array)` | Lecture | Liste des journaux | select, results, TYPE |
| `document_list` | `documentList(array)` | Lecture | Liste des documents | select, thirdid |
| `document_detail` | `documentDetail(string, string)` | Lecture | Détail d'un document | jnl, number |
| `Document_GetStatusList` | `documentGetStatusList(string)` | Lecture | Statuts d'un journal | jnl |
| `Document_GetUnitPriceAndVat` | `documentGetUnitPriceAndVat(array)` | Lecture | Prix et TVA | ARTID, QTY, JNL, THIRDID, DATE |
| `Document_GetDueDate` | `documentGetDueDate(string, string)` | Lecture | Échéance | paydelay, date |
| `Document_GetAttachListThumbnail` | `documentGetAttachListThumbnail(string, string)` | Lecture | Miniatures annexes | JNL, NUMBER |
| `Document_GetPDF` | `documentGetPdf(string, string, string)` | Lecture | Génération PDF | JNL, NUMBER, LAYOUT |
| `third_list` | `thirdList(array)` | Lecture | Liste des tiers | select, results, search |
| `third_GetArtHistory` | `thirdGetArtHistory(string)` | Lecture | Historique articles tiers | thirdid |
| `getserialnumber` | `getSerialNumber()` | Lecture | Numéro de série | - |
| `codes_list` | `codesList(array)` | Lecture | Données par code | code |
| `document_add` | `documentAdd(array)` | Écriture | Ajout d'un document | ThirdId, Date, Artid[], Qty[], Saleprice[], JNL, ... |
| `document_mod` | `documentMod(array)` | Écriture | Modification d'un document | number, Thirdid, Artid[], Qty[], Saleprice[], JNL, ... |
| `custom_geninv_updatestock` | `customGeninvUpdatestock(array)` | Écriture | Mise à jour inventaire | ARTID, STKID, QTY, ... |
**Endpoints non fonctionnels** : `Document_GetPDF` (paramètre LAYOUT inconnu), `custom_geninv_updatestock` (paramètre STKID inconnu, signification de TOCHECK/TOCHECKDETAIL/MODE à clarifier).
### Tables accessibles