This commit is contained in:
root
2025-12-21 15:14:34 -06:00
commit c04ee70afc
40 changed files with 3048 additions and 0 deletions

0
catalogos/__init__.py Executable file
View File

56
catalogos/admin.py Executable file
View File

@@ -0,0 +1,56 @@
from django.contrib import admin
# Register your models here.
from .models import Banco, Condominio, PeriodoCorte, CuentaContable
#from condominio_san_rafael.procesos import run_acum_san_rafael
#from condominio_santa_maria.procesos import run_acum_santa_maria
@admin.register(CuentaContable)
class CuentaContableAdmin(admin.ModelAdmin):
list_display = ('num_cuenta', 'descripcion')
list_filter = ('num_cuenta',)
@admin.register(Banco)
class BancoAdmin(admin.ModelAdmin):
list_display = ('clave', 'descripcion')
@admin.register(Condominio)
class CondominioAdmin(admin.ModelAdmin):
list_display = ('nombre', 'calle', 'colonia', 'delegacion', 'correo_electronico')
@admin.register(PeriodoCorte)
class PeriodoAdmin(admin.ModelAdmin):
list_display = ('condominio', 'fecha_inicial', 'fecha_final', 'saldo_final')
actions = ['acumulados', 'loadfile']
def acumulados(self, request, queryset):
for obj in queryset:
# field_value = getattr(obj, 'condominio')
print(" genera acumulados %s " % obj.condominio)
shortname = "%s" % obj.condominio
if shortname == "SANRAFAEL":
#run_acum_san_rafael(obj.condominio, shortname)
pass
elif shortname == "SANTAMARIA":
#run_acum_santa_maria(obj.condominio, shortname)
pass
self.message_user(request, " Fin del proceso de generacion de acumulados ")
acumulados.short_description = "Obtiene acumulados"
def loadfile(self, request, queryset):
for obj in queryset:
# field_value = getattr(obj, 'condominio')
#print(" genera acumulados %s " % obj.condominio)
condominio = "%s" % obj.condominio
print(condominio)
break
#self.message_user(request, " Fin del proceso de actualizacion de cuotas ")
loadfile.short_description = "Carga de archivo con movimientos"

5
catalogos/apps.py Executable file
View File

@@ -0,0 +1,5 @@
from django.apps import AppConfig
class CatalogosConfig(AppConfig):
name = 'catalogos'

67
catalogos/models.py Executable file
View File

@@ -0,0 +1,67 @@
from django.db import models
# Create your models here.
class Banco(models.Model):
clave = models.CharField(max_length=3)
descripcion = models.CharField(max_length=25, blank=True, null=True)
def __str__(self):
return '%s %s' % (self.clave, self.descripcion)
class Meta:
managed = True
db_table = 'banco'
class Condominio(models.Model):
nombre = models.CharField(max_length=45)
calle = models.CharField(max_length=45, blank=True, null=True)
colonia = models.CharField(max_length=45, blank=True, null=True)
delegacion = models.CharField(max_length=45, blank=True, null=True)
ciudad = models.CharField(max_length=45, blank=True, null=True)
estado = models.CharField(max_length=45, blank=True, null=True)
cp = models.CharField(max_length=5, blank=True, null=True)
regimen = models.CharField(max_length=45, blank=True, null=True)
rfc = models.CharField(max_length=13, blank=True, null=True)
fecha_constitucion = models.DateField(blank=True, null=True)
correo_electronico = models.CharField(max_length=254, null=True)
def __str__(self):
return '%s' % (self.nombre)
class Meta:
managed = True
db_table = 'condominio'
verbose_name_plural = "Condominios"
class PeriodoCorte(models.Model):
condominio = models.ForeignKey(Condominio, on_delete=models.PROTECT)
fecha_inicial = models.DateField(blank=True, null=True)
saldo_inicial = models.DecimalField(max_digits=12, decimal_places=2, default=0, null=True)
fecha_final = models.DateField(blank=True, null=True)
saldo_final = models.DecimalField(max_digits=12, decimal_places=2, default=0, null=True)
def __str__(self):
return '%s' % (self.condominio)
class Meta:
managed = True
db_table = 'periodo_corte'
verbose_name_plural = "Procesos y fechas de corte"
class CuentaContable(models.Model):
num_cuenta = models.CharField(max_length=20)
descripcion = models.CharField(max_length=100)
clave_mayor = models.CharField(max_length=4)
def __str__(self):
return '%s %s' % (self.num_cuenta, self.descripcion)
class Meta:
managed = True
db_table = 'cuenta_contable'
ordering = ['num_cuenta']
verbose_name_plural = "Cuentas contables"

3
catalogos/tests.py Executable file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

5
catalogos/views.py Executable file
View File

@@ -0,0 +1,5 @@
from django.http import HttpResponseRedirect
def home(request):
return HttpResponseRedirect('/5up3rc4l1fr4ct1c03sp1r4l1d0s0')