Skip to content

Commit

Permalink
Merge pull request #6483 from hmislk/Issue#6482
Browse files Browse the repository at this point in the history
Issue#6482 Closes #6482
  • Loading branch information
Deshani Pubudu authored Jul 21, 2024
2 parents ddbafd8 + e0f16ce commit 28cf0c7
Show file tree
Hide file tree
Showing 13 changed files with 381 additions and 114 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Developed using Java Enterprise Edition, the system offers both a web applicatio

## Current Version


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


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

import com.divudi.data.ReportTemplateRow;
import com.divudi.data.ReportTemplateRowBundle;
import com.divudi.data.dataStructure.PaymentMethodData;
import com.divudi.entity.WebUser;
import com.divudi.java.CommonFunctions;
import javax.inject.Named;
Expand Down Expand Up @@ -74,6 +75,7 @@ public class FinancialTransactionController implements Serializable {
// <editor-fold defaultstate="collapsed" desc="Class Variables">
private Bill currentBill;
private Payment currentPayment;
private PaymentMethodData paymentMethodData;
private Payment removingPayment;
private List<Payment> currentBillPayments;
private List<Bill> currentBills;
Expand Down Expand Up @@ -648,6 +650,7 @@ public void addPaymentToInitialFundBill() {
getCurrentBillPayments().add(currentPayment);
calculateInitialFundBillTotal();
currentPayment = null;
getCurrentPayment();
}

public void addPaymentToFundTransferBill() {
Expand Down Expand Up @@ -1530,9 +1533,23 @@ public Payment getCurrentPayment() {
if (currentPayment == null) {
currentPayment = new Payment();
}
if (currentPayment.getCurrencyDenominations() == null) {
currentPayment.setCurrencyDenominations(configOptionApplicationController.getDenominations());
}
return currentPayment;
}

public PaymentMethodData getPaymentMethodData() {
if (paymentMethodData == null) {
paymentMethodData = new PaymentMethodData();
}
return paymentMethodData;
}

public void setPaymentMethodData(PaymentMethodData paymentMethodData) {
this.paymentMethodData = paymentMethodData;
}

public void updateCashDenominations(AjaxBehaviorEvent event) {
System.out.println("updateCashDenominations called");

Expand All @@ -1542,7 +1559,7 @@ public void updateCashDenominations(AjaxBehaviorEvent event) {
}

double total = 0;
List<Denomination> denominations = configOptionApplicationController.getDenominations();
List<Denomination> denominations = currentPayment.getCurrencyDenominations();
for (Denomination denomination : denominations) {
int value = denomination.getCount();
System.out.println("Processing denomination: " + denomination.getValue() + " with count: " + value);
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/divudi/bean/channel/BookingController.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ public class BookingController implements Serializable, ControllerWithPatient {
@Inject
private CommonController commonController;

// * Properties
// */
private Speciality speciality;
private Staff staff;
private Staff toStaff;
Expand Down Expand Up @@ -686,7 +688,9 @@ public String smsBody(BillSession r) {
+ url;
return b;
}
//

// ALREADY DEFIENED in line 629

// public void sendChannellingStatusUpdateNotificationSms(BillSession methodBillSession) {
// if (methodBillSession == null) {
// JsfUtil.addErrorMessage("Nothing to send");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1959,6 +1959,15 @@ public String navigateToNurseViewWithItems() {
}
}

// public String navigateToNurseViewWithItems() {
// if (preSet()) {
// getChannelReportController().fillNurseView();
// return "/channel/channel_views/channel_nurse_view_with_items?faces-redirect=true";
// } else {
// return "";
// }
// }

public String navigateToDoctorView() {
if (preSet()) {
getChannelReportController().fillDoctorView();
Expand Down Expand Up @@ -2829,22 +2838,22 @@ public void setAbsentCount(double absentCount) {
this.absentCount = absentCount;
}

// public void errorCheckChannelNumber() {
//
// for (BillSession bs : billSessions) {
// //System.out.println("billSessions" + bs.getName());
// for (BillItem bi : getSelectedBillSession().getBill().getBillItems()) {
// //System.out.println("billitem" + bi.getId());
// if (bs.getSerialNo() == bi.getBillSession().getSerialNo()) {
// JsfUtil.addErrorMessage("Number you entered already exist");
// setSelectedBillSession(bs);
//
// }
//
// }
// }
//
// }
public void errorCheckChannelNumber() {

for (BillSession bs : billSessions) {
//System.out.println("billSessions" + bs.getName());
for (BillItem bi : getSelectedBillSession().getBill().getBillItems()) {
//System.out.println("billitem" + bi.getId());
if (bs.getSerialNo() == bi.getBillSession().getSerialNo()) {
JsfUtil.addErrorMessage("Number you entered already exist");
setSelectedBillSession(bs);

}

}
}

}
public void updatePatient() {
getPersonFacade().edit(getSelectedBillSession().getBill().getPatient().getPerson());
JsfUtil.addSuccessMessage("Patient Updated");
Expand Down Expand Up @@ -3126,7 +3135,12 @@ public long totalReservedNumberCount(SessionInstance s){
long reservedNumberCount = reservedNumbers.size();
return reservedNumberCount;
}

// ALREADY DEFINED in line 3133
// public long totalReservedNumberCount(SessionInstance s) {
// List<Integer> reservedNumbers = CommonFunctions.convertStringToIntegerList(s.getReserveNumbers());
// long reservedNumberCount = reservedNumbers.size();
// return reservedNumberCount;
// }

public BillSession addChannelBookingForOnlinePayment() {
errorText = "";
Expand Down
48 changes: 46 additions & 2 deletions src/main/java/com/divudi/bean/common/PackageItemController.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/**
*
* @author Dr. M. H. B. Ariyaratne, MBBS, MSc, MD(Health Informatics)
Informatics)
* Informatics)
*/
@Named
@SessionScoped
Expand Down Expand Up @@ -64,6 +64,8 @@ public class PackageItemController implements Serializable {
private List<Item> filteredItems;
List<Item> serviceItems;

private boolean canRemovePackageItemfromPackage;

public List<Item> getServiceItems() {
if (serviceItems == null) {
String temSql;
Expand Down Expand Up @@ -161,10 +163,39 @@ public void addToPackage() {
pi.setItem(getCurrentItem());
pi.setCreatedAt(new Date());
pi.setCreater(sessionController.loggedUser);
getFacade().create(pi);
if(pi.getId() == null){
getFacade().create(pi);
}

pi.getItem().setCanRemoveItemfromPackage(canRemovePackageItemfromPackage);

if(pi.getId() != null){
itemFacade.edit(pi.getItem());
}

JsfUtil.addSuccessMessage("Added");
recreateModel();
}

public void EditPackageItem() {
if (getCurrentPackege() == null) {
JsfUtil.addErrorMessage("Please select a package");
return;
}
if (getCurrent() == null) {
JsfUtil.addErrorMessage("Please select an item");
return;
}else{
getCurrent().getItem().setCanRemoveItemfromPackage(canRemovePackageItemfromPackage);
itemFacade.edit(getCurrent().getItem());
}

recreateModel();
getItems();

JsfUtil.addSuccessMessage("Updated");

}

public void removeFromPackage() {
if (getCurrentPackege() == null) {
Expand Down Expand Up @@ -252,6 +283,11 @@ public void setCurrent(PackageItem current) {
private PackageItemFacade getFacade() {
return ejbFacade;
}

public void clearValus(){
canRemovePackageItemfromPackage = false;

}

/**
*
Expand Down Expand Up @@ -446,6 +482,14 @@ public void setFilteredItems(List<Item> filteredItems) {
this.filteredItems = filteredItems;
}

public boolean isCanRemovePackageItemfromPackage() {
return canRemovePackageItemfromPackage;
}

public void setCanRemovePackageItemfromPackage(boolean canRemovePackageItemfromPackage) {
this.canRemovePackageItemfromPackage = canRemovePackageItemfromPackage;
}

/**
*
*/
Expand Down
18 changes: 10 additions & 8 deletions src/main/java/com/divudi/entity/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ public class Item implements Serializable, Comparable<Item> {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)



Long id;
int orderNo;

Expand Down Expand Up @@ -258,10 +255,9 @@ public class Item implements Serializable, Comparable<Item> {

@Column(name = "DTYPE", insertable = false, updatable = false)
private String clazz;




private boolean canRemoveItemfromPackage;

public double getVatPercentage() {
return 0;
}
Expand Down Expand Up @@ -1389,8 +1385,14 @@ public boolean isCanSechduleForOtherDays() {
public void setCanSechduleForOtherDays(boolean canSechduleForOtherDays) {
this.canSechduleForOtherDays = canSechduleForOtherDays;
}



public boolean isCanRemoveItemfromPackage() {
return canRemoveItemfromPackage;
}

public void setCanRemoveItemfromPackage(boolean canRemoveItemfromPackage) {
this.canRemoveItemfromPackage = canRemoveItemfromPackage;
}

static class ReportItemComparator implements Comparator<ReportItem> {

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/divudi/entity/Payment.java
Original file line number Diff line number Diff line change
Expand Up @@ -418,4 +418,14 @@ public void deserializeDenominations() {
public String getCurrencyDenominationsJson() {
return currencyDenominationsJson;
}

public List<Denomination> getCurrencyDenominations() {
return currencyDenominations;
}

public void setCurrencyDenominations(List<Denomination> currencyDenominations) {
this.currencyDenominations = currencyDenominations;
}


}
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="hmisPU" transaction-type="JTA">

<jta-data-source>jdbc/sethma</jta-data-source>
<jta-data-source>jdbc/arogya</jta-data-source>

<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="create-or-extend-tables"/>
</properties>
</persistence-unit>
<persistence-unit name="hmisAuditPU" transaction-type="JTA">
<jta-data-source>jdbc/sethmaAudit</jta-data-source>
<jta-data-source>jdbc/arogyaAudit</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
</properties>
Expand Down
3 changes: 3 additions & 0 deletions src/main/webapp/WEB-INF/glassfish-web.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">

<context-root>/sethma</context-root>


<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
Expand Down
Loading

0 comments on commit 28cf0c7

Please sign in to comment.