# -*- encoding:UTF-8 -*- from django import forms from django.contrib.auth.models import User from dependencias.models import * from .models import * estadoopcion = (('Bueno', 'Bueno'), ('Malo', 'Malo'),('Regular','Regular'),) estadorecepcion = (('Bueno', 'Bueno'), ('Donacion', 'Donacion'), ('Nuevo', 'Nuevo'),) class BienesForm(forms.ModelForm): descripcion = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'span12'})) marca = forms.CharField(max_length=150, widget=forms.TextInput(attrs={'class': 'span12'})) modelo = forms.CharField(max_length=150, widget=forms.TextInput(attrs={'class': 'span12'})) no_serie = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'span12'})) no_factura = forms.CharField(max_length=150, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) no_inventario_dgtic = forms.CharField(max_length=150, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) no_inventario_oficial = forms.CharField(max_length=150, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) fecha_factura = forms.DateField(required=False, widget=forms.DateInput(attrs={'class': 'span12'})) importe = forms.DecimalField(max_digits=10, decimal_places=2, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) estado = forms.ChoiceField(choices=estadoopcion, widget=forms.Select(attrs={'class': 'span12'})) observaciones = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'span12'})) ubicacion = forms.CharField(max_length=150, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) usuarios = forms.ModelChoiceField(queryset=usuarios.objects.all(), empty_label="Seleccione un Usuario", required=False, widget=forms.Select(attrs={'class': 'span12'})) estatus = forms.ModelChoiceField(queryset=Estatus.objects.filter(id__in=[1, 2, 3, 4, 5, 6, 7,10]), empty_label="Seleccione un Estatus", required=True, widget=forms.Select(attrs={'class': 'span12'})) foto_no_inventario = forms.ImageField(required=False, help_text="Solo deben de usarse fotos en formato .jpg/.jpeg") foto_no_serie = forms.ImageField(required=False, help_text="Solo deben de usarse fotos en formato .jpg/.jpeg") class Meta: model = Bienes fields = [ 'descripcion', 'marca', 'modelo', 'no_serie', 'no_inventario_oficial', 'no_inventario_dgtic', 'no_factura', 'fecha_factura', 'importe', 'estado', 'observaciones', 'ubicacion', 'usuarios', 'estatus', 'externo', 'no_resguardo', 'foto_no_inventario', 'foto_no_serie' ] class BienesDeleteForm(forms.ModelForm): class Meta: model = usuarios exclude = ['descripcion', 'marca', 'modelo', 'no_serie', 'no_inventario_oficial', 'no_inventario_dgtic', 'no_factura', 'fecha_factura', 'importe', 'estado', 'observaciones', 'ubicacion', 'usuarios', 'estatus', 'externo', 'no_resguardo'] class BienesUpdateForm(forms.ModelForm): descripcion = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'span12'})) marca = forms.CharField(max_length=150, widget=forms.TextInput(attrs={'class': 'span12'})) modelo = forms.CharField(max_length=150, widget=forms.TextInput(attrs={'class': 'span12'})) no_serie = forms.CharField(max_length=150, widget=forms.TextInput(attrs={'class': 'span12'})) no_factura = forms.CharField(max_length=150, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) no_inventario_dgtic = forms.CharField(max_length=150, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) no_inventario_oficial = forms.CharField(max_length=150, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) fecha_factura = forms.DateField(required=False, widget=forms.DateInput(attrs={'class': 'span12'})) importe = forms.DecimalField(max_digits=10, decimal_places=2, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) estado = forms.ChoiceField(choices=estadoopcion, widget=forms.Select(attrs={'class': 'span12'})) observaciones = forms.CharField(max_length=200, widget=forms.TextInput(attrs={'class': 'span12'})) ubicacion = forms.CharField(max_length=150, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) usuarios = forms.ModelChoiceField(queryset=usuarios.objects.filter(estatus = 'Activo'), empty_label="Seleccione un Usuario", required=False, widget=forms.Select(attrs={'class': 'span12'})) estatus = forms.ModelChoiceField(queryset=Estatus.objects.filter(id__in=[1, 2, 3, 4, 5, 6, 7, 9,10]), empty_label="Seleccione un Estatus", required=False, widget=forms.Select(attrs={'class': 'span12'})) class Meta: model = Bienes fields = [ 'descripcion', 'marca', 'modelo', 'no_serie', 'no_inventario_oficial', 'no_inventario_dgtic', 'no_factura', 'fecha_factura', 'importe', 'estado', 'observaciones', 'ubicacion', 'usuarios', 'estatus', 'localizado', 'externo', 'no_resguardo', 'foto_no_inventario', 'foto_no_serie' ] class UsuariosForm(forms.ModelForm): nombre = forms.CharField(max_length=60, widget=forms.TextInput(attrs={'class': 'span12'})) apellido_paterno = forms.CharField(max_length=25, widget=forms.TextInput(attrs={'class': 'span12'})) apellido_materno = forms.CharField(max_length=25, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) dependencias = forms.ModelChoiceField(queryset=dependencias.objects.all(), empty_label="Seleccione una Dependencia", widget=forms.Select(attrs={'class': 'span12'})) departamentos = forms.ModelChoiceField(queryset=departamentos.objects.all(), empty_label="Seleccione una Departamento", required=False, widget=forms.Select(attrs={'class': 'span12'})) class Meta: model = usuarios exclude = ['estatus', 'fecha_registro'] class UsuariosUpdateForm(forms.ModelForm): class Meta: model = usuarios exclude = ['nombre', 'apellido_paterno', 'apellido_materno', 'dependencias', 'departamentos', 'cargo', 'estatus' , 'fecha_registro'] class ReporteUsuarioForm(forms.Form): folio = forms.CharField(max_length=150, widget=forms.TextInput(attrs={'class': 'span12'})) firma = forms.ModelChoiceField(label='Firmante: ', queryset=firmas.objects.all(), empty_label="Seleccione un Firmante:", widget=forms.Select(attrs={'class': 'span12'})) usuario = forms.ModelChoiceField(label='Usuarios: ', queryset=usuarios.objects.filter(estatus = 'Activo'), empty_label="Seleccione un Usuario:", widget=forms.Select(attrs={'class': 'span12'})) firma_director = forms.ModelChoiceField(label='Director: ', queryset=firmas.objects.all(), empty_label="Seleccione un Director:", widget=forms.Select(attrs={'class': 'span12'})) estatus = forms.ModelChoiceField(label='Estatus del Bien: ', queryset=Estatus.objects.filter(id__in=[1, 6, 10, 11, 12]), empty_label="Seleccione el Estatus del bien:", widget=forms.Select(attrs={'class': 'span12'})) class ReporteDependenciaForm(forms.Form): dependencias = forms.ModelChoiceField(queryset=dependencias.objects.order_by('nombre'), empty_label="Seleccione una Dependencia", widget=forms.Select(attrs={'class': 'span12'})) class ReporteDepartamentoForm(forms.Form): dependencia = forms.ModelChoiceField(label='Dependencias: ', queryset=dependencias.objects.all(), empty_label="Seleccione una Dependencia", widget=forms.Select(attrs={'class': 'span12'})) departamento = forms.ModelChoiceField(label='Departamentos: ', queryset=departamentos.objects.all(), empty_label="Seleccione una Departamento", widget=forms.Select(attrs={'class': 'span12'})) class FirmasForm(forms.ModelForm): class Meta: model = firmas exclude = ['estatus', 'fecha_registro'] class FirmasUpdateForm(forms.ModelForm): class Meta: model = firmas exclude = ['director', 'estatus', 'fecha_registro'] class ReporteBienForm(forms.Form): folio = forms.CharField(max_length=150, widget=forms.TextInput(attrs={'class': 'span12'})) firmas = forms.ModelChoiceField(label='Firmante: ', queryset=firmas.objects.all(), empty_label="Seleccione una Firmante", required=False, widget=forms.Select(attrs={'class': 'span12'})) bien = forms.ModelChoiceField(label='Bien: ', queryset=Bienes.objects.all(), empty_label="Seleccione una Usuarios", widget=forms.Select(attrs={'class': 'span12'})) class ReporteEstatusForm(forms.Form): estatus = forms.ModelChoiceField(label='Estatus: ', queryset=Estatus.objects.all(), empty_label="Seleccione un estatus", widget=forms.Select(attrs={'class': 'span12'})) class ReporteResguardoForm(forms.Form): folio = forms.CharField(max_length=150, widget=forms.TextInput(attrs={'class': 'span12'})) firma = forms.ModelChoiceField(label='Firmante: ', queryset=firmas.objects.all(), empty_label="Seleccione un Firmante:", required=False, widget=forms.Select(attrs={'class': 'span12'})) no_resguardo = forms.CharField(label="Numero de Resguardo", max_length=150, widget=forms.TextInput(attrs={'class': 'span12'})) firma_director = forms.ModelChoiceField(label='Firmante: ', queryset=firmas.objects.all(), empty_label="Seleccione un Firmante:", widget=forms.Select(attrs={'class': 'span12'})) estatus = forms.ModelChoiceField(label='Estatus del Bien: ', queryset=Estatus.objects.filter(id__in=[1, 6, 10, 11]), empty_label="Seleccione el Estatus del bien:", widget=forms.Select(attrs={'class': 'span12'})) class RecepcionForm(forms.ModelForm): descripcion = forms.CharField(label='Articulo', max_length=200, required=True, widget=forms.TextInput(attrs={'class': 'span12'})) marca = forms.CharField(max_length=150, required=True, widget=forms.TextInput(attrs={'class': 'span12'})) modelo = forms.CharField(max_length=150, required=True, widget=forms.TextInput(attrs={'class': 'span12'})) no_serie = forms.CharField(label='Serie', required=True, max_length=200, widget=forms.TextInput(attrs={'class': 'span12'})) proveedor = forms.CharField(max_length=200, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) fecha_alta = forms.DateField(required=True, widget=forms.DateInput(attrs={'class': 'span12'})) observaciones = forms.CharField(max_length=200, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) art = forms.CharField(label='Art.', max_length=100, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) no_resguardo = forms.CharField(label='Resguardo', max_length=200, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) usuarios = forms.ModelChoiceField(queryset=usuarios.objects.all(), empty_label="Seleccione un Usuario", required=False, widget=forms.Select(attrs={'class': 'span12'})) estado = forms.ChoiceField(choices=estadorecepcion, widget=forms.Select(attrs={'class': 'span12'})) estatus = forms.ModelChoiceField(queryset=Estatus.objects.filter(id=8), empty_label="Seleccione un Estatus", required=True, widget=forms.Select(attrs={'class': 'span12'})) class Meta: model = Bienes fields = [ 'descripcion', 'marca', 'modelo', 'no_serie', 'proveedor', 'fecha_alta', 'observaciones', 'art', 'no_resguardo', 'usuarios', 'estado', 'estatus' ] class RecepcionUpdateForm(forms.ModelForm): descripcion = forms.CharField(label='Articulo', max_length=200, required=True, widget=forms.TextInput(attrs={'class': 'span12'})) marca = forms.CharField(max_length=150, required=True, widget=forms.TextInput(attrs={'class': 'span12'})) modelo = forms.CharField(max_length=150, required=True, widget=forms.TextInput(attrs={'class': 'span12'})) no_serie = forms.CharField(label='Serie', required=True, max_length=200, widget=forms.TextInput(attrs={'class': 'span12'})) proveedor = forms.CharField(max_length=200, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) fecha_alta = forms.DateField(label='Fecha Alta', required=True, widget=forms.DateInput(attrs={'class': 'span12'})) observaciones = forms.CharField(max_length=200, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) art = forms.CharField(label='Art.', max_length=100, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) no_resguardo = forms.CharField(label='Resguardo', max_length=200, required=False, widget=forms.TextInput(attrs={'class': 'span12'})) usuarios = forms.ModelChoiceField(queryset=usuarios.objects.all(), empty_label="Seleccione un Usuario", required=False, widget=forms.Select(attrs={'class': 'span12'})) estado = forms.ChoiceField(choices=estadorecepcion, widget=forms.Select(attrs={'class': 'span12'})) estatus = forms.ModelChoiceField(queryset=Estatus.objects.filter(id__in=[8, 9]), empty_label="Seleccione un Estatus", required=True, widget=forms.Select(attrs={'class': 'span12'})) class Meta: model = Bienes fields = [ 'descripcion', 'marca', 'modelo', 'no_serie', 'proveedor', 'fecha_alta', 'observaciones', 'art', 'no_resguardo', 'usuarios', 'estado', 'estatus' ]