@openmrs/esm-billing-app 1.0.2-pre.812 → 1.0.2-pre.814
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/4344.js +1 -1
- package/dist/4344.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-billing-app.js.buildmanifest.json +6 -6
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/billable-services/create-edit/add-billable-service.component.tsx +15 -8
- package/src/billable-services/create-edit/add-billable-service.scss +3 -61
- package/src/billable-services/create-edit/add-billable-service.test.tsx +5 -5
|
@@ -564,9 +564,9 @@
|
|
|
564
564
|
"initial": false,
|
|
565
565
|
"entry": false,
|
|
566
566
|
"recorded": false,
|
|
567
|
-
"size":
|
|
567
|
+
"size": 1166398,
|
|
568
568
|
"sizes": {
|
|
569
|
-
"javascript":
|
|
569
|
+
"javascript": 1166356,
|
|
570
570
|
"consume-shared": 42
|
|
571
571
|
},
|
|
572
572
|
"names": [],
|
|
@@ -580,7 +580,7 @@
|
|
|
580
580
|
"auxiliaryFiles": [
|
|
581
581
|
"4344.js.map"
|
|
582
582
|
],
|
|
583
|
-
"hash": "
|
|
583
|
+
"hash": "f506d0d12e301fca",
|
|
584
584
|
"childrenByOrder": {}
|
|
585
585
|
},
|
|
586
586
|
{
|
|
@@ -1209,10 +1209,10 @@
|
|
|
1209
1209
|
"initial": true,
|
|
1210
1210
|
"entry": true,
|
|
1211
1211
|
"recorded": false,
|
|
1212
|
-
"size":
|
|
1212
|
+
"size": 5464229,
|
|
1213
1213
|
"sizes": {
|
|
1214
1214
|
"consume-shared": 210,
|
|
1215
|
-
"javascript":
|
|
1215
|
+
"javascript": 5441573,
|
|
1216
1216
|
"share-init": 336,
|
|
1217
1217
|
"runtime": 22110
|
|
1218
1218
|
},
|
|
@@ -1229,7 +1229,7 @@
|
|
|
1229
1229
|
"auxiliaryFiles": [
|
|
1230
1230
|
"main.js.map"
|
|
1231
1231
|
],
|
|
1232
|
-
"hash": "
|
|
1232
|
+
"hash": "990a506cca0049ff",
|
|
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.814"}
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
FormLabel,
|
|
8
8
|
InlineLoading,
|
|
9
9
|
Layer,
|
|
10
|
+
NumberInput,
|
|
10
11
|
Search,
|
|
11
12
|
Stack,
|
|
12
13
|
TextInput,
|
|
@@ -36,7 +37,7 @@ interface ServiceType {
|
|
|
36
37
|
|
|
37
38
|
interface PaymentModeForm {
|
|
38
39
|
paymentMode: string;
|
|
39
|
-
price: string | number;
|
|
40
|
+
price: string | number | undefined;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
interface BillableServiceFormData {
|
|
@@ -54,7 +55,7 @@ interface AddBillableServiceProps {
|
|
|
54
55
|
isModal?: boolean;
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
const DEFAULT_PAYMENT_OPTION: PaymentModeForm = { paymentMode: '', price:
|
|
58
|
+
const DEFAULT_PAYMENT_OPTION: PaymentModeForm = { paymentMode: '', price: undefined };
|
|
58
59
|
const MAX_NAME_LENGTH = 19;
|
|
59
60
|
|
|
60
61
|
const createBillableServiceSchema = (t: TFunction) => {
|
|
@@ -150,7 +151,7 @@ const AddBillableService: React.FC<AddBillableServiceProps> = ({
|
|
|
150
151
|
concept: serviceToEdit?.concept || null,
|
|
151
152
|
payment: serviceToEdit?.servicePrices?.map((servicePrice: ServicePrice) => ({
|
|
152
153
|
paymentMode: servicePrice.paymentMode?.uuid || '',
|
|
153
|
-
price: servicePrice.price,
|
|
154
|
+
price: servicePrice.price || undefined,
|
|
154
155
|
})) || [DEFAULT_PAYMENT_OPTION],
|
|
155
156
|
},
|
|
156
157
|
resolver: zodResolver(billableServiceSchema),
|
|
@@ -181,7 +182,7 @@ const AddBillableService: React.FC<AddBillableServiceProps> = ({
|
|
|
181
182
|
concept: serviceToEdit.concept || null,
|
|
182
183
|
payment: serviceToEdit.servicePrices.map((payment: ServicePrice) => ({
|
|
183
184
|
paymentMode: payment.paymentMode?.uuid || '',
|
|
184
|
-
price: payment.price,
|
|
185
|
+
price: payment.price || undefined,
|
|
185
186
|
})),
|
|
186
187
|
});
|
|
187
188
|
}
|
|
@@ -407,14 +408,20 @@ const AddBillableService: React.FC<AddBillableServiceProps> = ({
|
|
|
407
408
|
name={`payment.${index}.price`}
|
|
408
409
|
render={({ field }) => (
|
|
409
410
|
<Layer>
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
{...field}
|
|
411
|
+
<NumberInput
|
|
412
|
+
allowEmpty
|
|
413
413
|
id={`price-${index}`}
|
|
414
414
|
invalid={!!errors?.payment?.[index]?.price}
|
|
415
415
|
invalidText={errors?.payment?.[index]?.price?.message}
|
|
416
|
-
|
|
416
|
+
label={t('sellingPrice', 'Selling Price')}
|
|
417
417
|
placeholder={t('enterSellingPrice', 'Enter selling price')}
|
|
418
|
+
min={0}
|
|
419
|
+
step={0.01}
|
|
420
|
+
value={field.value ?? ''}
|
|
421
|
+
onChange={(_, { value }) => {
|
|
422
|
+
const numValue = value === '' || value === undefined ? undefined : Number(value);
|
|
423
|
+
field.onChange(numValue);
|
|
424
|
+
}}
|
|
418
425
|
/>
|
|
419
426
|
</Layer>
|
|
420
427
|
)}
|
|
@@ -10,29 +10,8 @@
|
|
|
10
10
|
margin: layout.$spacing-05;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.sectionTitle {
|
|
14
|
-
@include type.type-style('heading-compact-02');
|
|
15
|
-
color: $text-02;
|
|
16
|
-
margin-bottom: layout.$spacing-04;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.modalBody {
|
|
20
|
-
padding-bottom: layout.$spacing-05;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.container {
|
|
24
|
-
margin: layout.$spacing-05;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.paymentContainer {
|
|
28
|
-
margin: layout.$layout-01;
|
|
29
|
-
padding: layout.$layout-01;
|
|
30
|
-
width: 70%;
|
|
31
|
-
border-right: 1px solid colors.$cool-gray-40;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
13
|
.paymentButtons {
|
|
35
|
-
margin: layout.$
|
|
14
|
+
margin: layout.$spacing-05 0;
|
|
36
15
|
}
|
|
37
16
|
|
|
38
17
|
.paymentMethodContainer {
|
|
@@ -44,22 +23,6 @@
|
|
|
44
23
|
width: 100%;
|
|
45
24
|
}
|
|
46
25
|
|
|
47
|
-
.paymentTotals {
|
|
48
|
-
margin-top: layout.$spacing-01;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.processPayments {
|
|
52
|
-
display: flex;
|
|
53
|
-
justify-content: flex-end;
|
|
54
|
-
margin: layout.$spacing-05;
|
|
55
|
-
column-gap: layout.$spacing-04;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.errorPaymentContainer {
|
|
59
|
-
margin: layout.$spacing-04;
|
|
60
|
-
min-height: layout.$spacing-09;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
26
|
.removeButtonContainer {
|
|
64
27
|
display: flex;
|
|
65
28
|
align-self: center;
|
|
@@ -98,39 +61,18 @@
|
|
|
98
61
|
margin-bottom: layout.$spacing-05;
|
|
99
62
|
}
|
|
100
63
|
|
|
101
|
-
.errorContainer {
|
|
102
|
-
margin: layout.$spacing-05;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
.serviceError {
|
|
106
|
-
:global(.cds--search-input):focus {
|
|
107
|
-
outline: 2.5px solid $danger;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
:global(.cds--search-magnifier) {
|
|
111
|
-
svg {
|
|
112
|
-
fill: $danger;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
64
|
.errorMessage {
|
|
118
65
|
@include type.type-style('label-02');
|
|
119
66
|
color: $danger;
|
|
120
|
-
margin-
|
|
67
|
+
margin-bottom: layout.$spacing-05;
|
|
121
68
|
}
|
|
122
69
|
|
|
123
|
-
.
|
|
70
|
+
.loader {
|
|
124
71
|
&:global(.cds--inline-loading) {
|
|
125
72
|
min-height: layout.$spacing-05;
|
|
126
73
|
}
|
|
127
74
|
}
|
|
128
75
|
|
|
129
|
-
.errorMessage {
|
|
130
|
-
color: red;
|
|
131
|
-
font-size: 0.875rem;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
76
|
.serviceNameLabel {
|
|
135
77
|
@include type.type-style('body-compact-02');
|
|
136
78
|
}
|
|
@@ -98,7 +98,7 @@ const fillRequiredFields = async (user, options: FillOptions = {}) => {
|
|
|
98
98
|
await user.click(screen.getByRole('option', { name: /Cash/i }));
|
|
99
99
|
|
|
100
100
|
if (!skipPrice) {
|
|
101
|
-
const priceInput = screen.getByRole('
|
|
101
|
+
const priceInput = screen.getByRole('spinbutton', { name: /Selling Price/i });
|
|
102
102
|
await user.type(priceInput, '100');
|
|
103
103
|
}
|
|
104
104
|
};
|
|
@@ -159,7 +159,7 @@ describe('AddBillableService', () => {
|
|
|
159
159
|
|
|
160
160
|
await fillRequiredFields(user, { skipPrice: true });
|
|
161
161
|
|
|
162
|
-
const priceInput = screen.getByRole('
|
|
162
|
+
const priceInput = screen.getByRole('spinbutton', { name: /selling price/i });
|
|
163
163
|
await user.type(priceInput, '0');
|
|
164
164
|
|
|
165
165
|
await submitForm(user);
|
|
@@ -174,7 +174,7 @@ describe('AddBillableService', () => {
|
|
|
174
174
|
|
|
175
175
|
await fillRequiredFields(user, { skipPrice: true });
|
|
176
176
|
|
|
177
|
-
const priceInput = screen.getByRole('
|
|
177
|
+
const priceInput = screen.getByRole('spinbutton', { name: /Selling Price/i });
|
|
178
178
|
await user.type(priceInput, '-10');
|
|
179
179
|
|
|
180
180
|
await submitForm(user);
|
|
@@ -196,7 +196,7 @@ describe('AddBillableService', () => {
|
|
|
196
196
|
await user.click(screen.getByRole('combobox', { name: /Payment mode/i }));
|
|
197
197
|
await user.click(screen.getByRole('option', { name: /Cash/i }));
|
|
198
198
|
|
|
199
|
-
const priceInput = screen.getByRole('
|
|
199
|
+
const priceInput = screen.getByRole('spinbutton', { name: /Selling Price/i });
|
|
200
200
|
await user.type(priceInput, '100');
|
|
201
201
|
|
|
202
202
|
await submitForm(user);
|
|
@@ -211,7 +211,7 @@ describe('AddBillableService', () => {
|
|
|
211
211
|
|
|
212
212
|
await fillRequiredFields(user, { skipPrice: true });
|
|
213
213
|
|
|
214
|
-
const priceInput = screen.getByRole('
|
|
214
|
+
const priceInput = screen.getByRole('spinbutton', { name: /selling price/i });
|
|
215
215
|
await user.type(priceInput, '10.50');
|
|
216
216
|
|
|
217
217
|
mockCreateBillableService.mockResolvedValue({} as FetchResponse<any>);
|