fix: removed crap, category on service and deal
This commit is contained in:
@@ -130,6 +130,14 @@ class DealService(BaseService):
|
||||
user,
|
||||
deadline=request.acceptance_date,
|
||||
comment=request.comment)
|
||||
# add category if specified
|
||||
if request.category:
|
||||
deal_category = DealPriceCategory(
|
||||
deal_id=deal.id,
|
||||
category_id=request.category.id
|
||||
)
|
||||
self.session.add(deal_category)
|
||||
|
||||
await self.session.commit()
|
||||
return DealQuickCreateResponse(deal_id=deal.id)
|
||||
|
||||
@@ -1004,7 +1012,7 @@ class DealService(BaseService):
|
||||
for product in deal.products:
|
||||
total_one_product = sum((service.price for service in product.services))
|
||||
total = total_one_product * product.quantity
|
||||
totals.append({ "total_one_product": total_one_product, "total": total })
|
||||
totals.append({"total_one_product": total_one_product, "total": total})
|
||||
|
||||
return totals
|
||||
|
||||
|
||||
Reference in New Issue
Block a user