Skip to content

Commit

Permalink
Merge branch 'master' into Issue#6734
Browse files Browse the repository at this point in the history
  • Loading branch information
DamithDeshan authored Aug 4, 2024
2 parents a212333 + e48840b commit 74d1ba9
Show file tree
Hide file tree
Showing 24 changed files with 1,544 additions and 251 deletions.
2 changes: 1 addition & 1 deletion .github/counter.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5
6
2 changes: 1 addition & 1 deletion .github/last_date.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20240803
20240804
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Developed using Java Enterprise Edition, the system offers both a web applicatio



Current Version: 3.0.0.20240803.5 (This line will be automatically updated to reflect the latest version)
Current Version: 3.0.0.20240804.6 (This line will be automatically updated to reflect the latest version)



Expand Down Expand Up @@ -77,7 +77,7 @@ The features available to different roles of the users are stated in detail in t
* Dr M H B Ariyaratne - Initiated the Project, Product owner, System Architect, Lead Developer since 2004 to date

## Project Management
* Mr.K.M.G.T.R. Waidyarathne - Project Management from 2013 to date
* Mr.K.M.G.T.R. Waidyarathne - Recruitment Management from 2013 to 2022, Project Management from 2022 to 2024

## Business Analyst
* Miss Binuthi Nilakna Ariyaratne - From 2024 to date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,14 @@ public Payment createPaymentForPettyCashBillReturn(Bill rb, PaymentMethod pm) {
return p;
}

public Payment createPaymentForPettyCashBillCancellation(Bill cb, PaymentMethod pm) {
Payment p = new Payment();
p.setBill(cb);
p.setPaidValue(0 - Math.abs(cb.getNetTotal()));
setPaymentMethodData(p, pm);
return p;
}

