Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue#4671 #4676

Merged
merged 18 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/build/
/dist/
/target/
/src/main/resources/version.txt
/src/main/resources/VERSION.txt
/src/main/webapp/WEB-INF/glassfish-resources.xml
/faces-config.NavData
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ public String settleFundTransferBill() {

billController.save(currentBill);
for (Payment p : getCurrentBillPayments()) {
System.out.println("p = " + p);
p.setBill(currentBill);
p.setDepartment(sessionController.getDepartment());
p.setInstitution(sessionController.getInstitution());
Expand Down Expand Up @@ -507,8 +506,6 @@ public void fillPaymentsFromShiftStartToNow() {
atomicBillTypeTotals = new AtomicBillTypeTotals();
for (Payment p : currentBillPayments) {
if (p.getBill().getBillTypeAtomic() == null) {
System.out.println("p = " + p);
System.out.println("p.getBill() = " + p.getBill());
}
atomicBillTypeTotals.addOrUpdateAtomicRecord(p.getBill().getBillTypeAtomic(), p.getPaymentMethod(), p.getPaidValue());
calculateBillValuesFromBillTypes(p);
Expand All @@ -519,15 +516,12 @@ public void fillPaymentsFromShiftStartToNow() {

public void calculateBillValuesFromBillTypes(Payment p) {
if (p.getBill() == null) {
System.err.println("No Bill for the Payment = " + p);
return;
}
if (p.getBill().getBillType() == null) {
System.err.println("No Bill Type for the Payment = " + p);
return;
}
if (p.getBill().getBillTypeAtomic() == null) {
System.err.println("No Bill Type Atomic for the Payment = " + p);
return;
}

Expand All @@ -536,7 +530,6 @@ public void calculateBillValuesFromBillTypes(Payment p) {
if (p.getPaidValue() != 0.0) {
paymentMethodValues.addValue(p);
} else {
System.out.println("No Paid Value for Bill = " + p);
paymentMethodValues.addValue(p.getBill());
}
break;
Expand All @@ -545,7 +538,6 @@ public void calculateBillValuesFromBillTypes(Payment p) {
if (p.getPaidValue() != 0.0) {
paymentMethodValues.deductAbsoluteValue(p);
} else {
System.out.println("No Paid Value for Bill = " + p);
paymentMethodValues.deductAbsoluteValue(p.getBill());
}
break;
Expand Down
45 changes: 24 additions & 21 deletions src/main/java/com/divudi/bean/channel/BookingController.java
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ public String navigateToAddBooking() {
}

public void fillFees() {
System.out.println("fillFees");
selectedItemFees = new ArrayList<>();
sessionFees = new ArrayList<>();
addedItemFees = new ArrayList<>();
Expand All @@ -341,17 +340,13 @@ public void fillFees() {
m.put("ses", selectedSessionInstance.getOriginatingSession());

sessionFees = itemFeeFacade.findByJpql(sql, m);
System.out.println("sessionFees = " + sessionFees);
m = new HashMap();
sql = "Select f from ItemFee f "
+ " where f.retired=false "
+ " and f.item=:item "
+ " order by f.id";
m.put("item", itemToAddToBooking);
System.out.println("m = " + m);
System.out.println("sql = " + sql);
addedItemFees = itemFeeFacade.findByJpql(sql, m);
System.out.println("addedItemFees = " + addedItemFees);
if (sessionFees != null) {
selectedItemFees.addAll(sessionFees);
}
Expand All @@ -366,7 +361,6 @@ public void fillFees() {
feeTotalForSelectedBill += tbf.getFee();
}
}
System.out.println("feeTotalForSelectedBill = " + feeTotalForSelectedBill);
}

public String navigateToChannelBookingFromMenu() {
Expand Down Expand Up @@ -741,7 +735,6 @@ public void sendSmsOnChannelDoctorArrival() {
}
for (BillSession bs : billSessions) {
if (bs.getBill() == null) {
System.err.println("No Billl for Bill Session");
continue;
}
if (bs.getBill().getPatient().getPerson().getSmsNumber() == null) {
Expand Down Expand Up @@ -772,7 +765,6 @@ public void sendSmsOnChannelMissingChannelBookings() {
}
for (BillSession bs : billSessions) {
if (bs.getBill() == null) {
System.err.println("No Billl for Bill Session");
continue;
}
if (bs.getBill().getPatient().getPerson().getSmsNumber() == null) {
Expand Down Expand Up @@ -819,19 +811,15 @@ private String createChanellBookingSms(Bill b) {

public String createSmsForChannelBooking(Bill b, String template) {
if (b == null) {
System.err.println("No Bill");
return "";
}
if (b.getSingleBillSession() == null) {
System.err.println("No Bill Session");
return "";
}
if (b.getSingleBillSession().getSessionInstance() == null) {
System.err.println("No Session Instances");
return "";
}
if (b.getSingleBillSession().getSessionInstance().getOriginatingSession() == null) {
System.err.println("No Bill Session");
return "";
}
SessionInstance si = b.getSingleBillSession().getSessionInstance();
Expand Down Expand Up @@ -2056,7 +2044,6 @@ public List<ItemFee> findServiceSessionFees(ServiceSession ss) {
+ " order by f.id";
m.put("ses", ss);
List<ItemFee> tfs = itemFeeFacade.findByJpql(sql, m);
System.out.println("tfs = " + tfs);
return tfs;
}

Expand Down Expand Up @@ -2202,14 +2189,10 @@ private void calculateBillTotalsFromBillFees(Bill billToCaclculate, List<BillFee
double calculatingNetBillTotal = 0.0;

for (BillFee iteratingBillFee : billfeesAvailable) {
System.out.println("iteratingBillFee = " + iteratingBillFee);
Fee currentItemFee;
if (iteratingBillFee.getFee() == null) {
System.err.println("No Fee for Bill Fee");
continue;
}
System.out.println("iteratingBillFee.getFeeGrossValue() = " + iteratingBillFee.getFeeGrossValue());
System.out.println("iteratingBillFee.getFeeValue() = " + iteratingBillFee.getFeeValue());


calculatingGrossBillTotal += iteratingBillFee.getFeeGrossValue();
Expand All @@ -2223,7 +2206,6 @@ private void calculateBillTotalsFromBillFees(Bill billToCaclculate, List<BillFee
}

private Bill createBill() {
System.out.println("create bill started = " + new Date());
Bill bill = new BilledBill();
bill.setStaff(getSelectedSessionInstance().getOriginatingSession().getStaff());
bill.setToStaff(toStaff);
Expand Down Expand Up @@ -2288,15 +2270,36 @@ private Bill createBill() {
// return null;
// }
// bill.setInsId(insId);
System.out.println("generate insId started = " + new Date());
// String insId = generateBillNumberInsId(bill);
//
// if (insId.equals("")) {
// return null;
// }
// bill.setInsId(insId);

System.out.println("generate deptId started = " + new Date());
// String insId = generateBillNumberInsId(bill);
//
// if (insId.equals("")) {
// return null;
// }
// bill.setInsId(insId);
// String insId = generateBillNumberInsId(bill);
//
// if (insId.equals("")) {
// return null;
// }
// bill.setInsId(insId);
// String insId = generateBillNumberInsId(bill);
//
// if (insId.equals("")) {
// return null;
// }
// bill.setInsId(insId);
// String insId = generateBillNumberInsId(bill);
//
// if (insId.equals("")) {
// return null;
// }
// bill.setInsId(insId);
String deptId = generateBillNumberDeptId(bill);

if (deptId.equals("")) {
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/com/divudi/bean/channel/ChannelBillController.java
Original file line number Diff line number Diff line change
Expand Up @@ -781,28 +781,22 @@ public void cancelAgentPaidBill() {
}

public void cancelCreditPaidBill() {
System.out.println("cancelCreditPaidBill");
System.out.println("getBillSession() = " + getBillSession());
if (getBillSession() == null) {
JsfUtil.addErrorMessage("No BillSession");
return;
}
System.out.println("getBillSession().getBill() = " + getBillSession().getBill());
if (getBillSession().getBill() == null) {
JsfUtil.addErrorMessage("No Bill To Cancel");
return;
}
System.out.println("getBillSession().getPaidBillSession() = " + getBillSession().getPaidBillSession());
if (getBillSession().getPaidBillSession() == null) {
JsfUtil.addErrorMessage("No Paid Paid Bill Session");
return;
}
System.out.println("getBillSession().getPaidBillSession().getBill() = " + getBillSession().getPaidBillSession().getBill());
if (getBillSession().getPaidBillSession().getBill() == null) {
JsfUtil.addErrorMessage("No Paid Paid Bill Session");
return;
}
System.out.println("getBillSession().getPaidBillSession().getBill().isRefunded() = " + getBillSession().getPaidBillSession().getBill().isRefunded());
if (getBillSession().getPaidBillSession().getBill().isRefunded()) {
JsfUtil.addErrorMessage("Already Refunded");
return;
Expand Down Expand Up @@ -1499,17 +1493,13 @@ private void savePatient() {
//
// }
public void add() {
System.out.println("add");
errorText = "";
if (errorCheck()) {
settleSucessFully = false;
return;
}
System.out.println("Error check completed");
savePatient();
System.out.println("Saving patient completed");
printingBill = saveBilledBill();
System.out.println("Printing bill completed");
printingBill = getBillFacade().find(printingBill.getId());
bookingController.fillBillSessions();
bookingController.generateSessions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ public void sendSmsOnChannelDoctorArrival() {
}
for (BillSession bs : billSessions) {
if (bs.getBill() == null) {
System.err.println("No Billl for Bill Session");
continue;
}
if (bs.getBill().getPatient().getPerson().getSmsNumber() == null) {
Expand Down Expand Up @@ -382,43 +381,34 @@ public void removeAdditionalItems() {
}

public void addAdditionalItems() {
System.out.println("addAdditionalItems");
System.out.println("current = " + current);
if (current == null) {
JsfUtil.addErrorMessage("No Session Selected yet");
return;
}
System.out.println("current.getId() = " + current.getId());
if (current.getId() == null) {
saveSelected();
}
System.out.println("additionalItemToAdd = " + additionalItemToAdd);
if (additionalItemToAdd == null) {
JsfUtil.addErrorMessage("No Item Selected to add");
return;
}
System.out.println("additionalItemsAddedForCurrentSession = " + additionalItemsAddedForCurrentSession);
if (getAdditionalItemsAddedForCurrentSession() == null) {
JsfUtil.addErrorMessage("No Items List");
return;
}
ItemForItem aii = itemForItemController.findItemForItem(current, additionalItemToAdd);
System.out.println("1 aii = " + aii);
if (aii != null) {
JsfUtil.addErrorMessage("Item is already added");
return;
} else {
aii = itemForItemController.addItemForItem(current, additionalItemToAdd);
}
System.out.println("2 aii = " + aii);
if (aii == null) {
JsfUtil.addErrorMessage("Error in adding");
return;
}
System.out.println("3 aii = " + aii);
getAdditionalItemsAddedForCurrentSession().add(aii);
additionalItemToAdd = null;
System.out.println("getAdditionalItemsAddedForCurrentSession = " + getAdditionalItemsAddedForCurrentSession());
JsfUtil.addSuccessMessage("Added");
}

Expand Down Expand Up @@ -770,7 +760,6 @@ public List<ServiceSession> fetchCreatedServiceSessions(ServiceSession ss) {

public void fillSessionInstance(){
sessionInstances=fetchCreatedSessionsInstances(current);
System.out.println("sessionInstances = " + sessionInstances.size());
}

public List<SessionInstance> fetchCreatedSessionsInstances(ServiceSession ss) {
Expand Down Expand Up @@ -897,7 +886,6 @@ public void saveFeeChanges() {
&& (fc.getValidFrom().getTime() == c.getValidFrom().getTime())) {
JsfUtil.addErrorMessage("This Fee Already Add - " + c.getFee().getName() + " , " + c.getFee().getFeeType() + " , " + c.getValidFrom());
} else {
System.out.println("fc.getFee().getName() = " + fc.getFee().getName());
if ((fc.getFee().getFee() != 0 || fc.getFee().getFfee() != 0) && (fc.getFee().getFee() != c.getFee().getFee() || fc.getFee().getFfee() != fc.getFee().getFfee())) {
fc.setValidFrom(effectiveDate);
fc.setCreatedAt(new Date());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,10 @@ public void searchForBillSessions() {
m.put("class", BilledBill.class);

if (getFromDate() != null && getToDate() != null) {
System.out.println("getBillSessionFacade().findByJpql(sql, m, TemporalType.TIMESTAMP) = " + getBillSessionFacade().findByJpql(sql, m, TemporalType.TIMESTAMP));
searchedBillSessions = getBillSessionFacade().findByJpql(sql, m, TemporalType.TIMESTAMP);
} else {
searchedBillSessions = getBillSessionFacade().findByJpql(sql, m);
}
System.out.println("searchedBillSessions = " + searchedBillSessions);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,25 +696,21 @@ private boolean checkBillFeeValue() {

private boolean errorCheck() {
if (currentStaff == null) {
System.out.println("currentStaff = " + currentStaff);
JsfUtil.addErrorMessage("Please select a Staff Memeber");
return true;
}

if (checkBillFeeValue()) {
System.out.println("checkBillFeeValue = " + checkBillFeeValue());
JsfUtil.addErrorMessage("There is a Credit Bill");
return true;
}

performCalculations();
if (totalPaying == 0) {
System.out.println("totalPaying = " + totalPaying);
JsfUtil.addErrorMessage("Total Paying Amount is zero. Please select payments to update");
return true;
}
if (paymentMethod == null) {
System.out.println("paymentMethod = " + paymentMethod);
JsfUtil.addErrorMessage("Please select a payment method");
return true;
}
Expand All @@ -728,19 +724,16 @@ private boolean errorCheckForSessionPayments() {
return true;
}
if (checkBillFeeValue()) {
System.out.println("checkBillFeeValue = " + checkBillFeeValue());
JsfUtil.addErrorMessage("There is a Credit Bill");
return true;
}

performCalculations();
if (totalPaying == 0) {
System.out.println("totalPaying = " + totalPaying);
JsfUtil.addErrorMessage("Total Paying Amount is zero. Please select payments to update");
return true;
}
if (paymentMethod == null) {
System.out.println("paymentMethod = " + paymentMethod);
JsfUtil.addErrorMessage("Please select a payment method");
return true;
}
Expand Down Expand Up @@ -773,7 +766,6 @@ private boolean errorCheckForAgency() {
}

public void settleBill() {
System.out.println("errorCheck() = " + errorCheck());
if (errorCheck()) {
return;
}
Expand All @@ -782,7 +774,6 @@ public void settleBill() {
current = b;
getBillFacade().create(b);
saveBillItemsAndFees(b);
System.out.println("sessionController.getDepartmentPreference().isDocterPaymentSMS() = " + sessionController.getDepartmentPreference().isSendSmsOnChannelBookingDocterPayment());
if (sessionController.getDepartmentPreference().isSendSmsOnChannelBookingDocterPayment()) {
sendSmsAfterDocPayment();
}
Expand Down Expand Up @@ -838,7 +829,6 @@ public void sendSmsAfterDocPayment() {
e.setCreatedAt(new Date());
e.setCreater(sessionController.getLoggedUser());
e.setReceipientNumber(current.getStaff().getPerson().getPhone());
System.out.println("DocPaymentSms = " + generateDoctorPaymentSms(current));
e.setSendingMessage(generateDoctorPaymentSms(current));
e.setDepartment(getSessionController().getLoggedUser().getDepartment());
e.setInstitution(getSessionController().getLoggedUser().getInstitution());
Expand Down
Loading