Exemplo n.º 1
0
Arquivo: views.py Projeto: Arpaso/ETS
def waybill_pdf(request, waybill_pk, queryset, template, print_original=False):
    """Generates PDF version of waybill"""
    waybill = get_object_or_404(queryset, pk = waybill_pk)
    return render_to_pdf(request, template, {
                'print_original': print_original,
                'object': waybill,
                'items': waybill.loading_details.select_related(),
    }, 'waybill-%s' % waybill.pk)
Exemplo n.º 2
0
Arquivo: views.py Projeto: Arpaso/ETS
def waybill_finalize_receipt(request, waybill_pk, template_name, queryset):
    """Signs reception"""
    waybill = get_object_or_404(queryset, pk = waybill_pk)
    waybill.receipt_sign()
    create_logentry(request, waybill, LOGENTRY_SIGN_RECEIVE)
    
    return render_to_pdf(request, template_name, {
                'print_original': True,
                'object': waybill,
                'items': waybill.loading_details.select_related(),
    }, 'waybill-%s' % waybill.pk)
Exemplo n.º 3
0
Arquivo: views.py Projeto: Arpaso/ETS
def waybill_finalize_dispatch(request, waybill_pk, template_name, queryset):
    """
    called when user pushes Print Original on dispatch
    Redirects to order details
    """

    waybill = get_object_or_404(queryset, pk = waybill_pk)
    waybill.dispatch_sign()
    create_logentry(request, waybill, LOGENTRY_SIGN_DISPATCH)
    
    return render_to_pdf(request, template_name, {
                'print_original': True,
                'object': waybill,
                'items': waybill.loading_details.select_related(),
    }, 'waybill-%s' % waybill.pk)