Skip to content

Commit

Permalink
Final for sprint 4
Browse files Browse the repository at this point in the history
  • Loading branch information
vinocastello committed Apr 29, 2022
1 parent fe1628a commit 8c3ebad
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ProfitMaximizationTool/profitmaximizer/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,6 @@ def edit_sales_record(request, business_owner):
edit_id = request.POST['edit-sales-record-id']
edit_date = request.POST['edit-sales-record-date']
edit_date = datetime.strptime(edit_date,"%Y-%m-%d").date()
# print(f'edit_date = {edit_date}')

edit_sales_report = {}
for key in request.POST:
Expand All @@ -483,7 +482,6 @@ def edit_sales_record(request, business_owner):
record.update_revenue()
record.update_profit()
record.save()
print(f'successful edit')
prompt = "successful-sales-edit-prompt"
except Exception as e:
print(e)
Expand Down Expand Up @@ -622,7 +620,7 @@ def profit_optimizer_view(request):
n = len(SalesRecord.objects.filter(owner=business_owner))
if n > 0:
avg_sales_products = get_avg_sales(business_owner) # dictionary containing average daily sales for each product
objective_func_coeffs = numpy.array(get_objective_eqn(products_data,avg_sales_products))
objective_func_coeffs = (-1)*numpy.array(get_objective_eqn(products_data,avg_sales_products))
else:
prices = numpy.array([i.price for i in products_data])
costs = numpy.array([i.cost for i in products_data])
Expand Down

0 comments on commit 8c3ebad

Please sign in to comment.