umwd-components 0.1.626 → 0.1.627
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/dist/src/components/e-commerce/iro/ManageIROForm.js +1 -1
- package/dist/src/components/e-commerce/iro/TextualManageIROForm.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/e-commerce/iro/ManageIROForm.tsx +1 -1
- package/src/components/e-commerce/iro/TextualManageIROForm.tsx +1 -1
|
@@ -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 r,{useState as a}from"react";import{useFormState as i}from"react-dom";import{updateIpoAction as n}from"../../../data/actions/logistics/ipo/updateIpoAction.js";import m from"../../logistics/note/NotesDisplay.js";import o from"../../logistics/note/NoteTakingComponent.js";import{StrapiErrors as l}from"../../StrapiErrors.js";import{SubmitButton as c}from"../../SubmitButton.js";import s from"@mui/material/Alert";import"@mui/material/Dialog";import"@mui/material/DialogActions";import"@mui/material/DialogContent";import"@mui/material/DialogTitle";import d from"@mui/material/Typography";import"@mui/material/Button";import p from"@mui/material/Grid";import u from"@mui/material/Box";import E from"@mui/material/Paper";import g from"@mui/material/Stack";import v from"@mui/material/Divider";import"next/headers";var y={zodErrors:null,strapiErrors:null,data:null,message:null};function f(f){var h,x,b,w=f.data,_=f.sx,D=f.revalidateCallback;f.handleClose;var j=f.role,C=e(i(n,y),2),q=C[0],S=C[1],k=e(a(w.items.data?w.items.data:[]),2),A=k[0];k[1];var N=e(a(!1),2);N[0],N[1];return r.createElement(u,{sx:t([],e(Array.isArray(_)?_:[_]),!1)},r.createElement(p,{container:!0,spacing:2},r.createElement(p,{item:!0,xs:12},r.createElement(g,{spacing:2},r.createElement(g,{direction:"row",spacing:2,justifyContent:"space-between"},r.createElement(g,{spacing:2},r.createElement(d,{variant:"h3",component:"h1"},"Management Inbound Purchase Order"),r.createElement(d,{variant:"body1"},"Manage arrival, registration and recieval of purchase order")),r.createElement(o,{content:"",related:[{id:w.id,__type:"api::logistics.ipo"}],revalidateCallback:D})),r.createElement(v,null))),r.createElement(p,{item:!0,xs:6},r.createElement(g,{spacing:1},r.createElement(d,{variant:"h5"},"Details"),r.createElement(g,{direction:"row",spacing:2},r.createElement(d,{variant:"body1",width:"250px"},"Purchase Order Number"),r.createElement(d,{variant:"body2"},w.
|
|
6
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as a}from"react";import{useFormState as i}from"react-dom";import{updateIpoAction as n}from"../../../data/actions/logistics/ipo/updateIpoAction.js";import m from"../../logistics/note/NotesDisplay.js";import o from"../../logistics/note/NoteTakingComponent.js";import{StrapiErrors as l}from"../../StrapiErrors.js";import{SubmitButton as c}from"../../SubmitButton.js";import s from"@mui/material/Alert";import"@mui/material/Dialog";import"@mui/material/DialogActions";import"@mui/material/DialogContent";import"@mui/material/DialogTitle";import d from"@mui/material/Typography";import"@mui/material/Button";import p from"@mui/material/Grid";import u from"@mui/material/Box";import E from"@mui/material/Paper";import g from"@mui/material/Stack";import v from"@mui/material/Divider";import"next/headers";var y={zodErrors:null,strapiErrors:null,data:null,message:null};function f(f){var h,x,b,w=f.data,_=f.sx,D=f.revalidateCallback;f.handleClose;var j=f.role,C=e(i(n,y),2),q=C[0],S=C[1],k=e(a(w.items.data?w.items.data:[]),2),A=k[0];k[1];var N=e(a(!1),2);N[0],N[1];return r.createElement(u,{sx:t([],e(Array.isArray(_)?_:[_]),!1)},r.createElement(p,{container:!0,spacing:2},r.createElement(p,{item:!0,xs:12},r.createElement(g,{spacing:2},r.createElement(g,{direction:"row",spacing:2,justifyContent:"space-between"},r.createElement(g,{spacing:2},r.createElement(d,{variant:"h3",component:"h1"},"Management Inbound Purchase Order"),r.createElement(d,{variant:"body1"},"Manage arrival, registration and recieval of purchase order")),r.createElement(o,{content:"",related:[{id:w.id,__type:"api::logistics.ipo"}],revalidateCallback:D})),r.createElement(v,null))),r.createElement(p,{item:!0,xs:6},r.createElement(g,{spacing:1},r.createElement(d,{variant:"h5"},"Details"),r.createElement(g,{direction:"row",spacing:2},r.createElement(d,{variant:"body1",width:"250px"},"Purchase Order Number"),r.createElement(d,{variant:"body2"},w.return_number)),r.createElement(g,{direction:"row",spacing:2},r.createElement(d,{variant:"body1",width:"250px"},"Custom reference")),r.createElement(g,{direction:"row",spacing:2},r.createElement(d,{variant:"body1",width:"250px"},"Order Date"),r.createElement(d,{variant:"body2"},w.return_date)),r.createElement(g,{direction:"row",spacing:2},r.createElement(d,{variant:"body1",width:"250px"},"Supplier")),r.createElement(g,{direction:"row",spacing:2},r.createElement(d,{variant:"body1",width:"250px"},"Order Status"),r.createElement(d,{variant:"body2",width:"250px"},w.status)))),r.createElement(p,{item:!0,xs:12},r.createElement(g,{spacing:2},r.createElement(d,{variant:"h5"},"Documents"),r.createElement(E,{sx:{p:2}},r.createElement(g,{spacing:1},"enduser"===j&&r.createElement(r.Fragment,null))))),(null===(x=null===(h=null==w?void 0:w.notes)||void 0===h?void 0:h.data)||void 0===x?void 0:x.length)>0&&r.createElement(p,{item:!0,xs:12},r.createElement(g,{spacing:2},r.createElement(d,{variant:"h5"},"Notes"),r.createElement(m,{notes:w.notes.data}),r.createElement(v,null))),r.createElement(p,{item:!0,xs:12},r.createElement(g,{spacing:1},r.createElement(d,{variant:"h5"},"Items"),r.createElement(v,null),r.createElement("form",{action:S},r.createElement("input",{name:"id",type:"hidden",value:w.id}),(null===(b=null==w?void 0:w.items)||void 0===b?void 0:b.data)&&w.items.data.map((function(e,t){return console.log("item",e),r.createElement(E,{sx:{p:2,mb:2},key:t})})),r.createElement(E,{sx:{p:2}},r.createElement(g,{direction:"row",spacing:2,justifyContent:"end"},r.createElement(c,{text:"Update items",loadingText:"Loading..."}),r.createElement(l,{error:null==q?void 0:q.strapiErrors}),(null==q?void 0:q.message)&&r.createElement(s,{severity:"error"},null==q?void 0:q.message))),r.createElement("input",{type:"hidden",name:"items",value:JSON.stringify(function(e){return e.map((function(e){return{id:e.id,received_quantity:e.received_quantity,registered_quantity:e.registered_quantity,released_quantity:e.released_quantity}}))}(A))}))))))}export{f 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 r}from"../../../../node_modules/tslib/tslib.es6.js";import a,{useState as
|
|
6
|
+
import{__read as e,__spreadArray as t,__assign as r}from"../../../../node_modules/tslib/tslib.es6.js";import a,{useState as n,useEffect as i}from"react";import{useFormState as o}from"react-dom";import{updateIroAction as m}from"../../../data/actions/e-commerce/iro/updateIroAction.js";import l from"./TextualIROItemUpdater.js";import d from"./IroItemDisplay.js";import c from"../../logistics/note/NotesDisplay.js";import s from"../../logistics/note/NoteTakingComponent.js";import{StrapiErrors as u}from"../../StrapiErrors.js";import{SubmitButton as p}from"../../SubmitButton.js";import v from"@mui/material/Alert";import"@mui/material/Dialog";import"@mui/material/DialogActions";import"@mui/material/DialogContent";import"@mui/material/DialogTitle";import E from"@mui/material/Typography";import"@mui/material/Button";import f from"@mui/material/Grid";import g from"@mui/material/Box";import y from"@mui/material/Paper";import h from"@mui/material/Stack";import x from"@mui/material/Divider";import"next/headers";import{FormControlLabel as b,Checkbox as w}from"@mui/material";var I={zodErrors:null,strapiErrors:null,data:null,message:null};function C(C){var j,D,k=C.data,A=C.sx,S=C.revalidateCallback;C.handleClose,C.role;var _=e(o(m,I),2),q=_[0],O=_[1],N=e(n(k.items.data?k.items.data:[]),2),T=N[0],U=N[1],B=e(n(!1),2);B[0],B[1];var R=e(n(["received","registered","released","reports"]),2),P=R[0],M=R[1],z=function(r,a,n){var i=t([],e(T),!1),o=i.findIndex((function(e){return e.id===a}));i[o][n]=r,U(i)},G=function(a,n){var i,o,m,l=t([],e(T),!1),d=l.findIndex((function(e){return e.id===n})),c=(null===(o=null===(i=l[d])||void 0===i?void 0:i.reports)||void 0===o?void 0:o.data)||[],s=t(t([],e(c),!1),[a],!1);null==(null===(m=l[d])||void 0===m?void 0:m.reports)&&(l[d]=r(r({},l[d]),{reports:{data:[]}})),l[d].reports.data=s,U(l)},J=function(r,a){var n,i,o=t([],e(T),!1),m=o.findIndex((function(e){return e.id===r})),l=(null===(i=null===(n=o[m])||void 0===n?void 0:n.reports)||void 0===i?void 0:i.data)||[],d=l.filter((function(e){return"id"in e})),c=l.filter((function(e){return!("id"in e)}));c.splice(a,1);var s=t(t([],e(d),!1),e(c),!1);o[m].reports.data=s,U(o)};return i((function(){"Iro Updated"===(null==q?void 0:q.message)&&S&&S()}),[q]),i((function(){var e;(null===(e=k.items)||void 0===e?void 0:e.data)&&U(k.items.data?k.items.data:[])}),[k]),a.createElement(g,{sx:t([],e(Array.isArray(A)?A:[A]),!1)},a.createElement(f,{container:!0,spacing:2},a.createElement(f,{item:!0,xs:12},a.createElement(h,{spacing:2},a.createElement(h,{direction:"row",spacing:2,justifyContent:"space-between"},a.createElement(h,{spacing:2},a.createElement(E,{variant:"h3",component:"h1"},"Management Inbound Purchase Order"),a.createElement(E,{variant:"body1"},"Manage arrival, registration and recieval of purchase order")),a.createElement(s,{content:"",related:[{id:k.id,__type:"api::e-commerce.iro"}],revalidateCallback:S})),a.createElement(x,null))),a.createElement(f,{item:!0,xs:6},a.createElement(h,{spacing:1},a.createElement(E,{variant:"h5"},"Details"),a.createElement(h,{direction:"row",spacing:2},a.createElement(E,{variant:"body1",width:"250px"},"Purchase Order Number"),a.createElement(E,{variant:"body2"},k.return_number)),a.createElement(h,{direction:"row",spacing:2},a.createElement(E,{variant:"body1",width:"250px"},"Custom reference")),a.createElement(h,{direction:"row",spacing:2},a.createElement(E,{variant:"body1",width:"250px"},"Order Date"),a.createElement(E,{variant:"body2"},k.return_date)),a.createElement(h,{direction:"row",spacing:2},a.createElement(E,{variant:"body1",width:"250px"},"Supplier")),a.createElement(h,{direction:"row",spacing:2},a.createElement(E,{variant:"body1",width:"250px"},"Order Status"),a.createElement(E,{variant:"body2",width:"250px"},k.status)))),a.createElement(f,{item:!0,xs:12},a.createElement(h,{spacing:2},a.createElement(E,{variant:"h5"},"Documents"),a.createElement(y,{sx:{p:2}},a.createElement(h,{spacing:1})))),(null===(D=null===(j=null==k?void 0:k.notes)||void 0===j?void 0:j.data)||void 0===D?void 0:D.length)>0&&a.createElement(f,{item:!0,xs:12},a.createElement(h,{spacing:2},a.createElement(E,{variant:"h5"},"Notes"),a.createElement(c,{notes:k.notes.data}),a.createElement(x,null))),a.createElement(f,{item:!0,xs:12},a.createElement(h,{spacing:1},a.createElement(E,{variant:"h5"},"Items"),a.createElement(h,{direction:"row",alignItems:"center",justifyContent:"flex-end",spacing:2,component:y,p:1},a.createElement(E,{variant:"body1"},"Show:"),["received","registered","released","reports"].map((function(r){return a.createElement(b,{key:r,control:a.createElement(w,{checked:P.includes(r),onChange:function(a){a.target.checked?M(t(t([],e(P),!1),[r],!1)):M(P.filter((function(e){return e!==r})))}}),label:r.charAt(0).toUpperCase()+r.slice(1)})}))),"requested"===k.status&&a.createElement(v,{severity:"warning"},"Before confirmation you cannot update the items"),a.createElement(x,null),a.createElement("form",{action:O},a.createElement("input",{name:"id",type:"hidden",value:k.id}),T&&T.map((function(e,t){var r,n;return a.createElement(y,{sx:{p:2,mb:2},key:t},"requested"===k.status?a.createElement(d,{item:e,index:t,image:null===(r=null==e?void 0:e.product)||void 0===r?void 0:r.image}):a.createElement(l,{item:e,index:t,handleUpdateQuantity:z,handleAddReport:G,image:null===(n=null==e?void 0:e.product)||void 0===n?void 0:n.image,handleRemoveReportAtIndex:J,revalidateCallback:S,showing:P}))})),a.createElement(y,{sx:{p:2}},a.createElement(h,{direction:"row",spacing:2,justifyContent:"end"},a.createElement(p,{text:"Update items",loadingText:"Loading..."}),a.createElement(u,{error:null==q?void 0:q.strapiErrors}),(null==q?void 0:q.message)&&a.createElement(v,{severity:"error"},null==q?void 0:q.message))),a.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,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}})))||[]}}))}(T))}))))))}export{C as default};
|