|
|
@@ -18,12 +18,26 @@
|
|
|
import logging
|
|
|
import re
|
|
|
|
|
|
+from path import Path # @UnusedImport
|
|
|
+
|
|
|
from core import logconf
|
|
|
from core.pde import AnalytiqueDb, mk_workdir
|
|
|
from core.webservice import GfWebservice
|
|
|
|
|
|
+
|
|
|
logger = logging.getLogger("gf2analytique")
|
|
|
-logconf.start("gf2analytique", logging.INFO)
|
|
|
+logconf.start("gf2analytique", logging.DEBUG)
|
|
|
+
|
|
|
+# # POUR TESTER, décommenter les lignes suivantes
|
|
|
+##-----------------------------------------------
|
|
|
+
|
|
|
+logger.warning("<<<<<<<<<<<<<< Mode TEST >>>>>>>>>>>>>>>>>")
|
|
|
+GfWebservice._url = r"http://webservices-t.bas-rhin.fr/CG67.AstreGF.WebServices/public/WsPDE.asmx"
|
|
|
+AnalytiqueDb._path = Path(r"\\h2o\local\4-transversal\BDD\mdb_test\Db_analytique.mdb")
|
|
|
+
|
|
|
+##-----------------------------------------------
|
|
|
+
|
|
|
+
|
|
|
|
|
|
logger.info("Initialization")
|
|
|
|
|
|
@@ -176,18 +190,12 @@ class Facture():
|
|
|
def _get_facture_id(self):
|
|
|
sql = """SELECT dblFactureId FROM tbl_Factures
|
|
|
WHERE intExercice = {}
|
|
|
- AND strEnveloppe = '{}'
|
|
|
AND strLiquidation = '{}'
|
|
|
- AND strAxe = '{}'
|
|
|
- AND
|
|
|
- ((intLiquidationLigne = {} AND strCentreCout='{}')
|
|
|
- OR (intLiquidationLigne IS NULL))
|
|
|
+ AND strEngagement = '{}'
|
|
|
+ AND strService='7710'
|
|
|
""".format(self.numExBudget,
|
|
|
- self.numEnv,
|
|
|
self.numLiqMandat,
|
|
|
- self.codeAxe,
|
|
|
- self.numLigneMandat,
|
|
|
- self.codeCout)
|
|
|
+ self.numMandat)
|
|
|
|
|
|
factureId = analytique_db.first(sql).dblFactureId
|
|
|
return factureId
|