fix: fixed price in productServiceEditorModal
This commit is contained in:
@ -18,12 +18,17 @@ const ProductServicesTable: FC<Props> = ({
|
||||
onDuplicateServices,
|
||||
onKitAdd,
|
||||
}) => {
|
||||
const { productServiceCrud } = useFulfillmentBaseContext();
|
||||
const { productServiceCrud, dealProductsList } =
|
||||
useFulfillmentBaseContext();
|
||||
|
||||
const onChange = (item: ProductServiceSchema) => {
|
||||
const excludeServiceIds = dealProduct.productServices.map(
|
||||
productService => productService.service.id
|
||||
);
|
||||
const totalQuantity = dealProductsList.dealProducts.reduce(
|
||||
(sum, prod) => prod.quantity + sum,
|
||||
0
|
||||
);
|
||||
|
||||
modals.openContextModal({
|
||||
modal: "productServiceEditorModal",
|
||||
@ -37,7 +42,7 @@ const ProductServicesTable: FC<Props> = ({
|
||||
values
|
||||
),
|
||||
excludeServiceIds,
|
||||
quantity: dealProduct.quantity,
|
||||
quantity: totalQuantity,
|
||||
isEditing: true,
|
||||
},
|
||||
withCloseButton: false,
|
||||
|
||||
@ -65,7 +65,7 @@ const useProductServicesTableColumns = ({
|
||||
{
|
||||
accessor: "price",
|
||||
title: "Цена",
|
||||
footer: (
|
||||
footer: data.length > 0 && (
|
||||
<Box h={"100%"}>
|
||||
<Text fw={700}>
|
||||
Итог: {totalPrice.toLocaleString("ru")}₽
|
||||
|
||||
Reference in New Issue
Block a user