umwd-components 0.1.350 → 0.1.351
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/products/PriceFields.js +1 -1
- package/dist/src/components/logistics/ipo/ManageIPOForm.js +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/data/loaders/e-commerce/getPaginatedCategories.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/e-commerce/products/PriceFields.tsx +4 -2
- package/src/components/logistics/ipo/ManageIPOForm.tsx +15 -1
- package/src/data/loaders/e-commerce/getPaginatedCategories.ts +4 -4
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* @copyright Jelle Paulus
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as n,useEffect as a}from"react";import
|
|
7
|
+
import{__read as e}from"../../../../node_modules/tslib/tslib.es6.js";import t,{useState as n,useEffect as a}from"react";import r from"@mui/material/TextField";import i from"@mui/icons-material/Euro";import l from"@mui/material/InputAdornment";import o from"@mui/material/Stack";function c(c){var m=c.data,d=c.componentName,u=c.componentReference,p=m||{},v=p.id,s=p.vat_rate,E=p.vat,f=p.price_incl_vat,_=p.price,b=e(n((null==_?void 0:_.toString())||""),2),g=b[0],F=b[1],h=e(n((function(){return(null==s?void 0:s.toString())||""})),2),x=h[0],y=h[1],A=e(n(E),2),I=A[0],P=A[1],V=e(n(f),2),S=V[0],C=V[1];return a((function(){if(g&&x){var e=parseFloat(g),t=e*(parseFloat(x)/100),n=e+t;P(t),C(n)}}),[g,x]),t.createElement(o,{spacing:2,direction:"row"},t.createElement("input",{id:"",type:"hidden",name:"".concat(d,".__component"),value:u}),v&&t.createElement("input",{id:"",type:"hidden",name:"".concat(d,".id"),value:v}),t.createElement(r,{id:"price",InputProps:{startAdornment:t.createElement(l,{position:"start"},t.createElement(i,null))},name:"".concat(d,".price"),label:"price",type:"float",value:g,onChange:function(e){F(e.target.value)}}),t.createElement(r,{id:"vat_rate",name:"".concat(d,".vat_rate"),type:"number",InputProps:{endAdornment:t.createElement(l,{position:"end"},"%")},label:"Vat Rate",value:x,onChange:function(e){y(e.target.value)}}),t.createElement(r,{id:"vat",InputProps:{startAdornment:t.createElement(l,{position:"start"},t.createElement(i,null))},name:"".concat(d,".vat"),label:"Vat",defaultValue:null==I?void 0:I.toFixed(2),disabled:!0}),t.createElement("input",{hidden:!0,name:"".concat(d,".vat"),value:null==I?void 0:I.toFixed(2),readOnly:!0}),t.createElement(r,{id:"price_incl_vat",InputProps:{startAdornment:t.createElement(l,{position:"start"},t.createElement(i,null))},name:"".concat(d,".price_incl_vat"),label:"Price Incl VAT",defaultValue:null==S?void 0:S.toFixed(2),disabled:!0}),t.createElement("input",{hidden:!0,name:"".concat(d,".price_incl_vat"),value:null==S?void 0:S.toFixed(2),readOnly:!0}))}export{c as PriceFields};
|
|
@@ -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
|
|
6
|
+
import{__read as e,__spreadArray as t}from"../../../../node_modules/tslib/tslib.es6.js";import r,{useState as a}from"react";import n from"@mui/material/Paper";import o from"@mui/material/Stack";import i from"@mui/material/Typography";import l from"@mui/material/Button";import m from"@mui/material/Divider";import c from"@mui/material/Grid";import d from"@mui/material/Card";import s from"@mui/material/CardContent";import p from"@mui/material/Box";import{useFormState as u}from"react-dom";import{updateIpoAction as v}from"../../../data/actions/logistics/ipo/updateIpoAction.js";import{UploadBase64MediaForm as E}from"../../common/media/UploadBase64MediaForm.js";import f from"../../../data/loaders/common/media/downloadBase64File.js";import g from"./ItemUpdater.js";import y from"../note/NotesDisplay.js";import h from"../note/NoteTakingComponent.js";import{SubmitButton as b}from"../../SubmitButton.js";import{StrapiErrors as _}from"../../StrapiErrors.js";import x from"@mui/material/Alert";var w={zodErrors:null,strapiErrors:null,data:null,message:null};function C(C){var j,D,I,N,k,A,F,R=C.data,O=C.sx,q=C.revalidateCallback,S=e(u(v,w),2),U=S[0],B=S[1];console.log("data",R);var P=e(a(R.items.data),2),M=P[0],T=P[1],H=function(r,a,n){void 0===n&&(n="registered_bad_reports"),console.log(M),console.log(r,a,n),console.log("handleAddReport");var o=t([],e(M),!1),i=o.findIndex((function(e){return e.id===r}));console.log(o[i]),o[i][n]?o[i][n].push(a):o[i][n]=[a]},Q=function(r,a,n){console.log(M),console.log(r,a,n),console.log("handleUpdateQuantity");var o=t([],e(M),!1),i=o.findIndex((function(e){return e.id===a}));o[i][n]=r,T(o)},z=function(e,t){console.log(M),console.log(e,t),console.log("handleRemoveReportAtIndex")};return r.createElement(p,{sx:t([],e(Array.isArray(O)?O:[O]),!1)},r.createElement(c,{container:!0,spacing:2},r.createElement(c,{item:!0,xs:12},r.createElement(o,{spacing:2},r.createElement(o,{direction:"row",spacing:2,justifyContent:"space-between"},r.createElement(o,{spacing:2},r.createElement(i,{variant:"h3",component:"h1"},"Inbound Management Purchase Order"),r.createElement(i,{variant:"body1"},"Manage arrival, registration and recieval of purchase order")),r.createElement(h,{content:"",related:[{id:R.id,__type:"api::logistics.ipo"}]})),r.createElement(m,null))),r.createElement(c,{item:!0,xs:12},r.createElement(i,{variant:"h4"},"Purchase Order Number ",R.ipo_number)),r.createElement(c,{item:!0,xs:6},r.createElement(o,{spacing:1},r.createElement(i,{variant:"h5"},"Details"),r.createElement(o,{direction:"row",spacing:2},r.createElement(i,{variant:"body1",width:"150px"},"Custom reference"),r.createElement(i,{variant:"body2"},R.custom_reference)),r.createElement(o,{direction:"row",spacing:2},r.createElement(i,{variant:"body1",width:"150px"},"Order Date"),r.createElement(i,{variant:"body2"},R.order_date)),r.createElement(o,{direction:"row",spacing:2},r.createElement(i,{variant:"body1",width:"150px"},"Supplier"),r.createElement(i,{variant:"body2"},null===(D=null===(j=R.vendor_profile)||void 0===j?void 0:j.business_credentials)||void 0===D?void 0:D.company_name)),r.createElement(o,{direction:"row",spacing:2},r.createElement(i,{variant:"body1",width:"150px"},"Order Status"),r.createElement(i,{variant:"body2",width:"150px"},R.status)),"placed"===R.status&&r.createElement(r.Fragment,null,r.createElement(l,{variant:"contained",color:"primary"},"Confirm order"),r.createElement(x,{severity:"warning"},"Please confirm the order as soon as possible, only upon confirmation this order will be available to the dispatcher")))),r.createElement(c,{item:!0,xs:12},r.createElement(o,{spacing:2},r.createElement(i,{variant:"h5"},"Documents"),r.createElement(d,{variant:"outlined"},r.createElement(s,null,r.createElement(o,{spacing:1},R.order_confirmation?r.createElement(r.Fragment,null,r.createElement(i,{variant:"h6"},"Order Confirmation"),r.createElement(i,null,null===(I=R.order_confirmation)||void 0===I?void 0:I.name),r.createElement(l,{variant:"contained",onClick:function(){f("api/ipos/".concat(R.id),"order_confirmation")}},"Download")):r.createElement(r.Fragment,null,r.createElement(i,{variant:"h5"},"Order Confirmation"),r.createElement(i,{variant:"body1"},"Here you can upload the the order confirmation for this order"),r.createElement(i,{variant:"body1"},"FileUpload"),r.createElement(m,null),r.createElement(E,{reference:"api::logistics.ipo",refID:R.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",revalidateCallback:q})),R.delivery_note?r.createElement(r.Fragment,null,r.createElement(i,{variant:"h6"},"Delivery Note"),r.createElement(i,null,null===(N=R.delivery_note)||void 0===N?void 0:N.name),r.createElement(l,{variant:"contained",onClick:function(){f("api/ipos/".concat(R.id),"delivery_note")}},"Download")):r.createElement(r.Fragment,null,r.createElement(i,{variant:"h5"},"Delivery Note"),r.createElement(i,{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:R.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",revalidateCallback:q}))))))),(null===(A=null===(k=null==R?void 0:R.notes)||void 0===k?void 0:k.data)||void 0===A?void 0:A.length)>0&&r.createElement(c,{item:!0,xs:12},r.createElement(o,{spacing:2},r.createElement(i,{variant:"h5"},"Notes"),r.createElement(y,{notes:R.notes.data}),r.createElement(m,null))),r.createElement(c,{item:!0,xs:12},r.createElement("form",{action:B},r.createElement("input",{name:"id",type:"hidden",value:R.id}),(null===(F=null==R?void 0:R.items)||void 0===F?void 0:F.data)&&R.items.data.map((function(e,t){var a;return console.log("item",e),r.createElement(n,{sx:{p:2,mb:2},key:t},r.createElement(g,{item:e,index:t,handleAddReport:H,handleUpdateQuantity:Q,image:null===(a=null==e?void 0:e.product)||void 0===a?void 0:a.image,handleRemoveReportAtIndex:z}))})),r.createElement(n,{sx:{p:2}},r.createElement(o,{direction:"row",spacing:2,justifyContent:"end"},r.createElement(b,{text:"Update items",loadingText:"Loading..."}),r.createElement(_,{error:null==U?void 0:U.strapiErrors}),(null==U?void 0:U.message)&&r.createElement(x,{severity:"error"},null==U?void 0:U.message))),r.createElement("input",{type:"hidden",name:"items",value:JSON.stringify(function(e){return e.map((function(e){return{id:e.id,arrived_quantity:e.arrived_quantity,registered_quantity:e.registered_quantity,recieved_quantity:e.recieved_quantity,registered_bad_reports:e.registered_bad_reports}}))}(M))})))))}export{C as default};
|