test dessin_edit
This commit is contained in:
@@ -366,20 +366,13 @@ def get_factures_en_att(request, societe):
|
||||
results = request.dbsession.execute(query, {'societe': societe}).fetchall()
|
||||
return results
|
||||
|
||||
def insert_dem_note(request, nodossier, type_note, logged_in):
|
||||
societe = nodossier[0:2]
|
||||
nochantier = int(nodossier[3:])
|
||||
# une note ou croquis
|
||||
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, type):
|
||||
def get_dem_notes(request, nodossier, noligne):
|
||||
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 AND type_note=:type ORDER BY libelle;"
|
||||
results = request.dbsession.execute(query, {'societe': societe, 'nochantier': nochantier, 'noligne': noligne, 'type': type}).fetchall()
|
||||
query = "SELECT societe, nochantier, noligne, 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()
|
||||
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()
|
||||
@@ -388,13 +381,25 @@ def get_dem_notes(request, nodossier, noligne, type):
|
||||
def delete_dem_note(request, nodossier, noligne):
|
||||
societe = nodossier[0:2]
|
||||
nochantier = int(nodossier[3:])
|
||||
# une note ou croquis
|
||||
# une note ou dessin
|
||||
query = "DELETE FROM dem_notes WHERE societe=:societe AND nochantier=:nochantier AND noligne=:noligne;"
|
||||
execute_query(request, query, {'societe': societe, 'nochantier': nochantier, 'noligne': noligne})
|
||||
|
||||
def update_dem_note(request, nodossier, noligne, notes):
|
||||
def update_dem_note(request, nodossier, noligne, notes, logged_in):
|
||||
societe = nodossier[0:2]
|
||||
nochantier = int(nodossier[3:])
|
||||
# une note ou croquis
|
||||
query = "UPDATE dem_notes SET notes=:notes WHERE societe=:societe AND nochantier=:nochantier AND noligne=:noligne;"
|
||||
execute_query(request, query, {'societe': societe, 'nochantier': nochantier, 'noligne': noligne, 'notes': notes})
|
||||
# création ou modif ?
|
||||
if noligne == '0':
|
||||
query = "INSERT INTO dem_notes (societe, nochantier, notes, usermaj) VALUES (:societe, :nochantier, :notes, :logged_in);"
|
||||
execute_query(request, query, {'societe': societe, 'nochantier': nochantier, 'notes': notes, 'logged_in': logged_in})
|
||||
else:
|
||||
query = "UPDATE dem_notes SET notes=:notes, logged_in=:logged_in WHERE societe=:societe AND nochantier=:nochantier AND noligne=:noligne;"
|
||||
execute_query(request, query, {'societe': societe, 'nochantier': nochantier, 'noligne': noligne, 'notes': notes, 'logged_in': logged_in})
|
||||
|
||||
def get_nb_dessins(request, nodossier):
|
||||
societe = nodossier[0:2]
|
||||
nochantier = nodossier[3:]
|
||||
|
||||
query = "SELECT count(*) AS nb FROM dossier_attaches WHERE societe=:societe AND nochantier=:nochantier AND origine='FRN' AND nomfichier LIKE '%DESSIN No %';"
|
||||
results = request.dbsession.execute(query, {'societe': societe, 'nochantier': nochantier}).first()
|
||||
return results.nb
|
||||
|
||||
Reference in New Issue
Block a user