Skip to content

Commit

Permalink
Closes #407
Browse files Browse the repository at this point in the history
Signed-off-by: buddhika75 <[email protected]>
  • Loading branch information
buddhika75 committed Aug 7, 2024
1 parent 5d33129 commit b877299
Show file tree
Hide file tree
Showing 17 changed files with 119 additions and 561 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.divudi</groupId>

<artifactId>sethma</artifactId>
<artifactId>ruhunu-dev</artifactId>
<version>3.0.0</version>
<packaging>war</packaging>
<name>sethma</name>
<name>ruhunu-dev</name>

<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
Expand Down
21 changes: 10 additions & 11 deletions src/main/java/com/divudi/bean/common/OpdPreBillController.java
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ public String settleBill() {
}

b.setBillItems(list);
b.setIpOpOrCc("OP");

getBillFacade().edit(b);
getBillBean().calculateBillItems(b, getLstBillEntries());
Expand All @@ -822,24 +823,24 @@ public String settleBill() {
saveBillItemSessions();
JsfUtil.addSuccessMessage("Bill Saved");
checkBillValues();

if (getToken() != null) {
if (getToken().getBill() == null) {
getToken().setBill(batchBill);
tokenFacade.edit(getToken());
markToken(batchBill);
}else{
Token t=new Token();
} else {
Token t = new Token();
t.setPatient(getToken().getPatient());
t.setBill(batchBill);
t.setTokenNumber(getToken().getTokenNumber());
tokenFacade.create(t);
getToken().setReferaToken(t);
tokenFacade.edit(t);
}
}

}

printPreview = true;

