umwd-components 0.1.653 → 0.1.655
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ai/{patterns.md → form-patterns.md} +39 -2
- package/dist/src/components/e-commerce/categories/EditCategoryForm.js +1 -1
- package/dist/src/components/e-commerce/invoice/CreateInvoiceForm.js +1 -1
- package/dist/src/components/e-commerce/opo/CreateOpoForm.js +1 -1
- package/dist/src/components/e-commerce/opo/ManageOpoForm.js +1 -1
- package/dist/src/components/e-commerce/opo/TextualManageOpoForm.js +1 -1
- package/dist/src/components/e-commerce/products/AddProductForm.js +1 -1
- package/dist/src/components/e-commerce/products/EditProductForm.js +1 -1
- package/dist/src/components/e-commerce/products/EditStockForm.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/e-commerce/invoice/CreateInvoiceForm.d.ts +2 -1
- package/dist/types/components/e-commerce/products/AddProductForm.d.ts +1 -1
- package/dist/types/components/e-commerce/products/EditProductForm.d.ts +2 -1
- package/dist/types/components/e-commerce/products/EditStockForm.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/e-commerce/categories/CreateCategoryForm.tsx +13 -12
- package/src/components/e-commerce/categories/EditCategoryForm.tsx +13 -20
- package/src/components/e-commerce/invoice/CreateInvoiceForm.tsx +51 -49
- package/src/components/e-commerce/opo/CreateOpoForm.tsx +21 -8
- package/src/components/e-commerce/opo/ManageOpoForm.tsx +11 -6
- package/src/components/e-commerce/opo/TextualManageOpoForm.tsx +12 -13
- package/src/components/e-commerce/products/AddProductForm.tsx +21 -18
- package/src/components/e-commerce/products/EditProductForm.tsx +23 -19
- package/src/components/e-commerce/products/EditStockForm.tsx +31 -31
|
@@ -81,10 +81,8 @@ styling:
|
|
|
81
81
|
```typescript
|
|
82
82
|
<Box
|
|
83
83
|
sx={[
|
|
84
|
-
{ p: 2 },
|
|
85
84
|
...(Array.isArray(sx) ? sx : [sx]),
|
|
86
85
|
]}
|
|
87
|
-
component={Paper}
|
|
88
86
|
>
|
|
89
87
|
```
|
|
90
88
|
|
|
@@ -99,6 +97,45 @@ styling:
|
|
|
99
97
|
4. **Consistent Styling**: Uses consistent Box wrapper with padding and sx prop
|
|
100
98
|
spreading
|
|
101
99
|
|
|
100
|
+
### Form Layout Pattern
|
|
101
|
+
|
|
102
|
+
1. **Title Section**:
|
|
103
|
+
|
|
104
|
+
```typescript
|
|
105
|
+
<Grid item xs={12}>
|
|
106
|
+
<Stack spacing={2}>
|
|
107
|
+
<Typography variant="h3" component={"h1"}>
|
|
108
|
+
Form Title Here
|
|
109
|
+
</Typography>
|
|
110
|
+
</Stack>
|
|
111
|
+
</Grid>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
2. **Action Buttons**:
|
|
115
|
+
|
|
116
|
+
- Place at bottom of form
|
|
117
|
+
- Cancel button is optional (only shown if handleClose provided)
|
|
118
|
+
- Use consistent button layout with space-between
|
|
119
|
+
|
|
120
|
+
```typescript
|
|
121
|
+
<Grid item xs={12}>
|
|
122
|
+
<Stack direction={"row"} justifyContent={"space-between"}>
|
|
123
|
+
{handleClose && (
|
|
124
|
+
<Button onClick={handleClose} variant="outlined">
|
|
125
|
+
Cancel
|
|
126
|
+
</Button>
|
|
127
|
+
)}
|
|
128
|
+
<SubmitButton text="Submit" loadingText="Loading..." variant="contained" />
|
|
129
|
+
</Stack>
|
|
130
|
+
</Grid>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
3. **Messages and Alerts**:
|
|
134
|
+
|
|
135
|
+
- Use Snackbar for all notifications instead of inline Alerts
|
|
136
|
+
- Remove StrapiErrors component as errors are shown in Snackbar
|
|
137
|
+
- Success messages automatically close the form and revalidate data
|
|
138
|
+
|
|
102
139
|
### Example Usage
|
|
103
140
|
|
|
104
141
|
```typescript
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useEffect as a}from"react";import i from"@mui/material/Box";import o from"@mui/material/Stack";import m from"@mui/material/TextField";import n from"@mui/material/Typography";import{SubmitButton as l}from"../../SubmitButton.js";import{useFormState as s}from"react-dom";import{updateCategoryAction as c}from"../../../data/actions/e-commerce/categories/updateCategoryAction.js";import d from"@mui/material/Grid";import u from"../products/ProductSelector.js";import p from"../../common/markdown/MarkdownEditor.js";import{useSnackbar as f}from"../../../context/common/SnackbarContext.js";import{Button as E}from"@mui/material";var v={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function g(g){var y=g.data,x=g.revalidateCallback,b=g.handleClose,j=g.productNamesArray,C=g.sx,h=y.id,k=y.title,A=y.description;y.slug,y.is_archive;var w=y.products,S=(null==w?void 0:w.data)||[],T=e(s(c,v),2),V=T[0],B=T[1],M=f().handleAddMessage;return a((function(){(null==V?void 0:V.message)&&(M({message:V.message,severity:V.severity||"error"}),"success"===V.severity&&(x&&x(),b&&b()))}),[null==V?void 0:V.message]),a((function(){(null==V?void 0:V.strapiErrors)&&M({message:V.strapiErrors.message||"Error updating category",severity:V.severity||"error"})}),[null==V?void 0:V.strapiErrors]),r.createElement(i,{sx:t([],e(Array.isArray(C)?C:[C]),!1)},r.createElement("form",{action:B},h&&r.createElement("input",{id:"id",type:"hidden",name:"id",value:h}),r.createElement(d,{container:!0,spacing:2},r.createElement(d,{item:!0,xs:12},r.createElement(o,{spacing:2},r.createElement(m,{id:"title",name:"title",label:"Title",defaultValue:k}),r.createElement(p,{name:"description",label:"Description",defaultValue:A}))),r.createElement(d,{item:!0,xs:12},r.createElement(n,{variant:"h6"},"Products"),r.createElement(u,{productNames:j,currentValue:t([],e(S.map((function(e){return e.id}))),!1)}))),r.createElement(d,{item:!0,xs:12},r.createElement(o,{direction:"row",justifyContent:"space-between"},b&&r.createElement(E,{onClick:b,variant:"outlined"},"Cancel"),r.createElement(l,{text:"Update category",loadingText:"Loading...",variant:"contained"})))))}export{g as EditCategoryForm};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as n,__assign as t,__awaiter as r,__generator as a}from"../../../../node_modules/tslib/tslib.es6.js";import l,{useState as i,useEffect as o}from"react";import c from"@mui/material/
|
|
7
|
+
import{__read as e,__spreadArray as n,__assign as t,__awaiter as r,__generator as a}from"../../../../node_modules/tslib/tslib.es6.js";import l,{useState as i,useEffect as o}from"react";import c from"@mui/material/Box";import s from"@mui/material/Stack";import m from"@mui/material/Button";import u from"@mui/material/TextField";import d from"@mui/material/Typography";import{SubmitButton as v}from"../../SubmitButton.js";import{useFormState as _}from"react-dom";import{createInvoiceAction as f}from"../../../data/actions/e-commerce/invoices/createInvoiceAction.js";import p from"@mui/material/Grid";import{AddressFields as b}from"../../common/Address.js";import E from"@mui/material/Divider";import{BusinessCredentialsFields as g}from"../customer/BusinessCredentials.js";import{CustomerSelector as y}from"../customer/CustomerSelector.js";import{getSingleCustomer as h}from"../../../data/loaders/e-commerce/getSingleCustomer.js";import C from"@mui/material/Checkbox";import{InvoiceItemFields as x}from"./InvoiceItemFields.js";import{InvoicePDFViewer as k}from"./InvoicePDF.js";import{getPublicInformation as j}from"../../../data/loaders/public-information/getPublicInformation.js";import I from"../../common/markdown/MarkdownEditor.js";import{useSnackbar as w}from"../../../context/common/SnackbarContext.js";var A={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function N(N){var F=this,B=N.customerLabels,R=N.revalidateCallback,S=N.handleClose,T=N.sx,D=e(_(f,A),2),L=D[0],P=D[1],M=w().handleAddMessage,U=e(i(!1),2),z=U[0],G=U[1],V=e(i(!1),2),q=V[0],H=V[1],J=e(i(null),2),K=J[0],O=J[1],Q=e(i(null),2),W=Q[0],X=Q[1];o((function(){(null==L?void 0:L.message)&&(M({message:L.message,severity:L.severity||"error"}),"success"===L.severity&&(R&&R(),S&&S()))}),[null==L?void 0:L.message]),o((function(){(null==L?void 0:L.strapiErrors)&&M({message:L.strapiErrors.message||"Error creating invoice",severity:L.severity||"error"})}),[null==L?void 0:L.strapiErrors]);return o((function(){!function(){r(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return[4,j()];case 1:return e=n.sent(),X((function(n){return t(t({},n),{seller_phone:null==e?void 0:e.phone,seller_email:null==e?void 0:e.email,seller_company_address:null==e?void 0:e.address,seller_business_credentials:null==e?void 0:e.business_credentials})})),[2]}}))}))}()}),[]),l.createElement(c,{sx:n([],e(Array.isArray(T)?T:[T]),!1)},l.createElement("form",{action:P},l.createElement(p,{container:!0,spacing:2},l.createElement(p,{item:!0,xs:12},l.createElement(s,{spacing:2},l.createElement(d,{variant:"h3",component:"h1"},"Create Invoice"),l.createElement(d,{variant:"body2"},"Create a new invoice by selecting a customer or filling in the details manually"))),l.createElement(p,{item:!0,xs:12},l.createElement(d,{variant:"h6"},"Choose a user"),l.createElement(y,{customerLabels:B,onChangeCallback:function(e){return r(F,void 0,void 0,(function(){var n;return a(this,(function(t){switch(t.label){case 0:return 0===e.length?(O(null),[2]):[4,h(e[0])];case 1:return n=t.sent(),O(n),[2]}}))}))}}),l.createElement(d,{variant:"h6"},"Set user details manually"),l.createElement(s,{spacing:2,direction:"row"},l.createElement(u,{name:"buyer_first_name",label:"First Name",value:(null==K?void 0:K.first_name)||(null==W?void 0:W.buyer_first_name)||"",onChange:function(e){X((function(n){return t(t({},n),{buyer_first_name:e.target.value})}))},disabled:null!==K}),l.createElement(u,{name:"buyer_last_name",label:"Last Name",value:(null==K?void 0:K.last_name)||(null==W?void 0:W.buyer_last_name)||"",onChange:function(e){X((function(n){return t(t({},n),{buyer_last_name:e.target.value})}))},disabled:null!==K})),l.createElement(d,{variant:"body2"}),l.createElement(d,{variant:"h6"},"Company Address"),l.createElement(E,null),l.createElement(b,{data:null==K?void 0:K.company_address,componentName:"buyer_company_address",componentReference:"common.address",onChangeCallback:function(e){X((function(n){return t(t({},n),{buyer_company_address:e})}))},disabled:null!==K}),l.createElement(d,{variant:"h6"},"Delivery Address"),l.createElement(E,null),null!==K?l.createElement(l.Fragment,null,null===K.delivery_address?l.createElement(d,{variant:"body2"},"No delivery address on file"):l.createElement(b,{data:null==K?void 0:K.delivery_address,componentName:"buyer_delivery_address",componentReference:"common.address",onChangeCallback:function(e){X((function(n){return t(t({},n),{buyer_delivery_address:e})}))},disabled:null!==K})):l.createElement(l.Fragment,null,l.createElement(s,{direction:"row",spacing:2,alignItems:"center"},l.createElement(C,{value:q,checked:q,onChange:function(){return H(!q)}}),l.createElement(d,null,"Use a different address for delivery")),q&&l.createElement(b,{componentName:"buyer_delivery_address",componentReference:"common.address",onChangeCallback:function(e){X((function(n){return t(t({},n),{buyer_delivery_address:e})}))}})),l.createElement(d,{variant:"h6"},"Billing Address"),l.createElement(E,null),null!==K?l.createElement(l.Fragment,null,null===K.billing_address?l.createElement(d,{variant:"body2"},"No billing address on file"):l.createElement(b,{data:null==K?void 0:K.billing_address,componentName:"buyer_billing_address",componentReference:"common.address",onChangeCallback:function(e){X((function(n){return t(t({},n),{buyer_billing_address:e})}))},disabled:null!==K})):l.createElement(l.Fragment,null,l.createElement(s,{direction:"row",spacing:2,alignItems:"center"},l.createElement(C,{value:z,checked:z,onChange:function(){return G(!z)}}),l.createElement(d,null,"Use a different address for billing")),z&&l.createElement(b,{componentName:"buyer_billing_address",componentReference:"common.address",onChangeCallback:function(e){X((function(n){return t(t({},n),{buyer_billing_address:e})}))}})),l.createElement(d,{variant:"h6"},"Bussiness Credentials"),l.createElement(E,null),l.createElement(g,{data:null==K?void 0:K.business_credentials,componentName:"buyer_business_credentials",componentReference:"business.credentials",onChangeCallback:function(e){X((function(n){return t(t({},n),{buyer_business_credentials:e})}))},disabled:null!==K})),l.createElement(p,{item:!0,xs:12},l.createElement(d,{variant:"h6"},"Invoice Items"),l.createElement(x,{onChangeCallback:function(e){X((function(n){return n?t(t({},n),{items:e.map((function(e){return t(t({},e),{product:"product"in e?e.product:void 0,item_description:"item_description"in e?e.item_description:void 0,price_excl_vat:"price_excl_vat"in e?e.price_excl_vat:0,vat_rate:"vat_rate"in e?e.vat_rate:0,vat:"vat"in e?e.vat:0,price_incl_vat:"price_incl_vat"in e?e.price_incl_vat:0})})),VAT_total:e.reduce((function(e,n){return e+n.price_excl_vat*(n.vat_rate/100)}),0),total_excl_vat:e.reduce((function(e,n){return e+n.price_excl_vat}),0),total_incl_vat:e.reduce((function(e,n){return e+n.price_excl_vat+n.price_excl_vat*(n.vat_rate/100)}),0)}):null}))}})),l.createElement(p,{item:!0,xs:12},l.createElement(d,{variant:"h6"},"Add a Comment"),l.createElement(I,{name:"comments",label:"Comments",onChangeCallback:function(e){return X((function(n){return n?t(t({},n),{comments:e}):null}))}})),l.createElement(p,{item:!0,xs:12},l.createElement(d,{variant:"h6"},"Preview the Invoice"),null!==W&&l.createElement(k,{invoice:W})),l.createElement(p,{item:!0,xs:12},l.createElement(s,{direction:"row",justifyContent:"space-between"},S&&l.createElement(m,{onClick:S,variant:"outlined"},"Cancel"),l.createElement(v,{text:"Create Invoice",loadingText:"Creating...",variant:"contained"}))))))}export{N as CreateInvoiceForm};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as r}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as
|
|
7
|
+
import{__read as e,__spreadArray as r}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as a,useEffect as o}from"react";import{useFormState as n}from"react-dom";import{createOpoAction as i}from"../../../data/actions/e-commerce/opo/createOpoAction.js";import{SubmitButton as m}from"../../SubmitButton.js";import{CustomerSelector as s}from"../customer/CustomerSelector.js";import{OPOItemFields as c}from"./OPOItemFields.js";import{useSnackbar as l}from"../../../context/common/SnackbarContext.js";import u from"@mui/material/Typography";import d from"@mui/material/Grid";import p from"@mui/material/Box";import f from"@mui/material/TextField";import E from"@mui/material/Checkbox";import h from"@mui/material/Stack";import v from"@mui/material/Button";var g={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function y(y){var x=y.sx,C=y.revalidateCallback,b=y.handleClose,w=y.customerLabels,j=y.productLabels,k=e(a(!1),2),A=k[0],I=k[1],L=e(n(i,g),2),O=L[0],S=L[1],B=l().handleAddMessage;return o((function(){(null==O?void 0:O.message)&&(B({message:O.message,severity:O.severity||"error"}),"success"===O.severity&&(C&&C(),b&&b()))}),[null==O?void 0:O.message]),o((function(){(null==O?void 0:O.strapiErrors)&&B({message:O.strapiErrors.message||"Error creating order",severity:O.severity||"error"})}),[null==O?void 0:O.strapiErrors]),t.createElement(p,{sx:r([],e(Array.isArray(x)?x:[x]),!1)},t.createElement("form",{action:S},t.createElement(d,{container:!0,spacing:2},t.createElement(d,{item:!0,xs:12},t.createElement(h,{spacing:2},t.createElement(u,{variant:"h3",component:"h1"},"Create new order"))),t.createElement(d,{item:!0,xs:12},t.createElement(h,{spacing:2},t.createElement(u,{variant:"h6"},"Choose a customer"),t.createElement(s,{customerLabels:w}))),t.createElement(d,{item:!0,xs:12},t.createElement(h,{spacing:2},t.createElement(u,{variant:"h6"},"Customer reference"),t.createElement(u,null,"If the customer utilizes a custom reference for inbound order management it should be left here"),t.createElement(f,{id:"customer_reference",name:"customer_reference",sx:{width:"100%"}}))),t.createElement(d,{item:!0,xs:12},t.createElement(u,{variant:"h6"},"Choose products for this order"),t.createElement(c,{productsArr:j})),t.createElement(d,{item:!0,xs:12},t.createElement(u,{variant:"h6"},"Confirm Order"),t.createElement(u,null,"Are you sure you want to confirm this order? Creating a order this way will not create a shipping label nor will it invoke a payment. It does however create an invoice which you can find under invoices"),t.createElement(h,{direction:"row",spacing:1,alignItems:"center"},t.createElement(E,{value:A,checked:A,onChange:function(){return I(!A)}}),A&&t.createElement(u,{color:"primary"},"I am sure I want to confirm this order")),t.createElement("input",{name:"status",type:"hidden",value:A?"ordered":"placed"})),t.createElement(d,{item:!0,xs:12},t.createElement(h,{direction:"row",justifyContent:"space-between"},b&&t.createElement(v,{onClick:b,variant:"outlined"},"Cancel"),t.createElement(m,{text:"Confirm",loadingText:"Loading...",variant:"contained"}))))))}export{y as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import
|
|
6
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import a,{useState as r,useEffect as n}from"react";import{useFormState as i}from"react-dom";import{updateOpoAction as o}from"../../../data/actions/e-commerce/opo/updateOpoAction.js";import{UploadBase64MediaForm as l}from"../../common/media/UploadBase64MediaForm.js";import m from"../../../data/loaders/common/media/downloadBase64File.js";import c from"./OpoItemUpdater.js";import s from"./OpoItemDisplay.js";import d from"../../logistics/note/NotesDisplay.js";import p from"../../logistics/note/NoteTakingComponent.js";import{SubmitButton as u}from"../../SubmitButton.js";import v from"@mui/material/Alert";import E from"@mui/material/Dialog";import f from"@mui/material/DialogActions";import y from"@mui/material/DialogContent";import g from"@mui/material/DialogTitle";import h from"@mui/material/Typography";import b from"@mui/material/Button";import x from"@mui/material/Grid";import C from"@mui/material/Box";import _ from"@mui/material/Paper";import w from"@mui/material/Stack";import k from"@mui/material/Divider";import{confirmationService as D}from"../../../data/services/common/confirmation-service.js";import{useSnackbar as j}from"../../../context/common/SnackbarContext.js";var O={zodErrors:null,strapiErrors:null,message:null};function q(e){var t=e.open,r=e.handleClose,n=e.orderID,i=e.currentStatus,o=e.revalidateCallback;return a.createElement(E,{open:t},a.createElement(g,null,"Confirm Order"),a.createElement(y,null,a.createElement(w,{spacing:2},a.createElement(h,null,"Are you sure you want to confirm this order?"),a.createElement(h,null,"Current status: ",i))),a.createElement(f,null,a.createElement(b,{variant:"contained",onClick:function(e){D("opos",[n]),o&&o()}},"Confirm"),a.createElement(b,{variant:"contained",onClick:r},"Cancel")))}function N(E){var f,y,g,D,N,A=E.opo,I=E.sx,S=E.revalidateCallback,B=E.handleClose,F=E.role,P=e(i(o,O),2),M=P[0],T=P[1],U=j().handleAddMessage,z=e(r(A.opo_items.data?A.opo_items.data:[]),2),G=z[0],H=z[1],J=e(r(!1),2),L=J[0],Q=J[1],R=function(a,r,n){var i=t([],e(G),!1),o=i.findIndex((function(e){return e.id===r}));i[o][n]=a,H(i)};return n((function(){var e;(null===(e=A.opo_items)||void 0===e?void 0:e.data)&&H(A.opo_items.data)}),[A]),n((function(){(null==M?void 0:M.message)&&(U({message:M.message,severity:M.severity||"error"}),"success"===M.severity&&(S&&S(),B&&B()))}),[null==M?void 0:M.message]),n((function(){(null==M?void 0:M.strapiErrors)&&U({message:M.strapiErrors.message||"Error updating OPO",severity:M.severity||"error"})}),[null==M?void 0:M.strapiErrors]),a.createElement(C,{sx:t([],e(Array.isArray(I)?I:[I]),!1)},a.createElement(x,{container:!0,spacing:2},a.createElement(x,{item:!0,xs:12},a.createElement(w,{spacing:2},a.createElement(w,{direction:"row",spacing:2,justifyContent:"space-between"},a.createElement(w,{spacing:2},a.createElement(h,{variant:"h3",component:"h1"},"Manage Outbound Purchase Order"),a.createElement(h,{variant:"body1"},"Manage picking, packing and shipping of purchase order")),a.createElement(p,{content:"",related:[{id:A.id,__type:"api::e-commerce.opo"}],revalidateCallback:S})),a.createElement(k,null))),a.createElement(x,{item:!0,xs:6},a.createElement(w,{spacing:1},a.createElement(h,{variant:"h5"},"Details"),a.createElement(w,{direction:"row",spacing:2},a.createElement(h,{variant:"body1",width:"250px"},"Purchase Order Number"),a.createElement(h,{variant:"body2"},A.opo_number)),a.createElement(w,{direction:"row",spacing:2},a.createElement(h,{variant:"body1",width:"250px"},"Custom reference"),a.createElement(h,{variant:"body2"},A.customer_reference)),a.createElement(w,{direction:"row",spacing:2},a.createElement(h,{variant:"body1",width:"250px"},"Order Date"),a.createElement(h,{variant:"body2"},A.order_date)),a.createElement(w,{direction:"row",spacing:2},a.createElement(h,{variant:"body1",width:"250px"},"Customer"),a.createElement(h,{variant:"body2"},null===(y=null===(f=A.customer)||void 0===f?void 0:f.business_credentials)||void 0===y?void 0:y.company_name)),a.createElement(w,{direction:"row",spacing:2},a.createElement(h,{variant:"body1",width:"250px"},"Order Status"),a.createElement(h,{variant:"body2",width:"250px"},A.status)),("placed"===A.status||"external_shipping_process"===A.status)&&"enduser"===F&&a.createElement(a.Fragment,null,a.createElement(b,{variant:"contained",color:"primary",onClick:function(){return Q(!0)}},"Confirm order"),a.createElement(v,{severity:"warning"},"Please confirm the order as soon as possible, only upon confirmation this order will be available to the dispatcher"),a.createElement(q,{open:L,handleClose:function(){return Q(!1)},orderID:A.id,currentStatus:A.status,revalidateCallback:S})))),a.createElement(x,{item:!0,xs:12},a.createElement(w,{spacing:2},a.createElement(h,{variant:"h5"},"Documents"),a.createElement(_,{sx:{p:2}},a.createElement(w,{spacing:1},A.delivery_note?a.createElement(a.Fragment,null,a.createElement(h,{variant:"h6"},"Delivery Note"),a.createElement(h,null,null===(g=A.delivery_note)||void 0===g?void 0:g.name),a.createElement(b,{variant:"contained",onClick:function(){m("api/opos/".concat(A.id),"delivery_note")}},"Download")):a.createElement(a.Fragment,null,a.createElement(h,{variant:"h5"},"Delivery Note"),a.createElement(h,{variant:"body1"},"Here you can upload the the delivery note for this order"),a.createElement(k,null),a.createElement(l,{reference:"api::e-commerce.opo",refID:A.id,field:"delivery_note",multiple:!1,accept:"text/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",path:"api/opos",componentName:"delivery_note",componentReference:"common.base64-encoded-media",revalidateCallback:S})))))),(null===(N=null===(D=null==A?void 0:A.notes)||void 0===D?void 0:D.data)||void 0===N?void 0:N.length)>0&&a.createElement(x,{item:!0,xs:12},a.createElement(w,{spacing:2},a.createElement(h,{variant:"h5"},"Notes"),a.createElement(d,{notes:A.notes.data}),a.createElement(k,null))),a.createElement(x,{item:!0,xs:12},a.createElement(w,{spacing:1},a.createElement(h,{variant:"h5"},"Items"),"placed"===A.status&&a.createElement(v,{severity:"warning"},"Before confirmation you cannot update the items"),a.createElement(k,null),a.createElement("form",{action:T},a.createElement("input",{name:"id",type:"hidden",value:A.id}),G&&G.map((function(e,t){var r,n;return console.log("item",e),a.createElement(_,{sx:{p:2,mb:2},key:t},"placed"===A.status?a.createElement(s,{item:e,index:t,image:null===(r=null==e?void 0:e.product)||void 0===r?void 0:r.image}):a.createElement(c,{item:e,index:t,handleUpdateQuantity:R,image:null===(n=null==e?void 0:e.product)||void 0===n?void 0:n.image,revalidateCallback:S}))})),a.createElement(_,{sx:{p:2}},a.createElement(w,{direction:"row",spacing:2,justifyContent:"space-between"},B&&a.createElement(b,{onClick:B,variant:"outlined"},"Cancel"),a.createElement(u,{text:"Update items",loadingText:"Loading..."}))),a.createElement("input",{type:"hidden",name:"items",value:JSON.stringify(function(e){return e.map((function(e){return{id:e.id,ordered_quantity:e.ordered_quantity,picked_quantity:e.picked_quantity,packed_quantity:e.packed_quantity,shipped_quantity:e.shipped_quantity}}))}(G))}))))))}export{N as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__read as e,__spreadArray as t,__assign as n}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as a,useEffect as o}from"react";import{useFormState as i}from"react-dom";import{updateOpoAction as l}from"../../../data/actions/e-commerce/opo/updateOpoAction.js";import{UploadBase64MediaForm as c}from"../../common/media/UploadBase64MediaForm.js";import m from"../../../data/loaders/common/media/downloadBase64File.js";import d from"./TextualOpoItemUpdater.js";import s from"./OpoItemDisplay.js";import u from"../../logistics/note/NotesDisplay.js";import p from"../../logistics/note/NoteTakingComponent.js";import{StrapiErrors as v}from"../../StrapiErrors.js";import{SubmitButton as E}from"../../SubmitButton.js";import f from"@mui/material/Alert";import h from"@mui/material/Dialog";import g from"@mui/material/DialogActions";import y from"@mui/material/DialogContent";import x from"@mui/material/DialogTitle";import b from"@mui/material/Typography";import C from"@mui/material/Button";import k from"@mui/material/Grid";import _ from"@mui/material/Box";import w from"@mui/material/Paper";import I from"@mui/material/Stack";import D from"@mui/material/Divider";import{confirmationService as j}from"../../../data/services/common/confirmation-service.js";import{cancellationService as N}from"../../../data/services/common/cancellation-service.js";import{FormControlLabel as O,Checkbox as q,List as A,ListItem as S,TextField as B}from"@mui/material";import T from"@mui/icons-material/Numbers";import P from"@mui/icons-material/CalendarToday";import U from"@mui/icons-material/Business";import F from"@mui/icons-material/Description";import R from"@mui/icons-material/Update";import{OpoStatusIndicator as W}from"./OpoStatusIndicator.js";var M={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function Y(e){var t=e.open,n=e.handleClose,a=e.orderID,o=e.currentStatus,i=e.revalidateCallback;return r.createElement(h,{open:t},r.createElement(x,null,"Confirm Order"),r.createElement(y,null,r.createElement(I,{spacing:2},r.createElement(b,null,"Are you sure you want to confirm this order?"),r.createElement(b,null,"Current status: ",o))),r.createElement(g,null,r.createElement(C,{variant:"contained",onClick:function(e){j("opos",[a]),i&&i(),n()}},"Yes"),r.createElement(C,{variant:"contained",onClick:n},"No")))}function z(t){var n=t.open,o=t.handleClose,i=t.orderID,l=t.revalidateCallback,c=e(a(""),2),m=c[0],d=c[1],s=e(a(""),2),u=s[0],p=s[1];return r.createElement("form",null,r.createElement(h,{open:n},r.createElement(x,null,"Cancel Return"),r.createElement(y,null,r.createElement(I,{spacing:2},r.createElement(b,null,"Are you sure you want to cancel this order?"),r.createElement(A,null,r.createElement(S,null,"By cancelling this order you will update it's status from ordered to cancelled"),r.createElement(S,null,"Please provide a reason for the cancellation"),r.createElement(S,null,"The customer will be notified about the cancellation and of the reason for the cancellation")),r.createElement(B,{label:"Cancellation reason",name:"reason",multiline:!0,rows:4,fullWidth:!0,variant:"outlined",value:m,onChange:function(e){return d(e.target.value)},placeholder:"Please provide a reason for the cancellation",error:!!u,helperText:u}))),r.createElement(g,null,r.createElement(C,{variant:"contained",onClick:function(e){m.length<5?p("Please provide a reason for the cancellation"):(N("opos",i,m),l&&l(),o())}},"Yes"),r.createElement(C,{variant:"contained",onClick:o},"No"))))}function G(h){var g,y,x,j,N,A=h.opo,S=h.sx,B=h.revalidateCallback;h.handleClose;var G=h.role,H=e(i(l,M),2),J=H[0],L=H[1],Q=e(a(A.opo_items.data?A.opo_items.data:[]),2),K=Q[0],V=Q[1],X=e(a(!1),2),Z=X[0],$=X[1],ee=e(a(!1),2),te=ee[0],ne=ee[1],re=e(a(["picked","packed","shipped","reports"]),2),ae=re[0],oe=re[1],ie=function(n,r,a){var o=t([],e(K),!1),i=o.findIndex((function(e){return e.id===r}));o[i][a]=n,V(o)},le=function(r,a){var o,i,l,c=t([],e(K),!1),m=c.findIndex((function(e){return e.id===a})),d=(null===(i=null===(o=c[m])||void 0===o?void 0:o.reports)||void 0===i?void 0:i.data)||[],s=t(t([],e(d),!1),[r],!1);null==(null===(l=c[m])||void 0===l?void 0:l.reports)&&(c[m]=n(n({},c[m]),{reports:{data:[]}})),c[m].reports.data=s,V(c)},ce=function(n,r){var a,o,i=t([],e(K),!1),l=i.findIndex((function(e){return e.id===n})),c=(null===(o=null===(a=i[l])||void 0===a?void 0:a.reports)||void 0===o?void 0:o.data)||[],m=c.filter((function(e){return"id"in e})),d=c.filter((function(e){return!("id"in e)}));d.splice(r,1);var s=t(t([],e(m),!1),e(d),!1);i[l].reports.data=s,V(i)};return o((function(){"Ipo Updated"===(null==J?void 0:J.message)&&B&&B()}),[J]),o((function(){var e;(null===(e=A.opo_items)||void 0===e?void 0:e.data)&&V(A.opo_items.data?A.opo_items.data:[])}),[A]),r.createElement(_,{sx:t([{p:2}],e(Array.isArray(S)?S:[S]),!1),component:w},r.createElement(k,{container:!0,spacing:2},r.createElement(k,{item:!0,xs:12},r.createElement(I,{spacing:2},r.createElement(I,{direction:"row",spacing:2,justifyContent:"space-between"},r.createElement(I,{spacing:2},r.createElement(b,{variant:"h3",component:"h1"},"Management Outbound Purchase Order"),r.createElement(b,{variant:"body1"},"Manage picking, packing and shipping of purchase order")),r.createElement(p,{content:"",related:[{id:A.id,__type:"api::e-commerce.opo"}],revalidateCallback:B})),r.createElement(D,null))),r.createElement(k,{item:!0,xs:12},r.createElement(b,{variant:"h5",sx:{py:1}},"Details")),r.createElement(k,{item:!0,xs:6},r.createElement(w,{elevation:2,sx:{p:2,height:"100%"}},r.createElement(I,{spacing:2},r.createElement(I,{direction:"row",spacing:2,alignItems:"center"},r.createElement(T,{color:"primary"}),r.createElement(b,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Purchase Order Number"),r.createElement(b,{variant:"body1",fontWeight:"medium"},A.opo_number)),r.createElement(I,{direction:"row",spacing:2,alignItems:"center"},r.createElement(F,{color:"primary"}),r.createElement(b,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Custom reference"),r.createElement(b,{variant:"body1",fontWeight:"medium"},A.customer_reference)),r.createElement(I,{direction:"row",spacing:2,alignItems:"center"},r.createElement(P,{color:"primary"}),r.createElement(b,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Order Date"),r.createElement(b,{variant:"body1",fontWeight:"medium"},A.order_date)),r.createElement(I,{direction:"row",spacing:2,alignItems:"center"},r.createElement(U,{color:"primary"}),r.createElement(b,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Customer"),r.createElement(b,{variant:"body1",fontWeight:"medium"},null===(y=null===(g=A.customer)||void 0===g?void 0:g.business_credentials)||void 0===y?void 0:y.company_name)),r.createElement(I,{direction:"row",spacing:2,alignItems:"center"},r.createElement(R,{color:"primary"}),r.createElement(b,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Order Status"),r.createElement(W,{status:A.status}))))),"enduser"===G&&r.createElement(k,{item:!0,xs:6},r.createElement(w,{elevation:2,sx:{p:2,height:"100%"}},r.createElement(I,{spacing:2},("placed"===A.status||"external_shipping_process"===A.status)&&r.createElement(r.Fragment,null,r.createElement(C,{variant:"contained",color:"primary",onClick:function(){return $(!0)}},"Confirm order"),r.createElement(f,{severity:"warning"},"Please confirm the order as soon as possible, only upon confirmation this order will be available to the dispatcher"),r.createElement(Y,{open:Z,handleClose:function(){return $(!1)},orderID:A.id,currentStatus:A.status,revalidateCallback:B})),("placed"===A.status||"ordered"===A.status)&&r.createElement(r.Fragment,null,r.createElement(C,{variant:"contained",color:"error",onClick:function(){return ne(!0)}},"Cancel order"),r.createElement(z,{open:te,handleClose:function(){return ne(!1)},orderID:A.id,revalidateCallback:B}))))),r.createElement(k,{item:!0,xs:12},r.createElement(I,{spacing:2},r.createElement(b,{variant:"h5"},"Documents"),r.createElement(w,{sx:{p:2}},r.createElement(I,{spacing:1},A.delivery_note?r.createElement(r.Fragment,null,r.createElement(b,{variant:"h6"},"Delivery Note"),r.createElement(b,null,null===(x=A.delivery_note)||void 0===x?void 0:x.name),r.createElement(C,{variant:"contained",onClick:function(){m("api/ipos/".concat(A.id),"delivery_note")}},"Download")):r.createElement(r.Fragment,null,r.createElement(b,{variant:"h5"},"Delivery Note"),r.createElement(b,{variant:"body1"},"Here you can upload the the delivery note for this order"),r.createElement(D,null),r.createElement(c,{reference:"api::e-commerce.opo",refID:A.id,field:"delivery_note",multiple:!1,accept:"text/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",path:"api/ipos",componentName:"delivery_note",componentReference:"common.base64-encoded-media",revalidateCallback:B})))))),(null===(N=null===(j=null==A?void 0:A.notes)||void 0===j?void 0:j.data)||void 0===N?void 0:N.length)>0&&r.createElement(k,{item:!0,xs:12},r.createElement(I,{spacing:2},r.createElement(b,{variant:"h5"},"Notes"),r.createElement(u,{notes:A.notes.data}),r.createElement(D,null))),r.createElement(k,{item:!0,xs:12},r.createElement(I,{spacing:1},r.createElement(b,{variant:"h5"},"Items"),r.createElement(I,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:2,component:w,p:1},r.createElement(b,{variant:"body1"},"Show:"),["picked","packed","shipped","reports"].map((function(n){return r.createElement(O,{key:n,control:r.createElement(q,{checked:ae.includes(n),onChange:function(r){r.target.checked?oe(t(t([],e(ae),!1),[n],!1)):oe(ae.filter((function(e){return e!==n})))}}),label:n.charAt(0).toUpperCase()+n.slice(1)})}))),"placed"===A.status&&r.createElement(f,{severity:"warning"},"Before confirmation you cannot update the items"),r.createElement(D,null),r.createElement("form",{action:L},r.createElement("input",{name:"id",type:"hidden",value:A.id}),K&&K.map((function(e,t){var n,a;return r.createElement(w,{sx:{p:2,mb:2},key:t},"placed"===A.status||"external_shipping_process"===A.status||"done"===A.status||"cancelled"===A.status?r.createElement(s,{item:e,index:t,image:null===(n=null==e?void 0:e.product)||void 0===n?void 0:n.image}):r.createElement(d,{item:e,index:t,handleUpdateQuantity:ie,handleAddReport:le,image:null===(a=null==e?void 0:e.product)||void 0===a?void 0:a.image,handleRemoveReportAtIndex:ce,revalidateCallback:B,showing:ae}))})),r.createElement(w,{sx:{p:2}},r.createElement(I,{direction:"row",spacing:2,justifyContent:"end"},r.createElement(E,{text:"Update items",loadingText:"Loading..."}),r.createElement(v,{error:null==J?void 0:J.strapiErrors}),(null==J?void 0:J.message)&&r.createElement(f,{severity:"error"},null==J?void 0:J.message))),r.createElement("input",{type:"hidden",name:"items",value:JSON.stringify(function(e){return e.map((function(e){var t,n;return{id:e.id,ordered_quantity:e.ordered_quantity,picked_quantity:e.picked_quantity,packed_quantity:e.packed_quantity,shipped_quantity:e.shipped_quantity,reports:(null===(n=null===(t=e.reports)||void 0===t?void 0:t.data)||void 0===n?void 0:n.map((function(e){return{id:"id"in e?e.id:void 0,quantity:e.quantity,content:e.content,type:e.type}})))||[]}}))}(K))}))))))}export{G as default};
|
|
6
|
+
import{__read as e,__spreadArray as t,__assign as n}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as a,useEffect as i}from"react";import{useFormState as o}from"react-dom";import{updateOpoAction as l}from"../../../data/actions/e-commerce/opo/updateOpoAction.js";import{UploadBase64MediaForm as c}from"../../common/media/UploadBase64MediaForm.js";import m from"../../../data/loaders/common/media/downloadBase64File.js";import d from"./TextualOpoItemUpdater.js";import s from"./OpoItemDisplay.js";import u from"../../logistics/note/NotesDisplay.js";import p from"../../logistics/note/NoteTakingComponent.js";import v from"@mui/material/Alert";import E from"@mui/material/Dialog";import f from"@mui/material/DialogActions";import h from"@mui/material/DialogContent";import g from"@mui/material/DialogTitle";import y from"@mui/material/Typography";import x from"@mui/material/Button";import b from"@mui/material/Grid";import C from"@mui/material/Box";import k from"@mui/material/Paper";import _ from"@mui/material/Stack";import w from"@mui/material/Divider";import{confirmationService as I}from"../../../data/services/common/confirmation-service.js";import{cancellationService as D}from"../../../data/services/common/cancellation-service.js";import{FormControlLabel as j,Checkbox as N,List as O,ListItem as q,TextField as A}from"@mui/material";import B from"@mui/icons-material/Numbers";import S from"@mui/icons-material/CalendarToday";import T from"@mui/icons-material/Business";import P from"@mui/icons-material/Description";import U from"@mui/icons-material/Update";import{OpoStatusIndicator as F}from"./OpoStatusIndicator.js";import{SubmitButton as R}from"../../SubmitButton.js";var W={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function M(e){var t=e.open,n=e.handleClose,a=e.orderID,i=e.currentStatus,o=e.revalidateCallback;return r.createElement(E,{open:t},r.createElement(g,null,"Confirm Order"),r.createElement(h,null,r.createElement(_,{spacing:2},r.createElement(y,null,"Are you sure you want to confirm this order?"),r.createElement(y,null,"Current status: ",i))),r.createElement(f,null,r.createElement(x,{variant:"contained",onClick:function(e){I("opos",[a]),o&&o(),n()}},"Yes"),r.createElement(x,{variant:"contained",onClick:n},"No")))}function Y(t){var n=t.open,i=t.handleClose,o=t.orderID,l=t.revalidateCallback,c=e(a(""),2),m=c[0],d=c[1],s=e(a(""),2),u=s[0],p=s[1];return r.createElement("form",null,r.createElement(E,{open:n},r.createElement(g,null,"Cancel Return"),r.createElement(h,null,r.createElement(_,{spacing:2},r.createElement(y,null,"Are you sure you want to cancel this order?"),r.createElement(O,null,r.createElement(q,null,"By cancelling this order you will update it's status from ordered to cancelled"),r.createElement(q,null,"Please provide a reason for the cancellation"),r.createElement(q,null,"The customer will be notified about the cancellation and of the reason for the cancellation")),r.createElement(A,{label:"Cancellation reason",name:"reason",multiline:!0,rows:4,fullWidth:!0,variant:"outlined",value:m,onChange:function(e){return d(e.target.value)},placeholder:"Please provide a reason for the cancellation",error:!!u,helperText:u}))),r.createElement(f,null,r.createElement(x,{variant:"contained",onClick:function(e){m.length<5?p("Please provide a reason for the cancellation"):(D("opos",o,m),l&&l(),i())}},"Yes"),r.createElement(x,{variant:"contained",onClick:i},"No"))))}function z(E){var f,h,g,I,D,O=E.opo,q=E.sx,A=E.revalidateCallback;E.handleClose;var z=E.role,G=l.bind(O.id),H=e(o(G,W),2),J=H[0],L=H[1],Q=e(a(O.opo_items.data?O.opo_items.data:[]),2),K=Q[0],V=Q[1],X=e(a(!1),2),Z=X[0],$=X[1],ee=e(a(!1),2),te=ee[0],ne=ee[1],re=e(a(["picked","packed","shipped","reports"]),2),ae=re[0],ie=re[1],oe=function(n,r,a){var i=t([],e(K),!1),o=i.findIndex((function(e){return e.id===r}));i[o][a]=n,V(i)},le=function(r,a){var i,o,l,c=t([],e(K),!1),m=c.findIndex((function(e){return e.id===a})),d=(null===(o=null===(i=c[m])||void 0===i?void 0:i.reports)||void 0===o?void 0:o.data)||[],s=t(t([],e(d),!1),[r],!1);null==(null===(l=c[m])||void 0===l?void 0:l.reports)&&(c[m]=n(n({},c[m]),{reports:{data:[]}})),c[m].reports.data=s,V(c)},ce=function(n,r){var a,i,o=t([],e(K),!1),l=o.findIndex((function(e){return e.id===n})),c=(null===(i=null===(a=o[l])||void 0===a?void 0:a.reports)||void 0===i?void 0:i.data)||[],m=c.filter((function(e){return"id"in e})),d=c.filter((function(e){return!("id"in e)}));d.splice(r,1);var s=t(t([],e(m),!1),e(d),!1);o[l].reports.data=s,V(o)};return i((function(){"Ipo Updated"===(null==J?void 0:J.message)&&A&&A()}),[J]),i((function(){var e;(null===(e=O.opo_items)||void 0===e?void 0:e.data)&&V(O.opo_items.data?O.opo_items.data:[])}),[O]),r.createElement(C,{sx:t([{p:2}],e(Array.isArray(q)?q:[q]),!1),component:k},r.createElement(b,{container:!0,spacing:2},r.createElement(b,{item:!0,xs:12},r.createElement(_,{spacing:2},r.createElement(_,{direction:"row",spacing:2,justifyContent:"space-between"},r.createElement(_,{spacing:2},r.createElement(y,{variant:"h3",component:"h1"},"Management Outbound Purchase Order"),r.createElement(y,{variant:"body1"},"Manage picking, packing and shipping of purchase order")),r.createElement(p,{content:"",related:[{id:O.id,__type:"api::e-commerce.opo"}],revalidateCallback:A})),r.createElement(w,null))),r.createElement(b,{item:!0,xs:12},r.createElement(y,{variant:"h5",sx:{py:1}},"Details")),r.createElement(b,{item:!0,xs:6},r.createElement(k,{elevation:2,sx:{p:2,height:"100%"}},r.createElement(_,{spacing:2},r.createElement(_,{direction:"row",spacing:2,alignItems:"center"},r.createElement(B,{color:"primary"}),r.createElement(y,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Purchase Order Number"),r.createElement(y,{variant:"body1",fontWeight:"medium"},O.opo_number)),r.createElement(_,{direction:"row",spacing:2,alignItems:"center"},r.createElement(P,{color:"primary"}),r.createElement(y,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Custom reference"),r.createElement(y,{variant:"body1",fontWeight:"medium"},O.customer_reference)),r.createElement(_,{direction:"row",spacing:2,alignItems:"center"},r.createElement(S,{color:"primary"}),r.createElement(y,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Order Date"),r.createElement(y,{variant:"body1",fontWeight:"medium"},O.order_date)),r.createElement(_,{direction:"row",spacing:2,alignItems:"center"},r.createElement(T,{color:"primary"}),r.createElement(y,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Customer"),r.createElement(y,{variant:"body1",fontWeight:"medium"},null===(h=null===(f=O.customer)||void 0===f?void 0:f.business_credentials)||void 0===h?void 0:h.company_name)),r.createElement(_,{direction:"row",spacing:2,alignItems:"center"},r.createElement(U,{color:"primary"}),r.createElement(y,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Order Status"),r.createElement(F,{status:O.status}))))),"enduser"===z&&r.createElement(b,{item:!0,xs:6},r.createElement(k,{elevation:2,sx:{p:2,height:"100%"}},r.createElement(_,{spacing:2},("placed"===O.status||"external_shipping_process"===O.status)&&r.createElement(r.Fragment,null,r.createElement(x,{variant:"contained",color:"primary",onClick:function(){return $(!0)}},"Confirm order"),r.createElement(v,{severity:"warning"},"Please confirm the order as soon as possible, only upon confirmation this order will be available to the dispatcher"),r.createElement(M,{open:Z,handleClose:function(){return $(!1)},orderID:O.id,currentStatus:O.status,revalidateCallback:A})),("placed"===O.status||"ordered"===O.status)&&r.createElement(r.Fragment,null,r.createElement(x,{variant:"contained",color:"error",onClick:function(){return ne(!0)}},"Cancel order"),r.createElement(Y,{open:te,handleClose:function(){return ne(!1)},orderID:O.id,revalidateCallback:A}))))),r.createElement(b,{item:!0,xs:12},r.createElement(_,{spacing:2},r.createElement(y,{variant:"h5"},"Documents"),r.createElement(k,{sx:{p:2}},r.createElement(_,{spacing:1},O.delivery_note?r.createElement(r.Fragment,null,r.createElement(y,{variant:"h6"},"Delivery Note"),r.createElement(y,null,null===(g=O.delivery_note)||void 0===g?void 0:g.name),r.createElement(x,{variant:"contained",onClick:function(){m("api/ipos/".concat(O.id),"delivery_note")}},"Download")):r.createElement(r.Fragment,null,r.createElement(y,{variant:"h5"},"Delivery Note"),r.createElement(y,{variant:"body1"},"Here you can upload the the delivery note for this order"),r.createElement(w,null),r.createElement(c,{reference:"api::e-commerce.opo",refID:O.id,field:"delivery_note",multiple:!1,accept:"text/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",path:"api/ipos",componentName:"delivery_note",componentReference:"common.base64-encoded-media",revalidateCallback:A})))))),(null===(D=null===(I=null==O?void 0:O.notes)||void 0===I?void 0:I.data)||void 0===D?void 0:D.length)>0&&r.createElement(b,{item:!0,xs:12},r.createElement(_,{spacing:2},r.createElement(y,{variant:"h5"},"Notes"),r.createElement(u,{notes:O.notes.data}),r.createElement(w,null))),r.createElement(b,{item:!0,xs:12},r.createElement(_,{spacing:1},r.createElement(y,{variant:"h5"},"Items"),r.createElement(_,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:2,component:k,p:1},r.createElement(y,{variant:"body1"},"Show:"),["picked","packed","shipped","reports"].map((function(n){return r.createElement(j,{key:n,control:r.createElement(N,{checked:ae.includes(n),onChange:function(r){r.target.checked?ie(t(t([],e(ae),!1),[n],!1)):ie(ae.filter((function(e){return e!==n})))}}),label:n.charAt(0).toUpperCase()+n.slice(1)})}))),"placed"===O.status&&r.createElement(v,{severity:"warning"},"Before confirmation you cannot update the items"),r.createElement(w,null),r.createElement("form",{action:L},r.createElement("input",{name:"id",type:"hidden",value:O.id}),r.createElement("input",{type:"hidden",name:"items",value:JSON.stringify(function(e){return e.map((function(e){var t,n;return{id:e.id,ordered_quantity:e.ordered_quantity,picked_quantity:e.picked_quantity,packed_quantity:e.packed_quantity,shipped_quantity:e.shipped_quantity,reports:(null===(n=null===(t=e.reports)||void 0===t?void 0:t.data)||void 0===n?void 0:n.map((function(e){return{id:"id"in e?e.id:void 0,quantity:e.quantity,content:e.content,type:e.type}})))||[]}}))}(K))}),K&&K.map((function(e,t){var n,a;return r.createElement(k,{sx:{p:2,mb:2},key:t},"placed"===O.status||"external_shipping_process"===O.status||"done"===O.status||"cancelled"===O.status?r.createElement(s,{item:e,index:t,image:null===(n=null==e?void 0:e.product)||void 0===n?void 0:n.image}):r.createElement(d,{item:e,index:t,handleUpdateQuantity:oe,handleAddReport:le,image:null===(a=null==e?void 0:e.product)||void 0===a?void 0:a.image,handleRemoveReportAtIndex:ce,revalidateCallback:A,showing:ae}))})),r.createElement(k,{sx:{p:2}},r.createElement(_,{direction:"row",spacing:2,justifyContent:"end"},r.createElement(R,{text:"Update items",loadingText:"Loading..."}))))))))}export{z as default};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useEffect as n,useState as i}from"react";import{useFormState as a}from"react-dom";import l from"@mui/material/Box";import m from"@mui/material/Stack";import o from"@mui/material/TextField";import c from"@mui/material/Typography";import s from"@mui/material/Button";import d from"@mui/material/Grid";import{SubmitButton as u}from"../../SubmitButton.js";import{createProductAction as p}from"../../../data/actions/e-commerce/product/createProductAction.js";import{MediaLibraryDialog as E}from"../../common/media/MediaLibraryDialog.js";import{StrapiImage as g}from"../../StrapiImage.js";import{PriceFields as f}from"./PriceFields.js";import h from"../categories/CategorySelectorV2.js";import{DimensionsFields as v}from"../../common/Dimensions.js";import x from"../../logistics/vendor/VendorSelector.js";import y from"../../common/markdown/MarkdownEditor.js";import{useSnackbar as b}from"../../../context/common/SnackbarContext.js";var C={zodErrors:null,strapiErrors:null,severity:null,data:null,message:null},j=function(j){var w=j.vendorArr,k=j.categories,S=j.revalidateCallback,A=j.handleClose,N=j.sx,P=e(a(p,C),2),T=P[0],V=P[1],_=b().handleAddMessage;n((function(){(null==T?void 0:T.message)&&(_({message:T.message,severity:T.severity||"error"}),"success"===T.severity&&(S&&S(),A&&A()))}),[null==T?void 0:T.message]),n((function(){(null==T?void 0:T.strapiErrors)&&_({message:T.strapiErrors.message||"Error adding product",severity:T.severity||"error"})}),[null==T?void 0:T.strapiErrors]);var D=e(i(null),2),I=D[0],B=D[1],M=e(i(null),2),O=M[0],F=M[1],G=e(i([]),2),R=G[0],z=G[1];return r.createElement(l,{sx:t([],e(Array.isArray(N)?N:[N]),!1)},r.createElement("form",{action:V},r.createElement(d,{container:!0,spacing:2},r.createElement(d,{item:!0,xs:12},r.createElement(c,{variant:"h3",component:"h1"},"Add New Product")),r.createElement(d,{item:!0,xs:12},r.createElement(m,{spacing:2},r.createElement(o,{id:"title",name:"title",label:"Title"}),r.createElement(y,{name:"description",label:"Description"}),r.createElement(o,{id:"external_product_number",name:"external_product_number",label:"External Product Number"}))),r.createElement(d,{item:!0,xs:6},r.createElement(c,{variant:"h6"},"Product Image"),r.createElement("input",{id:"image",type:"hidden",name:"image",value:(null==O?void 0:O.id)||""}),r.createElement(g,{id:(null==O?void 0:O.id)||"",url:(null==O?void 0:O.url)||"",alternativeText:"product image",width:(null==O?void 0:O.width)&&(null==O?void 0:O.height)?O.width/O.height*200:200,height:200}),r.createElement(s,{onClick:function(){return B("image")}},"open media library"),r.createElement(E,{open:"image"===I,handleClose:function(){return B(null)},handleCancel:function(){F(null),B(null)},handleSelect:function(e){F(e)},selected:O?[O]:[]})),r.createElement(d,{item:!0,xs:6},r.createElement(c,{variant:"h6"},"Image Gallery"),r.createElement("input",{id:"gallery",type:"hidden",name:"gallery",value:JSON.stringify(R.map((function(e){return e.id})))}),r.createElement(m,{direction:"row",spacing:2},R.map((function(e){return r.createElement(g,{key:e.id,id:e.id,url:e.url,alternativeText:"gallery image",width:e.width/e.height*100,height:100})}))),r.createElement(s,{onClick:function(){return B("gallery")}},"open media library"),r.createElement(E,{open:"gallery"===I,handleClose:function(){return B(null)},handleCancel:function(){z([]),B(null)},handleSelect:function(r){if(R.indexOf(r)>-1){var n=t([],e(R),!1);n.splice(R.indexOf(r),1),z(n)}else R.length>=5?z(t([],e(R),!1)):z(t(t([],e(R),!1),[r],!1))},selected:R})),r.createElement(d,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Price"),r.createElement(f,{componentName:"price",componentReference:"e-commerce-elements.price"})),r.createElement(d,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Categories"),r.createElement(h,{categories:k,currentValue:[]})),r.createElement(d,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Dimensions"),r.createElement(v,{componentName:"dimensions",componentReference:"e-commerce-elements.dimensions"})),r.createElement(d,{item:!0,xs:12},r.createElement(c,{variant:"h6"},"Vendors"),r.createElement(x,{vendorNames:w,currentValue:null})),r.createElement(d,{item:!0,xs:12},r.createElement(m,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{py:2}},A&&r.createElement(s,{onClick:A,variant:"outlined"},"Cancel"),r.createElement(u,{text:"create new product",loadingText:"loading"}))))))};export{j as AddProductForm};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useEffect as
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useEffect as n,useState as i}from"react";import a from"@mui/material/Box";import l from"@mui/material/Stack";import o from"@mui/material/TextField";import m from"@mui/material/Typography";import{SubmitButton as c}from"../../SubmitButton.js";import{useFormState as d}from"react-dom";import{updateProductAction as s}from"../../../data/actions/e-commerce/product/updateProductAction.js";import{MediaLibraryDialog as u}from"../../common/media/MediaLibraryDialog.js";import p from"@mui/material/Button";import E from"@mui/material/Grid";import{StrapiImage as g}from"../../StrapiImage.js";import{PriceFields as v}from"./PriceFields.js";import f from"../categories/CategorySelectorV2.js";import{DimensionsFields as h}from"../../common/Dimensions.js";import y from"../../logistics/vendor/VendorSelector.js";import x from"../../common/markdown/MarkdownEditor.js";import{useSnackbar as b}from"../../../context/common/SnackbarContext.js";var C={zodErrors:null,strapiErrors:null,severity:null,data:null,message:null};function j(j){var w,k,S=j.data,V=j.vendorArr,_=j.categoriesArray,A=j.revalidateCallback,P=j.handleClose,T=j.sx,I=S.id,N=S.title,D=S.description,B=S.external_product_number,M=S.image,F=S.gallery,G=S.price,R=S.dimensions,z=S.categories,J=S.vendors,L=(null==F?void 0:F.data)||[],O=(null==z?void 0:z.data)||[],q=b().handleAddMessage,H=e(d(s,C),2),K=H[0],Q=H[1];n((function(){(null==K?void 0:K.message)&&(q({message:K.message,severity:K.severity||"error"}),"success"===K.severity&&(A&&A(),P&&P()))}),[null==K?void 0:K.message]),n((function(){(null==K?void 0:K.strapiErrors)&&q({message:K.strapiErrors.message||"Error updating product",severity:K.severity||"error"})}),[null==K?void 0:K.strapiErrors]);var U=e(i(null),2),W=U[0],X=U[1],Y=e(i(M||null),2),Z=Y[0],$=Y[1],ee=e(i(t([],e(L),!1)),2),te=ee[0],re=ee[1];return r.createElement(a,{sx:t([],e(Array.isArray(T)?T:[T]),!1)},r.createElement("form",{action:Q},I&&r.createElement("input",{id:"id",type:"hidden",name:"id",value:I}),r.createElement(E,{container:!0,spacing:2},r.createElement(E,{item:!0,xs:12},r.createElement(m,{variant:"h3",component:"h1"},"Edit Product")),r.createElement(E,{item:!0,xs:12},r.createElement(l,{spacing:2},r.createElement(o,{id:"title",name:"title",label:"Title",defaultValue:N}),r.createElement(x,{name:"description",label:"Description",defaultValue:D}),r.createElement(o,{id:"external_product_number",name:"external_product_number",label:"External Product Number",defaultValue:B}))),r.createElement(E,{item:!0,xs:6},r.createElement(m,{variant:"h6"},"Product Image"),r.createElement("input",{id:"image",type:"hidden",name:"image",value:null==Z?void 0:Z.id}),r.createElement(g,{id:(null==Z?void 0:Z.id)||"",url:(null==Z?void 0:Z.url)||"",alternativeText:"product image",width:(null==Z?void 0:Z.width)&&(null==Z?void 0:Z.height)?Z.width/Z.height*200:200,height:200}),r.createElement(p,{onClick:function(){return X("image")}},"open media library"),r.createElement(u,{open:"image"===W,handleClose:function(){return X(null)},handleCancel:function(){$(null),X(null)},handleSelect:function(e){$(e)},selected:Z?[Z]:[]})),r.createElement(E,{item:!0,xs:6},r.createElement(m,{variant:"h6"},"Image Gallery"),r.createElement("input",{id:"gallery",type:"hidden",name:"gallery",value:JSON.stringify(te.map((function(e){return e.id})))}),r.createElement(l,{direction:"row",spacing:2},te.map((function(e){return r.createElement(g,{key:e.id,id:e.id,url:e.url,alternativeText:"gallery image",width:(null==e?void 0:e.width)&&(null==e?void 0:e.height)?e.width/e.height*100:100,height:100})}))),r.createElement(p,{onClick:function(){return X("gallery")}},"open media library"),r.createElement(u,{open:"gallery"===W,handleClose:function(){return X(null)},handleCancel:function(){re([]),X(null)},handleSelect:function(r){var n=te.findIndex((function(e){return e.id===r.id}));if(n>-1){var i=t([],e(te),!1);i.splice(n,1),re(i)}else te.length>=5?re(t([],e(te),!1)):re(t(t([],e(te),!1),[r],!1))},selected:te})),r.createElement(E,{item:!0,xs:12},r.createElement(m,{variant:"h6"},"Price"),r.createElement(v,{componentName:"price",componentReference:"e-commerce-elements.price",data:G})),r.createElement(E,{item:!0,xs:12},r.createElement(m,{variant:"h6"},"Categories"),r.createElement(f,{categories:_,currentValue:t([],e(O.map((function(e){return e.id}))),!1)})),r.createElement(E,{item:!0,xs:12},r.createElement(m,{variant:"h6"},"Dimensions"),r.createElement(h,{componentName:"dimensions",componentReference:"e-commerce-elements.dimensions",data:R})),r.createElement(E,{item:!0,xs:12},r.createElement(m,{variant:"h6"},"Vendors"),r.createElement(y,{vendorNames:V,currentValue:null===(k=null===(w=J.data)||void 0===w?void 0:w[0])||void 0===k?void 0:k.id})),r.createElement(E,{item:!0,xs:12},r.createElement(l,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{py:1}},P&&r.createElement(p,{onClick:P,variant:"outlined"},"Cancel"),r.createElement(c,{text:"update product",loadingText:"loading"}))))))}export{j as EditProductForm};
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useEffect as n}from"react";import l from"@mui/material/Paper";import a from"@mui/material/Box";import m from"@mui/material/Stack";import i from"@mui/material/
|
|
7
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useEffect as n}from"react";import l from"@mui/material/Paper";import a from"@mui/material/Box";import m from"@mui/material/Stack";import i from"@mui/material/Typography";import{SubmitButton as o}from"../../SubmitButton.js";import{useFormState as u}from"react-dom";import{updateProductAction as c}from"../../../data/actions/e-commerce/product/updateProductAction.js";import d from"@mui/material/Grid";import s from"../../logistics/report/ReportsDisplay.js";import E from"../../logistics/report/ReportMakingComponent.js";import{useSnackbar as p}from"../../../context/common/SnackbarContext.js";import y from"@mui/material/Table";import f from"@mui/material/TableBody";import g from"@mui/material/TableCell";import _ from"@mui/material/TableContainer";import v from"@mui/material/TableFooter";import k from"@mui/material/TableHead";import q from"@mui/material/TableRow";import b from"@mui/material/Tooltip";import x from"@mui/material/Button";import{AmountIndicator as h}from"../../common/AmountIndicator.js";var T={zodErrors:null,strapiErrors:null,data:null,message:null,severity:null};function C(C){var S=C.data,j=C.revalidateCallback,Q=C.handleClose,V=C.sx,O=S.id,R=S.title;S.product_number,S.stock;var A=S.ipos,I=S.opos,N=S.reports,w=p().handleAddMessage,z=e(u(c,T),2),B=z[0],D=z[1];return n((function(){(null==B?void 0:B.message)&&(w({message:B.message,severity:B.severity||"error"}),"success"===B.severity&&(j&&j(),Q&&Q()))}),[null==B?void 0:B.message,w,j,Q]),n((function(){(null==B?void 0:B.strapiErrors)&&w({message:B.strapiErrors.message||"Error updating stock",severity:"error"})}),[null==B?void 0:B.strapiErrors,w]),r.createElement(a,{sx:t([],e(Array.isArray(V)?V:[V]),!1)},r.createElement(d,{container:!0,spacing:2},r.createElement(d,{item:!0,xs:12},r.createElement(i,{variant:"h6"},R)),r.createElement(d,{item:!0,xs:12},r.createElement(_,{component:l},r.createElement(i,{variant:"h6"},"Incoming orders"),r.createElement(y,{size:"small"},r.createElement(k,null,r.createElement(q,null,r.createElement(g,null,"Number"),r.createElement(g,null,"Order Date"),r.createElement(g,null,"Line Item Number"),r.createElement(g,null,"Ordered Quantity"),r.createElement(g,null,"Received Quantity"),r.createElement(g,null,"Registered Quantity"),r.createElement(g,null,"Released Quantity"))),r.createElement(f,null,A.map((function(e){return r.createElement(r.Fragment,null,e.items.map((function(t){return r.createElement(q,{key:e.id},r.createElement(g,null,e.ipo_number),r.createElement(g,null,e.order_date),r.createElement(g,null,t.line_item_number),r.createElement(g,null,r.createElement(h,{value:t.ordered_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.received_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.registered_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.released_quantity,maxValue:t.ordered_quantity,color:"primary"})))})))}))),r.createElement(v,null,r.createElement(q,null,r.createElement(g,{colSpan:6,align:"right"},"Total added to stock:"),r.createElement(g,null,A.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0))))),r.createElement(i,{variant:"h6"},"Outgoing orders"),r.createElement(y,{size:"small"},r.createElement(k,null,r.createElement(q,null,r.createElement(g,null,"Number"),r.createElement(g,null,"Order Date"),r.createElement(g,null,"Line Item Number"),r.createElement(g,null,"Ordered Quantity"),r.createElement(g,null,"Picked Quantity"),r.createElement(g,null,"Packed Quantity"),r.createElement(g,null,"Shipped Quantity"))),r.createElement(f,null,I.map((function(e){return r.createElement(r.Fragment,null,e.opo_items.map((function(t){return r.createElement(q,{key:e.id},r.createElement(g,null,e.opo_number),r.createElement(g,null,e.order_date),r.createElement(g,null,t.line_item_number),r.createElement(g,null,r.createElement(h,{value:t.ordered_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.picked_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.packed_quantity,maxValue:t.ordered_quantity,color:"primary"})),r.createElement(g,null,r.createElement(h,{value:t.shipped_quantity,maxValue:t.ordered_quantity,color:"primary"})))})))}))),r.createElement(v,null,r.createElement(q,null,r.createElement(g,{colSpan:3,align:"right"},"Total reduced from stock:"),r.createElement(g,null,I.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0))))),r.createElement(y,{size:"small"},r.createElement(q,null,r.createElement(g,{align:"right"},"Total added to stock:"),r.createElement(g,null,A.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0))),r.createElement(q,null,r.createElement(g,{align:"right"},"Total reduced from stock:"),r.createElement(g,null,I.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0))),r.createElement(q,null,r.createElement(g,{align:"right"},"Corrections:"),r.createElement(g,null,r.createElement(b,{title:"Total stock corrections"},r.createElement(i,null,N?N.reduce((function(e,t){return e+t.quantity}),0):0))),r.createElement(g,null,r.createElement(b,{title:"Total stock corrections after updating"},r.createElement("b",null,N?N.reduce((function(e,t){return e+t.quantity}),0):0)))),r.createElement(q,null,r.createElement(g,{align:"right"},"Stock:"),r.createElement(g,null,r.createElement(b,{title:"Total stock"},r.createElement(i,null,A.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0)-I.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0)+(N?N.reduce((function(e,t){return e+t.quantity}),0):0)))),r.createElement(g,null,r.createElement(b,{title:"Total stock after updating"},r.createElement("b",null,A.reduce((function(e,t){return e+t.items.reduce((function(e,t){return e+t.released_quantity}),0)}),0)-I.reduce((function(e,t){return e+t.opo_items.reduce((function(e,t){return e+t.ordered_quantity}),0)}),0)+(N?N.reduce((function(e,t){return e+t.quantity}),0):0))))))))),r.createElement("form",{action:D},O&&r.createElement("input",{id:"id",type:"hidden",name:"id",value:O}),r.createElement("input",{id:"stock_reports",type:"hidden",name:"stock_reports",value:JSON.stringify(N)}),r.createElement(d,{container:!0,spacing:2},r.createElement(d,{item:!0,xs:12,sx:{mt:2}},r.createElement(m,{spacing:2},r.createElement(i,{variant:"h5"},"Stock corrections"),r.createElement(i,{variant:"body2"},"Here you can report and correct for damages wrong items etc. Do not forget to click the button!"),r.createElement(s,{reports:N}),r.createElement(E,{content:"content",quantity:0,type:"stock",related:[{id:O,__type:"api::e-commerce.product"}],revalidateCallback:j}))),r.createElement(d,{item:!0,xs:12},r.createElement(m,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{py:1}},Q&&r.createElement(x,{onClick:Q,variant:"outlined"},"Close"),r.createElement(o,{text:"Update Stock",loadingText:"Updating...",variant:"contained"}))))))}export{C as EditStockForm};
|