CARGA
CARGA
This commit is contained in:
0
bitacora/__init__.py
Normal file
0
bitacora/__init__.py
Normal file
BIN
bitacora/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
bitacora/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/__init__.cpython-39.pyc
Normal file
BIN
bitacora/__pycache__/__init__.cpython-39.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/admin.cpython-310.pyc
Normal file
BIN
bitacora/__pycache__/admin.cpython-310.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/admin.cpython-39.pyc
Normal file
BIN
bitacora/__pycache__/admin.cpython-39.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/apps.cpython-310.pyc
Normal file
BIN
bitacora/__pycache__/apps.cpython-310.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/apps.cpython-39.pyc
Normal file
BIN
bitacora/__pycache__/apps.cpython-39.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/forms.cpython-310.pyc
Normal file
BIN
bitacora/__pycache__/forms.cpython-310.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/forms.cpython-39.pyc
Normal file
BIN
bitacora/__pycache__/forms.cpython-39.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/models.cpython-310.pyc
Normal file
BIN
bitacora/__pycache__/models.cpython-310.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/models.cpython-39.pyc
Normal file
BIN
bitacora/__pycache__/models.cpython-39.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/views.cpython-310.pyc
Normal file
BIN
bitacora/__pycache__/views.cpython-310.pyc
Normal file
Binary file not shown.
BIN
bitacora/__pycache__/views.cpython-39.pyc
Normal file
BIN
bitacora/__pycache__/views.cpython-39.pyc
Normal file
Binary file not shown.
5
bitacora/admin.py
Normal file
5
bitacora/admin.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from django.contrib import admin
|
||||
from .models import bitreporte
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(bitreporte)
|
||||
6
bitacora/apps.py
Normal file
6
bitacora/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class BitacoraConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'bitacora'
|
||||
26
bitacora/forms.py
Normal file
26
bitacora/forms.py
Normal file
@@ -0,0 +1,26 @@
|
||||
from django import forms
|
||||
from .models import bitreporte
|
||||
|
||||
|
||||
class FormBitReporte(forms.ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(FormBitReporte, self).__init__(*args, **kwargs)
|
||||
self.fields['n_year'].widget.attrs['readonly'] = True
|
||||
self.fields['hora'].widget.attrs['readonly'] = True
|
||||
|
||||
class Meta:
|
||||
model = bitreporte
|
||||
fields = ('n_reporte', 'n_year', 'area', 'reporte', 'quien_reporta', 'asignado', 'recibido_por', 'hora', 'pendiente', 'control_bit')
|
||||
|
||||
|
||||
class FormBitReporteEnv(forms.ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(FormBitReporteEnv, self).__init__(*args, **kwargs)
|
||||
|
||||
class Meta:
|
||||
model = bitreporte
|
||||
fields = ('area', 'reporte', 'quien_reporta', 'asignado', 'recibido_por')
|
||||
|
||||
|
||||
|
||||
|
||||
38
bitacora/migrations/0001_initial.py
Normal file
38
bitacora/migrations/0001_initial.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# Generated by Django 3.2.7 on 2021-10-08 10:08
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
('inventarioalmacen', '0008_alter_equipo_options'),
|
||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='bitreporte',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('n_reporte', models.IntegerField(verbose_name='No. Reporte')),
|
||||
('fecha', models.DateField(auto_now_add=True, verbose_name='Fecha')),
|
||||
('reporte', models.CharField(max_length=250, verbose_name='Reporte')),
|
||||
('quien_reporta', models.CharField(max_length=250, verbose_name='Quien Reporta')),
|
||||
('realizado', models.CharField(max_length=250, unique=True, verbose_name='Realizado')),
|
||||
('pendiente', models.CharField(choices=[('Realizado', 'Realizado'), ('Pendiente', 'Pendiente')], default='Pendiente', max_length=20, verbose_name='Pendiente')),
|
||||
('area', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventarioalmacen.area', verbose_name='Area')),
|
||||
('asignado', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Asignado', to=settings.AUTH_USER_MODEL, verbose_name='Asignado A')),
|
||||
('recibido_por', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Recibio', to=settings.AUTH_USER_MODEL, verbose_name='Recibido Por')),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Bitacora Reporte',
|
||||
'verbose_name_plural': 'Bitacora Reportes',
|
||||
'ordering': ['-id'],
|
||||
},
|
||||
),
|
||||
]
|
||||
28
bitacora/migrations/0002_auto_20211008_0528.py
Normal file
28
bitacora/migrations/0002_auto_20211008_0528.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 3.2.7 on 2021-10-08 10:28
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bitacora', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='bitreporte',
|
||||
name='hora',
|
||||
field=models.CharField(default='05:28:00', max_length=50, verbose_name='05:28:00'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='bitreporte',
|
||||
name='n_year',
|
||||
field=models.CharField(default='21', max_length=4, verbose_name='21'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='bitreporte',
|
||||
name='realizado',
|
||||
field=models.CharField(max_length=250, verbose_name='Realizado'),
|
||||
),
|
||||
]
|
||||
18
bitacora/migrations/0003_alter_bitreporte_hora.py
Normal file
18
bitacora/migrations/0003_alter_bitreporte_hora.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.7 on 2021-10-10 07:03
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bitacora', '0002_auto_20211008_0528'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='bitreporte',
|
||||
name='hora',
|
||||
field=models.CharField(default='02:03:31', max_length=50, verbose_name='02:03:31'),
|
||||
),
|
||||
]
|
||||
23
bitacora/migrations/0004_auto_20211010_0540.py
Normal file
23
bitacora/migrations/0004_auto_20211010_0540.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 3.2.7 on 2021-10-10 10:40
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bitacora', '0003_alter_bitreporte_hora'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='bitreporte',
|
||||
name='hora',
|
||||
field=models.CharField(default='05:40:25', max_length=50, verbose_name='Hora'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='bitreporte',
|
||||
name='n_year',
|
||||
field=models.CharField(max_length=4, verbose_name='Año'),
|
||||
),
|
||||
]
|
||||
18
bitacora/migrations/0005_alter_bitreporte_hora.py
Normal file
18
bitacora/migrations/0005_alter_bitreporte_hora.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.7 on 2021-10-10 21:51
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bitacora', '0004_auto_20211010_0540'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='bitreporte',
|
||||
name='hora',
|
||||
field=models.CharField(max_length=50, verbose_name='Hora'),
|
||||
),
|
||||
]
|
||||
18
bitacora/migrations/0006_bitreporte_control_bit.py
Normal file
18
bitacora/migrations/0006_bitreporte_control_bit.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.8 on 2021-11-04 04:33
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bitacora', '0005_alter_bitreporte_hora'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='bitreporte',
|
||||
name='control_bit',
|
||||
field=models.CharField(blank=True, max_length=250, null=True, verbose_name='Control Bitacora'),
|
||||
),
|
||||
]
|
||||
23
bitacora/migrations/0007_auto_20211105_1526.py
Normal file
23
bitacora/migrations/0007_auto_20211105_1526.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Generated by Django 3.2.7 on 2021-11-05 21:26
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bitacora', '0006_bitreporte_control_bit'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='bitreporte',
|
||||
name='pendiente',
|
||||
field=models.CharField(blank=True, choices=[('Realizado', 'Realizado'), ('Pendiente', 'Pendiente')], default='Pendiente', max_length=20, null=True, verbose_name='Pendiente'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='bitreporte',
|
||||
name='realizado',
|
||||
field=models.CharField(blank=True, max_length=250, null=True, verbose_name='Realizado'),
|
||||
),
|
||||
]
|
||||
18
bitacora/migrations/0008_alter_bitreporte_control_bit.py
Normal file
18
bitacora/migrations/0008_alter_bitreporte_control_bit.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.2.8 on 2021-11-08 08:29
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bitacora', '0007_auto_20211105_1526'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='bitreporte',
|
||||
name='control_bit',
|
||||
field=models.CharField(blank=True, max_length=250, null=True, unique=True, verbose_name='Control Bitacora'),
|
||||
),
|
||||
]
|
||||
18
bitacora/migrations/0009_alter_bitreporte_pendiente.py
Normal file
18
bitacora/migrations/0009_alter_bitreporte_pendiente.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 4.0.2 on 2022-03-10 17:19
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('bitacora', '0008_alter_bitreporte_control_bit'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='bitreporte',
|
||||
name='pendiente',
|
||||
field=models.CharField(blank=True, choices=[('Bitacora', 'Bitacora'), ('Pendiente', 'Pendiente'), ('Realizado', 'Realizado')], default='Bitacora', max_length=20, null=True, verbose_name='Bitacora'),
|
||||
),
|
||||
]
|
||||
0
bitacora/migrations/__init__.py
Normal file
0
bitacora/migrations/__init__.py
Normal file
BIN
bitacora/migrations/__pycache__/0001_initial.cpython-310.pyc
Normal file
BIN
bitacora/migrations/__pycache__/0001_initial.cpython-310.pyc
Normal file
Binary file not shown.
BIN
bitacora/migrations/__pycache__/0001_initial.cpython-39.pyc
Normal file
BIN
bitacora/migrations/__pycache__/0001_initial.cpython-39.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
bitacora/migrations/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
bitacora/migrations/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
bitacora/migrations/__pycache__/__init__.cpython-39.pyc
Normal file
BIN
bitacora/migrations/__pycache__/__init__.cpython-39.pyc
Normal file
Binary file not shown.
36
bitacora/models.py
Normal file
36
bitacora/models.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
import os
|
||||
from tinymce import models as tinymce_models
|
||||
from model_utils import Choices
|
||||
from inventarioalmacen.models import *
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
# Create your models here.
|
||||
|
||||
class bitreporte(models.Model):
|
||||
STATUS = Choices('Bitacora', 'Pendiente', 'Realizado')
|
||||
n_reporte = models.IntegerField(verbose_name='No. Reporte')
|
||||
n_year = models.CharField(max_length=4, null=False, verbose_name='Año')
|
||||
fecha = models.DateField(auto_now_add=True, verbose_name='Fecha')
|
||||
area = models.ForeignKey(area, on_delete=models.CASCADE, null=False, blank=False, verbose_name='Area')
|
||||
reporte = models.CharField(max_length=250, null=False, verbose_name='Reporte')
|
||||
quien_reporta = models.CharField(max_length=250, null=False, verbose_name='Quien Reporta')
|
||||
asignado = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True, related_name='Asignado', verbose_name='Asignado A')
|
||||
recibido_por = models.ForeignKey(User, on_delete=models.CASCADE, null=True, blank=True, related_name='Recibio', verbose_name='Recibido Por')
|
||||
hora = models.CharField(max_length=50, null=False, verbose_name='Hora')
|
||||
realizado = models.CharField(max_length=250, null=True, blank=True, verbose_name='Realizado')
|
||||
pendiente = models.CharField(choices=STATUS, null=True, blank=True, default=STATUS.Bitacora, max_length=20, verbose_name='Bitacora')
|
||||
control_bit = models.CharField(max_length=250, unique=True, null=True, blank=True, verbose_name='Control Bitacora')
|
||||
|
||||
def __str__(self):
|
||||
return str(self.n_reporte)
|
||||
|
||||
class Meta:
|
||||
verbose_name = 'Bitacora Reporte'
|
||||
verbose_name_plural = 'Bitacora Reportes'
|
||||
ordering = ['-id']
|
||||
|
||||
|
||||
|
||||
3
bitacora/tests.py
Normal file
3
bitacora/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
166
bitacora/views.py
Normal file
166
bitacora/views.py
Normal file
@@ -0,0 +1,166 @@
|
||||
from django.shortcuts import render, redirect, get_object_or_404
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.auth.models import User
|
||||
from .models import bitreporte
|
||||
from .forms import FormBitReporte, FormBitReporteEnv
|
||||
from inventarioalmacen.models import area
|
||||
from datetime import datetime
|
||||
import datetime
|
||||
from servicios.models import serviciorealizado, accesorios
|
||||
from openpyxl import Workbook
|
||||
from django.http.response import HttpResponse
|
||||
|
||||
|
||||
date = datetime.datetime.now()
|
||||
year = date.strftime('%y')
|
||||
h = date.strftime("%H:%M:%S")
|
||||
|
||||
# Create your views here.
|
||||
@login_required(login_url='/acceder')
|
||||
def bitacora(request):
|
||||
datos = bitreporte.objects.filter(pendiente='Bitacora')
|
||||
servicios = serviciorealizado.objects.all()
|
||||
usuarios = User.objects.all()
|
||||
accesorio = accesorios.objects.all()
|
||||
return render(request, "bitacora.html", {"datos": datos, "servicios": servicios, "usuarios": usuarios, "accesorio": accesorio})
|
||||
|
||||
|
||||
@login_required(login_url='/acceder')
|
||||
def crear_bitacora(request):
|
||||
if request.method == "POST":
|
||||
form = FormBitReporte(request.POST)
|
||||
if form.is_valid():
|
||||
post = form.save(commit=False)
|
||||
post.save()
|
||||
titulo = form.cleaned_data.get("n_reporte")
|
||||
messages.success(request, f"El reporte {titulo} se ha creado correctamente")
|
||||
return redirect("bitacora")
|
||||
else:
|
||||
for field, items in form.errors.items():
|
||||
for item in items:
|
||||
messages.error(request, '{}: {}'.format(field, item))
|
||||
reporte = bitreporte.objects.latest('id')
|
||||
date = datetime.datetime.now()
|
||||
year = date.strftime('%y')
|
||||
h = date.strftime("%H:%M:%S")
|
||||
dato_rep = reporte.n_reporte + 1
|
||||
dato_year = reporte.n_year
|
||||
if year != dato_year :
|
||||
new_year = year
|
||||
dato_rep = 1
|
||||
hora = h
|
||||
form = FormBitReporteEnv()
|
||||
return render(request, "crear_bitacora.html", {"form": form, "dato_rep":dato_rep, "new_year":new_year, "hora":hora})
|
||||
new_year = dato_year
|
||||
hora = h
|
||||
form = FormBitReporteEnv()
|
||||
return render(request, "crear_bitacora.html", {"form": form, "dato_rep":dato_rep, "new_year":new_year, "hora":hora})
|
||||
|
||||
|
||||
@login_required(login_url='/acceder')
|
||||
def ActualizarBitacora(request, id):
|
||||
instance= get_object_or_404(bitreporte, pk=id)
|
||||
form = FormBitReporte(request.POST or None, instance=instance)
|
||||
context= {'form': form}
|
||||
if form.is_valid():
|
||||
obj= form.save(commit= False)
|
||||
obj.save()
|
||||
messages.success(request, "La Bitacora fue actualizada")
|
||||
return redirect("bitacora")
|
||||
|
||||
else:
|
||||
context= {'form': form, 'error': 'Error al actualizar'}
|
||||
return render(request,'actualizar_bitacora.html' , context)
|
||||
|
||||
|
||||
|
||||
@login_required(login_url='/acceder')
|
||||
def ReporteExcelBitacora(request):
|
||||
bitacoras = bitreporte.objects.all()
|
||||
ibs = User.objects.all()
|
||||
bitareas = area.objects.all()
|
||||
datosservicio = serviciorealizado.objects.all()
|
||||
datosaccesorios = accesorios.objects.all()
|
||||
fecha = datetime.datetime.now()
|
||||
fe = str(fecha)
|
||||
wb = Workbook()
|
||||
ws = wb.active
|
||||
ws['B1'] = 'REPORTE DE SERVICIOS CONCLUIDOS'
|
||||
|
||||
ws.merge_cells('B1:L1')
|
||||
|
||||
ws['B2'] = datetime.datetime.now()
|
||||
|
||||
ws.merge_cells('B2:D2')
|
||||
|
||||
ws['B3'] = 'No. REPORTE'
|
||||
ws['C3'] = 'FECHA'
|
||||
ws['D3'] = 'AREA'
|
||||
ws['E3'] = 'REPORTE'
|
||||
ws['F3'] = 'QUIEN REPORTA'
|
||||
ws['G3'] = 'ASIGNADO'
|
||||
ws['H3'] = 'RECIBIO'
|
||||
ws['I3'] = 'HORA'
|
||||
ws['J3'] = 'SERVICIOS'
|
||||
ws['K3'] = 'ACCESORIOS'
|
||||
|
||||
|
||||
cont = 4
|
||||
|
||||
for bitacora in bitacoras:
|
||||
for ib in ibs:
|
||||
if bitacora.recibido_por_id == ib.id:
|
||||
recibido = ib.username
|
||||
for ib in ibs:
|
||||
if bitacora.asignado_id == ib.id:
|
||||
asignado = ib.username
|
||||
|
||||
for bitarea in bitareas:
|
||||
if bitacora.area_id == bitarea.id:
|
||||
datoarea = bitarea.nombre
|
||||
|
||||
count = 0
|
||||
serreali = ""
|
||||
for datoservicio in datosservicio:
|
||||
if bitacora.control_bit == datoservicio.control_bit:
|
||||
count = count + 1
|
||||
realizado = str(count) + " - " + datoservicio.descripcion
|
||||
serreali = serreali + " // " + realizado
|
||||
if count == 0 :
|
||||
serreali = ""
|
||||
count = 0
|
||||
|
||||
count1 = 0
|
||||
seracce = ""
|
||||
for datoaccesorios in datosaccesorios:
|
||||
if bitacora.control_bit == datoaccesorios.control_bit:
|
||||
count1 = count1 + 1
|
||||
acceso = str(count1) + " - " + datoaccesorios.n_parte + " | " + datoaccesorios.descripcion
|
||||
seracce = seracce + " // " + acceso
|
||||
if count1 == 0 :
|
||||
seracce = ""
|
||||
|
||||
ws.cell(row=cont, column=2).value = bitacora.control_bit
|
||||
ws.cell(row=cont, column=3).value = bitacora.fecha
|
||||
ws.cell(row=cont, column=4).value = datoarea
|
||||
ws.cell(row=cont, column=5).value = bitacora.reporte
|
||||
ws.cell(row=cont, column=6).value = bitacora.quien_reporta
|
||||
ws.cell(row=cont, column=7).value = asignado
|
||||
ws.cell(row=cont, column=8).value = recibido
|
||||
ws.cell(row=cont, column=9).value = bitacora.hora
|
||||
ws.cell(row=cont, column=10).value = serreali
|
||||
ws.cell(row=cont, column=11).value = seracce
|
||||
|
||||
cont += 1
|
||||
serreali = ""
|
||||
seracce = ""
|
||||
|
||||
|
||||
nombre_archivo = "ReporteServicioConcluidos "+fe+".xlsx"
|
||||
response = HttpResponse(content_type="application/ms-excel")
|
||||
content = "attachment; filename = {0}".format(nombre_archivo)
|
||||
response['Content-Disposition'] = content
|
||||
wb.save(response)
|
||||
return response
|
||||
|
||||
Reference in New Issue
Block a user