@openmrs/esm-billing-app 1.0.2-pre.725 → 1.0.2-pre.737
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/4739.js +1 -1
- package/dist/4739.js.map +1 -1
- package/dist/7452.js +1 -1
- package/dist/7452.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/openmrs-esm-billing-app.js +1 -1
- package/dist/openmrs-esm-billing-app.js.buildmanifest.json +8 -8
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/billing-form/billing-form.component.tsx +125 -42
- package/src/billing-form/billing-form.scss +140 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
var _openmrs_esm_billing_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,f,p,d,c,h,m,v,g,b,y,w,_={45120:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(2177),t.e(8930),t.e(1146),t.e(2524),t.e(6072),t.e(3006),t.e(942)]).then((()=>()=>t(80942)))},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})}},P={};function S(e){var r=P[e];if(void 0!==r)return r.exports;var t=P[e]={id:e,loaded:!1,exports:{}};return _[e].call(t.exports,t,t.exports,S),t.loaded=!0,t.exports}S.m=_,S.c=P,S.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return S.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,S.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);S.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,S.d(o,a),o},S.d=(e,r)=>{for(var t in r)S.o(r,t)&&!S.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},S.f={},S.e=e=>Promise.all(Object.keys(S.f).reduce(((r,t)=>(S.f[t](e,r),r)),[])),S.u=e=>e+".js",S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-billing-app:",S.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,S.nc&&i.setAttribute("nonce",S.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var p=(r,n)=>{i.onerror=i.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=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)}},S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},S.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{S.S={};var e={},r={};S.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];S.o(S.S,t)||(S.S[t]={});var a=S.S[t],i="@openmrs/esm-billing-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","8.0.1-pre.
|
|
1
|
+
var _openmrs_esm_billing_app;(()=>{"use strict";var e,r,t,n,o,a,i,l,s,u,f,p,d,c,h,m,v,g,b,y,w,_={45120:(e,r,t)=>{var n={"./start":()=>Promise.all([t.e(2177),t.e(8930),t.e(1146),t.e(2524),t.e(6072),t.e(3006),t.e(942)]).then((()=>()=>t(80942)))},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})}},P={};function S(e){var r=P[e];if(void 0!==r)return r.exports;var t=P[e]={id:e,loaded:!1,exports:{}};return _[e].call(t.exports,t,t.exports,S),t.loaded=!0,t.exports}S.m=_,S.c=P,S.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return S.d(r,{a:r}),r},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,S.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);S.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,S.d(o,a),o},S.d=(e,r)=>{for(var t in r)S.o(r,t)&&!S.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},S.f={},S.e=e=>Promise.all(Object.keys(S.f).reduce(((r,t)=>(S.f[t](e,r),r)),[])),S.u=e=>e+".js",S.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),S.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t={},n="@openmrs/esm-billing-app:",S.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,S.nc&&i.setAttribute("nonce",S.nc),i.setAttribute("data-webpack",n+o),i.src=e),t[e]=[r];var p=(r,n)=>{i.onerror=i.onload=null,clearTimeout(d);var o=t[e];if(delete t[e],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach((e=>e(n))),r)return r(n)},d=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)}},S.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},S.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{S.S={};var e={},r={};S.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];S.o(S.S,t)||(S.S[t]={});var a=S.S[t],i="@openmrs/esm-billing-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","8.0.1-pre.3415",(()=>Promise.all([S.e(2177),S.e(7452),S.e(8930),S.e(1856),S.e(6072),S.e(1997),S.e(3006)]).then((()=>()=>S(41856))))),l("@openmrs/esm-patient-common-lib","11.3.1-pre.8983",(()=>Promise.all([S.e(2177),S.e(7452),S.e(8930),S.e(4724),S.e(1146),S.e(6072),S.e(1997),S.e(3006)]).then((()=>()=>S(94724))))),l("react-dom","18.3.1",(()=>Promise.all([S.e(961),S.e(6072)]).then((()=>()=>S(40961))))),l("react-i18next","14.0.1",(()=>Promise.all([S.e(7255),S.e(6072)]).then((()=>()=>S(77255))))),l("react","18.3.1",(()=>S.e(6540).then((()=>()=>S(96540))))),l("rxjs","6.6.7",(()=>S.e(3184).then((()=>()=>S(63184))))),l("swr/immutable","2.3.3",(()=>Promise.all([S.e(2177),S.e(6072),S.e(4225)]).then((()=>()=>S(54225))))),l("swr/infinite","2.3.3",(()=>Promise.all([S.e(2177),S.e(6072),S.e(3041)]).then((()=>()=>S(23041)))))),e[t]=s.length?Promise.all(s).then((()=>e[t]=1)):1}}})(),(()=>{var e;S.g.importScripts&&(e=S.g.location+"");var r=S.g.document;if(!e&&r&&(r.currentScript&&"SCRIPT"===r.currentScript.tagName.toUpperCase()&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");if(t.length)for(var n=t.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=t[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),S.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 d=[],c=d.pop.bind(d);for(a=1;a<e.length;a++){var h=e[a];d.push(1==h?c()|c():2==h?c()&c():h?l(h,r):!c())}return!!c()},s=(e,r)=>e&&S.o(e,r),u=e=>(e.loaded=1,e.get()),f=e=>Object.keys(e).reduce(((r,t)=>(e[t].eager&&(r[t]=e[t]),r)),{}),p=(e,r,t)=>{var n=t?f(e[r]):e[r];return Object.keys(n).reduce(((e,r)=>!e||!n[e].loaded&&a(e,r)?r:e),0)},d=(e,r,t,n)=>"Unsatisfied version "+t+" from "+(t&&e[r][t].from)+" of shared singleton module "+r+" (required "+i(n)+")",c=e=>{throw new Error(e)},h=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},m=(e,r,t)=>t?t():((e,r)=>c("Shared module "+r+" doesn't exist in shared scope "+e))(e,r),v=(e=>function(r,t,n,o,a){var i=S.I(r);return i&&i.then&&!n?i.then(e.bind(e,r,S.S[r],t,!1,o,a)):e(r,S.S[r],t,n,o,a)})(((e,r,t,n,o,a)=>{if(!s(r,t))return m(e,t,a);var i=p(r,t,n);return l(o,i)||h(d(r,t,i,o)),u(r[t][i])})),g={},b={16072:()=>v("default","react",!1,[1,18],(()=>S.e(6540).then((()=>()=>S(96540))))),44209:()=>v("default","swr/immutable",!1,[1,2],(()=>S.e(6606).then((()=>()=>S(54225))))),53083:()=>v("default","rxjs",!1,[1,6],(()=>S.e(3184).then((()=>()=>S(63184))))),56339:()=>v("default","swr/infinite",!1,[1,2],(()=>S.e(5422).then((()=>()=>S(23041))))),15847:()=>v("default","@openmrs/esm-framework",!1,[1,8],(()=>Promise.all([S.e(7452),S.e(1856),S.e(1997)]).then((()=>()=>S(41856))))),53941:()=>v("default","react-i18next",!1,[1,11],(()=>S.e(7255).then((()=>()=>S(77255))))),92646:()=>v("default","react-dom",!1,[1,18],(()=>S.e(961).then((()=>()=>S(40961))))),35332:()=>v("default","@openmrs/esm-patient-common-lib",!1,[1,11],(()=>Promise.all([S.e(7452),S.e(4724),S.e(1997)]).then((()=>()=>S(94724)))))},y={942:[35332],1997:[44209,53083,56339],3006:[15847,53941,92646],6072:[16072]},w={},S.f.consumes=(e,r)=>{S.o(y,e)&&y[e].forEach((e=>{if(S.o(g,e))return r.push(g[e]);if(!w[e]){var t=r=>{g[e]=0,S.m[e]=t=>{delete S.c[e],t.exports=r()}};w[e]=!0;var n=r=>{delete g[e],S.m[e]=t=>{throw delete S.c[e],r}};try{var o=b[e]();o.then?r.push(g[e]=o.then(t).catch(n)):t(o)}catch(e){n(e)}}}))},(()=>{var e={6803:0};S.f.j=(r,t)=>{var n=S.o(e,r)?e[r]:void 0;if(0!==n)if(n)t.push(n[2]);else if(/^(1997|3006|6072)$/.test(r))e[r]=0;else{var o=new Promise(((t,o)=>n=e[r]=[t,o]));t.push(n[2]=o);var a=S.p+S.u(r),i=new Error;S.l(a,(t=>{if(S.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)}};var r=(r,t)=>{var n,o,[a,i,l]=t,s=0;if(a.some((r=>0!==e[r]))){for(n in i)S.o(i,n)&&(S.m[n]=i[n]);l&&l(S)}for(r&&r(t);s<a.length;s++)o=a[s],S.o(e,o)&&e[o]&&e[o][0](),e[o]=0},t=globalThis.webpackChunk_openmrs_esm_billing_app=globalThis.webpackChunk_openmrs_esm_billing_app||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})(),S.nc=void 0;var j=S(45120);_openmrs_esm_billing_app=j})();
|
|
@@ -659,9 +659,9 @@
|
|
|
659
659
|
"initial": false,
|
|
660
660
|
"entry": false,
|
|
661
661
|
"recorded": false,
|
|
662
|
-
"size":
|
|
662
|
+
"size": 37846,
|
|
663
663
|
"sizes": {
|
|
664
|
-
"javascript":
|
|
664
|
+
"javascript": 37846
|
|
665
665
|
},
|
|
666
666
|
"names": [],
|
|
667
667
|
"idHints": [],
|
|
@@ -675,7 +675,7 @@
|
|
|
675
675
|
"auxiliaryFiles": [
|
|
676
676
|
"4739.js.map"
|
|
677
677
|
],
|
|
678
|
-
"hash": "
|
|
678
|
+
"hash": "9effec24bd4f34f8",
|
|
679
679
|
"childrenByOrder": {}
|
|
680
680
|
},
|
|
681
681
|
{
|
|
@@ -971,7 +971,7 @@
|
|
|
971
971
|
"auxiliaryFiles": [
|
|
972
972
|
"openmrs-esm-billing-app.js.map"
|
|
973
973
|
],
|
|
974
|
-
"hash": "
|
|
974
|
+
"hash": "93a70ed033bdb78b",
|
|
975
975
|
"childrenByOrder": {}
|
|
976
976
|
},
|
|
977
977
|
{
|
|
@@ -1095,9 +1095,9 @@
|
|
|
1095
1095
|
"entry": false,
|
|
1096
1096
|
"recorded": false,
|
|
1097
1097
|
"reason": "split chunk (cache group: defaultVendors)",
|
|
1098
|
-
"size":
|
|
1098
|
+
"size": 4074509,
|
|
1099
1099
|
"sizes": {
|
|
1100
|
-
"javascript":
|
|
1100
|
+
"javascript": 4074509
|
|
1101
1101
|
},
|
|
1102
1102
|
"names": [],
|
|
1103
1103
|
"idHints": [
|
|
@@ -1113,7 +1113,7 @@
|
|
|
1113
1113
|
"auxiliaryFiles": [
|
|
1114
1114
|
"7452.js.map"
|
|
1115
1115
|
],
|
|
1116
|
-
"hash": "
|
|
1116
|
+
"hash": "f6159abaa2195e90",
|
|
1117
1117
|
"childrenByOrder": {}
|
|
1118
1118
|
},
|
|
1119
1119
|
{
|
|
@@ -1229,7 +1229,7 @@
|
|
|
1229
1229
|
"auxiliaryFiles": [
|
|
1230
1230
|
"main.js.map"
|
|
1231
1231
|
],
|
|
1232
|
-
"hash": "
|
|
1232
|
+
"hash": "5e6c9136da519695",
|
|
1233
1233
|
"childrenByOrder": {}
|
|
1234
1234
|
},
|
|
1235
1235
|
{
|
package/dist/routes.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.24.0","fhir2":">=1.2"},"pages":[{"component":"billableServicesHome","route":"billable-services"}],"extensions":[{"component":"billingDashboardLink","name":"billing-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"billing","title":"billing","slot":"billing-dashboard-slot"},"featureFlag":"billing"},{"component":"root","name":"billing-dashboard-root","slot":"billing-dashboard-slot"},{"name":"billing-patient-summary","component":"billingPatientSummary","slot":"patient-chart-billing-dashboard-slot","order":10,"meta":{"columnSpan":4}},{"name":"billing-summary-dashboard-link","component":"billingSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":11,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-billing-dashboard-slot","path":"Billing history"},"featureFlag":"billing"},{"name":"billable-services-app-menu-item","component":"billableServicesAppMenuItem","slot":"app-menu-item-slot","meta":{"name":"Billable Services"}},{"name":"billing-checkin-form","slot":"extra-visit-attribute-slot","component":"billingCheckInForm","featureFlag":"billing"},{"slot":"system-admin-page-card-link-slot","component":"billableServicesCardLink","name":"billable-services-admin-card-link"},{"name":"patient-banner-billing-tags","component":"visitAttributeTags","slot":"patient-banner-tags-slot","order":2},{"name":"billing-home-tiles-ext","slot":"billing-home-tiles-slot","component":"serviceMetrics"},{"name":"edit-bill-line-item-dialog","component":"editBillLineItemModal","online":true,"offline":true}],"modals":[{"name":"add-cash-point-modal","component":"addCashPointModal"},{"name":"add-payment-mode-modal","component":"addPaymentModeModal"},{"name":"delete-payment-mode-modal","component":"deletePaymentModeModal"},{"name":"edit-bill-item-modal","component":"editBillLineItemModal"},{"name":"edit-billable-service-modal","component":"editBillableServiceModal"},{"name":"require-billing-modal","component":"requirePaymentModal"}],"workspaces":[{"name":"billing-form-workspace","title":"billingForm","component":"billingFormWorkspace","type":"form"}],"featureFlags":[{"flagName":"billing","label":"Billing module","description":"This feature introduces navigation links on the patient chart and home page to allow accessing the billing module features"}],"version":"1.0.2-pre.
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":">=2.24.0","fhir2":">=1.2"},"pages":[{"component":"billableServicesHome","route":"billable-services"}],"extensions":[{"component":"billingDashboardLink","name":"billing-dashboard-link","slot":"homepage-dashboard-slot","meta":{"name":"billing","title":"billing","slot":"billing-dashboard-slot"},"featureFlag":"billing"},{"component":"root","name":"billing-dashboard-root","slot":"billing-dashboard-slot"},{"name":"billing-patient-summary","component":"billingPatientSummary","slot":"patient-chart-billing-dashboard-slot","order":10,"meta":{"columnSpan":4}},{"name":"billing-summary-dashboard-link","component":"billingSummaryDashboardLink","slot":"patient-chart-dashboard-slot","order":11,"meta":{"columns":1,"columnSpan":1,"slot":"patient-chart-billing-dashboard-slot","path":"Billing history"},"featureFlag":"billing"},{"name":"billable-services-app-menu-item","component":"billableServicesAppMenuItem","slot":"app-menu-item-slot","meta":{"name":"Billable Services"}},{"name":"billing-checkin-form","slot":"extra-visit-attribute-slot","component":"billingCheckInForm","featureFlag":"billing"},{"slot":"system-admin-page-card-link-slot","component":"billableServicesCardLink","name":"billable-services-admin-card-link"},{"name":"patient-banner-billing-tags","component":"visitAttributeTags","slot":"patient-banner-tags-slot","order":2},{"name":"billing-home-tiles-ext","slot":"billing-home-tiles-slot","component":"serviceMetrics"},{"name":"edit-bill-line-item-dialog","component":"editBillLineItemModal","online":true,"offline":true}],"modals":[{"name":"add-cash-point-modal","component":"addCashPointModal"},{"name":"add-payment-mode-modal","component":"addPaymentModeModal"},{"name":"delete-payment-mode-modal","component":"deletePaymentModeModal"},{"name":"edit-bill-item-modal","component":"editBillLineItemModal"},{"name":"edit-billable-service-modal","component":"editBillableServiceModal"},{"name":"require-billing-modal","component":"requirePaymentModal"}],"workspaces":[{"name":"billing-form-workspace","title":"billingForm","component":"billingFormWorkspace","type":"form"}],"featureFlags":[{"flagName":"billing","label":"Billing module","description":"This feature introduces navigation links on the patient chart and home page to allow accessing the billing module features"}],"version":"1.0.2-pre.737"}
|
package/package.json
CHANGED
|
@@ -21,10 +21,15 @@ import { useConfig, useLayoutType, showSnackbar, getCoreTranslation } from '@ope
|
|
|
21
21
|
import { processBillItems, useBillableServices } from '../billing.resource';
|
|
22
22
|
import { calculateTotalAmount, convertToCurrency } from '../helpers/functions';
|
|
23
23
|
import type { BillingConfig } from '../config-schema';
|
|
24
|
-
import type { BillableItem, LineItem } from '../types';
|
|
24
|
+
import type { BillableItem, LineItem, ServicePrice } from '../types';
|
|
25
25
|
import { apiBasePath } from '../constants';
|
|
26
26
|
import styles from './billing-form.scss';
|
|
27
27
|
|
|
28
|
+
interface ExtendedLineItem extends LineItem {
|
|
29
|
+
selectedPaymentMethod?: ServicePrice;
|
|
30
|
+
availablePaymentMethods?: ServicePrice[];
|
|
31
|
+
}
|
|
32
|
+
|
|
28
33
|
type BillingFormProps = {
|
|
29
34
|
patientUuid: string;
|
|
30
35
|
closeWorkspace: () => void;
|
|
@@ -35,13 +40,13 @@ const BillingForm: React.FC<BillingFormProps> = ({ patientUuid, closeWorkspace }
|
|
|
35
40
|
const { t } = useTranslation();
|
|
36
41
|
const { defaultCurrency, postBilledItems } = useConfig<BillingConfig>();
|
|
37
42
|
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
38
|
-
const [selectedItems, setSelectedItems] = useState<
|
|
43
|
+
const [selectedItems, setSelectedItems] = useState<ExtendedLineItem[]>([]);
|
|
39
44
|
const { data, error, isLoading } = useBillableServices();
|
|
40
45
|
|
|
41
46
|
const selectBillableItem = (item: BillableItem) => {
|
|
42
47
|
if (!item) return;
|
|
43
|
-
const existingItem = selectedItems.find((selectedItem) => selectedItem.uuid === item.uuid);
|
|
44
48
|
|
|
49
|
+
const existingItem = selectedItems.find((selectedItem) => selectedItem.uuid === item.uuid);
|
|
45
50
|
if (existingItem) {
|
|
46
51
|
const updatedItem = { ...existingItem, quantity: existingItem.quantity + 1 };
|
|
47
52
|
setSelectedItems(
|
|
@@ -50,15 +55,27 @@ const BillingForm: React.FC<BillingFormProps> = ({ patientUuid, closeWorkspace }
|
|
|
50
55
|
return;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
const
|
|
58
|
+
const availablePaymentMethods = item.servicePrices || [];
|
|
59
|
+
let defaultPrice = 0;
|
|
60
|
+
let selectedPaymentMethod = null;
|
|
61
|
+
|
|
62
|
+
if (availablePaymentMethods.length === 1) {
|
|
63
|
+
defaultPrice = parseFloat(availablePaymentMethods[0].price);
|
|
64
|
+
selectedPaymentMethod = availablePaymentMethods[0];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const mappedItem: ExtendedLineItem = {
|
|
54
68
|
uuid: item.uuid,
|
|
55
69
|
display: item.name,
|
|
56
70
|
quantity: 1,
|
|
57
|
-
price:
|
|
71
|
+
price: defaultPrice,
|
|
58
72
|
billableService: item.uuid,
|
|
59
73
|
paymentStatus: 'PENDING',
|
|
60
74
|
lineItemOrder: 0,
|
|
75
|
+
selectedPaymentMethod: selectedPaymentMethod,
|
|
76
|
+
availablePaymentMethods: availablePaymentMethods,
|
|
61
77
|
};
|
|
78
|
+
|
|
62
79
|
setSelectedItems([...selectedItems, mappedItem]);
|
|
63
80
|
};
|
|
64
81
|
|
|
@@ -72,7 +89,40 @@ const BillingForm: React.FC<BillingFormProps> = ({ patientUuid, closeWorkspace }
|
|
|
72
89
|
setSelectedItems(updatedItems);
|
|
73
90
|
};
|
|
74
91
|
|
|
92
|
+
const updatePaymentMethod = (itemUuid: string, paymentMethod: ServicePrice) => {
|
|
93
|
+
const updatedItems = [...selectedItems].map((item) =>
|
|
94
|
+
item.uuid === itemUuid
|
|
95
|
+
? {
|
|
96
|
+
...item,
|
|
97
|
+
selectedPaymentMethod: paymentMethod,
|
|
98
|
+
price: parseFloat(paymentMethod.price),
|
|
99
|
+
priceName: paymentMethod.name,
|
|
100
|
+
priceUuid: paymentMethod.uuid,
|
|
101
|
+
}
|
|
102
|
+
: item,
|
|
103
|
+
);
|
|
104
|
+
setSelectedItems(updatedItems);
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
const validateSelectedItems = (): boolean => {
|
|
108
|
+
for (const item of selectedItems) {
|
|
109
|
+
if (item.availablePaymentMethods && item.availablePaymentMethods.length > 1 && !item.selectedPaymentMethod) {
|
|
110
|
+
showSnackbar({
|
|
111
|
+
title: t('validationError', 'Validation Error'),
|
|
112
|
+
subtitle: t('selectPaymentMethodRequired', 'Please select a payment method for all items'),
|
|
113
|
+
kind: 'error',
|
|
114
|
+
});
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return true;
|
|
119
|
+
};
|
|
120
|
+
|
|
75
121
|
const postBillItems = () => {
|
|
122
|
+
if (!validateSelectedItems()) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
76
126
|
setIsSubmitting(true);
|
|
77
127
|
const bill = {
|
|
78
128
|
cashPoint: postBilledItems.cashPoint,
|
|
@@ -142,49 +192,82 @@ const BillingForm: React.FC<BillingFormProps> = ({ patientUuid, closeWorkspace }
|
|
|
142
192
|
/>
|
|
143
193
|
)}
|
|
144
194
|
{selectedItems && selectedItems.length > 0 && (
|
|
145
|
-
<
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
195
|
+
<div className={styles.selectedItemsContainer}>
|
|
196
|
+
<h4>{t('selectedItems', 'Selected Items')}</h4>
|
|
197
|
+
{selectedItems.map((item) => (
|
|
198
|
+
<div key={item.uuid} className={styles.itemCard}>
|
|
199
|
+
<div className={styles.itemHeader}>
|
|
200
|
+
<span className={styles.itemName}>{item.display}</span>
|
|
201
|
+
<Button
|
|
202
|
+
kind="ghost"
|
|
203
|
+
size="sm"
|
|
204
|
+
renderIcon={TrashCan}
|
|
205
|
+
iconDescription={t('remove', 'Remove')}
|
|
206
|
+
onClick={() => removeSelectedBillableItem(item.uuid)}
|
|
207
|
+
/>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<div className={styles.itemControls}>
|
|
211
|
+
{item.availablePaymentMethods && item.availablePaymentMethods.length > 1 ? (
|
|
212
|
+
<div className={styles.controlSection}>
|
|
213
|
+
<label>{t('selectPaymentMethod', 'Select payment method')}</label>
|
|
214
|
+
<ComboBox
|
|
215
|
+
id={`payment-method-${item.uuid}`}
|
|
216
|
+
items={item.availablePaymentMethods}
|
|
217
|
+
size="md"
|
|
218
|
+
itemToString={(method: ServicePrice) =>
|
|
219
|
+
method
|
|
220
|
+
? `${method.name} - ${convertToCurrency(parseFloat(method.price), defaultCurrency)}`
|
|
221
|
+
: ''
|
|
222
|
+
}
|
|
223
|
+
selectedItem={item.selectedPaymentMethod}
|
|
224
|
+
onChange={({ selectedItem }) => {
|
|
225
|
+
if (selectedItem) {
|
|
226
|
+
updatePaymentMethod(item.uuid, selectedItem);
|
|
227
|
+
}
|
|
228
|
+
}}
|
|
229
|
+
placeholder={t('selectPaymentMethod', 'Select payment method')}
|
|
230
|
+
titleText=""
|
|
231
|
+
/>
|
|
232
|
+
</div>
|
|
233
|
+
) : (
|
|
234
|
+
<div className={styles.controlSection}>
|
|
235
|
+
<label>{t('unitPrice', 'Unit Price')}</label>
|
|
236
|
+
<span className={styles.priceDisplay}>{convertToCurrency(item.price, defaultCurrency)}</span>
|
|
237
|
+
</div>
|
|
238
|
+
)}
|
|
239
|
+
|
|
240
|
+
<div className={styles.controlSection}>
|
|
241
|
+
<label>{t('quantity', 'Quantity')}</label>
|
|
160
242
|
<NumberInput
|
|
161
|
-
id={
|
|
243
|
+
id={`quantity-${item.uuid}`}
|
|
162
244
|
min={1}
|
|
163
|
-
value={
|
|
245
|
+
value={item.quantity}
|
|
246
|
+
size="md"
|
|
164
247
|
onChange={(_, { value }) => {
|
|
165
248
|
const number = parseFloat(String(value));
|
|
166
|
-
updateQuantity(
|
|
249
|
+
updateQuantity(item.uuid, isNaN(number) ? 1 : number);
|
|
167
250
|
}}
|
|
168
251
|
/>
|
|
169
|
-
</
|
|
170
|
-
|
|
171
|
-
<
|
|
172
|
-
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
</
|
|
177
|
-
</
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
</
|
|
186
|
-
</
|
|
187
|
-
</
|
|
252
|
+
</div>
|
|
253
|
+
|
|
254
|
+
<div className={styles.controlSection}>
|
|
255
|
+
<label>{t('total', 'Total')}</label>
|
|
256
|
+
<span className={styles.totalDisplay}>
|
|
257
|
+
{convertToCurrency(item.price * item.quantity, defaultCurrency)}
|
|
258
|
+
</span>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
</div>
|
|
262
|
+
))}
|
|
263
|
+
|
|
264
|
+
<div className={styles.grandTotal}>
|
|
265
|
+
<strong>
|
|
266
|
+
{t('grandTotal', 'Grand total')}:{' '}
|
|
267
|
+
{convertToCurrency(calculateTotalAmount(selectedItems), defaultCurrency)}
|
|
268
|
+
</strong>
|
|
269
|
+
</div>
|
|
270
|
+
</div>
|
|
188
271
|
)}
|
|
189
272
|
</div>
|
|
190
273
|
|
|
@@ -88,3 +88,143 @@
|
|
|
88
88
|
.spacer {
|
|
89
89
|
margin-top: layout.$spacing-05;
|
|
90
90
|
}
|
|
91
|
+
|
|
92
|
+
.selectedItemsContainer {
|
|
93
|
+
margin-top: layout.$spacing-05;
|
|
94
|
+
|
|
95
|
+
h4 {
|
|
96
|
+
margin-bottom: layout.$spacing-05;
|
|
97
|
+
color: $text-02;
|
|
98
|
+
font-size: 1rem;
|
|
99
|
+
font-weight: 600;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.itemCard {
|
|
103
|
+
border: 1px solid $ui-03;
|
|
104
|
+
border-radius: layout.$spacing-02;
|
|
105
|
+
padding: layout.$spacing-05;
|
|
106
|
+
margin-bottom: layout.$spacing-05;
|
|
107
|
+
background-color: $ui-01;
|
|
108
|
+
|
|
109
|
+
.itemHeader {
|
|
110
|
+
display: flex;
|
|
111
|
+
justify-content: space-between;
|
|
112
|
+
align-items: center;
|
|
113
|
+
margin-bottom: layout.$spacing-05;
|
|
114
|
+
|
|
115
|
+
.itemName {
|
|
116
|
+
font-weight: 600;
|
|
117
|
+
font-size: 1rem;
|
|
118
|
+
color: $text-02;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.itemControls {
|
|
123
|
+
display: flex;
|
|
124
|
+
flex-wrap: wrap;
|
|
125
|
+
gap: layout.$spacing-05;
|
|
126
|
+
margin-top: layout.$spacing-03;
|
|
127
|
+
align-items: flex-end; .controlSection {
|
|
128
|
+
display: flex;
|
|
129
|
+
flex-direction: column;
|
|
130
|
+
min-width: 0;
|
|
131
|
+
|
|
132
|
+
&:first-child {
|
|
133
|
+
flex: 1 1 auto;
|
|
134
|
+
min-width: 250px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
&:nth-child(2) {
|
|
138
|
+
flex: 0 0 140px;
|
|
139
|
+
width: 140px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
&:last-child {
|
|
143
|
+
flex: 0 0 180px;
|
|
144
|
+
width: 180px;
|
|
145
|
+
margin-left: auto;
|
|
146
|
+
text-align: right;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
label {
|
|
150
|
+
font-size: 0.875rem;
|
|
151
|
+
font-weight: 500;
|
|
152
|
+
margin-bottom: layout.$spacing-03;
|
|
153
|
+
color: $text-02;
|
|
154
|
+
white-space: nowrap;
|
|
155
|
+
overflow: hidden;
|
|
156
|
+
text-overflow: ellipsis;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
:global(.cds--list-box),
|
|
160
|
+
:global(.cds--number),
|
|
161
|
+
:global(.cds--combo-box),
|
|
162
|
+
:global(.cds--list-box__wrapper),
|
|
163
|
+
:global(.cds--list-box__field) {
|
|
164
|
+
width: 100% !important;
|
|
165
|
+
max-width: 100% !important;
|
|
166
|
+
min-width: 0 !important;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.priceDisplay,
|
|
170
|
+
.totalDisplay {
|
|
171
|
+
font-size: 0.875rem;
|
|
172
|
+
font-size: 0.875rem;
|
|
173
|
+
font-weight: 600;
|
|
174
|
+
color: $text-02;
|
|
175
|
+
padding: layout.$spacing-03 0;
|
|
176
|
+
word-break: break-word;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.grandTotal {
|
|
183
|
+
text-align: right;
|
|
184
|
+
padding: layout.$spacing-05;
|
|
185
|
+
border-top: 2px solid $interactive-01;
|
|
186
|
+
margin-top: layout.$spacing-05;
|
|
187
|
+
background-color: $ui-01;
|
|
188
|
+
font-size: 1.125rem;
|
|
189
|
+
font-weight: 600;
|
|
190
|
+
color: $text-02;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@media (max-width: 1056px) {
|
|
195
|
+
.selectedItemsContainer {
|
|
196
|
+
.itemCard {
|
|
197
|
+
.itemControls {
|
|
198
|
+
.controlSection {
|
|
199
|
+
&:nth-child(2) {
|
|
200
|
+
flex: 1 1 100%;
|
|
201
|
+
width: 100%;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
@media (max-width: 768px) {
|
|
210
|
+
.selectedItemsContainer {
|
|
211
|
+
.itemCard {
|
|
212
|
+
padding: layout.$spacing-04;
|
|
213
|
+
|
|
214
|
+
.itemControls {
|
|
215
|
+
flex-direction: column;
|
|
216
|
+
gap: layout.$spacing-03;
|
|
217
|
+
|
|
218
|
+
.controlSection {
|
|
219
|
+
&:first-child,
|
|
220
|
+
&:nth-child(2),
|
|
221
|
+
&:last-child {
|
|
222
|
+
flex: 1 1 100%;
|
|
223
|
+
width: 100%;
|
|
224
|
+
max-width: 100%;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|