style: Reformat method calls and remove unnecessary blank lines for improved code consistency.
This commit is contained in:
parent
61e787bf36
commit
e95e550044
2 changed files with 519 additions and 539 deletions
|
|
@ -299,10 +299,10 @@ class SageGatewayClient:
|
||||||
Returns:
|
Returns:
|
||||||
Fournisseur modifié
|
Fournisseur modifié
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/fournisseurs/update", {
|
return self._post(
|
||||||
"code": code,
|
"/sage/fournisseurs/update",
|
||||||
"fournisseur_data": fournisseur_data
|
{"code": code, "fournisseur_data": fournisseur_data},
|
||||||
}).get("data", {})
|
).get("data", {})
|
||||||
|
|
||||||
# =====================================================
|
# =====================================================
|
||||||
# AVOIRS
|
# AVOIRS
|
||||||
|
|
@ -378,11 +378,9 @@ class SageGatewayClient:
|
||||||
Returns:
|
Returns:
|
||||||
Client modifié
|
Client modifié
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/clients/update", {
|
return self._post(
|
||||||
"code": code,
|
"/sage/clients/update", {"code": code, "client_data": client_data}
|
||||||
"client_data": client_data
|
).get("data", {})
|
||||||
}).get("data", {})
|
|
||||||
|
|
||||||
|
|
||||||
def modifier_devis(self, numero: str, devis_data: Dict) -> Dict:
|
def modifier_devis(self, numero: str, devis_data: Dict) -> Dict:
|
||||||
"""
|
"""
|
||||||
|
|
@ -398,10 +396,9 @@ class SageGatewayClient:
|
||||||
Returns:
|
Returns:
|
||||||
Devis modifié avec totaux recalculés
|
Devis modifié avec totaux recalculés
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/devis/update", {
|
return self._post(
|
||||||
"numero": numero,
|
"/sage/devis/update", {"numero": numero, "devis_data": devis_data}
|
||||||
"devis_data": devis_data
|
).get("data", {})
|
||||||
}).get("data", {})
|
|
||||||
|
|
||||||
def creer_commande(self, commande_data: Dict) -> Dict:
|
def creer_commande(self, commande_data: Dict) -> Dict:
|
||||||
"""
|
"""
|
||||||
|
|
@ -423,7 +420,6 @@ class SageGatewayClient:
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/commandes/create", commande_data).get("data", {})
|
return self._post("/sage/commandes/create", commande_data).get("data", {})
|
||||||
|
|
||||||
|
|
||||||
def modifier_commande(self, numero: str, commande_data: Dict) -> Dict:
|
def modifier_commande(self, numero: str, commande_data: Dict) -> Dict:
|
||||||
"""
|
"""
|
||||||
✏️ Modification d'une commande existante
|
✏️ Modification d'une commande existante
|
||||||
|
|
@ -439,11 +435,9 @@ class SageGatewayClient:
|
||||||
Returns:
|
Returns:
|
||||||
Commande modifiée avec totaux recalculés
|
Commande modifiée avec totaux recalculés
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/commandes/update", {
|
return self._post(
|
||||||
"numero": numero,
|
"/sage/commandes/update", {"numero": numero, "commande_data": commande_data}
|
||||||
"commande_data": commande_data
|
).get("data", {})
|
||||||
}).get("data", {})
|
|
||||||
|
|
||||||
|
|
||||||
def creer_livraison(self, livraison_data: Dict) -> Dict:
|
def creer_livraison(self, livraison_data: Dict) -> Dict:
|
||||||
"""
|
"""
|
||||||
|
|
@ -451,15 +445,14 @@ class SageGatewayClient:
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/livraisons/create", livraison_data).get("data", {})
|
return self._post("/sage/livraisons/create", livraison_data).get("data", {})
|
||||||
|
|
||||||
|
|
||||||
def modifier_livraison(self, numero: str, livraison_data: Dict) -> Dict:
|
def modifier_livraison(self, numero: str, livraison_data: Dict) -> Dict:
|
||||||
"""
|
"""
|
||||||
✏️ Modification d'une livraison existante
|
✏️ Modification d'une livraison existante
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/livraisons/update", {
|
return self._post(
|
||||||
"numero": numero,
|
"/sage/livraisons/update",
|
||||||
"livraison_data": livraison_data
|
{"numero": numero, "livraison_data": livraison_data},
|
||||||
}).get("data", {})
|
).get("data", {})
|
||||||
|
|
||||||
def creer_avoir(self, avoir_data: Dict) -> Dict:
|
def creer_avoir(self, avoir_data: Dict) -> Dict:
|
||||||
"""
|
"""
|
||||||
|
|
@ -481,7 +474,6 @@ class SageGatewayClient:
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/avoirs/create", avoir_data).get("data", {})
|
return self._post("/sage/avoirs/create", avoir_data).get("data", {})
|
||||||
|
|
||||||
|
|
||||||
def modifier_avoir(self, numero: str, avoir_data: Dict) -> Dict:
|
def modifier_avoir(self, numero: str, avoir_data: Dict) -> Dict:
|
||||||
"""
|
"""
|
||||||
✏️ Modification d'un avoir existant
|
✏️ Modification d'un avoir existant
|
||||||
|
|
@ -497,11 +489,9 @@ class SageGatewayClient:
|
||||||
Returns:
|
Returns:
|
||||||
Avoir modifié avec totaux recalculés
|
Avoir modifié avec totaux recalculés
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/avoirs/update", {
|
return self._post(
|
||||||
"numero": numero,
|
"/sage/avoirs/update", {"numero": numero, "avoir_data": avoir_data}
|
||||||
"avoir_data": avoir_data
|
).get("data", {})
|
||||||
}).get("data", {})
|
|
||||||
|
|
||||||
|
|
||||||
def creer_facture(self, facture_data: Dict) -> Dict:
|
def creer_facture(self, facture_data: Dict) -> Dict:
|
||||||
"""
|
"""
|
||||||
|
|
@ -523,7 +513,6 @@ class SageGatewayClient:
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/factures/create", facture_data).get("data", {})
|
return self._post("/sage/factures/create", facture_data).get("data", {})
|
||||||
|
|
||||||
|
|
||||||
def modifier_facture(self, numero: str, facture_data: Dict) -> Dict:
|
def modifier_facture(self, numero: str, facture_data: Dict) -> Dict:
|
||||||
"""
|
"""
|
||||||
✏️ Modification d'une facture existante
|
✏️ Modification d'une facture existante
|
||||||
|
|
@ -539,10 +528,9 @@ class SageGatewayClient:
|
||||||
Returns:
|
Returns:
|
||||||
Facture modifiée avec totaux recalculés
|
Facture modifiée avec totaux recalculés
|
||||||
"""
|
"""
|
||||||
return self._post("/sage/factures/update", {
|
return self._post(
|
||||||
"numero": numero,
|
"/sage/factures/update", {"numero": numero, "facture_data": facture_data}
|
||||||
"facture_data": facture_data
|
).get("data", {})
|
||||||
}).get("data", {})
|
|
||||||
|
|
||||||
def generer_pdf_document(self, doc_id: str, type_doc: int) -> bytes:
|
def generer_pdf_document(self, doc_id: str, type_doc: int) -> bytes:
|
||||||
"""
|
"""
|
||||||
|
|
@ -577,12 +565,9 @@ class SageGatewayClient:
|
||||||
# Appel HTTP vers la gateway Windows
|
# Appel HTTP vers la gateway Windows
|
||||||
r = requests.post(
|
r = requests.post(
|
||||||
f"{self.url}/sage/documents/generate-pdf",
|
f"{self.url}/sage/documents/generate-pdf",
|
||||||
json={
|
json={"doc_id": doc_id, "type_doc": type_doc},
|
||||||
"doc_id": doc_id,
|
|
||||||
"type_doc": type_doc
|
|
||||||
},
|
|
||||||
headers=self.headers,
|
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()
|
r.raise_for_status()
|
||||||
|
|
@ -626,6 +611,5 @@ class SageGatewayClient:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Instance globale
|
# Instance globale
|
||||||
sage_client = SageGatewayClient()
|
sage_client = SageGatewayClient()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue