umwd-components 0.1.337 → 0.1.340

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}from"../../../../node_modules/tslib/tslib.es6.js";import{useTheme as t,Stack as n,Typography as a,Divider as r,IconButton as i,Collapse as c}from"@mui/material";import{AmountUpdater as u}from"../../common/AmountUpdater.js";import o from"@mui/icons-material/ArrowDropDown";import{useState as l}from"react";import m from"../../common/ImagePreviewTooltip.js";function d(d){var R=d.item,v=d.index;d.handleAddReport,d.handleUpdateQuantity;var s=d.image;d.handleRemoveReportAtIndex;var p=R.line_item_number,y=R.product,f=R.arrived_quantity,E=R.registered_quantity,g=R.recieved_quantity,b=R.ordered_quantity,q=R.arrived_bad_reasons,_=R.registered_bad_reasons,h=e(l(!1),2),w=h[0],V=h[1];t();var N=e(l(f),2),x=N[0],C=N[1],A=e(l(E),2),I=A[0],j=A[1],k=e(l(g),2),D=k[0],F=k[1];return React.createElement(n,{spacing:1,key:v},R&&React.createElement(React.Fragment,null,React.createElement(n,{direction:"row",justifyContent:"space-between"},React.createElement(n,{spacing:1},React.createElement(a,{variant:"body1"},"Line Item Number: ",p),React.createElement(a,{variant:"body1"},"Part Number: ",y.product_number)),s&&React.createElement(React.Fragment,null,React.createElement(m,{image:s,label:R.product.title}))),React.createElement(a,{variant:"body2"},"Arrived"),React.createElement(u,{currentValue:x,totalValue:b+(null==q?void 0:q.reduce((function(e,t){return e+t.quantity}),0)),minNewValue:0+I+(null==_?void 0:_.reduce((function(e,t){return e+t.quantity}),0)),maxNewValue:b+(null==q?void 0:q.reduce((function(e,t){return e+t.quantity}),0)),color:"info",handleChange:function(e){C(e)}}),React.createElement("input",{name:"arrived_quantity",type:"hidden",value:x}),React.createElement(a,{variant:"body2"},"Registered"),React.createElement(u,{currentValue:I,totalValue:b+(null==q?void 0:q.reduce((function(e,t){return e+t.quantity}),0)),minNewValue:0+D,maxNewValue:x+(null==_?void 0:_.reduce((function(e,t){return e+t.quantity}),0)),color:"info",handleChange:function(e){j(e)},offsetEnd:null==_?void 0:_.reduce((function(e,t){return e+t.quantity}),0)}),React.createElement("input",{name:"registered_quantity",type:"hidden",value:I}),React.createElement(r,{sx:{p:0}},React.createElement(n,{direction:"row",spacing:1,alignItems:"center"},React.createElement(a,{variant:"body2"},"Irregularities / Corrections"),React.createElement(i,{onClick:function(){return V(!w)}},React.createElement(o,null)))),React.createElement(c,{in:w},React.createElement(n,{spacing:2},React.createElement(a,{variant:"body2"},"Here you can report and correct for damages wrong items etc. Do not forget to click the button!"))),React.createElement(a,{variant:"body2"},"Recieved"),React.createElement(u,{currentValue:D,totalValue:b+(null==q?void 0:q.reduce((function(e,t){return e+t.quantity}),0))+(null==_?void 0:_.reduce((function(e,t){return e+t.quantity}),0)),minNewValue:0,maxNewValue:I,color:"info",handleChange:function(e){F(e)}}),React.createElement("input",{name:"recieved_quantity",type:"hidden",value:D})))}export{d as default};
6
+ import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as n}from"react";import{useTheme as r,Stack as a,Typography as i,Divider as u,IconButton as o,Collapse as l}from"@mui/material";import{AmountUpdater as c}from"../../common/AmountUpdater.js";import m from"@mui/icons-material/ArrowDropDown";import d from"../../common/ImagePreviewTooltip.js";function v(v){var s=v.item,p=v.index;v.handleAddReport,v.handleUpdateQuantity;var y=v.image;v.handleRemoveReportAtIndex;var f=s.line_item_number,E=s.product,g=s.arrived_quantity,b=s.registered_quantity,q=s.recieved_quantity,_=s.ordered_quantity,h=s.arrived_bad_reasons,w=s.registered_bad_reasons,V=e(n(!1),2),N=V[0],x=V[1];r();var C=e(n(g),2),A=C[0],I=C[1],R=e(n(b),2),j=R[0],k=R[1],D=e(n(q),2),F=D[0],P=D[1];return t.createElement(a,{spacing:1,key:p},s&&t.createElement(t.Fragment,null,t.createElement(a,{direction:"row",justifyContent:"space-between"},t.createElement(a,{spacing:1},t.createElement(i,{variant:"body1"},"Line Item Number: ",f),t.createElement(i,{variant:"body1"},"Part Number: ",E.product_number)),y&&t.createElement(t.Fragment,null,t.createElement(d,{image:y,label:s.product.title}))),t.createElement(i,{variant:"body2"},"Arrived"),t.createElement(c,{currentValue:A,totalValue:_+(null==h?void 0:h.reduce((function(e,t){return e+t.quantity}),0)),minNewValue:0+j+(null==w?void 0:w.reduce((function(e,t){return e+t.quantity}),0)),maxNewValue:_+(null==h?void 0:h.reduce((function(e,t){return e+t.quantity}),0)),color:"info",handleChange:function(e){I(e)}}),t.createElement("input",{name:"arrived_quantity",type:"hidden",value:A}),t.createElement(i,{variant:"body2"},"Registered"),t.createElement(c,{currentValue:j,totalValue:_+(null==h?void 0:h.reduce((function(e,t){return e+t.quantity}),0)),minNewValue:0+F,maxNewValue:A+(null==w?void 0:w.reduce((function(e,t){return e+t.quantity}),0)),color:"info",handleChange:function(e){k(e)},offsetEnd:null==w?void 0:w.reduce((function(e,t){return e+t.quantity}),0)}),t.createElement("input",{name:"registered_quantity",type:"hidden",value:j}),t.createElement(u,{sx:{p:0}},t.createElement(a,{direction:"row",spacing:1,alignItems:"center"},t.createElement(i,{variant:"body2"},"Irregularities / Corrections"),t.createElement(o,{onClick:function(){return x(!N)}},t.createElement(m,null)))),t.createElement(l,{in:N},t.createElement(a,{spacing:2},t.createElement(i,{variant:"body2"},"Here you can report and correct for damages wrong items etc. Do not forget to click the button!"))),t.createElement(i,{variant:"body2"},"Recieved"),t.createElement(c,{currentValue:F,totalValue:_+(null==h?void 0:h.reduce((function(e,t){return e+t.quantity}),0))+(null==w?void 0:w.reduce((function(e,t){return e+t.quantity}),0)),minNewValue:0,maxNewValue:j,color:"info",handleChange:function(e){P(e)}}),t.createElement("input",{name:"recieved_quantity",type:"hidden",value:F})))}export{v 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 a from"@mui/material/Paper";import r from"@mui/material/Stack";import n from"@mui/material/Typography";import o from"@mui/material/Button";import i from"@mui/material/Divider";import c from"@mui/material/Grid";import m from"@mui/material/Card";import l from"@mui/material/CardContent";import d from"@mui/material/Box";import{useFormState as p}from"react-dom";import{updateIpoAction as s}from"../../../data/actions/logistics/ipo/updateIpoAction.js";import{UploadBase64MediaForm as u}from"../../common/media/UploadBase64MediaForm.js";import R from"../../../data/loaders/common/media/downloadBase64File.js";import E from"./ItemUpdater.js";import v from"../note/NotesDisplay.js";import f from"../note/NoteTakingComponent.js";import{SubmitButton as g}from"../../SubmitButton.js";import{StrapiErrors as y}from"../../StrapiErrors.js";import h from"@mui/material/Alert";var x={zodErrors:null,strapiErrors:null,data:null,message:null};function b(b){var _,w,j,C,D,A,N,F=b.data,I=b.sx,k=e(p(s,x),2),B=k[0],O=k[1];return console.log("data",F),React.createElement(d,{sx:t([],e(Array.isArray(I)?I:[I]),!1)},React.createElement(c,{container:!0,spacing:2},React.createElement(c,{item:!0,xs:12},React.createElement(r,{spacing:2},React.createElement(r,{direction:"row",spacing:2,justifyContent:"space-between"},React.createElement(r,{spacing:2},React.createElement(n,{variant:"h3",component:"h1"},"Inbound Management Purchase Order"),React.createElement(n,{variant:"body1"},"Manage arrival, registration and recieval of purchase order")),React.createElement(f,{content:"",related:[{id:F.id,__type:"api::logistics.ipo"}]})),React.createElement(i,null))),React.createElement(c,{item:!0,xs:12},React.createElement(n,{variant:"h4"},"Purchase Order Number ",F.ipo_number)),React.createElement(c,{item:!0,xs:6},React.createElement(r,{spacing:1},React.createElement(n,{variant:"h5"},"Details"),React.createElement(r,{direction:"row",spacing:2},React.createElement(n,{variant:"body1",width:"150px"},"Custom reference"),React.createElement(n,{variant:"body2"},F.custom_reference)),React.createElement(r,{direction:"row",spacing:2},React.createElement(n,{variant:"body1",width:"150px"},"Order Date"),React.createElement(n,{variant:"body2"},F.order_date)),React.createElement(r,{direction:"row",spacing:2},React.createElement(n,{variant:"body1",width:"150px"},"Supplier"),React.createElement(n,{variant:"body2"},null===(w=null===(_=F.vendor_profile)||void 0===_?void 0:_.business_credentials)||void 0===w?void 0:w.company_name)))),React.createElement(c,{item:!0,xs:12},React.createElement(r,{spacing:2},React.createElement(n,{variant:"h5"},"Documents"),React.createElement(m,{variant:"outlined"},React.createElement(l,null,React.createElement(r,{spacing:1},F.order_confirmation?React.createElement(React.Fragment,null,React.createElement(n,{variant:"h6"},"Order Confirmation"),React.createElement(n,null,null===(j=F.order_confirmation)||void 0===j?void 0:j.name),React.createElement(o,{variant:"contained",onClick:function(){R("api/ipos/".concat(F.id),"order_confirmation")}},"Download")):React.createElement(React.Fragment,null,React.createElement(n,{variant:"h5"},"Order Confirmation"),React.createElement(n,{variant:"body1"},"Here you can upload the the order confirmation for this order"),React.createElement(n,{variant:"body1"},"FileUpload"),React.createElement(i,null),React.createElement(u,{reference:"api::logistics.ipo",refID:F.id,field:"order_confirmation",multiple:!1,accept:"text/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",path:"api/ipos",componentName:"order_confirmation",componentReference:"common.base64-encoded-media"})),F.delivery_note?React.createElement(React.Fragment,null,React.createElement(n,{variant:"h6"},"Delivery Note"),React.createElement(n,null,null===(C=F.delivery_note)||void 0===C?void 0:C.name),React.createElement(o,{variant:"contained",onClick:function(){R("api/ipos/".concat(F.id),"delivery_note")}},"Download")):React.createElement(React.Fragment,null,React.createElement(n,{variant:"h5"},"Delivery Note"),React.createElement(n,{variant:"body1"},"Here you can upload the the delivery note for this order"),React.createElement(i,null),React.createElement(u,{reference:"api::logistics.ipo",refID:F.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"}))))))),(null===(A=null===(D=null==F?void 0:F.notes)||void 0===D?void 0:D.data)||void 0===A?void 0:A.length)>0&&React.createElement(c,{item:!0,xs:12},React.createElement(r,{spacing:2},React.createElement(n,{variant:"h5"},"Notes"),React.createElement(v,{notes:F.notes.data}),React.createElement(i,null))),React.createElement(c,{item:!0,xs:12},React.createElement("form",{action:O},(null===(N=null==F?void 0:F.items)||void 0===N?void 0:N.data)&&F.items.data.map((function(e,t){var r;return React.createElement(a,{sx:{p:2,mb:2}},React.createElement(E,{key:t,item:e,index:t,handleAddReport:function(){return console.log("handleAddReport")},handleUpdateQuantity:function(){return console.log("handleUpdateQuantity")},image:null===(r=null==e?void 0:e.product)||void 0===r?void 0:r.image,handleRemoveReportAtIndex:function(){return console.log("handleRemoveReportAtIndex")}}))})),React.createElement(a,{sx:{p:2}},React.createElement(r,{direction:"row",spacing:2,justifyContent:"end"},React.createElement(g,{text:"Submit",loadingText:"Loading..."}),React.createElement(y,{error:null==B?void 0:B.strapiErrors}),(null==B?void 0:B.message)&&React.createElement(h,{severity:"error"},null==B?void 0:B.message)))))))}export{b as default};
6
+ import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r from"react";import n from"@mui/material/Paper";import a from"@mui/material/Stack";import o from"@mui/material/Typography";import i from"@mui/material/Button";import m from"@mui/material/Divider";import l from"@mui/material/Grid";import c from"@mui/material/Card";import d from"@mui/material/CardContent";import p from"@mui/material/Box";import{useFormState as s}from"react-dom";import{updateIpoAction as u}from"../../../data/actions/logistics/ipo/updateIpoAction.js";import{UploadBase64MediaForm as E}from"../../common/media/UploadBase64MediaForm.js";import v from"../../../data/loaders/common/media/downloadBase64File.js";import f from"./ItemUpdater.js";import g from"../note/NotesDisplay.js";import y from"../note/NoteTakingComponent.js";import{SubmitButton as h}from"../../SubmitButton.js";import{StrapiErrors as x}from"../../StrapiErrors.js";import b from"@mui/material/Alert";var _={zodErrors:null,strapiErrors:null,data:null,message:null};function w(w){var j,C,D,A,N,R,F,I=w.data,k=w.sx,B=e(s(u,_),2),O=B[0],S=B[1];return console.log("data",I),r.createElement(p,{sx:t([],e(Array.isArray(k)?k:[k]),!1)},r.createElement(l,{container:!0,spacing:2},r.createElement(l,{item:!0,xs:12},r.createElement(a,{spacing:2},r.createElement(a,{direction:"row",spacing:2,justifyContent:"space-between"},r.createElement(a,{spacing:2},r.createElement(o,{variant:"h3",component:"h1"},"Inbound Management Purchase Order"),r.createElement(o,{variant:"body1"},"Manage arrival, registration and recieval of purchase order")),r.createElement(y,{content:"",related:[{id:I.id,__type:"api::logistics.ipo"}]})),r.createElement(m,null))),r.createElement(l,{item:!0,xs:12},r.createElement(o,{variant:"h4"},"Purchase Order Number ",I.ipo_number)),r.createElement(l,{item:!0,xs:6},r.createElement(a,{spacing:1},r.createElement(o,{variant:"h5"},"Details"),r.createElement(a,{direction:"row",spacing:2},r.createElement(o,{variant:"body1",width:"150px"},"Custom reference"),r.createElement(o,{variant:"body2"},I.custom_reference)),r.createElement(a,{direction:"row",spacing:2},r.createElement(o,{variant:"body1",width:"150px"},"Order Date"),r.createElement(o,{variant:"body2"},I.order_date)),r.createElement(a,{direction:"row",spacing:2},r.createElement(o,{variant:"body1",width:"150px"},"Supplier"),r.createElement(o,{variant:"body2"},null===(C=null===(j=I.vendor_profile)||void 0===j?void 0:j.business_credentials)||void 0===C?void 0:C.company_name)))),r.createElement(l,{item:!0,xs:12},r.createElement(a,{spacing:2},r.createElement(o,{variant:"h5"},"Documents"),r.createElement(c,{variant:"outlined"},r.createElement(d,null,r.createElement(a,{spacing:1},I.order_confirmation?r.createElement(r.Fragment,null,r.createElement(o,{variant:"h6"},"Order Confirmation"),r.createElement(o,null,null===(D=I.order_confirmation)||void 0===D?void 0:D.name),r.createElement(i,{variant:"contained",onClick:function(){v("api/ipos/".concat(I.id),"order_confirmation")}},"Download")):r.createElement(r.Fragment,null,r.createElement(o,{variant:"h5"},"Order Confirmation"),r.createElement(o,{variant:"body1"},"Here you can upload the the order confirmation for this order"),r.createElement(o,{variant:"body1"},"FileUpload"),r.createElement(m,null),r.createElement(E,{reference:"api::logistics.ipo",refID:I.id,field:"order_confirmation",multiple:!1,accept:"text/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",path:"api/ipos",componentName:"order_confirmation",componentReference:"common.base64-encoded-media"})),I.delivery_note?r.createElement(r.Fragment,null,r.createElement(o,{variant:"h6"},"Delivery Note"),r.createElement(o,null,null===(A=I.delivery_note)||void 0===A?void 0:A.name),r.createElement(i,{variant:"contained",onClick:function(){v("api/ipos/".concat(I.id),"delivery_note")}},"Download")):r.createElement(r.Fragment,null,r.createElement(o,{variant:"h5"},"Delivery Note"),r.createElement(o,{variant:"body1"},"Here you can upload the the delivery note for this order"),r.createElement(m,null),r.createElement(E,{reference:"api::logistics.ipo",refID:I.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"}))))))),(null===(R=null===(N=null==I?void 0:I.notes)||void 0===N?void 0:N.data)||void 0===R?void 0:R.length)>0&&r.createElement(l,{item:!0,xs:12},r.createElement(a,{spacing:2},r.createElement(o,{variant:"h5"},"Notes"),r.createElement(g,{notes:I.notes.data}),r.createElement(m,null))),r.createElement(l,{item:!0,xs:12},r.createElement("form",{action:S},(null===(F=null==I?void 0:I.items)||void 0===F?void 0:F.data)&&I.items.data.map((function(e,t){var a;return r.createElement(n,{sx:{p:2,mb:2}},r.createElement(f,{key:t,item:e,index:t,handleAddReport:function(){return console.log("handleAddReport")},handleUpdateQuantity:function(){return console.log("handleUpdateQuantity")},image:null===(a=null==e?void 0:e.product)||void 0===a?void 0:a.image,handleRemoveReportAtIndex:function(){return console.log("handleRemoveReportAtIndex")}}))})),r.createElement(n,{sx:{p:2}},r.createElement(a,{direction:"row",spacing:2,justifyContent:"end"},r.createElement(h,{text:"Submit",loadingText:"Loading..."}),r.createElement(x,{error:null==O?void 0:O.strapiErrors}),(null==O?void 0:O.message)&&r.createElement(b,{severity:"error"},null==O?void 0:O.message)))))))}export{w 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{useTheme as t,IconButton as r,Dialog as a,DialogContent as o,Paper as l,Stack as n,Typography as c,TextField as i,DialogActions as m,Button as f,Alert as s}from"@mui/material";import{useState as u}from"react";import d from"@mui/icons-material/NoteAlt";import{SubmitButton as E}from"../../SubmitButton.js";import{StrapiErrors as p}from"../../StrapiErrors.js";import{useFormState as g}from"react-dom";import{createNoteAction as R}from"../../../data/actions/logistics/note/createNoteAction.js";import{formatDate as b}from"../../../../node_modules/date-fns/format.js";var v={zodErrors:null,strapiErrors:null,data:null,message:null};function x(x){var k=x.content,h=x.related;t();var y=e(u(!1),2),j=y[0],S=y[1],w=R.bind(null,h),A=e(g(w,v),2),C=A[0],z=A[1];return React.createElement(React.Fragment,null,React.createElement(r,{onClick:function(){return S(!0)},sx:{width:50,height:50,color:"#ffff88"}},React.createElement(d,{fontSize:"large"})),React.createElement(a,{open:j,fullWidth:!0,maxWidth:"lg"},React.createElement("form",{action:z},React.createElement(o,{sx:{p:1}},React.createElement(l,{elevation:4,sx:{background:"linear-gradient(135deg, #ffff88 81%,#ffff88 82%,#ffff88 82%,#ffffc6 100%)",color:"black",p:1}},React.createElement(n,{spacing:2},React.createElement(c,{variant:"body1",textAlign:"right"},b(Date.now(),"dd-MM-yyyy")),React.createElement(i,{id:"content",name:"content",sx:{color:"black",label:{color:"black"},input:{color:"black"},div:{color:"black"}},label:"The note",multiline:!0,rows:12,defaultValue:k})))),React.createElement(m,null,React.createElement(f,{onClick:function(){return S(!1)}},"Cancel"),React.createElement(E,{text:"Submit",loadingText:"Loading..."}),React.createElement(p,{error:null==C?void 0:C.strapiErrors}),(null==C?void 0:C.message)&&React.createElement(s,{severity:"error"},null==C?void 0:C.message)))))}export{x as default};
6
+ import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import{IconButton as t,Dialog as r,DialogContent as o,Paper as l,Stack as n,Typography as a,TextField as i,DialogActions as m,Button as c,Alert as f}from"@mui/material";import s,{useState as u}from"react";import d from"@mui/icons-material/NoteAlt";import{SubmitButton as E}from"../../SubmitButton.js";import{StrapiErrors as p}from"../../StrapiErrors.js";import{useFormState as g}from"react-dom";import{createNoteAction as b}from"../../../data/actions/logistics/note/createNoteAction.js";import{formatDate as v}from"../../../../node_modules/date-fns/format.js";var x={zodErrors:null,strapiErrors:null,data:null,message:null};function k(k){var h=k.content,y=k.related,j=e(u(!1),2),S=j[0],w=j[1],A=b.bind(null,y),C=e(g(A,x),2),z=C[0],D=C[1];return s.createElement(s.Fragment,null,s.createElement(t,{onClick:function(){return w(!0)},sx:{width:50,height:50,color:"#ffff88"}},s.createElement(d,{fontSize:"large"})),s.createElement(r,{open:S,fullWidth:!0,maxWidth:"lg"},s.createElement("form",{action:D},s.createElement(o,{sx:{p:1}},s.createElement(l,{elevation:4,sx:{background:"linear-gradient(135deg, #ffff88 81%,#ffff88 82%,#ffff88 82%,#ffffc6 100%)",color:"black",p:1}},s.createElement(n,{spacing:2},s.createElement(a,{variant:"body1",textAlign:"right"},v(Date.now(),"dd-MM-yyyy")),s.createElement(i,{id:"content",name:"content",sx:{color:"black",label:{color:"black"},input:{color:"black"},div:{color:"black"}},label:"The note",multiline:!0,rows:12,defaultValue:h})))),s.createElement(m,null,s.createElement(c,{onClick:function(){return w(!1)}},"Cancel"),s.createElement(E,{text:"Submit",loadingText:"Loading..."}),s.createElement(p,{error:null==z?void 0:z.strapiErrors}),(null==z?void 0:z.message)&&s.createElement(f,{severity:"error"},null==z?void 0:z.message)))))}export{k as default};