umwd-components 0.1.595 → 0.1.596
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/common/AmountUpdater.js +1 -1
- package/dist/src/components/e-commerce/opo/ManageOpoForm.js +1 -1
- package/dist/src/components/e-commerce/opo/OpoItemUpdater.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/common/AmountUpdater.d.ts +2 -1
- package/dist/types/types/common/AmountUpdater.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/common/AmountUpdater.tsx +5 -0
- package/src/components/e-commerce/opo/ManageOpoForm.tsx +6 -6
- package/src/components/e-commerce/opo/OpoItemUpdater.tsx +3 -0
- package/src/types/common/AmountUpdater.ts +1 -0
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__read as e}from"../../../node_modules/tslib/tslib.es6.js";import t,{useState as n,useEffect as a}from"react";import l from"@mui/material/Box";import r from"@mui/material/IconButton";import i from"@mui/material/Typography";import c from"@mui/material/Stack";import o from"@mui/material/Badge";import m from"@mui/icons-material/RemoveCircle";import d from"@mui/icons-material/AddCircle";import{useTheme as u,styled as p}from"@mui/material/styles";function g(g){var s=g.currentValue,f=g.totalValue,E=g.minNewValue,b=g.maxNewValue,x=g.color,C=g.handleChange,h=g.offsetEnd,k=100/f*s,
|
|
6
|
+
import{__read as e}from"../../../node_modules/tslib/tslib.es6.js";import t,{useState as n,useEffect as a}from"react";import l from"@mui/material/Box";import r from"@mui/material/IconButton";import i from"@mui/material/Typography";import c from"@mui/material/Stack";import o from"@mui/material/Badge";import m from"@mui/icons-material/RemoveCircle";import d from"@mui/icons-material/AddCircle";import{useTheme as u,styled as p}from"@mui/material/styles";function g(g){var s=g.currentValue,f=g.totalValue,E=g.minNewValue,b=g.maxNewValue,x=g.color,C=g.handleChange,h=g.offsetEnd,k=g.revalidateCallback,z=100/f*s,v=e(n(s),2),y=v[0],R=v[1],B=100/f*y,w=h?100/f*h*-1:0,O=u(),V=function(e){y+e<=b&&(R(y+e),C(y+e),k&&k())},M=function(e){y-e>=E&&(R(y-e),C(y-e),k&&k())};a((function(){R(s)}),[s]);var j=p(o)((function(e){return e.theme,{"& .MuiBadge-badge":{backgroundColor:"#fff",fontWeight:"bold",color:"black",mixBlendMode:"lighten",margin:"-1px 0px",padding:"0px 4px"}}})),I=p(r)((function(e){var t=e.theme;return{"&:hover":{color:t.palette.primary.main,"& .MuiBadge-badge":{backgroundColor:t.palette.primary.main}}}}));return t.createElement(l,{sx:[{display:"flex",alignItems:"center",background:"\n linear-gradient(90deg, ".concat(O.palette[x].main,"55 ").concat(z,"%, ").concat(O.palette[x].main,"33 ").concat(z,"%),\n linear-gradient(90deg, ").concat(O.palette[x].main,"55 ").concat(B,"%, ").concat(O.palette[x].main,"33 ").concat(B,"%)\n "),width:"100%",borderRadius:"16px",padding:"2px",justifyContent:"space-between"},y-f==1&&{paddingRight:"4px",background:"linear-gradient(-90deg, ".concat(O.palette[x].main,"33 4px, ").concat(O.palette[x].main,"66 4px)")},y-f==2&&{paddingRight:"8px",background:"linear-gradient(-90deg, ".concat(O.palette[x].main,"33 8px, ").concat(O.palette[x].main,"66 8px)")},y-f==3&&{paddingRight:"12px",background:"linear-gradient(-90deg, ".concat(O.palette[x].main,"33 12px, ").concat(O.palette[x].main,"66 12px)")},y-f==4&&{paddingRight:"16px",background:"linear-gradient(-90deg, ".concat(O.palette[x].main,"33 16px, ").concat(O.palette[x].main,"66 16px)")},y-f>=5&&{paddingRight:"20px",background:"linear-gradient(-90deg, ".concat(O.palette[x].main,"33 20px, ").concat(O.palette[x].main,"66 20px)")},null!=h&&h<0&&{background:"linear-gradient(-90deg, ".concat(O.palette.error.main," ").concat(w,"%, ").concat(O.palette[x].main,"66 ").concat(w,"%)")}]},t.createElement(l,null,y-100>=E&&t.createElement(I,{size:"small",onClick:function(e){return M(100)}},t.createElement(j,{badgeContent:100,max:100,anchorOrigin:{vertical:"bottom",horizontal:"left"}},t.createElement(m,null))),y-25>=E&&t.createElement(I,{size:"small",onClick:function(e){return M(25)}},t.createElement(j,{badgeContent:25,anchorOrigin:{vertical:"bottom",horizontal:"left"}},t.createElement(m,null))),y-10>=E&&t.createElement(I,{size:"small",onClick:function(e){return M(10)}},t.createElement(j,{badgeContent:10,anchorOrigin:{vertical:"bottom",horizontal:"left"}},t.createElement(m,null))),y-5>=E&&t.createElement(I,{size:"small",onClick:function(e){return M(5)}},t.createElement(j,{badgeContent:5,anchorOrigin:{vertical:"bottom",horizontal:"left"}},t.createElement(m,null))),t.createElement(I,{size:"small",onClick:function(){y-1>=E&&(R(y-1),C(y-1),k&&k())},disabled:y-1<E},t.createElement(m,null))),t.createElement(c,{direction:"row",spacing:1},s!==f?t.createElement(i,{variant:"body2"},"".concat(s," / ").concat(f)):t.createElement(i,{variant:"body2"},"".concat(s)),y!==s&&t.createElement(i,{variant:"body2"},"+ (".concat(y-s,") = ").concat(y))),t.createElement(l,null,t.createElement(I,{size:"small",onClick:function(){y+1<=b&&(R(y+1),C(y+1),k&&k())},disabled:y+1>b},t.createElement(d,null)),y+5<=b&&t.createElement(I,{size:"small",onClick:function(e){return V(5)}},t.createElement(j,{badgeContent:5},t.createElement(d,null))),y+10<=b&&t.createElement(I,{size:"small",onClick:function(e){return V(10)}},t.createElement(j,{badgeContent:10},t.createElement(d,null))),y+25<=b&&t.createElement(I,{size:"small",onClick:function(e){return V(25)}},t.createElement(j,{badgeContent:25},t.createElement(d,null))),y+100<=b&&t.createElement(I,{size:"small",onClick:function(e){return V(100)}},t.createElement(j,{badgeContent:100,max:100},t.createElement(d,null)))))}export{g as AmountUpdater,g 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 r,{useState as a,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 m from"./OpoItemUpdater.js";import l from"./OpoItemDisplay.js";import c from"../../logistics/note/NotesDisplay.js";import d from"../../logistics/note/NoteTakingComponent.js";import{StrapiErrors as s}from"../../StrapiErrors.js";import{SubmitButton as u}from"../../SubmitButton.js";import p from"@mui/material/Alert";import E from"@mui/material/Dialog";import v from"@mui/material/DialogActions";import f from"@mui/material/DialogContent";import g from"@mui/material/DialogTitle";import y from"@mui/material/Typography";import h from"@mui/material/Button";import b from"@mui/material/Grid";import C from"@mui/material/Box";import x from"@mui/material/Paper";import _ from"@mui/material/Stack";import w from"@mui/material/Divider";import k from"@mui/material/Card";import D from"@mui/material/CardContent";import{confirmationService as O}from"../../../data/services/logistics/ipo/confirmation-service.js";var j={zodErrors:null,strapiErrors:null,data:null,message:null};function q(e){var t=e.open,a=e.handleClose,n=e.orderID,i=e.currentStatus,o=e.revalidateCallback;return r.createElement(E,{open:t},r.createElement(g,null,"Confirm Order"),r.createElement(f,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(v,null,r.createElement(h,{variant:"contained",onClick:function(e){O("opos",[n]),o&&o()}},"Confirm"),r.createElement(h,{variant:"contained",onClick:a},"Cancel")))}function S(E){var v,f,g,O,S=E.opo,A=E.sx,I=E.revalidateCallback;E.handleClose;var N=E.role,T=e(i(o,j),2),B=T[0],P=T[1],U=e(a(S.opo_items.data?S.opo_items.data:[]),2),M=U[0],z=U[1]
|
|
6
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as a,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 m from"./OpoItemUpdater.js";import l from"./OpoItemDisplay.js";import c from"../../logistics/note/NotesDisplay.js";import d from"../../logistics/note/NoteTakingComponent.js";import{StrapiErrors as s}from"../../StrapiErrors.js";import{SubmitButton as u}from"../../SubmitButton.js";import p from"@mui/material/Alert";import E from"@mui/material/Dialog";import v from"@mui/material/DialogActions";import f from"@mui/material/DialogContent";import g from"@mui/material/DialogTitle";import y from"@mui/material/Typography";import h from"@mui/material/Button";import b from"@mui/material/Grid";import C from"@mui/material/Box";import x from"@mui/material/Paper";import _ from"@mui/material/Stack";import w from"@mui/material/Divider";import k from"@mui/material/Card";import D from"@mui/material/CardContent";import{confirmationService as O}from"../../../data/services/logistics/ipo/confirmation-service.js";var j={zodErrors:null,strapiErrors:null,data:null,message:null};function q(e){var t=e.open,a=e.handleClose,n=e.orderID,i=e.currentStatus,o=e.revalidateCallback;return r.createElement(E,{open:t},r.createElement(g,null,"Confirm Order"),r.createElement(f,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(v,null,r.createElement(h,{variant:"contained",onClick:function(e){O("opos",[n]),o&&o()}},"Confirm"),r.createElement(h,{variant:"contained",onClick:a},"Cancel")))}function S(E){var v,f,g,O,S=E.opo,A=E.sx,I=E.revalidateCallback;E.handleClose;var N=E.role,T=e(i(o,j),2),B=T[0],P=T[1],U=e(a(S.opo_items.data?S.opo_items.data:[]),2),M=U[0],z=U[1],F=e(a(!1),2),G=F[0],J=F[1],L=function(r,a,n){var i=t([],e(M),!1),o=i.findIndex((function(e){return e.id===a}));i[o][n]=r,z(i)};return n((function(){var e;(null===(e=S.opo_items)||void 0===e?void 0:e.data)&&z(S.opo_items.data)}),[S,I]),r.createElement(C,{sx:t([],e(Array.isArray(A)?A:[A]),!1)},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(d,{content:"",related:[{id:S.id,__type:"api::e-commerce.opo"}],revalidateCallback:I})),r.createElement(w,null))),r.createElement(b,{item:!0,xs:6},r.createElement(_,{spacing:1},r.createElement(y,{variant:"h5"},"Details"),r.createElement(_,{direction:"row",spacing:2},r.createElement(y,{variant:"body1",width:"250px"},"Purchase Order Number"),r.createElement(y,{variant:"body2"},S.opo_number)),r.createElement(_,{direction:"row",spacing:2},r.createElement(y,{variant:"body1",width:"250px"},"Custom reference"),r.createElement(y,{variant:"body2"},S.customer_inhouse_reference)),r.createElement(_,{direction:"row",spacing:2},r.createElement(y,{variant:"body1",width:"250px"},"Order Date"),r.createElement(y,{variant:"body2"},S.order_date)),r.createElement(_,{direction:"row",spacing:2},r.createElement(y,{variant:"body1",width:"250px"},"Customer"),r.createElement(y,{variant:"body2"},null===(f=null===(v=S.customer)||void 0===v?void 0:v.business_credentials)||void 0===f?void 0:f.company_name)),r.createElement(_,{direction:"row",spacing:2},r.createElement(y,{variant:"body1",width:"250px"},"Order Status"),r.createElement(y,{variant:"body2",width:"250px"},S.status)),("placed"===S.status||"external_shipping_process"===S.status)&&"enduser"===N&&r.createElement(r.Fragment,null,r.createElement(h,{variant:"contained",color:"primary",onClick:function(){return J(!0)}},"Confirm order"),r.createElement(p,{severity:"warning"},"Please confirm the order as soon as possible, only upon confirmation this order will be available to the dispatcher"),r.createElement(q,{open:G,handleClose:function(){return J(!1)},orderID:S.id,currentStatus:S.status,revalidateCallback:I})))),r.createElement(b,{item:!0,xs:12},r.createElement(_,{spacing:2},r.createElement(y,{variant:"h5"},"Documents"),r.createElement(k,{variant:"outlined"},r.createElement(D,null,r.createElement(_,{spacing:1},"// TODO - Should we add options to upload a shipping label and a delivery note?? where do these notes come from? are they generated by the system or are they uploaded by the enduser?"))))),(null===(O=null===(g=null==S?void 0:S.notes)||void 0===g?void 0:g.data)||void 0===O?void 0:O.length)>0&&r.createElement(b,{item:!0,xs:12},r.createElement(_,{spacing:2},r.createElement(y,{variant:"h5"},"Notes"),r.createElement(c,{notes:S.notes.data}),r.createElement(w,null))),r.createElement(b,{item:!0,xs:12},r.createElement(_,{spacing:1},r.createElement(y,{variant:"h5"},"Items"),"placed"===S.status&&r.createElement(p,{severity:"warning"},"Before confirmation you cannot update the items"),r.createElement(w,null),r.createElement("form",{action:P},r.createElement("input",{name:"id",type:"hidden",value:S.id}),M&&M.map((function(e,t){var a,n;return console.log("item",e),r.createElement(x,{sx:{p:2,mb:2},key:t},"placed"===S.status?r.createElement(l,{item:e,index:t,image:null===(a=null==e?void 0:e.product)||void 0===a?void 0:a.image}):r.createElement(m,{item:e,index:t,handleUpdateQuantity:L,image:null===(n=null==e?void 0:e.product)||void 0===n?void 0:n.image,revalidateCallback:I}))})),r.createElement(x,{sx:{p:2}},r.createElement(_,{direction:"row",spacing:2,justifyContent:"end"},r.createElement(u,{text:"Update items",loadingText:"Loading..."}),r.createElement(s,{error:null==B?void 0:B.strapiErrors}),(null==B?void 0:B.message)&&r.createElement(p,{severity:"error"},null==B?void 0:B.message))),r.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}}))}(M))}))))))}export{S as default};
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* @copyright Jelle Paulus
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as a}from"react";import
|
|
6
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as a}from"react";import r from"@mui/material/Stack";import n from"@mui/material/Typography";import i from"@mui/material/IconButton";import o from"@mui/material/Divider";import l from"@mui/material/Collapse";import{AmountUpdater as m}from"../../common/AmountUpdater.js";import c from"@mui/icons-material/ArrowDropDown";import u from"../../common/ImagePreviewTooltip.js";import d from"../../logistics/report/ReportMakingComponent.js";import p from"../../logistics/report/ReportsDisplay.js";function s(s){var f=s.item,y=s.index,E=s.handleUpdateQuantity,g=s.image,v=s.revalidateCallback,b=f.line_item_number,k=f.product,h=f.ordered_quantity,V=f.picked_quantity,w=f.packed_quantity,C=f.shipped_quantity,_=f.reports,q=e(a(!1),2),N=q[0],x=q[1];t.useMemo((function(){return void 0!==(null==_?void 0:_.data)&&_.data.length>0?_.data.filter((function(e){return"picked"===e.type})).reduce((function(e,t){return e+t.quantity}),0):0}),[_]);var j=t.useMemo((function(){return void 0!==(null==_?void 0:_.data)&&_.data.length>0?_.data.filter((function(e){return"packed"===e.type})).reduce((function(e,t){return e+t.quantity}),0):0}),[_]);return t.useMemo((function(){return void 0!==(null==_?void 0:_.data)&&_.data.length>0?_.data.filter((function(e){return"shipped"===e.type})).reduce((function(e,t){return e+t.quantity}),0):0}),[_]),t.createElement(r,{spacing:1,key:y},f&&t.createElement(t.Fragment,null,t.createElement(r,{direction:"row",justifyContent:"space-between"},t.createElement(r,{spacing:1},t.createElement(n,{variant:"body1"},"Line Item Number: ",b),t.createElement(n,{variant:"body1"},"Part Number: ",null==k?void 0:k.product_number)),g&&t.createElement(t.Fragment,null,t.createElement(u,{image:g,label:null==k?void 0:k.title}))),t.createElement(n,{variant:"body2"},"Picked"),t.createElement(m,{currentValue:V,totalValue:h+-j,minNewValue:0+w+-j,maxNewValue:h+-j,color:"info",handleChange:function(e){E(e,f.id,"picked_quantity")},revalidateCallback:v}),t.createElement(n,{variant:"body2"},"Packed"),t.createElement(m,{currentValue:w,totalValue:h,minNewValue:0+C,maxNewValue:V+j,color:"info",handleChange:function(e){E(e,f.id,"packed_quantity")},revalidateCallback:v,offsetEnd:j}),t.createElement(o,{sx:{p:0}},t.createElement(r,{direction:"row",spacing:1,alignItems:"center"},t.createElement(n,{variant:"body2"},"Irregularities / Corrections"),t.createElement(i,{onClick:function(){return x(!N)}},t.createElement(c,null)))),t.createElement(l,{in:N},t.createElement(r,{spacing:2},t.createElement(n,{variant:"body2"},"Here you can report and correct for damages wrong items etc. Do not forget to click the button!"),t.createElement(p,{reports:_.data}),t.createElement(d,{content:"content",quantity:0,type:"packed",minValue:-(V+j),maxValue:0,related:[{id:f.id,__type:"api::e-commerce.opo-item"}],revalidateCallback:v}))),t.createElement(n,{variant:"body2"},"Shipped"),t.createElement(m,{currentValue:C,totalValue:h,minNewValue:0,maxNewValue:w,color:"info",handleChange:function(e){E(e,f.id,"shipped_quantity")},revalidateCallback:v})))}export{s as default};
|