order create
This commit is contained in:
@@ -259,19 +259,15 @@ const OrderPage = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const order_products = [];
|
const order_products = cartItems.map((item) => ({
|
||||||
|
|
||||||
cartItems.forEach((e) => {
|
|
||||||
order_products.push({
|
|
||||||
inventory_kind: 'G',
|
inventory_kind: 'G',
|
||||||
product_code: e.product.code,
|
product_code: item.product.code,
|
||||||
on_balance: 'Y',
|
on_balance: 'Y',
|
||||||
order_quant: e.quantity,
|
order_quant: item.quantity,
|
||||||
price_type_code: e.product.prices[0].price_type.code,
|
price_type_code: item.product.prices?.[0]?.price_type?.code,
|
||||||
product_price: e.product.prices[0].price,
|
product_price: item.product.prices?.[0]?.price,
|
||||||
warehouse_code: 'wh1',
|
warehouse_code: 'wh1',
|
||||||
});
|
}));
|
||||||
});
|
|
||||||
|
|
||||||
mutate({
|
mutate({
|
||||||
order: [
|
order: [
|
||||||
|
|||||||
Reference in New Issue
Block a user