WIP: feat/documentation_dolibarr #11
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@
|
|||||||
|
|
||||||
# Aptatio/Platformio specifics
|
# Aptatio/Platformio specifics
|
||||||
secrets.ini
|
secrets.ini
|
||||||
|
.idea
|
||||||
|
22
docker-compose-dolibarr.yml
Normal file
22
docker-compose-dolibarr.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:latest
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
MYSQL_DATABASE: dolibarr
|
||||||
|
|
||||||
|
web:
|
||||||
|
image: tuxgasy/dolibarr
|
||||||
|
environment:
|
||||||
|
DOLI_DB_HOST: mariadb
|
||||||
|
DOLI_DB_USER: root
|
||||||
|
DOLI_DB_PASSWORD: root
|
||||||
|
DOLI_DB_NAME: dolibarr
|
||||||
|
DOLI_URL_ROOT: 'http://0.0.0.0'
|
||||||
|
PHP_INI_DATE_TIMEZONE: 'Europe/Paris'
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
links:
|
||||||
|
- mariadb
|
58
docs/dolibarr/README.md
Normal file
58
docs/dolibarr/README.md
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
# Dolbarr documentation
|
||||||
|
|
||||||
|
### Créer une instance de dev
|
||||||
|
|
||||||
|
Pour créer une instance de développement, nous allons utiliser l'image docker de dolibarr:
|
||||||
|
https://hub.docker.com/r/tuxgasy/dolibarr/
|
||||||
|
|
||||||
|
pour simplifier l'installation, un docker-compose est disponible a la racine du projet `./docker-compose-dolibarr.yml`
|
||||||
|
|
||||||
|
pour lancer dolibarr:
|
||||||
|
```shell
|
||||||
|
$ docker compose -f docker-compose-dolibarr.yml up
|
||||||
|
```
|
||||||
|
|
||||||
|
ensuite il faut se rendre sur http://0.0.0.0/ puis se login avec les credentials par défault (admin, admin)
|
||||||
|
|
||||||
|
|
||||||
|
### Api flow
|
||||||
|
|
||||||
|
Base url: http://0.0.0.0/api/index.php/
|
||||||
|
|
||||||
|
Pour commencer, il faut récupérer l'api token d'un utilisateur pour pouvoir faire des requêtes api, assurer vous bien que l'utilisateurs a bien les permissions nécéssaires:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
ensuite vous pouvez utiliser ce token pour chaque route API en ajoutant dans les headers:
|
||||||
|
DOLAPIKEY = {{votre_ap_token}}
|
||||||
|
|
||||||
|
Récupérer le warehouse de base et vérifier son existance :
|
||||||
|
|
||||||
|
```
|
||||||
|
Method: GET
|
||||||
|
Url: warehouses/{id}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Récupérer les produits disponibles:
|
||||||
|
|
||||||
|
```
|
||||||
|
Method: GET
|
||||||
|
Url: products?sortfield=t.ref&sortorder=ASC&limit=10000
|
||||||
|
```
|
||||||
|
|
||||||
|
Pour créer un mouvement de stock:
|
||||||
|
|
||||||
|
```
|
||||||
|
Method: POST
|
||||||
|
Url: stockmovements?sortfield=t.rowid&sortorder=ASC&limit=100
|
||||||
|
Body (JSON):
|
||||||
|
{
|
||||||
|
"product_id": "1", //string, - id of the product to move
|
||||||
|
"warehouse_id": "1", //string - id of the warehourse
|
||||||
|
"qty": 60, //int - quantity to move (1 for positive or -1 to remove one item)
|
||||||
|
"movementcode": "S-1", //string - code of the mouvement
|
||||||
|
"movementlabel": "Abc" //string - label of the mouvement
|
||||||
|
}
|
||||||
|
```
|
BIN
docs/resources/image.png
Normal file
BIN
docs/resources/image.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 80 KiB |
Loading…
x
Reference in New Issue
Block a user