public void createPaymentForPettyCashBill(Bill b, PaymentMethod pm) {
Payment p = new Payment();
p.setBill(b);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.divudi.ejb.BillNumberGenerator;
import com.divudi.ejb.CashTransactionBean;
import com.divudi.bean.common.util.JsfUtil;
import com.divudi.data.BillTypeAtomic;
import com.divudi.ejb.EjbApplication;
import com.divudi.entity.Bill;
import com.divudi.entity.BillComponent;
Expand All @@ -20,6 +21,7 @@
import com.divudi.entity.BillItem;
import com.divudi.entity.BilledBill;
import com.divudi.entity.CancelledBill;
import com.divudi.entity.Payment;
import com.divudi.entity.PaymentScheme;
import com.divudi.entity.WebUser;
import com.divudi.facade.BillComponentFacade;
Expand Down Expand Up @@ -84,6 +86,8 @@ public class PettyCashBillSearch implements Serializable {
SessionController sessionController;
@Inject
private WebUserController webUserController;
@Inject
PettyCashBillController pettyCashBillController;
@EJB
EjbApplication ejbApplication;
private List<BillItem> tempbillItems;
Expand Down Expand Up @@ -257,6 +261,7 @@ private CancelledBill createCancelBill() {
cb.setCreater(getSessionController().getLoggedUser());
cb.setDepartment(getSessionController().getDepartment());
cb.setInstitution(getSessionController().getInstitution());
cb.setBillTypeAtomic(BillTypeAtomic.PETTY_CASH_BILL_CANCELLATION);
cb.setPaymentMethod(paymentMethod);
cb.setComments(comment);

Expand Down Expand Up @@ -308,7 +313,6 @@ public void cancelBill() {
}

CancelledBill cb = createCancelBill();

//Copy & paste
//if (webUserController.hasPrivilege("LabBillCancelling")) {
if (true) {
Expand All @@ -321,6 +325,7 @@ public void cancelBill() {

WebUser wb = getCashTransactionBean().saveBillCashInTransaction(cb, getSessionController().getLoggedUser());
getSessionController().setLoggedUser(wb);
Payment p = pettyCashBillController.createPaymentForPettyCashBillCancellation(cb, paymentMethod);
printPreview = true;
} else {
getEjbApplication().getBillsToCancel().add(cb);
Expand Down
28 changes: 26 additions & 2 deletions src/main/java/com/divudi/bean/common/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -4472,6 +4472,11 @@ public void createDueFeeTable() {
sql += " and ((b.billItem.item.name) like :staff )";
temMap.put("staff", "%" + getSearchKeyword().getItemName().trim().toUpperCase() + "%");
}

if (getSearchKeyword().getBhtNo() != null && !getSearchKeyword().getBhtNo().trim().equals("")) {
sql += " and ((b.paidForBillFee.bill.patientEncounter.bhtNo) like :bht )";
temMap.put("bht", "%" + getSearchKeyword().getBhtNo().trim().toUpperCase() + "%");
}

sql += " order by b.staff.id ";

Expand Down Expand Up @@ -4540,6 +4545,11 @@ public void createDueFeeTableAll() {
sql += " and ((b.billItem.item.name) like :staff )";
temMap.put("staff", "%" + getSearchKeyword().getItemName().trim().toUpperCase() + "%");
}

if (getSearchKeyword().getBhtNo() != null && !getSearchKeyword().getBhtNo().trim().equals("")) {
sql += " and ((b.paidForBillFee.bill.patientEncounter.bhtNo) like :bht )";
temMap.put("bht", "%" + getSearchKeyword().getBhtNo().trim().toUpperCase() + "%");
}

sql += " order by b.staff.id ";

Expand Down Expand Up @@ -5130,6 +5140,11 @@ public void createPaymentTable() {
sql += " and b.paidForBillFee.bill.creditCompany=:cc ";
temMap.put("cc", getReportKeyWord().getInstitution());
}

if (getSearchKeyword().getBhtNo() != null && !getSearchKeyword().getBhtNo().trim().equals("")) {
sql += " and ((b.paidForBillFee.bill.patientEncounter.bhtNo) like :bht )";
temMap.put("bht", "%" + getSearchKeyword().getBhtNo().trim().toUpperCase() + "%");
}

sql += " order by b.createdAt desc ";

Expand Down Expand Up @@ -5194,6 +5209,11 @@ public void createPaymentTableAll() {
sql += " and b.paidForBillFee.bill.creditCompany=:cc ";
temMap.put("cc", getReportKeyWord().getInstitution());
}

if (getSearchKeyword().getBhtNo() != null && !getSearchKeyword().getBhtNo().trim().equals("")) {
sql += " and ((b.paidForBillFee.bill.patientEncounter.bhtNo) like :bht )";
temMap.put("bht", "%" + getSearchKeyword().getBhtNo().trim().toUpperCase() + "%");
}

sql += " order by b.createdAt desc ";

Expand Down Expand Up @@ -7080,13 +7100,17 @@ public void createStaffCreditBillList() {
jpql = "select b from Bill b "
+ "where b.toStaff is not null "
+ "and b.createdAt between :fromDate and :toDate "
+ "and b.retired = false ";
+ "and b.retired = false "
+ "and b.cancelled = false "
+ "and b.refunded = false ";
jpql += " and b.billTypeAtomic in :btas ";

btas.addAll(BillTypeAtomic.findByServiceType(ServiceType.OPD));
btas.addAll(BillTypeAtomic.findByServiceType(ServiceType.CHANNELLING));
btas.removeAll(BillTypeAtomic.findByCategory(BillCategory.PAYMENTS));

btas.removeAll(BillTypeAtomic.findByCategory(BillCategory.CANCELLATION));
btas.removeAll(BillTypeAtomic.findByCategory(BillCategory.REFUND));

jpql += " order by b.createdAt desc";

m.put("fromDate", fromDate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ private TreeNode<PrivilegeHolder> createPrivilegeHolderTreeNodes() {
TreeNode opdBillSearchEditNode = new DefaultTreeNode(new PrivilegeHolder(Privileges.OpdBillSearchEdit, "OPD Bill Search Edit (Patient Details)"), opdNode);
TreeNode OpdReprintOriginalBillNode = new DefaultTreeNode(new PrivilegeHolder(Privileges.OpdReprintOriginalBill, "Reprint the Original Bill"), opdNode);
TreeNode addCreditLimit = new DefaultTreeNode(new PrivilegeHolder(Privileges.AddCreditLimitInRegistration, "Add Credit Limit During Patient Registration"), opdNode);
TreeNode addNewRefferalDoctor = new DefaultTreeNode(new PrivilegeHolder(Privileges.OpdAddNewRefferalDoctor, "Add New Referral Doctor"), opdNode);
TreeNode addNewCollectingCentre = new DefaultTreeNode(new PrivilegeHolder(Privileges.OpdAddNewCollectingCentre, "Add New Referral Center"), opdNode);

TreeNode inwardNode = new DefaultTreeNode(new PrivilegeHolder(null, "Inward"), allNode);
TreeNode inwardMenuNode = new DefaultTreeNode(new PrivilegeHolder(Privileges.Inward, "Inward Menu"), inwardNode);
Expand Down Expand Up @@ -485,7 +487,7 @@ private TreeNode<PrivilegeHolder> createPrivilegeHolderTreeNodes() {
TreeNode cashInNode = new DefaultTreeNode(new PrivilegeHolder(Privileges.CashTransactionCashIn, "Cash In"), cashTransactionNode);
TreeNode cashOutNode = new DefaultTreeNode(new PrivilegeHolder(Privileges.CashTransactionCashOut, "Cash Out"), cashTransactionNode);
TreeNode listToCashReceiveNode = new DefaultTreeNode(new PrivilegeHolder(Privileges.CashTransactionListToCashRecieve, "List To Cash Receive"), cashTransactionNode);

//Pharmacy
TreeNode retailTransaction = new DefaultTreeNode("Pharmacy Retail Transaction", pharmacyNode);
TreeNode retailTransactionMenu = new DefaultTreeNode(new PrivilegeHolder(Privileges.PharmacyRetailTransactionMenue, "Pharmacy Retail Transaction Menu"), retailTransaction);
Expand Down
Loading

0 comments on commit 74d1ba9

Please sign in to comment.