Skip to content

Commit

Permalink
Invoice changes with errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
devenderbutani21 committed May 3, 2024
1 parent 901bfb3 commit ff0ac3a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion backend/views/core/invoices/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ def invoices_dashboard_id(request: HtmxHttpRequest, invoice_id):
Invoice.objects.get(id=invoice_id)
except Invoice.DoesNotExist:
return redirect("invoices:dashboard")

return render(request, "pages/invoices/dashboard/dashboard.html", context)
42 changes: 23 additions & 19 deletions backend/views/core/invoices/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,30 @@ def invoice_get_existing_data(invoice_obj):

client_to = invoice_obj.client_to
if client_to:
stored_data.update({
"to_name": client_to.name,
"to_company": client_to.company,
"is_representative": client_to.representative,
# "to_address": client_to.address,
# "to_city": client_to.city,
# "to_county": client_to.county,
# "to_country": client_to.country
"existing_client": client_to,
})
stored_data.update(
{
"to_name": client_to.name,
"to_company": client_to.company,
"is_representative": client_to.representative,
# "to_address": client_to.address,
# "to_city": client_to.city,
# "to_county": client_to.county,
# "to_country": client_to.country
"existing_client": client_to,
}
)
else:
stored_data.update({
"to_name": invoice_obj.client_name,
"to_company": invoice_obj.client_company,
"to_address": invoice_obj.client_address,
"to_city": invoice_obj.client_city,
"to_county": invoice_obj.client_county,
"to_country": invoice_obj.client_country,
"is_representative": invoice_obj.client_is_representative,
})
stored_data.update(
{
"to_name": invoice_obj.client_name,
"to_company": invoice_obj.client_company,
"to_address": invoice_obj.client_address,
"to_city": invoice_obj.client_city,
"to_county": invoice_obj.client_county,
"to_country": invoice_obj.client_country,
"is_representative": invoice_obj.client_is_representative,
}
)
return stored_data


Expand Down
2 changes: 1 addition & 1 deletion backend/views/core/invoices/manage_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def create_code(request: HtmxHttpRequest, invoice_id):
)


#Function to delete an access code for an invoice
# Function to delete an access code for an invoice
def delete_code(request: HtmxHttpRequest, code):
if request.method != "DELETE" or not request.htmx:
return HttpResponse("Request invalid", status=400)
Expand Down

0 comments on commit ff0ac3a

Please sign in to comment.