return "/opd/opd_pre_bill?faces-redirect=true";
Expand Down Expand Up @@ -956,6 +957,7 @@ private void saveBatchBill() {

newlyCreatingBatchBillPre.setNetTotal(tmpBatchBillTotalOfNetTotals);
newlyCreatingBatchBillPre.setDiscount(tmpBatchBillTotalOfDiscounts);
newlyCreatingBatchBillPre.setIpOpOrCc("OP");
newlyCreatingBatchBillPre.setTotal(tmpBatchBillTotalOfGrossTotals);
getBillFacade().edit(newlyCreatingBatchBillPre);

Expand Down Expand Up @@ -1013,15 +1015,14 @@ private PreBill saveBill(Department bt, PreBill updatingPreBill) {
updatingPreBill.setReferredByInstitution(referredByInstitution);
//updatingPreBill.setCreditCompany(creditCompany);
updatingPreBill.setComments(comment);

updatingPreBill.setIpOpOrCc("OP");
//getBillBean().setPaymentMethodData(updatingPreBill, paymentMethod, getPaymentMethodData());

updatingPreBill.setBillDate(new Date());
updatingPreBill.setBillTime(new Date());
updatingPreBill.setPatient(getPatient());

// updatingPreBill.setMembershipScheme(membershipSchemeController.fetchPatientMembershipScheme(getPatient(), getSessionController().getApplicationPreference().isMembershipExpires()));

//updatingPreBill.setPaymentScheme(getPaymentScheme());
//updatingPreBill.setPaymentMethod(paymentMethod);
updatingPreBill.setCreatedAt(new Date());
Expand Down Expand Up @@ -1138,7 +1139,6 @@ private boolean errorCheck() {
// JsfUtil.addErrorMessage("Select Payment Method.");
// return true;
// }

// if (getPaymentSchemeController().errorCheckPaymentMethod(paymentMethod, getPaymentMethodData())) {
// return true;
// }
Expand All @@ -1162,7 +1162,6 @@ private boolean errorCheck() {
// JsfUtil.addErrorMessage("Check Payment method");
// return true;
// }

return false;
}

Expand Down Expand Up @@ -1386,7 +1385,7 @@ public void calTotals() {
double billDiscount = 0.0;
double billGross = 0.0;
double billNet = 0.0;

for (BillEntry be : getLstBillEntries()) {
//////// // System.out.println("bill item entry");
double entryGross = 0.0;
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/divudi/bean/common/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,7 @@ public void fillCollectingCentreCourierPatientInvestigations() {
+ " join pi.billItem.bill b "
+ " join b.patient.person p "
+ " where "
+ " b.createdAt between :fromDate and :toDate "
+ " and pi.investigation.department=:dep ";
+ " b.createdAt between :fromDate and :toDate ";

Map temMap = new HashMap();
temMap.put("toDate", getToDate());
Expand All @@ -1028,7 +1027,7 @@ public void fillCollectingCentreCourierPatientInvestigations() {
temMap.put("ccs", sessionController.getLoggableCollectingCentres());
} else {
jpql += " and b.collectingCentre=:cc ";
temMap.put("cc", sessionController.getLoggableCollectingCentres());
temMap.put("cc", institution);
}

if (getSearchKeyword().getPatientName() != null && !getSearchKeyword().getPatientName().trim().equals("")) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/divudi/bean/opd/OpdBillController.java
Original file line number Diff line number Diff line change
Expand Up @@ -1750,6 +1750,7 @@ private boolean executeSettleBillActions() {
}
newSingleBill.setBillItems(list);
newSingleBill.setBillTotal(newSingleBill.getNetTotal());
newSingleBill.setIpOpOrCc("OP");
getBillFacade().edit(newSingleBill);
getBillBean().calculateBillItems(newSingleBill, getLstBillEntries());
if (getSessionController().getApplicationPreference().isPartialPaymentOfOpdBillsAllowed()) {
Expand Down Expand Up @@ -1995,6 +1996,7 @@ private void saveBatchBill() {
newBatchBill.setFromInstitution(sessionController.getInstitution());
newBatchBill.setFromDepartment(sessionController.getDepartment());
newBatchBill.setPatient(patient);
newBatchBill.setIpOpOrCc("OP");
newBatchBill.setInsId(
getBillNumberGenerator().institutionBillNumberGenerator(
getSessionController().getInstitution(),
Expand Down Expand Up @@ -2096,7 +2098,9 @@ private Bill saveBill(Department bt, Bill newBill) {

newBill.setCreditCompany(creditCompany);
newBill.setCollectingCentre(collectingCentre);
newBill.setIpOpOrCc("OP");
newBill.setComments(comment);


getBillBean().setPaymentMethodData(newBill, paymentMethod, getPaymentMethodData());

Expand Down Expand Up @@ -2178,6 +2182,7 @@ private Bill saveBill(Department bt, Category cat, Bill newBill) {
newBill.setCreditCompany(creditCompany);
newBill.setCollectingCentre(collectingCentre);
newBill.setComments(comment);
newBill.setIpOpOrCc("OP");

getBillBean().setPaymentMethodData(newBill, paymentMethod, getPaymentMethodData());

Expand Down
64 changes: 32 additions & 32 deletions src/main/java/com/divudi/bean/store/StoreAdjustmentController.java
Original file line number Diff line number Diff line change
Expand Up @@ -664,38 +664,38 @@ public void setStk(List<Stock> stk) {
this.stk = stk;
}

public void fillSelectStock() {
List<Stock> items = new ArrayList<>();
if (stock == null) {
stk = items;
return;
}
String sql;
Map<String, Object> m = new HashMap<>();

sql = "select i "
+ " from Stock i "
+ " where i.department=:d "
+ " and i.itemBatch.item.code=:stationary "
+ " order by i.stock desc";

m.put("d", sessionController.getDepartment());
m.put("stationary", stock.getItemBatch().getItem().getCode()); // Assuming stk contains the item

items = getStockFacade().findByJpql(sql, m);

if (items != null) {
stk = items;
}
}

public List<Stock> getStk() {
return stk;
}

public void setStk(List<Stock> stk) {
this.stk = stk;
}
// public void fillSelectStock() {
// List<Stock> items = new ArrayList<>();
// if (stock == null) {
// stk = items;
// return;
// }
// String sql;
// Map<String, Object> m = new HashMap<>();
//
// sql = "select i "
// + " from Stock i "
// + " where i.department=:d "
// + " and i.itemBatch.item.code=:stationary "
// + " order by i.stock desc";
//
// m.put("d", sessionController.getDepartment());
// m.put("stationary", stock.getItemBatch().getItem().getCode()); // Assuming stk contains the item
//
// items = getStockFacade().findByJpql(sql, m);
//
// if (items != null) {
// stk = items;
// }
// }
//
// public List<Stock> getStk() {
// return stk;
// }
//
// public void setStk(List<Stock> stk) {
// this.stk = stk;
// }

// public void fillSelectStock(){
// List<Stock> items = new ArrayList<>();
Expand Down
Loading

0 comments on commit b877299

Please sign in to comment.