Esempio n. 1
0
def action_plan(request):
    params = {}
    if request.method == "GET":
        if "roNumber" in request.GET:
            roNumber = request.GET.get("roNumber")

            ro = RoServices(request.session["dealer_id"])
            params['service'] = ro.getCustomerServiceRequest(request.GET)
            params['summary'] = ro.getSummaryDetailsByRoNumber(roNumber)
            params['roDetails'] = ro.getROdetails(roNumber)
            params['color'] = ro.getColorForRO(roNumber)
            params['roNumber'] = roNumber
            params['recommendations'] = ro.getInspectionRecommendationSummary(
                roNumber)
            params["inspection"] = ro.getCustomerInspectionRecommendation(
                roNumber)
            params["action_plan"] = "true"
    return render(request, "flagging_app/action_plan.html", params)
Esempio n. 2
0
def action_plan_pdf(request):
    params = {}
    if request.method == "GET":
        if "roNumber" in request.GET:
            roNumber = request.GET.get("roNumber")
            ro = RoServices(request.GET.get("dealer_id"))
            params['service'] = ro.getCustomerServiceRequest(request.GET)
            params['summary'] = ro.getSummaryDetailsByRoNumber(roNumber)
            params['roDetails'] = ro.getROdetails(roNumber)
            params['color'] = ro.getColorForRO(roNumber)
            params['roNumber'] = roNumber
            params['recommendations'] = ro.getInspectionRecommendationSummary(
                roNumber)
            params["inspection"] = ro.getCustomerInspectionRecommendation(
                roNumber)
            params["action_plan"] = "true"
            apt = Appointment.objects.get(ro__ro_number=roNumber)
            first_name = apt.customer.first_name if apt.customer.first_name else " "
            last_name = apt.customer.last_name if apt.customer.last_name else " "
            params["vehicle_vin"] = apt.vehicle.vin_number
            params["customer"] = first_name + " " + last_name
            params["dealer_code"] = Dealer.objects.get(
                id=request.GET.get("dealer_id")).dealer_code
    return render(request, "flagging_app/action_plan_pdf.html", params)