style: Reformat method calls and remove unnecessary blank lines for improved code consistency.

This commit is contained in:
Fanilo-Nantenaina 2025-12-08 17:57:41 +03:00
parent 61e787bf36
commit e95e550044
2 changed files with 519 additions and 539 deletions

372
api.py

File diff suppressed because it is too large Load diff

View file

@ -299,10 +299,10 @@ class SageGatewayClient:
Returns:
Fournisseur modifié
"""
return self._post("/sage/fournisseurs/update", {
"code": code,
"fournisseur_data": fournisseur_data
}).get("data", {})
return self._post(
"/sage/fournisseurs/update",
{"code": code, "fournisseur_data": fournisseur_data},
).get("data", {})
# =====================================================
# AVOIRS
@ -378,11 +378,9 @@ class SageGatewayClient:
Returns:
Client modifié
"""
return self._post("/sage/clients/update", {
"code": code,
"client_data": client_data
}).get("data", {})
return self._post(
"/sage/clients/update", {"code": code, "client_data": client_data}
).get("data", {})
def modifier_devis(self, numero: str, devis_data: Dict) -> Dict:
"""
@ -398,10 +396,9 @@ class SageGatewayClient:
Returns:
Devis modifié avec totaux recalculés
"""
return self._post("/sage/devis/update", {
"numero": numero,
"devis_data": devis_data
}).get("data", {})
return self._post(
"/sage/devis/update", {"numero": numero, "devis_data": devis_data}
).get("data", {})
def creer_commande(self, commande_data: Dict) -> Dict:
"""
@ -423,7 +420,6 @@ class SageGatewayClient:
"""
return self._post("/sage/commandes/create", commande_data).get("data", {})
def modifier_commande(self, numero: str, commande_data: Dict) -> Dict:
"""
Modification d'une commande existante
@ -439,11 +435,9 @@ class SageGatewayClient:
Returns:
Commande modifiée avec totaux recalculés
"""
return self._post("/sage/commandes/update", {
"numero": numero,
"commande_data": commande_data
}).get("data", {})
return self._post(
"/sage/commandes/update", {"numero": numero, "commande_data": commande_data}
).get("data", {})
def creer_livraison(self, livraison_data: Dict) -> Dict:
"""
@ -451,15 +445,14 @@ class SageGatewayClient:
"""
return self._post("/sage/livraisons/create", livraison_data).get("data", {})
def modifier_livraison(self, numero: str, livraison_data: Dict) -> Dict:
"""
Modification d'une livraison existante
"""
return self._post("/sage/livraisons/update", {
"numero": numero,
"livraison_data": livraison_data
}).get("data", {})
return self._post(
"/sage/livraisons/update",
{"numero": numero, "livraison_data": livraison_data},
).get("data", {})
def creer_avoir(self, avoir_data: Dict) -> Dict:
"""
@ -481,7 +474,6 @@ class SageGatewayClient:
"""
return self._post("/sage/avoirs/create", avoir_data).get("data", {})
def modifier_avoir(self, numero: str, avoir_data: Dict) -> Dict:
"""
Modification d'un avoir existant
@ -497,11 +489,9 @@ class SageGatewayClient:
Returns:
Avoir modifié avec totaux recalculés
"""
return self._post("/sage/avoirs/update", {
"numero": numero,
"avoir_data": avoir_data
}).get("data", {})
return self._post(
"/sage/avoirs/update", {"numero": numero, "avoir_data": avoir_data}
).get("data", {})
def creer_facture(self, facture_data: Dict) -> Dict:
"""
@ -523,7 +513,6 @@ class SageGatewayClient:
"""
return self._post("/sage/factures/create", facture_data).get("data", {})
def modifier_facture(self, numero: str, facture_data: Dict) -> Dict:
"""
Modification d'une facture existante
@ -539,10 +528,9 @@ class SageGatewayClient:
Returns:
Facture modifiée avec totaux recalculés
"""
return self._post("/sage/factures/update", {
"numero": numero,
"facture_data": facture_data
}).get("data", {})
return self._post(
"/sage/factures/update", {"numero": numero, "facture_data": facture_data}
).get("data", {})
def generer_pdf_document(self, doc_id: str, type_doc: int) -> bytes:
"""
@ -577,12 +565,9 @@ class SageGatewayClient:
# Appel HTTP vers la gateway Windows
r = requests.post(
f"{self.url}/sage/documents/generate-pdf",
json={
"doc_id": doc_id,
"type_doc": type_doc
},
json={"doc_id": doc_id, "type_doc": type_doc},
headers=self.headers,
timeout=60 # Timeout élevé pour génération PDF
timeout=60, # Timeout élevé pour génération PDF
)
r.raise_for_status()
@ -626,6 +611,5 @@ class SageGatewayClient:
raise
# Instance globale
sage_client = SageGatewayClient()