order create
This commit is contained in:
@@ -259,15 +259,23 @@ const OrderPage = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const order_products = cartItems.map((item) => ({
|
const order_products = cartItems
|
||||||
inventory_kind: 'G',
|
.filter(
|
||||||
product_code: item.product.code,
|
(item) =>
|
||||||
on_balance: 'Y',
|
item.product.prices &&
|
||||||
order_quant: item.quantity,
|
item.product.prices.length > 0 &&
|
||||||
price_type_code: item.product.prices?.[0]?.price_type?.code,
|
item.product.prices[0].price_type?.code &&
|
||||||
product_price: item.product.prices?.[0]?.price,
|
item.product.prices[0].price,
|
||||||
warehouse_code: 'wh1',
|
)
|
||||||
}));
|
.map((item) => ({
|
||||||
|
inventory_kind: 'G',
|
||||||
|
product_code: item.product.code,
|
||||||
|
on_balance: 'Y',
|
||||||
|
order_quant: item.quantity,
|
||||||
|
price_type_code: item.product.prices![0].price_type.code,
|
||||||
|
product_price: item.product.prices![0].price,
|
||||||
|
warehouse_code: 'wh1',
|
||||||
|
}));
|
||||||
|
|
||||||
mutate({
|
mutate({
|
||||||
order: [
|
order: [
|
||||||
@@ -283,6 +291,7 @@ const OrderPage = () => {
|
|||||||
currency_code: '860',
|
currency_code: '860',
|
||||||
owner_person_code: '1234567',
|
owner_person_code: '1234567',
|
||||||
note: value.comment,
|
note: value.comment,
|
||||||
|
|
||||||
order_products: order_products,
|
order_products: order_products,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user