umwd-components 0.1.337 → 0.1.339
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/logistics/ipo/ItemUpdater.js +1 -1
- package/dist/src/components/logistics/ipo/ManageIPOForm.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/logistics/ipo/ItemUpdater.d.ts +2 -2
- package/dist/types/components/logistics/ipo/ManageIPOForm.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/logistics/ipo/ItemUpdater.tsx +3 -6
- package/src/components/logistics/ipo/ManageIPOForm.tsx +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{useTheme as t,Stack as n,Typography as
|
|
6
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import{useTheme as t,Stack as n,Typography as r,Divider as a,IconButton as i,Collapse as u}from"@mui/material";import{AmountUpdater as o}from"../../common/AmountUpdater.js";import l from"@mui/icons-material/ArrowDropDown";import c,{useState as m}from"react";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(m(!1),2),N=V[0],x=V[1];t();var C=e(m(g),2),A=C[0],I=C[1],R=e(m(b),2),j=R[0],k=R[1],D=e(m(q),2),F=D[0],P=D[1];return c.createElement(n,{spacing:1,key:p},s&&c.createElement(c.Fragment,null,c.createElement(n,{direction:"row",justifyContent:"space-between"},c.createElement(n,{spacing:1},c.createElement(r,{variant:"body1"},"Line Item Number: ",f),c.createElement(r,{variant:"body1"},"Part Number: ",E.product_number)),y&&c.createElement(c.Fragment,null,c.createElement(d,{image:y,label:s.product.title}))),c.createElement(r,{variant:"body2"},"Arrived"),c.createElement(o,{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)}}),c.createElement("input",{name:"arrived_quantity",type:"hidden",value:A}),c.createElement(r,{variant:"body2"},"Registered"),c.createElement(o,{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)}),c.createElement("input",{name:"registered_quantity",type:"hidden",value:j}),c.createElement(a,{sx:{p:0}},c.createElement(n,{direction:"row",spacing:1,alignItems:"center"},c.createElement(r,{variant:"body2"},"Irregularities / Corrections"),c.createElement(i,{onClick:function(){return x(!N)}},c.createElement(l,null)))),c.createElement(u,{in:N},c.createElement(n,{spacing:2},c.createElement(r,{variant:"body2"},"Here you can report and correct for damages wrong items etc. Do not forget to click the button!"))),c.createElement(r,{variant:"body2"},"Recieved"),c.createElement(o,{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)}}),c.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
|
|
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};
|