def receipt_view(request, pk, _type): types = ['MERCHANT', 'CUSTOMER'] if _type not in types: raise Exception('Unhandled receipt type') receipt = models.Receipt.objects.get(pk=pk) bill_to = settings.BILL_TO[0][1] name = bill_to.split('\n')[0].replace('Inc.', '') address = bill_to.split('\n')[1].replace('.', '') city_province_postal_code = bill_to.split('\n')[2] city_province, postal_code = city_province_postal_code.split(' ') phone = bill_to.split('\n')[4].replace('Phone:', '') return views.render_to_pdf( request, 'clients/pdfs/receipt.html', { 'name': name, 'address': address, 'city_province': city_province, 'postal_code': postal_code, 'phone': phone, 'receipt': receipt, 'receipt_class': models.Receipt, 'type': _type, })
def biomechanical_gait_pdf(request, pk): biomechanical_gait = \ clients_models.BiomechanicalGait.objects.select_related( 'patient', ).get(pk=pk) # return shortcuts.render( # request, # 'clients/pdfs/biomechanical_gait.html', # { # 'title': "Bio-mechanical/Gait Examination", # 'biomechanical_gait': biomechanical_gait, # 'address': settings.BILL_TO[0][1], # 'email': settings.DANNY_EMAIL, # } # ) return clients_views.render_to_pdf( request, 'clients/pdfs/biomechanical_gait.html', { 'title': "Bio-mechanical/Gait Examination", 'biomechanical_gait': biomechanical_gait, 'address': settings.BILL_TO[0][1], 'email': settings.DANNY_EMAIL, } )
def receipt_view(request, pk, _type): types = ['MERCHANT', 'CUSTOMER'] if _type not in types: raise Exception('Unhandled receipt type') receipt = models.Receipt.objects.get(pk=pk) bill_to = settings.BILL_TO[0][1] name = bill_to.split('\n')[0].replace('Inc.', '') address = bill_to.split('\n')[1].replace('.', '') city_province_postal_code = bill_to.split('\n')[2] city_province, postal_code = city_province_postal_code.split(' ') phone = bill_to.split('\n')[4].replace('Phone:', '') return views.render_to_pdf( request, 'clients/pdfs/receipt.html', { 'name': name, 'address': address, 'city_province': city_province, 'postal_code': postal_code, 'phone': phone, 'receipt': receipt, 'receipt_class': models.Receipt, 'type': _type, } )
def old_arrived_date_orders_report(request): return views.render_to_pdf( request, 'clients/pdfs/old_orders.html', { 'title': 'Old Arrived Date Orders Report', 'pagesize': 'A4 landscape', 'orders': _old_arrvied_date_orders(), 'order_class': inventory_models.Order, 'hidden_fields': ['dispensed_date'] })
def overdue_claims_report(request): return views.render_to_pdf( request, 'clients/pdfs/overdue_claims.html', { 'title': 'Overdue Claims Report', 'pagesize': 'A4 landscape', 'overdue_claims': _overdue_claims(), 'claim_class': clients_models.Claim, 'hidden_fields': ['fileset', 'insurance_paid_date'] })
def insurance_stats_report(request): insurances = _insurance_providers_stats(request) return views.render_to_pdf( request, 'clients/pdfs/insurance_stats.html', { 'title': 'Insurance Statistics Report', 'pagesize': 'A4 landscape', 'stats': _stats(), 'insurances': insurances, 'insurances_totals': _insurance_providers_stats_totals(insurances) })
def old_arrived_date_orders_report(request): return views.render_to_pdf( request, 'clients/pdfs/old_orders.html', { 'title': 'Old Arrived Date Orders Report', 'pagesize': 'A4 landscape', 'orders': _old_arrvied_date_orders(), 'order_class': inventory_models.Order, 'hidden_fields': ['dispensed_date'] } )
def overdue_claims_report(request): return views.render_to_pdf( request, 'clients/pdfs/overdue_claims.html', { 'title': 'Overdue Claims Report', 'pagesize': 'A4 landscape', 'overdue_claims': _overdue_claims(), 'claim_class': clients_models.Claim, 'hidden_fields': ['fileset', 'insurance_paid_date'] } )
def insurance_stats_report(request): insurances = _insurance_providers_stats(request) return views.render_to_pdf( request, 'clients/pdfs/insurance_stats.html', { 'title': 'Insurance Statistics Report', 'pagesize': 'A4 landscape', 'stats': _stats(), 'insurances': insurances, 'insurances_totals': _insurance_providers_stats_totals(insurances) } )
def biomechanical_foot_pdf(request, claim_pk): claim, biomechanical_foot = _biomechanical_foot(claim_pk) # return shortcuts.render( # request, # 'clients/pdfs/biomechanical_foot.html', # { # 'title': "Biomechanical Foot Examination", # 'claim': claim, # 'biomechanical_foot': biomechanical_foot, # } # ) return clients_views.render_to_pdf( request, 'clients/pdfs/biomechanical_foot.html', { 'title': "Biomechanical Foot Examination", 'claim': claim, 'biomechanical_foot': biomechanical_foot, })
def biomechanical_foot_pdf(request, claim_pk): claim, biomechanical_foot = _biomechanical_foot(claim_pk) # return shortcuts.render( # request, # 'clients/pdfs/biomechanical_foot.html', # { # 'title': "Biomechanical Foot Examination", # 'claim': claim, # 'biomechanical_foot': biomechanical_foot, # } # ) return clients_views.render_to_pdf( request, 'clients/pdfs/biomechanical_foot.html', { 'title': "Biomechanical Foot Examination", 'claim': claim, 'biomechanical_foot': biomechanical_foot, } )
def biomechanical_gait_pdf(request, pk): biomechanical_gait = \ clients_models.BiomechanicalGait.objects.select_related( 'patient', ).get(pk=pk) # return shortcuts.render( # request, # 'clients/pdfs/biomechanical_gait.html', # { # 'title': "Bio-mechanical/Gait Examination", # 'biomechanical_gait': biomechanical_gait, # 'address': settings.BILL_TO[0][1], # 'email': settings.DANNY_EMAIL, # } # ) return clients_views.render_to_pdf( request, 'clients/pdfs/biomechanical_gait.html', { 'title': "Bio-mechanical/Gait Examination", 'biomechanical_gait': biomechanical_gait, 'address': settings.BILL_TO[0][1], 'email': settings.DANNY_EMAIL, })