ajout croquis_edit

This commit is contained in:
2021-08-06 19:34:11 +02:00
parent c0a7f5bd9b
commit dfbc1ea083
14 changed files with 2552 additions and 24 deletions

View File

@@ -357,13 +357,13 @@ def insert_dem_note(request, nodossier, type_note, logged_in):
query = "INSERT INTO dem_notes (societe, nochantier, type_note, usermaj) VALUES (:societe, :nochantier, :type_note, :logged_in);"
execute_query(request, query, {'societe': societe, 'nochantier': nochantier, 'type_note': type_note, 'logged_in': logged_in})
def get_dem_notes(request, nodossier, noligne):
def get_dem_notes(request, nodossier, noligne, type):
societe = nodossier[0:2]
nochantier = int(nodossier[3:])
if noligne == '0':
query = "SELECT societe, nochantier, noligne, type_note, libelle FROM dem_notes WHERE societe = :societe AND nochantier = :nochantier ORDER BY libelle;"
results = request.dbsession.execute(query, {'societe': societe, 'nochantier': nochantier, 'noligne': noligne}).fetchall()
query = "SELECT societe, nochantier, noligne, type_note, libelle FROM dem_notes WHERE societe = :societe AND nochantier = :nochantier AND type_note=:type ORDER BY libelle;"
results = request.dbsession.execute(query, {'societe': societe, 'nochantier': nochantier, 'noligne': noligne, 'type': type}).fetchall()
else:
query = "SELECT * FROM dem_notes WHERE societe = :societe AND nochantier = :nochantier AND noligne = :noligne;"
results = request.dbsession.execute(query, {'societe': societe, 'nochantier': nochantier, 'noligne': noligne}).first()