Skip to content

Commit

Permalink
Up to date changes to coop testing (#10511)
Browse files Browse the repository at this point in the history
* Closed #9499 (#10492)

Signed-off-by: pubudu piyankara <[email protected]>

* Closing stock report (#10497)

* code refactor

* code refactor

* code refactor

* batch wise report

* item wise report

* item wise report

* closing stock report

---------

Co-authored-by: imexh <[email protected]>

* 10420 improvements in grn summary   procurements reports (#10494)

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

* Signed-off-by: SandithP2001 <[email protected]>

---------

Co-authored-by: imexh <[email protected]>

* Fixed #10403 (#10495)

Signed-off-by: Lawan Samarasekara <[email protected]>

Co-authored-by: imexh <[email protected]>

* Issue#10477 fix need validation for credit limit (#10503)

* Added Validations to Credit Limit

* Added Validation

* Fixed #10477

* Issue#10504 interim bill button is not showing after final bill is cancelled (#10505)

* 10496 improvements in grn summary   procurements reports bugs (#10506)

* 10459 samples barcode stickers are not generated in some instances (#10461)

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #10459

No issue was found. sample tunes were not assgined to investigation

Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

---------

Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>
Co-authored-by: imexh <[email protected]>

* 10488 issue in opd doctors mark out (#10489)

* Mark in UI Improved

Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #10488
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* Closes #10488
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

---------

Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>

* 6273 need to manage save document send for approval approve status transfer issue (#10501)

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* add new view for tranfer issue request and approval process

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* add method to retrive all tranfer request

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Add approval privillage and only privillage holder can approve the request

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

---------

Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>

* 10500 consumption report bug fixes (#10508)

* Issue#10458 inpatient credit company payment bill cancellation (#10510)

---------

Signed-off-by: pubudu piyankara <[email protected]>
Signed-off-by: Dr M H Buddhika Ariyaratne <[email protected]>
Signed-off-by: Chinthaka Prasad Wijerathna <[email protected]>
Co-authored-by: Pubudu Piyankara <[email protected]>
Co-authored-by: Imesh Ranawella <[email protected]>
Co-authored-by: imexh <[email protected]>
Co-authored-by: Sandith Pivithuru <[email protected]>
Co-authored-by: Lawan Chaamindu Jayalath Samarasekara <[email protected]>
Co-authored-by: Dr. M H B Ariyaratne <[email protected]>
  • Loading branch information
7 people authored Feb 13, 2025
1 parent f6045a6 commit 490f8dd
Show file tree
Hide file tree
Showing 35 changed files with 2,415 additions and 875 deletions.
61 changes: 57 additions & 4 deletions src/main/java/com/divudi/bean/common/CreditCompanyBillSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,22 @@ public List<Bill> getBillsOwn() {
return bills;
}

public String navigateToBillPreview(Bill b) {
String page;
switch (b.getBillTypeAtomic()) {
case INPATIENT_CREDIT_COMPANY_PAYMENT_RECEIVED:
page = "/credit/inpatient_credit_company_bill_reprint?faces-redirect=true";
break;
case OPD_CREDIT_COMPANY_PAYMENT_RECEIVED:
page = "/credit/credit_company_bill_reprint?faces-redirect=true";
break;
default:
page = "credit_company_bill_reprint?faces-redirect=true";
break;
}
return page;
}

public BillFeeFacade getBillFeeFacade() {
return billFeeFacade;
}
Expand Down Expand Up @@ -269,13 +285,13 @@ private boolean checkPaid() {
return false;
}

private CancelledBill createCancelBill() {
private CancelledBill createCancelBill(BillNumberSuffix billSuffix) {
CancelledBill cb = new CancelledBill();
cb.copy(getBill());
cb.invertAndAssignValuesFromOtherBill(getBill());

cb.setDeptId(getBillNumberBean().departmentBillNumberGenerator(getSessionController().getDepartment(), BillType.CashRecieveBill, BillClassType.CancelledBill, BillNumberSuffix.CRDCAN));
cb.setInsId(getBillNumberBean().institutionBillNumberGenerator(getSessionController().getInstitution(), BillType.CashRecieveBill, BillClassType.CancelledBill, BillNumberSuffix.CRDCAN));
cb.setDeptId(getBillNumberBean().departmentBillNumberGenerator(getSessionController().getDepartment(), BillType.CashRecieveBill, BillClassType.CancelledBill, billSuffix));
cb.setInsId(getBillNumberBean().institutionBillNumberGenerator(getSessionController().getInstitution(), BillType.CashRecieveBill, BillClassType.CancelledBill, billSuffix));

cb.setBilledBill(getBill());
cb.setBillDate(new Date());
Expand Down Expand Up @@ -371,7 +387,7 @@ public void cancelBill() {
return;
}

CancelledBill cb = createCancelBill();
CancelledBill cb = createCancelBill(BillNumberSuffix.CRDCAN);

//Copy & paste
// if (webUserController.hasPrivilege("LabBillCancelling")) {
Expand All @@ -397,6 +413,43 @@ public void cancelBill() {
}

}

public void cancelCreditCompanyPaymentBill() {
if (getBill() != null && getBill().getId() != null && getBill().getId() != 0) {
if (errorCheck()) {
return;
}

CancelledBill cb = createCancelBill(BillNumberSuffix.INWCCPAYCAN);

//Copy & paste
// if (webUserController.hasPrivilege("LabBillCancelling")) {
if (true) {
cb.setBillTypeAtomic(BillTypeAtomic.INPATIENT_CREDIT_COMPANY_PAYMENT_CANCELLATION);
getCancelledBillFacade().create(cb);
cancelBillItems(cb);
getBill().setCancelled(true);
getBill().setCancelledBill(cb);
getBilledBillFacade().edit(getBill());
JsfUtil.addSuccessMessage("Cancelled");
WebUser wb = getCashTransactionBean().saveBillCashOutTransaction(cb, getSessionController().getLoggedUser());
for(BillItem cancellingBillItem : cb.getBillItems()){
getBillBean().updateInwardDipositList(cancellingBillItem.getPatientEncounter(), cb);
}
getSessionController().setLoggedUser(wb);
createPayment(cb, paymentMethod);
printPreview = true;
} else {
getEjbApplication().getBillsToCancel().add(cb);
JsfUtil.addSuccessMessage("Awaiting Cancellation");
}

} else {
JsfUtil.addErrorMessage("No Bill to cancel");
}

}

List<Bill> billsToApproveCancellation;
List<Bill> billsApproving;
private Bill billForCancel;
Expand Down
29 changes: 25 additions & 4 deletions src/main/java/com/divudi/bean/common/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,26 @@ public void createGrnWithDealerTable() {
grnBills = getBillFacade().findByJpql(sql, m, TemporalType.TIMESTAMP);
}

public void fillSavedTranserRequestBills() {

String sql = "Select bill from Bill bill where bill.retired =false "
+ " and bill.billType = :billType "
+ " and bill.institution = :institution "
+ " and bill.fromDepartment = :fromDepartment "
+ " and bill.createdAt between :fromDate and :toDate"
+ " order by bill.createdAt desc";

Map parametersForSearching = new HashMap();
parametersForSearching.put("billType", BillType.PharmacyTransferRequest);
parametersForSearching.put("institution", sessionController.getInstitution());
parametersForSearching.put("fromDepartment", sessionController.getDepartment());
parametersForSearching.put("fromDate", getFromDate());
parametersForSearching.put("toDate", getToDate());

bills = getBillFacade().findByJpql(sql, parametersForSearching, TemporalType.TIMESTAMP);

}

public String navigateToPatientLabReports() {
fillPatientLabReports(patient);
return "/lab/patient_lab_reports";
Expand Down Expand Up @@ -3767,10 +3787,12 @@ public void createRequestTable() {
tmp.put("toDep", getSessionController().getDepartment());
tmp.put("bct", bct);
tmp.put("bTp", BillType.PharmacyTransferRequest);
tmp.put("billTypeAtomic", billTypeAtomic.PHARMACY_TRANSFER_REQUEST);

sql = "Select b From Bill b where "
+ " b.retired=false and b.toDepartment=:toDep"
+ " and b.billClassType not in :bct"
+ " and b.billClassType not in :bct "
+ " and b.billTypeAtomic = :billTypeAtomic"
+ " and b.billType= :bTp and b.createdAt between :fromDate and :toDate ";

if (getSearchKeyword().getBillNo() != null && !getSearchKeyword().getBillNo().trim().equals("")) {
Expand Down Expand Up @@ -4534,17 +4556,16 @@ public void createBillItemTableBht(BillType btp) {
m.put("bType", btp);
m.put("ins", getSessionController().getInstitution());
m.put("class", PreBill.class);


sql = "select bi from BillItem bi"
+ " where type(bi.bill)=:class "
+ " and bi.bill.institution=:ins"
+ " and bi.bill.billType=:bType and "
+ " bi.createdAt between :fromDate and :toDate ";

if (getSearchKeyword().getFrmDepartment() != null) {
sql += " and bi.bill.department=:dep";
m.put("dep", getSearchKeyword().getFrmDepartment());
m.put("dep", getSearchKeyword().getFrmDepartment());
}

if (getSearchKeyword().getPatientName() != null && !getSearchKeyword().getPatientName().trim().equals("")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,9 @@ private TreeNode<PrivilegeHolder> createPrivilegeHolderTreeNodes() {
TreeNode disbursementRecieve = new DefaultTreeNode(new PrivilegeHolder(Privileges.PharmacyDisbursementRecieve, "Recieve"), disbursementNode);
TreeNode TransferReciveApproval = new DefaultTreeNode(new PrivilegeHolder(Privileges.TransferReciveApproval, "Recieve Approval"), disbursementNode);
TreeNode PharmacyDisbursementReports = new DefaultTreeNode(new PrivilegeHolder(Privileges.PharmacyDisbursementReports, "Pharmacy Disbursement Reports"), disbursementNode);
TreeNode PharmacyDisbursementApproval = new DefaultTreeNode(new PrivilegeHolder(Privileges.PharmacyDisbursementRequestApproval, "Pharmacy Disbursement Request Approval"), disbursementNode);


TreeNode InpatientMedicationManagementNode = new DefaultTreeNode("Inpatient medication Management", pharmacyNode);
TreeNode InpatientMedicationManagementMenue = new DefaultTreeNode(new PrivilegeHolder(Privileges.InpatientMedicationManagementMenue, "Procurement Menu"), InpatientMedicationManagementNode);
TreeNode PharmacyDirectIssueToBht = new DefaultTreeNode(new PrivilegeHolder(Privileges.PharmacyDirectIssueToBht, "Pharmacy Direct Issue To Bht"), InpatientMedicationManagementNode);
Expand Down
53 changes: 31 additions & 22 deletions src/main/java/com/divudi/bean/inward/AdmissionController.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,19 @@
import com.divudi.bean.pharmacy.PharmacyRequestForBhtController;
import com.divudi.data.BillTypeAtomic;
import com.divudi.data.clinical.ClinicalFindingValueType;

import static com.divudi.data.inward.AdmissionStatus.ADMITTED_BUT_NOT_DISCHARGED;
import static com.divudi.data.inward.AdmissionStatus.ANY_STATUS;
import static com.divudi.data.inward.AdmissionStatus.DISCHARGED_AND_FINAL_BILL_COMPLETED;
import static com.divudi.data.inward.AdmissionStatus.DISCHARGED_BUT_FINAL_BILL_NOT_COMPLETED;

import com.divudi.entity.Department;
import com.divudi.entity.Staff;
import com.divudi.entity.clinical.ClinicalFindingValue;
import com.divudi.entity.inward.AdmissionType;
import com.divudi.facade.ClinicalFindingValueFacade;
import com.divudi.java.CommonFunctions;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Calendar;
Expand All @@ -71,10 +74,10 @@
import javax.inject.Inject;
import javax.inject.Named;
import javax.persistence.TemporalType;

import org.primefaces.event.TabChangeEvent;

/**
*
* @author Dr. M. H. B. Ariyaratne, MBBS, MSc, MD(Health Informatics) Acting
* Consultant (Health Informatics)
*/
Expand All @@ -101,7 +104,7 @@ public class AdmissionController implements Serializable, ControllerWithPatient
ConfigOptionApplicationController configOptionApplicationController;
@Inject
private CommonController commonController;
////////////
/// /////////
@EJB
private AdmissionFacade ejbFacade;
@EJB
Expand All @@ -126,9 +129,9 @@ public class AdmissionController implements Serializable, ControllerWithPatient
@Inject
ClinicalFindingValueController clinicalFindingValueController;

////////////////////////////
/// /////////////////////////
private CommonFunctions commonFunctions;
///////////////////////
/// ////////////////////
List<Admission> selectedItems;
private Admission current;
private Admission currentNonBht;
Expand All @@ -140,7 +143,7 @@ public class AdmissionController implements Serializable, ControllerWithPatient
private List<Patient> patientList;
private boolean printPreview;
private List<Admission> currentAdmissions;
///////////////////////////
/// ////////////////////////
String selectText = "";
private String ageText = "";
private String bhtText = "";
Expand Down Expand Up @@ -252,6 +255,10 @@ public String navigateToInpatientClinicalData() {
}

public void addCreditCompnay() {
if (encounterCreditCompany.getCreditLimit() <= 0) {
JsfUtil.addErrorMessage("Credit limit must be greater than zero");
return;
}
// need to add encounterCreditCompany to list
if (encounterCreditCompany.getInstitution() != null) {
encounterCreditCompany.setPatientEncounter(current);
Expand Down Expand Up @@ -390,7 +397,7 @@ public List<Bill> getCreditPaymentBillsBht(Institution institution) {
return lst;
}

// public List<Admission> completePatientPaymentDue(String qry) {
// public List<Admission> completePatientPaymentDue(String qry) {
// String sql = "Select b.patientEncounter From "
// + " BilledBill b where"
// + " b.retired=false "
Expand Down Expand Up @@ -491,7 +498,7 @@ public String navigateToAddBabyAdmission() {
return "/inward/inward_admission_child?faces-redirect=true";
}

// // Services & Items Submenu Methods
// // Services & Items Submenu Methods
// public String navigateToAddServices() {
// return "/inward/inward_bill_service?faces-redirect=true";
// }
Expand Down Expand Up @@ -620,15 +627,17 @@ public void searchAdmissions() {
j += " and c.parentEncounter=:pent ";
m.put("pent", parentAdmission);
}

if (admissionTypeForSearch != null) {
j += " and c.admissionType=:at ";
m.put("at", admissionTypeForSearch);
}

j += " ORDER BY c.dateOfAdmission DESC ";

items = getFacade().findByJpql(j, m, TemporalType.TIMESTAMP);
}

public void searchAdmissionsWithoutRoom() {
if (fromDate == null || toDate == null) {
JsfUtil.addErrorMessage("Please select date");
Expand Down Expand Up @@ -724,7 +733,7 @@ public String navigateToAdmissionProfilePage() {
bhtSummeryController.setPatientEncounter(current);
return bhtSummeryController.navigateToInpatientProfile();
}


public List<Admission> completeAdmission(String query) {
List<Admission> suggestions;
Expand Down Expand Up @@ -789,7 +798,7 @@ public List<Admission> completePatientFinaled(String query) {
return suggestions;
}

// public List<Admission> completePatientCredit(String query) {
// public List<Admission> completePatientCredit(String query) {
// List<Admission> suggestions;
// String sql;
// HashMap hm = new HashMap();
Expand Down Expand Up @@ -891,7 +900,7 @@ public List<Admission> completePatientPaymentFinalized(String query) {
return suggestions;
}

// public List<Admission> completeDishcahrgedPatient(String query) {
// public List<Admission> completeDishcahrgedPatient(String query) {
// List<Admission> suggestions;
// String sql;
// if (query == null) {
Expand All @@ -909,7 +918,7 @@ public void prepareAdd() {

List<Admission> admissionsWithErrors;

// public List<Admission> getAdmissionsWithErrors() {
// public List<Admission> getAdmissionsWithErrors() {
// String sql;
// sql = "select p from Admission p where c.patient.retired=false "
// + "and (c.patient.patient is null or c.patient.bhtNo is null)";
Expand Down Expand Up @@ -1120,7 +1129,7 @@ private boolean errorCheck() {
return true;
}
}

if (getCurrent().getAdmissionType().isRoomChargesAllowed()) {
if (getPatientRoom().getRoomFacilityCharge() == null) {
JsfUtil.addErrorMessage("Select Room ");
Expand Down Expand Up @@ -1268,14 +1277,14 @@ public void updateBHTNo() {
}

public void saveSelected() {
if(admittingProcessStarted){
if (admittingProcessStarted) {
JsfUtil.addErrorMessage("Admittin process already started.");
return;
}
admittingProcessStarted=true;
admittingProcessStarted = true;

if (errorCheck()) {
admittingProcessStarted=false;
admittingProcessStarted = false;
return;
}
savePatient();
Expand Down Expand Up @@ -1331,10 +1340,10 @@ public void saveSelected() {

// Save EncounterCreditCompanies
// Need to create EncounterCredit
admittingProcessStarted=false;
admittingProcessStarted = false;
printPreview = true;
}

public void saveConvertSelected() {
if (errorCheck()) {
return;
Expand Down Expand Up @@ -1389,7 +1398,7 @@ public void saveConvertSelected() {
}

saveEncounterCreditCompanies(current);

getCurrentNonBht().setParentEncounter(current);
getCurrentNonBht().setDischarged(true);
getCurrentNonBht().setDateOfDischarge(new Date());
Expand Down Expand Up @@ -1948,7 +1957,7 @@ public boolean isAdmittingProcessStarted() {
public void setAdmittingProcessStarted(boolean admittingProcessStarted) {
this.admittingProcessStarted = admittingProcessStarted;
}


public AdmissionType getAdmissionTypeForSearch() {
return admissionTypeForSearch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ public String cancelInwardPharmacyRequestBillFromInward() {
}

public String cancelPharmacyTransferRequestBill() {
if(comment == null || comment.isEmpty()){
JsfUtil.addErrorMessage("Please Provide a comment to cancel the bill");
return "";
}
if (bill == null) {
JsfUtil.addErrorMessage("Not Bill Found !");
return "";
Expand Down
Loading

0 comments on commit 490f8dd

Please sign in to comment.