From 71e1e414f0c19ba78103a688d662fbe4dc5af389 Mon Sep 17 00:00:00 2001 From: buddhika75 Date: Thu, 25 Jul 2024 21:20:23 +0530 Subject: [PATCH 1/6] Closes #6603 Signed-off-by: buddhika75 --- .../FinancialTransactionController.java | 93 ++++++++++ .../java/com/divudi/data/BillTypeAtomic.java | 25 +-- .../com/divudi/data/CountedServiceType.java | 11 +- .../java/com/divudi/data/ServiceType.java | 1 + ...ift_end_report_bill_of_selected_user.xhtml | 169 +----------------- 5 files changed, 121 insertions(+), 178 deletions(-) diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java index bf67496b4e..b5120ee028 100644 --- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java +++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java @@ -277,6 +277,76 @@ public ReportTemplateRowBundle addChannellingByCategories( return bundle; } + + + public ReportTemplateRowBundle addProfessionalPayments( + ReportTemplateType type, + List btas, + Date paramDate, + Date paramFromDate, + Date paramToDate, + Institution paramInstitution, + Department paramDepartment, + Institution paramFromInstitution, + Department paramFromDepartment, + Institution paramToInstitution, + Department paramToDepartment, + WebUser paramUser, + Institution paramCreditCompany, + Long paramStartId, + Long paramEndId) { + System.out.println("addOpdByDepartments"); + + ReportTemplateRowBundle bundle; + List inBts = BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD_IN); + List outBts = BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD_OUT); + + ReportTemplateRowBundle ins = reportTemplateController.generateReport( + type, + inBts, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); + + System.out.println("ins = " + ins.getReportTemplateRows().size()); + + ReportTemplateRowBundle outs = reportTemplateController.generateReport( + type, + outBts, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId); + + System.out.println("outes = " + outs.getReportTemplateRows().size()); + + bundle = combineBundlesByItemDepartment(ins, outs); + + return bundle; + } + + + + public ReportTemplateRowBundle addOpdByDepartments( ReportTemplateType type, List btas, @@ -346,6 +416,8 @@ public void processShiftEndReport() { shiftEndBundles = new ArrayList<>(); ReportTemplateType channelingType = ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL; ReportTemplateType opdType = ReportTemplateType.ITEM_DEPARTMENT_SUMMARY_BY_BILL_ITEM; + ReportTemplateType paymentsType = ReportTemplateType.BILL_TYPE_ATOMIC_SUMMARY_USING_BILLS; + List btas = null; Date paramDate = null; Date paramFromDate = null; @@ -397,11 +469,32 @@ public void processShiftEndReport() { paramStartId, paramEndId ); + + ReportTemplateRowBundle tmpPaymentBundle + = addProfessionalPayments( + paymentsType, + btas, + paramDate, + paramFromDate, + paramToDate, + paramInstitution, + paramDepartment, + paramFromInstitution, + paramFromDepartment, + paramToInstitution, + paramToDepartment, + paramUser, + paramCreditCompany, + paramStartId, + paramEndId + ); tmpChannellingBundle.setName("Channelling"); tmpOpdBundle.setName("OPD"); + tmpPaymentBundle.setName("Payments"); shiftEndBundles.add(tmpChannellingBundle); shiftEndBundles.add(tmpOpdBundle); + shiftEndBundles.add(tmpPaymentBundle); } diff --git a/src/main/java/com/divudi/data/BillTypeAtomic.java b/src/main/java/com/divudi/data/BillTypeAtomic.java index 4b6e48a62a..3aaeabd5c2 100644 --- a/src/main/java/com/divudi/data/BillTypeAtomic.java +++ b/src/main/java/com/divudi/data/BillTypeAtomic.java @@ -5,8 +5,8 @@ import java.util.stream.Collectors; /** - * Enumerates types of bills for atomic billing purposes. - * Includes categorization by service type and finance type. + * Enumerates types of bills for atomic billing purposes. Includes + * categorization by service type and finance type. */ public enum BillTypeAtomic { @@ -120,7 +120,8 @@ public enum BillTypeAtomic { OPD_BILL_CANCELLATION("Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_OUT), OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_OUT), OPD_BILL_REFUND("Opd Bill Refund", BillCategory.REFUND, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_OUT), - OPD_PROFESSIONAL_PAYMENT_BILL("OPD Professional Payment bill", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_PROFESSIONAL_PAYMENT), + OPD_PROFESSIONAL_PAYMENT_BILL("OPD Professional Payment bill", BillCategory.PAYMENTS, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_PROFESSIONAL_PAYMENT), + OPD_PROFESSIONAL_PAYMENT_BILL_RETURN("OPD Professional Payment bill", BillCategory.PAYMENTS, ServiceType.OPD, BillFinanceType.CASH_IN, CountedServiceType.OPD_PROFESSIONAL_PAYMENT_RETURN), @Deprecated OPD_BILL_WITH_PAYMENT_UNDER_BATCH_BILL("OPD Bill with payment under batch bill", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD_IN), // PACKAGES @@ -154,11 +155,15 @@ public enum BillTypeAtomic { FUND_WITHDRAWAL_BILL("Withdrawal Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.BANK_IN, CountedServiceType.OTHER), FUND_WITHDRAWAL_BILL_CANCELLED("Withdrawal Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.BANK_OUT, CountedServiceType.OTHER), // PROFESSIONAL PAYMENTS - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_INWARD_SERVICE("Inward Payment for Staff", BillCategory.PAYMENTS, ServiceType.INWARD, BillFinanceType.CASH_IN, CountedServiceType.INWARD), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE("Channelling Payment for Staff", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_SESSION("Channelling session Payment for Staff", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_FOR_AGENCIES("Channelling Payment for Staff for agencies", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER), - PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_OPD_SERVICES("OPD Professional Payment bill", BillCategory.PAYMENTS, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_IN), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_INWARD_SERVICE("Inward Payment for Staff", BillCategory.PAYMENTS, ServiceType.INWARD, BillFinanceType.CASH_IN, CountedServiceType.INWARD_PROFESSIONAL_PAYMENT), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE("Channelling Payment for Staff", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING_PROFESSIONAL_PAYMENT), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_SESSION("Channelling session Payment for Staff", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING_PROFESSIONAL_PAYMENT), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_FOR_AGENCIES("Channelling Payment for Staff for agencies", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER_PROFESSIONAL_PAYMENT), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_OPD_SERVICES("OPD Professional Payment bill", BillCategory.PAYMENTS, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD_PROFESSIONAL_PAYMENT_RETURN), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_INWARD_SERVICE_RETURN("Inward Payment for Staff - Return and Cancellation", BillCategory.PAYMENTS, ServiceType.INWARD, BillFinanceType.CASH_OUT, CountedServiceType.INWARD_PROFESSIONAL_PAYMENT_RETURN), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_RETURN("Channelling Payment for Staff - Return and Cancellation", BillCategory.PAYMENTS, ServiceType.CHANNELLING, BillFinanceType.CASH_IN, CountedServiceType.CHANNELLING_PROFESSIONAL_PAYMENT_RETURN), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_FOR_AGENCIES_RETURN("Channelling Payment for Staff for agencies - Return and Cancellation", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_OUT, CountedServiceType.OTHER), + PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_OPD_SERVICES_RETURN("OPD Professional Payment bill - Return and Cancellation", BillCategory.PAYMENTS, ServiceType.OPD, BillFinanceType.CASH_IN, CountedServiceType.OPD_PROFESSIONAL_PAYMENT_RETURN), PETTY_CASH_ISSUE("Petty Cash Issue", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_OUT, CountedServiceType.OTHER), PETTY_CASH_RETURN("Petty Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER), IOU_CASH_ISSUE("Iou Cash Issue", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_OUT, CountedServiceType.OTHER), @@ -218,7 +223,7 @@ public static List findByServiceType(ServiceType serviceType) { .filter(e -> e.getServiceType() == serviceType) .collect(Collectors.toList()); } - + // Method to find BillTypeAtomic by ServiceType public static List findByCountedServiceType(CountedServiceType counterServiceType) { return Arrays.stream(BillTypeAtomic.values()) @@ -232,7 +237,7 @@ public static List findByServiceTypeAndFinanceType(ServiceType s .filter(e -> e.getServiceType() == serviceType && e.getBillFinanceType() == financeType) .collect(Collectors.toList()); } - + // Method to find BillTypeAtomic by ServiceType and BillCategory public static List findBillTypeAtomic(ServiceType serviceType, BillCategory billCategory) { return Arrays.stream(BillTypeAtomic.values()) diff --git a/src/main/java/com/divudi/data/CountedServiceType.java b/src/main/java/com/divudi/data/CountedServiceType.java index cbcebd617c..a93cff776d 100644 --- a/src/main/java/com/divudi/data/CountedServiceType.java +++ b/src/main/java/com/divudi/data/CountedServiceType.java @@ -8,13 +8,22 @@ public enum CountedServiceType { OPD_IN("Outpatient Department - Collection"), OPD_OUT("Outpatient Department - Cancellation or Refunds"), OPD_PROFESSIONAL_PAYMENT("Outpatient Department - Professional Payment"), + OPD_PROFESSIONAL_PAYMENT_RETURN("Outpatient Department - Professional Payment Cancellation or Returns"), NONE("NONE"), PHARMACY("Pharmacy"), STORE("Store"), CHANNELLING("Channelling"), + CHANNELLING_PROFESSIONAL_PAYMENT("Channelling Professional Payment"), + CHANNELLING_PROFESSIONAL_PAYMENT_RETURN("Channelling Professional Payment Cancellation or Returns"), + INWARD("Inward"), + INWARD_PROFESSIONAL_PAYMENT("Inward Professional Payment"), + INWARD_PROFESSIONAL_PAYMENT_RETURN("Inward Professional Payment Cancellation or Returns"), COLLECTING_CENTRE("Colelcting Centre"), OTHER("Other"), - INWARD("Inward"); + OTHER_PROFESSIONAL_PAYMENT("Channelling Professional Payment"), + OTHER_PROFESSIONAL_PAYMENT_RETURN("Channelling Professional Payment Cancellation or Returns"), + + ; private final String label; diff --git a/src/main/java/com/divudi/data/ServiceType.java b/src/main/java/com/divudi/data/ServiceType.java index 13cb3d99fb..6bf3e2d242 100644 --- a/src/main/java/com/divudi/data/ServiceType.java +++ b/src/main/java/com/divudi/data/ServiceType.java @@ -6,6 +6,7 @@ public enum ServiceType { OPD("Outpatient Department"), + PROFESSIONAL_PAYMENT("Professional Payment"), PHARMACY("Pharmacy"), STORE("Store"), CHANNELLING("Channelling"), diff --git a/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml b/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml index bbdf25d67b..207feecce3 100644 --- a/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml +++ b/src/main/webapp/cashier/shift_end_report_bill_of_selected_user.xhtml @@ -152,175 +152,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Service - - Collected - - Refunds - - Payments - - Net -
- Channelling on site - - - - - - - - - - - - - - - - -
- Channelling by agent - - - - - - - - - - - - - - - - -
- Channelling by Online - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
+ - #{financialTransactionController.opdByDepartment.reportTemplateRows} + From 2f2c559d9369dd79669e4a6ff4bf0aaa372e9927 Mon Sep 17 00:00:00 2001 From: DamithDeshan Date: Fri, 26 Jul 2024 00:42:04 +0530 Subject: [PATCH 2/6] Signed-off-by: DamithDeshan --- src/main/webapp/resources/ezcomp/prints/posOpdBill.xhtml | 7 +++++++ .../resources/ezcomp/prints/posOpdBillWithoutLogo.xhtml | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/main/webapp/resources/ezcomp/prints/posOpdBill.xhtml b/src/main/webapp/resources/ezcomp/prints/posOpdBill.xhtml index 2c0f05e2a3..17d25af73b 100644 --- a/src/main/webapp/resources/ezcomp/prints/posOpdBill.xhtml +++ b/src/main/webapp/resources/ezcomp/prints/posOpdBill.xhtml @@ -453,6 +453,13 @@ + + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+
+ + +
+ + +
+