Create and update article functionnal but not, anymore, capable of handling "prix_achat"

This commit is contained in:
fanilo 2026-01-03 16:29:09 +01:00
parent cc1f3aa8b1
commit 4ae0178090

View file

@ -8708,6 +8708,27 @@ class SageConnector:
try:
article.Write()
logger.info(" [OK] Write() réussi")
# Vérification immédiate SQL
try:
with self._get_sql_connection() as conn:
cursor = conn.cursor()
cursor.execute(
"""
SELECT AR_PrixAch, AR_Coef, AR_Stat01, AR_Stat02
FROM F_ARTICLE
WHERE AR_Ref = ?
""",
(reference.upper(),),
)
verif_row = cursor.fetchone()
if verif_row:
logger.info(
f" [VERIF SQL] prix_achat={verif_row[0]}, coef={verif_row[1]}, stat01={verif_row[2]}, stat02={verif_row[3]}"
)
except Exception as e_verif:
logger.warning(f" [VERIF SQL] Impossible : {e_verif}")
except Exception as e:
error_detail = str(e)
try:
@ -9033,7 +9054,6 @@ class SageConnector:
raise RuntimeError("Connexion Sage non établie")
try:
valide, erreur = valider_donnees_modification(article_data)
if not valide:
raise ValueError(erreur)
@ -9289,6 +9309,27 @@ class SageConnector:
try:
article.Write()
logger.info("[ARTICLE] Write() réussi")
# Vérification immédiate SQL
try:
with self._get_sql_connection() as conn:
cursor = conn.cursor()
cursor.execute(
"""
SELECT AR_PrixAch, AR_Coef, AR_Stat01, AR_Stat02
FROM F_ARTICLE
WHERE AR_Ref = ?
""",
(reference.upper(),),
)
verif_row = cursor.fetchone()
if verif_row:
logger.info(
f" [VERIF SQL] prix_achat={verif_row[0]}, coef={verif_row[1]}, stat01={verif_row[2]}, stat02={verif_row[3]}"
)
except Exception as e_verif:
logger.warning(f" [VERIF SQL] Impossible : {e_verif}")
except Exception as e:
error_detail = str(e)
try: