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