Commit 11bce73a by Juan Pablo dure

empesamos a tocar reportes

1 parent 208b02ca
......@@ -11,6 +11,12 @@ class estaticos():
return(rta)
@staticmethod
def Hora():
"""Devuelve la fecha y hora en formato humano"""
rta = datetime.datetime.now().strftime("%H:%M")
return(rta)
@staticmethod
def Fecha():
"""Devuelve la fecha con formatio humano"""
rta = datetime.datetime.now().strftime("%d/%m/%Y")
......
......@@ -8,17 +8,17 @@ ing = ingenieros.ingenieros()
app = Flask(__name__)
def create():
if not os.path.exists("users.json"):
with open("users.json", "+w") as f:
if not os.path.exists("data/users.json"):
with open("data/users.json", "+w") as f:
f.write("{}")
def usersave(usr, psw):
create()
content = ""
with open("users.json", "r") as u:
with open("data/users.json", "r") as u:
content = u.read()
with open("users.json", "w") as u:
with open("data/users.json", "w") as u:
try:
content = json.loads(content)
except:
......@@ -30,7 +30,7 @@ def usersave(usr, psw):
def userget(usr):
create()
content = ""
with open("users.json", "r") as u:
with open("data/users.json", "r") as u:
content = u.read()
try:
......@@ -157,7 +157,8 @@ def report():
answer['header']['patente'] = plate.upper()
answer['header']["fecha-hora"] = apollo.estaticos.FechaHora()
answer['header']["ingeniero"] = ing.LeerDatosUsuario(request.cookies["login"])
answer['header']["hora"] = apollo.estaticos.Hora()
answer['header']["ingeniero"] = ing.LeerDatosUsuario(request.cookies["login"])['nombreyapellido']
try:
login(
......
......@@ -139,8 +139,10 @@ class PDF1 {
"CP:Ciudad:",
"Teléfono:",
`Fecha de Prueba:\t${data['fecha']}`,
"Hora de Prueba:",
`Hora de Prueba:\t${data['hora']}`,
`Ingeniero:\t${data['ingeniero']}`,
"Estado de Carga:\tVacio"
],
new Vector(Pos.beg_margin + 5, Pos.beg_margin + 10),
body_black
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!