コード例 #1
0
def show_erecibo(nroFrom):
    resp = MessagingResponse()
    msg = resp.message()
    clnt = Cliente.where('número_telefonico', nroFrom[9:100]).first()
    fact = Factura.where('cliente_id', clnt.id).first()
    usr_nombre = clnt.nombre
    msg.body('Hola ' + usr_nombre + " este es tu recibo:" + "\nsub total: " +
             str(fact.sub_total) + "\n IGV: " + str(fact.IGV) + "\n total: " +
             str(fact.monto_total))
    return str(resp)
コード例 #2
0
def show_estado(nroFrom):
    resp = MessagingResponse()
    msg = resp.message()
    app.logger.debug(nroFrom[9:100])
    clnt = Cliente.where('número_telefonico', nroFrom[9:100]).first()
    usr_nombre = clnt.nombre
    usr_id = clnt.id
    app.logger.debug(usr_id)
    ped = Pedido.where('cliente_id', usr_id).first()
    usr_fec_entrg = ped.fecha_entrega
    msg.body('Hola ' + usr_nombre +
             ', tienes un pedido con entrega para el día ' +
             str(usr_fec_entrg) +
             '\nEscriba menu para volver a ver las opciones.')
    return str(resp)