diff --git a/pom.xml b/pom.xml
index 65afc125dc..dca45d2719 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,10 +3,10 @@
4.0.0
com.divudi
- sethma
+ sethmademo
3.0.0
war
- sethma
+ sethmademo
${project.build.directory}/endorsed
diff --git a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java
index 5e2f98a257..51b327f53d 100644
--- a/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java
+++ b/src/main/java/com/divudi/bean/cashTransaction/FinancialTransactionController.java
@@ -1,5 +1,6 @@
package com.divudi.bean.cashTransaction;
+import com.divudi.bean.channel.analytics.ReportTemplateController;
import java.util.HashMap;
import com.divudi.bean.common.BillController;
import com.divudi.bean.common.BillSearch;
@@ -14,21 +15,29 @@
import com.divudi.facade.PaymentFacade;
import com.divudi.bean.common.util.JsfUtil;
import com.divudi.data.AtomicBillTypeTotals;
+import com.divudi.data.BillCategory;
import com.divudi.data.BillFinanceType;
import com.divudi.data.BillTypeAtomic;
+import com.divudi.data.CountedServiceType;
import com.divudi.data.Denomination;
import com.divudi.data.FinancialReport;
import com.divudi.data.PaymentMethod;
import com.divudi.data.PaymentMethodValues;
-
import com.divudi.data.ReportTemplateRow;
import com.divudi.data.ReportTemplateRowBundle;
+import com.divudi.data.ServiceType;
+import com.divudi.data.analytics.ReportTemplateType;
import com.divudi.data.dataStructure.PaymentMethodData;
+import com.divudi.entity.Category;
+import com.divudi.entity.Item;
import com.divudi.entity.WebUser;
import com.divudi.java.CommonFunctions;
import javax.inject.Named;
import javax.enterprise.context.SessionScoped;
import java.io.Serializable;
+import java.time.Duration;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -36,7 +45,6 @@
import java.util.stream.Collectors;
import javax.ejb.EJB;
import javax.faces.event.AjaxBehaviorEvent;
-import javax.faces.event.ValueChangeEvent;
import javax.inject.Inject;
import javax.persistence.TemporalType;
import org.json.JSONArray;
@@ -61,6 +69,8 @@ public class FinancialTransactionController implements Serializable {
@Inject
SessionController sessionController;
@Inject
+ ReportTemplateController reportTemplateController;
+ @Inject
BillController billController;
@Inject
PaymentController paymentController;
@@ -74,6 +84,21 @@ public class FinancialTransactionController implements Serializable {
//
private Bill currentBill;
+ private ReportTemplateType reportTemplateType;
+ private ReportTemplateRowBundle reportTemplateRowBundle;
+ private ReportTemplateRowBundle opdServiceBundle;
+ private ReportTemplateRowBundle channellingBundle;
+ private ReportTemplateRowBundle opdDocPayment;
+ private ReportTemplateRowBundle channellingDocPayment;
+
+ private ReportTemplateRowBundle opdBilled;
+ private ReportTemplateRowBundle opdReturns;
+ private ReportTemplateRowBundle opdBundle;
+ private ReportTemplateRowBundle channellingBilled;
+ private ReportTemplateRowBundle channellingReturns;
+ private ReportTemplateRowBundle pharmacyBilld;
+ private ReportTemplateRowBundle pharmacyReturned;
+
private Payment currentPayment;
private PaymentMethodData paymentMethodData;
private Payment removingPayment;
@@ -158,6 +183,330 @@ public String navigateToCreateNewInitialFundBill() {
return "/cashier/initial_fund_bill?faces-redirect=true;";
}
+ // Method to calculate duration between two Date objects
+ public String calculateDuration(Date startDate, Date endDate) {
+ if (startDate == null || endDate == null) {
+ return "N/A";
+ }
+
+ LocalDateTime startDateTime = convertToLocalDateTime(startDate);
+ LocalDateTime endDateTime = convertToLocalDateTime(endDate);
+
+ Duration duration = Duration.between(startDateTime, endDateTime);
+ long hours = duration.toHours();
+ long minutes = duration.minusHours(hours).toMinutes();
+
+ return String.format("%d hours, %d minutes", hours, minutes);
+ }
+
+ // Helper method to convert Date to LocalDateTime
+ private LocalDateTime convertToLocalDateTime(Date date) {
+ return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+ }
+
+ public void processShiftEndReport() {
+ channellingBilled = reportTemplateController.generateReport(
+ ReportTemplateType.BILL_NET_TOTAL,
+ BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.CHANNELLING, BillFinanceType.CASH_IN),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ nonClosedShiftStartFundBill.getCreater(),
+ null,
+ nonClosedShiftStartFundBill.getId(),
+ nonClosedShiftStartFundBill.getReferenceBill().getId());
+ channellingReturns = reportTemplateController.generateReport(
+ ReportTemplateType.BILL_NET_TOTAL,
+ BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.CHANNELLING, BillFinanceType.CASH_OUT),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ nonClosedShiftStartFundBill.getCreater(),
+ null,
+ nonClosedShiftStartFundBill.getId(),
+ nonClosedShiftStartFundBill.getReferenceBill().getId());
+ opdBilled = reportTemplateController.generateReport(
+ ReportTemplateType.BILL_NET_TOTAL,
+ BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_IN),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ nonClosedShiftStartFundBill.getCreater(),
+ null,
+ nonClosedShiftStartFundBill.getId(),
+ nonClosedShiftStartFundBill.getReferenceBill().getId());
+ opdReturns = reportTemplateController.generateReport(
+ ReportTemplateType.BILL_NET_TOTAL,
+ BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_OUT),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ nonClosedShiftStartFundBill.getCreater(),
+ null,
+ nonClosedShiftStartFundBill.getId(),
+ nonClosedShiftStartFundBill.getReferenceBill().getId());
+ channellingDocPayment = reportTemplateController.generateReport(
+ ReportTemplateType.BILL_NET_TOTAL,
+ BillTypeAtomic.findBillTypeAtomic(ServiceType.CHANNELLING, BillCategory.PAYMENTS),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ nonClosedShiftStartFundBill.getCreater(),
+ null,
+ nonClosedShiftStartFundBill.getId(),
+ nonClosedShiftStartFundBill.getReferenceBill().getId());
+ opdDocPayment = reportTemplateController.generateReport(
+ ReportTemplateType.BILL_NET_TOTAL,
+ BillTypeAtomic.findBillTypeAtomic(ServiceType.OPD, BillCategory.PAYMENTS),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ nonClosedShiftStartFundBill.getCreater(),
+ null,
+ nonClosedShiftStartFundBill.getId(),
+ nonClosedShiftStartFundBill.getReferenceBill().getId());
+ }
+
+ private ReportTemplateRowBundle combineBundlesByItem(ReportTemplateRowBundle inBundle, ReportTemplateRowBundle outBundle) {
+ ReportTemplateRowBundle temOutBundle = new ReportTemplateRowBundle();
+ Map- combinedRows = new HashMap<>();
+
+ if (inBundle != null && inBundle.getReportTemplateRows() != null) {
+ for (ReportTemplateRow inRow : inBundle.getReportTemplateRows()) {
+ if (inRow != null) {
+ Item item = inRow.getItem();
+ if (item != null) {
+ if (!combinedRows.containsKey(item)) {
+ combinedRows.put(item, new ReportTemplateRow(item));
+ }
+ ReportTemplateRow combinedRow = combinedRows.get(item);
+ combinedRow.setRowCountIn((combinedRow.getRowCountIn() != null ? combinedRow.getRowCountIn() : 0L) + (inRow.getRowCount() != null ? inRow.getRowCount() : 0L));
+ combinedRow.setRowValueIn((combinedRow.getRowValueIn() != null ? combinedRow.getRowValueIn() : 0.0) + (inRow.getRowValue() != null ? inRow.getRowValue() : 0.0));
+ }
+ }
+ }
+ }
+
+ if (outBundle != null && outBundle.getReportTemplateRows() != null) {
+ for (ReportTemplateRow outRow : outBundle.getReportTemplateRows()) {
+ if (outRow != null) {
+ Item item = outRow.getItem();
+ if (item != null) {
+ if (!combinedRows.containsKey(item)) {
+ combinedRows.put(item, new ReportTemplateRow(item));
+ }
+ ReportTemplateRow combinedRow = combinedRows.get(item);
+ combinedRow.setRowCountOut((combinedRow.getRowCountOut() != null ? combinedRow.getRowCountOut() : 0L) + (outRow.getRowCount() != null ? outRow.getRowCount() : 0L));
+ combinedRow.setRowValueOut((combinedRow.getRowValueOut() != null ? combinedRow.getRowValueOut() : 0.0) + (outRow.getRowValue() != null ? outRow.getRowValue() : 0.0));
+ }
+ }
+ }
+ }
+
+ long totalInCount = 0;
+ long totalOutCount = 0;
+ double totalInValue = 0.0;
+ double totalOutValue = 0.0;
+
+ for (ReportTemplateRow row : combinedRows.values()) {
+ row.setRowCount((row.getRowCountIn() != null ? row.getRowCountIn() : 0L) + (row.getRowCountOut() != null ? row.getRowCountOut() : 0L));
+ row.setRowValue((row.getRowValueIn() != null ? row.getRowValueIn() : 0.0) + (row.getRowValueOut() != null ? row.getRowValueOut() : 0.0));
+ temOutBundle.getReportTemplateRows().add(row);
+
+ totalInCount += (row.getRowCountIn() != null ? row.getRowCountIn() : 0L);
+ totalOutCount += (row.getRowCountOut() != null ? row.getRowCountOut() : 0L);
+ totalInValue += (row.getRowValueIn() != null ? row.getRowValueIn() : 0.0);
+ totalOutValue += (row.getRowValueOut() != null ? row.getRowValueOut() : 0.0);
+ }
+
+ temOutBundle.setCountIn(totalInCount);
+ temOutBundle.setCountOut(totalOutCount);
+ temOutBundle.setCount(totalInCount + totalOutCount);
+ temOutBundle.setTotalIn(totalInValue);
+ temOutBundle.setTotalOut(totalOutValue);
+ temOutBundle.setTotal(totalInValue + totalOutValue);
+
+ return temOutBundle;
+ }
+
+ private ReportTemplateRowBundle combineBundlesByCategory(ReportTemplateRowBundle inBundle, ReportTemplateRowBundle outBundle) {
+ ReportTemplateRowBundle temOutBundle = new ReportTemplateRowBundle();
+ Map combinedRows = new HashMap<>();
+
+ if (inBundle != null && inBundle.getReportTemplateRows() != null) {
+ for (ReportTemplateRow inRow : inBundle.getReportTemplateRows()) {
+ if (inRow != null) {
+ Category c = inRow.getCategory();
+ if (c != null) {
+ if (!combinedRows.containsKey(c)) {
+ combinedRows.put(c, new ReportTemplateRow(c));
+ }
+ ReportTemplateRow combinedRow = combinedRows.get(c);
+ combinedRow.setRowCountIn((combinedRow.getRowCountIn() != null ? combinedRow.getRowCountIn() : 0L) + (inRow.getRowCount() != null ? inRow.getRowCount() : 0L));
+ combinedRow.setRowValueIn((combinedRow.getRowValueIn() != null ? combinedRow.getRowValueIn() : 0.0) + (inRow.getRowValue() != null ? inRow.getRowValue() : 0.0));
+ }
+ }
+ }
+ }
+
+ if (outBundle != null && outBundle.getReportTemplateRows() != null) {
+ for (ReportTemplateRow outRow : outBundle.getReportTemplateRows()) {
+ if (outRow != null) {
+ Category c = outRow.getCategory();
+ if (c != null) {
+ if (!combinedRows.containsKey(c)) {
+ combinedRows.put(c, new ReportTemplateRow(c));
+ }
+ ReportTemplateRow combinedRow = combinedRows.get(c);
+ combinedRow.setRowCountOut((combinedRow.getRowCountOut() != null ? combinedRow.getRowCountOut() : 0L) + (outRow.getRowCount() != null ? outRow.getRowCount() : 0L));
+ combinedRow.setRowValueOut((combinedRow.getRowValueOut() != null ? combinedRow.getRowValueOut() : 0.0) + (outRow.getRowValue() != null ? outRow.getRowValue() : 0.0));
+ }
+ }
+ }
+ }
+
+ long totalInCount = 0;
+ long totalOutCount = 0;
+ double totalInValue = 0.0;
+ double totalOutValue = 0.0;
+
+ for (ReportTemplateRow row : combinedRows.values()) {
+ row.setRowCount((row.getRowCountIn() != null ? row.getRowCountIn() : 0L) + (row.getRowCountOut() != null ? row.getRowCountOut() : 0L));
+ row.setRowValue((row.getRowValueIn() != null ? row.getRowValueIn() : 0.0) + (row.getRowValueOut() != null ? row.getRowValueOut() : 0.0));
+ temOutBundle.getReportTemplateRows().add(row);
+
+ totalInCount += (row.getRowCountIn() != null ? row.getRowCountIn() : 0L);
+ totalOutCount += (row.getRowCountOut() != null ? row.getRowCountOut() : 0L);
+ totalInValue += (row.getRowValueIn() != null ? row.getRowValueIn() : 0.0);
+ totalOutValue += (row.getRowValueOut() != null ? row.getRowValueOut() : 0.0);
+ }
+
+ temOutBundle.setCountIn(totalInCount);
+ temOutBundle.setCountOut(totalOutCount);
+ temOutBundle.setCount(totalInCount + totalOutCount);
+ temOutBundle.setTotalIn(totalInValue);
+ temOutBundle.setTotalOut(totalOutValue);
+ temOutBundle.setTotal(totalInValue + totalOutValue);
+
+ return temOutBundle;
+ }
+
+ public void processShiftEndReportOpdCategory() {
+ reportTemplateType = ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM;
+ List bts = new ArrayList<>();
+ bts.addAll(BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_IN));
+ bts.addAll(BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD));
+ opdBilled = reportTemplateController.generateReport(
+ ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM,
+ BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ nonClosedShiftStartFundBill.getCreater(),
+ null,
+ nonClosedShiftStartFundBill.getId(),
+ nonClosedShiftStartFundBill.getReferenceBill().getId());
+ opdReturns = reportTemplateController.generateReport(
+ ReportTemplateType.ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM,
+ BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD_OUT),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ nonClosedShiftStartFundBill.getCreater(),
+ null,
+ nonClosedShiftStartFundBill.getId(),
+ nonClosedShiftStartFundBill.getReferenceBill().getId());
+ opdBundle = combineBundlesByCategory(opdBilled, opdReturns);
+ }
+
+ public void processShiftEndReportOpdItem() {
+ reportTemplateType = ReportTemplateType.ITEM_SUMMARY_BY_BILL;
+ List bts = new ArrayList<>();
+ bts.addAll(BillTypeAtomic.findByServiceTypeAndFinanceType(ServiceType.OPD, BillFinanceType.CASH_IN));
+ bts.addAll(BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD));
+ opdBilled = reportTemplateController.generateReport(
+ ReportTemplateType.ITEM_SUMMARY_BY_BILL,
+ BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ nonClosedShiftStartFundBill.getCreater(),
+ null,
+ nonClosedShiftStartFundBill.getId(),
+ nonClosedShiftStartFundBill.getReferenceBill().getId());
+ opdReturns = reportTemplateController.generateReport(
+ ReportTemplateType.ITEM_SUMMARY_BY_BILL,
+ BillTypeAtomic.findByCountedServiceType(CountedServiceType.OPD_OUT),
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ null,
+ nonClosedShiftStartFundBill.getCreater(),
+ null,
+ nonClosedShiftStartFundBill.getId(),
+ nonClosedShiftStartFundBill.getReferenceBill().getId());
+ opdBundle = combineBundlesByItem(opdBilled, opdReturns);
+ }
+
public String navigateToListShiftEndSummaries() {
resetClassVariables();
return "/cashier/initial_fund_bill_list?faces-redirect=true;";
@@ -194,6 +543,16 @@ public String navigateToCashierSummary() {
return "/cashier/cashier_summary?faces-redirect=true";
}
+ public String navigateToCashierReport() {
+ processShiftEndReport();
+ return "/cashier/shift_end_report_bill_of_selected_user?faces-redirect=true";
+ }
+
+ public String navigateToCashierReportOpd() {
+ resetBundles();
+ return "/cashier/shift_end_report_bill_of_selected_user_opd?faces-redirect=true";
+ }
+
public String navigateToCashierSummaryBreakdown() {
return "/cashier/shift_end_summary_breakdown?faces-redirect=true";
}
@@ -941,7 +1300,7 @@ private void createPaymentSummery() {
List rows = aggregatedPayments.entrySet().stream().map(entry -> {
ReportTemplateRow row = keyMap.get(entry.getKey());
-
+
if (row != null) {
row.setRowValue(entry.getValue());
}
@@ -953,33 +1312,40 @@ private void createPaymentSummery() {
}
- public String navigateToViewEndOfSelectedShiftStartSummaryBill(Bill startBill) {
+ public String navigateToViewShiftSratToNow(Bill startBill) {
resetClassVariables();
if (startBill == null) {
JsfUtil.addErrorMessage("No Start Bill");
return null;
}
+ if (startBill.getCreater() == null) {
+ JsfUtil.addErrorMessage("No User");
+ return null;
+ }
nonClosedShiftStartFundBill = startBill;
fillPaymentsFromShiftStartToNow(startBill, startBill.getCreater());
- return "/cashier/shift_end_summery_bill_of_selected_user_not_closed?faces-redirect=true";
+ return "/cashier/shift_end_summery_bill_of_selected_user?faces-redirect=true";
}
- public String navigateToViewStartToEndOfSelectedShiftStartSummaryBill(Bill startBill) {
+ public String navigateToViewShiftSrartToEnd(Bill startBill) {
resetClassVariables();
if (startBill == null) {
JsfUtil.addErrorMessage("No Start Bill");
return null;
}
+ if (startBill.getCreater() == null) {
+ JsfUtil.addErrorMessage("No User");
+ return null;
+ }
Bill endBill;
if (startBill.getReferenceBill() == null) {
JsfUtil.addErrorMessage("No Start Bill");
return null;
}
-
endBill = startBill.getReferenceBill();
nonClosedShiftStartFundBill = startBill;
fillPaymentsFromShiftStartToEnd(startBill, endBill, startBill.getCreater());
- return "/cashier/shift_end_summery_bill_of_selected_user_not_closed?faces-redirect=true";
+ return "/cashier/shift_end_summery_bill_of_selected_user?faces-redirect=true";
}
public String navigateToCreateShiftEndSummaryBillByBills() {
@@ -1362,15 +1728,15 @@ public String settleShiftEndFundBill() {
}
//
-//
+ //
/**
*
* User click to Crete Transfer Bill Add (fromStaff 0 the user) Select User
* to transfer (toStaff) settle to print
*
*/
-//
-//
+ //
+ //
/**
*
* pavan
@@ -1440,8 +1806,8 @@ public String settleFundTransferReceiveBill() {
return "/cashier/fund_transfer_receive_bill_print?faces-redirect=true";
}
-//
-//
+ //
+ //
//Lawan
public void addPaymentToFundDepositBill() {
if (currentBill == null) {
@@ -1499,8 +1865,8 @@ public String settleFundDepositBill() {
}
return "/cashier/deposit_funds_print?faces-redirect=true";
}
-//
-//
+ //
+ //
public String navigateToCreateNewFundWithdrawalBill() {
prepareToAddNewWithdrawalProcessingBill();
@@ -1515,8 +1881,8 @@ private void prepareToAddNewWithdrawalProcessingBill() {
currentBill.setBillClassType(BillClassType.Bill);
}
-//Damith
-//
+ //Damith
+ //
//
public Bill getCurrentBill() {
return currentBill;
@@ -1990,4 +2356,123 @@ public void setPaymentsSelected(List paymentsSelected) {
}
+ public ReportTemplateRowBundle getReportTemplateRowBundle() {
+ return reportTemplateRowBundle;
+ }
+
+ public void setReportTemplateRowBundle(ReportTemplateRowBundle reportTemplateRowBundle) {
+ this.reportTemplateRowBundle = reportTemplateRowBundle;
+ }
+
+ public ReportTemplateRowBundle getOpdServiceBundle() {
+ return opdServiceBundle;
+ }
+
+ public void setOpdServiceBundle(ReportTemplateRowBundle opdServiceBundle) {
+ this.opdServiceBundle = opdServiceBundle;
+ }
+
+ public ReportTemplateRowBundle getChannellingBundle() {
+ return channellingBundle;
+ }
+
+ public void setChannellingBundle(ReportTemplateRowBundle channellingBundle) {
+ this.channellingBundle = channellingBundle;
+ }
+
+ public ReportTemplateRowBundle getOpdDocPayment() {
+ return opdDocPayment;
+ }
+
+ public void setOpdDocPayment(ReportTemplateRowBundle opdDocPayment) {
+ this.opdDocPayment = opdDocPayment;
+ }
+
+ public ReportTemplateRowBundle getChannellingDocPayment() {
+ return channellingDocPayment;
+ }
+
+ public void setChannellingDocPayment(ReportTemplateRowBundle channellingDocPayment) {
+ this.channellingDocPayment = channellingDocPayment;
+ }
+
+ public ReportTemplateRowBundle getOpdBilled() {
+ return opdBilled;
+ }
+
+ public void setOpdBilled(ReportTemplateRowBundle opdBilled) {
+ this.opdBilled = opdBilled;
+ }
+
+ public ReportTemplateRowBundle getOpdReturns() {
+ return opdReturns;
+ }
+
+ public void setOpdReturns(ReportTemplateRowBundle opdReturns) {
+ this.opdReturns = opdReturns;
+ }
+
+ public ReportTemplateRowBundle getChannellingBilled() {
+ return channellingBilled;
+ }
+
+ public void setChannellingBilled(ReportTemplateRowBundle channellingBilled) {
+ this.channellingBilled = channellingBilled;
+ }
+
+ public ReportTemplateRowBundle getChannellingReturns() {
+ return channellingReturns;
+ }
+
+ public void setChannellingReturns(ReportTemplateRowBundle channellingReturns) {
+ this.channellingReturns = channellingReturns;
+ }
+
+ public ReportTemplateRowBundle getPharmacyBilld() {
+ return pharmacyBilld;
+ }
+
+ public void setPharmacyBilld(ReportTemplateRowBundle pharmacyBilld) {
+ this.pharmacyBilld = pharmacyBilld;
+ }
+
+ public ReportTemplateRowBundle getPharmacyReturned() {
+ return pharmacyReturned;
+ }
+
+ public void setPharmacyReturned(ReportTemplateRowBundle pharmacyReturned) {
+ this.pharmacyReturned = pharmacyReturned;
+ }
+
+ public ReportTemplateRowBundle getOpdBundle() {
+ return opdBundle;
+ }
+
+ public void setOpdBundle(ReportTemplateRowBundle opdBundle) {
+ this.opdBundle = opdBundle;
+ }
+
+ private void resetBundles() {
+ reportTemplateRowBundle = new ReportTemplateRowBundle();
+ opdServiceBundle = new ReportTemplateRowBundle();
+ channellingBundle = new ReportTemplateRowBundle();
+ opdDocPayment = new ReportTemplateRowBundle();
+ channellingDocPayment = new ReportTemplateRowBundle();
+ opdBilled = new ReportTemplateRowBundle();
+ opdReturns = new ReportTemplateRowBundle();
+ opdBundle = new ReportTemplateRowBundle();
+ channellingBilled = new ReportTemplateRowBundle();
+ channellingReturns = new ReportTemplateRowBundle();
+ pharmacyBilld = new ReportTemplateRowBundle();
+ pharmacyReturned = new ReportTemplateRowBundle();
+ }
+
+ public ReportTemplateType getReportTemplateType() {
+ return reportTemplateType;
+ }
+
+ public void setReportTemplateType(ReportTemplateType reportTemplateType) {
+ this.reportTemplateType = reportTemplateType;
+ }
+
}
diff --git a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java
index 65d0bc0a90..c8c569e541 100644
--- a/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java
+++ b/src/main/java/com/divudi/bean/channel/BookingControllerViewScope.java
@@ -505,48 +505,50 @@ private Bill createBillForChannelReshedule(BillSession bs) {
bill.setPatient(bs.getBill().getPatient());
switch (bs.getBill().getPaymentMethod()) {
case OnCall:
- bill.setBillType(BillType.ChannelResheduleWithOutPayment);
+ bill.setBillType(BillType.ChannelOnCall);
bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT);
break;
case Cash:
- bill.setBillType(BillType.ChannelResheduleWithOutPayment);
+ bill.setBillType(BillType.ChannelCash);
bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT);
break;
case Card:
- bill.setBillType(BillType.ChannelResheduleWithPayment);
+ bill.setBillType(BillType.ChannelCash);
bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT);
break;
case Cheque:
- bill.setBillType(BillType.ChannelResheduleWithOutPayment);
- bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT);
+ bill.setBillType(BillType.ChannelCash);
+ bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT);
break;
case Slip:
- bill.setBillType(BillType.ChannelResheduleWithOutPayment);
- bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT);
+ bill.setBillType(BillType.ChannelCash);
+ bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT);
break;
case Agent:
- bill.setBillType(BillType.ChannelResheduleWithOutPayment);
- bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT);
+ bill.setBillType(BillType.ChannelAgent);
+ bill.setCreditCompany(institution);
+ bill.setAgentRefNo(agentRefNo);
+ bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT);
break;
case Staff:
- bill.setBillType(BillType.ChannelResheduleWithOutPayment);
+ bill.setBillType(BillType.ChannelStaff);
bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT);
break;
case Credit:
- bill.setBillType(BillType.ChannelResheduleWithOutPayment);
+ bill.setBillType(BillType.ChannelCredit);
bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT);
break;
case OnlineSettlement:
- bill.setBillType(BillType.ChannelResheduleWithOutPayment);
- bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_OUT_PAYMENT);
+ bill.setBillType(BillType.ChannelCash);
+ bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_BOOKING_WITH_PAYMENT_ONLINE);
break;
case MultiplePaymentMethods:
- bill.setBillType(BillType.ChannelResheduleWithPayment);
+ bill.setBillType(BillType.ChannelCash);
bill.setBillTypeAtomic(BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT);
break;
}
@@ -558,7 +560,7 @@ private Bill createBillForChannelReshedule(BillSession bs) {
bill.setDeptId(deptId);
bill.setInsId(deptId);
- bill.setPaidAmount(getSelectedSessionInstanceForRechedule().getOriginatingSession().getTotal());
+ bill.setPaidAmount(bs.getBill().getPaidAmount());
bill.setPaidAt(new Date());
bill.setBillDate(new Date());
@@ -581,7 +583,7 @@ private Bill createBillForChannelReshedule(BillSession bs) {
}
return bill;
}
-
+
private BillItem createSessionItemForReshedule(Bill bill) {
BillItem bi = new BillItem();
bi.setAdjustedValue(0.0);
@@ -2891,6 +2893,21 @@ public boolean patientErrorPresent(Patient p) {
JsfUtil.addErrorMessage("Please enter a name");
return true;
}
+
+ if (p.getPerson().getPhone() == null) {
+ JsfUtil.addErrorMessage("Please enter a phone number");
+ return true;
+ }
+
+ if (p.getPerson().getMobile()== null) {
+ JsfUtil.addErrorMessage("Please enter a mobile number");
+ return true;
+ }
+
+ if (p.getPerson().getArea()== null) {
+ JsfUtil.addErrorMessage("Please enter a area");
+ return true;
+ }
return false;
}
@@ -4539,7 +4556,9 @@ public void fillBillSessions() {
BillType.ChannelCash,
BillType.ChannelOnCall,
BillType.ChannelStaff,
- BillType.ChannelCredit
+ BillType.ChannelCredit,
+ BillType.ChannelResheduleWithPayment,
+ BillType.ChannelResheduleWithOutPayment
};
List bts = Arrays.asList(billTypes);
String sql = "Select bs "
@@ -4648,7 +4667,9 @@ public void fillBillSessions(SessionInstance s) {
BillType.ChannelCash,
BillType.ChannelOnCall,
BillType.ChannelStaff,
- BillType.ChannelCredit
+ BillType.ChannelCredit,
+ BillType.ChannelResheduleWithPayment,
+ BillType.ChannelResheduleWithOutPayment
};
List bts = Arrays.asList(billTypes);
String sql = "Select bs "
diff --git a/src/main/java/com/divudi/bean/channel/ChannelBillController.java b/src/main/java/com/divudi/bean/channel/ChannelBillController.java
index 794f513cb2..012cb3f8da 100644
--- a/src/main/java/com/divudi/bean/channel/ChannelBillController.java
+++ b/src/main/java/com/divudi/bean/channel/ChannelBillController.java
@@ -467,6 +467,7 @@ public BillSession settleCreditForOnlinePayments(BillSession bookingBillSession)
bookingBillSession.getBill().setPaidAmount(newSettleBill.getPaidAmount());
bookingBillSession.getBill().setBalance(0.0);
bookingBillSession.getBill().setPaidBill(newSettleBill);
+ bookingBillSession.setRetired(false);
bookingBillSession.setPaidBillSession(newlyCreatedSettlingBillSession);
getBillFacade().edit(bookingBillSession.getBill());
diff --git a/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java b/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java
index 980a811adb..77747350b3 100644
--- a/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java
+++ b/src/main/java/com/divudi/bean/channel/ChannelStaffPaymentBillController.java
@@ -313,10 +313,9 @@ public void calculateDueFeesOld() {
}
}
-
-
- public void debugDueFees() {
- Date startTime = new Date();
+
+ public void debugDueFees() {
+ Date startTime = new Date();
if (getSpeciality() == null) {
JsfUtil.addErrorMessage("Select Specility");
@@ -343,7 +342,7 @@ public void debugDueFees() {
+ " and b.fee.feeType=:ftp"
+ " and b.bill.refunded=false "
+ " and b.bill.cancelled=false "
- + " and b.bill.singleBillSession.absent=false"
+ // + " and b.bill.singleBillSession.absent=false"
+ " and (b.feeValue - b.paidValue) > 0 "
+ " and b.bill.billType in :bt "
+ " and b.staff=:stf ";
@@ -363,8 +362,11 @@ public void debugDueFees() {
hm.put("ss", getSelectedServiceSession());
}
- sql += " and b.bill.singleBillSession.absent=false "
- + " order by b.bill.singleBillSession.serviceSession.sessionDate,"
+// sql += " and b.bill.singleBillSession.absent=false "
+// + " order by b.bill.singleBillSession.serviceSession.sessionDate,"
+// + " b.bill.singleBillSession.serviceSession.sessionTime,"
+// + " b.bill.singleBillSession.serialNo ";
+ sql += " order by b.bill.singleBillSession.serviceSession.sessionDate,"
+ " b.bill.singleBillSession.serviceSession.sessionTime,"
+ " b.bill.singleBillSession.serialNo ";
@@ -415,7 +417,7 @@ public void debugDueFees() {
nonRefundableBillFees = billFeeFacade.findByJpql(sql, m, TemporalType.TIMESTAMP);
dueBillFees.addAll(nonRefundableBillFees);
- }
+ }
public void calculateDueFees() {
Date startTime = new Date();
@@ -445,7 +447,7 @@ public void calculateDueFees() {
+ " and b.fee.feeType=:ftp"
+ " and b.bill.refunded=false "
+ " and b.bill.cancelled=false "
- + " and b.bill.singleBillSession.absent=false"
+ // + " and b.bill.singleBillSession.absent=false"
+ " and (b.feeValue - b.paidValue) > 0 "
+ " and b.bill.billType in :bt "
+ " and b.staff=:stf ";
@@ -465,8 +467,11 @@ public void calculateDueFees() {
hm.put("ss", getSelectedServiceSession());
}
- sql += " and b.bill.singleBillSession.absent=false "
- + " order by b.bill.singleBillSession.serviceSession.sessionDate,"
+// sql += " and b.bill.singleBillSession.absent=false "
+// + " order by b.bill.singleBillSession.serviceSession.sessionDate,"
+// + " b.bill.singleBillSession.serviceSession.sessionTime,"
+// + " b.bill.singleBillSession.serialNo ";
+ sql += " order by b.bill.singleBillSession.serviceSession.sessionDate,"
+ " b.bill.singleBillSession.serviceSession.sessionTime,"
+ " b.bill.singleBillSession.serialNo ";
@@ -537,14 +542,16 @@ public void calculateSessionDueFees() {
+ " and b.fee.feeType=:ftp"
+ " and b.bill.refunded=false "
+ " and b.bill.cancelled=false "
- + " and b.bill.singleBillSession.absent=false"
+ // + " and b.bill.singleBillSession.absent=false"
+ " and (b.feeValue - b.paidValue) > 0 "
+ " and b.bill.billType in :bt "
- + " and b.bill.singleBillSession.sessionInstance=:si";
+ + " and b.bill.singleBillSession.sessionInstance=:si"
+ + " and b.bill.singleBillSession.completed=:com";
sql += " order by b.bill.singleBillSession.serialNo ";
hm.put("si", getSessionInstance());
hm.put("bt", bts);
hm.put("ftp", FeeType.Staff);
+ hm.put("com", true);
hm.put("class", BilledBill.class);
dueBillFees = billFeeFacade.findByJpql(sql, hm, TemporalType.TIMESTAMP);
@@ -571,9 +578,8 @@ public void calculateSessionDueFees() {
dueBillFees.addAll(nonRefundableBillFees);
}
-
-
- public void calculateSessionAllFees() {
+
+ public void calculateSessionDoneFees() {
Date startTime = new Date();
if (getSessionInstance() == null) {
JsfUtil.addErrorMessage("Select Specility");
@@ -587,18 +593,20 @@ public void calculateSessionAllFees() {
+ " FROM BillFee b "
+ " where type(b.bill)=:class "
+ " and b.bill.retired=false "
-// + " and b.bill.paidAmount!=0 "
+ + " and b.bill.paidAmount!=0 "
+ " and b.fee.feeType=:ftp"
+ " and b.bill.refunded=false "
+ " and b.bill.cancelled=false "
-// + " and b.bill.singleBillSession.absent=false"
-// + " and (b.feeValue - b.paidValue) > 0 "
-// + " and b.bill.billType in :bt "
- + " and b.bill.singleBillSession.sessionInstance=:si";
+ // + " and b.bill.singleBillSession.absent=false"
+ + " and (b.feeValue - b.paidValue) < 1 "
+ + " and b.bill.billType in :bt "
+ + " and b.bill.singleBillSession.sessionInstance=:si"
+ + " and b.bill.singleBillSession.completed=:com";
sql += " order by b.bill.singleBillSession.serialNo ";
hm.put("si", getSessionInstance());
-// hm.put("bt", bts);
+ hm.put("bt", bts);
hm.put("ftp", FeeType.Staff);
+ hm.put("com", true);
hm.put("class", BilledBill.class);
dueBillFees = billFeeFacade.findByJpql(sql, hm, TemporalType.TIMESTAMP);
@@ -615,7 +623,7 @@ public void calculateSessionAllFees() {
+ " and b.bill.billType in :bt "
+ " and b.bill.singleBillSession.sessionInstance=:si "
+ " and b.bill.singleBillSession.absent=true "
- + " and b.bill.singleBillSession.sessionInstance.originatingSession.refundable=false ";
+ + " and b.bill.singleBillSession.serviceSession.originatingSession.refundable=false ";
sql += " order by b.bill.singleBillSession.serialNo ";
m.put("si", getSessionInstance());
m.put("bt", bts);
@@ -626,6 +634,32 @@ public void calculateSessionAllFees() {
}
+ public void calculateSessionAllFees() {
+ if (getSessionInstance() == null) {
+ JsfUtil.addErrorMessage("Select Specility");
+ return;
+ }
+
+ BillType[] billTypes = {BillType.ChannelAgent, BillType.ChannelCash, BillType.ChannelPaid};
+ List bts = Arrays.asList(billTypes);
+ HashMap hm = new HashMap<>();
+ String sql = " SELECT b "
+ + " FROM BillFee b "
+ + " where type(b.bill) in :classes "
+ + " and b.bill.retired=false "
+ + " and b.fee.feeType=:ftp"
+ + " and b.bill.singleBillSession.sessionInstance=:si";
+ sql += " order by b.bill.singleBillSession.serialNo ";
+ List> classes = new ArrayList<>();
+ classes.add(BilledBill.class);
+
+ hm.put("si", getSessionInstance());
+ hm.put("ftp", FeeType.Staff);
+ hm.put("classes", classes);
+ System.out.println("sql = " + sql);
+ System.out.println("hm = " + hm);
+ dueBillFees = billFeeFacade.findByJpql(sql, hm, TemporalType.TIMESTAMP);
+ }
public void calculateDueFeesAgency() {
Date startTime = new Date();
@@ -790,20 +824,20 @@ private Bill createPaymentBill() {
return tmp;
}
-
+
public Payment createPaymentProPayment(Bill bill, PaymentMethod pm) {
Payment p = new Payment();
p.setBill(bill);
double valueToSet = 0 - Math.abs(bill.getNetTotal());
p.setPaidValue(valueToSet);
- if(pm == null){
+ if (pm == null) {
pm = bill.getPaymentMethod();
}
setPaymentMethodData(p, pm);
return p;
}
-
- public void setPaymentMethodData(Payment p, PaymentMethod pm) {
+
+ public void setPaymentMethodData(Payment p, PaymentMethod pm) {
p.setInstitution(getSessionController().getInstitution());
p.setDepartment(getSessionController().getDepartment());
p.setCreatedAt(new Date());
@@ -967,13 +1001,13 @@ public void settleBill() {
Bill b = createPaymentBillForSession();
current = b;
getBillFacade().create(b);
- createPaymentProPayment(b,paymentMethod);
+ createPaymentProPayment(b, paymentMethod);
saveBillItemsAndFees(b);
if (sessionController.getDepartmentPreference().isSendSmsOnChannelBookingDocterPayment()) {
sendSmsAfterDocPayment();
}
printPreview = true;
- currentStaff=null;
+ currentStaff = null;
JsfUtil.addSuccessMessage("Successfully Paid");
//////// // System.out.println("Paid");
}
@@ -984,7 +1018,7 @@ public void settleSessionPaymentBill() {
}
calculateTotalPay();
Bill b = createPaymentBill();
-
+
getBillFacade().create(b);
createPaymentProPayment(b, paymentMethod);
List bis = saveBillItemsAndFees(b);
@@ -998,7 +1032,7 @@ public void settleSessionPaymentBill() {
sendSmsAfterSessionPayment();
}
printPreview = true;
- currentStaff=null;
+ currentStaff = null;
JsfUtil.addSuccessMessage("Successfully Paid");
}
diff --git a/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java b/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java
index ef87761544..b5c36190e8 100644
--- a/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java
+++ b/src/main/java/com/divudi/bean/channel/analytics/ReportTemplateController.java
@@ -10,6 +10,7 @@
import com.divudi.bean.common.*;
import com.divudi.bean.common.util.JsfUtil;
+import com.divudi.data.AtomicBillTypeTotals;
import com.divudi.data.BillTypeAtomic;
import com.divudi.data.ReportTemplateRow;
import com.divudi.data.ReportTemplateRowBundle;
@@ -58,8 +59,7 @@ public class ReportTemplateController implements Serializable {
private ReportTemplateFacade ejbFacade;
private ReportTemplate current;
private List items = null;
-
-
+
private Date date;
private Date fromDate;
private Date toDate;
@@ -67,7 +67,8 @@ public class ReportTemplateController implements Serializable {
private Department department;
private WebUser user;
private Staff staff;
-
+ private Long startId;
+ private Long endId;
private Institution creditCompany;
private Institution fromInstitution;
@@ -93,10 +94,6 @@ public void save(ReportTemplate reportTemplate) {
}
}
-
-
-
-
public ReportTemplate findReportTemplateByName(String name) {
if (name == null) {
return null;
@@ -139,98 +136,440 @@ public void recreateModel() {
items = null;
}
- public String processReport() {
- if (current == null) {
- JsfUtil.addErrorMessage("Nothing Selected");
- return null;
- }
- if (current.getReportTemplateType() == null) {
- JsfUtil.addErrorMessage("No report Type");
- return "";
- }
- switch (current.getReportTemplateType()) {
+ public ReportTemplateRowBundle generateReport(
+ 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) {
+
+ ReportTemplateRowBundle bundle;
+
+ switch (type) {
+ case BILL_NET_TOTAL:
+ bundle = handleBillTypeAtomicTotalUsingBills(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
+ break;
case BILLT_TYPE_AND_PAYMENT_METHOD_SUMMARY_PAYMENTS:
- handleBillTypeAndPaymentMethodSummaryPayments();
+ bundle = handleBillTypeAndPaymentMethodSummaryPayments(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case BILLT_TYPE_AND_PAYMENT_METHOD_SUMMARY_USING_BILLS:
- handleBillTypeAndPaymentMethodSummaryUsingBills();
+ bundle = handleBillTypeAndPaymentMethodSummaryUsingBills(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case BILL_TYPE_ATOMIC_SUMMARY_USING_FEES:
- handleBillFeeGroupedByBillTypeAtomic();
+ bundle = handleBillFeeGroupedByBillTypeAtomic(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case BILL_FEE_GROUPED_BY_TO_DEPARTMENT_AND_CATEGORY:
- handleBillFeeGroupedByToDepartmentAndCategory();
+ bundle = handleBillFeeGroupedByToDepartmentAndCategory(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case BILL_FEE_LIST:
- handleBillFeeList();
+ bundle = handleBillFeeList(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case BILL_ITEM_LIST:
- handleBillItemList();
+ bundle = handleBillItemList(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case BILL_LIST:
- handleBillList();
+ bundle = handleBillList(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case BILL_TYPE_ATOMIC_SUMMARY_USING_BILLS:
- handleBillTypeAtomicSummaryUsingBills();
+ bundle = handleBillTypeAtomicSummaryUsingBills(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case BILL_TYPE_ATOMIC_SUMMARY_USING_PAYMENTS:
- handleBillTypeAtomicSummaryUsingPayments();
+ bundle = handleBillTypeAtomicSummaryUsingPayments(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case ENCOUNTER_LIST:
- handleEncounterList();
+ bundle = handleEncounterList(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case PATIENT_LIST:
- handlePatientList();
+ bundle = handlePatientList(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case PAYMENT_METHOD_SUMMARY_USING_BILLS:
- handlePaymentMethodSummaryUsingBills();
+ bundle = handlePaymentMethodSummaryUsingBills(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case PAYMENT_METHOD_SUMMARY_USING_PAYMENTS:
- handlePaymentMethodSummaryUsingPayments();
+ bundle = handlePaymentMethodSummaryUsingPayments(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case PAYMENT_TYPE_SUMMARY_PAYMENTS:
- handlePaymentTypeSummaryPayments();
+ bundle = handlePaymentTypeSummaryPayments(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case PAYMENT_TYPE_SUMMARY_USING_BILLS:
- handlePaymentTypeSummaryUsingBills();
+ bundle = handlePaymentTypeSummaryUsingBills(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case ITEM_CATEGORY_SUMMARY_BY_BILL_FEE:
- handleItemCategorySummaryByBillFee();
+ bundle = handleItemCategorySummaryByBillFee(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
- case ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM:
- handleItemCategorySummaryByBillItem();
+ case ITEM_SUMMARY_BY_BILL:
+ bundle =handleItemSummaryByBill(btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
+ case ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM:
case ITEM_CATEGORY_SUMMARY_BY_BILL:
- handleItemCategorySummaryByBill();
+ bundle = handleItemCategorySummaryByBill(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case TO_DEPARTMENT_SUMMARY_BY_BILL_FEE:
- handleToDepartmentSummaryByBillFee();
+ bundle = handleToDepartmentSummaryByBillFee(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
case TO_DEPARTMENT_SUMMARY_BY_BILL_ITEM:
- handleToDepartmentSummaryByBillItem();
+ bundle = handleToDepartmentSummaryByBillItem(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
+
case TO_DEPARTMENT_SUMMARY_BY_BILL:
- handleToDepartmentSummaryByBill();
+ bundle = handleToDepartmentSummaryByBill(
+ btas,
+ paramDate,
+ paramFromDate,
+ paramToDate,
+ paramInstitution,
+ paramDepartment,
+ paramFromInstitution,
+ paramFromDepartment,
+ paramToInstitution,
+ paramToDepartment,
+ paramUser,
+ paramCreditCompany,
+ paramStartId,
+ paramEndId);
break;
default:
JsfUtil.addErrorMessage("Unknown Report Type");
- return "";
+ return null;
}
- return "";
- }
-
- private void handleBillTypeAndPaymentMethodSummaryPayments() {
- // Method implementation here
+ return bundle;
}
- private void handleBillTypeAndPaymentMethodSummaryUsingBills() {
- // Method implementation here
+ public String processReport() {
+ if (current == null) {
+ JsfUtil.addErrorMessage("Nothing Selected");
+ return null;
+ }
+ if (current.getReportTemplateType() == null) {
+ JsfUtil.addErrorMessage("No report Type");
+ return "";
+ }
+ reportTemplateRowBundle = generateReport(current.getReportTemplateType(), current.getBillTypeAtomics(), date, fromDate, toDate, institution, department, fromInstitution, fromDepartment, toInstitution, toDepartment, user, creditCompany, startId, endId);
+ return "";
}
- private void handleBillFeeGroupedByBillTypeAtomic() {
+ private ReportTemplateRowBundle handleBillFeeGroupedByBillTypeAtomic(
+ 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) {
+
+ ReportTemplateRowBundle bundle = new ReportTemplateRowBundle();
String jpql;
Map parameters = new HashMap<>();
- reportTemplateRowBundle = new ReportTemplateRowBundle();
jpql = "select new com.divudi.data.ReportTemplateRow("
+ " bill.billTypeAtomic, sum(bf.feeValue)) "
@@ -243,56 +582,69 @@ private void handleBillFeeGroupedByBillTypeAtomic() {
parameters.put("bir", true);
parameters.put("br", true);
- if (current.getBillTypeAtomics() != null) {
+ if (btas != null) {
jpql += " and bill.billTypeAtomic in :btas ";
- parameters.put("btas", current.getBillTypeAtomics());
+ parameters.put("btas", btas);
}
- for (ReportTemplateFilter f : current.getReportFilters()) {
- switch (f) {
- case DATE:
- jpql += " and bill.billDate=:bd ";
- parameters.put("bd", date);
- break;
- case TO_DATE:
- jpql += " and bill.billDate < :td ";
- parameters.put("td", toDate);
- break;
- case FROM_DATE:
- jpql += " and bill.billDate > :fd ";
- parameters.put("fd", fromDate);
- break;
- case INSTITUTION:
- jpql += " and bill.institution=:ins ";
- parameters.put("ins", institution);
- break;
- case DEPARTMENT:
- jpql += " and bill.department=:dep ";
- parameters.put("dep", department);
- break;
- case FROM_INSTITUTION:
- jpql += " and bill.fromInstitution=:fins ";
- parameters.put("fins", fromInstitution);
- break;
- case FROM_DEPARTMENT:
- jpql += " and bill.fromDepartment=:fdep ";
- parameters.put("fdep", fromDepartment);
- break;
- case TO_INSTITUTION:
- jpql += " and bill.toInstitution=:tins ";
- parameters.put("tins", toInstitution);
- break;
- case TO_DEPARTMENT:
- jpql += " and bill.toDepartment=:tdep ";
- parameters.put("tdep", toDepartment);
- break;
- case CREDIT_COMPANY:
- jpql += " and bill.creditCompany=:creditCompany ";
- parameters.put("creditCompany", creditCompany);
- break;
- default:
- throw new AssertionError();
- }
+ if (paramDate != null) {
+ jpql += " and bill.billDate=:bd ";
+ parameters.put("bd", paramDate);
+ }
+
+ if (paramToDate != null) {
+ jpql += " and bill.billDate < :td ";
+ parameters.put("td", paramToDate);
+ }
+
+ if (paramFromDate != null) {
+ jpql += " and bill.billDate > :fd ";
+ parameters.put("fd", paramFromDate);
+ }
+
+ if (paramStartId != null) {
+ jpql += " and bill.id > :sid ";
+ parameters.put("sid", paramStartId);
+ }
+
+ if (paramEndId != null) {
+ jpql += " and bill.id < :eid ";
+ parameters.put("eid", paramEndId);
+ }
+
+ if (paramInstitution != null) {
+ jpql += " and bill.institution=:ins ";
+ parameters.put("ins", paramInstitution);
+ }
+
+ if (paramDepartment != null) {
+ jpql += " and bill.department=:dep ";
+ parameters.put("dep", paramDepartment);
+ }
+
+ if (paramFromInstitution != null) {
+ jpql += " and bill.fromInstitution=:fins ";
+ parameters.put("fins", paramFromInstitution);
+ }
+
+ if (paramFromDepartment != null) {
+ jpql += " and bill.fromDepartment=:fdep ";
+ parameters.put("fdep", paramFromDepartment);
+ }
+
+ if (paramToInstitution != null) {
+ jpql += " and bill.toInstitution=:tins ";
+ parameters.put("tins", paramToInstitution);
+ }
+
+ if (paramToDepartment != null) {
+ jpql += " and bill.toDepartment=:tdep ";
+ parameters.put("tdep", paramToDepartment);
+ }
+
+ if (paramCreditCompany != null) {
+ jpql += " and bill.creditCompany=:cc ";
+ parameters.put("cc", paramCreditCompany);
}
jpql += " group by bill.billTypeAtomic";
@@ -312,13 +664,29 @@ private void handleBillFeeGroupedByBillTypeAtomic() {
for (ReportTemplateRow row : rs) {
row.setId(idCounter++);
}
- reportTemplateRowBundle.setReportTemplateRows(rs);
- }
-
- private void handleBillFeeGroupedByToDepartmentAndCategory() {
+ bundle.setReportTemplateRows(rs);
+ return bundle;
+ }
+
+ private ReportTemplateRowBundle handleBillFeeGroupedByToDepartmentAndCategory(
+ 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) {
+
+ ReportTemplateRowBundle bundle = new ReportTemplateRowBundle();
String jpql;
Map parameters = new HashMap<>();
- reportTemplateRowBundle = new ReportTemplateRowBundle();
jpql = "select new com.divudi.data.ReportTemplateRow("
+ " bill.billTypeAtomic, sum(bf.feeValue)) "
@@ -331,52 +699,69 @@ private void handleBillFeeGroupedByToDepartmentAndCategory() {
parameters.put("bir", true);
parameters.put("br", true);
- if (current.getBillTypeAtomics() != null) {
+ if (btas != null) {
jpql += " and bill.billTypeAtomic in :btas ";
- parameters.put("btas", current.getBillTypeAtomics());
+ parameters.put("btas", btas);
}
- for (ReportTemplateFilter f : current.getReportFilters()) {
- switch (f) {
- case DATE:
- jpql += " and bill.billDate=:bd ";
- parameters.put("bd", date);
- break;
- case TO_DATE:
- jpql += " and bill.billDate < :td ";
- parameters.put("td", toDate);
- break;
- case FROM_DATE:
- jpql += " and bill.billDate > :fd ";
- parameters.put("fd", fromDate);
- break;
- case INSTITUTION:
- jpql += " and bill.institution=:ins ";
- parameters.put("ins", institution);
- break;
- case DEPARTMENT:
- jpql += " and bill.department=:dep ";
- parameters.put("dep", department);
- break;
- case FROM_INSTITUTION:
- jpql += " and bill.fromInstitution=:fins ";
- parameters.put("fins", fromInstitution);
- break;
- case FROM_DEPARTMENT:
- jpql += " and bill.fromDepartment=:fdep ";
- parameters.put("fdep", fromDepartment);
- break;
- case TO_INSTITUTION:
- jpql += " and bill.toInstitution=:tins ";
- parameters.put("tins", toInstitution);
- break;
- case TO_DEPARTMENT:
- jpql += " and bill.toDepartment=:tdep ";
- parameters.put("tdep", toDepartment);
- break;
- default:
- throw new AssertionError();
- }
+ if (paramDate != null) {
+ jpql += " and bill.billDate=:bd ";
+ parameters.put("bd", paramDate);
+ }
+
+ if (paramToDate != null) {
+ jpql += " and bill.billDate < :td ";
+ parameters.put("td", paramToDate);
+ }
+
+ if (paramFromDate != null) {
+ jpql += " and bill.billDate > :fd ";
+ parameters.put("fd", paramFromDate);
+ }
+
+ if (paramStartId != null) {
+ jpql += " and bill.id > :sid ";
+ parameters.put("sid", paramStartId);
+ }
+
+ if (paramEndId != null) {
+ jpql += " and bill.id < :eid ";
+ parameters.put("eid", paramEndId);
+ }
+
+ if (paramInstitution != null) {
+ jpql += " and bill.institution=:ins ";
+ parameters.put("ins", paramInstitution);
+ }
+
+ if (paramDepartment != null) {
+ jpql += " and bill.department=:dep ";
+ parameters.put("dep", paramDepartment);
+ }
+
+ if (paramFromInstitution != null) {
+ jpql += " and bill.fromInstitution=:fins ";
+ parameters.put("fins", paramFromInstitution);
+ }
+
+ if (paramFromDepartment != null) {
+ jpql += " and bill.fromDepartment=:fdep ";
+ parameters.put("fdep", paramFromDepartment);
+ }
+
+ if (paramToInstitution != null) {
+ jpql += " and bill.toInstitution=:tins ";
+ parameters.put("tins", paramToInstitution);
+ }
+
+ if (paramToDepartment != null) {
+ jpql += " and bill.toDepartment=:tdep ";
+ parameters.put("tdep", paramToDepartment);
+ }
+
+ if (paramCreditCompany != null) {
+ jpql += " and bill.creditCompany=:cc ";
+ parameters.put("cc", paramCreditCompany);
}
jpql += " group by bill.billTypeAtomic";
@@ -396,85 +781,565 @@ private void handleBillFeeGroupedByToDepartmentAndCategory() {
for (ReportTemplateRow row : rs) {
row.setId(idCounter++);
}
- reportTemplateRowBundle.setReportTemplateRows(rs);
- }
+ bundle.setReportTemplateRows(rs);
+ return bundle;
+ }
+
+ private ReportTemplateRowBundle handleBillTypeAtomicSummaryUsingBills(
+ 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) {
+
+ ReportTemplateRowBundle bundle = new ReportTemplateRowBundle();
+ String jpql;
+ Map parameters = new HashMap<>();
- private void handleBillFeeList() {
- // Method implementation here
- }
+ jpql = "select new com.divudi.data.ReportTemplateRow("
+ + " bill.billTypeAtomic, sum(bill.netTotal)) "
+ + " from Bill bill "
+ + " where bill.retired<>:br ";
+ parameters.put("br", true);
- private void handleBillItemList() {
- // Method implementation here
- }
+ if (btas != null) {
+ jpql += " and bill.billTypeAtomic in :btas ";
+ parameters.put("btas", btas);
+ }
- private void handleBillList() {
- // Method implementation here
- }
+ if (paramDate != null) {
+ jpql += " and bill.billDate=:bd ";
+ parameters.put("bd", paramDate);
+ }
+
+ if (paramToDate != null) {
+ jpql += " and bill.billDate < :td ";
+ parameters.put("td", paramToDate);
+ }
+
+ if (paramFromDate != null) {
+ jpql += " and bill.billDate > :fd ";
+ parameters.put("fd", paramFromDate);
+ }
+
+ if (paramStartId != null) {
+ jpql += " and bill.id > :sid ";
+ parameters.put("sid", paramStartId);
+ }
+
+ if (paramEndId != null) {
+ jpql += " and bill.id < :eid ";
+ parameters.put("eid", paramEndId);
+ }
+
+ if (paramInstitution != null) {
+ jpql += " and bill.institution=:ins ";
+ parameters.put("ins", paramInstitution);
+ }
+
+ if (paramDepartment != null) {
+ jpql += " and bill.department=:dep ";
+ parameters.put("dep", paramDepartment);
+ }
+
+ if (paramFromInstitution != null) {
+ jpql += " and bill.fromInstitution=:fins ";
+ parameters.put("fins", paramFromInstitution);
+ }
- private void handleBillTypeAtomicSummaryUsingBills() {
+ if (paramFromDepartment != null) {
+ jpql += " and bill.fromDepartment=:fdep ";
+ parameters.put("fdep", paramFromDepartment);
+ }
+
+ if (paramToInstitution != null) {
+ jpql += " and bill.toInstitution=:tins ";
+ parameters.put("tins", paramToInstitution);
+ }
+
+ if (paramToDepartment != null) {
+ jpql += " and bill.toDepartment=:tdep ";
+ parameters.put("tdep", paramToDepartment);
+ }
+
+ if (paramCreditCompany != null) {
+ jpql += " and bill.creditCompany=:cc ";
+ parameters.put("cc", paramCreditCompany);
+ }
+
+ jpql += " group by bill.billTypeAtomic";
+
+ System.out.println("jpql = " + jpql);
+ System.out.println("parameters = " + parameters);
+
+ List rs = (List) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.DATE);
+
+ if (rs == null || rs.isEmpty()) {
+ System.out.println("No results found.");
+ } else {
+ System.out.println("Results found: " + rs.size());
+ }
+
+ long idCounter = 1;
+ for (ReportTemplateRow row : rs) {
+ row.setId(idCounter++);
+ }
+ bundle.setReportTemplateRows(rs);
+ return bundle;
+ }
+
+ private ReportTemplateRowBundle handleBillTypeAtomicTotalUsingBills(
+ 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) {
+
+ ReportTemplateRowBundle bundle = new ReportTemplateRowBundle();
String jpql;
Map parameters = new HashMap<>();
- reportTemplateRowBundle = new ReportTemplateRowBundle();
- jpql = "select new com.divudi.data.ReportTemplateRow("
- + " bill.billTypeAtomic, sum(bill.netTotal)) "
+ // Initialize the total to 0
+ double totalNetAmount = 0.0;
+
+ jpql = "select sum(bill.netTotal) "
+ " from Bill bill "
+ " where bill.retired<>:br ";
parameters.put("br", true);
- if (current.getBillTypeAtomics() != null) {
+ if (btas != null) {
jpql += " and bill.billTypeAtomic in :btas ";
- parameters.put("btas", current.getBillTypeAtomics());
+ parameters.put("btas", btas);
}
- for (ReportTemplateFilter f : current.getReportFilters()) {
- switch (f) {
- case DATE:
- jpql += " and bill.billDate=:bd ";
- parameters.put("bd", date);
- break;
- case TO_DATE:
- jpql += " and bill.billDate < :td ";
- parameters.put("td", toDate);
- break;
- case FROM_DATE:
- jpql += " and bill.billDate > :fd ";
- parameters.put("fd", fromDate);
- break;
- case INSTITUTION:
- jpql += " and bill.institution=:ins ";
- parameters.put("ins", institution);
- break;
- case DEPARTMENT:
- jpql += " and bill.department=:dep ";
- parameters.put("dep", department);
- break;
- case FROM_INSTITUTION:
- jpql += " and bill.fromInstitution=:fins ";
- parameters.put("fins", fromInstitution);
- break;
- case FROM_DEPARTMENT:
- jpql += " and bill.fromDepartment=:fdep ";
- parameters.put("fdep", fromDepartment);
- break;
- case TO_INSTITUTION:
- jpql += " and bill.toInstitution=:tins ";
- parameters.put("tins", toInstitution);
- break;
- case TO_DEPARTMENT:
- jpql += " and bill.toDepartment=:tdep ";
- parameters.put("tdep", toDepartment);
- break;
- case CREDIT_COMPANY:
- jpql += " and bill.creditCompany=:creditCompany ";
- parameters.put("creditCompany", creditCompany);
- break;
- default:
- throw new AssertionError();
- }
+ if (paramDate != null) {
+ jpql += " and bill.billDate=:bd ";
+ parameters.put("bd", paramDate);
}
- jpql += " group by bill.billTypeAtomic";
+ if (paramToDate != null) {
+ jpql += " and bill.billDate < :td ";
+ parameters.put("td", paramToDate);
+ }
+
+ if (paramFromDate != null) {
+ jpql += " and bill.billDate > :fd ";
+ parameters.put("fd", paramFromDate);
+ }
+
+ if (paramStartId != null) {
+ jpql += " and bill.id > :sid ";
+ parameters.put("sid", paramStartId);
+ }
+
+ if (paramEndId != null) {
+ jpql += " and bill.id < :eid ";
+ parameters.put("eid", paramEndId);
+ }
+
+ if (paramInstitution != null) {
+ jpql += " and bill.institution=:ins ";
+ parameters.put("ins", paramInstitution);
+ }
+
+ if (paramDepartment != null) {
+ jpql += " and bill.department=:dep ";
+ parameters.put("dep", paramDepartment);
+ }
+
+ if (paramFromInstitution != null) {
+ jpql += " and bill.fromInstitution=:fins ";
+ parameters.put("fins", paramFromInstitution);
+ }
+
+ if (paramFromDepartment != null) {
+ jpql += " and bill.fromDepartment=:fdep ";
+ parameters.put("fdep", paramFromDepartment);
+ }
+
+ if (paramToInstitution != null) {
+ jpql += " and bill.toInstitution=:tins ";
+ parameters.put("tins", paramToInstitution);
+ }
+
+ if (paramToDepartment != null) {
+ jpql += " and bill.toDepartment=:tdep ";
+ parameters.put("tdep", paramToDepartment);
+ }
+
+ if (paramCreditCompany != null) {
+ jpql += " and bill.creditCompany=:cc ";
+ parameters.put("cc", paramCreditCompany);
+ }
+
+ if (paramUser != null) {
+ jpql += " and bill.creater=:wu ";
+ parameters.put("wu", paramUser);
+ }
+
+ System.out.println("jpql = " + jpql);
+ System.out.println("parameters = " + parameters);
+
+ Double sumResult = ejbFacade.findSingleResultByJpql(jpql, parameters, TemporalType.DATE);
+
+ if (sumResult != null) {
+ totalNetAmount = sumResult;
+ }
+
+ bundle.setTotal(totalNetAmount);
+
+ return bundle;
+ }
+
+ private ReportTemplateRowBundle handleBillTypeAndPaymentMethodSummaryPayments(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handleBillTypeAndPaymentMethodSummaryUsingBills(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handleBillFeeList(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handleBillItemList(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handleBillList(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handleBillTypeAtomicSummaryUsingPayments(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handleEncounterList(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handlePatientList(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handlePaymentMethodSummaryUsingBills(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handlePaymentMethodSummaryUsingPayments(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handlePaymentTypeSummaryPayments(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handlePaymentTypeSummaryUsingBills(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handleItemCategorySummaryByBillFee(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handleItemCategorySummaryByBillItem(
+ 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) {
+
+ String jpql;
+ Map parameters = new HashMap<>();
+ ReportTemplateRowBundle bundle = new ReportTemplateRowBundle();
+
+ jpql = "select new com.divudi.data.ReportTemplateRow("
+ + " bi.item.category.name, sum(bi.netValue)) "
+ + " from BillItem bi"
+ + " join bi.bill bill "
+ + " where bill.retired<>:br "
+ + " and bi.retired<>:br ";
+ parameters.put("br", true);
+
+ if (btas != null) {
+ jpql += " and bill.billTypeAtomic in :btas ";
+ parameters.put("btas", btas);
+ }
+
+ if (paramDate != null) {
+ jpql += " and bill.billDate=:bd ";
+ parameters.put("bd", paramDate);
+ }
+
+ if (paramToDate != null) {
+ jpql += " and bill.billDate < :td ";
+ parameters.put("td", paramToDate);
+ }
+
+ if (paramFromDate != null) {
+ jpql += " and bill.billDate > :fd ";
+ parameters.put("fd", paramFromDate);
+ }
+
+ if (paramStartId != null) {
+ jpql += " and bill.id > :sid ";
+ parameters.put("sid", paramStartId);
+ }
+
+ if (paramEndId != null) {
+ jpql += " and bill.id < :eid ";
+ parameters.put("eid", paramEndId);
+ }
+
+ if (paramInstitution != null) {
+ jpql += " and bill.institution=:ins ";
+ parameters.put("ins", paramInstitution);
+ }
+
+ if (paramDepartment != null) {
+ jpql += " and bill.department=:dep ";
+ parameters.put("dep", paramDepartment);
+ }
+
+ if (paramFromInstitution != null) {
+ jpql += " and bill.fromInstitution=:fins ";
+ parameters.put("fins", paramFromInstitution);
+ }
+
+ if (paramFromDepartment != null) {
+ jpql += " and bill.fromDepartment=:fdep ";
+ parameters.put("fdep", paramFromDepartment);
+ }
+
+ if (paramToInstitution != null) {
+ jpql += " and bill.toInstitution=:tins ";
+ parameters.put("tins", paramToInstitution);
+ }
+
+ if (paramToDepartment != null) {
+ jpql += " and bill.toDepartment=:tdep ";
+ parameters.put("tdep", paramToDepartment);
+ }
+
+ if (paramCreditCompany != null) {
+ jpql += " and bill.creditCompany=:creditCompany ";
+ parameters.put("creditCompany", paramCreditCompany);
+ }
+
+ jpql += " and bi.item is not null "
+ + " and bi.item.category is not null ";
+
+ jpql += " group by bi.item.category ";
System.out.println("jpql = " + jpql);
System.out.println("parameters = " + parameters);
@@ -491,36 +1356,312 @@ private void handleBillTypeAtomicSummaryUsingBills() {
for (ReportTemplateRow row : rs) {
row.setId(idCounter++);
}
- reportTemplateRowBundle.setReportTemplateRows(rs);
+ bundle.setReportTemplateRows(rs);
+ return bundle;
+ }
+
+ private ReportTemplateRowBundle handleItemCategorySummaryByBill(
+ 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) {
- }
+ String jpql;
+ Map parameters = new HashMap<>();
+ ReportTemplateRowBundle bundle = new ReportTemplateRowBundle();
- private void handleBillTypeAtomicSummaryUsingPayments() {
- // Method implementation here
- }
+ jpql = "select new com.divudi.data.ReportTemplateRow("
+ + " bi.item.category, count(bi), sum(bi.netValue)) "
+ + " from BillItem bi"
+ + " join bi.bill bill "
+ + " where bill.retired<>:br "
+ + " and bi.retired<>:br ";
+ parameters.put("br", true);
- private void handleEncounterList() {
- // Method implementation here
- }
+ if (btas != null) {
+ jpql += " and bill.billTypeAtomic in :btas ";
+ parameters.put("btas", btas);
+ }
- private void handlePatientList() {
- // Method implementation here
- }
+ if (paramDate != null) {
+ jpql += " and bill.billDate=:bd ";
+ parameters.put("bd", paramDate);
+ }
- private void handlePaymentMethodSummaryUsingBills() {
- // Method implementation here
- }
+ if (paramToDate != null) {
+ jpql += " and bill.billDate < :td ";
+ parameters.put("td", paramToDate);
+ }
- private void handlePaymentMethodSummaryUsingPayments() {
- // Method implementation here
- }
+ if (paramFromDate != null) {
+ jpql += " and bill.billDate > :fd ";
+ parameters.put("fd", paramFromDate);
+ }
+
+ if (paramStartId != null) {
+ jpql += " and bill.id > :sid ";
+ parameters.put("sid", paramStartId);
+ }
+
+ if (paramEndId != null) {
+ jpql += " and bill.id < :eid ";
+ parameters.put("eid", paramEndId);
+ }
+
+ if (paramInstitution != null) {
+ jpql += " and bill.institution=:ins ";
+ parameters.put("ins", paramInstitution);
+ }
+
+ if (paramDepartment != null) {
+ jpql += " and bill.department=:dep ";
+ parameters.put("dep", paramDepartment);
+ }
+
+ if (paramFromInstitution != null) {
+ jpql += " and bill.fromInstitution=:fins ";
+ parameters.put("fins", paramFromInstitution);
+ }
+
+ if (paramFromDepartment != null) {
+ jpql += " and bill.fromDepartment=:fdep ";
+ parameters.put("fdep", paramFromDepartment);
+ }
+
+ if (paramToInstitution != null) {
+ jpql += " and bill.toInstitution=:tins ";
+ parameters.put("tins", paramToInstitution);
+ }
+
+ if (paramToDepartment != null) {
+ jpql += " and bill.toDepartment=:tdep ";
+ parameters.put("tdep", paramToDepartment);
+ }
+
+ if (paramUser != null) {
+ jpql += " and bill.creater=:wu ";
+ parameters.put("wu", paramUser);
+ }
+
+ if (paramCreditCompany != null) {
+ jpql += " and bill.creditCompany=:creditCompany ";
+ parameters.put("creditCompany", paramCreditCompany);
+ }
+
+ jpql += " and bi.item is not null "
+ + " and bi.item.category is not null ";
- private void handlePaymentTypeSummaryPayments() {
- // Method implementation here
+ jpql += " group by bi.item.category ";
+
+ System.out.println("jpql = " + jpql);
+ System.out.println("parameters = " + parameters);
+
+ List rs = (List) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.DATE);
+
+ if (rs == null || rs.isEmpty()) {
+ System.out.println("No results found.");
+ } else {
+ System.out.println("Results found: " + rs.size());
+ }
+
+ long idCounter = 1;
+ Double total = 0.0;
+ for (ReportTemplateRow row : rs) {
+ row.setId(idCounter++);
+ total = row.getRowValue();
+ }
+ bundle.setReportTemplateRows(rs);
+ return bundle;
}
- private void handlePaymentTypeSummaryUsingBills() {
+
+ private ReportTemplateRowBundle handleItemSummaryByBill(
+ 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) {
+
+ String jpql;
+ Map parameters = new HashMap<>();
+ ReportTemplateRowBundle bundle = new ReportTemplateRowBundle();
+ jpql = "select new com.divudi.data.ReportTemplateRow("
+ + " bi.item, count(bi), sum(bi.netValue)) "
+ + " from BillItem bi"
+ + " join bi.bill bill "
+ + " where bill.retired<>:br "
+ + " and bi.retired<>:br ";
+ parameters.put("br", true);
+
+ if (btas != null) {
+ jpql += " and bill.billTypeAtomic in :btas ";
+ parameters.put("btas", btas);
+ }
+
+ if (paramDate != null) {
+ jpql += " and bill.billDate=:bd ";
+ parameters.put("bd", paramDate);
+ }
+
+ if (paramToDate != null) {
+ jpql += " and bill.billDate < :td ";
+ parameters.put("td", paramToDate);
+ }
+
+ if (paramFromDate != null) {
+ jpql += " and bill.billDate > :fd ";
+ parameters.put("fd", paramFromDate);
+ }
+
+ if (paramStartId != null) {
+ jpql += " and bill.id > :sid ";
+ parameters.put("sid", paramStartId);
+ }
+
+ if (paramEndId != null) {
+ jpql += " and bill.id < :eid ";
+ parameters.put("eid", paramEndId);
+ }
+
+ if (paramInstitution != null) {
+ jpql += " and bill.institution=:ins ";
+ parameters.put("ins", paramInstitution);
+ }
+
+ if (paramDepartment != null) {
+ jpql += " and bill.department=:dep ";
+ parameters.put("dep", paramDepartment);
+ }
+
+ if (paramFromInstitution != null) {
+ jpql += " and bill.fromInstitution=:fins ";
+ parameters.put("fins", paramFromInstitution);
+ }
+
+ if (paramFromDepartment != null) {
+ jpql += " and bill.fromDepartment=:fdep ";
+ parameters.put("fdep", paramFromDepartment);
+ }
+
+ if (paramToInstitution != null) {
+ jpql += " and bill.toInstitution=:tins ";
+ parameters.put("tins", paramToInstitution);
+ }
+
+ if (paramToDepartment != null) {
+ jpql += " and bill.toDepartment=:tdep ";
+ parameters.put("tdep", paramToDepartment);
+ }
+
+ if (paramUser != null) {
+ jpql += " and bill.creater=:wu ";
+ parameters.put("wu", paramUser);
+ }
+
+ if (paramCreditCompany != null) {
+ jpql += " and bill.creditCompany=:creditCompany ";
+ parameters.put("creditCompany", paramCreditCompany);
+ }
+
+ jpql += " and bi.item is not null ";
+
+ jpql += " group by bi.item ";
+
+ System.out.println("jpql = " + jpql);
+ System.out.println("parameters = " + parameters);
+
+ List rs = (List) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.DATE);
+
+ if (rs == null || rs.isEmpty()) {
+ System.out.println("No results found.");
+ } else {
+ System.out.println("Results found: " + rs.size());
+ }
+
+ long idCounter = 1;
+ Double total = 0.0;
+ for (ReportTemplateRow row : rs) {
+ row.setId(idCounter++);
+ total = row.getRowValue();
+ }
+ bundle.setReportTemplateRows(rs);
+ return bundle;
+ }
+
+
+
+ private ReportTemplateRowBundle handleToDepartmentSummaryByBillFee(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handleToDepartmentSummaryByBillItem(
+ 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) {
+ return new ReportTemplateRowBundle();
+ }
+
+ private ReportTemplateRowBundle handleToDepartmentSummaryByBill(
+ 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) {
+ return new ReportTemplateRowBundle();
}
public void saveSelected() {
@@ -819,118 +1960,23 @@ public Institution getCreditCompany() {
public void setCreditCompany(Institution creditCompany) {
this.creditCompany = creditCompany;
}
- /**
- *
- */
- private void handleItemCategorySummaryByBillFee() {
- throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
- }
-
- private void handleItemCategorySummaryByBillItem() {
- String jpql;
- Map parameters = new HashMap<>();
- reportTemplateRowBundle = new ReportTemplateRowBundle();
-
- jpql = "select new com.divudi.data.ReportTemplateRow("
- + " bi.item.category.name, sum(bi.netValue)) "
- + " from BillItem bi"
- + " join bi.bill bill "
- + " where bill.retired<>:br "
- + " and bi.retired<>:br ";
- parameters.put("br", true);
-
- if (current.getBillTypeAtomics() != null) {
- jpql += " and bill.billTypeAtomic in :btas ";
- parameters.put("btas", current.getBillTypeAtomics());
- }
-
- for (ReportTemplateFilter f : current.getReportFilters()) {
- switch (f) {
- case DATE:
- jpql += " and bill.billDate=:bd ";
- parameters.put("bd", date);
- break;
- case TO_DATE:
- jpql += " and bill.billDate < :td ";
- parameters.put("td", toDate);
- break;
- case FROM_DATE:
- jpql += " and bill.billDate > :fd ";
- parameters.put("fd", fromDate);
- break;
- case INSTITUTION:
- jpql += " and bill.institution=:ins ";
- parameters.put("ins", institution);
- break;
- case DEPARTMENT:
- jpql += " and bill.department=:dep ";
- parameters.put("dep", department);
- break;
- case FROM_INSTITUTION:
- jpql += " and bill.fromInstitution=:fins ";
- parameters.put("fins", fromInstitution);
- break;
- case FROM_DEPARTMENT:
- jpql += " and bill.fromDepartment=:fdep ";
- parameters.put("fdep", fromDepartment);
- break;
- case TO_INSTITUTION:
- jpql += " and bill.toInstitution=:tins ";
- parameters.put("tins", toInstitution);
- break;
- case TO_DEPARTMENT:
- jpql += " and bill.toDepartment=:tdep ";
- parameters.put("tdep", toDepartment);
- break;
- case CREDIT_COMPANY:
- jpql += " and bill.creditCompany=:creditCompany ";
- parameters.put("creditCompany", creditCompany);
- break;
- default:
- throw new AssertionError();
- }
- }
-
- jpql += " and bi.item is not null "
- + " and bi.item.category is not null ";
-
- jpql += " group by bi.item.category ";
-
- System.out.println("jpql = " + jpql);
- System.out.println("parameters = " + parameters);
-
- List rs = (List) ejbFacade.findLightsByJpql(jpql, parameters, TemporalType.DATE);
-
- if (rs == null || rs.isEmpty()) {
- System.out.println("No results found.");
- } else {
- System.out.println("Results found: " + rs.size());
- }
-
- long idCounter = 1;
- for (ReportTemplateRow row : rs) {
- row.setId(idCounter++);
- }
- reportTemplateRowBundle.setReportTemplateRows(rs);
- }
- private void handleItemCategorySummaryByBill() {
- throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
+ public Long getStartId() {
+ return startId;
}
- private void handleToDepartmentSummaryByBillFee() {
- throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
+ public void setStartId(Long startId) {
+ this.startId = startId;
}
- private void handleToDepartmentSummaryByBillItem() {
- throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
+ public Long getEndId() {
+ return endId;
}
- private void handleToDepartmentSummaryByBill() {
- throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody
+ public void setEndId(Long endId) {
+ this.endId = endId;
}
-
public static class ReportTemplateConverter implements Converter {
@Override
diff --git a/src/main/java/com/divudi/bean/common/ConfigOptionApplicationController.java b/src/main/java/com/divudi/bean/common/ConfigOptionApplicationController.java
index 8defc92dcd..03e23a4460 100644
--- a/src/main/java/com/divudi/bean/common/ConfigOptionApplicationController.java
+++ b/src/main/java/com/divudi/bean/common/ConfigOptionApplicationController.java
@@ -56,29 +56,18 @@ public void init() {
private void initializeDenominations() {
String denominationsStr = getLongTextValueByKey("Currency Denominations");
- if (denominationsStr != null && !denominationsStr.trim().isEmpty()) {
- denominations = Arrays.stream(denominationsStr.split(","))
- .map(String::trim) // Trim any extra spaces
- .filter(s -> !s.isEmpty()) // Filter out empty strings
- .map(Integer::parseInt)
- .map(value -> new Denomination(value, 0))
- .collect(Collectors.toList());
- } else {
- denominations = new ArrayList<>(); // Initialize to an empty list if the string is null or empty
+ if (denominationsStr == null || !denominationsStr.trim().isEmpty()) {
+ denominationsStr = "1,2,5,10,20,50,100,500,1000,5000";
}
- }
-
- public List getCurrencyDenominations() {
- String denominationsStr = getLongTextValueByKey("Currency Denominations");
- return Arrays.stream(denominationsStr.split(","))
+ denominations = Arrays.stream(denominationsStr.split(","))
+ .map(String::trim) // Trim any extra spaces
+ .filter(s -> !s.isEmpty()) // Filter out empty strings
.map(Integer::parseInt)
+ .map(value -> new Denomination(value, 0))
.collect(Collectors.toList());
}
- public String getCurrencyDenominationsAsJson() {
- List denominations = getCurrencyDenominations();
- return new JSONArray(denominations).toString();
- }
+
public void loadApplicationOptions() {
applicationOptions = new HashMap<>();
@@ -111,6 +100,12 @@ public void saveOption(ConfigOption option) {
}
public List getDenominations() {
+ if (denominations == null) {
+ initializeDenominations();
+ }
+ for(Denomination d:denominations){
+ d.setCount(0);
+ }
return denominations;
}
diff --git a/src/main/java/com/divudi/bean/common/OpdTokenController.java b/src/main/java/com/divudi/bean/common/OpdTokenController.java
index 0d66d69853..60cbd520ab 100644
--- a/src/main/java/com/divudi/bean/common/OpdTokenController.java
+++ b/src/main/java/com/divudi/bean/common/OpdTokenController.java
@@ -10,6 +10,7 @@
import com.divudi.bean.pharmacy.PharmacyPreSettleController;
import com.divudi.bean.pharmacy.PharmacySaleController;
import com.divudi.data.PaymentMethod;
+import com.divudi.data.TokenCount;
import com.divudi.data.TokenType;
import com.divudi.ejb.BillNumberGenerator;
import com.divudi.entity.Bill;
@@ -88,6 +89,7 @@ public class OpdTokenController implements Serializable, ControllerWithPatient {
private Staff staff;
private Bill bill;
private boolean patientDetailsEditable;
+ private List tokenCounts;
private boolean printPreview;
@@ -351,18 +353,78 @@ public String navigateToManageOpdTokensCalled() {
return "/opd/token/opd_tokens_called?faces-redirect=true"; // Adjust the navigation string as per your page structure
}
+ public String navigateToManageOpdTokensWaiting() {
+ fillOpdTokensWaiting();
+ fillOpdWaitingTokensCounts();
+ return "/opd/token/opd_tokens_waiting?faces-redirect=true"; // Adjust the navigation string as per your page structure
+ }
+
public void fillOpdTokensCalled() {
Map m = new HashMap<>();
String j = "Select t "
+ " from Token t"
+ " where t.department=:dep"
+ + " and t.tokenDate=:date "
+ " and t.called=:cal "
+ " and t.tokenType=:ty"
+ " and t.inProgress=:prog "
+ " and t.completed=:com"; // Add conditions to filter out tokens that are in progress or completed
m.put("dep", sessionController.getDepartment());
+ m.put("date", new Date());
m.put("cal", true); // Tokens that are called
- m.put("prog", true); // Tokens that are not in progress
+ m.put("prog", false); // Tokens that are not in progress
+ m.put("ty", TokenType.OPD_TOKEN); // Chack Token Type that are called
+ m.put("com", false); // Tokens that are not completed
+ j += " order by t.id";
+ currentTokens = tokenFacade.findByJpql(j, m, TemporalType.DATE);
+ //System.out.println("currentTokens = " + currentTokens);
+ }
+
+ public void fillOpdWaitingTokensCounts() {
+ Map m = new HashMap<>();
+ String j = "Select new com.divudi.data.TokenCount(t.counter, t.staff, count(t)) "
+ + " from Token t"
+ + " where t.department=:dep"
+ + " and t.tokenDate=:date "
+ + " and t.called=:cal "
+ + " and t.tokenType=:ty"
+ + " and t.inProgress=:prog "
+ + " and t.completed=:com"; // Add conditions to filter out tokens that are in progress or completed
+
+ boolean testing = false;
+ if(testing){
+ Token t=new Token();
+ t.getCounter();
+ t.getStaff();
+
+ }
+
+ m.put("dep", sessionController.getDepartment());
+ m.put("date", new Date());
+ m.put("cal", false); // Tokens that are called
+ m.put("prog", false); // Tokens that are not in progress
+ m.put("ty", TokenType.OPD_TOKEN); // Chack Token Type that are called
+ m.put("com", false); // Tokens that are not completed
+ j += " group by t.counter, t.staff";
+ currentTokens = tokenFacade.findByJpql(j, m, TemporalType.DATE);
+ tokenCounts = (List) tokenFacade.findLightsByJpql(j, m);
+ //System.out.println("currentTokens = " + currentTokens);
+ }
+
+ public void fillOpdTokensWaiting() {
+ Map m = new HashMap<>();
+ String j = "Select t "
+ + " from Token t"
+ + " where t.department=:dep"
+ + " and t.tokenDate=:date "
+ + " and t.called=:cal "
+ + " and t.tokenType=:ty"
+ + " and t.inProgress=:prog "
+ + " and t.completed=:com"; // Add conditions to filter out tokens that are in progress or completed
+ m.put("dep", sessionController.getDepartment());
+ m.put("date", new Date());
+ m.put("cal", false); // Tokens that are called
+ m.put("prog", false); // Tokens that are not in progress
m.put("ty", TokenType.OPD_TOKEN); // Chack Token Type that are called
m.put("com", false); // Tokens that are not completed
j += " order by t.id";
@@ -446,10 +508,10 @@ public void recallToken() {
JsfUtil.addErrorMessage("Please select valid Token");
return;
}
-
+
if (currentToken.isCalled()) {
currentToken.setCalled(false);
- }else{
+ } else {
currentToken.setCalled(true);
}
tokenFacade.edit(currentToken);
@@ -458,13 +520,12 @@ public void recallToken() {
// public void restartTokenService() {
//
// }
-
public void reverseCompleteTokenService() {
- if (currentToken==null) {
+ if (currentToken == null) {
JsfUtil.addErrorMessage("Token Is Not Valid !");
return;
}
- currentToken.setRestartTokenServices(true);
+ currentToken.setRestartTokenServices(true);
currentToken.setCompleted(false);
tokenFacade.edit(currentToken);
}
@@ -580,6 +641,8 @@ public Doctor getDoctor() {
return doctor;
}
+
+
public void setDoctor(Doctor doctor) {
this.doctor = doctor;
}
@@ -608,4 +671,12 @@ public void setBill(Bill bill) {
this.bill = bill;
}
+ public List getTokenCounts() {
+ return tokenCounts;
+ }
+
+ public void setTokenCounts(List tokenCounts) {
+ this.tokenCounts = tokenCounts;
+ }
+
}
diff --git a/src/main/java/com/divudi/bean/common/SearchController.java b/src/main/java/com/divudi/bean/common/SearchController.java
index ac6e2a3754..96aa4f769c 100644
--- a/src/main/java/com/divudi/bean/common/SearchController.java
+++ b/src/main/java/com/divudi/bean/common/SearchController.java
@@ -3330,7 +3330,7 @@ public void createPharmacyIssueBillItemTable() {
sql += " order by bi.id desc ";
- billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP, 50);
+ billItems = getBillItemFacade().findByJpql(sql, m, TemporalType.TIMESTAMP);
}
diff --git a/src/main/java/com/divudi/data/BillTypeAtomic.java b/src/main/java/com/divudi/data/BillTypeAtomic.java
index 14f721a1aa..831d4ae081 100644
--- a/src/main/java/com/divudi/data/BillTypeAtomic.java
+++ b/src/main/java/com/divudi/data/BillTypeAtomic.java
@@ -1,7 +1,3 @@
-/*
- * Dr M H B Ariyaratne
- * buddhika.ari@gmail.com
- */
package com.divudi.data;
import java.util.Arrays;
@@ -9,175 +5,177 @@
import java.util.stream.Collectors;
/**
- * @author Buddhika
+ * Enumerates types of bills for atomic billing purposes.
+ * Includes categorization by service type and finance type.
*/
public enum BillTypeAtomic {
- //INWARD
- INWARD_PHARMACY_REQUEST("Inward Request Medicines From Pharmacy", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- INWARD_SERVICE_BATCH_BILL("Inward Service Batch Bill", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- INWARD_SERVICE_BATCH_BILL_CANCELLATION("Inward Service Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- INWARD_SERVICE_BILL("Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- INWARD_SERVICE_BILL_CANCELLATION("Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- INWARD_SERVICE_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- INWARD_SERVICE_BATCH_BILL_REFUND("Opd Bill Refund", BillCategory.REFUND, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- INWARD_SERVICE_PROFESSIONAL_PAYMENT_BILL("OPD Professional Payment bill", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- //Store
- STORE_ORDER("Store Order", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN),
- STORE_ORDER_PRE("Store Order Pre", BillCategory.BILL, ServiceType.STORE, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- STORE_ORDER_CANCELLED("Store Order Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT),
- STORE_ORDER_APPROVAL("Store Order Approval", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN),
- STORE_ORDER_APPROVAL_CANCELLED("Store Order Approval Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT),
- STORE_DIRECT_PURCHASE("Store Direct Purchase", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN),
- STORE_DIRECT_PURCHASE_CANCELLED("Store Direct Purchase Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT),
- STORE_DIRECT_PURCHASE_REFUND("Store Direct Purchase Refund", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_OUT),
- STORE_GRN("Store GRN", BillCategory.PAYMENTS, ServiceType.STORE, BillFinanceType.CASH_OUT),
- STORE_GRN_CANCELLED("Store GRN Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT),
- STORE_GRN_REFUND("Store GRN Refund", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_OUT),
- STORE_GRN_RETURN("Store GRN Return", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_IN),
-
- // Pharmacy
- PHARMACY_RETAIL_SALE("Pharmacy Retail Sale", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_RETAIL_SALE_PRE("Pharmacy Retail Sale Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
+ // INWARD
+ INWARD_PHARMACY_REQUEST("Inward Request Medicines From Pharmacy", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD),
+ INWARD_SERVICE_BATCH_BILL("Inward Service Batch Bill", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD),
+ INWARD_SERVICE_BATCH_BILL_CANCELLATION("Inward Service Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD),
+ INWARD_SERVICE_BILL("Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD),
+ INWARD_SERVICE_BILL_CANCELLATION("Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD),
+ INWARD_SERVICE_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD),
+ INWARD_SERVICE_BATCH_BILL_REFUND("Opd Bill Refund", BillCategory.REFUND, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD),
+ INWARD_SERVICE_PROFESSIONAL_PAYMENT_BILL("OPD Professional Payment bill", BillCategory.BILL, ServiceType.INWARD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.INWARD),
+ // STORE
+ STORE_ORDER("Store Order", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN, CountedServiceType.STORE),
+ STORE_ORDER_PRE("Store Order Pre", BillCategory.BILL, ServiceType.STORE, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.STORE),
+ STORE_ORDER_CANCELLED("Store Order Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE),
+ STORE_ORDER_APPROVAL("Store Order Approval", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN, CountedServiceType.STORE),
+ STORE_ORDER_APPROVAL_CANCELLED("Store Order Approval Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE),
+ STORE_DIRECT_PURCHASE("Store Direct Purchase", BillCategory.BILL, ServiceType.STORE, BillFinanceType.CASH_IN, CountedServiceType.STORE),
+ STORE_DIRECT_PURCHASE_CANCELLED("Store Direct Purchase Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE),
+ STORE_DIRECT_PURCHASE_REFUND("Store Direct Purchase Refund", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE),
+ STORE_GRN("Store GRN", BillCategory.PAYMENTS, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE),
+ STORE_GRN_CANCELLED("Store GRN Cancelled", BillCategory.CANCELLATION, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE),
+ STORE_GRN_REFUND("Store GRN Refund", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_OUT, CountedServiceType.STORE),
+ STORE_GRN_RETURN("Store GRN Return", BillCategory.REFUND, ServiceType.STORE, BillFinanceType.CASH_IN, CountedServiceType.STORE),
+ // PHARMACY
+ PHARMACY_RETAIL_SALE("Pharmacy Retail Sale", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_RETAIL_SALE_PRE("Pharmacy Retail Sale Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
@Deprecated
- PHARMACY_RETAIL_SALE_PRE_SETTLE_AT_CASHIER("NOT USED - Pharmacy Retail Sale Pre Bill Settled At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_RETAIL_SALE_PREBILL_SETTLED_AT_CASHIER("Pharmacy Retail Sale Pre Bill Settled At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_RETAIL_SALE_PRE_TO_SETTLE_AT_CASHIER("Pharmacy Retail Sale Pre Bill To Settle At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_RETAIL_SALE_CANCELLED("Pharmacy Retail Sale Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_RETAIL_SALE_REFUND("Pharmacy Retail Sale Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_RETAIL_SALE_RETURN_ITEMS_ONLY("Pharmacy Retail Sale Return Items Only", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_RETAIL_SALE_RETURN_ITEM_PAYMENTS("Pharmacy Retail Sale Return Item Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_RETAIL_SALE_RETURN_ITEMS_AND_PAYMENTS("Pharmacy Retail Sale Return Items And Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_SALE_WITHOUT_STOCK("Pharmacy Sale Without Stock", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_SALE_WITHOUT_STOCK_PRE("Pharmacy Sale Without Stock Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_SALE_WITHOUT_STOCK_CANCELLED("Pharmacy Sale Without Stock Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_SALE_WITHOUT_STOCK_REFUND("Pharmacy Sale Without Stock Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_RETAIL_SALE_PRE_ADD_TO_STOCK("Pharmacy Retail Sale Pre Bill Add to Stock", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_WHOLESALE("Pharmacy Wholesale", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_WHOLESALE_PRE("Pharmacy Wholesale Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_WHOLESALE_CANCELLED("Pharmacy Wholesale Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_WHOLESALE_REFUND("Pharmacy Wholesale Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_ORDER("Pharmacy Order", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_ORDER_PRE("Pharmacy Order Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_ORDER_CANCELLED("Pharmacy Order Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_ORDER_APPROVAL("Pharmacy Order Approval", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_ORDER_APPROVAL_CANCELLED("Pharmacy Order Approval Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_DIRECT_PURCHASE("Pharmacy Direct Purchase", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_DIRECT_PURCHASE_CANCELLED("Pharmacy Direct Purchase Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_DIRECT_PURCHASE_REFUND("Pharmacy Direct Purchase Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_GRN("Pharmacy GRN", BillCategory.PAYMENTS, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_GRN_PRE("Pharmacy GRN Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_GRN_WHOLESALE("Pharmacy Wholesale GRN", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_GRN_CANCELLED("Pharmacy GRN Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_GRN_REFUND("Pharmacy GRN Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_GRN_RETURN("Pharmacy GRN Return", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL("Pharmacy Direct Purchase", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL_CANCELLED("Pharmacy Direct Purchase - Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL_REFUND("Pharmacy Direct Purchase - Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_WHOLESALE_GRN_BILL("Pharmacy GRN", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_WHOLESALE_GRN_BILL_CANCELLED("Pharmacy GRN - Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_WHOLESALE_GRN_BILL_REFUND("Pharmacy GRN - Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_GRN_PAYMENT("GRN Payment", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- PHARMACY_GRN_PAYMENT_CANCELLED("GRN Payment Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_ADJUSTMENT("Pharmacy Adjustment", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_ADJUSTMENT_CANCELLED("Pharmacy Adjustment Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_TRANSFER_REQUEST("Pharmacy Transfer Request", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_TRANSFER_REQUEST_PRE("Pharmacy Transfer Request Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_TRANSFER_REQUEST_CANCELLED("Pharmacy Transfer Request Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_ISSUE("Pharmacy Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_ISSUE_CANCELLED("Pharmacy Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_DIRECT_ISSUE("Pharmacy Direct Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_DIRECT_ISSUE_CANCELLED("Pharmacy Direct Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_RECEIVE("Pharmacy Receive", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_RECEIVE_PRE("Pharmacy Receive Request", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PHARMACY_RECEIVE_CANCELLED("Pharmacy Receive Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
+ PHARMACY_RETAIL_SALE_PRE_SETTLE_AT_CASHIER("NOT USED - Pharmacy Retail Sale Pre Bill Settled At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_RETAIL_SALE_PREBILL_SETTLED_AT_CASHIER("Pharmacy Retail Sale Pre Bill Settled At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_RETAIL_SALE_PRE_TO_SETTLE_AT_CASHIER("Pharmacy Retail Sale Pre Bill To Settle At Cashier", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_RETAIL_SALE_CANCELLED("Pharmacy Retail Sale Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_RETAIL_SALE_REFUND("Pharmacy Retail Sale Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_RETAIL_SALE_RETURN_ITEMS_ONLY("Pharmacy Retail Sale Return Items Only", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_RETAIL_SALE_RETURN_ITEM_PAYMENTS("Pharmacy Retail Sale Return Item Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_RETAIL_SALE_RETURN_ITEMS_AND_PAYMENTS("Pharmacy Retail Sale Return Items And Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_SALE_WITHOUT_STOCK("Pharmacy Sale Without Stock", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_SALE_WITHOUT_STOCK_PRE("Pharmacy Sale Without Stock Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_SALE_WITHOUT_STOCK_CANCELLED("Pharmacy Sale Without Stock Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_SALE_WITHOUT_STOCK_REFUND("Pharmacy Sale Without Stock Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_RETAIL_SALE_PRE_ADD_TO_STOCK("Pharmacy Retail Sale Pre Bill Add to Stock", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_WHOLESALE("Pharmacy Wholesale", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_WHOLESALE_PRE("Pharmacy Wholesale Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_WHOLESALE_CANCELLED("Pharmacy Wholesale Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_WHOLESALE_REFUND("Pharmacy Wholesale Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_ORDER("Pharmacy Order", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_ORDER_PRE("Pharmacy Order Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_ORDER_CANCELLED("Pharmacy Order Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_ORDER_APPROVAL("Pharmacy Order Approval", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_ORDER_APPROVAL_CANCELLED("Pharmacy Order Approval Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_DIRECT_PURCHASE("Pharmacy Direct Purchase", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_DIRECT_PURCHASE_CANCELLED("Pharmacy Direct Purchase Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_DIRECT_PURCHASE_REFUND("Pharmacy Direct Purchase Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_GRN("Pharmacy GRN", BillCategory.PAYMENTS, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_GRN_PRE("Pharmacy GRN Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_GRN_WHOLESALE("Pharmacy Wholesale GRN", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_GRN_CANCELLED("Pharmacy GRN Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_GRN_REFUND("Pharmacy GRN Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_GRN_RETURN("Pharmacy GRN Return", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL("Pharmacy Direct Purchase", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL_CANCELLED("Pharmacy Direct Purchase - Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_WHOLESALE_DIRECT_PURCHASE_BILL_REFUND("Pharmacy Direct Purchase - Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_WHOLESALE_GRN_BILL("Pharmacy GRN", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_WHOLESALE_GRN_BILL_CANCELLED("Pharmacy GRN - Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_WHOLESALE_GRN_BILL_REFUND("Pharmacy GRN - Refund", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_GRN_PAYMENT("GRN Payment", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ PHARMACY_GRN_PAYMENT_CANCELLED("GRN Payment Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_ADJUSTMENT("Pharmacy Adjustment", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_ADJUSTMENT_CANCELLED("Pharmacy Adjustment Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_TRANSFER_REQUEST("Pharmacy Transfer Request", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_TRANSFER_REQUEST_PRE("Pharmacy Transfer Request Pre", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_TRANSFER_REQUEST_CANCELLED("Pharmacy Transfer Request Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_ISSUE("Pharmacy Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_ISSUE_CANCELLED("Pharmacy Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_DIRECT_ISSUE("Pharmacy Direct Issue", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_DIRECT_ISSUE_CANCELLED("Pharmacy Direct Issue Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_RECEIVE("Pharmacy Receive", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_RECEIVE_PRE("Pharmacy Receive Request", BillCategory.BILL, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
+ PHARMACY_RECEIVE_CANCELLED("Pharmacy Receive Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
@Deprecated
- PHARMACY_RETURN_ITEMS_Only("Pharmacy Return Items Only", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
+ PHARMACY_RETURN_ITEMS_Only("Pharmacy Return Items Only", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
@Deprecated
- PHARMACY_RETURN_ITEMS_AND_PAYMENTS("Pharmacy Return Items And Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT),
- PHARMACY_RETURN_ITEMS_AND_PAYMENTS_CANCELLATION("Pharmacy Return Items And Payments Cancellation", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_IN),
- MULTIPLE_PHARMACY_ORDER_CANCELLED_BILL("Multiple Pharmacy Purchase Order Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS),
+ PHARMACY_RETURN_ITEMS_AND_PAYMENTS("Pharmacy Return Items And Payments", BillCategory.REFUND, ServiceType.PHARMACY, BillFinanceType.CASH_OUT, CountedServiceType.PHARMACY),
+ PHARMACY_RETURN_ITEMS_AND_PAYMENTS_CANCELLATION("Pharmacy Return Items And Payments Cancellation", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.CASH_IN, CountedServiceType.PHARMACY),
+ MULTIPLE_PHARMACY_ORDER_CANCELLED_BILL("Multiple Pharmacy Purchase Order Cancelled", BillCategory.CANCELLATION, ServiceType.PHARMACY, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.PHARMACY),
// CHANNELLING
- CHANNEL_BOOKING_WITH_PAYMENT("Channel Booking and Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.CASH_IN),
- CHANNEL_BOOKING_FOR_PAYMENT_ONLINE_PENDING_PAYMENT("Channel Booking For Online Payment - Pending Confirmation", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- CHANNEL_RESHEDULE_WITH_PAYMENT("Channel Reshedule for paid Appointment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- CHANNEL_RESHEDULE_WITH_OUT_PAYMENT("Channel Reshedule For Non Paid Appointment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS),
+ CHANNEL_BOOKING_WITH_PAYMENT("Channel Booking and Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.CASH_IN, CountedServiceType.CHANNELLING),
+ CHANNEL_BOOKING_FOR_PAYMENT_ONLINE_PENDING_PAYMENT("Channel Booking For Online Payment - Pending Confirmation", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING),
+ CHANNEL_RESHEDULE_WITH_PAYMENT("Channel Reshedule for paid Appointment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING),
+ CHANNEL_RESHEDULE_WITH_OUT_PAYMENT("Channel Reshedule For Non Paid Appointment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING),
@Deprecated
- CHANNEL_BOOKING_PAYMENT("Channel Booking For Online Payment - Pending Confirmation", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- CHANNEL_BOOKING_WITH_PAYMENT_ONLINE("Channel Booking Online Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.ONLINE_PAYMENT_IN),
- CHANNEL_BOOKING_WITHOUT_PAYMENT("Channel Booking without Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- CHANNEL_PAYMENT_FOR_BOOKING_BILL("Channel Payment for Booking", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.CASH_IN),
- CHANNEL_CANCELLATION_WITH_PAYMENT("Channel Cancellation with Payment", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT),
- CHANNEL_CANCELLATION_WITH_PAYMENT_FOR_CREDIT_SETTLED_BOOKINGS("Channel Cancellation with Payment for Bills Where Credit Payment was Settled", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT),
- CHANNEL_REFUND_WITH_PAYMENT("Channel Refund with Payment", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT),
- CHANNEL_REFUND_WITH_PAYMENT_FOR_CREDIT_SETTLED_BOOKINGS("Channel Refund with Payment for Bills where Credit Payment was Settled", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT),
- CHANNEL_CANCELLATION_WITHOUT_PAYMENT("Channel Cancellation without Payment", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- CHANNEL_REFUND("Channel Refund", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT),
+ CHANNEL_BOOKING_PAYMENT("Channel Booking For Online Payment - Pending Confirmation", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING),
+ CHANNEL_BOOKING_WITH_PAYMENT_ONLINE("Channel Booking Online Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.ONLINE_PAYMENT_IN, CountedServiceType.CHANNELLING),
+ CHANNEL_BOOKING_WITHOUT_PAYMENT("Channel Booking without Payment", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING),
+ CHANNEL_PAYMENT_FOR_BOOKING_BILL("Channel Payment for Booking", BillCategory.BILL, ServiceType.CHANNELLING, BillFinanceType.CASH_IN, CountedServiceType.CHANNELLING),
+ CHANNEL_CANCELLATION_WITH_PAYMENT("Channel Cancellation with Payment", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING),
+ CHANNEL_CANCELLATION_WITH_PAYMENT_FOR_CREDIT_SETTLED_BOOKINGS("Channel Cancellation with Payment for Bills Where Credit Payment was Settled", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING),
+ CHANNEL_REFUND_WITH_PAYMENT("Channel Refund with Payment", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING),
+ CHANNEL_REFUND_WITH_PAYMENT_FOR_CREDIT_SETTLED_BOOKINGS("Channel Refund with Payment for Bills where Credit Payment was Settled", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING),
+ CHANNEL_CANCELLATION_WITHOUT_PAYMENT("Channel Cancellation without Payment", BillCategory.CANCELLATION, ServiceType.CHANNELLING, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.CHANNELLING),
+ CHANNEL_REFUND("Channel Refund", BillCategory.REFUND, ServiceType.CHANNELLING, BillFinanceType.CASH_OUT, CountedServiceType.CHANNELLING),
// OPD
- OPD_BATCH_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Opd Batch Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- OPD_BATCH_BILL_PAYMENT_COLLECTION_AT_CASHIER("Opd Batch Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN),
- OPD_BATCH_BILL_WITH_PAYMENT("Opd Batch Bill with Payment Collection", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN),
- OPD_BATCH_BILL_CANCELLATION("Opd Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- OPD_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- OPD_BILL_PAYMENT_COLLECTION_AT_CASHIER("OPD Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- OPD_BILL_WITH_PAYMENT("OPD Bill Payment with Payment", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- OPD_BILL_CANCELLATION("Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT),
- OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT),
- OPD_BILL_REFUND("Opd Bill Refund", BillCategory.REFUND, ServiceType.OPD, BillFinanceType.CASH_OUT),
- OPD_PROFESSIONAL_PAYMENT_BILL("OPD Professional Payment bill", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_OUT),
+ OPD_BATCH_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Opd Batch Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.NONE),
+ OPD_BATCH_BILL_PAYMENT_COLLECTION_AT_CASHIER("Opd Batch Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN, CountedServiceType.NONE),
+ OPD_BATCH_BILL_WITH_PAYMENT("Opd Batch Bill with Payment Collection", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN, CountedServiceType.NONE),
+ OPD_BATCH_BILL_CANCELLATION("Opd Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.NONE),
+ OPD_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.NONE),
+ OPD_BILL_PAYMENT_COLLECTION_AT_CASHIER("OPD Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD),
+ OPD_BILL_WITH_PAYMENT("OPD Bill Payment with Payment", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD),
+ 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),
@Deprecated
- OPD_BILL_WITH_PAYMENT_UNDER_BATCH_BILL("OPD Bill with payment under batch bill", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- //Packages
- PACKAGE_OPD_BATCH_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Package Opd Batch Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PACKAGE_OPD_BATCH_BILL_PAYMENT_COLLECTION_AT_CASHIER("Package Opd Batch Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN),
- PACKAGE_OPD_BATCH_BILL_WITH_PAYMENT("Package Opd Batch Bill with Payment Collection", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN),
- PACKAGE_OPD_BATCH_BILL_CANCELLATION("Package Opd Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PACKAGE_OPD_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Package Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PACKAGE_OPD_BILL_PAYMENT_COLLECTION_AT_CASHIER("Package OPD Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PACKAGE_OPD_BILL_WITH_PAYMENT("Package OPD Bill Payment with Payment", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS),
- PACKAGE_OPD_BILL_CANCELLATION("Package Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT),
- PACKAGE_OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Package Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT),
- PACKAGE_OPD_BILL_REFUND("Package Opd Bill Refund", BillCategory.REFUND, ServiceType.OPD, BillFinanceType.CASH_OUT),
- // Collecting Centre
- CC_BATCH_BILL("Collecting Centre Batch Bill", BillCategory.BILL, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_IN),
- CC_BATCH_BILL_CANCELLATION("Collecting Centre Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT),
- CC_BILL("Collecting Centre Bill", BillCategory.BILL, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_IN),
- CC_BILL_CANCELLATION("Collecting Centre Bill Cancellation", BillCategory.CANCELLATION, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT),
- CC_BILL_REFUND("Collecting Centre Bill Refund", BillCategory.REFUND, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT),
- // Float Transactions
- FUND_SHIFT_START_BILL("Shift Start Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_STARTING_BALANCE),
- FUND_SHIFT_START_BILL_CANCELLED("Shift Start Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_STARTING_BALANCE),
- FUND_SHIFT_END_BILL("Shift End Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_CLOSING_BALANCE),
- FUND_SHIFT_END_BILL_CANCELLED("Shift End Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_CLOSING_BALANCE),
- FUND_TRANSFER_BILL("Fund Transfer Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_DECREASE),
- FUND_TRANSFER_BILL_CANCELLED("Fund Transfer Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_INCREASE),
- FUND_TRANSFER_RECEIVED_BILL("Fund Transfer Received Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_INCREASE),
- FUND_TRANSFER_RECEIVED_BILL_CANCELLED("Fund Transfer Received Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_DECREASE),
- FUND_DEPOSIT_BILL("Deposit Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.BANK_OUT),
- FUND_DEPOSIT_BILL_CANCELLED("Deposit Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.BANK_IN),
- FUND_WITHDRAWAL_BILL("Withdrawal Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.BANK_IN),
- FUND_WITHDRAWAL_BILL_CANCELLED("Withdrawal Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.BANK_OUT),
- // Professional Payments
- PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_INWARD_SERVICE("Inward Payment for Staff", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN),
- PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE("Channelling Payment for Staff", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_OUT),
- PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_SESSION("Channelling session Payment for Staff", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_OUT),
- PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_CHANNELING_SERVICE_FOR_AGENCIES("Channelling Payment for Staff for agencies", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN),
- PROFESSIONAL_PAYMENT_FOR_STAFF_FOR_OPD_SERVICES("OPD Professional Payment bill", BillCategory.PAYMENTS, ServiceType.OPD, BillFinanceType.CASH_OUT),
- PETTY_CASH_ISSUE("Petty Cash Issue", BillCategory.PAYMENTS, ServiceType.OTHER, BillFinanceType.CASH_OUT),
- PETTY_CASH_RETURN("Petty Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN),
- IOU_CASH_ISSUE("Iou Cash Issue", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_OUT),
- IOU_CASH_RETURN("Iou Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN);
+ OPD_BILL_WITH_PAYMENT_UNDER_BATCH_BILL("OPD Bill with payment under batch bill", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD),
+ // PACKAGES
+ PACKAGE_OPD_BATCH_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Package Opd Batch Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD),
+ PACKAGE_OPD_BATCH_BILL_PAYMENT_COLLECTION_AT_CASHIER("Package Opd Batch Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN, CountedServiceType.OPD),
+ PACKAGE_OPD_BATCH_BILL_WITH_PAYMENT("Package Opd Batch Bill with Payment Collection", BillCategory.BILL, ServiceType.OPD, BillFinanceType.CASH_IN, CountedServiceType.OPD),
+ PACKAGE_OPD_BATCH_BILL_CANCELLATION("Package Opd Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD),
+ PACKAGE_OPD_BILL_TO_COLLECT_PAYMENT_AT_CASHIER("Package Opd Bill to Collect Payment at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD),
+ PACKAGE_OPD_BILL_PAYMENT_COLLECTION_AT_CASHIER("Package OPD Bill Payment Collection at Cashier", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD),
+ PACKAGE_OPD_BILL_WITH_PAYMENT("Package OPD Bill Payment with Payment", BillCategory.BILL, ServiceType.OPD, BillFinanceType.NO_FINANCE_TRANSACTIONS, CountedServiceType.OPD),
+ PACKAGE_OPD_BILL_CANCELLATION("Package Opd Bill Cancellation", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD),
+ PACKAGE_OPD_BILL_CANCELLATION_DURING_BATCH_BILL_CANCELLATION("Package Opd Bill Cancellation with Batch Bill", BillCategory.CANCELLATION, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD),
+ PACKAGE_OPD_BILL_REFUND("Package Opd Bill Refund", BillCategory.REFUND, ServiceType.OPD, BillFinanceType.CASH_OUT, CountedServiceType.OPD),
+ // COLLECTING CENTRE
+ CC_BATCH_BILL("Collecting Centre Batch Bill", BillCategory.BILL, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_IN, CountedServiceType.COLLECTING_CENTRE),
+ CC_BATCH_BILL_CANCELLATION("Collecting Centre Batch Bill Cancellation", BillCategory.CANCELLATION, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT, CountedServiceType.COLLECTING_CENTRE),
+ CC_BILL("Collecting Centre Bill", BillCategory.BILL, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_IN, CountedServiceType.COLLECTING_CENTRE),
+ CC_BILL_CANCELLATION("Collecting Centre Bill Cancellation", BillCategory.CANCELLATION, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT, CountedServiceType.COLLECTING_CENTRE),
+ CC_BILL_REFUND("Collecting Centre Bill Refund", BillCategory.REFUND, ServiceType.COLLECTING_CENTRE, BillFinanceType.CASH_OUT, CountedServiceType.COLLECTING_CENTRE),
+ // FLOAT TRANSACTIONS
+ FUND_SHIFT_START_BILL("Shift Start Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_STARTING_BALANCE, CountedServiceType.OTHER),
+ FUND_SHIFT_START_BILL_CANCELLED("Shift Start Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_STARTING_BALANCE, CountedServiceType.OTHER),
+ FUND_SHIFT_END_BILL("Shift End Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_CLOSING_BALANCE, CountedServiceType.OTHER),
+ FUND_SHIFT_END_BILL_CANCELLED("Shift End Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_CLOSING_BALANCE, CountedServiceType.OTHER),
+ FUND_TRANSFER_BILL("Fund Transfer Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_DECREASE, CountedServiceType.OTHER),
+ FUND_TRANSFER_BILL_CANCELLED("Fund Transfer Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_INCREASE, CountedServiceType.OTHER),
+ FUND_TRANSFER_RECEIVED_BILL("Fund Transfer Received Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.FLOAT_INCREASE, CountedServiceType.OTHER),
+ FUND_TRANSFER_RECEIVED_BILL_CANCELLED("Fund Transfer Received Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.FLOAT_DECREASE, CountedServiceType.OTHER),
+ FUND_DEPOSIT_BILL("Deposit Fund Bill", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.BANK_OUT, CountedServiceType.OTHER),
+ FUND_DEPOSIT_BILL_CANCELLED("Deposit Fund Bill - Cancelled", BillCategory.CANCELLATION, ServiceType.OTHER, BillFinanceType.BANK_IN, CountedServiceType.OTHER),
+ 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),
+ 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),
+ IOU_CASH_RETURN("Iou Cash Return", BillCategory.BILL, ServiceType.OTHER, BillFinanceType.CASH_IN, CountedServiceType.OTHER);
private final String label;
private final BillCategory billCategory;
private final ServiceType serviceType;
private final BillFinanceType billFinanceType;
+ private final CountedServiceType countedServiceType;
- BillTypeAtomic(String label, BillCategory billCategory, ServiceType serviceType, BillFinanceType billFinanceType) {
+ BillTypeAtomic(String label, BillCategory billCategory, ServiceType serviceType, BillFinanceType billFinanceType, CountedServiceType countedServiceType) {
this.label = label;
this.billCategory = billCategory;
this.serviceType = serviceType;
this.billFinanceType = billFinanceType;
+ this.countedServiceType = countedServiceType;
}
public String getLabel() {
@@ -193,7 +191,11 @@ public ServiceType getServiceType() {
}
public BillFinanceType getBillFinanceType() {
- return billFinanceType; // This is the getter method you need
+ return billFinanceType;
+ }
+
+ public CountedServiceType getCountedServiceType() {
+ return countedServiceType;
}
// Method to find BillTypeAtomic by BillFinanceType
@@ -203,9 +205,38 @@ public static List findByFinanceType(BillFinanceType financeType
.collect(Collectors.toList());
}
+ // Method to find BillTypeAtomic by BillCategory
public static List findByCategory(BillCategory category) {
return Arrays.stream(BillTypeAtomic.values())
.filter(e -> e.getBillCategory() == category)
.collect(Collectors.toList());
}
+
+ // Method to find BillTypeAtomic by ServiceType
+ public static List findByServiceType(ServiceType serviceType) {
+ return Arrays.stream(BillTypeAtomic.values())
+ .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())
+ .filter(e -> e.getCountedServiceType() == counterServiceType)
+ .collect(Collectors.toList());
+ }
+
+ // Method to find BillTypeAtomic by ServiceType and BillFinanceType
+ public static List findByServiceTypeAndFinanceType(ServiceType serviceType, BillFinanceType financeType) {
+ return Arrays.stream(BillTypeAtomic.values())
+ .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())
+ .filter(e -> e.getServiceType() == serviceType && e.getBillCategory() == billCategory)
+ .collect(Collectors.toList());
+ }
}
diff --git a/src/main/java/com/divudi/data/CountedServiceType.java b/src/main/java/com/divudi/data/CountedServiceType.java
new file mode 100644
index 0000000000..8594ce6689
--- /dev/null
+++ b/src/main/java/com/divudi/data/CountedServiceType.java
@@ -0,0 +1,28 @@
+package com.divudi.data;
+
+/**
+ * Enumerates types of services for billing purposes, categorizing bills by the type of service provided.
+ */
+public enum CountedServiceType {
+
+ OPD("Outpatient Department"),
+ OPD_OUT("Outpatient Department - Cancellation or Refunds"),
+ OPD_PROFESSIONAL_PAYMENT("Outpatient Department - Professional Payment"),
+ NONE("NONE"),
+ PHARMACY("Pharmacy"),
+ STORE("Store"),
+ CHANNELLING("Channelling"),
+ COLLECTING_CENTRE("Colelcting Centre"),
+ OTHER("Other"),
+ INWARD("Inward");
+
+ private final String label;
+
+ CountedServiceType(String label) {
+ this.label = label;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+}
diff --git a/src/main/java/com/divudi/data/Denomination.java b/src/main/java/com/divudi/data/Denomination.java
index 1dcf19c60a..932882b2e0 100644
--- a/src/main/java/com/divudi/data/Denomination.java
+++ b/src/main/java/com/divudi/data/Denomination.java
@@ -5,7 +5,7 @@
* @author buddhika
*/
public class Denomination {
- private int value;
+ private double value;
private int count;
public Denomination() {}
@@ -15,11 +15,11 @@ public Denomination(int value, int count) {
this.count = count;
}
- public int getValue() {
+ public double getValue() {
return value;
}
- public void setValue(int value) {
+ public void setValue(double value) {
this.value = value;
}
diff --git a/src/main/java/com/divudi/data/FinancialReport.java b/src/main/java/com/divudi/data/FinancialReport.java
index df070a8c71..a6d3335563 100644
--- a/src/main/java/com/divudi/data/FinancialReport.java
+++ b/src/main/java/com/divudi/data/FinancialReport.java
@@ -363,6 +363,16 @@ public List getBillTypesForCollectedCash() {
}
return billTypesForCollectedCash;
}
+
+ public List getBillTypesForChannelCollected() {
+ List cc = new ArrayList<>();
+ BillTypeAtomic.findByFinanceType(BillFinanceType.CASH_IN);
+ if (billTypesForCollectedCash == null) {
+ billTypesForCollectedCash = new ArrayList<>();
+ billTypesForCollectedCash = BillTypeAtomic.findByFinanceType(BillFinanceType.CASH_IN);
+ }
+ return billTypesForCollectedCash;
+ }
public List getPaymentMethodsForRefundedCash() {
if (paymentMethodsForRefundedCash == null) {
@@ -919,5 +929,7 @@ public List getBillTypesForShortExcess() {
}
return billTypesForShortExcess;
}
+
+
}
diff --git a/src/main/java/com/divudi/data/ReportTemplateRow.java b/src/main/java/com/divudi/data/ReportTemplateRow.java
index 965710e6d9..af872807d9 100644
--- a/src/main/java/com/divudi/data/ReportTemplateRow.java
+++ b/src/main/java/com/divudi/data/ReportTemplateRow.java
@@ -3,6 +3,7 @@
import com.divudi.entity.Category;
import com.divudi.entity.Department;
import com.divudi.entity.Institution;
+import com.divudi.entity.Item;
/**
*
@@ -16,15 +17,29 @@ public class ReportTemplateRow {
private String itemName;
private String paymentName;
private Double rowValue;
+ private Double rowValueIn;
+ private Double rowValueOut;
+ private Long rowCountIn;
+ private Long rowCountOut;
private Long rowCount;
private Long id;
private Category category;
+ private Item item;
private ServiceType serviceType;
private BillTypeAtomic billTypeAtomic;
private Institution creditCompany;
private Department toDepartment;
+ public ReportTemplateRow(Category c) {
+ this.category = c;
+ }
+
+ public ReportTemplateRow(Item item) {
+ this.item = item;
+
+ }
+
public void setFeeName(String feeName) {
this.feeName = feeName;
}
@@ -86,12 +101,30 @@ public ReportTemplateRow(String feeName, String categoryName, String toDepartmen
this.rowValue = rowValue;
this.rowCount = rowCount;
}
-
+
+ public ReportTemplateRow(String categoryName, Long rowCount, Double rowValue) {
+ this.categoryName = categoryName;
+ this.rowValue = rowValue;
+ this.rowCount = rowCount;
+ }
+
+ public ReportTemplateRow(Category category, Long rowCount, Double rowValue) {
+ this.category = category;
+ this.rowValue = rowValue;
+ this.rowCount = rowCount;
+ }
+
+ public ReportTemplateRow(Item item, Long rowCount, Double rowValue) {
+ this.item = item;
+ this.rowValue = rowValue;
+ this.rowCount = rowCount;
+ }
+
public ReportTemplateRow(String categoryName, Double rowValue) {
this.categoryName = categoryName;
this.rowValue = rowValue;
}
-
+
public ReportTemplateRow(BillTypeAtomic billTypeAtomic, String categoryName, String toDepartmentName, Double rowValue) {
this.billTypeAtomic = billTypeAtomic;
this.categoryName = categoryName;
@@ -104,7 +137,6 @@ public ReportTemplateRow(BillTypeAtomic billTypeAtomic, Double rowValue) {
this.rowValue = rowValue;
}
-
public ReportTemplateRow(Double rowValue) {
this.rowValue = rowValue;
}
@@ -173,4 +205,44 @@ public String getFeeName() {
return feeName;
}
+ public Double getRowValueIn() {
+ return rowValueIn;
+ }
+
+ public void setRowValueIn(Double rowValueIn) {
+ this.rowValueIn = rowValueIn;
+ }
+
+ public Double getRowValueOut() {
+ return rowValueOut;
+ }
+
+ public void setRowValueOut(Double rowValueOut) {
+ this.rowValueOut = rowValueOut;
+ }
+
+ public Long getRowCountIn() {
+ return rowCountIn;
+ }
+
+ public void setRowCountIn(Long rowCountIn) {
+ this.rowCountIn = rowCountIn;
+ }
+
+ public Long getRowCountOut() {
+ return rowCountOut;
+ }
+
+ public void setRowCountOut(Long rowCountOut) {
+ this.rowCountOut = rowCountOut;
+ }
+
+ public Item getItem() {
+ return item;
+ }
+
+ public void setItem(Item item) {
+ this.item = item;
+ }
+
}
diff --git a/src/main/java/com/divudi/data/ReportTemplateRowBundle.java b/src/main/java/com/divudi/data/ReportTemplateRowBundle.java
index 5064db5b99..f48f2f9685 100644
--- a/src/main/java/com/divudi/data/ReportTemplateRowBundle.java
+++ b/src/main/java/com/divudi/data/ReportTemplateRowBundle.java
@@ -12,7 +12,17 @@ public class ReportTemplateRowBundle {
private ReportTemplate reportTemplate;
private List reportTemplateRows;
+ private Double total;
+ private Double totalIn;
+ private Double totalOut;
+ private Long countIn;
+ private Long countOut;
+ private Long count;
+
+
+
+
public ReportTemplate getReportTemplate() {
return reportTemplate;
}
@@ -32,6 +42,54 @@ public void setReportTemplateRows(List reportTemplateRows) {
this.reportTemplateRows = reportTemplateRows;
}
+ public Double getTotal() {
+ return total;
+ }
+
+ public void setTotal(Double total) {
+ this.total = total;
+ }
+
+ public Double getTotalIn() {
+ return totalIn;
+ }
+
+ public void setTotalIn(Double totalIn) {
+ this.totalIn = totalIn;
+ }
+
+ public Double getTotalOut() {
+ return totalOut;
+ }
+
+ public void setTotalOut(Double totalOut) {
+ this.totalOut = totalOut;
+ }
+
+ public Long getCountIn() {
+ return countIn;
+ }
+
+ public void setCountIn(Long countIn) {
+ this.countIn = countIn;
+ }
+
+ public Long getCountOut() {
+ return countOut;
+ }
+
+ public void setCountOut(Long countOut) {
+ this.countOut = countOut;
+ }
+
+ public Long getCount() {
+ return count;
+ }
+
+ public void setCount(Long count) {
+ this.count = count;
+ }
+
diff --git a/src/main/java/com/divudi/data/TokenCount.java b/src/main/java/com/divudi/data/TokenCount.java
new file mode 100644
index 0000000000..c6e1616926
--- /dev/null
+++ b/src/main/java/com/divudi/data/TokenCount.java
@@ -0,0 +1,49 @@
+package com.divudi.data;
+
+import com.divudi.entity.Department;
+import com.divudi.entity.Staff;
+
+public class TokenCount {
+ private Department department;
+ private Long tokenCount;
+ private Staff staff;
+
+ public TokenCount() {
+ }
+
+ public TokenCount(Department department, Staff staff, Long tokenCount) {
+ this.department = department;
+ this.tokenCount = tokenCount;
+ this.staff = staff;
+ }
+
+
+
+ public Department getDepartment() {
+ return department;
+ }
+
+ public void setDepartment(Department department) {
+ this.department = department;
+ }
+
+ public Long getTokenCount() {
+ return tokenCount;
+ }
+
+ public void setTokenCount(Long tokenCount) {
+ this.tokenCount = tokenCount;
+ }
+
+ public Staff getStaff() {
+ return staff;
+ }
+
+ public void setStaff(Staff staff) {
+ this.staff = staff;
+ }
+
+
+
+
+}
diff --git a/src/main/java/com/divudi/data/analytics/ReportTemplateType.java b/src/main/java/com/divudi/data/analytics/ReportTemplateType.java
index d52b6ceb15..d5126234a5 100644
--- a/src/main/java/com/divudi/data/analytics/ReportTemplateType.java
+++ b/src/main/java/com/divudi/data/analytics/ReportTemplateType.java
@@ -6,6 +6,7 @@
*/
public enum ReportTemplateType {
BILL_LIST("Bill List"),
+ BILL_NET_TOTAL("Bill Net Total"),
BILL_ITEM_LIST("Bill Item List"),
BILL_FEE_LIST("Bill Fee List"),
PATIENT_LIST("Patient List"),
@@ -23,6 +24,7 @@ public enum ReportTemplateType {
ITEM_CATEGORY_SUMMARY_BY_BILL_FEE("Item Category Summary by Bill Fee"),
ITEM_CATEGORY_SUMMARY_BY_BILL_ITEM("Item Category Summary by Bill Item"),
ITEM_CATEGORY_SUMMARY_BY_BILL("Item Category Summary by Bill"),
+ ITEM_SUMMARY_BY_BILL("Item Summary by Bill"),
TO_DEPARTMENT_SUMMARY_BY_BILL_FEE("To Department Summary by Bill Fee"),
TO_DEPARTMENT_SUMMARY_BY_BILL_ITEM("To Department Summary by Bill Item"),
TO_DEPARTMENT_SUMMARY_BY_BILL("To Department Summary by Bill");
diff --git a/src/main/java/com/divudi/ejb/ServiceSessionBean.java b/src/main/java/com/divudi/ejb/ServiceSessionBean.java
index 978b863740..cd00e5a242 100644
--- a/src/main/java/com/divudi/ejb/ServiceSessionBean.java
+++ b/src/main/java/com/divudi/ejb/ServiceSessionBean.java
@@ -215,7 +215,9 @@ public int getSessionNumber(ServiceSession serviceSession, Date sessionDate) {
BillType.ChannelOnCall,
BillType.ChannelStaff,
BillType.ClinicalOpdBooking,
- BillType.ChannelCredit
+ BillType.ChannelCredit,
+ BillType.ChannelResheduleWithOutPayment,
+ BillType.ChannelResheduleWithPayment
};
List bts = Arrays.asList(billTypes);
@@ -257,7 +259,9 @@ public int getSessionNumber(ServiceSession serviceSession, Date sessionDate, Bil
BillType.ChannelCash,
BillType.ChannelOnCall,
BillType.ChannelStaff,
- BillType.ChannelCredit};
+ BillType.ChannelCredit,
+ BillType.ChannelResheduleWithOutPayment,
+ BillType.ChannelResheduleWithPayment};
List bts = Arrays.asList(billTypes);
String sql = "Select bs From BillSession bs where "
@@ -321,7 +325,9 @@ public Integer getNextNonReservedSerialNumber(SessionInstance si, List
BillType.ChannelCash,
BillType.ChannelOnCall,
BillType.ChannelStaff,
- BillType.ChannelCredit
+ BillType.ChannelCredit,
+ BillType.ChannelResheduleWithOutPayment,
+ BillType.ChannelResheduleWithPayment
};
List bts = Arrays.asList(billTypes);
@@ -360,7 +366,9 @@ public Integer getNextAvailableReservedNumber(SessionInstance si, List
BillType.ChannelCash,
BillType.ChannelOnCall,
BillType.ChannelStaff,
- BillType.ChannelCredit
+ BillType.ChannelCredit,
+ BillType.ChannelResheduleWithOutPayment,
+ BillType.ChannelResheduleWithPayment
};
List bts = Arrays.asList(billTypes);
diff --git a/src/main/java/com/divudi/entity/Payment.java b/src/main/java/com/divudi/entity/Payment.java
index 9240ddc60a..a96a83d636 100644
--- a/src/main/java/com/divudi/entity/Payment.java
+++ b/src/main/java/com/divudi/entity/Payment.java
@@ -99,10 +99,9 @@ public class Payment implements Serializable {
@ManyToOne
Department department;
-
@Transient
private List currencyDenominations;
-
+
@Transient
private List humanReadableDenominations;
@@ -113,14 +112,19 @@ public Long getId() {
public void setId(Long id) {
this.id = id;
}
-
+
public List getHumanReadableDenominations() {
List humanReadableList = new ArrayList<>();
deserializeDenominations();
if (this.currencyDenominations != null) {
for (Denomination denomination : this.currencyDenominations) {
- String humanReadable = "Denomination: " + denomination.getValue() + ", Count: " + denomination.getCount() + ", Value: " + (denomination.getValue() * denomination.getCount());
- humanReadableList.add(humanReadable);
+ if (denomination.getCount() > 0) {
+ String valueFormatted = String.format("%.2f", denomination.getValue());
+ String countFormatted = String.format("%d", denomination.getCount());
+ String totalFormatted = String.format("%.2f", denomination.getValue() * denomination.getCount());
+ String humanReadable = "(" + valueFormatted + "x" + countFormatted + "=" + totalFormatted + ")";
+ humanReadableList.add(humanReadable);
+ }
}
}
return humanReadableList;
@@ -389,8 +393,6 @@ public void serializeDenominations() {
this.currencyDenominationsJson = "[]"; // Empty JSON array if currencyDenominations is null
}
}
-
-
public void deserializeDenominations() {
if (this.currencyDenominationsJson != null && !this.currencyDenominationsJson.isEmpty()) {
@@ -414,7 +416,6 @@ public void deserializeDenominations() {
}
}
-
public String getCurrencyDenominationsJson() {
return currencyDenominationsJson;
}
@@ -426,6 +427,5 @@ public List getCurrencyDenominations() {
public void setCurrencyDenominations(List currencyDenominations) {
this.currencyDenominations = currencyDenominations;
}
-
-
+
}
diff --git a/src/main/java/com/divudi/facade/AbstractFacade.java b/src/main/java/com/divudi/facade/AbstractFacade.java
index cb49d3ba8c..f1093bc4c3 100644
--- a/src/main/java/com/divudi/facade/AbstractFacade.java
+++ b/src/main/java/com/divudi/facade/AbstractFacade.java
@@ -369,9 +369,7 @@ public List> findLightsByJpql(String jpql, Map parameters, Tem
return resultList;
}
-
-
-
+
public List> findLightsByJpql(String jpql, Map parameters, TemporalType tt, int maxRecords) {
Query qry = getEntityManager().createQuery(jpql);
Set> entries = parameters.entrySet();
@@ -1036,6 +1034,28 @@ public List