From 5d81fd0f3ef3df3881ee9b4961561d802bc877c2 Mon Sep 17 00:00:00 2001 From: Imesh Ranawella Date: Wed, 19 Feb 2025 12:58:32 +0530 Subject: [PATCH 1/3] OPD Weekly Report issue fix (#10627) Co-authored-by: imexh --- .../divudi/bean/common/ReportsController.java | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/ReportsController.java b/src/main/java/com/divudi/bean/common/ReportsController.java index 80e8451438..0cbd17e47b 100644 --- a/src/main/java/com/divudi/bean/common/ReportsController.java +++ b/src/main/java/com/divudi/bean/common/ReportsController.java @@ -52,10 +52,7 @@ import javax.persistence.TemporalType; import javax.servlet.http.HttpServletResponse; import java.io.*; -import java.time.YearMonth; -import java.time.LocalDate; -import java.time.Month; -import java.time.ZoneId; +import java.time.*; import java.util.*; import java.util.List; import java.text.SimpleDateFormat; @@ -1974,20 +1971,33 @@ public List getDaysOfWeek(final int weekOfMonth) { } final YearMonth yearMonth = YearMonth.of(LocalDate.now().getYear(), month); + final LocalDate firstDayOfMonth = yearMonth.atDay(1); List daysOfWeek = new ArrayList<>(); - LocalDate firstDayOfMonth = yearMonth.atDay(1); - int firstDayOfTargetWeek = (weekOfMonth - 1) * 7 + 1; - - for (int i = 0; i < 7; i++) { - LocalDate day = firstDayOfMonth.plusDays(firstDayOfTargetWeek - 1 + i); + LocalDate firstSunday = firstDayOfMonth; + while (firstSunday.getDayOfWeek() != DayOfWeek.SUNDAY) { + firstSunday = firstSunday.plusDays(1); + } - if (day.getMonth() != yearMonth.getMonth()) { - break; + if (weekOfMonth == 1) { + LocalDate currentDay = firstDayOfMonth; + while (currentDay.getDayOfWeek() != DayOfWeek.SUNDAY && currentDay.getMonthValue() == month.getValue()) { + daysOfWeek.add(currentDay.getDayOfMonth()); + currentDay = currentDay.plusDays(1); } + } else { + LocalDate firstDayOfWeek = firstSunday.plusWeeks(weekOfMonth - 2); + + for (int i = 0; i < 7; i++) { + LocalDate day = firstDayOfWeek.plusDays(i); - daysOfWeek.add(day.getDayOfMonth()); + if (day.getMonthValue() != month.getValue()) { + break; + } + + daysOfWeek.add(day.getDayOfMonth()); + } } return daysOfWeek; @@ -2097,12 +2107,6 @@ private ReportTemplateRowBundle generateWeeklyBillItems(List bts jpql += "AND bill.billTypeAtomic in :bts "; parameters.put("bts", bts); -// if (visitType != null) { -// if (visitType.equalsIgnoreCase("IP") || visitType.equalsIgnoreCase("OP")) { -// jpql += "AND bill.ipOpOrCc = :type "; -// parameters.put("type", visitType); -// } -// } if (getSearchKeyword().getItemName() != null && !getSearchKeyword().getItemName().trim().isEmpty()) { jpql += "AND ((bill.billPackege.name) like :itemName ) "; parameters.put("itemName", "%" + getSearchKeyword().getItemName().trim().toUpperCase() + "%"); From 938c233300e3149d36c9ddd09eaab5537c48113b Mon Sep 17 00:00:00 2001 From: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> Date: Wed, 19 Feb 2025 15:28:00 +0530 Subject: [PATCH 2/3] 10423 disposal return recievable amount was wrong (#10626) * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * add new view for tranfer issue request and approval process Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * add method to retrive all tranfer request Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Add approval privillage and only privillage holder can approve the request Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> --------- Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> --- pom.xml | 4 +- .../divudi/ws/common/ApplicationConfig.java | 1 - src/main/webapp/WEB-INF/glassfish-web.xml | 2 +- .../pharmacy/pharmacy_bill_return_issue.xhtml | 66 ++++++--- .../pharmacy_reprint_bill_unit_issue.xhtml | 2 +- .../pharmacy_search_issue_bill_item.xhtml | 25 ++-- .../pharmacy_search_issue_bill_return.xhtml | 6 +- .../resources/pharmacy/consumptionIssue.xhtml | 130 +++++++++++------ .../resources/pharmacy/inward/issueBill.xhtml | 101 +++++++++---- .../pharmacy/inward/returnBill.xhtml | 135 ++++++++++++++---- .../pharmacy_disposal_bill_five_five.xhtml | 125 +++++++++++----- .../pharmacy/pharmacy_disposal_bill_pos.xhtml | 113 +++++++++++---- 12 files changed, 506 insertions(+), 204 deletions(-) diff --git a/pom.xml b/pom.xml index 2c0acbc9ba..e3f603b436 100644 --- a/pom.xml +++ b/pom.xml @@ -2,10 +2,10 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 com.divudi - coop + rh 3.0.0 war - coop + rh ${project.build.directory}/endorsed diff --git a/src/main/java/com/divudi/ws/common/ApplicationConfig.java b/src/main/java/com/divudi/ws/common/ApplicationConfig.java index 433b4b84a9..fb765393ba 100644 --- a/src/main/java/com/divudi/ws/common/ApplicationConfig.java +++ b/src/main/java/com/divudi/ws/common/ApplicationConfig.java @@ -46,7 +46,6 @@ private void addRestResourceClasses(Set> resources) { resources.add(com.divudi.ws.finance.clinical.Fhir.class); resources.add(com.divudi.ws.inward.ApiInward.class); resources.add(com.divudi.ws.lims.Lims.class); - resources.add(com.divudi.ws.lims.LimsMiddlewareController.class); resources.add(com.divudi.ws.lims.MiddlewareController.class); } diff --git a/src/main/webapp/WEB-INF/glassfish-web.xml b/src/main/webapp/WEB-INF/glassfish-web.xml index 8947aba09c..157dde8610 100644 --- a/src/main/webapp/WEB-INF/glassfish-web.xml +++ b/src/main/webapp/WEB-INF/glassfish-web.xml @@ -1,7 +1,7 @@ - /coop + /rh diff --git a/src/main/webapp/pharmacy/pharmacy_bill_return_issue.xhtml b/src/main/webapp/pharmacy/pharmacy_bill_return_issue.xhtml index 9055416389..4d21a35e5d 100644 --- a/src/main/webapp/pharmacy/pharmacy_bill_return_issue.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_bill_return_issue.xhtml @@ -16,12 +16,14 @@
- + +
@@ -55,8 +57,7 @@ @@ -69,14 +70,14 @@ - - - - - - - - + @@ -84,7 +85,11 @@ - + + + + + @@ -96,20 +101,40 @@ - + + + + + + + + + + - - + + @@ -158,6 +183,9 @@ + diff --git a/src/main/webapp/pharmacy/pharmacy_reprint_bill_unit_issue.xhtml b/src/main/webapp/pharmacy/pharmacy_reprint_bill_unit_issue.xhtml index ce3a9a67b9..7f4925eb43 100644 --- a/src/main/webapp/pharmacy/pharmacy_reprint_bill_unit_issue.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_reprint_bill_unit_issue.xhtml @@ -32,7 +32,7 @@ value="To Return" class="mx-2 ui-button-warning" icon="fa fa-money-bill-wave" - action="pharmacy_bill_return_issue" + action="pharmacy_bill_return_issue?faces-redirect=true" disabled="#{pharmacyBillSearch.bill.cancelled eq true}" > - + - +  -  - - + + - + @@ -110,20 +110,27 @@ - - + + + + + + + + + - + - + diff --git a/src/main/webapp/pharmacy/pharmacy_search_issue_bill_return.xhtml b/src/main/webapp/pharmacy/pharmacy_search_issue_bill_return.xhtml index 2782d66c2a..a99131e00a 100644 --- a/src/main/webapp/pharmacy/pharmacy_search_issue_bill_return.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_search_issue_bill_return.xhtml @@ -82,7 +82,7 @@ + action="pharmacy_reprint_bill_unit_issue_return?faces-redirect=true"> @@ -150,9 +150,7 @@ - - - + diff --git a/src/main/webapp/resources/pharmacy/consumptionIssue.xhtml b/src/main/webapp/resources/pharmacy/consumptionIssue.xhtml index b41fd22938..fedd38ebe8 100644 --- a/src/main/webapp/resources/pharmacy/consumptionIssue.xhtml +++ b/src/main/webapp/resources/pharmacy/consumptionIssue.xhtml @@ -72,7 +72,6 @@ - @@ -86,11 +85,11 @@ - + : - + @@ -119,16 +118,11 @@ - -
-
- -
@@ -159,10 +153,10 @@ - - - + + + + + + + + + + + + + + + + + + - - - - - -
- + @@ -173,46 +167,97 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +

+
+ + + +
- - +
-
- - -
- +
- @@ -255,46 +255,95 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -225,16 +270,16 @@ - +
- + + @@ -246,15 +291,12 @@ - - - \ No newline at end of file diff --git a/src/main/webapp/resources/pharmacy/inward/issueBill.xhtml b/src/main/webapp/resources/pharmacy/inward/issueBill.xhtml index 6c872d46d2..97056b7bc0 100644 --- a/src/main/webapp/resources/pharmacy/inward/issueBill.xhtml +++ b/src/main/webapp/resources/pharmacy/inward/issueBill.xhtml @@ -240,7 +240,7 @@
- +
- - - - - - - - - - - - -
+ + + + + + + + + + + + + + + + + + + +

+
+ + + +
+
+

- - -
@@ -304,7 +353,7 @@ diff --git a/src/main/webapp/resources/pharmacy/inward/returnBill.xhtml b/src/main/webapp/resources/pharmacy/inward/returnBill.xhtml index 8bbe1a191f..9e6f26bb3f 100644 --- a/src/main/webapp/resources/pharmacy/inward/returnBill.xhtml +++ b/src/main/webapp/resources/pharmacy/inward/returnBill.xhtml @@ -39,7 +39,7 @@
- +
@@ -71,7 +71,7 @@
- + - + - + - + - + + + - - + + + + + - - - - + + + + - + + + + -
- +
@@ -96,9 +96,9 @@
@@ -121,7 +121,7 @@
@@ -149,7 +149,7 @@
- +
@@ -163,22 +163,52 @@
+ +
- +
@@ -189,41 +219,84 @@ - - - - - - - -
+ + + + + + + + + + + + + + + + + + + +

+
+ + + + + + -
+ + + + -
-
+ + +
+ +
-
+
@@ -231,8 +304,8 @@ - @@ -252,7 +325,7 @@ diff --git a/src/main/webapp/resources/pharmacy/pharmacy_disposal_bill_five_five.xhtml b/src/main/webapp/resources/pharmacy/pharmacy_disposal_bill_five_five.xhtml index f20538a349..3e7d071e66 100644 --- a/src/main/webapp/resources/pharmacy/pharmacy_disposal_bill_five_five.xhtml +++ b/src/main/webapp/resources/pharmacy/pharmacy_disposal_bill_five_five.xhtml @@ -292,24 +292,75 @@ - - - - + + + + + + + + + + + + + + + + + + + + + @@ -336,7 +387,7 @@ @@ -345,12 +396,8 @@ - - -
- + + - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + +

+
+ + + +
- +
-
@@ -358,8 +405,6 @@
- -
@@ -370,7 +415,7 @@ @@ -383,12 +428,22 @@ + @@ -414,16 +469,16 @@ - +
- + - +