Example #1
0
 def fieldsDefinition(cls):
     res = Record.fieldsDefinition()
     res['id'] = {'Type': 'integer', 'Hidde': True}
     res['UserId'] = {'Type': 'integer', 'Hidde': True}
     res['Comment'] = {
         'Type': 'text',
         'Label': 'Comentario',
         'Input': 'text',
         'Readonly': 1
     }
     res['Action'] = {'Type': 'text', 'Hidde': True}
     res['Status'] = {
         'Type': 'integer',
         'Label': 'Estado',
         'Input': 'combo',
         'Values': {
             0: 'No Leída',
             1: 'Leída'
         }
     }
     res['TransDate'] = {
         'Type': 'datetime',
         'Label': 'Fecha',
         'Input': 'datetime',
         'Readonly': 1
     }
     res['Description'] = {
         'Type': 'text',
         'Label': 'Descripción',
         'Input': 'textarea',
         'rows': '4',
         'Readonly': 1
     }
     return res
Example #2
0
 def fieldsDefinition(cls):
     res = Record.fieldsDefinition()
     res['id'] = {'Type': 'text', 'Hidde': True, 'Readonly': 1}
     res['CompanyId'] = {'Type': 'integer', 'Hidde': True}
     res['UserId'] = {
         'Type': 'integer',
         'Label': 'Usuario',
         'Input': 'combo',
         'Level': [0, 1],
         'LinkTo': {
             'Table': 'User',
             'Show': ['Name']
         }
     }
     res['ServiceId'] = {
         'Type': 'integer',
         'Label': 'Servicio',
         'Input': 'combo',
         'Level': [0, 1],
         'LinkTo': {
             'Table': 'Service',
             'Show': ['Name']
         }
     }
     return res
Example #3
0
 def fieldsDefinition(cls):
     res = Record.fieldsDefinition()
     res['id'] = {'Type': 'text', 'Hidde': True}
     res['UserId'] = {'Type': 'integer'}
     res['FavoriteId'] = {'Type': 'integer'}
     res['Checked'] = {'Type': 'boolean'}
     return res
Example #4
0
 def getRecordList(cls, TableClass, limit=None, order_by=None, desc=None):
     if current_user.UserType == 1:
         session = Session()
         records = session.query(cls).filter_by(
             CompanyId=current_user.CompanyId)
         session.close()
     else:
         records = Record.getRecordList(TableClass)
     return records
Example #5
0
 def fieldsDefinition(cls):
     res = Record.fieldsDefinition()
     res['id'] = {'Type': 'integer','Hidde': True}
     res['UserId'] = {'Type': 'integer','Hidde': True}
     res['ProfId'] = {'Type': 'integer', 'Hidde': True}
     res['CompanyId'] = {'Type': 'text', 'Hidde': True}
     res['TransDate'] = {'Type': 'datetime', 'Hidde': True}
     res['Note'] = {'Type': 'text', 'Label': 'Nota','Input':'textarea','rows':'4','cols':'50'}
     return res
Example #6
0
 def fieldsDefinition(cls):
     res = Record.fieldsDefinition()
     res['id'] = {'Type': 'text', 'Label': 'Email','Input':'text','Readonly':1}
     res['Password'] = {'Type': 'text', 'Label': 'Password','Input':'password'}
     res['Active'] = {'Type': 'integer', 'Label': 'Activo', 'Input': 'checkbox','Level':[0]}
     res['UserType'] = {'Type': 'integer', 'Label': 'Tipo de Usuario', 'Input': 'combo', \
         'Values': {0: 'Super',1: 'Administrador',2: 'Profesional',3: 'Cliente'},'Level':[0,1],\
         'ValuesLevel':{0:[0,1,2,3],1:[1,2,3],2:[3],3:[]}}
     res['Name'] = {'Type': 'text', 'Label': 'Nombre', 'Input': 'text'}
     return res
