umwd-components 0.1.639 → 0.1.640

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.
@@ -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 r}from"../../../../node_modules/tslib/tslib.es6.js";import n,{useState as a,useEffect as i}from"react";import{useFormState as o}from"react-dom";import{updateIroAction as l}from"../../../data/actions/e-commerce/iro/updateIroAction.js";import c from"./TextualIROItemUpdater.js";import m from"./IroItemDisplay.js";import s from"../../logistics/note/NotesDisplay.js";import u from"../../logistics/note/NoteTakingComponent.js";import{StrapiErrors as d}from"../../StrapiErrors.js";import{SubmitButton as p}from"../../SubmitButton.js";import v from"@mui/material/Alert";import E from"@mui/material/Dialog";import f from"@mui/material/DialogActions";import g from"@mui/material/DialogContent";import y from"@mui/material/DialogTitle";import h from"@mui/material/Typography";import b from"@mui/material/Button";import C from"@mui/material/Grid";import w from"@mui/material/Box";import x from"@mui/material/Paper";import _ from"@mui/material/Stack";import k from"@mui/material/Divider";import{confirmationService as q}from"../../../data/services/common/confirmation-service.js";import{cancellationService as I}from"../../../data/services/common/cancellation-service.js";import{FormControlLabel as D,Checkbox as R,List as j,ListItem as A,TextField as S}from"@mui/material";var N={zodErrors:null,strapiErrors:null,data:null,message:null};function T(e){var t=e.open,r=e.handleClose,a=e.orderID,i=e.currentStatus,o=e.revalidateCallback;return n.createElement(E,{open:t},n.createElement(y,null,"Confirm Return"),n.createElement(g,null,n.createElement(_,{spacing:2},n.createElement(h,null,"Are you sure you want to confirm this return?"),n.createElement(j,null,"requested"===i&&n.createElement(A,null,"When confirming this return order a rma number will be generated"),n.createElement(A,null,"requested"===i?"By confirming the return you will update it's status from requested to returning":"By confirming the return you will update it's status from finalising_process to done")),n.createElement(h,null,"Current status: ",i))),n.createElement(f,null,n.createElement(b,{variant:"contained",onClick:function(e){q("iros",[a]),o&&o(),r()}},"Yes"),n.createElement(b,{variant:"contained",onClick:r},"No")))}function P(t){var r=t.open,i=t.handleClose,o=t.orderID,l=t.revalidateCallback,c=e(a(""),2),m=c[0],s=c[1],u=e(a(""),2),d=u[0],p=u[1];return n.createElement("form",null,n.createElement(E,{open:r},n.createElement(y,null,"Cancel Return"),n.createElement(g,null,n.createElement(_,{spacing:2},n.createElement(h,null,"Are you sure you want to cancel this return?"),n.createElement(j,null,n.createElement(A,null,"By cancelling this return order you will update it's status from requested to cancelled"),n.createElement(A,null,"Please provide a reason for the cancellation"),n.createElement(A,null,"The customer will be notified about the cancellation and of the reason for the cancellation")),n.createElement(S,{label:"Cancellation reason",name:"reason",multiline:!0,rows:4,fullWidth:!0,variant:"outlined",value:m,onChange:function(e){return s(e.target.value)},placeholder:"Please provide a reason for the cancellation",error:!!d,helperText:d}))),n.createElement(f,null,n.createElement(b,{variant:"contained",onClick:function(e){m.length<5?p("Please provide a reason for the cancellation"):(I("iros",o,m),l&&l(),i())}},"Yes"),n.createElement(b,{variant:"contained",onClick:i},"No"))))}function B(E){var f,g,y,q,I=E.data,j=E.sx,A=E.revalidateCallback;E.handleClose;var S=E.role,B=e(o(l,N),2),M=B[0],O=B[1],U=e(a(I.iro_items.data?I.iro_items.data:[]),2),Y=U[0],W=U[1],z=e(a(!1),2),F=z[0],G=z[1],J=e(a(!1),2),L=J[0],Q=J[1],H=e(a(["received","registered","released","reports"]),2),K=H[0],V=H[1],X=function(r,n,a){var i=t([],e(Y),!1),o=i.findIndex((function(e){return e.id===n}));i[o][a]=r,W(i)},Z=function(n,a){var i,o,l,c=t([],e(Y),!1),m=c.findIndex((function(e){return e.id===a})),s=(null===(o=null===(i=c[m])||void 0===i?void 0:i.reports)||void 0===o?void 0:o.data)||[],u=t(t([],e(s),!1),[n],!1);null==(null===(l=c[m])||void 0===l?void 0:l.reports)&&(c[m]=r(r({},c[m]),{reports:{data:[]}})),c[m].reports.data=u,W(c)},$=function(r,n){var a,i,o=t([],e(Y),!1),l=o.findIndex((function(e){return e.id===r})),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})),s=c.filter((function(e){return!("id"in e)}));s.splice(n,1);var u=t(t([],e(m),!1),e(s),!1);o[l].reports.data=u,W(o)};return i((function(){"Iro Updated"===(null==M?void 0:M.message)&&A&&A()}),[M]),i((function(){var e;console.log(I),(null===(e=I.iro_items)||void 0===e?void 0:e.data)&&W(I.iro_items.data?I.iro_items.data:[])}),[I]),n.createElement(w,{sx:t([],e(Array.isArray(j)?j:[j]),!1)},n.createElement(C,{container:!0,spacing:2},n.createElement(C,{item:!0,xs:12},n.createElement(_,{spacing:2},n.createElement(_,{direction:"row",spacing:2,justifyContent:"space-between"},n.createElement(_,{spacing:2},n.createElement(h,{variant:"h3",component:"h1"},"Management Inbound Return"),n.createElement(h,{variant:"body1"},"Manage arrival, registration and release of returns")),n.createElement(u,{content:"",related:[{id:I.id,__type:"api::e-commerce.iro"}],revalidateCallback:A})),n.createElement(k,null))),n.createElement(C,{item:!0,xs:6},n.createElement(_,{spacing:1},n.createElement(h,{variant:"h5"},"Details"),n.createElement(_,{direction:"row",spacing:2},n.createElement(h,{variant:"body1",width:"250px"},"Return Number"),n.createElement(h,{variant:"body2"},I.return_number)),n.createElement(_,{direction:"row",spacing:2},n.createElement(h,{variant:"body1",width:"250px"},"RMA Number"),n.createElement(h,{variant:"body2"},I.rma_number)),n.createElement(_,{direction:"row",spacing:2},n.createElement(h,{variant:"body1",width:"250px"},"Customer internal reference number"),n.createElement(h,{variant:"body2"},I.customer_reference)),n.createElement(_,{direction:"row",spacing:2},n.createElement(h,{variant:"body1",width:"250px"},"Return Date"),n.createElement(h,{variant:"body2"},I.return_date)),n.createElement(_,{direction:"row",spacing:2},n.createElement(h,{variant:"body1",width:"250px"},"Customer"),n.createElement(h,{variant:"body2"},null===(g=null===(f=I.customer)||void 0===f?void 0:f.business_credentials)||void 0===g?void 0:g.company_name)),n.createElement(_,{direction:"row",spacing:2},n.createElement(h,{variant:"body1",width:"250px"},"Return Status"),n.createElement(h,{variant:"body2",width:"250px"},I.status)),("requested"===I.status||"finalising_process"===I.status)&&"enduser"===S&&n.createElement(n.Fragment,null,n.createElement(b,{variant:"contained",color:"primary",onClick:function(){return G(!0)}},"Confirm order"),"requested"===I.status&&n.createElement(v,{severity:"warning"},"Please confirm the order as soon as possible, only upon confirmation this order will be assigned an RMA number and will become available to the dispatcher. Status: requested - returning"),"finalising_process"===I.status&&n.createElement(v,{severity:"warning"},"Please finalise this return order. Make sure the customer recieves a return payment if eligible and than confirm this step. Status: finalising_process - done"),"finalising_process"===I.status&&n.createElement(b,{variant:"contained",sx:{color:"yellow"}},"// TODO RE-PAYMENT PROCESS"),n.createElement(b,{variant:"contained",color:"error",onClick:function(){return Q(!0)}},"Cancel order"),n.createElement(T,{open:F,handleClose:function(){return G(!1)},orderID:I.id,currentStatus:I.status,revalidateCallback:A}),n.createElement(P,{open:L,handleClose:function(){return Q(!1)},orderID:I.id,revalidateCallback:A})))),n.createElement(C,{item:!0,xs:12},n.createElement(_,{spacing:2},n.createElement(h,{variant:"h5"},"Documents"),n.createElement(x,{sx:{p:2}},n.createElement(_,{spacing:1})))),(null===(q=null===(y=null==I?void 0:I.notes)||void 0===y?void 0:y.data)||void 0===q?void 0:q.length)>0&&n.createElement(C,{item:!0,xs:12},n.createElement(_,{spacing:2},n.createElement(h,{variant:"h5"},"Notes"),n.createElement(s,{notes:I.notes.data}),n.createElement(k,null))),n.createElement(C,{item:!0,xs:12},n.createElement(_,{spacing:1},n.createElement(h,{variant:"h5"},"Items"),n.createElement(_,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:2,component:x,p:1},n.createElement(h,{variant:"body1"},"Show:"),["received","registered","released","reports"].map((function(r){return n.createElement(D,{key:r,control:n.createElement(R,{checked:K.includes(r),onChange:function(n){n.target.checked?V(t(t([],e(K),!1),[r],!1)):V(K.filter((function(e){return e!==r})))}}),label:r.charAt(0).toUpperCase()+r.slice(1)})}))),"requested"===I.status&&n.createElement(v,{severity:"warning"},"Before confirmation you cannot update the items"),n.createElement(k,null),n.createElement("form",{action:O},n.createElement("input",{name:"id",type:"hidden",value:I.id}),Y&&Y.map((function(e,t){var r,a;return n.createElement(x,{sx:{p:2,mb:2},key:t},"requested"===I.status||"cancelled"===I.status||"done"===I.status?n.createElement(m,{item:e,index:t,image:null===(r=null==e?void 0:e.product)||void 0===r?void 0:r.image}):n.createElement(c,{item:e,index:t,handleUpdateQuantity:X,handleAddReport:Z,image:null===(a=null==e?void 0:e.product)||void 0===a?void 0:a.image,handleRemoveReportAtIndex:$,revalidateCallback:A,showing:K}))})),n.createElement(x,{sx:{p:2}},n.createElement(_,{direction:"row",spacing:2,justifyContent:"end"},n.createElement(p,{text:"Update items",loadingText:"Loading..."}),n.createElement(d,{error:null==M?void 0:M.strapiErrors}),(null==M?void 0:M.message)&&n.createElement(v,{severity:"error"},null==M?void 0:M.message))),n.createElement("input",{type:"hidden",name:"items",value:JSON.stringify(function(e){return e.map((function(e){var t,r;return{id:e.id,returned_quantity:e.returned_quantity,received_quantity:e.received_quantity,registered_quantity:e.registered_quantity,released_quantity:e.released_quantity,reports:(null===(r=null===(t=e.reports)||void 0===t?void 0:t.data)||void 0===r?void 0:r.map((function(e){return{id:"id"in e?e.id:void 0,quantity:e.quantity,content:e.content,type:e.type}})))||[]}}))}(Y))}))))))}export{B as default};
6
+ import{__read as e,__spreadArray as t,__assign as r}from"../../../../node_modules/tslib/tslib.es6.js";import n,{useState as a,useEffect as i}from"react";import{useFormState as o}from"react-dom";import{updateIroAction as l}from"../../../data/actions/e-commerce/iro/updateIroAction.js";import m from"./TextualIROItemUpdater.js";import c from"./IroItemDisplay.js";import s from"../../logistics/note/NotesDisplay.js";import u from"../../logistics/note/NoteTakingComponent.js";import{StrapiErrors as d}from"../../StrapiErrors.js";import{SubmitButton as p}from"../../SubmitButton.js";import E from"@mui/material/Alert";import f from"@mui/material/Dialog";import v from"@mui/material/DialogActions";import g from"@mui/material/DialogContent";import y 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 w from"@mui/material/Paper";import _ from"@mui/material/Stack";import I from"@mui/material/Divider";import{confirmationService as k}from"../../../data/services/common/confirmation-service.js";import{cancellationService as q}from"../../../data/services/common/cancellation-service.js";import{FormControlLabel as D,Checkbox as R,List as j,ListItem as A,TextField as S}from"@mui/material";import N from"@mui/icons-material/Numbers";import T from"@mui/icons-material/AssignmentReturn";import B from"@mui/icons-material/CalendarToday";import P from"@mui/icons-material/Business";import W from"@mui/icons-material/Description";import M from"@mui/icons-material/Update";import{IroStatusIndicator as U}from"./IroStatusIndicator.js";var O={zodErrors:null,strapiErrors:null,data:null,message:null};function Y(e){var t=e.open,r=e.handleClose,a=e.orderID,i=e.currentStatus,o=e.revalidateCallback;return n.createElement(f,{open:t},n.createElement(y,null,"Confirm Return"),n.createElement(g,null,n.createElement(_,{spacing:2},n.createElement(h,null,"Are you sure you want to confirm this return?"),n.createElement(j,null,"requested"===i&&n.createElement(A,null,"When confirming this return order a rma number will be generated"),n.createElement(A,null,"requested"===i?"By confirming the return you will update it's status from requested to returning":"By confirming the return you will update it's status from finalising_process to done")),n.createElement(h,null,"Current status: ",i))),n.createElement(v,null,n.createElement(b,{variant:"contained",onClick:function(e){k("iros",[a]),o&&o(),r()}},"Yes"),n.createElement(b,{variant:"contained",onClick:r},"No")))}function z(t){var r=t.open,i=t.handleClose,o=t.orderID,l=t.revalidateCallback,m=e(a(""),2),c=m[0],s=m[1],u=e(a(""),2),d=u[0],p=u[1];return n.createElement("form",null,n.createElement(f,{open:r},n.createElement(y,null,"Cancel Return"),n.createElement(g,null,n.createElement(_,{spacing:2},n.createElement(h,null,"Are you sure you want to cancel this return?"),n.createElement(j,null,n.createElement(A,null,"By cancelling this return order you will update it's status from requested to cancelled"),n.createElement(A,null,"Please provide a reason for the cancellation"),n.createElement(A,null,"The customer will be notified about the cancellation and of the reason for the cancellation")),n.createElement(S,{label:"Cancellation reason",name:"reason",multiline:!0,rows:4,fullWidth:!0,variant:"outlined",value:c,onChange:function(e){return s(e.target.value)},placeholder:"Please provide a reason for the cancellation",error:!!d,helperText:d}))),n.createElement(v,null,n.createElement(b,{variant:"contained",onClick:function(e){c.length<5?p("Please provide a reason for the cancellation"):(q("iros",o,c),l&&l(),i())}},"Yes"),n.createElement(b,{variant:"contained",onClick:i},"No"))))}function G(f){var v,g,y,k,q=f.data,j=f.sx,A=f.revalidateCallback;f.handleClose;var S=f.role,G=e(o(l,O),2),J=G[0],L=G[1],Q=e(a(q.iro_items.data?q.iro_items.data:[]),2),F=Q[0],H=Q[1],K=e(a(!1),2),V=K[0],X=K[1],Z=e(a(!1),2),$=Z[0],ee=Z[1],te=e(a(["received","registered","released","reports"]),2),re=te[0],ne=te[1],ae=function(r,n,a){var i=t([],e(F),!1),o=i.findIndex((function(e){return e.id===n}));i[o][a]=r,H(i)},ie=function(n,a){var i,o,l,m=t([],e(F),!1),c=m.findIndex((function(e){return e.id===a})),s=(null===(o=null===(i=m[c])||void 0===i?void 0:i.reports)||void 0===o?void 0:o.data)||[],u=t(t([],e(s),!1),[n],!1);null==(null===(l=m[c])||void 0===l?void 0:l.reports)&&(m[c]=r(r({},m[c]),{reports:{data:[]}})),m[c].reports.data=u,H(m)},oe=function(r,n){var a,i,o=t([],e(F),!1),l=o.findIndex((function(e){return e.id===r})),m=(null===(i=null===(a=o[l])||void 0===a?void 0:a.reports)||void 0===i?void 0:i.data)||[],c=m.filter((function(e){return"id"in e})),s=m.filter((function(e){return!("id"in e)}));s.splice(n,1);var u=t(t([],e(c),!1),e(s),!1);o[l].reports.data=u,H(o)};return i((function(){"Iro Updated"===(null==J?void 0:J.message)&&A&&A()}),[J]),i((function(){var e;(null===(e=q.iro_items)||void 0===e?void 0:e.data)&&H(q.iro_items.data?q.iro_items.data:[])}),[q]),n.createElement(C,{sx:t([],e(Array.isArray(j)?j:[j]),!1)},n.createElement(x,{container:!0,spacing:2},n.createElement(x,{item:!0,xs:12},n.createElement(_,{spacing:2},n.createElement(_,{direction:"row",spacing:2,justifyContent:"space-between"},n.createElement(_,{spacing:2},n.createElement(h,{variant:"h3",component:"h1"},"Management Inbound Return"),n.createElement(h,{variant:"body1"},"Manage arrival, registration and release of returns")),n.createElement(u,{content:"",related:[{id:q.id,__type:"api::e-commerce.iro"}],revalidateCallback:A})),n.createElement(I,null))),n.createElement(x,{item:!0,xs:12},n.createElement(h,{variant:"h5",sx:{py:1}},"Details")),n.createElement(x,{item:!0,xs:6},n.createElement(w,{elevation:2,sx:{p:2,height:"100%"}},n.createElement(_,{spacing:2},n.createElement(_,{direction:"row",spacing:2,alignItems:"center"},n.createElement(N,{color:"primary"}),n.createElement(h,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Return Number"),n.createElement(h,{variant:"body1",fontWeight:"medium"},q.return_number)),n.createElement(_,{direction:"row",spacing:2,alignItems:"center"},n.createElement(T,{color:"primary"}),n.createElement(h,{variant:"subtitle1",color:"text.secondary",width:"200px"},"RMA Number"),n.createElement(h,{variant:"body1",fontWeight:"medium"},q.rma_number)),n.createElement(_,{direction:"row",spacing:2,alignItems:"center"},n.createElement(W,{color:"primary"}),n.createElement(h,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Customer Reference"),n.createElement(h,{variant:"body1",fontWeight:"medium"},q.customer_reference)),n.createElement(_,{direction:"row",spacing:2,alignItems:"center"},n.createElement(B,{color:"primary"}),n.createElement(h,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Return Date"),n.createElement(h,{variant:"body1",fontWeight:"medium"},q.return_date)),n.createElement(_,{direction:"row",spacing:2,alignItems:"center"},n.createElement(P,{color:"primary"}),n.createElement(h,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Customer"),n.createElement(h,{variant:"body1",fontWeight:"medium"},null===(g=null===(v=q.customer)||void 0===v?void 0:v.business_credentials)||void 0===g?void 0:g.company_name)),n.createElement(_,{direction:"row",spacing:2,alignItems:"center"},n.createElement(M,{color:"primary"}),n.createElement(h,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Return Status"),n.createElement(U,{status:q.status}))))),("requested"===q.status||"finalising_process"===q.status)&&"enduser"===S&&n.createElement(x,{item:!0,xs:6},n.createElement(w,{elevation:2,sx:{p:2,height:"100%"}},n.createElement(_,{spacing:2},n.createElement(b,{variant:"contained",color:"primary",onClick:function(){return X(!0)}},"Confirm order"),"requested"===q.status&&n.createElement(E,{severity:"warning"},"Please confirm the order as soon as possible, only upon confirmation this order will be assigned an RMA number and will become available to the dispatcher. Status: requested - returning"),"finalising_process"===q.status&&n.createElement(E,{severity:"warning"},"Please finalise this return order. Make sure the customer recieves a return payment if eligible and than confirm this step. Status: finalising_process - done"),"finalising_process"===q.status&&n.createElement(b,{variant:"contained",sx:{color:"yellow"}},"// TODO RE-PAYMENT PROCESS"),n.createElement(b,{variant:"contained",color:"error",onClick:function(){return ee(!0)}},"Cancel order"),n.createElement(Y,{open:V,handleClose:function(){return X(!1)},orderID:q.id,currentStatus:q.status,revalidateCallback:A}),n.createElement(z,{open:$,handleClose:function(){return ee(!1)},orderID:q.id,revalidateCallback:A})))),n.createElement(x,{item:!0,xs:12},n.createElement(_,{spacing:2},n.createElement(h,{variant:"h5"},"Documents"),n.createElement(w,{sx:{p:2}},n.createElement(_,{spacing:1})))),(null===(k=null===(y=null==q?void 0:q.notes)||void 0===y?void 0:y.data)||void 0===k?void 0:k.length)>0&&n.createElement(x,{item:!0,xs:12},n.createElement(_,{spacing:2},n.createElement(h,{variant:"h5"},"Notes"),n.createElement(s,{notes:q.notes.data}),n.createElement(I,null))),n.createElement(x,{item:!0,xs:12},n.createElement(_,{spacing:1},n.createElement(h,{variant:"h5"},"Items"),n.createElement(_,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:2,component:w,p:1},n.createElement(h,{variant:"body1"},"Show:"),["received","registered","released","reports"].map((function(r){return n.createElement(D,{key:r,control:n.createElement(R,{checked:re.includes(r),onChange:function(n){n.target.checked?ne(t(t([],e(re),!1),[r],!1)):ne(re.filter((function(e){return e!==r})))}}),label:r.charAt(0).toUpperCase()+r.slice(1)})}))),"requested"===q.status&&n.createElement(E,{severity:"warning"},"Before confirmation you cannot update the items"),n.createElement(I,null),n.createElement("form",{action:L},n.createElement("input",{name:"id",type:"hidden",value:q.id}),F&&F.map((function(e,t){var r,a;return n.createElement(w,{sx:{p:2,mb:2},key:t},"requested"===q.status||"cancelled"===q.status||"done"===q.status?n.createElement(c,{item:e,index:t,image:null===(r=null==e?void 0:e.product)||void 0===r?void 0:r.image}):n.createElement(m,{item:e,index:t,handleUpdateQuantity:ae,handleAddReport:ie,image:null===(a=null==e?void 0:e.product)||void 0===a?void 0:a.image,handleRemoveReportAtIndex:oe,revalidateCallback:A,showing:re}))})),n.createElement(w,{sx:{p:2}},n.createElement(_,{direction:"row",spacing:2,justifyContent:"end"},n.createElement(p,{text:"Update items",loadingText:"Loading..."}),n.createElement(d,{error:null==J?void 0:J.strapiErrors}),(null==J?void 0:J.message)&&n.createElement(E,{severity:"error"},null==J?void 0:J.message))),n.createElement("input",{type:"hidden",name:"items",value:JSON.stringify(function(e){return e.map((function(e){var t,r;return{id:e.id,returned_quantity:e.returned_quantity,received_quantity:e.received_quantity,registered_quantity:e.registered_quantity,released_quantity:e.released_quantity,reports:(null===(r=null===(t=e.reports)||void 0===t?void 0:t.data)||void 0===r?void 0:r.map((function(e){return{id:"id"in e?e.id:void 0,quantity:e.quantity,content:e.content,type:e.type}})))||[]}}))}(F))}))))))}export{G as default};
@@ -3,4 +3,4 @@
3
3
  * @copyright Jelle Paulus
4
4
  * @license MIT
5
5
  */
6
- import e from"react";import t from"@mui/material/Stack";import r from"@mui/material/Typography";import a from"../../common/ImagePreviewTooltip.js";function m(m){var n,i=m.item,o=m.index,l=m.image,c=i.product,u=i.ordered_quantity,d=i.line_item_number;return e.createElement(t,{spacing:1,key:o},i&&e.createElement(t,{direction:"row",justifyContent:"space-between",alignItems:"center"},e.createElement(t,{spacing:1},e.createElement(r,{variant:"body1"},"Line Item Number: ",d),e.createElement(r,{variant:"body1"},"Part Number: ",null==c?void 0:c.product_number),e.createElement(r,{variant:"body1"},"Quantity Ordered: ",u)),l&&e.createElement(e.Fragment,null,e.createElement(a,{image:l,label:null===(n=i.product)||void 0===n?void 0:n.title}))))}export{m as default};
6
+ import e from"react";import t from"@mui/material/Stack";import r from"@mui/material/Typography";import n from"../../common/ImagePreviewTooltip.js";import a from"../../logistics/report/ReportsDisplay.js";function i(i){var c,m,o=i.item,l=i.index,p=i.image,d=o.line_item_number,s=o.product,u=o.ordered_quantity,E=o.picked_quantity,g=o.packed_quantity,v=o.shipped_quantity,y=o.reports;return e.createElement(t,{spacing:1,key:l},o&&e.createElement(t,{direction:"row",justifyContent:"space-between",alignItems:"center"},e.createElement(t,{spacing:1},e.createElement(r,{variant:"body1"},"Line Item Number: ",d),e.createElement(r,{variant:"body1"},"Part Number: ",null==s?void 0:s.product_number)),p&&e.createElement(e.Fragment,null,e.createElement(n,{image:p,label:null===(c=o.product)||void 0===c?void 0:c.title}))),e.createElement(t,{direction:"row",spacing:1,justifyContent:"space-between",alignItems:"center"},e.createElement(t,{direction:"row",spacing:1,alignItems:"center"},e.createElement(r,{variant:"caption"},"Ordered"),e.createElement(r,{variant:"h6"},u)),e.createElement(t,{direction:"row",spacing:1,alignItems:"center"},e.createElement(r,{variant:"caption"},"Received"),e.createElement(r,{variant:"h6"},E)),e.createElement(t,{direction:"row",spacing:1,alignItems:"center"},e.createElement(r,{variant:"caption"},"Registered"),e.createElement(r,{variant:"h6"},g)),e.createElement(t,{direction:"row",spacing:1,alignItems:"center"},e.createElement(r,{variant:"caption"},"Released"),e.createElement(r,{variant:"h6"},v))),(null===(m=null==y?void 0:y.data)||void 0===m?void 0:m.length)>0&&e.createElement(t,{spacing:1},e.createElement(r,{variant:"body1"},"Reports:"),e.createElement(a,{reports:y.data.filter((function(e){return"id"in e&&!("pre_report"in e)}))})))}export{i 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 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 m}from"../../common/media/UploadBase64MediaForm.js";import c from"../../../data/loaders/common/media/downloadBase64File.js";import d from"./TextualOpoItemUpdater.js";import p from"./OpoItemDisplay.js";import s from"../../logistics/note/NotesDisplay.js";import u 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 y from"@mui/material/Dialog";import g from"@mui/material/DialogActions";import h from"@mui/material/DialogContent";import b from"@mui/material/DialogTitle";import x from"@mui/material/Typography";import _ from"@mui/material/Button";import C from"@mui/material/Grid";import k from"@mui/material/Box";import w from"@mui/material/Paper";import D from"@mui/material/Stack";import j from"@mui/material/Divider";import{confirmationService as I}from"../../../data/services/common/confirmation-service.js";import{FormControlLabel as q,Checkbox as O}from"@mui/material";var A={zodErrors:null,strapiErrors:null,data:null,message:null};function N(e){var t=e.open,n=e.handleClose,a=e.orderID,i=e.currentStatus,o=e.revalidateCallback;return r.createElement(y,{open:t},r.createElement(b,null,"Confirm Order"),r.createElement(h,null,r.createElement(D,{spacing:2},r.createElement(x,null,"Are you sure you want to confirm this order?"),r.createElement(x,null,"Current status: ",i))),r.createElement(g,null,r.createElement(_,{variant:"contained",onClick:function(e){I("opos",[a]),o&&o()}},"Confirm"),r.createElement(_,{variant:"contained",onClick:n},"Cancel")))}function S(y){var g,h,b,I,S,B=y.opo,U=y.sx,F=y.revalidateCallback;y.handleClose;var T=y.role,P=e(o(l,A),2),R=P[0],M=P[1],z=e(a(B.opo_items.data?B.opo_items.data:[]),2),G=z[0],H=z[1],J=e(a(!1),2),L=J[0],Q=J[1],K=e(a(["picked","packed","shipped","reports"]),2),V=K[0],W=K[1],X=function(n,r,a){var i=t([],e(G),!1),o=i.findIndex((function(e){return e.id===r}));i[o][a]=n,H(i)},Y=function(r,a){var i,o,l,m=t([],e(G),!1),c=m.findIndex((function(e){return e.id===a})),d=(null===(o=null===(i=m[c])||void 0===i?void 0:i.reports)||void 0===o?void 0:o.data)||[],p=t(t([],e(d),!1),[r],!1);null==(null===(l=m[c])||void 0===l?void 0:l.reports)&&(m[c]=n(n({},m[c]),{reports:{data:[]}})),m[c].reports.data=p,H(m)},Z=function(n,r){var a,i,o=t([],e(G),!1),l=o.findIndex((function(e){return e.id===n})),m=(null===(i=null===(a=o[l])||void 0===a?void 0:a.reports)||void 0===i?void 0:i.data)||[],c=m.filter((function(e){return"id"in e})),d=m.filter((function(e){return!("id"in e)}));d.splice(r,1);var p=t(t([],e(c),!1),e(d),!1);o[l].reports.data=p,H(o)};return i((function(){"Ipo Updated"===(null==R?void 0:R.message)&&F&&F()}),[R]),i((function(){var e;(null===(e=B.opo_items)||void 0===e?void 0:e.data)&&H(B.opo_items.data?B.opo_items.data:[])}),[B]),r.createElement(k,{sx:t([],e(Array.isArray(U)?U:[U]),!1)},r.createElement(C,{container:!0,spacing:2},r.createElement(C,{item:!0,xs:12},r.createElement(D,{spacing:2},r.createElement(D,{direction:"row",spacing:2,justifyContent:"space-between"},r.createElement(D,{spacing:2},r.createElement(x,{variant:"h3",component:"h1"},"Management Outbound Purchase Order"),r.createElement(x,{variant:"body1"},"Manage picking, packing and shipping of purchase order")),r.createElement(u,{content:"",related:[{id:B.id,__type:"api::e-commerce.opo"}],revalidateCallback:F})),r.createElement(j,null))),r.createElement(C,{item:!0,xs:6},r.createElement(D,{spacing:1},r.createElement(x,{variant:"h5"},"Details"),r.createElement(D,{direction:"row",spacing:2},r.createElement(x,{variant:"body1",width:"250px"},"Purchase Order Number"),r.createElement(x,{variant:"body2"},B.opo_number)),r.createElement(D,{direction:"row",spacing:2},r.createElement(x,{variant:"body1",width:"250px"},"Custom reference"),r.createElement(x,{variant:"body2"},B.customer_reference)),r.createElement(D,{direction:"row",spacing:2},r.createElement(x,{variant:"body1",width:"250px"},"Order Date"),r.createElement(x,{variant:"body2"},B.order_date)),r.createElement(D,{direction:"row",spacing:2},r.createElement(x,{variant:"body1",width:"250px"},"Customer"),r.createElement(x,{variant:"body2"},null===(h=null===(g=B.customer)||void 0===g?void 0:g.business_credentials)||void 0===h?void 0:h.company_name)),r.createElement(D,{direction:"row",spacing:2},r.createElement(x,{variant:"body1",width:"250px"},"Order Status"),r.createElement(x,{variant:"body2",width:"250px"},B.status)),("placed"===B.status||"external_shipping_process"===B.status)&&"enduser"===T&&r.createElement(r.Fragment,null,r.createElement(_,{variant:"contained",color:"primary",onClick:function(){return Q(!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(N,{open:L,handleClose:function(){return Q(!1)},orderID:B.id,currentStatus:B.status,revalidateCallback:F})))),r.createElement(C,{item:!0,xs:12},r.createElement(D,{spacing:2},r.createElement(x,{variant:"h5"},"Documents"),r.createElement(w,{sx:{p:2}},r.createElement(D,{spacing:1},B.delivery_note?r.createElement(r.Fragment,null,r.createElement(x,{variant:"h6"},"Delivery Note"),r.createElement(x,null,null===(b=B.delivery_note)||void 0===b?void 0:b.name),r.createElement(_,{variant:"contained",onClick:function(){c("api/ipos/".concat(B.id),"delivery_note")}},"Download")):r.createElement(r.Fragment,null,r.createElement(x,{variant:"h5"},"Delivery Note"),r.createElement(x,{variant:"body1"},"Here you can upload the the delivery note for this order"),r.createElement(j,null),r.createElement(m,{reference:"api::e-commerce.opo",refID:B.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:F})))))),(null===(S=null===(I=null==B?void 0:B.notes)||void 0===I?void 0:I.data)||void 0===S?void 0:S.length)>0&&r.createElement(C,{item:!0,xs:12},r.createElement(D,{spacing:2},r.createElement(x,{variant:"h5"},"Notes"),r.createElement(s,{notes:B.notes.data}),r.createElement(j,null))),r.createElement(C,{item:!0,xs:12},r.createElement(D,{spacing:1},r.createElement(x,{variant:"h5"},"Items"),r.createElement(D,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:2,component:w,p:1},r.createElement(x,{variant:"body1"},"Show:"),["picked","packed","shipped","reports"].map((function(n){return r.createElement(q,{key:n,control:r.createElement(O,{checked:V.includes(n),onChange:function(r){r.target.checked?W(t(t([],e(V),!1),[n],!1)):W(V.filter((function(e){return e!==n})))}}),label:n.charAt(0).toUpperCase()+n.slice(1)})}))),"placed"===B.status&&r.createElement(f,{severity:"warning"},"Before confirmation you cannot update the items"),r.createElement(j,null),r.createElement("form",{action:M},r.createElement("input",{name:"id",type:"hidden",value:B.id}),G&&G.map((function(e,t){var n,a;return r.createElement(w,{sx:{p:2,mb:2},key:t},"placed"===B.status?r.createElement(p,{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:X,handleAddReport:Y,image:null===(a=null==e?void 0:e.product)||void 0===a?void 0:a.image,handleRemoveReportAtIndex:Z,revalidateCallback:F,showing:V}))})),r.createElement(w,{sx:{p:2}},r.createElement(D,{direction:"row",spacing:2,justifyContent:"end"},r.createElement(E,{text:"Update items",loadingText:"Loading..."}),r.createElement(v,{error:null==R?void 0:R.strapiErrors}),(null==R?void 0:R.message)&&r.createElement(f,{severity:"error"},null==R?void 0:R.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}})))||[]}}))}(G))}))))))}export{S as default};
6
+ import{__read as e,__spreadArray as t,__assign as r}from"../../../../node_modules/tslib/tslib.es6.js";import n,{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 R from"@mui/icons-material/Description";import W from"@mui/icons-material/Update";import{OpoStatusIndicator as F}from"./OpoStatusIndicator.js";var M={zodErrors:null,strapiErrors:null,data:null,message:null};function Y(e){var t=e.open,r=e.handleClose,a=e.orderID,o=e.currentStatus,i=e.revalidateCallback;return n.createElement(h,{open:t},n.createElement(x,null,"Confirm Order"),n.createElement(y,null,n.createElement(I,{spacing:2},n.createElement(b,null,"Are you sure you want to confirm this order?"),n.createElement(b,null,"Current status: ",o))),n.createElement(g,null,n.createElement(C,{variant:"contained",onClick:function(e){j("opos",[a]),i&&i(),r()}},"Yes"),n.createElement(C,{variant:"contained",onClick:r},"No")))}function z(t){var r=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 n.createElement("form",null,n.createElement(h,{open:r},n.createElement(x,null,"Cancel Return"),n.createElement(y,null,n.createElement(I,{spacing:2},n.createElement(b,null,"Are you sure you want to cancel this order?"),n.createElement(A,null,n.createElement(S,null,"By cancelling this order you will update it's status from ordered to cancelled"),n.createElement(S,null,"Please provide a reason for the cancellation"),n.createElement(S,null,"The customer will be notified about the cancellation and of the reason for the cancellation")),n.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}))),n.createElement(g,null,n.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"),n.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],re=ee[1],ne=e(a(["picked","packed","shipped","reports"]),2),ae=ne[0],oe=ne[1],ie=function(r,n,a){var o=t([],e(K),!1),i=o.findIndex((function(e){return e.id===n}));o[i][a]=r,V(o)},le=function(n,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),[n],!1);null==(null===(l=c[m])||void 0===l?void 0:l.reports)&&(c[m]=r(r({},c[m]),{reports:{data:[]}})),c[m].reports.data=s,V(c)},ce=function(r,n){var a,o,i=t([],e(K),!1),l=i.findIndex((function(e){return e.id===r})),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(n,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]),n.createElement(_,{sx:t([],e(Array.isArray(S)?S:[S]),!1)},n.createElement(k,{container:!0,spacing:2},n.createElement(k,{item:!0,xs:12},n.createElement(I,{spacing:2},n.createElement(I,{direction:"row",spacing:2,justifyContent:"space-between"},n.createElement(I,{spacing:2},n.createElement(b,{variant:"h3",component:"h1"},"Management Outbound Purchase Order"),n.createElement(b,{variant:"body1"},"Manage picking, packing and shipping of purchase order")),n.createElement(p,{content:"",related:[{id:A.id,__type:"api::e-commerce.opo"}],revalidateCallback:B})),n.createElement(D,null))),n.createElement(k,{item:!0,xs:12},n.createElement(b,{variant:"h5",sx:{py:1}},"Details")),n.createElement(k,{item:!0,xs:6},n.createElement(w,{elevation:2,sx:{p:2,height:"100%"}},n.createElement(I,{spacing:2},n.createElement(I,{direction:"row",spacing:2,alignItems:"center"},n.createElement(T,{color:"primary"}),n.createElement(b,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Purchase Order Number"),n.createElement(b,{variant:"body1",fontWeight:"medium"},A.opo_number)),n.createElement(I,{direction:"row",spacing:2,alignItems:"center"},n.createElement(R,{color:"primary"}),n.createElement(b,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Custom reference"),n.createElement(b,{variant:"body1",fontWeight:"medium"},A.customer_reference)),n.createElement(I,{direction:"row",spacing:2,alignItems:"center"},n.createElement(P,{color:"primary"}),n.createElement(b,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Order Date"),n.createElement(b,{variant:"body1",fontWeight:"medium"},A.order_date)),n.createElement(I,{direction:"row",spacing:2,alignItems:"center"},n.createElement(U,{color:"primary"}),n.createElement(b,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Customer"),n.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)),n.createElement(I,{direction:"row",spacing:2,alignItems:"center"},n.createElement(W,{color:"primary"}),n.createElement(b,{variant:"subtitle1",color:"text.secondary",width:"200px"},"Order Status"),n.createElement(F,{status:A.status}))))),("placed"===A.status||"external_shipping_process"===A.status)&&"enduser"===G&&n.createElement(k,{item:!0,xs:6},n.createElement(w,{elevation:2,sx:{p:2,height:"100%"}},n.createElement(I,{spacing:2},n.createElement(C,{variant:"contained",color:"primary",onClick:function(){return $(!0)}},"Confirm order"),n.createElement(f,{severity:"warning"},"Please confirm the order as soon as possible, only upon confirmation this order will be available to the dispatcher"),n.createElement(C,{variant:"contained",color:"error",onClick:function(){return re(!0)}},"Cancel order"),n.createElement(Y,{open:Z,handleClose:function(){return $(!1)},orderID:A.id,currentStatus:A.status,revalidateCallback:B}),n.createElement(z,{open:te,handleClose:function(){return re(!1)},orderID:A.id,revalidateCallback:B})))),n.createElement(k,{item:!0,xs:12},n.createElement(I,{spacing:2},n.createElement(b,{variant:"h5"},"Documents"),n.createElement(w,{sx:{p:2}},n.createElement(I,{spacing:1},A.delivery_note?n.createElement(n.Fragment,null,n.createElement(b,{variant:"h6"},"Delivery Note"),n.createElement(b,null,null===(x=A.delivery_note)||void 0===x?void 0:x.name),n.createElement(C,{variant:"contained",onClick:function(){m("api/ipos/".concat(A.id),"delivery_note")}},"Download")):n.createElement(n.Fragment,null,n.createElement(b,{variant:"h5"},"Delivery Note"),n.createElement(b,{variant:"body1"},"Here you can upload the the delivery note for this order"),n.createElement(D,null),n.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&&n.createElement(k,{item:!0,xs:12},n.createElement(I,{spacing:2},n.createElement(b,{variant:"h5"},"Notes"),n.createElement(u,{notes:A.notes.data}),n.createElement(D,null))),n.createElement(k,{item:!0,xs:12},n.createElement(I,{spacing:1},n.createElement(b,{variant:"h5"},"Items"),n.createElement(I,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:2,component:w,p:1},n.createElement(b,{variant:"body1"},"Show:"),["picked","packed","shipped","reports"].map((function(r){return n.createElement(O,{key:r,control:n.createElement(q,{checked:ae.includes(r),onChange:function(n){n.target.checked?oe(t(t([],e(ae),!1),[r],!1)):oe(ae.filter((function(e){return e!==r})))}}),label:r.charAt(0).toUpperCase()+r.slice(1)})}))),"placed"===A.status&&n.createElement(f,{severity:"warning"},"Before confirmation you cannot update the items"),n.createElement(D,null),n.createElement("form",{action:L},n.createElement("input",{name:"id",type:"hidden",value:A.id}),K&&K.map((function(e,t){var r,a;return n.createElement(w,{sx:{p:2,mb:2},key:t},"placed"===A.status||"external_shipping_process"===A.status||"done"===A.status||"cancelled"===A.status?n.createElement(s,{item:e,index:t,image:null===(r=null==e?void 0:e.product)||void 0===r?void 0:r.image}):n.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}))})),n.createElement(w,{sx:{p:2}},n.createElement(I,{direction:"row",spacing:2,justifyContent:"end"},n.createElement(E,{text:"Update items",loadingText:"Loading..."}),n.createElement(v,{error:null==J?void 0:J.strapiErrors}),(null==J?void 0:J.message)&&n.createElement(f,{severity:"error"},null==J?void 0:J.message))),n.createElement("input",{type:"hidden",name:"items",value:JSON.stringify(function(e){return e.map((function(e){var t,r;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===(r=null===(t=e.reports)||void 0===t?void 0:t.data)||void 0===r?void 0:r.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};