From 83e1bbef554d8a328ec457f699f5a86894cb6e42 Mon Sep 17 00:00:00 2001 From: "Dr. M H B Ariyaratne" Date: Sat, 15 Feb 2025 12:54:42 +0530 Subject: [PATCH 01/25] 10551 need sale value in pharmacy transfer issue report (#10552) * Closes #10551 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne --- .../divudi/bean/pharmacy/ReportsTransfer.java | 12 +++-- .../divudi/ws/common/ApplicationConfig.java | 1 + src/main/webapp/WEB-INF/glassfish-web.xml | 2 +- .../webapp/pharmacy/pharmacy_analytics.xhtml | 5 ++- .../pharmacy_reprint_transfer_isssue.xhtml | 14 ++++-- .../pharmacy_report_transfer_issue_bill.xhtml | 45 +++++++++++++------ 6 files changed, 56 insertions(+), 23 deletions(-) diff --git a/src/main/java/com/divudi/bean/pharmacy/ReportsTransfer.java b/src/main/java/com/divudi/bean/pharmacy/ReportsTransfer.java index 6f21ce4290..69d0d51a4d 100644 --- a/src/main/java/com/divudi/bean/pharmacy/ReportsTransfer.java +++ b/src/main/java/com/divudi/bean/pharmacy/ReportsTransfer.java @@ -151,6 +151,10 @@ public String navigateToTransferIssueByBill() { return "/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill?faces-redirect=true"; } + public String navigateBackToTransferIssueByBill() { + return "/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill?faces-redirect=true"; + } + public String navigateToTransferReceiveByBill() { transferBills = null; pharmacyController.setManagePharamcyReportIndex(pharmacyDisbursementReportIndex); @@ -1710,18 +1714,18 @@ public void fillDepartmentTransfersRecieveByBill() { jpql.append(" order by b.id"); transferBills = getBillFacade().findByJpql(jpql.toString(), params, TemporalType.TIMESTAMP); - + totalsValue = 0.0; discountsValue = 0.0; netTotalValues = 0.0; for (Bill b : transferBills) { - + discountsValue = discountsValue + b.getDiscount(); netTotalValues = netTotalValues + b.getNetTotal(); - } + } calculatePurachaseValuesOfBillItemsInBill(transferBills); } - + public void fillTheaterTransfersReceiveWithBHTIssue() { FacesContext context = FacesContext.getCurrentInstance(); HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest(); diff --git a/src/main/java/com/divudi/ws/common/ApplicationConfig.java b/src/main/java/com/divudi/ws/common/ApplicationConfig.java index fb765393ba..433b4b84a9 100644 --- a/src/main/java/com/divudi/ws/common/ApplicationConfig.java +++ b/src/main/java/com/divudi/ws/common/ApplicationConfig.java @@ -46,6 +46,7 @@ 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 157dde8610..8947aba09c 100644 --- a/src/main/webapp/WEB-INF/glassfish-web.xml +++ b/src/main/webapp/WEB-INF/glassfish-web.xml @@ -1,7 +1,7 @@ - /rh + /coop diff --git a/src/main/webapp/pharmacy/pharmacy_analytics.xhtml b/src/main/webapp/pharmacy/pharmacy_analytics.xhtml index 68d0fd2ea7..fe11727350 100644 --- a/src/main/webapp/pharmacy/pharmacy_analytics.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_analytics.xhtml @@ -289,7 +289,10 @@ icon="fa fa-file-import" class="w-100"> - + diff --git a/src/main/webapp/pharmacy/pharmacy_reprint_transfer_isssue.xhtml b/src/main/webapp/pharmacy/pharmacy_reprint_transfer_isssue.xhtml index 011fce8b1b..4cab3e6a8f 100644 --- a/src/main/webapp/pharmacy/pharmacy_reprint_transfer_isssue.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_reprint_transfer_isssue.xhtml @@ -19,20 +19,26 @@
-
+
+ value="Back to Issued List"/> + diff --git a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml index f5742c908f..db6a73af7c 100644 --- a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml +++ b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml @@ -16,23 +16,39 @@ - + - + + - + + - + + - + - + - + + From 8484f4e070e1de8bfbbff0e4dd123c78943192cb Mon Sep 17 00:00:00 2001 From: "Dr. M H B Ariyaratne" Date: Sat, 15 Feb 2025 12:55:11 +0530 Subject: [PATCH 02/25] 10413 bill number generation stragies are not working properly (#10553) * fact: add expense section to direct purchase and update bill with net total Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * fact:improve purchase bill adding expenses and ui improvements. 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: Dr M H B Ariyaratne * Closes #10116 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10187 Signed-off-by: Dr M H B Ariyaratne * Closes #10176 * add department wise filter for inward pharmacy issue summery Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Dr M H B Ariyaratne * Closes #10191 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Update mp_prod_ci_cd.yml * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Dr M H B Ariyaratne * fix: pharmacy tranfer bill improvement done. 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> * Payment Approval Basics Completed Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10291 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10259 Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10259 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * GRN No, Invoice No added Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9986 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9939 Also adds Supplier Payment Preperation Bill Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * 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: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10334 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #7830 now can search supplier credit bills Make sure you select the option "Approveal necessary is required for Supplier Payments" as false Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10337 But need to fix pharmacy summery reports, cashier summary as seperate issues * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #3832 For Institutions where GRN payment approval is NOT necessary (Make the configuration) Payments Menu > SUpplier Payment > Settle Bills by SUpplier * Signed-off-by: Dr M H Buddhika Ariyaratne * Improved supplier payment management where Approval is necessary Need to improve UIs, navigations, have to check GRN Returns, not checked Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9681 Improved supplier payment management where Approval is necessary Need to improve UIs, navigations, have to check GRN Returns, not checked Signed-off-by: Dr M H Buddhika Ariyaratne Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9681 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10260 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #9676 * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #9679 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10413 Signed-off-by: Dr M H Buddhika Ariyaratne --------- Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> Signed-off-by: Dr M H B Ariyaratne Signed-off-by: Dr M H Buddhika Ariyaratne Co-authored-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> Co-authored-by: Geeth Sandaru Madhushan --- pom.xml | 4 ++-- .../com/divudi/bean/common/ReportsController.java | 11 +++++------ src/main/java/com/divudi/ejb/BillNumberGenerator.java | 8 ++++---- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index e3f603b436..2c0acbc9ba 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 - rh + coop 3.0.0 war - rh + coop ${project.build.directory}/endorsed diff --git a/src/main/java/com/divudi/bean/common/ReportsController.java b/src/main/java/com/divudi/bean/common/ReportsController.java index 956e30e04f..2a847b5221 100644 --- a/src/main/java/com/divudi/bean/common/ReportsController.java +++ b/src/main/java/com/divudi/bean/common/ReportsController.java @@ -61,7 +61,6 @@ import java.text.SimpleDateFormat; import java.util.stream.Collectors; import java.text.DecimalFormat; - import org.apache.poi.xssf.usermodel.XSSFCellStyle; /** @@ -2651,7 +2650,7 @@ public void generateDebtorBalanceReport(final boolean onlyDueBills) { } public ReportTemplateRowBundle generateDebtorBalanceReportBills(List bts, List billPaymentMethods, - boolean onlyDueBills) { + boolean onlyDueBills) { Map parameters = new HashMap<>(); String jpql = "SELECT new com.divudi.data.ReportTemplateRow(bill) " + "FROM Bill bill " @@ -3595,7 +3594,7 @@ public void exportOpdAndInwardOPToPdf() { table.setWidths(columnWidths); String[] headers = {"S. No", "Invoice Date", "Invoice No", "Customer Reference No", "MRNO", "Patient Name", - "Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"}; + "Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, boldFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); @@ -3818,7 +3817,7 @@ public void exportOpdAndInwardIPToPdf() { table.setWidths(columnWidths); String[] headers = {"S. No", "BHT No", "Invoice Date", "Invoice No", "Customer Reference No", "MRNO", "Patient Name", - "Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"}; + "Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, boldFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); @@ -4860,8 +4859,8 @@ public void exportDetailedWeeklyOPDReportToPDF() { } private void addWeeklyReportSection(Document document, String sectionTitle, List itemList, - List daysOfWeek, Map>> weeklyDailyBillItemMap, - int week, com.itextpdf.text.Font headerFont, com.itextpdf.text.Font regularFont) throws DocumentException { + List daysOfWeek, Map>> weeklyDailyBillItemMap, + int week, com.itextpdf.text.Font headerFont, com.itextpdf.text.Font regularFont) throws DocumentException { document.add(new com.itextpdf.text.Paragraph(sectionTitle, headerFont)); document.add(com.itextpdf.text.Chunk.NEWLINE); diff --git a/src/main/java/com/divudi/ejb/BillNumberGenerator.java b/src/main/java/com/divudi/ejb/BillNumberGenerator.java index 84ac2e8cd3..f0882c22b9 100644 --- a/src/main/java/com/divudi/ejb/BillNumberGenerator.java +++ b/src/main/java/com/divudi/ejb/BillNumberGenerator.java @@ -1498,9 +1498,9 @@ public String departmentBillNumberGenerator(Institution ins, Department dep, Bil } public String departmentBillNumberGeneratorYearly(Department dep, BillTypeAtomic billType) { - System.out.println("departmentBillNumberGeneratorYearly = "); - System.out.println("billType = " + billType); - System.out.println("dep = " + dep); +// System.out.println("departmentBillNumberGeneratorYearly = "); +// System.out.println("billType = " + billType); +// System.out.println("dep = " + dep); if (dep == null) { return ""; } @@ -1511,7 +1511,7 @@ public String departmentBillNumberGeneratorYearly(Department dep, BillTypeAtomic String billSuffix = configOptionApplicationController.getLongTextValueByKey("Bill Number Suffix for " + billType, ""); System.out.println("billSuffix = " + billSuffix); if (billSuffix == null || billSuffix.trim().equals("")) { - billSuffix = billType.toString(); + billSuffix = ""; } boolean commonBillNumberForAllDepartmentsInstitutionsBillTypeAtomic = configOptionApplicationController.getBooleanValueByKey("Bill Number Generation Strategy - Common Bill Number for All Departments, Institutions and Bill Types", false); From 85c657349eaac19de664e1de18cd14768d5fdd1f Mon Sep 17 00:00:00 2001 From: Geeth Sandaru Madhushan Date: Sat, 15 Feb 2025 13:39:05 +0530 Subject: [PATCH 03/25] Update rmh_prod_ci_cd.yml (#10574) --- .github/workflows/rmh_prod_ci_cd.yml | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/rmh_prod_ci_cd.yml b/.github/workflows/rmh_prod_ci_cd.yml index 275eb4c98a..54ab2c4788 100644 --- a/.github/workflows/rmh_prod_ci_cd.yml +++ b/.github/workflows/rmh_prod_ci_cd.yml @@ -56,8 +56,6 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v3 - with: - ref: 'rmh-prod' - name: Download Build Artifact uses: actions/download-artifact@v4 @@ -67,10 +65,10 @@ jobs: - name: Deploy to Payara env: - SERVER_IP: ${{ secrets.COOP_PROD_SERVER_IP }} - SERVER_USER: ${{ secrets.COOP_PROD_SERVER_USER }} - SSH_PRIVATE_KEY: ${{ secrets.COOP_PROD_SSH_PRIVATE_KEY }} - PAYARA_ADMIN_PASS: ${{ secrets.COOP_PROD_PAYARA_ADMIN_PASS }} + SERVER_IP: ${{ secrets.RMH_PROD_SERVER_IP }} + SERVER_USER: ${{ secrets.RMH_PROD_SERVER_USER }} + SSH_PRIVATE_KEY: ${{ secrets.RMH_PROD_SSH_PRIVATE_KEY }} + PAYARA_ADMIN_PASS: ${{ secrets.RMH_PROD_PAYARA_ADMIN_PASS }} run: | # Add SSH private key to the SSH agent echo "$SSH_PRIVATE_KEY" > private_key.pem @@ -84,9 +82,8 @@ jobs: # Ensure deployment directory exists ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " - sudo mkdir -p $WAR_DIR - sudo chown -R appuser:appuser /home/appuser/app/latest - sudo su - appuser + mkdir -p $WAR_DIR + chown -R appuser:appuser $WAR_DIR cd $WAR_DIR # Remove old backup if it exists @@ -101,18 +98,16 @@ jobs: " # Copy new WAR file to the server - rsync -aL --progress -e "ssh -i private_key.pem" ./*.war $SERVER_USER@$SERVER_IP:/tmp/$WAR_NAME + rsync -aL --progress -e "ssh -i private_key.pem" ./*.war $SERVER_USER@$SERVER_IP:$WAR_DIR/$WAR_NAME - # Move the file to /home/appuser/app/latest/ and set permissions + # Set the WAR file permission ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " - sudo mv /tmp/$WAR_NAME $WAR_DIR/ - sudo chown appuser:appuser $WAR_DIR/$WAR_NAME + chown appuser:appuser $WAR_DIR/$WAR_NAME " # Deploy the WAR using asadmin ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " - sudo su - appuser - echo 'AS_ADMIN_PASSWORD=${{ secrets.COOP_PROD_PAYARA_ADMIN_PASS }}' > /tmp/payara-admin-pass.txt + echo 'AS_ADMIN_PASSWORD=$PAYARA_ADMIN_PASS' > /tmp/payara-admin-pass.txt /opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt undeploy $APP_NAME || true /opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt deploy --force=true --contextroot $APP_NAME $WAR_DIR/$WAR_NAME rm /tmp/payara-admin-pass.txt @@ -120,8 +115,7 @@ jobs: # Validate if the application is running ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " - sudo su - appuser - echo 'AS_ADMIN_PASSWORD=${{ secrets.COOP_PROD_PAYARA_ADMIN_PASS }}' > /tmp/payara-admin-pass.txt + echo 'AS_ADMIN_PASSWORD=$PAYARA_ADMIN_PASS' > /tmp/payara-admin-pass.txt if /opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt list-applications | grep -q '$APP_NAME'; then echo 'Application is running.' else From b1173938d5c451df1dbe1e877f145005677044b6 Mon Sep 17 00:00:00 2001 From: Lawan Chaamindu Jayalath Samarasekara Date: Sat, 15 Feb 2025 14:00:51 +0530 Subject: [PATCH 04/25] Fixed #10575 (#10576) Signed-off-by: Lawan Samarasekara --- .github/workflows/coop_prod_ci_cd.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/coop_prod_ci_cd.yml b/.github/workflows/coop_prod_ci_cd.yml index 4795a728f7..de20ceaf8d 100644 --- a/.github/workflows/coop_prod_ci_cd.yml +++ b/.github/workflows/coop_prod_ci_cd.yml @@ -56,8 +56,6 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v3 - with: - ref: 'coop-prod' - name: Download Build Artifact uses: actions/download-artifact@v4 @@ -84,9 +82,8 @@ jobs: # Ensure deployment directory exists ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " - sudo mkdir -p $WAR_DIR - sudo chown -R appuser:appuser /home/appuser/app/latest - sudo su - appuser + mkdir -p $WAR_DIR + chown -R appuser:appuser $WAR_DIR cd $WAR_DIR # Remove old backup if it exists @@ -101,18 +98,16 @@ jobs: " # Copy new WAR file to the server - rsync -aL --progress -e "ssh -i private_key.pem" ./*.war $SERVER_USER@$SERVER_IP:/tmp/$WAR_NAME + rsync -aL --progress -e "ssh -i private_key.pem" ./*.war $SERVER_USER@$SERVER_IP:$WAR_DIR/$WAR_NAME - # Move the file to /home/appuser/app/latest/ and set permissions + # Set the WAR file permission ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " - sudo mv /tmp/$WAR_NAME $WAR_DIR/ - sudo chown appuser:appuser $WAR_DIR/$WAR_NAME + chown appuser:appuser $WAR_DIR/$WAR_NAME " # Deploy the WAR using asadmin ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " - sudo su - appuser - echo 'AS_ADMIN_PASSWORD=${{ secrets.COOP_PROD_PAYARA_ADMIN_PASS }}' > /tmp/payara-admin-pass.txt + echo 'AS_ADMIN_PASSWORD=$PAYARA_ADMIN_PASS' > /tmp/payara-admin-pass.txt /opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt undeploy $APP_NAME || true /opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt deploy --force=true --contextroot $APP_NAME $WAR_DIR/$WAR_NAME rm /tmp/payara-admin-pass.txt @@ -120,8 +115,7 @@ jobs: # Validate if the application is running ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " - sudo su - appuser - echo 'AS_ADMIN_PASSWORD=${{ secrets.COOP_PROD_PAYARA_ADMIN_PASS }}' > /tmp/payara-admin-pass.txt + echo 'AS_ADMIN_PASSWORD=$PAYARA_ADMIN_PASS' > /tmp/payara-admin-pass.txt if /opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt list-applications | grep -q '$APP_NAME'; then echo 'Application is running.' else @@ -145,3 +139,4 @@ jobs: # Cleanup rm -f private_key.pem + From 6ca6998217f1259f6ec97cba0fc31bb8aa5a55b4 Mon Sep 17 00:00:00 2001 From: Pubudu Piyankara <139697238+Pubudu-Piyankara@users.noreply.github.com> Date: Sun, 16 Feb 2025 08:43:34 +0530 Subject: [PATCH 05/25] #10543 stock ledger report (#10582) * transfer issue done Signed-off-by: pubudu piyankara * disbursement direct issue done closed #10543 Signed-off-by: pubudu piyankara --- .../pharmacy/TransferIssueController.java | 4 +- .../bean/report/PharmacyReportController.java | 82 +++++++++++-------- .../java/com/divudi/ejb/PharmacyBean.java | 24 +++++- 3 files changed, 71 insertions(+), 39 deletions(-) diff --git a/src/main/java/com/divudi/bean/pharmacy/TransferIssueController.java b/src/main/java/com/divudi/bean/pharmacy/TransferIssueController.java index 39be24681a..c7f0a8b651 100644 --- a/src/main/java/com/divudi/bean/pharmacy/TransferIssueController.java +++ b/src/main/java/com/divudi/bean/pharmacy/TransferIssueController.java @@ -487,7 +487,7 @@ public void settleDirectIssue() { //Addinng Staff // System.out.println("//Addinng Staff = "); System.out.println(i.getPharmaceuticalBillItem() + " 1 " + i.getPharmaceuticalBillItem().getQtyInUnit() + " " + getIssuedBill().getToStaff()); - Stock staffStock = pharmacyBean.addToStock(i.getPharmaceuticalBillItem(), + Stock staffStock = pharmacyBean.addToStockWihtoutStockHistory(i.getPharmaceuticalBillItem(), Math.abs(i.getPharmaceuticalBillItem().getQtyInUnit()), getIssuedBill().getToStaff()); i.getPharmaceuticalBillItem().setStaffStock(staffStock); @@ -611,7 +611,7 @@ public void settle() { if (returnFlag) { //Addinng Staff - Stock staffStock = pharmacyBean.addToStock(i.getPharmaceuticalBillItem(), + Stock staffStock = pharmacyBean.addToStockWihtoutStockHistory(i.getPharmaceuticalBillItem(), Math.abs(i.getPharmaceuticalBillItem().getQtyInUnit()), getIssuedBill().getToStaff()); i.getPharmaceuticalBillItem().setStaffStock(staffStock); diff --git a/src/main/java/com/divudi/bean/report/PharmacyReportController.java b/src/main/java/com/divudi/bean/report/PharmacyReportController.java index 1781921cd6..53a73ad91e 100644 --- a/src/main/java/com/divudi/bean/report/PharmacyReportController.java +++ b/src/main/java/com/divudi/bean/report/PharmacyReportController.java @@ -1949,14 +1949,16 @@ public void processStockLedgerReport() { billTypes.add(BillType.PharmacyIssue); } else if ("transferIssueDoc".equals(documentType)) { - billTypeAtomics.add(BillTypeAtomic.PHARMACY_DIRECT_ISSUE); - billTypeAtomics.add(BillTypeAtomic.PHARMACY_DIRECT_ISSUE_CANCELLED); - billTypeAtomics.add(BillTypeAtomic.PHARMACY_ISSUE); - billTypeAtomics.add(BillTypeAtomic.PHARMACY_ISSUE_CANCELLED); - billTypeAtomics.add(BillTypeAtomic.PHARMACY_ISSUE_RETURN); + billTypes.add(BillType.PharmacyTransferIssue); +// billTypeAtomics.add(BillTypeAtomic.PHARMACY_DIRECT_ISSUE); +// billTypeAtomics.add(BillTypeAtomic.PHARMACY_DIRECT_ISSUE_CANCELLED); +// billTypeAtomics.add(BillTypeAtomic.PHARMACY_ISSUE); +// billTypeAtomics.add(BillTypeAtomic.PHARMACY_ISSUE_CANCELLED); +// billTypeAtomics.add(BillTypeAtomic.PHARMACY_ISSUE_RETURN); } else if ("transferReceiveDoc".equals(documentType)) { - billTypeAtomics.add(BillTypeAtomic.PHARMACY_RECEIVE); - billTypeAtomics.add(BillTypeAtomic.PHARMACY_RECEIVE_CANCELLED); + billTypes.add(BillType.PharmacyTransferReceive); +// billTypeAtomics.add(BillTypeAtomic.PHARMACY_RECEIVE); +// billTypeAtomics.add(BillTypeAtomic.PHARMACY_RECEIVE_CANCELLED); } stockLedgerHistories = new ArrayList(); @@ -2102,8 +2104,8 @@ public void processClosingStockReport() { pr.getStockHistory().setStockQty(pr.getStockHistory().getStockQty() + row.getStockHistory().getStockQty()); setStockQty(getStockQty() + row.getStockHistory().getStockQty()); - pr.getStockHistory().setStockSaleValue(pr.getStockHistory().getStockSaleValue() + row.getStockHistory().getStockQty() * - row.getStockHistory().getItemBatch().getRetailsaleRate()); + pr.getStockHistory().setStockSaleValue(pr.getStockHistory().getStockSaleValue() + row.getStockHistory().getStockQty() + * row.getStockHistory().getItemBatch().getRetailsaleRate()); setStockSaleValue(getStockSaleValue() + row.getStockHistory().getStockQty() * row.getStockHistory().getItemBatch().getRetailsaleRate()); } else { if (row.getStockHistory().getStockQty() == 0.0) { @@ -2252,9 +2254,9 @@ public void exportExpiryItemReportToExcel() { Row headerRow = sheet.createRow(rowIndex++); String[] headers = {"Department/Staff", "Item Category Code", "Item Category Name", "Item Code", "Item Name", - "Base UOM", "Item Type", "Batch No", "Batch Date", "Expiry Date", "Supplier", - "Shelf life remaining (Days)", "Rate", "MRP", "Quantity", "Item Value", - "Batch wise Item Value", "Batch wise Qty", "Item wise total", "Item wise Qty"}; + "Base UOM", "Item Type", "Batch No", "Batch Date", "Expiry Date", "Supplier", + "Shelf life remaining (Days)", "Rate", "MRP", "Quantity", "Item Value", + "Batch wise Item Value", "Batch wise Qty", "Item wise total", "Item wise Qty"}; for (int i = 0; i < headers.length; i++) { headerRow.createCell(i).setCellValue(headers[i]); @@ -2279,21 +2281,21 @@ public void exportExpiryItemReportToExcel() { row.createCell(5).setCellValue(item.getMeasurementUnit() != null ? item.getMeasurementUnit().getName() : "-"); row.createCell(6).setCellValue(item.getCategory() != null ? item.getCategory().getName() : "-"); row.createCell(7).setCellValue(stock.getItemBatch().getId()); - row.createCell(8).setCellValue(stock.getItemBatch() != null && - stock.getItemBatch().getLastPurchaseBillItem() != null && - stock.getItemBatch().getLastPurchaseBillItem().getBill() != null && - stock.getItemBatch().getLastPurchaseBillItem().getBill().getCreatedAt() != null + row.createCell(8).setCellValue(stock.getItemBatch() != null + && stock.getItemBatch().getLastPurchaseBillItem() != null + && stock.getItemBatch().getLastPurchaseBillItem().getBill() != null + && stock.getItemBatch().getLastPurchaseBillItem().getBill().getCreatedAt() != null ? sdf.format(stock.getItemBatch().getLastPurchaseBillItem().getBill().getCreatedAt()) : "-"); - row.createCell(9).setCellValue(stock.getItemBatch() != null && - stock.getItemBatch().getDateOfExpire() != null + row.createCell(9).setCellValue(stock.getItemBatch() != null + && stock.getItemBatch().getDateOfExpire() != null ? sdf.format(stock.getItemBatch().getDateOfExpire()) : "-"); - row.createCell(10).setCellValue(stock.getItemBatch() != null && - stock.getItemBatch().getLastPurchaseBillItem() != null && - stock.getItemBatch().getLastPurchaseBillItem().getBill() != null && - stock.getItemBatch().getLastPurchaseBillItem().getBill().getFromInstitution() != null + row.createCell(10).setCellValue(stock.getItemBatch() != null + && stock.getItemBatch().getLastPurchaseBillItem() != null + && stock.getItemBatch().getLastPurchaseBillItem().getBill() != null + && stock.getItemBatch().getLastPurchaseBillItem().getBill().getFromInstitution() != null ? stock.getItemBatch().getLastPurchaseBillItem().getBill().getFromInstitution().getName() : "-"); - row.createCell(11).setCellValue(stock.getItemBatch() != null && - stock.getItemBatch().getDateOfExpire() != null + row.createCell(11).setCellValue(stock.getItemBatch() != null + && stock.getItemBatch().getDateOfExpire() != null ? calculateDaysRemaining(stock.getItemBatch().getDateOfExpire()) : 0); row.createCell(12).setCellValue(stock.getItemBatch() != null ? stock.getItemBatch().getPurcahseRate() : 0); row.createCell(13).setCellValue(stock.getItemBatch() != null ? stock.getItemBatch().getRetailsaleRate() : 0); @@ -2358,8 +2360,8 @@ public void exportExpiryItemReportToPdf() { table.setWidths(columnWidths); String[] headers = {"Department/Staff", "Item Cat Code", "Item Cat Name", "Item Code", "Item Name", "Base UOM", - "Item Type", "Batch No", "Batch Date", "Expiry Date", "Supplier", "Shelf Life (Days)", "Rate", "MRP", - "Quantity", "Item Value", "Batch Wise Item Value", "Batch Wise Qty", "Item Wise Total", "Item Wise Qty"}; + "Item Type", "Batch No", "Batch Date", "Expiry Date", "Supplier", "Shelf Life (Days)", "Rate", "MRP", + "Quantity", "Item Value", "Batch Wise Item Value", "Batch Wise Qty", "Item Wise Total", "Item Wise Qty"}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10))); @@ -2384,15 +2386,15 @@ public void exportExpiryItemReportToPdf() { table.addCell(item.getMeasurementUnit() != null ? item.getMeasurementUnit().getName() : "-"); table.addCell(item.getCategory() != null ? item.getCategory().getName() : "-"); table.addCell(stock.getItemBatch() != null ? String.valueOf(stock.getItemBatch().getId()) : "-"); - table.addCell(stock.getItemBatch() != null && stock.getItemBatch().getLastPurchaseBillItem() != null && - stock.getItemBatch().getLastPurchaseBillItem().getBill() != null && - stock.getItemBatch().getLastPurchaseBillItem().getBill().getCreatedAt() != null + table.addCell(stock.getItemBatch() != null && stock.getItemBatch().getLastPurchaseBillItem() != null + && stock.getItemBatch().getLastPurchaseBillItem().getBill() != null + && stock.getItemBatch().getLastPurchaseBillItem().getBill().getCreatedAt() != null ? sdf.format(stock.getItemBatch().getLastPurchaseBillItem().getBill().getCreatedAt()) : "-"); table.addCell(stock.getItemBatch() != null && stock.getItemBatch().getDateOfExpire() != null ? sdf.format(stock.getItemBatch().getDateOfExpire()) : "-"); - table.addCell(stock.getItemBatch() != null && stock.getItemBatch().getLastPurchaseBillItem() != null && - stock.getItemBatch().getLastPurchaseBillItem().getBill() != null && - stock.getItemBatch().getLastPurchaseBillItem().getBill().getFromInstitution() != null + table.addCell(stock.getItemBatch() != null && stock.getItemBatch().getLastPurchaseBillItem() != null + && stock.getItemBatch().getLastPurchaseBillItem().getBill() != null + && stock.getItemBatch().getLastPurchaseBillItem().getBill().getFromInstitution() != null ? stock.getItemBatch().getLastPurchaseBillItem().getBill().getFromInstitution().getName() : "-"); table.addCell(stock.getItemBatch() != null && stock.getItemBatch().getDateOfExpire() != null ? String.valueOf(calculateDaysRemaining(stock.getItemBatch().getDateOfExpire())) : "0"); @@ -2408,16 +2410,24 @@ public void exportExpiryItemReportToPdf() { table.addCell("-"); table.addCell("-"); } - for (int i = 0; i < 16; i++) table.addCell(" "); + for (int i = 0; i < 16; i++) { + table.addCell(" "); + } table.addCell(String.valueOf(calculateItemWiseTotalOfExpiredItems(item))); table.addCell(String.valueOf(calculateBatchWiseQtyOfExpiredItems(item, batchNumber))); - for (int i = 0; i < 2; i++) table.addCell(" "); + for (int i = 0; i < 2; i++) { + table.addCell(" "); + } + } + for (int i = 0; i < 18; i++) { + table.addCell(" "); } - for (int i = 0; i < 18; i++) table.addCell(" "); table.addCell(String.valueOf(calculateItemWiseTotalOfExpiredItems(item))); table.addCell(String.valueOf(calculateItemWiseQtyOfExpiredItems(item))); } - for (int i = 0; i < 16; i++) table.addCell(" "); + for (int i = 0; i < 16; i++) { + table.addCell(" "); + } table.addCell(String.format("%.2f", stockPurchaseValue)); table.addCell(String.format("%.2f", quantity)); table.addCell(String.format("%.2f", stockPurchaseValue)); diff --git a/src/main/java/com/divudi/ejb/PharmacyBean.java b/src/main/java/com/divudi/ejb/PharmacyBean.java index 09807631bc..f343987a65 100644 --- a/src/main/java/com/divudi/ejb/PharmacyBean.java +++ b/src/main/java/com/divudi/ejb/PharmacyBean.java @@ -471,6 +471,28 @@ public Stock addToStock(PharmaceuticalBillItem pharmaceuticalBillItem, double qt addToStockHistory(pharmaceuticalBillItem, s, staff); return s; } + + public Stock addToStockWihtoutStockHistory(PharmaceuticalBillItem pharmaceuticalBillItem, double qty, Staff staff) { + String sql; + HashMap hm = new HashMap(); + sql = "Select s from Stock s where s.itemBatch=:bc and s.staff=:stf"; + hm.put("bc", pharmaceuticalBillItem.getItemBatch()); + hm.put("stf", staff); + Stock s = getStockFacade().findFirstByJpql(sql, hm); + if (s == null) { + s = new Stock(); + s.setStaff(staff); + s.setItemBatch(pharmaceuticalBillItem.getItemBatch()); + } + if (s.getId() == null || s.getId() == 0) { + s.setStock(s.getStock() + qty); + getStockFacade().create(s); + } else { + s.setStock(s.getStock() + qty); + getStockFacade().edit(s); + } + return s; + } public Stock addToStock(PharmaceuticalBillItem pharmaceuticalBillItem, double qty, Department department) { String sql; @@ -729,7 +751,7 @@ public boolean deductFromStock(Stock stock, double qty, PharmaceuticalBillItem p return true; } - @Deprecated + public boolean deductFromStockWithoutHistory(Stock stock, double qty, PharmaceuticalBillItem pbi, Department d) { if (stock == null) { return false; From 22e5036e252a712653a45a43909f3c4e9b78d6a6 Mon Sep 17 00:00:00 2001 From: "Dr. M H B Ariyaratne" Date: Sun, 16 Feb 2025 08:44:00 +0530 Subject: [PATCH 06/25] 10584 enhancements to bill search for administrators (#10585) * fact: add expense section to direct purchase and update bill with net total Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * fact:improve purchase bill adding expenses and ui improvements. 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: Dr M H B Ariyaratne * Closes #10116 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10187 Signed-off-by: Dr M H B Ariyaratne * Closes #10176 * add department wise filter for inward pharmacy issue summery Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Dr M H B Ariyaratne * Closes #10191 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Update mp_prod_ci_cd.yml * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Dr M H B Ariyaratne * fix: pharmacy tranfer bill improvement done. 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> * Payment Approval Basics Completed Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10291 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10259 Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10259 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * GRN No, Invoice No added Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9986 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9939 Also adds Supplier Payment Preperation Bill Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * 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: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10334 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #7830 now can search supplier credit bills Make sure you select the option "Approveal necessary is required for Supplier Payments" as false Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10337 But need to fix pharmacy summery reports, cashier summary as seperate issues * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #3832 For Institutions where GRN payment approval is NOT necessary (Make the configuration) Payments Menu > SUpplier Payment > Settle Bills by SUpplier * Signed-off-by: Dr M H Buddhika Ariyaratne * Improved supplier payment management where Approval is necessary Need to improve UIs, navigations, have to check GRN Returns, not checked Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9681 Improved supplier payment management where Approval is necessary Need to improve UIs, navigations, have to check GRN Returns, not checked Signed-off-by: Dr M H Buddhika Ariyaratne Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9681 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10260 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #9676 * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #9679 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10425 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10462 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Import export json completed Signed-off-by: Dr M H B Ariyaratne * Import for Grn Done. Signed-off-by: Dr M H B Ariyaratne * Closes #10471 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10471 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10452 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: buddhika * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Fixes #10584 : Improved bill search with additional filters, optimized queries, and UI enhancements Signed-off-by: Dr M H B Ariyaratne --------- Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> Signed-off-by: Dr M H B Ariyaratne Signed-off-by: Dr M H Buddhika Ariyaratne Signed-off-by: buddhika Co-authored-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> Co-authored-by: Geeth Sandaru Madhushan Co-authored-by: buddhika --- .../divudi/bean/common/SearchController.java | 90 +++++++++- .../divudi/bean/pharmacy/GrnController.java | 1 - .../data/dataStructure/SearchKeyword.java | 10 ++ .../dataAdmin/admin_data_administration.xhtml | 6 +- src/main/webapp/dataAdmin/bill_summery.xhtml | 3 + src/main/webapp/dataAdmin/search_bill.xhtml | 160 +++++++++++------- 6 files changed, 198 insertions(+), 72 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/SearchController.java b/src/main/java/com/divudi/bean/common/SearchController.java index 029ba73a48..32f28eec41 100644 --- a/src/main/java/com/divudi/bean/common/SearchController.java +++ b/src/main/java/com/divudi/bean/common/SearchController.java @@ -681,7 +681,7 @@ public void fillSavedTranserRequestBills() { parametersForSearching.put("fromDepartment", sessionController.getDepartment()); parametersForSearching.put("fromDate", getFromDate()); parametersForSearching.put("toDate", getToDate()); - + bills = getBillFacade().findByJpql(sql, parametersForSearching, TemporalType.TIMESTAMP); } @@ -4556,17 +4556,16 @@ public void createBillItemTableBht(BillType btp) { m.put("bType", btp); m.put("ins", getSessionController().getInstitution()); m.put("class", PreBill.class); - sql = "select bi from BillItem bi" + " where type(bi.bill)=:class " + " and bi.bill.institution=:ins" + " and bi.bill.billType=:bType and " + " bi.createdAt between :fromDate and :toDate "; - + if (getSearchKeyword().getFrmDepartment() != null) { sql += " and bi.bill.department=:dep"; - m.put("dep", getSearchKeyword().getFrmDepartment()); + m.put("dep", getSearchKeyword().getFrmDepartment()); } if (getSearchKeyword().getFrmDepartment() != null) { @@ -10987,6 +10986,89 @@ && getSearchKeyword().getRefBillNo() == null) { bills = getBillFacade().findByJpql(sql, m, 5000); } + public void searchByInsId() { + if (getSearchKeyword() == null) { + JsfUtil.addErrorMessage("Search keyword is null"); + return; + } + + if (getSearchKeyword().getInsId() == null) { + JsfUtil.addErrorMessage("Enter Ins ID"); + return; + } + bills = null; + String jpql; + Map params = new HashMap<>(); + + jpql = "select b from Bill b where b.id is not null"; + + jpql += " and b.insId=:insId "; + params.put("insId", getSearchKeyword().getInsId()); + + jpql += " order by b.insId"; + + bills = getBillFacade().findByJpql(jpql, params, 500); + } + + public void searchByDeptId() { + if (getSearchKeyword() == null) { + JsfUtil.addErrorMessage("Search keyword is null"); + return; + } + if (getSearchKeyword().getDeptId() == null) { + JsfUtil.addErrorMessage("Enter Ins ID"); + return; + } + bills = null; + String jpql; + Map params = new HashMap<>(); + jpql = "select b from Bill b where b.id is not null"; + jpql += " and b.deptId=:deptId "; + params.put("deptId", getSearchKeyword().getDeptId()); + + jpql += " order by b.deptId"; + + bills = getBillFacade().findByJpql(jpql, params, 500); + } + + public void searchById() { + if (getSearchKeyword() == null) { + JsfUtil.addErrorMessage("Search keyword is null"); + return; + } + if (getSearchKeyword().getId() == null) { + JsfUtil.addErrorMessage("Enter Ins ID"); + return; + } + bills = null; + String jpql; + Map params = new HashMap<>(); + jpql = "select b from Bill b where b.id is not null"; + jpql += " and b.id=:id "; + params.put("id", getSearchKeyword().getId()); + jpql += " order by b.id"; + bills = getBillFacade().findByJpql(jpql, params, 500); + } + + public void searchByBhtNumber() { + if (getSearchKeyword() == null) { + JsfUtil.addErrorMessage("Search keyword is null"); + return; + } + if (getSearchKeyword().getBhtNo() == null) { + JsfUtil.addErrorMessage("Enter Ins ID"); + return; + } + bills = null; + String jpql; + Map params = new HashMap<>(); + jpql = "select b from Bill b where b.id is not null"; + jpql += " and b.patientEncounter.bhtNo=:bhtNo "; + params.put("bhtNo", getSearchKeyword().getBhtNo()); + jpql += " order by b.id"; + bills = getBillFacade().findByJpql(jpql, params, 500); + } + public void createSearchAll() { bills = null; String sql; diff --git a/src/main/java/com/divudi/bean/pharmacy/GrnController.java b/src/main/java/com/divudi/bean/pharmacy/GrnController.java index 84134ff1fc..f5e4204595 100644 --- a/src/main/java/com/divudi/bean/pharmacy/GrnController.java +++ b/src/main/java/com/divudi/bean/pharmacy/GrnController.java @@ -1181,7 +1181,6 @@ public void onEdit(BillItem tmp) { setBatch(tmp); double remains = getPharmacyCalculation().getRemainingQty(tmp.getPharmaceuticalBillItem()); - if (remains < tmp.getPharmaceuticalBillItem().getQtyInUnit()) { tmp.setTmpQty(remains); JsfUtil.addErrorMessage("You cant Change Qty than Remaining qty"); diff --git a/src/main/java/com/divudi/data/dataStructure/SearchKeyword.java b/src/main/java/com/divudi/data/dataStructure/SearchKeyword.java index 468e45c87b..aa82585b76 100644 --- a/src/main/java/com/divudi/data/dataStructure/SearchKeyword.java +++ b/src/main/java/com/divudi/data/dataStructure/SearchKeyword.java @@ -59,6 +59,7 @@ public class SearchKeyword { private Item item; private Investigation investigation; private List billTypes; + private Long id; @@ -442,6 +443,15 @@ public void setInvestigation(Investigation investigation) { this.investigation = investigation; } + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + diff --git a/src/main/webapp/dataAdmin/admin_data_administration.xhtml b/src/main/webapp/dataAdmin/admin_data_administration.xhtml index 495c427a1d..4dca073787 100644 --- a/src/main/webapp/dataAdmin/admin_data_administration.xhtml +++ b/src/main/webapp/dataAdmin/admin_data_administration.xhtml @@ -15,7 +15,9 @@
- + @@ -125,7 +127,7 @@ - +
diff --git a/src/main/webapp/dataAdmin/bill_summery.xhtml b/src/main/webapp/dataAdmin/bill_summery.xhtml index bf89a009cd..97da25d1b9 100644 --- a/src/main/webapp/dataAdmin/bill_summery.xhtml +++ b/src/main/webapp/dataAdmin/bill_summery.xhtml @@ -11,6 +11,9 @@ + +

WILL BE DEPRECATED SOON. IF NEEDED TO KEEP, PLEASE DISCUSS

+ diff --git a/src/main/webapp/dataAdmin/search_bill.xhtml b/src/main/webapp/dataAdmin/search_bill.xhtml index 553390c36e..afa40fa21f 100644 --- a/src/main/webapp/dataAdmin/search_bill.xhtml +++ b/src/main/webapp/dataAdmin/search_bill.xhtml @@ -13,48 +13,64 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@@ -189,40 +209,50 @@ -
- - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - +
From 0cf1e21b733e6b3a5d721a48d4f7bda23d4bca75 Mon Sep 17 00:00:00 2001 From: "Dr. M H B Ariyaratne" Date: Sun, 16 Feb 2025 08:51:01 +0530 Subject: [PATCH 07/25] 10586 adding a feature to list bills with errors for administrators (#10587) * fact: add expense section to direct purchase and update bill with net total Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * fact:improve purchase bill adding expenses and ui improvements. 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: Dr M H B Ariyaratne * Closes #10116 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10187 Signed-off-by: Dr M H B Ariyaratne * Closes #10176 * add department wise filter for inward pharmacy issue summery Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Dr M H B Ariyaratne * Closes #10191 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Update mp_prod_ci_cd.yml * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Dr M H B Ariyaratne * fix: pharmacy tranfer bill improvement done. 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> * Payment Approval Basics Completed Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10291 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10259 Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10259 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * GRN No, Invoice No added Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9986 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9939 Also adds Supplier Payment Preperation Bill Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * 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: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10334 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #7830 now can search supplier credit bills Make sure you select the option "Approveal necessary is required for Supplier Payments" as false Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10337 But need to fix pharmacy summery reports, cashier summary as seperate issues * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #3832 For Institutions where GRN payment approval is NOT necessary (Make the configuration) Payments Menu > SUpplier Payment > Settle Bills by SUpplier * Signed-off-by: Dr M H Buddhika Ariyaratne * Improved supplier payment management where Approval is necessary Need to improve UIs, navigations, have to check GRN Returns, not checked Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9681 Improved supplier payment management where Approval is necessary Need to improve UIs, navigations, have to check GRN Returns, not checked Signed-off-by: Dr M H Buddhika Ariyaratne Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9681 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10260 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #9676 * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #9679 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10425 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10462 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Import export json completed Signed-off-by: Dr M H B Ariyaratne * Import for Grn Done. Signed-off-by: Dr M H B Ariyaratne * Closes #10471 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10471 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10452 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: buddhika * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Fixes #10584 : Improved bill search with additional filters, optimized queries, and UI enhancements Signed-off-by: Dr M H B Ariyaratne * Closes 10586 -adding-a-feature-to-list-bills-with-errors-for-administrators 10586: Added a feature to list bills with errors for administrators. Introduced a 'Bills with Errors' button, implemented filtering by date, institution, department, and bill type, added validation checks for missing Bill Type Atomic and net total mismatches, and enhanced the UI with an export option. Signed-off-by: Dr M H B Ariyaratne --------- Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> Signed-off-by: Dr M H B Ariyaratne Signed-off-by: Dr M H Buddhika Ariyaratne Signed-off-by: buddhika Co-authored-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> Co-authored-by: Geeth Sandaru Madhushan Co-authored-by: buddhika --- .../com/divudi/bean/common/BillSearch.java | 35 +-- .../divudi/bean/common/SearchController.java | 98 ++++++- .../pharmacy/PurchaseOrderController.java | 6 - src/main/java/com/divudi/entity/Bill.java | 10 + .../java/com/divudi/service/BillService.java | 105 +++++-- src/main/webapp/analytics/bill_types.xhtml | 1 + src/main/webapp/analytics/bills.xhtml | 4 +- .../dataAdmin/admin_data_administration.xhtml | 9 + .../webapp/dataAdmin/bills_with_errors.xhtml | 266 ++++++++++++++++++ src/main/webapp/opd/view/bill_admin.xhtml | 121 +++++++- .../ezcomp/view/bill_item_list_edit.xhtml | 22 +- 11 files changed, 616 insertions(+), 61 deletions(-) create mode 100644 src/main/webapp/dataAdmin/bills_with_errors.xhtml diff --git a/src/main/java/com/divudi/bean/common/BillSearch.java b/src/main/java/com/divudi/bean/common/BillSearch.java index f7708d6b1e..0b62274ffc 100644 --- a/src/main/java/com/divudi/bean/common/BillSearch.java +++ b/src/main/java/com/divudi/bean/common/BillSearch.java @@ -319,6 +319,7 @@ public class BillSearch implements Serializable { private Bill viewingBill; private List viewingIndividualBillsOfBatchBill; private List viewingRefundBills; + private List viewingReferanceBills; private List viewingBillItems; private List viewingBillFees; private List viewingBillComponents; @@ -1394,9 +1395,6 @@ public void calculateRefundTotalForOpdBillForAjex() { double refundingValue = 0; for (BillFee refundingBillFees : refundingBillItem.getBillFees()) { - System.out.println("rbf.getFeeValue() name = " + refundingBillFees.getFee().getName()); - System.out.println("rbf.getFeeValue() = " + refundingBillFees.getFeeValue()); - System.out.println("rbf.getFeeValue() fee = " + refundingBillFees.getFee().getFee()); refundingValue += refundingBillFees.getFeeValue(); } refundingBillItem.setNetValue(refundingValue); @@ -1773,11 +1771,8 @@ public String refundOpdBill() { } if (refundingBill.getBillItems() != null) { - System.out.println("refundingBill = " + refundingBill); for (BillItem refundingBillItemTmp : refundingBill.getBillItems()) { - System.out.println("refundingBillItemTmp = " + refundingBillItemTmp); for (BillFee refundingBillFeeTmp : refundingBillItemTmp.getBillFees()) { - System.out.println("refundingBillFeeTmp = " + refundingBillFeeTmp); if (refundingBillFeeTmp.getReferenceBillFee().getFeeValue() < refundingBillFeeTmp.getFeeValue()) { JsfUtil.addErrorMessage("Pleace Enter Correct Value"); return ""; @@ -2076,15 +2071,8 @@ public void refundBillItems(RefundBill refundingBill) { getBillItemFacede().createAndFlush(rbi); originalBillItem.setRefunded(true); originalBillItem.setBillItemRefunded(true); - System.out.println("bi = " + originalBillItem); - System.out.println("1 bi Refunded= " + originalBillItem.isRefunded()); - System.out.println("1 billItemRefunded= " + originalBillItem.isBillItemRefunded()); getBillItemFacede().editAndFlush(originalBillItem); - System.out.println("2 bi Refunded= " + originalBillItem.isRefunded()); - System.out.println("2 billItemRefunded= " + originalBillItem.isBillItemRefunded()); originalBillItem = billItemFacade.find(bi.getId()); - System.out.println("3 bi Refunded= " + originalBillItem.isRefunded()); - System.out.println("3 billItemRefunded= " + originalBillItem.isBillItemRefunded()); String sql = "Select bf From BillFee bf where " + " bf.retired=false and bf.billItem.id=" + originalBillItem.getId(); List tmp = getBillFeeFacade().findByJpql(sql); @@ -2628,7 +2616,6 @@ public void cancelCashOutBill() { } private void returnBillFee(Bill rb, BillItem bt, List tmp) { - System.out.println("returnBillFee"); for (BillFee nB : tmp) { BillFee bf = new BillFee(); bf.copy(nB); @@ -2949,7 +2936,6 @@ public void cancelBillFee(Bill cancellationProfessionalPaymentBill, List originalProfessionalPaymentFeesForBillItem) { for (BillFee originalProfessionalPaymentFeeForBillItem : originalProfessionalPaymentFeesForBillItem) { BillFee newCancellingBillFee = new BillFee(); - System.out.println("addind new fee under cancelBillFee "); newCancellingBillFee.setFee(originalProfessionalPaymentFeeForBillItem.getFee()); newCancellingBillFee.setPatienEncounter(originalProfessionalPaymentFeeForBillItem.getPatienEncounter()); newCancellingBillFee.setPatient(originalProfessionalPaymentFeeForBillItem.getPatient()); @@ -3606,8 +3592,6 @@ public String navigateToViewOpdCreditBatchBillSettle() { } cashRecieveBillController.setPrintPreview(true); cashRecieveBillController.setCurrent(getBill()); - System.out.println("Preview = " + cashRecieveBillController.isPrintPreview()); - System.out.println("Bill = " + cashRecieveBillController.getCurrent()); return "/credit/credit_compnay_bill_opd?faces-redirect=true;"; } @@ -3904,13 +3888,10 @@ public String navigateToAdminBillByAtomicBillType() { } public String navigateToManageBillByAtomicBillType() { - System.out.println("navigateToManageBillByAtomicBillType"); - System.out.println("bill"); if (bill == null) { JsfUtil.addErrorMessage("No Bill is Selected"); return null; } - System.out.println("bill.getBillTypeAtomic() = " + bill.getBillTypeAtomic()); if (bill.getBillTypeAtomic() == null) { JsfUtil.addErrorMessage("No Bill type"); return null; @@ -4244,7 +4225,6 @@ private void createBillItemsAndBillFeesForOpdRefund() { List billedBillItems = billController.billItemsOfBill(bill); for (BillItem originalBillItem : billedBillItems) { - System.out.println("bi = " + originalBillItem); BillItem newlyCreatedRefundingBillItem = new BillItem(); newlyCreatedRefundingBillItem.copyWithoutFinancialData(originalBillItem); newlyCreatedRefundingBillItem.setBill(refundingBill); @@ -4254,7 +4234,6 @@ private void createBillItemsAndBillFeesForOpdRefund() { List originalBillFeesOfBillItem = billController.billFeesOfBillItem(originalBillItem); for (BillFee originalBillFeeOfBillItem : originalBillFeesOfBillItem) { - System.out.println("bf = " + originalBillFeeOfBillItem); BillFee newlyCreatedRefundingBillFeeOfBillItem = new BillFee(); newlyCreatedRefundingBillFeeOfBillItem.copyWithoutFinancialData(originalBillFeeOfBillItem); @@ -5287,12 +5266,15 @@ private void loadBillDetails(Bill bill) { // System.out.println("viewingBillFees = " + viewingBillFees); viewingBillComponents = billBean.fetchBillComponents(bill); viewingBillPayments = billBean.fetchBillPayments(bill); + viewingReferanceBills = billService.fetchAllReferanceBills(bill); } public Bill getViewingBill() { return viewingBill; } + + public void setViewingBill(Bill viewingBill) { this.viewingBill = viewingBill; } @@ -5369,6 +5351,14 @@ public void setPaymentMethods(List paymentMethods) { this.paymentMethods = paymentMethods; } + public List getViewingReferanceBills() { + return viewingReferanceBills; + } + + public void setViewingReferanceBills(List viewingReferanceBills) { + this.viewingReferanceBills = viewingReferanceBills; + } + public class PaymentSummary { private long idCounter = 0; @@ -5559,7 +5549,6 @@ public String navigateToDownloadBillsAndBillItems1() { } public String findOriginalBillFromCancelledBill(Bill cancelBill) { - System.out.println("findOriginalBillFromCancelledBill"); Bill bill = null; String jpql = "SELECT b FROM Bill b " + " WHERE b.cancelledBill=:bi " diff --git a/src/main/java/com/divudi/bean/common/SearchController.java b/src/main/java/com/divudi/bean/common/SearchController.java index 32f28eec41..70da65eac0 100644 --- a/src/main/java/com/divudi/bean/common/SearchController.java +++ b/src/main/java/com/divudi/bean/common/SearchController.java @@ -4669,9 +4669,7 @@ public void createShiftShortageBillsTable() { bills = getBillFacade().findByJpql(sql, m); if (bills == null || bills.isEmpty()) { - System.err.println("No bills found"); } else { - System.err.println("Bills found: " + bills.size()); } } @@ -9884,7 +9882,6 @@ public void processUserFinancialTransactionalSummaryByPaymentMethod() { if (obj instanceof BillSummaryRow) { billSummaryRows.add((BillSummaryRow) obj); } else { - System.err.println("Unexpected result type: " + obj.getClass().getName()); } } @@ -10585,6 +10582,99 @@ public void listBillTypes() { bundle.calculateTotalByValues(); } + + public String navigateToListBillsWithErrors(){ + bills = null; + return "/dataAdmin/bills_with_errors?faces-redirect=true;"; + } + + public void findBillsWithErrors() { + bills = new ArrayList<>(); + List allBills; + Map params = new HashMap<>(); + StringBuilder jpql = new StringBuilder("select b from Bill b where 1=1 "); + if (toDate != null && fromDate != null) { + jpql.append(" and b.createdAt between :fromDate and :toDate "); + params.put("toDate", toDate); + params.put("fromDate", fromDate); + } + + if (institution != null) { + params.put("ins", institution); + jpql.append(" and b.department.institution = :ins "); + } + + if (department != null) { + params.put("dept", department); + jpql.append(" and b.department = :dept "); + } + + if (site != null) { + params.put("site", site); + jpql.append(" and b.department.site = :site "); + } + + if (webUser != null) { + jpql.append(" and b.creater=:wu "); + params.put("wu", webUser); + } + + if (billClassType != null) { + jpql.append(" and type(b)=:billClassType "); + switch (billClassType) { + case Bill: + params.put("billClassType", com.divudi.entity.Bill.class); + break; + case BilledBill: + params.put("billClassType", com.divudi.entity.BilledBill.class); + break; + case CancelledBill: + params.put("billClassType", com.divudi.entity.CancelledBill.class); + break; + case OtherBill: + params.put("billClassType", com.divudi.entity.Bill.class); + break; + case PreBill: + params.put("billClassType", com.divudi.entity.PreBill.class); + break; + case RefundBill: + params.put("billClassType", com.divudi.entity.RefundBill.class); + break; + + } + } + + if (billType != null) { + jpql.append(" and b.billType=:billType "); + params.put("billType", billType); + } + + if (billTypeAtomic != null) { + jpql.append(" and b.billTypeAtomic=:billTypeAtomic "); + params.put("billTypeAtomic", billTypeAtomic); + } + + // Order by bill ID + jpql.append(" order by b.id "); + + // Execute the query + allBills = getBillFacade().findByJpql(jpql.toString(), params, TemporalType.TIMESTAMP); + + if (allBills != null) { + for (Bill tmpBill : allBills) { + boolean billHasErrors; + billHasErrors = billService.checkBillForErrors(tmpBill); + if (!billHasErrors) { + continue; + } + bills.add(tmpBill); + total += tmpBill.getTotal(); + netTotal += tmpBill.getNetTotal(); + discount += tmpBill.getDiscount(); + } + } + + } public void listBillItems() { billItems = null; @@ -11068,7 +11158,7 @@ public void searchByBhtNumber() { jpql += " order by b.id"; bills = getBillFacade().findByJpql(jpql, params, 500); } - + public void createSearchAll() { bills = null; String sql; diff --git a/src/main/java/com/divudi/bean/pharmacy/PurchaseOrderController.java b/src/main/java/com/divudi/bean/pharmacy/PurchaseOrderController.java index 861a512dde..79031c2a26 100644 --- a/src/main/java/com/divudi/bean/pharmacy/PurchaseOrderController.java +++ b/src/main/java/com/divudi/bean/pharmacy/PurchaseOrderController.java @@ -142,23 +142,17 @@ public String approve() { JsfUtil.addErrorMessage("Please add bill items"); return ""; } - calTotal(); - saveBill(); - totalBillItemsCount = 0; saveBillComponent(); if (totalBillItemsCount == 0){ JsfUtil.addErrorMessage("Please add item quantities for the bill"); return ""; } - String deptId = billNumberBean.departmentBillNumberGeneratorYearly(getSessionController().getDepartment(), BillTypeAtomic.PHARMACY_ORDER_APPROVAL); - getAprovedBill().setDeptId(deptId); getAprovedBill().setInsId(deptId); - getAprovedBill().setBillTypeAtomic(BillTypeAtomic.PHARMACY_ORDER_APPROVAL); billFacade.edit(getAprovedBill()); notificationController.createNotification(getAprovedBill()); diff --git a/src/main/java/com/divudi/entity/Bill.java b/src/main/java/com/divudi/entity/Bill.java index 338f86ce94..7f1e1dce36 100644 --- a/src/main/java/com/divudi/entity/Bill.java +++ b/src/main/java/com/divudi/entity/Bill.java @@ -406,6 +406,8 @@ public class Bill implements Serializable, RetirableEntity { private String ageAtBilledDate; @Transient private Bill tmpRefBill; + @Transient + private String tmpComments; private String agentRefNo; private boolean billClosed; @@ -2654,6 +2656,14 @@ public void setPaymentGenerationComments(String paymentGenerationComments) { this.paymentGenerationComments = paymentGenerationComments; } + public String getTmpComments() { + return tmpComments; + } + + public void setTmpComments(String tmpComments) { + this.tmpComments = tmpComments; + } + diff --git a/src/main/java/com/divudi/service/BillService.java b/src/main/java/com/divudi/service/BillService.java index 2121b67ff7..cb731ba494 100644 --- a/src/main/java/com/divudi/service/BillService.java +++ b/src/main/java/com/divudi/service/BillService.java @@ -45,17 +45,12 @@ import com.divudi.facade.ItemFacade; import com.divudi.facade.PaymentFacade; import java.util.ArrayList; -import java.util.Date; import java.util.HashMap; -import java.util.List; -import java.util.Map; import javax.ejb.EJB; import javax.ejb.Stateless; import javax.persistence.TemporalType; -import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.util.*; -import java.text.SimpleDateFormat; import com.google.gson.Gson; import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -676,7 +671,7 @@ public List fetchBills(Date fromDate, jpql += " and b.paymentScheme=:paymentScheme "; params.put("paymentScheme", paymentScheme); } - + jpql += " order by b.createdAt desc "; List fetchedBills = billFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP); return fetchedBills; @@ -744,10 +739,7 @@ public List fetchBillItems(Date fromDate, } jpql += " order by b.createdAt, bi.id "; - System.out.println("jpql = " + jpql); - System.out.println("params = " + params); List fetchedBillItems = billFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP); - System.out.println("fetchedBillItems = " + fetchedBillItems.size()); return fetchedBillItems; } @@ -807,10 +799,7 @@ public List fetchBillItemsWithoutCancellationsAndReturns(Date fromDate } jpql += " order by b.createdAt, bi.id "; - System.out.println("jpql = " + jpql); - System.out.println("params = " + params); List fetchedBillItems = billFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP); - System.out.println("fetchedBillItems = " + fetchedBillItems.size()); return fetchedBillItems; } @@ -844,12 +833,52 @@ public List fetchReturnBills(Bill inputBill) { params.put("ret", false); params.put("btas", btas); params.put("bill", inputBill); - System.out.println("jpql = " + jpql); - System.out.println("params = " + params); List fetchedBills = billFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP); return fetchedBills; } + public List fetchAllReferanceBills(Bill inputBill) { + if (inputBill == null || inputBill.getBillTypeAtomic() == null) { + return null; + } + + Set allRefBills = new LinkedHashSet<>(); + + if (inputBill.getReferenceBill() != null) { + allRefBills.add(inputBill.getReferenceBill()); + } + if (inputBill.getBilledBill() != null) { + allRefBills.add(inputBill.getBilledBill()); + } + if (inputBill.getBackwardReferenceBill() != null) { + allRefBills.add(inputBill.getBackwardReferenceBill()); + } + if (inputBill.getForwardReferenceBill() != null) { + allRefBills.add(inputBill.getForwardReferenceBill()); + } + if (inputBill.getPaidBill() != null) { + allRefBills.add(inputBill.getPaidBill()); + } + + String jpql = "select b from Bill b " + + "where b.billedBill = :bill " + + "or b.referenceBill = :bill " + + "or b.backwardReferenceBill = :bill " + + "or b.forwardReferenceBill = :bill " + + "or b.paidBill = :bill " + + "order by b.createdAt"; + + Map params = new HashMap<>(); + params.put("bill", inputBill); + + List fetchedBills = billFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP); + if (fetchedBills != null) { + allRefBills.addAll(fetchedBills); + } + + return new ArrayList<>(allRefBills); + } + public List fetchPaymentBillItems(Bill inputBill) { String jpql; if (inputBill == null) { @@ -881,10 +910,7 @@ public List fetchPaymentBillItems(Bill inputBill) { params.put("ret", false); params.put("btas", btas); params.put("bill", inputBill); - System.out.println("jpql = " + jpql); - System.out.println("params = " + params); List fetchedBillItems = billItemFacade.findByJpql(jpql, params, TemporalType.TIMESTAMP); - System.out.println("fetchedBillItems = " + fetchedBillItems); return fetchedBillItems; } @@ -1051,4 +1077,49 @@ public Bill importPharmacyGrnBillFromJson(JsonObject jsonObject) { return bill; } + public boolean checkBillForErrors(Bill bill) { + if (bill == null) { + return true; + } + if (bill.getBillTypeAtomic() == null) { + bill.setTmpComments("No Bill Type Atomic"); + return true; + } + boolean hasAtLeatOneError = false; + switch (bill.getBillTypeAtomic()) { + case PHARMACY_GRN: + case PHARMACY_ORDER: + case PHARMACY_ORDER_APPROVAL: + boolean billNetTotalIsNotEqualToBillItemNetTotalError = billNetTotalIsNotEqualToBillItemNetTotal(bill); + System.out.println("billNetTotalIsNotEqualToBillItemNetTotalError = " + billNetTotalIsNotEqualToBillItemNetTotalError); + if (billNetTotalIsNotEqualToBillItemNetTotalError) { + hasAtLeatOneError = true; + } + break; + default: + hasAtLeatOneError = false; + + } + System.out.println("hasAtLeatOneError = " + hasAtLeatOneError); + return hasAtLeatOneError; + } + + public boolean billNetTotalIsNotEqualToBillItemNetTotal(Bill bill) { + if (bill == null || bill.getBillItems() == null) { + return true; + } + + double billNetTotal = Math.abs(bill.getNetTotal()); + double billItemNetTotal = 0.0; + + for (BillItem bi : bill.getBillItems()) { + if (bi != null) { + billItemNetTotal += Math.abs(bi.getNetValue()); + } + } + boolean billNetTotalIsNotEqualToBillItemNetTotalError = Math.abs(billNetTotal - billItemNetTotal) >= 0.01; + System.out.println("billNetTotalIsNotEqualToBillItemNetTotalError = " + billNetTotalIsNotEqualToBillItemNetTotalError); + return billNetTotalIsNotEqualToBillItemNetTotalError; + } + } diff --git a/src/main/webapp/analytics/bill_types.xhtml b/src/main/webapp/analytics/bill_types.xhtml index 531a9a0919..cd20cc61bd 100644 --- a/src/main/webapp/analytics/bill_types.xhtml +++ b/src/main/webapp/analytics/bill_types.xhtml @@ -132,6 +132,7 @@ ajax="false" value="List" action="#{searchController.listBillTypes}"/> + diff --git a/src/main/webapp/analytics/bills.xhtml b/src/main/webapp/analytics/bills.xhtml index 8acb355a0a..858f80ecb2 100644 --- a/src/main/webapp/analytics/bills.xhtml +++ b/src/main/webapp/analytics/bills.xhtml @@ -160,7 +160,7 @@ --> + filterMatchMode="contains" > diff --git a/src/main/webapp/dataAdmin/admin_data_administration.xhtml b/src/main/webapp/dataAdmin/admin_data_administration.xhtml index 4dca073787..0e1b9e34e4 100644 --- a/src/main/webapp/dataAdmin/admin_data_administration.xhtml +++ b/src/main/webapp/dataAdmin/admin_data_administration.xhtml @@ -139,6 +139,15 @@ action="#{searchController.toSearchBills}" rendered="#{webUserController.hasPrivilege('Search')}"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ + + +
+ +
+
+ diff --git a/src/main/webapp/opd/view/bill_admin.xhtml b/src/main/webapp/opd/view/bill_admin.xhtml index 2279870207..d0813bd2a4 100644 --- a/src/main/webapp/opd/view/bill_admin.xhtml +++ b/src/main/webapp/opd/view/bill_admin.xhtml @@ -5,10 +5,7 @@ xmlns:p="http://primefaces.org/ui" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" - xmlns:bi="http://xmlns.jcp.org/jsf/composite/bill" - xmlns:prints="http://xmlns.jcp.org/jsf/composite/ezcomp/prints" - xmlns:view="http://xmlns.jcp.org/jsf/composite/ezcomp/view" - xmlns:common="http://xmlns.jcp.org/jsf/composite/ezcomp/common"> + xmlns:view="http://xmlns.jcp.org/jsf/composite/ezcomp/view"> @@ -163,6 +160,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/resources/ezcomp/view/bill_item_list_edit.xhtml b/src/main/webapp/resources/ezcomp/view/bill_item_list_edit.xhtml index 5788a38ae6..83a16b091c 100644 --- a/src/main/webapp/resources/ezcomp/view/bill_item_list_edit.xhtml +++ b/src/main/webapp/resources/ezcomp/view/bill_item_list_edit.xhtml @@ -15,11 +15,19 @@ -

Bill Items

- - - - + + + + + + + + + @@ -27,6 +35,10 @@ + + + + From 20ea93f8b426def92d22bbae7633e4ca0377cbab Mon Sep 17 00:00:00 2001 From: "Dr. M H B Ariyaratne" Date: Sun, 16 Feb 2025 08:54:37 +0530 Subject: [PATCH 08/25] 10559 print improvement pharmacy transfer issue report (#10588) * Closes #10559 Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10559 Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10559 Signed-off-by: Dr M H Buddhika Ariyaratne --------- Signed-off-by: Dr M H Buddhika Ariyaratne --- .../resources/META-INF/.LCKpersistence.xml~ | 1 + .../pharmacy_income_report.xhtml | 61 ++++++++------- src/main/webapp/resources/css/ohmis.css | 77 +++++++++++++++++++ 3 files changed, 110 insertions(+), 29 deletions(-) create mode 100644 src/main/resources/META-INF/.LCKpersistence.xml~ diff --git a/src/main/resources/META-INF/.LCKpersistence.xml~ b/src/main/resources/META-INF/.LCKpersistence.xml~ new file mode 100644 index 0000000000..e4d2437f6c --- /dev/null +++ b/src/main/resources/META-INF/.LCKpersistence.xml~ @@ -0,0 +1 @@ +D:\Development\rh\src\main\resources\META-INF\persistence.xml \ No newline at end of file diff --git a/src/main/webapp/pharmacy/reports/summary_reports/pharmacy_income_report.xhtml b/src/main/webapp/pharmacy/reports/summary_reports/pharmacy_income_report.xhtml index 7842386e4d..fd7ce392bb 100644 --- a/src/main/webapp/pharmacy/reports/summary_reports/pharmacy_income_report.xhtml +++ b/src/main/webapp/pharmacy/reports/summary_reports/pharmacy_income_report.xhtml @@ -201,146 +201,147 @@ - - + + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -351,6 +352,8 @@ + +
diff --git a/src/main/webapp/resources/css/ohmis.css b/src/main/webapp/resources/css/ohmis.css index 6547411546..70fca88aa9 100644 --- a/src/main/webapp/resources/css/ohmis.css +++ b/src/main/webapp/resources/css/ohmis.css @@ -328,6 +328,83 @@ th.align-right-header .ui-column-title { padding: 0 !important; } + +.compact-column-borders { + --content-padding: 0.0rem; /* Remove padding */ + --inline-spacing: 0.0rem; /* Remove spacing */ + --border-radius: 0px; /* No border rounding */ + border-collapse: collapse; /* Ensures borders align properly */ + width: 100%; +} + +.compact-column-borders td, +.compact-column-borders th { + border-left: 1px solid black; + border-right: 1px solid black; + padding: 2px !important; /* Minimal padding */ + margin: 0 !important; + line-height: 1; /* Remove extra spacing */ + text-align: left; + white-space: nowrap; /* Prevent text wrapping */ + overflow: hidden; /* Hide overflowing text */ + text-overflow: ellipsis; /* Show "..." for cut-off text */ + max-width: 10em; /* Adjust based on column width */ +} + +.compact-column-borders th { + font-weight: bold; + text-align: center; + background: #f8f8f8; +} + +.compact-column-borders tr { + height: auto !important; /* Prevent row height increase */ + border-bottom: none !important; /* Remove row borders */ + border-top: none !important; /* Remove row borders */ +} + +.compact-column-borders th:first-child, +.compact-column-borders td:first-child { + border-left: none; /* Remove left border for first column */ +} + +.compact-column-borders th:last-child, +.compact-column-borders td:last-child { + border-right: none; /* Remove right border for last column */ +} + +/* Bold footer text */ +.compact-column-borders tfoot td { + font-weight: bold !important; + border-top: 1px solid black !important; /* Add border above footer */ +} + +.compact-column-borders .ui-datatable-header, +.compact-column-borders .ui-datatable-footer { + margin: 0 !important; + padding: 2px !important; + line-height: 1.1; +} + +/* Hide empty footer cells */ +.compact-column-borders .ui-datatable-footer td:empty { + display: none; +} + +.compact-column-borders .ui-state-default { + margin: 0 !important; + padding: 0 !important; +} + +/* Border below header */ +.compact-column-borders thead { + border-bottom: 1px solid black !important; +} + + + + + .light-grey-background { background-color: #e2e3e5; /* Slightly darker grey than before */ color: #343a40; /* Dark grey text, ensuring good contrast */ From 965d5ef59f03f9cd7346a4ff226c1ddfe3589b9e Mon Sep 17 00:00:00 2001 From: "Dr. M H B Ariyaratne" Date: Sun, 16 Feb 2025 17:57:10 +0530 Subject: [PATCH 09/25] 10106 request value approved value was wrong in po (#10591) * fact: add expense section to direct purchase and update bill with net total Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * fact:improve purchase bill adding expenses and ui improvements. 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: Dr M H B Ariyaratne * Closes #10116 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10187 Signed-off-by: Dr M H B Ariyaratne * Closes #10176 * add department wise filter for inward pharmacy issue summery Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Dr M H B Ariyaratne * Closes #10191 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Update mp_prod_ci_cd.yml * Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> * Signed-off-by: Dr M H B Ariyaratne * fix: pharmacy tranfer bill improvement done. 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> * Payment Approval Basics Completed Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10291 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10259 Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10259 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * GRN No, Invoice No added Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9986 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9939 Also adds Supplier Payment Preperation Bill Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * 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: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10334 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #7830 now can search supplier credit bills Make sure you select the option "Approveal necessary is required for Supplier Payments" as false Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #10337 But need to fix pharmacy summery reports, cashier summary as seperate issues * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #3832 For Institutions where GRN payment approval is NOT necessary (Make the configuration) Payments Menu > SUpplier Payment > Settle Bills by SUpplier * Signed-off-by: Dr M H Buddhika Ariyaratne * Improved supplier payment management where Approval is necessary Need to improve UIs, navigations, have to check GRN Returns, not checked Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9681 Improved supplier payment management where Approval is necessary Need to improve UIs, navigations, have to check GRN Returns, not checked Signed-off-by: Dr M H Buddhika Ariyaratne Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Closes #9681 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10260 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #9676 * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #9679 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10425 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10462 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Import export json completed Signed-off-by: Dr M H B Ariyaratne * Import for Grn Done. Signed-off-by: Dr M H B Ariyaratne * Closes #10471 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10471 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10452 Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: buddhika * Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Fixes #10584 : Improved bill search with additional filters, optimized queries, and UI enhancements Signed-off-by: Dr M H B Ariyaratne * Closes 10586 -adding-a-feature-to-list-bills-with-errors-for-administrators 10586: Added a feature to list bills with errors for administrators. Introduced a 'Bills with Errors' button, implemented filtering by date, institution, department, and bill type, added validation checks for missing Bill Type Atomic and net total mismatches, and enhanced the UI with an export option. Signed-off-by: Dr M H B Ariyaratne * Signed-off-by: Dr M H B Ariyaratne * Closes #10106 Signed-off-by: Dr M H B Ariyaratne --------- Signed-off-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> Signed-off-by: Dr M H B Ariyaratne Signed-off-by: Dr M H Buddhika Ariyaratne Signed-off-by: buddhika Co-authored-by: Chinthaka Prasad Wijerathna <118891516+ChinthakaPrasad@users.noreply.github.com> Co-authored-by: Geeth Sandaru Madhushan Co-authored-by: buddhika --- .../webapp/dataAdmin/bills_with_errors.xhtml | 17 +++++++---------- .../pharmacy_purhcase_order_approving.xhtml | 6 +++--- src/main/webapp/resources/pharmacy/po.xhtml | 12 ++++++++++++ 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/src/main/webapp/dataAdmin/bills_with_errors.xhtml b/src/main/webapp/dataAdmin/bills_with_errors.xhtml index 4259cb22d0..e2c6ec9eef 100644 --- a/src/main/webapp/dataAdmin/bills_with_errors.xhtml +++ b/src/main/webapp/dataAdmin/bills_with_errors.xhtml @@ -192,17 +192,17 @@ rowsPerPageTemplate="5,10,15,50" > - + - + @@ -219,30 +219,27 @@ diff --git a/src/main/webapp/pharmacy/pharmacy_purhcase_order_approving.xhtml b/src/main/webapp/pharmacy/pharmacy_purhcase_order_approving.xhtml index 983db50520..92726a51bb 100644 --- a/src/main/webapp/pharmacy/pharmacy_purhcase_order_approving.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_purhcase_order_approving.xhtml @@ -102,11 +102,11 @@ - #{bi.item.name} + - #{bi.item.code} + @@ -127,7 +127,7 @@ - + diff --git a/src/main/webapp/resources/pharmacy/po.xhtml b/src/main/webapp/resources/pharmacy/po.xhtml index 2739cacca0..4f48b6daf6 100644 --- a/src/main/webapp/resources/pharmacy/po.xhtml +++ b/src/main/webapp/resources/pharmacy/po.xhtml @@ -140,6 +140,18 @@ + + + + Total + + + + + + + +
From 03d66e07fdbaa9ef1e34b283456df576468683f5 Mon Sep 17 00:00:00 2001 From: "Dr. M H B Ariyaratne" Date: Sun, 16 Feb 2025 17:57:39 +0530 Subject: [PATCH 10/25] Closes #10507 (#10592) Signed-off-by: Dr M H B Ariyaratne --- .../java/com/divudi/bean/pharmacy/BhtIssueReturnController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/divudi/bean/pharmacy/BhtIssueReturnController.java b/src/main/java/com/divudi/bean/pharmacy/BhtIssueReturnController.java index 6e6ab30f6a..aaf47e86b6 100644 --- a/src/main/java/com/divudi/bean/pharmacy/BhtIssueReturnController.java +++ b/src/main/java/com/divudi/bean/pharmacy/BhtIssueReturnController.java @@ -298,7 +298,7 @@ public void settle() { saveReturnBill(); saveComponent(); - updateMargin(getReturnBill().getBillItems(), getReturnBill(), getReturnBill().getFromDepartment(), getBill().getPatientEncounter().getPaymentMethod()); +// updateMargin(getReturnBill().getBillItems(), getReturnBill(), getReturnBill().getFromDepartment(), getBill().getPatientEncounter().getPaymentMethod()); getBillFacade().edit(getReturnBill()); From 49764f0956ef83ce86744a150428b61924479703 Mon Sep 17 00:00:00 2001 From: Pubudu Piyankara <139697238+Pubudu-Piyankara@users.noreply.github.com> Date: Mon, 17 Feb 2025 09:19:23 +0530 Subject: [PATCH 11/25] Signed-off-by: pubudu piyankara (#10594) --- .../pharmacy/TransferReceiveController.java | 2 +- .../java/com/divudi/ejb/PharmacyBean.java | 31 +++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java b/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java index 51d390de96..1a01c906ec 100644 --- a/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java +++ b/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java @@ -224,7 +224,7 @@ public void settle() { double qty = Math.abs(i.getPharmaceuticalBillItem().getQtyInUnit()); // Deduct Staff Stock - boolean returnFlag = getPharmacyBean().deductFromStock(tmpPh, Math.abs(qty), getIssuedBill().getToStaff()); + boolean returnFlag = getPharmacyBean().deductFromStockWithoutStockHistory(tmpPh, Math.abs(qty), getIssuedBill().getToStaff()); if (returnFlag) { // Add Stock To Department diff --git a/src/main/java/com/divudi/ejb/PharmacyBean.java b/src/main/java/com/divudi/ejb/PharmacyBean.java index f343987a65..938b30aece 100644 --- a/src/main/java/com/divudi/ejb/PharmacyBean.java +++ b/src/main/java/com/divudi/ejb/PharmacyBean.java @@ -578,6 +578,33 @@ public boolean deductFromStock(PharmaceuticalBillItem pharmaceuticalBillItem, do return true; } + public boolean deductFromStockWithoutStockHistory(PharmaceuticalBillItem pharmaceuticalBillItem, double qty, Staff staff) { + String sql; + HashMap hm = new HashMap(); + sql = "Select s from Stock s where s.itemBatch=:batch " + + "and s.staff=:stf"; + hm.put("batch", pharmaceuticalBillItem.getItemBatch()); + hm.put("stf", staff); + Stock s = getStockFacade().findFirstByJpql(sql, hm); + if (s == null) { + s = new Stock(); + s.setStaff(staff); + s.setItemBatch(pharmaceuticalBillItem.getItemBatch()); + } + if (s.getStock() < qty) { + return false; + } + + if (s.getId() == null || s.getId() == 0) { + s.setStock(s.getStock() - qty); + getStockFacade().create(s); + } else { + s.setStock(s.getStock() - qty); + getStockFacade().edit(s); + } + return true; + } + public boolean deductFromStock(ItemBatch batch, double qty, Department department, boolean minusAllowed) { if (!minusAllowed) { return deductFromStock(batch, qty, department); @@ -822,7 +849,7 @@ public void addToStockHistory(PharmaceuticalBillItem phItem, Stock stock, Staff return; } - StockHistory sh= new StockHistory(); + StockHistory sh = new StockHistory(); sh.setFromDate(Calendar.getInstance().getTime()); sh.setPbItem(phItem); sh.setHxDate(Calendar.getInstance().get(Calendar.DATE)); @@ -1394,7 +1421,7 @@ public Ampp getAmpp(Amp amp, double issueUnitsPerPack, MeasurementUnit unit) { public Vmp getVmp(Vtm vtm, double strength, MeasurementUnit strengthUnit, PharmaceuticalItemCategory cat) { System.out.println("getVmp"); System.out.println("strength = " + strength); - + String sql; String vmpName = ""; From 21c0e71c01bb08eacfaeffa50e2fd4593c34e755 Mon Sep 17 00:00:00 2001 From: Isuru Ranaweera <152675215+IsuruUdaraRanaweera@users.noreply.github.com> Date: Mon, 17 Feb 2025 09:19:51 +0530 Subject: [PATCH 12/25] 10519 need UI improvements for service investigation bill (#10595) * search page changed Signed-off-by: Isuru Ranaweera * UI improved Signed-off-by: Isuru Ranaweera --- .../webapp/inward/inward_bill_service.xhtml | 225 ++++++++---------- 1 file changed, 102 insertions(+), 123 deletions(-) diff --git a/src/main/webapp/inward/inward_bill_service.xhtml b/src/main/webapp/inward/inward_bill_service.xhtml index 9f317fe03e..d7726dcaf4 100644 --- a/src/main/webapp/inward/inward_bill_service.xhtml +++ b/src/main/webapp/inward/inward_bill_service.xhtml @@ -21,7 +21,7 @@ -
+
-
- - - - - - -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
@@ -229,8 +199,20 @@
- - +
+
+ + +
+ + +
-
-
+
+
- -
-
+
-
+
-
+
+ value="#{billBhtController.currentBillItem.qty}" + style="text-align: right; padding-right: 10px;">
-
-
+
+
-
+
-
+
-
+
-
+
+
+
From 9dff0a9d1ce3097310f375d4829234d310590352 Mon Sep 17 00:00:00 2001 From: Pasindu Wathsara <113449846+PasinduW99@users.noreply.github.com> Date: Mon, 17 Feb 2025 09:20:20 +0530 Subject: [PATCH 13/25] 10566_print_improvements_pharmacy_transer_receive_report (#10596) * Closes #10559 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: PasinduW99 --------- Signed-off-by: Dr M H Buddhika Ariyaratne Co-authored-by: Dr M H Buddhika Ariyaratne --- .../pharmacy_report_transfer_issue_bill.xhtml | 177 +++++++++++++++--- ...harmacy_report_transfer_receive_bill.xhtml | 158 +++++++++++++--- src/main/webapp/resources/css/ohmis.css | 16 +- 3 files changed, 292 insertions(+), 59 deletions(-) diff --git a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml index db6a73af7c..388a1b7a73 100644 --- a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml +++ b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml @@ -71,14 +71,19 @@ icon="fas fa-print" class="ui-button-info" action="#" > - + - - + +   @@ -95,92 +100,95 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + Cancelled - + Returned - + - + - + - + - + - + - + - + - + + + + + + +   + +   + +

+   + + + +   + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Cancelled + + + + Returned + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ diff --git a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_receive_bill.xhtml b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_receive_bill.xhtml index 850a89910a..d8d7b21fb7 100644 --- a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_receive_bill.xhtml +++ b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_receive_bill.xhtml @@ -50,35 +50,35 @@ icon="fas fa-print" class="ui-button-info" action="#" > - + - + - +
+ - + - +
+ - + @@ -92,60 +92,61 @@ --> - + - + - - + + - - + + - + - + - + - - + + - + - + - + - + - + @@ -153,16 +154,117 @@ - +
+
+ + + + + +
+ + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/webapp/resources/css/ohmis.css b/src/main/webapp/resources/css/ohmis.css index 70fca88aa9..3e56dd45c5 100644 --- a/src/main/webapp/resources/css/ohmis.css +++ b/src/main/webapp/resources/css/ohmis.css @@ -675,13 +675,23 @@ th.align-right-header .ui-column-title { } } -@media screen { - .printingOnly{ +@media print { + .printingOnly { + display: block !important; + } + .screenOnly { display: none !important; - } } +@media screen { + .printingOnly { + display: none !important; + } + .screenOnly { + display: block !important; + } +} /* Adjust the size of the autocomplete dropdown panel */ From 8a859f18a85cd2658d781b448ce8c1849abcd4ad Mon Sep 17 00:00:00 2001 From: Pasindu Wathsara <113449846+PasinduW99@users.noreply.github.com> Date: Mon, 17 Feb 2025 09:20:54 +0530 Subject: [PATCH 14/25] #10568 print improvements inpatient report bht issue by bill (#10597) * Closes #10559 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: PasinduW99 * Signed-off-by: PasinduW99 --------- Signed-off-by: Dr M H Buddhika Ariyaratne Co-authored-by: Dr M H Buddhika Ariyaratne --- .../pharmacy_report_bht_issue_bill.xhtml | 204 ++++++++++++++---- 1 file changed, 168 insertions(+), 36 deletions(-) diff --git a/src/main/webapp/pharmacy/pharmacy_report_bht_issue_bill.xhtml b/src/main/webapp/pharmacy/pharmacy_report_bht_issue_bill.xhtml index 14270cf358..fb25306624 100644 --- a/src/main/webapp/pharmacy/pharmacy_report_bht_issue_bill.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_report_bht_issue_bill.xhtml @@ -64,21 +64,24 @@ class="ui-button-info" action="#" > - + - - + + -   + -   +
@@ -90,100 +93,229 @@
- + - + #{i.billType} - + - + - + - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + +
+
+ + + + + + + +
+ + + + + + + + + +
+ + + + + + #{i.billType} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ From ba1782e02d0a3f28ffe213aca1a81aea0d4b9567 Mon Sep 17 00:00:00 2001 From: Lawan Chaamindu Jayalath Samarasekara Date: Mon, 17 Feb 2025 10:07:34 +0530 Subject: [PATCH 15/25] Fixed #10577 (#10578) Signed-off-by: Lawan Samarasekara --- .github/workflows/digasiri_prod_ci_cd.yml | 141 ++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 .github/workflows/digasiri_prod_ci_cd.yml diff --git a/.github/workflows/digasiri_prod_ci_cd.yml b/.github/workflows/digasiri_prod_ci_cd.yml new file mode 100644 index 0000000000..93d097f277 --- /dev/null +++ b/.github/workflows/digasiri_prod_ci_cd.yml @@ -0,0 +1,141 @@ +name: DIGASIRI-PROD Build & Deployment Pipeline + +on: + push: + branches: + - digasiri-prod + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '11' + + - name: Cache Maven Packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: Update JDBC Data Sources in persistence.xml + run: | + sed -i 's|${JDBC_DATASOURCE}|jdbc/digasiri|' src/main/resources/META-INF/persistence.xml + sed -i 's|${JDBC_AUDIT_DATASOURCE}|jdbc/digasiriAudit|' src/main/resources/META-INF/persistence.xml + + - name: Verify JDBC Data Sources in persistence.xml + run: | + grep '' src/main/resources/META-INF/persistence.xml + + - name: Build with Maven + run: mvn clean package -DskipTests + + - name: Archive Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: build-artifacts + path: target/*.war + overwrite: true + + # - name: Run Tests + # run: mvn test + + deploy: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Download Build Artifact + uses: actions/download-artifact@v4 + with: + name: build-artifacts + path: ./ + + - name: Deploy to Payara + env: + SERVER_IP: ${{ secrets.DIGASIRI_PROD_SERVER_IP }} + SERVER_USER: ${{ secrets.DIGASIRI_PROD_SERVER_USER }} + SSH_PRIVATE_KEY: ${{ secrets.DIGASIRI_PROD_SSH_PRIVATE_KEY }} + PAYARA_ADMIN_PASS: ${{ secrets.DIGASIRI_PROD_PAYARA_ADMIN_PASS }} + run: | + # Add SSH private key to the SSH agent + echo "$SSH_PRIVATE_KEY" > private_key.pem + chmod 600 private_key.pem + + # Variables + WAR_NAME="digasiri.war" + WAR_DIR="/home/appuser/app/latest" + APP_NAME="digasiri" + SUBDOMAIN="digasiri" + + # Ensure deployment directory exists + ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " + mkdir -p $WAR_DIR + chown -R appuser:appuser $WAR_DIR + cd $WAR_DIR + + # Remove old backup if it exists + if [ -f $WAR_NAME.old ]; then + rm $WAR_NAME.old + fi + + # If the current WAR file exists, back it up + if [ -f $WAR_NAME ]; then + mv $WAR_NAME $WAR_NAME.old + fi + " + + # Copy new WAR file to the server + rsync -aL --progress -e "ssh -i private_key.pem" ./*.war $SERVER_USER@$SERVER_IP:$WAR_DIR/$WAR_NAME + + # Set the WAR file permission + ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " + chown appuser:appuser $WAR_DIR/$WAR_NAME + " + + # Deploy the WAR using asadmin + ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " + echo 'AS_ADMIN_PASSWORD=$PAYARA_ADMIN_PASS' > /tmp/payara-admin-pass.txt + /opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt undeploy $APP_NAME || true + /opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt deploy --force=true --contextroot $APP_NAME $WAR_DIR/$WAR_NAME + rm /tmp/payara-admin-pass.txt + " + + # Validate if the application is running + ssh -i private_key.pem -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_IP " + echo 'AS_ADMIN_PASSWORD=$PAYARA_ADMIN_PASS' > /tmp/payara-admin-pass.txt + if /opt/payara5/bin/asadmin --user admin --passwordfile /tmp/payara-admin-pass.txt list-applications | grep -q '$APP_NAME'; then + echo 'Application is running.' + else + echo 'Application failed to start.' + fi + rm /tmp/payara-admin-pass.txt + " + + # Check if the application is reachable + for i in {1..5}; do + RESPONSE_CODE=$(curl -s -o /dev/null -w "%{http_code}" https://$SUBDOMAIN.carecode.org/$APP_NAME/faces/index1.xhtml) + if [ "$RESPONSE_CODE" == "200" ]; then + echo "Application is reachable and healthy." + break + elif [ "$i" == "5" ]; then + echo "Application is not reachable or unhealthy at https://$SUBDOMAIN.carecode.org/$APP_NAME (HTTP $RESPONSE_CODE)" + break + fi + sleep 10 + done + + # Cleanup + rm -f private_key.pem From d21192c49085cb2f59c0f05caaab6af5630f2b9f Mon Sep 17 00:00:00 2001 From: Imesh Ranawella Date: Mon, 17 Feb 2025 22:17:31 +0530 Subject: [PATCH 16/25] closing stock report issue fix (#10605) Co-authored-by: imexh --- .../bean/report/PharmacyReportController.java | 14 +++++++++----- .../inventoryReports/closing_stock_report.xhtml | 14 ++------------ 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/main/java/com/divudi/bean/report/PharmacyReportController.java b/src/main/java/com/divudi/bean/report/PharmacyReportController.java index 53a73ad91e..1999111bb7 100644 --- a/src/main/java/com/divudi/bean/report/PharmacyReportController.java +++ b/src/main/java/com/divudi/bean/report/PharmacyReportController.java @@ -2009,6 +2009,11 @@ public void processStockLedgerReport() { } public void processClosingStockReport() { + stockSaleValue = 0.0; + stockQty = 0.0; + stockPurchaseValue = 0.0; + stockTotal = 0.0; + List ids; Map params = new HashMap<>(); StringBuilder jpql = new StringBuilder("select MAX(sh.id) " @@ -2058,7 +2063,6 @@ public void processClosingStockReport() { ids = getStockFacade().findLongValuesByJpql(jpql.toString(), params, TemporalType.TIMESTAMP); - // Calculate purchase and sale values stockPurchaseValue = 0.0; stockSaleValue = 0.0; stockTotal = 0.0; @@ -2088,8 +2092,8 @@ public void processClosingStockReport() { } if (reportType.equalsIgnoreCase("itemWise")) { - setStockSaleValue(0.0); - setStockQty(0.0); + stockPurchaseValue = 0.0; + stockQty = 0.0; Map map = new HashMap<>(); @@ -2106,7 +2110,7 @@ public void processClosingStockReport() { pr.getStockHistory().setStockSaleValue(pr.getStockHistory().getStockSaleValue() + row.getStockHistory().getStockQty() * row.getStockHistory().getItemBatch().getRetailsaleRate()); - setStockSaleValue(getStockSaleValue() + row.getStockHistory().getStockQty() * row.getStockHistory().getItemBatch().getRetailsaleRate()); + setStockPurchaseValue(getStockPurchaseValue() + row.getStockHistory().getStockQty() * row.getStockHistory().getItemBatch().getPurcahseRate()); } else { if (row.getStockHistory().getStockQty() == 0.0) { continue; @@ -2118,7 +2122,7 @@ public void processClosingStockReport() { row.getStockHistory().getStockQty() * row.getStockHistory().getItemBatch().getRetailsaleRate()); setStockQty(getStockQty() + row.getStockHistory().getStockQty()); - setStockSaleValue(getStockSaleValue() + row.getStockHistory().getStockQty() * row.getStockHistory().getItemBatch().getRetailsaleRate()); + setStockPurchaseValue(getStockPurchaseValue() + row.getStockHistory().getStockQty() * row.getStockHistory().getItemBatch().getPurcahseRate()); } } diff --git a/src/main/webapp/reports/inventoryReports/closing_stock_report.xhtml b/src/main/webapp/reports/inventoryReports/closing_stock_report.xhtml index 745a056758..f7a95a63b1 100644 --- a/src/main/webapp/reports/inventoryReports/closing_stock_report.xhtml +++ b/src/main/webapp/reports/inventoryReports/closing_stock_report.xhtml @@ -292,16 +292,6 @@ - - - @@ -380,11 +370,11 @@ + value="#{p.stockHistory.stockQty * p.stockHistory.itemBatch.purcahseRate}"> - + From a42ae646deed5b8bbdd642fdfe28b68bec61b4ea Mon Sep 17 00:00:00 2001 From: Pasindu Wathsara <113449846+PasinduW99@users.noreply.github.com> Date: Mon, 17 Feb 2025 22:19:36 +0530 Subject: [PATCH 17/25] Signed-off-by: PasinduW99 (#10604) --- .../pharmacy/pharmacy_report_grn_detail.xhtml | 403 +++++++++--------- 1 file changed, 213 insertions(+), 190 deletions(-) diff --git a/src/main/webapp/pharmacy/pharmacy_report_grn_detail.xhtml b/src/main/webapp/pharmacy/pharmacy_report_grn_detail.xhtml index bd2d17fe00..d02548e473 100644 --- a/src/main/webapp/pharmacy/pharmacy_report_grn_detail.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_report_grn_detail.xhtml @@ -31,8 +31,8 @@ forceSelection="true" rendered="true" requiredMessage="You must select a department" > - - + + + /> @@ -79,7 +79,7 @@ - + @@ -101,6 +101,8 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -263,131 +269,138 @@ - + - + - - + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -401,8 +414,9 @@ - @@ -411,51 +425,53 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -463,83 +479,83 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -552,126 +568,128 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -685,21 +703,26 @@ - + Summary - - + + - - + + - - - + + + From e44b87f7b9a0990d5809f13c62dc3963a5d86efe Mon Sep 17 00:00:00 2001 From: Pasindu Wathsara <113449846+PasinduW99@users.noreply.github.com> Date: Mon, 17 Feb 2025 22:45:39 +0530 Subject: [PATCH 18/25] #10599 excel improvements pharmacy analytics reports (#10606) * Closes #10559 Signed-off-by: Dr M H Buddhika Ariyaratne * Signed-off-by: PasinduW99 * Signed-off-by: PasinduW99 * Signed-off-by: PasinduW99 --------- Signed-off-by: Dr M H Buddhika Ariyaratne Co-authored-by: Dr M H Buddhika Ariyaratne --- .../pharmacy_report_bht_issue_bill.xhtml | 3 +- .../pharmacy_report_transfer_issue_bill.xhtml | 47 ++++++------------- ...harmacy_report_transfer_receive_bill.xhtml | 2 +- 3 files changed, 16 insertions(+), 36 deletions(-) diff --git a/src/main/webapp/pharmacy/pharmacy_report_bht_issue_bill.xhtml b/src/main/webapp/pharmacy/pharmacy_report_bht_issue_bill.xhtml index fb25306624..b9cff0bb70 100644 --- a/src/main/webapp/pharmacy/pharmacy_report_bht_issue_bill.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_report_bht_issue_bill.xhtml @@ -55,7 +55,7 @@ value="Excel" icon="fas fa-file-excel" class="ui-button-success mx-2"> - + - #{i.billType} diff --git a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml index 388a1b7a73..48f7310a5e 100644 --- a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml +++ b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml @@ -16,39 +16,23 @@ - + - - + - - + - + - - + - + - + - + -
diff --git a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_receive_bill.xhtml b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_receive_bill.xhtml index d8d7b21fb7..ad13146fca 100644 --- a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_receive_bill.xhtml +++ b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_receive_bill.xhtml @@ -42,7 +42,7 @@ value="Excel" icon="fas fa-file-excel" class="ui-button-success mx-2"> - + Date: Tue, 18 Feb 2025 00:46:39 +0530 Subject: [PATCH 19/25] Signed-off-by: pubudu piyankara (#10607) --- src/main/webapp/pharmacy/pharmacy_bill_retail_sale.xhtml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/pharmacy/pharmacy_bill_retail_sale.xhtml b/src/main/webapp/pharmacy/pharmacy_bill_retail_sale.xhtml index deed4919d0..362bc7d3af 100644 --- a/src/main/webapp/pharmacy/pharmacy_bill_retail_sale.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_bill_retail_sale.xhtml @@ -1295,7 +1295,12 @@
- + + +
+ +
+
From 98e65c4b6e902ec61ad794763bba777e4424c0a7 Mon Sep 17 00:00:00 2001 From: "Dr. M H B Ariyaratne" Date: Tue, 18 Feb 2025 06:53:07 +0530 Subject: [PATCH 20/25] 10593 iou should support for supplier payments (#10608) --- .../divudi/bean/common/EnumController.java | 9 +++ src/main/java/com/divudi/entity/Payment.java | 12 ++++ .../com/divudi/service/PaymentService.java | 6 ++ .../resources/META-INF/.LCKpersistence.xml~ | 1 - .../webapp/dealerPayment/dealor_due.xhtml | 15 +++-- .../webapp/dealerPayment/pay_supplier.xhtml | 22 ++++--- .../settle_supplier_payment.xhtml | 14 +++-- .../pharmacy_report_transfer_issue_bill.xhtml | 2 +- .../webapp/resources/paymentMethod/iou.xhtml | 61 +++++++++++++++++++ 9 files changed, 124 insertions(+), 18 deletions(-) delete mode 100644 src/main/resources/META-INF/.LCKpersistence.xml~ create mode 100644 src/main/webapp/resources/paymentMethod/iou.xhtml diff --git a/src/main/java/com/divudi/bean/common/EnumController.java b/src/main/java/com/divudi/bean/common/EnumController.java index 16b4ffef1d..b0fd19a49e 100644 --- a/src/main/java/com/divudi/bean/common/EnumController.java +++ b/src/main/java/com/divudi/bean/common/EnumController.java @@ -819,6 +819,15 @@ public PaymentMethod[] getPaymentMethodsWithoutCredit() { PaymentMethod.ewallet}; return p; } + + public PaymentMethod[] getPaymentMethodsForSupplierPayments() { + PaymentMethod[] p = {PaymentMethod.Cash, + PaymentMethod.Card, + PaymentMethod.Cheque, + PaymentMethod.Slip, + PaymentMethod.IOU}; + return p; + } public PaymentMethod[] getPaymentMethodsForIwardDeposit() { PaymentMethod[] p = {PaymentMethod.Cash, diff --git a/src/main/java/com/divudi/entity/Payment.java b/src/main/java/com/divudi/entity/Payment.java index 193e40d7e8..a199a957f4 100644 --- a/src/main/java/com/divudi/entity/Payment.java +++ b/src/main/java/com/divudi/entity/Payment.java @@ -204,6 +204,10 @@ public class Payment implements Serializable, RetirableEntity { private Institution fromInstitution; @ManyToOne private Institution toInstitution; + + private Staff toStaff; + + public Payment() { cashbookEntryStated = false; @@ -956,4 +960,12 @@ public void setCreditCompany(Institution creditCompany) { this.creditCompany = creditCompany; } + public Staff getToStaff() { + return toStaff; + } + + public void setToStaff(Staff toStaff) { + this.toStaff = toStaff; + } + } diff --git a/src/main/java/com/divudi/service/PaymentService.java b/src/main/java/com/divudi/service/PaymentService.java index 329ac9bb4c..bdd79fbea9 100644 --- a/src/main/java/com/divudi/service/PaymentService.java +++ b/src/main/java/com/divudi/service/PaymentService.java @@ -249,6 +249,12 @@ private void populatePaymentDetails(Payment payment, PaymentMethod paymentMethod payment.setPaidValue(paymentMethodData.getStaffCredit().getTotalValue()); payment.setComments(paymentMethodData.getStaffCredit().getComment()); break; + case IOU: + payment.setReferenceNo(paymentMethodData.getIou().getReferenceNo()); + payment.setChequeDate(paymentMethodData.getIou().getDate()); + payment.setToStaff(paymentMethodData.getIou().getToStaff()); + payment.setComments(paymentMethodData.getIou().getComment()); + break; default: break; } diff --git a/src/main/resources/META-INF/.LCKpersistence.xml~ b/src/main/resources/META-INF/.LCKpersistence.xml~ deleted file mode 100644 index e4d2437f6c..0000000000 --- a/src/main/resources/META-INF/.LCKpersistence.xml~ +++ /dev/null @@ -1 +0,0 @@ -D:\Development\rh\src\main\resources\META-INF\persistence.xml \ No newline at end of file diff --git a/src/main/webapp/dealerPayment/dealor_due.xhtml b/src/main/webapp/dealerPayment/dealor_due.xhtml index d1fdfdbfbc..3867f55305 100644 --- a/src/main/webapp/dealerPayment/dealor_due.xhtml +++ b/src/main/webapp/dealerPayment/dealor_due.xhtml @@ -179,20 +179,25 @@ - + + ajax="false"> + disabled="#{b.referenceBill.billTypeAtomic eq 'SUPPLIER_PAYMENT' or b.paidAmount ne 0.0}"> + diff --git a/src/main/webapp/dealerPayment/pay_supplier.xhtml b/src/main/webapp/dealerPayment/pay_supplier.xhtml index e4fbe7a920..8b645158cc 100644 --- a/src/main/webapp/dealerPayment/pay_supplier.xhtml +++ b/src/main/webapp/dealerPayment/pay_supplier.xhtml @@ -72,7 +72,7 @@ - + + + - - + + + + + + - - + + - - + + + + diff --git a/src/main/webapp/dealerPayment/settle_supplier_payment.xhtml b/src/main/webapp/dealerPayment/settle_supplier_payment.xhtml index ba0515f9a9..ee6835e8f0 100644 --- a/src/main/webapp/dealerPayment/settle_supplier_payment.xhtml +++ b/src/main/webapp/dealerPayment/settle_supplier_payment.xhtml @@ -35,7 +35,7 @@ - + - + - + - + + + + + + + diff --git a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml index 48f7310a5e..c5b5db654a 100644 --- a/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml +++ b/src/main/webapp/pharmacy/reports/disbursement_reports/pharmacy_report_transfer_issue_bill.xhtml @@ -1,5 +1,5 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 2085dc452f2b0cf4341f2b8904fd103fd8bd3942 Mon Sep 17 00:00:00 2001 From: Imesh Ranawella Date: Tue, 18 Feb 2025 10:38:25 +0530 Subject: [PATCH 21/25] 10555 consumption report bugfixes (#10610) * consumption report issue 1 fix * consumption report issue 2 & 3 fix --------- Co-authored-by: imexh --- .../bean/pharmacy/PharmacyController.java | 20 ++++++++++++------- .../inventoryReports/consumption.xhtml | 6 +++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java b/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java index 6fac8e355b..67be8802e2 100644 --- a/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java +++ b/src/main/java/com/divudi/bean/pharmacy/PharmacyController.java @@ -21,13 +21,7 @@ import com.divudi.data.dataStructure.ItemTransactionSummeryRow; import com.divudi.data.dataStructure.StockAverage; -import com.divudi.entity.Bill; -import com.divudi.entity.BillItem; -import com.divudi.entity.BilledBill; -import com.divudi.entity.Category; -import com.divudi.entity.Department; -import com.divudi.entity.Institution; -import com.divudi.entity.Item; +import com.divudi.entity.*; import com.divudi.entity.pharmacy.Amp; import com.divudi.entity.pharmacy.Ampp; import com.divudi.entity.pharmacy.Atm; @@ -972,6 +966,18 @@ public void generateGrnReportTable() { calculateTotals(bills); } + public static String formatDate(Date date) { + if (date == null) { + return ""; + } + + UserPreference userPreference = new UserPreference(); + String pattern = userPreference.getLongDateTimeFormat(); + + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + return sdf.format(date); + } + public void createConsumptionReportTable() { resetFields(); diff --git a/src/main/webapp/reports/inventoryReports/consumption.xhtml b/src/main/webapp/reports/inventoryReports/consumption.xhtml index 9959ee70ee..90651b2694 100644 --- a/src/main/webapp/reports/inventoryReports/consumption.xhtml +++ b/src/main/webapp/reports/inventoryReports/consumption.xhtml @@ -384,14 +384,14 @@ width="6em" filterMatchMode="contains" sortBy="#{b.createdAt}" - filterBy="#{b.createdAt}"> + filterBy="#{pharmacyController.formatDate(b.createdAt)}"> - + @@ -509,7 +509,7 @@ width="8em" filterMatchMode="contains" sortBy="#{i.bill.createdAt}" - filterBy="#{i.bill.createdAt}"> + filterBy="#{pharmacyController.formatDate(i.bill.createdAt)}"> From 04074707b2e38975ec08a481fd56c857177b0f7e Mon Sep 17 00:00:00 2001 From: Sandith Pivithuru <114053279+SandithP2001@users.noreply.github.com> Date: Tue, 18 Feb 2025 11:37:25 +0530 Subject: [PATCH 22/25] 10612 first one of the report list should displayed as grn summary button (#10613) --- src/main/webapp/pharmacy/pharmacy_analytics.xhtml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/pharmacy/pharmacy_analytics.xhtml b/src/main/webapp/pharmacy/pharmacy_analytics.xhtml index fe11727350..d706e448ab 100644 --- a/src/main/webapp/pharmacy/pharmacy_analytics.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_analytics.xhtml @@ -206,6 +206,7 @@
+ @@ -213,9 +214,7 @@ - - + Date: Tue, 18 Feb 2025 12:27:41 +0530 Subject: [PATCH 23/25] 10615 should need to change the font (#10616) --- .../pharmacy/pharmacy_report_grn_detail.xhtml | 648 +++++++++++++++++- 1 file changed, 639 insertions(+), 9 deletions(-) diff --git a/src/main/webapp/pharmacy/pharmacy_report_grn_detail.xhtml b/src/main/webapp/pharmacy/pharmacy_report_grn_detail.xhtml index d02548e473..0c22735949 100644 --- a/src/main/webapp/pharmacy/pharmacy_report_grn_detail.xhtml +++ b/src/main/webapp/pharmacy/pharmacy_report_grn_detail.xhtml @@ -78,8 +78,8 @@ - - + + @@ -101,6 +101,634 @@ + + +    + + + +      + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Summary + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + - + @@ -228,7 +856,7 @@ - + @@ -270,7 +898,7 @@ - - @@ -704,7 +1332,7 @@ + + From bea77b7c5dd20a2220ffa572b6069b036753600f Mon Sep 17 00:00:00 2001 From: Imesh Ranawella Date: Tue, 18 Feb 2025 14:04:26 +0530 Subject: [PATCH 24/25] 10402 external laboratory workload report (#10617) * external laboratory workload report issue fix * External Laboratory workload report fix --------- Co-authored-by: imexh --- .../divudi/bean/common/ReportsController.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/divudi/bean/common/ReportsController.java b/src/main/java/com/divudi/bean/common/ReportsController.java index 2a847b5221..80e8451438 100644 --- a/src/main/java/com/divudi/bean/common/ReportsController.java +++ b/src/main/java/com/divudi/bean/common/ReportsController.java @@ -61,6 +61,7 @@ import java.text.SimpleDateFormat; import java.util.stream.Collectors; import java.text.DecimalFormat; + import org.apache.poi.xssf.usermodel.XSSFCellStyle; /** @@ -2650,7 +2651,7 @@ public void generateDebtorBalanceReport(final boolean onlyDueBills) { } public ReportTemplateRowBundle generateDebtorBalanceReportBills(List bts, List billPaymentMethods, - boolean onlyDueBills) { + boolean onlyDueBills) { Map parameters = new HashMap<>(); String jpql = "SELECT new com.divudi.data.ReportTemplateRow(bill) " + "FROM Bill bill " @@ -3247,9 +3248,12 @@ private ReportTemplateRowBundle generateExternalLaboratoryWorkloadBillItems(List parameters.put("bts", bts); if (visitType != null) { - if (visitType.equalsIgnoreCase("IP") || visitType.equalsIgnoreCase("OP") || visitType.equalsIgnoreCase("CC")) { + if (visitType.equalsIgnoreCase("IP") || visitType.equalsIgnoreCase("CC")) { jpql += "AND bill.ipOpOrCc = :type "; parameters.put("type", visitType); + } else if (visitType.equalsIgnoreCase("OP")) { + jpql += "AND (bill.ipOpOrCc = :type OR bill.ipOpOrCc IS NULL) "; + parameters.put("type", visitType); } } @@ -3343,9 +3347,12 @@ private ReportTemplateRowBundle generateExternalLaboratoryWorkloadSummaryBillIte + "AND bill.createdAt BETWEEN :fd AND :td "; if (visitType != null) { - if (visitType.equalsIgnoreCase("IP") || visitType.equalsIgnoreCase("OP") || visitType.equalsIgnoreCase("CC")) { + if (visitType.equalsIgnoreCase("IP") || visitType.equalsIgnoreCase("CC")) { jpql += "AND bill.ipOpOrCc = :type "; parameters.put("type", visitType); + } else if (visitType.equalsIgnoreCase("OP")) { + jpql += "AND (bill.ipOpOrCc = :type OR bill.ipOpOrCc IS NULL) "; + parameters.put("type", visitType); } } @@ -3594,7 +3601,7 @@ public void exportOpdAndInwardOPToPdf() { table.setWidths(columnWidths); String[] headers = {"S. No", "Invoice Date", "Invoice No", "Customer Reference No", "MRNO", "Patient Name", - "Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"}; + "Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, boldFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); @@ -3817,7 +3824,7 @@ public void exportOpdAndInwardIPToPdf() { table.setWidths(columnWidths); String[] headers = {"S. No", "BHT No", "Invoice Date", "Invoice No", "Customer Reference No", "MRNO", "Patient Name", - "Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"}; + "Gross Amt", "Disc Amt", "Net Amt", "Patient Share", "Sponsor Share", "Due Amt"}; for (String header : headers) { PdfPCell cell = new PdfPCell(new Phrase(header, boldFont)); cell.setHorizontalAlignment(Element.ALIGN_CENTER); @@ -4859,8 +4866,8 @@ public void exportDetailedWeeklyOPDReportToPDF() { } private void addWeeklyReportSection(Document document, String sectionTitle, List itemList, - List daysOfWeek, Map>> weeklyDailyBillItemMap, - int week, com.itextpdf.text.Font headerFont, com.itextpdf.text.Font regularFont) throws DocumentException { + List daysOfWeek, Map>> weeklyDailyBillItemMap, + int week, com.itextpdf.text.Font headerFont, com.itextpdf.text.Font regularFont) throws DocumentException { document.add(new com.itextpdf.text.Paragraph(sectionTitle, headerFont)); document.add(com.itextpdf.text.Chunk.NEWLINE); From fd00a630a9331ce2d25044ed2bd3ad22403c10d7 Mon Sep 17 00:00:00 2001 From: Pubudu Piyankara <139697238+Pubudu-Piyankara@users.noreply.github.com> Date: Tue, 18 Feb 2025 23:24:29 +0530 Subject: [PATCH 25/25] #10583 stock ledger improvement (#10623) * Signed-off-by: pubudu piyankara * Signed-off-by: pubudu piyankara * Signed-off-by: pubudu piyankara --- .../pharmacy/TransferIssueController.java | 4 +- .../pharmacy/TransferReceiveController.java | 2 +- .../bean/report/PharmacyReportController.java | 3 ++ .../java/com/divudi/ejb/PharmacyBean.java | 49 ------------------- 4 files changed, 6 insertions(+), 52 deletions(-) diff --git a/src/main/java/com/divudi/bean/pharmacy/TransferIssueController.java b/src/main/java/com/divudi/bean/pharmacy/TransferIssueController.java index c7f0a8b651..39be24681a 100644 --- a/src/main/java/com/divudi/bean/pharmacy/TransferIssueController.java +++ b/src/main/java/com/divudi/bean/pharmacy/TransferIssueController.java @@ -487,7 +487,7 @@ public void settleDirectIssue() { //Addinng Staff // System.out.println("//Addinng Staff = "); System.out.println(i.getPharmaceuticalBillItem() + " 1 " + i.getPharmaceuticalBillItem().getQtyInUnit() + " " + getIssuedBill().getToStaff()); - Stock staffStock = pharmacyBean.addToStockWihtoutStockHistory(i.getPharmaceuticalBillItem(), + Stock staffStock = pharmacyBean.addToStock(i.getPharmaceuticalBillItem(), Math.abs(i.getPharmaceuticalBillItem().getQtyInUnit()), getIssuedBill().getToStaff()); i.getPharmaceuticalBillItem().setStaffStock(staffStock); @@ -611,7 +611,7 @@ public void settle() { if (returnFlag) { //Addinng Staff - Stock staffStock = pharmacyBean.addToStockWihtoutStockHistory(i.getPharmaceuticalBillItem(), + Stock staffStock = pharmacyBean.addToStock(i.getPharmaceuticalBillItem(), Math.abs(i.getPharmaceuticalBillItem().getQtyInUnit()), getIssuedBill().getToStaff()); i.getPharmaceuticalBillItem().setStaffStock(staffStock); diff --git a/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java b/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java index 1a01c906ec..51d390de96 100644 --- a/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java +++ b/src/main/java/com/divudi/bean/pharmacy/TransferReceiveController.java @@ -224,7 +224,7 @@ public void settle() { double qty = Math.abs(i.getPharmaceuticalBillItem().getQtyInUnit()); // Deduct Staff Stock - boolean returnFlag = getPharmacyBean().deductFromStockWithoutStockHistory(tmpPh, Math.abs(qty), getIssuedBill().getToStaff()); + boolean returnFlag = getPharmacyBean().deductFromStock(tmpPh, Math.abs(qty), getIssuedBill().getToStaff()); if (returnFlag) { // Add Stock To Department diff --git a/src/main/java/com/divudi/bean/report/PharmacyReportController.java b/src/main/java/com/divudi/bean/report/PharmacyReportController.java index 1999111bb7..04e1204d3c 100644 --- a/src/main/java/com/divudi/bean/report/PharmacyReportController.java +++ b/src/main/java/com/divudi/bean/report/PharmacyReportController.java @@ -2003,6 +2003,9 @@ public void processStockLedgerReport() { jpql += "and s.item=:itm "; m.put("itm", item); } + if ("transferReceiveDoc".equals(documentType) || "transferIssueDoc".equals(documentType)) { + jpql += " and s.department IS NOT NULL "; + } jpql += " order by s.createdAt "; stockLedgerHistories = facade.findByJpql(jpql, m, TemporalType.TIMESTAMP); diff --git a/src/main/java/com/divudi/ejb/PharmacyBean.java b/src/main/java/com/divudi/ejb/PharmacyBean.java index 938b30aece..9afaf1aaef 100644 --- a/src/main/java/com/divudi/ejb/PharmacyBean.java +++ b/src/main/java/com/divudi/ejb/PharmacyBean.java @@ -472,28 +472,6 @@ public Stock addToStock(PharmaceuticalBillItem pharmaceuticalBillItem, double qt return s; } - public Stock addToStockWihtoutStockHistory(PharmaceuticalBillItem pharmaceuticalBillItem, double qty, Staff staff) { - String sql; - HashMap hm = new HashMap(); - sql = "Select s from Stock s where s.itemBatch=:bc and s.staff=:stf"; - hm.put("bc", pharmaceuticalBillItem.getItemBatch()); - hm.put("stf", staff); - Stock s = getStockFacade().findFirstByJpql(sql, hm); - if (s == null) { - s = new Stock(); - s.setStaff(staff); - s.setItemBatch(pharmaceuticalBillItem.getItemBatch()); - } - if (s.getId() == null || s.getId() == 0) { - s.setStock(s.getStock() + qty); - getStockFacade().create(s); - } else { - s.setStock(s.getStock() + qty); - getStockFacade().edit(s); - } - return s; - } - public Stock addToStock(PharmaceuticalBillItem pharmaceuticalBillItem, double qty, Department department) { String sql; HashMap hm = new HashMap(); @@ -578,33 +556,6 @@ public boolean deductFromStock(PharmaceuticalBillItem pharmaceuticalBillItem, do return true; } - public boolean deductFromStockWithoutStockHistory(PharmaceuticalBillItem pharmaceuticalBillItem, double qty, Staff staff) { - String sql; - HashMap hm = new HashMap(); - sql = "Select s from Stock s where s.itemBatch=:batch " - + "and s.staff=:stf"; - hm.put("batch", pharmaceuticalBillItem.getItemBatch()); - hm.put("stf", staff); - Stock s = getStockFacade().findFirstByJpql(sql, hm); - if (s == null) { - s = new Stock(); - s.setStaff(staff); - s.setItemBatch(pharmaceuticalBillItem.getItemBatch()); - } - if (s.getStock() < qty) { - return false; - } - - if (s.getId() == null || s.getId() == 0) { - s.setStock(s.getStock() - qty); - getStockFacade().create(s); - } else { - s.setStock(s.getStock() - qty); - getStockFacade().edit(s); - } - return true; - } - public boolean deductFromStock(ItemBatch batch, double qty, Department department, boolean minusAllowed) { if (!minusAllowed) { return deductFromStock(batch, qty, department);