Example #7
0
 def fieldsDefinition(cls):
     res = Record.fieldsDefinition()
     res['id'] = {'Type': 'text', 'Hidde': True, 'Readonly': 1}
     res['UserId'] = {
         'Type': 'integer',
         'Label': 'Usuario',
         'Input': 'combo',
         'LinkTo': {
             'Table': 'User',
             'Show': ['Name']
         }
     }
     res['ActivityId'] = {'Type': 'text', 'Hidde': True, 'Readonly': 1}
     res['CompanyId'] = {
         'Type': 'integer',
         'Label': 'Empresa',
         'Input': 'combo',
         'LinkTo': {
             'Table': 'Company',
             'Show': ['Name']
         }
     }
     res['Amount'] = {'Type': 'float', 'Label': 'Valor', 'Input': 'number'}
     res['ResponseCode'] = {'Type': 'integer', 'Label': 'Estado', 'Input': 'combo','Values': {0: 'No Recibido' ,1: 'Aprobado' \
         ,2: 'Rechazado' ,3: 'Pendiente' ,4: 'Fallida'}}
     res['TransDate'] = {
         'Type': 'datetime',
         'Label': 'Fecha',
         'Input': 'datetime'
     }
     res['Reference'] = {
         'Type': 'text',
         'Label': 'Referencia',
         'Input': 'text'
     }
     res['Reason'] = {'Type': 'text', 'Label': 'Motivo', 'Input': 'text'}
     res['TransactionId'] = {
         'Type': 'text',
         'Label': 'Recibo',
         'Input': 'text'
     }
     res['Currency'] = {'Type': 'text', 'Label': 'Moneda', 'Input': 'text'}
     res['BankName'] = {'Type': 'text', 'Label': 'Banco', 'Input': 'text'}
     res['AutorizationCode'] = {
         'Type': 'text',
         'Label': 'Autorización',
         'Input': 'text'
     }
     res['Response'] = {
         'Type': 'text',
         'Label': 'Respuesta',
         'Input': 'text'
     }
     return res
Example #8
0
 def fieldsDefinition(cls):
     res = Record.fieldsDefinition()
     res['id'] = {
         'Type': 'text',
         'Hidde': True,
         'Label': 'Código',
         'Input': 'integer',
         'Readonly': 1
     }
     res['Active'] = {
         'Type': 'integer',
         'Label': 'Activo',
         'Input': 'checkbox',
         'Level': [0]
     }
     res['Name'] = {'Type': 'text', 'Label': 'Nombre', 'Input': 'text'}
     res['Phone'] = {'Type': 'text', 'Label': 'Teléfono', 'Input': 'text'}
     res['Email'] = {'Type': 'text', 'Label': 'Email', 'Input': 'text'}
     res['WebSite'] = {'Type': 'text', 'Label': 'Web Site', 'Input': 'text'}
     res['Comment'] = {
         'Type': 'text',
         'Label': 'Comentario',
         'Input': 'textarea',
         'rows': '4'
     }
     res['Address'] = {
         'Type': 'text',
         'Label': 'Dirección',
         'Input': 'text'
     }
     res['City'] = {'Type': 'text', 'Label': 'Ciudad', 'Input': 'text'}
     res['ImageProfile'] = {
         'Type': 'text',
         'Label':
         'Imagen de Perfil. Tamaño sugerido: 300px x 300px. Peso máximo: 150kb',
         'Input': 'fileinput'
     }
     res['OnlinePayment'] = {
         'Type': 'integer',
         'Label': 'Habilitar Pagos en línea',
         'Input': 'checkbox'
     }
     res['KeyPayco'] = {
         'Type': 'text',
         'Label': 'Clave ePayco',
         'Input': 'text'
     }
     res['Closed'] = {
         'Type': 'integer',
         'Label': 'Cerrado',
         'Input': 'checkbox',
         'Level': [0]
     }
     return res
