umwd-components 0.1.596 → 0.1.598
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/opo/ManageOpoForm.js +1 -1
- package/dist/src/components/e-commerce/opo/OpoItemUpdater.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/e-commerce/opo/ManageOpoForm.tsx +4 -1
- package/src/components/e-commerce/opo/OpoItemUpdater.tsx +1 -3
|
@@ -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],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
|
|
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]),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 n from"@mui/material/Stack";import r 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,h=f.product,k=f.ordered_quantity,V=f.picked_quantity,w=f.packed_quantity,_=f.shipped_quantity,q=f.reports,C=e(a(!1),2),N=C[0],x=C[1];t.useMemo((function(){return void 0!==(null==q?void 0:q.data)&&q.data.length>0?q.data.filter((function(e){return"picked"===e.type})).reduce((function(e,t){return e+t.quantity}),0):0}),[q]);var j=t.useMemo((function(){return void 0!==(null==q?void 0:q.data)&&q.data.length>0?q.data.filter((function(e){return"packed"===e.type})).reduce((function(e,t){return e+t.quantity}),0):0}),[q]);return t.useMemo((function(){return void 0!==(null==q?void 0:q.data)&&q.data.length>0?q.data.filter((function(e){return"shipped"===e.type})).reduce((function(e,t){return e+t.quantity}),0):0}),[q]),t.createElement(n,{spacing:1,key:y},f&&t.createElement(t.Fragment,null,t.createElement(n,{direction:"row",justifyContent:"space-between"},t.createElement(n,{spacing:1},t.createElement(r,{variant:"body1"},"Line Item Number: ",b),t.createElement(r,{variant:"body1"},"Part Number: ",null==h?void 0:h.product_number)),g&&t.createElement(t.Fragment,null,t.createElement(u,{image:g,label:null==h?void 0:h.title}))),t.createElement(r,{variant:"body2"},"Picked"),t.createElement(m,{currentValue:V,totalValue:k+-j,minNewValue:0+w+-j,maxNewValue:k+-j,color:"info",handleChange:function(e){E(e,f.id,"picked_quantity")}}),t.createElement(r,{variant:"body2"},"Packed"),t.createElement(m,{currentValue:w,totalValue:k,minNewValue:0+_,maxNewValue:V+j,color:"info",handleChange:function(e){E(e,f.id,"packed_quantity")},offsetEnd:j}),t.createElement(o,{sx:{p:0}},t.createElement(n,{direction:"row",spacing:1,alignItems:"center"},t.createElement(r,{variant:"body2"},"Irregularities / Corrections"),t.createElement(i,{onClick:function(){return x(!N)}},t.createElement(c,null)))),t.createElement(l,{in:N},t.createElement(n,{spacing:2},t.createElement(r,{variant:"body2"},"Here you can report and correct for damages wrong items etc. Do not forget to click the button!"),t.createElement(p,{reports:q.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(r,{variant:"body2"},"Shipped"),t.createElement(m,{currentValue:_,totalValue:k,minNewValue:0,maxNewValue:w,color:"info",handleChange:function(e){E(e,f.id,"shipped_quantity")}})))}export{s as default};
|