Skip to content

Commit

Permalink
Merge pull request #6863 from hmislk/Issue#6854
Browse files Browse the repository at this point in the history
Issue#6854 Closes #6854
  • Loading branch information
Irani96 authored Aug 21, 2024
2 parents b5d9f54 + f3589eb commit ead6903
Show file tree
Hide file tree
Showing 21 changed files with 747 additions and 686 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ public void sessionReschedule() {
JsfUtil.addErrorMessage("Cannot reschedule: This bill session has been Alrady Recheduled To Another Session !");
}

if (selectedBillSession.getReferenceBillSession() == null) {
if (selectedBillSession.getReferenceBillSession() == null) { // TODO: can remove after ReferenceBillSession is deprecated
createBillSessionForReschedule(selectedBillSession, getSelectedSessionInstanceForRechedule());
JsfUtil.addSuccessMessage("Reschedule Successfully");
sendSmsOnChannelBookingReschedule();
Expand Down Expand Up @@ -441,13 +441,15 @@ private void createBillSessionForReschedule(BillSession bs, SessionInstance si)
newBillSession.copy(bs);
newBillSession.setBill(printingBill);
newBillSession.setBillItem(savingBillItem);
newBillSession.setReferenceBillSession(bs);
newBillSession.setRescheduledFromBillSession(bs);
newBillSession.setCreatedAt(new Date());
newBillSession.setCreater(getSessionController().getLoggedUser());
newBillSession.setSessionInstance(getSelectedSessionInstanceForRechedule());
newBillSession.setSessionDate(getSelectedSessionInstanceForRechedule().getSessionDate());
newBillSession.setSessionTime(getSelectedSessionInstanceForRechedule().getSessionTime());
newBillSession.setStaff(getSelectedSessionInstanceForRechedule().getStaff());
newBillSession.setSerialNo(0);
getBillSessionFacade().create(newBillSession);

printingBill.setSingleBillSession(newBillSession);
printingBill.setSingleBillItem(savingBillItem);
Expand All @@ -470,7 +472,7 @@ private void createBillSessionForReschedule(BillSession bs, SessionInstance si)
savingBillItem.setHospitalFee(billBeanController.calFeeValue(FeeType.OwnInstitution, savingBillItem));
savingBillItem.setStaffFee(billBeanController.calFeeValue(FeeType.Staff, savingBillItem));
savingBillItem.setBillSession(newBillSession);
getBillSessionFacade().edit(newBillSession);
getBillItemFacade().edit(savingBillItem);
printingBill.setHospitalFee(billBeanController.calFeeValue(FeeType.OwnInstitution, printingBill));
printingBill.setStaffFee(billBeanController.calFeeValue(FeeType.Staff, printingBill));
printingBill.setSingleBillItem(savingBillItem);
Expand Down Expand Up @@ -511,9 +513,9 @@ private void createBillSessionForReschedule(BillSession bs, SessionInstance si)
newBillSession.setSerialNo(1);
System.out.println("count serial number= " + bs.getSerialNo());
}
getBillSessionFacade().create(newBillSession);
getBillSessionFacade().edit(newBillSession);
bs.setRecheduledSession(true);
bs.setReferenceBillSession(newBillSession);
bs.setRescheduledToBillSession(newBillSession);
getBillSessionFacade().edit(bs);
newBillSessionForSMS = newBillSession;
System.out.println("newBillSessionForSMS = " + newBillSessionForSMS);
Expand Down Expand Up @@ -593,8 +595,10 @@ private Bill createBillForChannelReshedule(BillSession bs) {
bill.setDeptId(deptId);
bill.setInsId(deptId);

bill.setPaidAmount(bs.getBill().getPaidAmount());
bill.setPaidAt(new Date());
if (bill.getBillTypeAtomic() == BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT) {
bill.setPaidAmount(getSelectedSessionInstanceForRechedule().getOriginatingSession().getTotal());
bill.setPaidAt(new Date());
}

bill.setBillDate(new Date());
bill.setBillTime(new Date());
Expand Down Expand Up @@ -1048,41 +1052,41 @@ public void addSingleDateToToDate() {
cal.setTime(getFromDate());
cal.add(Calendar.DATE, 1);
toDate = cal.getTime();
listAllSesionInstances();
filterSessionInstances();
listAndFilterSessionInstances();
// filterSessionInstances();
}

public void addToDayToToDate() {
toDate = new Date();
listAllSesionInstances();
filterSessionInstances();
listAndFilterSessionInstances();
// filterSessionInstances();
}

public void addTwoDays() {
Calendar cal = Calendar.getInstance();
cal.setTime(getFromDate());
cal.add(Calendar.DATE, 2);
toDate = cal.getTime();
listAllSesionInstances();
filterSessionInstances();
listAndFilterSessionInstances();
// filterSessionInstances();
}

public void addSevenDays() {
Calendar cal = Calendar.getInstance();
cal.setTime(getFromDate());
cal.add(Calendar.DATE, 7);
toDate = cal.getTime();
listAllSesionInstances();
filterSessionInstances();
listAndFilterSessionInstances();
// filterSessionInstances();
}

public void addMonth() {
Calendar cal = Calendar.getInstance();
cal.setTime(getFromDate());
cal.add(Calendar.MONTH, 1);
toDate = cal.getTime();
listAllSesionInstances();
filterSessionInstances();
listAndFilterSessionInstances();
// filterSessionInstances();
}

public void addMonthNew() {
Expand Down Expand Up @@ -1173,6 +1177,15 @@ public void listCompleted() {
listAndFilterSessionInstances();
}

public void listCancelled() {
listAll = false;
listPending = false;
listCancelled = true;
listOngoing = false;
listCompleted = false;
listAndFilterSessionInstances();
}

public void addBillSessionData() {
if (configOptionApplicationController.getBooleanValueByKey("Calculate All Patient Count When Loading Channel Booking By Dates")) {
if (sessionInstances != null) {
Expand Down Expand Up @@ -1584,7 +1597,7 @@ public void init() {

needToFillSessionInstances = viewScopeDataTransferController.getNeedToFillSessionInstances();
if (needToFillSessionInstances == null || needToFillSessionInstances != false) {
listAllSesionInstances();
listAndFilterSessionInstances();
}

selectedSessionInstance = viewScopeDataTransferController.getSelectedSessionInstance();
Expand Down Expand Up @@ -1634,7 +1647,7 @@ public String navigateToChannelBookingFromMenuByDate() {
if (financialTransactionController.getNonClosedShiftStartFundBill() != null) {
fromDate = new Date();
toDate = new Date();
// listAllSesionInstances();
// listAndFilterSessionInstances();
prepareForNewChannellingBill();
return "/channel/channel_booking_by_date?faces-redirect=true";
} else {
Expand All @@ -1644,7 +1657,7 @@ public String navigateToChannelBookingFromMenuByDate() {
} else {
fromDate = new Date();
toDate = new Date();
// listAllSesionInstances();
// listAndFilterSessionInstances();
// prepareForNewChannellingBill();
return "/channel/channel_booking_by_date?faces-redirect=true";
}
Expand Down Expand Up @@ -1750,16 +1763,6 @@ public String navigateToChannelQueueFromConsultantRoom() {
return "/channel/channel_queue?faces-redirect=true";
}

public void listAllSesionInstances() {
sessionInstances = channelBean.listSessionInstances(fromDate, toDate, null, null, null);
if (configOptionApplicationController.getBooleanValueByKey("Calculate All Patient Count When Loading Channel Booking By Dates")) {
for (SessionInstance s : sessionInstances) {
fillBillSessions(s);
}
}
filterSessionInstances();
}

public void listOngoingSesionInstances() {
sessionInstances = channelBean.listSessionInstances(fromDate, toDate, true, null, null);
filterSessionInstances();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,10 @@ private Bill createBillForChannelReshedule(BillSession bs) {
bill.setDeptId(deptId);
bill.setInsId(deptId);

bill.setPaidAmount(getSelectedSessionInstanceForRechedule().getOriginatingSession().getTotal());
bill.setPaidAt(new Date());
if (bill.getBillTypeAtomic() == BillTypeAtomic.CHANNEL_RESHEDULE_WITH_PAYMENT) {
bill.setPaidAmount(getSelectedSessionInstanceForRechedule().getOriginatingSession().getTotal());
bill.setPaidAt(new Date());
}

bill.setBillDate(new Date());
bill.setBillTime(new Date());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,12 @@ public void processAndfillDailySessionCounts() {
m.put("ins", institution);
j += " and si.institution=:ins ";
}

m.put("fd", fromDate);
m.put("td", toDate);

sessionInstances = sessionInstanceFacade.findByJpql(j, m);
System.out.println("sessionInstance = " + sessionInstances);
for (SessionInstance si : sessionInstances) {
fillBillSessions(si);
}
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/com/divudi/bean/hr/GradeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ public class GradeController implements Serializable {
private List<Grade> items = null;
String selectText = "";

public List<Grade> getSelectedItems() {
selectedItems = getFacade().findByJpql("select c from Grade c where c.retired=false and (c.name) like '%" + getSelectText().toUpperCase() + "%' order by c.name");
return selectedItems;
}


public List<Grade> completeGrade(String qry) {
List<Grade> a = null;
Expand Down
Loading

0 comments on commit ead6903

Please sign in to comment.