Example #9
0
    def get_data(self):
        """save record to data"""
        with open(self.file_name) as txt_tmp:
            f = txt_tmp.readlines()
            for one_line_data in f:
                one_line_data = one_line_data.split()
                if len(one_line_data) is 1:
                    one_line_data = one_line_data[0].split(',')

                str1 = Record(one_line_data)
                self.data.append(str1)
Example #10
0
 def getRecordList(cls, TableClass, limit=None, order_by=None, desc=None):
     if current_user.UserType == 1:
         session = Session()
         records = session.query(cls).filter(
             cls.CompanyId == current_user.CompanyId, cls.UserType >= 1)
         session.close()
     elif current_user.UserType == 2:
         session = Session()
         records = session.query(cls).filter(cls.CompanyId==current_user.CompanyId, \
             or_(cls.UserType==3,cls.id==current_user.id))
         session.close()
     else:
         records = Record.getRecordList(TableClass)
     return records
Example #11
0
 def fieldsDefinition(cls):
     res = Record.fieldsDefinition()
     res['id'] = {'Type': 'text', 'Hidde': True, 'Readonly': 1}
     res['Name'] = {'Type': 'text', 'Label': 'Nombre', 'Input': 'text'}
     res['CompanyId'] = {
         'Type': 'integer',
         'Label': 'Empresa',
         'Input': 'combo',
         'Level': [0],
         'LinkTo': {
             'Table': 'Company',
             'Show': ['Name']
         }
     }
     res['OnlinePayment'] = {
         'Type': 'integer',
         'Label': 'Habilitar Pagos en línea',
         'Input': 'checkbox'
     }
     res['Price'] = {'Type': 'flaot', 'Label': 'Precio', 'Input': 'number'}
     return res
Example #12
0
 def beforeInsert(self):
     Record.beforeInsert(self)
     user = User.getRecordById(self.FavoriteId)
     if user and user.CompanyId:
         self.CompanyId = user.CompanyId
Example #13
0
 def fieldsDefinition(cls):
     res = Record.fieldsDefinition()
     res['id'] = {'Type': 'integer', 'Hidde': True}
     res['CustId'] = {'Type': 'integer', 'Label': 'Cliente', 'Input': 'combo','LinkTo':{'Table':'User','Show':['Name']\
         ,'Method':'getCustomer','Params':"{'favorite':True}" \
         ,'Filters': {'UserType':[3]},'Params':"{'favorite':True}"},'ShowIf':['Type',["0"],-1]}
     res['ProfId'] = {'Type': 'integer', 'Label': 'Profesional', 'Input': 'combo','LinkTo':{'Table':'User','Show':['Name'] \
         ,'Filters': {'UserType':[0,1,2]}}}
     res['CompanyId'] = {
         'Type': 'text',
         'Label': 'Empresa',
         'Input': 'combo',
         'LinkTo': {
             'Table': 'Company',
             'Show': ['Name']
         }
     }
     res['ServiceId'] = {'Type': 'text', 'Label': 'Servicio', 'Input': 'combo','LinkTo':{'Table':'Service','Show':['Name']} \
         ,'AfterChange':'setServicePrice()'}
     res['Comment'] = {
         'Type': 'text',
         'Label': 'Comentario',
         'Input': 'text'
     }
     res['Type'] = {'Type': 'integer', 'Label': 'Tipo de actividad', 'Input': 'combo' \
         ,'Values': {0: 'Cita',1: 'Curso',2:'Evento'},'OnChange':'updateLinkTo()'}
     if current_user.UserType == 3:
         res['Type']['Hidde'] = True
     res['Users'] = {
         'Type': [],
         'Class': 'ActivityUsers',
         'fieldsDefinition': ActivityUsers.fieldsDefinition(),
         'Level': [0, 1, 2],
         'htmlView': ActivityUsers.htmlView()
     }
     res['Schedules'] = {
         'Type': [],
         'Label': 'Horarios',
         'Class': 'ActivitySchedules',
         'fieldsDefinition': ActivitySchedules.fieldsDefinition(),
         'Level': [0, 1, 2, 3],
         'htmlView': ActivitySchedules.htmlView()
     }
     res['Image'] = {
         'Type': 'text',
         'Label': 'Imagen',
         'Input': 'fileinput',
         'Level': [0, 1, 2]
     }
     res['MaxPersons'] = {
         'Type': 'integer',
         'Label': 'Cupos',
         'Input': 'integer',
         'Level': [0, 1, 2]
     }
     res['Price'] = {
         'Type': 'float',
         'Label': 'Valor',
         'Input': 'number',
         'Level': [0, 1, 2, 3]
     }
     res['Description'] = {
         'Type': 'text',
         'Label': 'Descripción',
         'Input': 'textarea',
         'rows': '4',
         'Level': [0, 1, 2]
     }
     res['Status'] = {
         'Type': 'integer',
         'Label': 'Estado',
         'Input': 'combo',
         'Values': {
             0: 'Solicitada',
             1: 'Confirmada',
             2: 'Cancelada'
         },
         'Level': [0, 1, 2, 3]
     }
     res['OnlinePayment'] = {
         'Type': 'integer',
         'Label': 'Habilitar Pagos en línea',
         'Input': 'checkbox',
         'Level': [0, 1, 2, 3]
     }
     return res
