Ejemplo n.º 1
0
def print_servicio(request, id):
    id = int(id)
    servicio = Ordenes_de_servicio.objects.get(pk=id)
    nombre = "%s|%s" % (servicio.cotizacion.contacto.cliente.nombre, servicio.id)
    response = HttpResponse(content_type="application/pdf")
    response["Content-Disposition"] = 'filename="%s.pdf"' % nombre

    buffer = BytesIO()

    reporte = Impresion(buffer, "Letter")
    reporte.doc.topMargin = 100
    reporte.doc.leftMargin = 72

    pdf = reporte.print_servicio(id=id)
    response.write(pdf)

    return response
Ejemplo n.º 2
0
def print_servicio(request, id):
    id = int(id)
    servicio = Ordenes_de_servicio.objects.get(pk=id)
    nombre = '%s|%s' % (servicio.cotizacion.contacto.cliente.nombre,
                        servicio.id)
    response = HttpResponse(content_type='application/pdf')
    response['Content-Disposition'] = 'filename="%s.pdf"' % nombre

    buffer = BytesIO()

    reporte = Impresion(buffer, 'Letter')
    reporte.doc.topMargin = 100
    reporte.doc.leftMargin = 72

    pdf = reporte.print_servicio(id=id)
    response.write(pdf)

    return response
Ejemplo n.º 3
0
def print_factura(request, id):
    id = int(id)
    print id
    factura = Factura.objects.get(pk=id)
    nombre = "Factura-%s|%s" % (factura.id, factura.fecha)
    print nombre
    response = HttpResponse(content_type="application/pdf")
    response["Content-Disposition"] = 'filename="%s.pdf"' % nombre

    buffer = BytesIO()

    reporte = Impresion(buffer, "Letter")
    reporte.doc.topMargin = 100
    reporte.doc.leftMargin = 40

    pdf = reporte.print_factura(id=id)
    response.write(pdf)

    return response
Ejemplo n.º 4
0
def print_factura(request, id):
    id = int(id)
    print id
    factura = Factura.objects.get(pk=id)
    nombre = 'Factura-%s|%s' % (factura.id, factura.fecha)
    print nombre
    response = HttpResponse(content_type='application/pdf')
    response['Content-Disposition'] = 'filename="%s.pdf"' % nombre

    buffer = BytesIO()

    reporte = Impresion(buffer, 'Letter')
    reporte.doc.topMargin = 100
    reporte.doc.leftMargin = 40

    pdf = reporte.print_factura(id=id)
    response.write(pdf)

    return response
Ejemplo n.º 5
0
def print_cotizacion(request, id):
    # Create the HttpResponse object with the appropriate PDF headers.
    id = int(id)
    cotizacion = Cotizacion.objects.get(pk=id)
    nombre = '%s|%s-%s%s%s' % (cotizacion.contacto.nombre, cotizacion.id * 10 +
                               80000, cotizacion.fecha.month / 10,
                               cotizacion.fecha.month % 10,
                               cotizacion.fecha.year - 2000)
    response = HttpResponse(content_type='application/pdf')
    response['Content-Disposition'] = 'filename="%s.pdf"' % nombre

    buffer = BytesIO()

    reporte = Impresion(buffer, 'Letter')
    print id
    pdf = reporte.print_cotizaciones(id=id)

    response.write(pdf)

    return response
Ejemplo n.º 6
0
def print_cotizacion(request, id):
    # Create the HttpResponse object with the appropriate PDF headers.
    id = int(id)
    cotizacion = Cotizacion.objects.get(pk=id)
    nombre = "%s|%s-%s%s%s" % (
        cotizacion.contacto.nombre,
        cotizacion.id * 10 + 80000,
        cotizacion.fecha.month / 10,
        cotizacion.fecha.month % 10,
        cotizacion.fecha.year - 2000,
    )
    response = HttpResponse(content_type="application/pdf")
    response["Content-Disposition"] = 'filename="%s.pdf"' % nombre

    buffer = BytesIO()

    reporte = Impresion(buffer, "Letter")
    print id
    pdf = reporte.print_cotizaciones(id=id)

    response.write(pdf)

    return response