Skip to content

Commit

Permalink
Merge branch 'develop' into facility_delete
Browse files Browse the repository at this point in the history
  • Loading branch information
xakep8 authored Nov 30, 2023
2 parents 452f7ba + 31b7690 commit 4ea9d75
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
7 changes: 6 additions & 1 deletion src/Components/Facility/AddInventoryForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const AddInventoryForm = (props: any) => {
if (unitName === "Dozen") {
return Number(unitData.quantity) * 12;
}
if (unitName === "Gram") {
if (unitName === "gram") {
return Number(unitData.quantity) / 1000;
}
return Number(unitData.quantity);
Expand Down Expand Up @@ -238,6 +238,11 @@ export const AddInventoryForm = (props: any) => {
};
// if user has selected "Add stock" or "stockValidation" function is true
if (data.is_incoming || stockValidation(data)) {
// if user has selected grams as unit then convert it to kg
if (data.unit === 5) {
data.quantity = data.quantity / 1000;
data.unit = 6;
}
const res = await dispatchAction(postInventory(data, { facilityId }));
setIsLoading(false);

Expand Down
6 changes: 5 additions & 1 deletion src/Components/Patient/PatientInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,11 @@ export default function PatientInfoCard(props: {
</div>
<div className="mt-1 text-xl font-semibold leading-5 text-gray-900">
{!consultation?.discharge_reason ? (
<span className="text-gray-800">UNKNOWN</span>
<span className="text-gray-800">
{consultation.suggestion === "OP"
? "OP file closed"
: "UNKNOWN"}
</span>
) : consultation?.discharge_reason === "EXP" ? (
<span className="text-red-600">EXPIRED</span>
) : (
Expand Down
1 change: 0 additions & 1 deletion src/Components/Shifting/ListFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ export default function ListFilter(props: any) {
name="patient_phone_number"
value={filterState.patient_phone_number}
onChange={handleFormFieldChange}
errorClassName="hidden"
types={["mobile", "landline"]}
/>
<DateRangeFormField
Expand Down
40 changes: 20 additions & 20 deletions src/Components/Users/UserFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,26 +134,26 @@ export default function UserFilter(props: any) {
errors={""}
/>
</div>

<PhoneNumberFormField
label="Phone Number"
name="phone_number"
placeholder="Phone Number"
value={filterState.phone_number}
onChange={handleChange}
errorClassName="hidden"
types={["mobile", "landline"]}
/>

<PhoneNumberFormField
label="Whatsapp Number"
name="alt_phone_number"
placeholder="WhatsApp Phone Number"
value={filterState.alt_phone_number}
onChange={handleChange}
errorClassName="hidden"
types={["mobile"]}
/>
<div className="-mb-4">
<PhoneNumberFormField
label="Phone Number"
name="phone_number"
placeholder="Phone Number"
value={filterState.phone_number}
onChange={handleChange}
types={["mobile", "landline"]}
/>
</div>
<div className="-mb-4">
<PhoneNumberFormField
label="Whatsapp Number"
name="alt_phone_number"
placeholder="WhatsApp Phone Number"
value={filterState.alt_phone_number}
onChange={handleChange}
types={["mobile"]}
/>
</div>
</FiltersSlideover>
);
}

0 comments on commit 4ea9d75

Please sign in to comment.