Example #14
0
 def fieldsDefinition(cls):
     res = Record.fieldsDefinition()
     res['id'] = {'Type': 'integer', 'Hidde': True}
     res['Email'] = {'Type': 'text', 'Label': 'Email', 'Input': 'text'}
     res['Password'] = {
         'Type': 'text',
         'Label': 'Password',
         'Input': 'password'
     }
     res['Active'] = {
         'Type': 'integer',
         'Label': 'Activo',
         'Input': 'checkbox',
         'Level': [0]
     }
     res['UserType'] = {'Type': 'integer', 'Label': 'Tipo de Usuario', 'Input': 'combo', \
         'Values': {0: 'Super',1: 'Administrador',2: 'Profesional',3: 'Cliente'},\
         'ValuesLevel':{0:[0,1,2,3],1:[1,2,3],2:[3],3:[]},'ShowIf':['UserType',["0","1","2"],-1]}
     res['CompanyId'] = {'Type': 'integer', 'Label': 'Empresa', 'Input': 'combo','Level':[0]\
         ,'LinkTo':{'Table':'Company','Show':['Name']},'ShowIf':['UserType',["0","1","2"],-1]}
     res['Name'] = {'Type': 'text', 'Label': 'Nombre', 'Input': 'text'}
     res['Title'] = {
         'Type': 'text',
         'Label': 'Profesión',
         'Input': 'text',
         'Level': [0, 1, 2]
     }
     res['FindMe'] = {
         'Type': 'integer',
         'Label': 'Aparecer en Buscador',
         'Input': 'checkbox',
         'Level': [0, 1, 2],
         'ShowIf': ['UserType', ["0", "1", "2"], -1]
     }
     res['FixedSchedule'] = {
         'Type': 'integer',
         'Label': 'Horarios Fijos',
         'Input': 'checkbox',
         'Level': [0, 1, 2],
         'ShowIf': ['UserType', ["0", "1", "2"], -1]
     }
     res['MinTime'] = {
         'Type': 'integer',
         'Label': 'Tiempo Mínimo',
         'Input': 'integer',
         'Level': [0, 1, 2],
         'ShowIf': ['UserType', ["0", "1", "2"], -1]
     }
     res['MaxTime'] = {
         'Type': 'integer',
         'Label': 'Tiempo Máximo',
         'Input': 'integer',
         'Level': [0, 1, 2],
         'ShowIf': ['UserType', ["0", "1", "2"], -1]
     }
     res['ShowDays'] = {
         'Type': 'integer',
         'Label': 'Disponibilidad Hasta (Cantidad de días)',
         'Input': 'integer',
         'Level': [0, 1, 2],
         'ShowIf': ['UserType', ["0", "1", "2"], -1]
     }
     res['ShowFromDays'] = {
         'Type': 'integer',
         'Label': 'Disponibilidad Desde (Cantidad de días)',
         'Input': 'integer',
         'Level': [0, 1, 2],
         'ShowIf': ['UserType', ["0", "1", "2"], -1]
     }
     res['Phone'] = {'Type': 'text', 'Label': 'Teléfono', 'Input': 'text'}
     res['Comment'] = {
         'Type': 'text',
         'Label': 'Descripción',
         'Input': 'textarea',
         'rows': '4',
         'Level': [0, 1, 2],
         'ShowIf': ['UserType', ["0", "1", "2"], -1]
     }
     res['Address'] = {
         'Type': 'text',
         'Label': 'Dirección',
         'Input': 'text'
     }
     res['City'] = {'Type': 'text', 'Label': 'Ciudad', 'Input': 'text'}
     res['EditSchedule'] = {'Type': 'integer', 'Label': 'Editar Agenda', 'Input': 'combo', \
         'Values': {0: 'SI',1: 'NO'},'Level':[0,1],'ShowIf':['UserType',["0","1","2"],-1]}
     res['Schedules'] = {'Type':[],'Label':'Horarios','Class':'UserSchedule',\
         'fieldsDefinition': UserSchedule.fieldsDefinition(),'Level':[0,1,2],'ShowIf':['UserType',["0","1","2"],-1]}
     res['Favorite'] = {'Type': 'integer', 'Label': 'Agregar a Favoritos', 'Input': 'button','Level':[0,1,2],'Persistent':False, \
         'Method':'getFavorite()','onClick': 'setFavorite(this,"1")','Class':'btn btn-primary btn-rounded waves-effect waves-light m-t-20' }
     res['ImageProfile'] = {'Type': 'text', 'Label': 'Imagen de Perfil', 'Input': 'fileinput' ,\
                            'SubLabel':'Tamaño sugerido: 300px x 300px. Peso máximo: 150kb'}
     res['NtfActivityNew'] = {
         'Type': 'integer',
         'Label': 'Nueva Actividad',
         'Input': 'checkbox'
     }
     res['NtfActivityCancel'] = {
         'Type': 'integer',
         'Label': 'Actividad Cancelada',
         'Input': 'checkbox'
     }
     res['NtfActivityChange'] = {
         'Type': 'integer',
         'Label': 'Actividad Modificada',
         'Input': 'checkbox'
     }
     res['NtfActivityReminder'] = {
         'Type': 'integer',
         'Label': 'Recordatorio de Actividad ',
         'Input': 'checkbox'
     }
     res['NtfReminderDays'] = {
         'Type': 'integer',
         'Label': 'Días de Antelación para Recordatorio',
         'Input': 'integer'
     }
     res['NtfReminderHours'] = {
         'Type': 'integer',
         'Label': 'Horas de Antelación para Recordatorio',
         'Input': 'integer'
     }
     res['NtfActivityConfirm'] = {
         'Type': 'integer',
         'Label': 'Actividad Confirmada',
         'Input': 'checkbox'
     }
     res['NtfActivityNewCust'] = {
         'Type': 'integer',
         'Label': 'Nuevos Clientes',
         'Input': 'checkbox',
         'Level': [0, 1, 2],
         'ShowIf': ['UserType', ["0", "1", "2"], -1]
     }
     res['Closed'] = {
         'Type': 'integer',
         'Label': 'Cerrado',
         'Input': 'checkbox',
         'Level': [0]
     }
     res['CreatedDate'] = {'Type': 'date', 'Hidde': True}
     return res