@openmrs/esm-stock-management-app 1.0.1-pre.785 → 1.0.1-pre.788
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/155.js +1 -1
- package/dist/155.js.map +1 -1
- package/dist/922.js +1 -0
- package/dist/922.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-stock-management-app.js +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +12 -12
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/config-schema.ts +6 -0
- package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-items-table.scss +34 -0
- package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-items-table.tsx +111 -0
- package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-operation-expanded-row.component.tsx +87 -0
- package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-operation-expanded-row.scss +31 -0
- package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-operations-status.tsx +45 -0
- package/src/stock-operations/stock-operations-forms/input-components/stock-item-search.component.tsx +30 -7
- package/src/stock-operations/stock-operations-forms/step2.test.tsx +6 -2
- package/src/stock-operations/stock-operations-forms/steps/received-items.component.tsx +110 -0
- package/src/stock-operations/stock-operations-forms/steps/stock-operation-item-cell.component.tsx +15 -3
- package/src/stock-operations/stock-operations-forms/steps/stock-operation-submission-form-step.component.tsx +7 -0
- package/src/stock-operations/stock-operations-forms/stock-item-form/stock-item-form.workspace.tsx +16 -2
- package/src/stock-operations/stock-operations-forms/stock-operation-form.component.tsx +18 -13
- package/src/stock-operations/stock-operations-table.component.tsx +39 -38
- package/dist/914.js +0 -1
- package/dist/914.js.map +0 -1
- package/src/stock-operations/received-items.component.tsx +0 -93
@@ -1 +1 @@
|
|
1
|
-
var _openmrs_esm_stock_management_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,f,p,c,d,h,m,v,g={1371:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(935),t.e(493),t.e(672),t.e(
|
1
|
+
var _openmrs_esm_stock_management_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,f,p,c,d,h,m,v,g={1371:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(935),t.e(493),t.e(672),t.e(922)]).then((()=>()=>t(6830)))},o=(e,r)=>(t.R=r,r=t.o(n,e)?n[e]():Promise.resolve().then((()=>{throw new Error('Module "'+e+'" does not exist in container.')})),t.R=void 0,r),a=(e,r)=>{if(t.S){var n="default",o=t.S[n];if(o&&o!==e)throw new Error("Container initialization failed as it has already been initialized with a different share scope");return t.S[n]=e,t.I(n,r)}};t.d(r,{get:()=>o,init:()=>a})}},b={};function y(e){var r=b[e];if(void 0!==r)return r.exports;var t=b[e]={id:e,loaded:!1,exports:{}};return g[e].call(t.exports,t,t.exports,y),t.loaded=!0,t.exports}y.m=g,y.c=b,y.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return y.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,y.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var o=Object.create(null);y.r(o);var a={};e=e||[null,r({}),r([]),r(r)];for(var i=2&n&&t;"object"==typeof i&&!~e.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach((e=>a[e]=()=>t[e]));return a.default=()=>t,y.d(o,a),o},y.d=(e,r)=>{for(var t in r)y.o(r,t)&&!y.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},y.f={},y.e=e=>Promise.all(Object.keys(y.f).reduce(((r,t)=>(y.f[t](e,r),r)),[])),y.u=e=>e+".js",y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-stock-management-app:",y.l=(e,r,o,a)=>{if(t[e])t[e].push(r);else{var i,l;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var f=s[u];if(f.getAttribute("src")==e||f.getAttribute("data-webpack")==n+o){i=f;break}}i||(l=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,y.nc&&i.setAttribute("nonce",y.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var p=(r,n)=>{i.onerror=i.onload=null,clearTimeout(c);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},c=setTimeout(p.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=p.bind(null,i.onerror),i.onload=p.bind(null,i.onload),l&&document.head.appendChild(i)}},y.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{y.S={};var e={},r={};y.I=(t,n)=>{n||(n=[]);var o=r[t];if(o||(o=r[t]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[t])return e[t];y.o(y.S,t)||(y.S[t]={});var a=y.S[t],i="@openmrs/esm-stock-management-app",l=(e,r,t,n)=>{var o=a[e]=a[e]||{},l=o[r];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(o[r]={get:t,from:i,eager:!!n})},s=[];return"default"===t&&(l("@openmrs/esm-framework","5.7.3-pre.2161",(()=>Promise.all([y.e(793),y.e(672)]).then((()=>()=>y(1793))))),l("dayjs","1.11.10",(()=>y.e(484).then((()=>()=>y(7484))))),l("react-i18next","11.18.6",(()=>Promise.all([y.e(672),y.e(629)]).then((()=>()=>y(707))))),l("react-router-dom","6.21.1",(()=>Promise.all([y.e(26),y.e(935),y.e(672)]).then((()=>()=>y(8026))))),l("react","18.2.0",(()=>y.e(294).then((()=>()=>y(7294))))),l("swr/_internal","2.2.5",(()=>Promise.all([y.e(46),y.e(672)]).then((()=>()=>y(46)))))),e[t]=s.length?Promise.all(s).then((()=>e[t]=1)):1}}})(),(()=>{var e;y.g.importScripts&&(e=y.g.location+"");var r=y.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&!e;)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),y.p=e})(),o=e=>{var r=e=>e.split(".").map((e=>+e==e?+e:e)),t=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=t[1]?r(t[1]):[];return t[2]&&(n.length++,n.push.apply(n,r(t[2]))),t[3]&&(n.push([]),n.push.apply(n,r(t[3]))),n},a=(e,r)=>{e=o(e),r=o(r);for(var t=0;;){if(t>=e.length)return t<r.length&&"u"!=(typeof r[t])[0];var n=e[t],a=(typeof n)[0];if(t>=r.length)return"u"==a;var i=r[t],l=(typeof i)[0];if(a!=l)return"o"==a&&"n"==l||"s"==l||"u"==a;if("o"!=a&&"u"!=a&&n!=i)return n<i;t++}},i=e=>{var r=e[0],t="";if(1===e.length)return"*";if(r+.5){t+=0==r?">=":-1==r?"<":1==r?"^":2==r?"~":r>0?"=":"!=";for(var n=1,o=1;o<e.length;o++)n--,t+="u"==(typeof(l=e[o]))[0]?"-":(n>0?".":"")+(n=2,l);return t}var a=[];for(o=1;o<e.length;o++){var l=e[o];a.push(0===l?"not("+s()+")":1===l?"("+s()+" || "+s()+")":2===l?a.pop()+" "+a.pop():i(l))}return s();function s(){return a.pop().replace(/^\((.+)\)$/,"$1")}},l=(e,r)=>{if(0 in e){r=o(r);var t=e[0],n=t<0;n&&(t=-t-1);for(var a=0,i=1,s=!0;;i++,a++){var u,f,p=i<e.length?(typeof e[i])[0]:"";if(a>=r.length||"o"==(f=(typeof(u=r[a]))[0]))return!s||("u"==p?i>t&&!n:""==p!=n);if("u"==f){if(!s||"u"!=p)return!1}else if(s)if(p==f)if(i<=t){if(u!=e[i])return!1}else{if(n?u>e[i]:u<e[i])return!1;u!=e[i]&&(s=!1)}else if("s"!=p&&"n"!=p){if(n||i<=t)return!1;s=!1,i--}else{if(i<=t||f<p!=n)return!1;s=!1}else"s"!=p&&"n"!=p&&(s=!1,i--)}}var c=[],d=c.pop.bind(c);for(a=1;a<e.length;a++){var h=e[a];c.push(1==h?d()|d():2==h?d()&d():h?l(h,r):!d())}return!!d()},s=(e,r)=>{var t=e[r];return Object.keys(t).reduce(((e,r)=>!e||!t[e].loaded&&a(e,r)?r:e),0)},u=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+i(n)+")",f=(e,r,t,n)=>{var o=s(e,t);return l(n,o)||p(u(e,t,o,n)),c(e[t][o])},p=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},c=e=>(e.loaded=1,e.get()),d=(e=>function(r,t,n,o){var a=y.I(r);return a&&a.then?a.then(e.bind(e,r,y.S[r],t,n,o)):e(0,y.S[r],t,n,o)})(((e,r,t,n,o)=>r&&y.o(r,t)?f(r,0,t,n):o())),h={},m={1672:()=>d("default","react",[1,18],(()=>y.e(294).then((()=>()=>y(7294))))),1914:()=>d("default","react-router-dom",[1,6],(()=>y.e(26).then((()=>()=>y(8026))))),2653:()=>d("default","dayjs",[1,1],(()=>y.e(484).then((()=>()=>y(7484))))),3397:()=>d("default","react-i18next",[1,11],(()=>y.e(707).then((()=>()=>y(707))))),5512:()=>d("default","swr/_internal",[1,2],(()=>y.e(46).then((()=>()=>y(46))))),7248:()=>d("default","@openmrs/esm-framework",[1,5],(()=>y.e(793).then((()=>()=>y(1793)))))},v={672:[1672],922:[1914,2653,3397,5512,7248]},y.f.consumes=(e,r)=>{y.o(v,e)&&v[e].forEach((e=>{if(y.o(h,e))return r.push(h[e]);var t=r=>{h[e]=0,y.m[e]=t=>{delete y.c[e],t.exports=r()}},n=r=>{delete h[e],y.m[e]=t=>{throw delete y.c[e],r}};try{var o=m[e]();o.then?r.push(h[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}))},(()=>{var e={122:0};y.f.j=(r,t)=>{var n=y.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(672!=r){var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=y.p+y.u(r),i=new Error;y.l(a,(t=>{if(y.o(e,r)&&(0!==(n=e[r])&&(e[r]=void 0),n)){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;i.message="Loading chunk "+r+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+r,r)}else e[r]=0};var r=(r,t)=>{var n,o,[a,i,l]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in i)y.o(i,n)&&(y.m[n]=i[n]);l&&l(y)}for(r&&r(t);s<a.length;s++)o=a[s],y.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),y.nc=void 0;var _=y(1371);_openmrs_esm_stock_management_app=_})();
|
@@ -102,7 +102,7 @@
|
|
102
102
|
"auxiliaryFiles": [
|
103
103
|
"openmrs-esm-stock-management-app.js.map"
|
104
104
|
],
|
105
|
-
"hash": "
|
105
|
+
"hash": "ed834d45d9bcd330",
|
106
106
|
"childrenByOrder": {}
|
107
107
|
},
|
108
108
|
{
|
@@ -110,9 +110,9 @@
|
|
110
110
|
"initial": false,
|
111
111
|
"entry": false,
|
112
112
|
"recorded": false,
|
113
|
-
"size":
|
113
|
+
"size": 56544,
|
114
114
|
"sizes": {
|
115
|
-
"javascript":
|
115
|
+
"javascript": 56544
|
116
116
|
},
|
117
117
|
"names": [],
|
118
118
|
"idHints": [],
|
@@ -126,7 +126,7 @@
|
|
126
126
|
"auxiliaryFiles": [
|
127
127
|
"155.js.map"
|
128
128
|
],
|
129
|
-
"hash": "
|
129
|
+
"hash": "d2341156343a2948",
|
130
130
|
"childrenByOrder": {}
|
131
131
|
},
|
132
132
|
{
|
@@ -158,10 +158,10 @@
|
|
158
158
|
"initial": true,
|
159
159
|
"entry": true,
|
160
160
|
"recorded": false,
|
161
|
-
"size":
|
161
|
+
"size": 5785832,
|
162
162
|
"sizes": {
|
163
163
|
"consume-shared": 252,
|
164
|
-
"javascript":
|
164
|
+
"javascript": 5763883,
|
165
165
|
"share-init": 252,
|
166
166
|
"runtime": 21445
|
167
167
|
},
|
@@ -178,7 +178,7 @@
|
|
178
178
|
"auxiliaryFiles": [
|
179
179
|
"main.js.map"
|
180
180
|
],
|
181
|
-
"hash": "
|
181
|
+
"hash": "db105aa271d284d7",
|
182
182
|
"childrenByOrder": {}
|
183
183
|
},
|
184
184
|
{
|
@@ -604,9 +604,9 @@
|
|
604
604
|
"initial": false,
|
605
605
|
"entry": false,
|
606
606
|
"recorded": false,
|
607
|
-
"size":
|
607
|
+
"size": 2042659,
|
608
608
|
"sizes": {
|
609
|
-
"javascript":
|
609
|
+
"javascript": 2042449,
|
610
610
|
"consume-shared": 210
|
611
611
|
},
|
612
612
|
"names": [],
|
@@ -615,12 +615,12 @@
|
|
615
615
|
"@openmrs/esm-stock-management-app"
|
616
616
|
],
|
617
617
|
"files": [
|
618
|
-
"
|
618
|
+
"922.js"
|
619
619
|
],
|
620
620
|
"auxiliaryFiles": [
|
621
|
-
"
|
621
|
+
"922.js.map"
|
622
622
|
],
|
623
|
-
"hash": "
|
623
|
+
"hash": "7bfc983f0ab1d304",
|
624
624
|
"childrenByOrder": {}
|
625
625
|
},
|
626
626
|
{
|
package/dist/routes.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-nav-menu","slot":"stock-sidebar-slot","component":"stockNavMenu","online":true,"offline":true},{"name":"overview-db-link","slot":"stock-page-dashboard-slot","component":"stockOverviewLink","meta":{"name":"overview","slot":"overview-dashboard-slot","title":"overview"},"order":0,"online":true,"offline":true},{"name":"stock-overview-db","slot":"overview-dashboard-slot","component":"stockOverview"},{"name":"operations-db-link","slot":"stock-page-dashboard-slot","component":"stockOperationsLink","meta":{"name":"operations","slot":"operations-dashboard-slot","title":"operations"},"order":2,"online":true,"offline":true},{"name":"stock-operations-db","slot":"operations-dashboard-slot","component":"stockOperations"},{"name":"items-db-link","slot":"stock-page-dashboard-slot","component":"stockItemsLink","meta":{"name":"items","slot":"items-dashboard-slot","title":"items"},"order":1,"online":true,"offline":true},{"name":"stock-items-db","slot":"items-dashboard-slot","component":"stockItems"},{"name":"user-scopes-db-link","slot":"stock-page-dashboard-slot","component":"stockUserScopesLink","meta":{"name":"user-scopes","slot":"user-scopes-dashboard-slot","title":"user-scopes"},"order":3,"online":true,"offline":true},{"name":"stock-user-scopes-db","slot":"user-scopes-dashboard-slot","component":"stockUserScopes"},{"name":"sources-db-link","slot":"stock-page-dashboard-slot","component":"stockSourcesLink","meta":{"name":"sources","slot":"sources-dashboard-slot","title":"Sources"},"order":2,"online":true,"offline":true},{"name":"stock-sources-db","slot":"sources-dashboard-slot","component":"stockSources"},{"name":"locations-db-link","slot":"stock-page-dashboard-slot","component":"stockLocationsLink","meta":{"name":"locations","slot":"locations-dashboard-slot","title":"Locations"},"order":4,"online":true,"offline":true},{"name":"stock-locations-db","slot":"locations-dashboard-slot","component":"stockLocations"},{"name":"reports-db-link","slot":"stock-page-dashboard-slot","component":"stockReportsLink","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"order":5,"online":true,"offline":true},{"name":"stock-reports-db","slot":"reports-dashboard-slot","component":"stockReports"},{"name":"settings-db-link","slot":"stock-page-dashboard-slot","component":"stockSettingsLink","meta":{"name":"settings","slot":"settings-dashboard-slot","title":"Settings"},"order":6,"online":true,"offline":true},{"name":"stock-settings-db","slot":"settings-dashboard-slot","component":"stockSettings"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"modals":[{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsModal"},{"name":"stock-operation-dialog","component":"stockOperationModal"},{"name":"transactions-print-bincard-preview-modal","component":"transactionBincardPrintPreviewModal"},{"name":"transactions-print-stockcard-preview-modal","component":"transactionStockcardPrintPreviewModal"}],"workspaces":[{"name":"stock-operation-stock-items-form","component":"stockOperationStockItemForm","title":"Stock Items","type":"form","width":"wider"}],"pages":[{"component":"root","route":"stock-management"}],"version":"1.0.1-pre.
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-nav-menu","slot":"stock-sidebar-slot","component":"stockNavMenu","online":true,"offline":true},{"name":"overview-db-link","slot":"stock-page-dashboard-slot","component":"stockOverviewLink","meta":{"name":"overview","slot":"overview-dashboard-slot","title":"overview"},"order":0,"online":true,"offline":true},{"name":"stock-overview-db","slot":"overview-dashboard-slot","component":"stockOverview"},{"name":"operations-db-link","slot":"stock-page-dashboard-slot","component":"stockOperationsLink","meta":{"name":"operations","slot":"operations-dashboard-slot","title":"operations"},"order":2,"online":true,"offline":true},{"name":"stock-operations-db","slot":"operations-dashboard-slot","component":"stockOperations"},{"name":"items-db-link","slot":"stock-page-dashboard-slot","component":"stockItemsLink","meta":{"name":"items","slot":"items-dashboard-slot","title":"items"},"order":1,"online":true,"offline":true},{"name":"stock-items-db","slot":"items-dashboard-slot","component":"stockItems"},{"name":"user-scopes-db-link","slot":"stock-page-dashboard-slot","component":"stockUserScopesLink","meta":{"name":"user-scopes","slot":"user-scopes-dashboard-slot","title":"user-scopes"},"order":3,"online":true,"offline":true},{"name":"stock-user-scopes-db","slot":"user-scopes-dashboard-slot","component":"stockUserScopes"},{"name":"sources-db-link","slot":"stock-page-dashboard-slot","component":"stockSourcesLink","meta":{"name":"sources","slot":"sources-dashboard-slot","title":"Sources"},"order":2,"online":true,"offline":true},{"name":"stock-sources-db","slot":"sources-dashboard-slot","component":"stockSources"},{"name":"locations-db-link","slot":"stock-page-dashboard-slot","component":"stockLocationsLink","meta":{"name":"locations","slot":"locations-dashboard-slot","title":"Locations"},"order":4,"online":true,"offline":true},{"name":"stock-locations-db","slot":"locations-dashboard-slot","component":"stockLocations"},{"name":"reports-db-link","slot":"stock-page-dashboard-slot","component":"stockReportsLink","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"order":5,"online":true,"offline":true},{"name":"stock-reports-db","slot":"reports-dashboard-slot","component":"stockReports"},{"name":"settings-db-link","slot":"stock-page-dashboard-slot","component":"stockSettingsLink","meta":{"name":"settings","slot":"settings-dashboard-slot","title":"Settings"},"order":6,"online":true,"offline":true},{"name":"stock-settings-db","slot":"settings-dashboard-slot","component":"stockSettings"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"modals":[{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsModal"},{"name":"stock-operation-dialog","component":"stockOperationModal"},{"name":"transactions-print-bincard-preview-modal","component":"transactionBincardPrintPreviewModal"},{"name":"transactions-print-stockcard-preview-modal","component":"transactionStockcardPrintPreviewModal"}],"workspaces":[{"name":"stock-operation-stock-items-form","component":"stockOperationStockItemForm","title":"Stock Items","type":"form","width":"wider"}],"pages":[{"component":"root","route":"stock-management"}],"version":"1.0.1-pre.788"}
|
package/package.json
CHANGED
package/src/config-schema.ts
CHANGED
@@ -40,6 +40,11 @@ export const configSchema = {
|
|
40
40
|
_description: 'UUID for the stock dispensing units uuid',
|
41
41
|
_default: '162402AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA',
|
42
42
|
},
|
43
|
+
useItemCommonNameAsDisplay: {
|
44
|
+
_type: Type.Boolean,
|
45
|
+
_description: 'true to use item common name as display and false to use Drug name as display',
|
46
|
+
_default: true,
|
47
|
+
},
|
43
48
|
stockItemCategoryUUID: {
|
44
49
|
_type: Type.ConceptUuid,
|
45
50
|
_description: 'UUID for the stock item category',
|
@@ -74,6 +79,7 @@ export type ConfigObject = {
|
|
74
79
|
stockSourceTypeUUID: string;
|
75
80
|
dispensingUnitsUUID: string;
|
76
81
|
stockItemCategoryUUID: string;
|
82
|
+
useItemCommonNameAsDisplay: boolean;
|
77
83
|
logo: {
|
78
84
|
src: string;
|
79
85
|
alt: string;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
@use '@carbon/layout';
|
2
|
+
@use '@carbon/type';
|
3
|
+
@use '@carbon/colors';
|
4
|
+
|
5
|
+
.title {
|
6
|
+
@include type.type-style('heading-02');
|
7
|
+
display: flex;
|
8
|
+
align-items: center;
|
9
|
+
justify-content: space-between;
|
10
|
+
margin: layout.$spacing-05;
|
11
|
+
row-gap: 1.5rem;
|
12
|
+
position: relative;
|
13
|
+
|
14
|
+
&::after {
|
15
|
+
content: '';
|
16
|
+
display: block;
|
17
|
+
width: 2rem;
|
18
|
+
border-bottom: 0.375rem solid var(--brand-03);
|
19
|
+
position: absolute;
|
20
|
+
bottom: -0.75rem;
|
21
|
+
left: 0;
|
22
|
+
}
|
23
|
+
|
24
|
+
& > span {
|
25
|
+
@include type.type-style('body-01');
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
.container {
|
30
|
+
background-color: colors.$white-0;
|
31
|
+
border: 1px solid colors.$gray-20;
|
32
|
+
margin-bottom: 1rem;
|
33
|
+
width: 100%;
|
34
|
+
}
|
package/src/stock-operations/add-stock-operation/stock-operations-expanded-row/stock-items-table.tsx
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
import {
|
2
|
+
DataTable,
|
3
|
+
Pagination,
|
4
|
+
Search,
|
5
|
+
Table,
|
6
|
+
TableBody,
|
7
|
+
TableCell,
|
8
|
+
TableHead,
|
9
|
+
TableHeader,
|
10
|
+
TableRow,
|
11
|
+
Tile,
|
12
|
+
} from '@carbon/react';
|
13
|
+
import { formatDate, parseDate, usePagination } from '@openmrs/esm-framework';
|
14
|
+
import React, { useMemo, useState } from 'react';
|
15
|
+
import { useTranslation } from 'react-i18next';
|
16
|
+
import { StockOperationItemDTO } from '../../../core/api/types/stockOperation/StockOperationItemDTO';
|
17
|
+
import styles from './stock-items-table.scss';
|
18
|
+
|
19
|
+
type Props = {
|
20
|
+
items: Array<StockOperationItemDTO>;
|
21
|
+
};
|
22
|
+
const StockItemsTable: React.FC<Props> = ({ items }) => {
|
23
|
+
const { t } = useTranslation();
|
24
|
+
const [pageSize, setPageSize] = useState(10);
|
25
|
+
const pageSizesOptions = useMemo(() => [5, 10, 20, 50, 100], []);
|
26
|
+
const [searchText, setSearchText] = useState();
|
27
|
+
|
28
|
+
const handleSearch = (item: StockOperationItemDTO) => {
|
29
|
+
if (!searchText) return true;
|
30
|
+
return item.commonName.toLowerCase().includes(searchText);
|
31
|
+
};
|
32
|
+
const filtered = items.filter(handleSearch);
|
33
|
+
const { results, totalPages, currentPage, goTo } = usePagination(filtered, pageSize);
|
34
|
+
|
35
|
+
const headers = useMemo(
|
36
|
+
() => [
|
37
|
+
{
|
38
|
+
header: t('item', 'Item'),
|
39
|
+
key: 'commonName',
|
40
|
+
},
|
41
|
+
{
|
42
|
+
header: t('batchNo', 'Batch No'),
|
43
|
+
key: 'batchNo',
|
44
|
+
},
|
45
|
+
{
|
46
|
+
header: t('expiry', 'Expiry'),
|
47
|
+
key: 'expiration',
|
48
|
+
},
|
49
|
+
{
|
50
|
+
header: t('qty', 'Qty'),
|
51
|
+
key: 'quantity',
|
52
|
+
},
|
53
|
+
{
|
54
|
+
header: t('uom', 'UoM'),
|
55
|
+
key: 'stockItemPackagingUOMName',
|
56
|
+
},
|
57
|
+
],
|
58
|
+
[t],
|
59
|
+
);
|
60
|
+
|
61
|
+
const tableRows = useMemo(
|
62
|
+
() =>
|
63
|
+
results.map((item, index) => ({
|
64
|
+
id: index,
|
65
|
+
...item,
|
66
|
+
expiration: item.expiration ? formatDate(parseDate(`${item.expiration}`)) : '--',
|
67
|
+
})),
|
68
|
+
[results],
|
69
|
+
);
|
70
|
+
|
71
|
+
return (
|
72
|
+
<Tile className={styles.container}>
|
73
|
+
<span className={styles.title}>{t('stockItems', 'Stock items')}</span>
|
74
|
+
<Search value={searchText} onChange={({ target: { value } }) => setSearchText(value)} />
|
75
|
+
<DataTable useZebraStyles={true} rows={tableRows} headers={headers}>
|
76
|
+
{({ rows, headers, getTableProps, getHeaderProps, getRowProps }) => (
|
77
|
+
<Table {...getTableProps()}>
|
78
|
+
<TableHead>
|
79
|
+
<TableRow>
|
80
|
+
{headers.map((header) => (
|
81
|
+
<TableHeader {...getHeaderProps({ header })}>{header.header}</TableHeader>
|
82
|
+
))}
|
83
|
+
</TableRow>
|
84
|
+
</TableHead>
|
85
|
+
<TableBody>
|
86
|
+
{rows.map((row) => (
|
87
|
+
<TableRow {...getRowProps({ row })}>
|
88
|
+
{row.cells.map((cell) => (
|
89
|
+
<TableCell key={cell.id}>{cell.value}</TableCell>
|
90
|
+
))}
|
91
|
+
</TableRow>
|
92
|
+
))}
|
93
|
+
</TableBody>
|
94
|
+
</Table>
|
95
|
+
)}
|
96
|
+
</DataTable>
|
97
|
+
<Pagination
|
98
|
+
page={currentPage}
|
99
|
+
pageSize={pageSize}
|
100
|
+
pageSizes={pageSizesOptions}
|
101
|
+
totalItems={filtered.length}
|
102
|
+
onChange={({ page, pageSize }) => {
|
103
|
+
goTo(page);
|
104
|
+
setPageSize(pageSize);
|
105
|
+
}}
|
106
|
+
/>
|
107
|
+
</Tile>
|
108
|
+
);
|
109
|
+
};
|
110
|
+
|
111
|
+
export default StockItemsTable;
|
@@ -0,0 +1,87 @@
|
|
1
|
+
import { Layer, Row } from '@carbon/react';
|
2
|
+
import React from 'react';
|
3
|
+
import { useTranslation } from 'react-i18next';
|
4
|
+
import { StockOperationDTO } from '../../../core/api/types/stockOperation/StockOperationDTO';
|
5
|
+
import styles from './stock-operation-expanded-row.scss';
|
6
|
+
import StockItemsTable from './stock-items-table';
|
7
|
+
import StockOpertationStatus from './stock-operations-status';
|
8
|
+
|
9
|
+
interface StockOperationExpandedRowProps {
|
10
|
+
model: StockOperationDTO;
|
11
|
+
}
|
12
|
+
|
13
|
+
const StockOperationExpandedRow: React.FC<StockOperationExpandedRowProps> = (props) => {
|
14
|
+
const { t } = useTranslation();
|
15
|
+
return (
|
16
|
+
<>
|
17
|
+
<Layer className={styles.statusContainer}>
|
18
|
+
<Row className={styles.statusContainerRow}>
|
19
|
+
{props.model?.dateCreated && (
|
20
|
+
<StockOpertationStatus
|
21
|
+
status={t('started', 'Started')}
|
22
|
+
statusFilledDate={props.model?.dateCreated.toString()}
|
23
|
+
statusFillerFamilyName={props.model?.creatorFamilyName}
|
24
|
+
statusFillerGivenName={props.model?.creatorGivenName}
|
25
|
+
/>
|
26
|
+
)}
|
27
|
+
{props.model.submittedDate && (
|
28
|
+
<StockOpertationStatus
|
29
|
+
status={t('submitted', 'Submitted')}
|
30
|
+
statusFilledDate={props.model?.submittedDate.toString()}
|
31
|
+
statusFillerFamilyName={props.model?.submittedByFamilyName}
|
32
|
+
statusFillerGivenName={props.model?.submittedByGivenName}
|
33
|
+
/>
|
34
|
+
)}
|
35
|
+
{props.model?.dispatchedDate && (
|
36
|
+
<StockOpertationStatus
|
37
|
+
status={t('dispatched', 'Dispatched')}
|
38
|
+
statusFilledDate={props.model?.dispatchedDate.toString()}
|
39
|
+
statusFillerFamilyName={props.model?.dispatchedByFamilyName}
|
40
|
+
statusFillerGivenName={props.model?.dispatchedByGivenName}
|
41
|
+
/>
|
42
|
+
)}
|
43
|
+
{props.model?.returnedDate && (
|
44
|
+
<StockOpertationStatus
|
45
|
+
status={t('returned', 'Returned')}
|
46
|
+
statusFilledDate={props.model?.returnedDate.toString()}
|
47
|
+
statusFillerFamilyName={props.model?.returnedByFamilyName}
|
48
|
+
statusFillerGivenName={props.model?.returnedByGivenName}
|
49
|
+
extraStatusinfo={<span className={styles.text}>{props.model?.returnReason}</span>}
|
50
|
+
/>
|
51
|
+
)}
|
52
|
+
{props.model?.completedDate && (
|
53
|
+
<StockOpertationStatus
|
54
|
+
status={t('completed', 'Completed')}
|
55
|
+
statusFilledDate={props.model?.completedDate.toString()}
|
56
|
+
statusFillerFamilyName={props.model?.completedByFamilyName}
|
57
|
+
statusFillerGivenName={props.model?.completedByGivenName}
|
58
|
+
/>
|
59
|
+
)}
|
60
|
+
{props.model?.status === 'CANCELLED' && (
|
61
|
+
<StockOpertationStatus
|
62
|
+
status={t('cancelled', 'Cancelled')}
|
63
|
+
statusFilledDate={props.model?.cancelledDate.toString()}
|
64
|
+
statusFillerFamilyName={props.model?.cancelledByFamilyName}
|
65
|
+
statusFillerGivenName={props.model?.cancelledByGivenName}
|
66
|
+
extraStatusinfo={<span className={styles.text}>{props.model?.cancelReason}</span>}
|
67
|
+
/>
|
68
|
+
)}
|
69
|
+
{props.model?.status === 'REJECTED' && (
|
70
|
+
<StockOpertationStatus
|
71
|
+
status={t('rejected', 'Rejected')}
|
72
|
+
statusFilledDate={props.model?.rejectedDate.toString()}
|
73
|
+
statusFillerFamilyName={props.model?.rejectedByFamilyName}
|
74
|
+
statusFillerGivenName={props.model?.rejectedByGivenName}
|
75
|
+
extraStatusinfo={<span>{props.model?.rejectionReason}</span>}
|
76
|
+
/>
|
77
|
+
)}
|
78
|
+
</Row>
|
79
|
+
<Row className={styles.statusContainerRow}>
|
80
|
+
<StockItemsTable items={props.model.stockOperationItems} />
|
81
|
+
</Row>
|
82
|
+
</Layer>
|
83
|
+
</>
|
84
|
+
);
|
85
|
+
};
|
86
|
+
|
87
|
+
export default StockOperationExpandedRow;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
@use '@carbon/layout';
|
2
|
+
@use '@carbon/type';
|
3
|
+
@use '~@openmrs/esm-styleguide/src/vars' as *;
|
4
|
+
|
5
|
+
.textHeading {
|
6
|
+
font-weight: bold;
|
7
|
+
}
|
8
|
+
|
9
|
+
.statusDescriptions {
|
10
|
+
margin-top: 4px;
|
11
|
+
|
12
|
+
.text {
|
13
|
+
margin-right: 4px;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
|
17
|
+
.statusContainer {
|
18
|
+
display: flex;
|
19
|
+
margin: 10px;
|
20
|
+
gap: layout.$spacing-05;
|
21
|
+
flex-direction: column;
|
22
|
+
padding: layout.$spacing-05;
|
23
|
+
}
|
24
|
+
|
25
|
+
.statusContainerRow {
|
26
|
+
display: flex;
|
27
|
+
width: 100%;
|
28
|
+
border: none;
|
29
|
+
gap: layout.$spacing-05;
|
30
|
+
flex: 1;
|
31
|
+
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import { formatDate, parseDate } from '@openmrs/esm-framework';
|
2
|
+
import React from 'react';
|
3
|
+
import { useTranslation } from 'react-i18next';
|
4
|
+
import styles from './stock-operation-expanded-row.scss';
|
5
|
+
|
6
|
+
type Props = {
|
7
|
+
status: string;
|
8
|
+
statusFilledDate: string;
|
9
|
+
statusFillerGivenName?: string;
|
10
|
+
statusFillerFamilyName?: string;
|
11
|
+
extraStatusinfo?: React.ReactNode;
|
12
|
+
};
|
13
|
+
|
14
|
+
const StockOpertationStatus: React.FC<Props> = ({
|
15
|
+
status,
|
16
|
+
statusFillerFamilyName,
|
17
|
+
statusFillerGivenName,
|
18
|
+
statusFilledDate,
|
19
|
+
extraStatusinfo,
|
20
|
+
}) => {
|
21
|
+
const { t } = useTranslation();
|
22
|
+
return (
|
23
|
+
<div>
|
24
|
+
<span className={styles.textHeading}>{status}:</span>
|
25
|
+
<div className={styles.statusDescriptions}>
|
26
|
+
<span className={styles.text}>
|
27
|
+
{formatDate(parseDate(statusFilledDate), {
|
28
|
+
time: true,
|
29
|
+
mode: 'standard',
|
30
|
+
})}
|
31
|
+
</span>
|
32
|
+
|
33
|
+
<span className={styles.text}>{t('by', 'By')}</span>
|
34
|
+
|
35
|
+
<span className={styles.text}>
|
36
|
+
{statusFillerFamilyName}
|
37
|
+
{statusFillerGivenName}
|
38
|
+
</span>
|
39
|
+
{extraStatusinfo}
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
);
|
43
|
+
};
|
44
|
+
|
45
|
+
export default StockOpertationStatus;
|
package/src/stock-operations/stock-operations-forms/input-components/stock-item-search.component.tsx
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
import { ClickableTile, Search } from '@carbon/react';
|
2
|
-
import { useDebounce } from '@openmrs/esm-framework';
|
3
|
-
import React, { useEffect, useState } from 'react';
|
2
|
+
import { useConfig, useDebounce } from '@openmrs/esm-framework';
|
3
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
4
4
|
import { useTranslation } from 'react-i18next';
|
5
5
|
import { StockItemDTO } from '../../../core/api/types/stockItem/StockItem';
|
6
6
|
import { useFilterableStockItems } from '../hooks/useFilterableStockItems';
|
7
7
|
import styles from './input-components-styles.scss';
|
8
|
+
import { ConfigObject } from '../../../config-schema';
|
8
9
|
|
9
10
|
type StockItemSearchProps = {
|
10
11
|
onSelectedItem?: (stockItem: StockItemDTO) => void;
|
@@ -15,7 +16,24 @@ const StockItemSearch: React.FC<StockItemSearchProps> = ({ onSelectedItem }) =>
|
|
15
16
|
const { isLoading, stockItemsList, setSearchString } = useFilterableStockItems({});
|
16
17
|
const [searchTerm, setSearchTerm] = useState('');
|
17
18
|
const debouncedSearchTerm = useDebounce(searchTerm);
|
19
|
+
const { useItemCommonNameAsDisplay } = useConfig<ConfigObject>();
|
20
|
+
const getDrugName = useCallback(
|
21
|
+
(item: StockItemDTO) => {
|
22
|
+
if (useItemCommonNameAsDisplay) return;
|
23
|
+
const commonName = item?.commonName ? `(Common name: ${item.commonName})` : undefined;
|
24
|
+
return `${item?.drugName || t('noDrugNameAvailable', 'No drug name available') + (commonName ?? '')}`;
|
25
|
+
},
|
26
|
+
[useItemCommonNameAsDisplay, t],
|
27
|
+
);
|
18
28
|
|
29
|
+
const getCommonName = useCallback(
|
30
|
+
(item: StockItemDTO) => {
|
31
|
+
if (!useItemCommonNameAsDisplay) return;
|
32
|
+
const drugName = item?.drugName ? `(Drug name: ${item.drugName})` : undefined;
|
33
|
+
return `${item?.commonName || t('noCommonNameAvailable', 'No common name available') + (drugName ?? '')}`;
|
34
|
+
},
|
35
|
+
[useItemCommonNameAsDisplay, t],
|
36
|
+
);
|
19
37
|
useEffect(() => {
|
20
38
|
if (debouncedSearchTerm?.length !== 0) {
|
21
39
|
setSearchString(debouncedSearchTerm);
|
@@ -26,6 +44,7 @@ const StockItemSearch: React.FC<StockItemSearchProps> = ({ onSelectedItem }) =>
|
|
26
44
|
onSelectedItem?.(stockItem);
|
27
45
|
setSearchTerm('');
|
28
46
|
};
|
47
|
+
|
29
48
|
return (
|
30
49
|
<div className={styles.stockItemSearchContainer}>
|
31
50
|
<div style={{ display: 'flex' }}>
|
@@ -42,11 +61,15 @@ const StockItemSearch: React.FC<StockItemSearchProps> = ({ onSelectedItem }) =>
|
|
42
61
|
</div>
|
43
62
|
{searchTerm && stockItemsList?.length > 0 && (
|
44
63
|
<div className={styles.searchResults}>
|
45
|
-
{stockItemsList?.slice(0, 5).map((stockItem) =>
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
64
|
+
{stockItemsList?.slice(0, 5).map((stockItem) => {
|
65
|
+
const commonName = getCommonName(stockItem);
|
66
|
+
const drugName = getDrugName(stockItem);
|
67
|
+
return (
|
68
|
+
<ClickableTile onClick={() => handleOnSearchResultClick(stockItem)} key={stockItem?.uuid}>
|
69
|
+
{useItemCommonNameAsDisplay ? commonName : drugName}
|
70
|
+
</ClickableTile>
|
71
|
+
);
|
72
|
+
})}
|
50
73
|
</div>
|
51
74
|
)}
|
52
75
|
</div>
|
@@ -176,7 +176,9 @@ describe('Stock Operation step 2 (stock operation items details)', () => {
|
|
176
176
|
it('should search stock operation item and render results', async () => {
|
177
177
|
const mocksetSearchString = jest.fn();
|
178
178
|
(useFilterableStockItems as jest.Mock).mockReturnValue({
|
179
|
-
stockItemsList: [
|
179
|
+
stockItemsList: [
|
180
|
+
{ uuid: 'mock-uuid', commonName: 'mock-common-name', drugName: 'mock-common-name' },
|
181
|
+
] as Array<StockItemDTO>,
|
180
182
|
setLimit: jest.fn(),
|
181
183
|
setRepresentation: jest.fn(),
|
182
184
|
isLoading: false,
|
@@ -198,7 +200,9 @@ describe('Stock Operation step 2 (stock operation items details)', () => {
|
|
198
200
|
|
199
201
|
it('should properly handle stock operation item selection', async () => {
|
200
202
|
(useFilterableStockItems as jest.Mock).mockReturnValue({
|
201
|
-
stockItemsList: [
|
203
|
+
stockItemsList: [
|
204
|
+
{ uuid: 'mock-uuid', commonName: 'mock-common-name', drugName: 'mock-common-name' },
|
205
|
+
] as Array<StockItemDTO>,
|
202
206
|
setLimit: jest.fn(),
|
203
207
|
setRepresentation: jest.fn(),
|
204
208
|
isLoading: false,
|