Skip to content

Commit

Permalink
Merge pull request #6502 from hmislk/Issue#6486
Browse files Browse the repository at this point in the history
Issue#6486 Closes #6486
  • Loading branch information
DeshaniPubudu authored Jul 23, 2024
2 parents 89304bb + 6ba7e6b commit 419a91b
Show file tree
Hide file tree
Showing 8 changed files with 622 additions and 222 deletions.
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.divudi</groupId>

<artifactId>sethma</artifactId>
<version>3.0.0</version>
<packaging>war</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@ public class FinancialTransactionController implements Serializable {

private ReportTemplateRowBundle paymentSummaryBundle;

private Date fromDate;
private Date toDate;

private ReportTemplateRowBundle paymentSummaryBundle;

// </editor-fold>
// <editor-fold defaultstate="collapsed" desc="Constructors">
public FinancialTransactionController() {
Expand Down
113 changes: 103 additions & 10 deletions src/main/java/com/divudi/bean/common/BillPackageController.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ public class BillPackageController implements Serializable, ControllerWithPatien
@Inject
ConfigOptionApplicationController configOptionApplicationController;

private List<Item> malePackaes;
private List<Item> femalePackaes;
private List<Item> bothPackaes;
private List<Item> packaes;

//</editor-fold>
// <editor-fold defaultstate="collapsed" desc="Class Variables">
private static final long serialVersionUID = 1L;
Expand Down Expand Up @@ -221,7 +226,6 @@ public void putToBills() {
}
}
myBill.setBillItems(list);
//////System.out.println("555");
getBillBean().calculateBillItems(myBill, tmp);
bills.add(myBill);
}
Expand Down Expand Up @@ -288,7 +292,6 @@ public void cancellAll() {
getBillSearch().setBill((BilledBill) b);
getBillSearch().setPaymentMethod(b.getPaymentMethod());
getBillSearch().setComment("Batch Cancell");
//////System.out.println("ggg : " + getBillSearch().getComment());
getBillSearch().cancelOpdBill();
}

Expand All @@ -302,9 +305,7 @@ public void cancellAll() {
private void saveBillItemSessions() {
for (BillEntry be : lstBillEntries) {
BillItem temBi = be.getBillItem();
////System.out.println("temBi = " + temBi);
BillSession temBs = getServiceSessionBean().createBillSession(temBi);
////System.out.println("temBs = " + temBs);
temBi.setBillSession(temBs);
if (temBs != null) {
getBillSessionFacade().create(temBs);
Expand All @@ -326,9 +327,7 @@ public void settleBill() {
getBills().add(b);

} else {
// //////System.out.println("11");
putToBills();
// //////System.out.println("22");
}

saveBatchBill();
Expand All @@ -354,7 +353,6 @@ public void settleBill() {
saveBillItemSessions();

clearBillItemValues();
//////System.out.println("33");

JsfUtil.addSuccessMessage(
"Bill Saved");
Expand Down Expand Up @@ -798,8 +796,6 @@ private void addEntry(BillItem bi) {
}

public void addToBill() {
// System.out.println("getCurrentBillItem = " + getCurrentBillItem());
// System.out.println("getCurrentBillItem.item = " + getCurrentBillItem().getItem().getName());
if (getLstBillEntries().size() > 0) {
JsfUtil.addErrorMessage("You can not add more than on package at a time create new bill");
return;
Expand Down Expand Up @@ -945,7 +941,7 @@ public void recreateList(BillEntry r) {
for (BillEntry b : getLstBillEntries()) {
if (b.getBillItem().getItem() != r.getBillItem().getItem()) {
temp.add(b);
//////System.out.println(b.getBillItem().getNetValue());

}
}
lstBillEntries = temp;
Expand Down Expand Up @@ -1448,4 +1444,101 @@ public void setToStaff(Staff toStaff) {
this.toStaff = toStaff;
}

public List<Item> getMalePackaes() {
return malePackaes;
}

public void setMalePackaes(List<Item> malePackaes) {
this.malePackaes = malePackaes;
}

public List<Item> getFemalePackaes() {
return femalePackaes;
}

public void setFemalePackaes(List<Item> femalePackaes) {
this.femalePackaes = femalePackaes;
}

public List<Item> getBothPackaes() {
return bothPackaes;
}

public void setBothPackaes(List<Item> bothPackaes) {
this.bothPackaes = bothPackaes;
}



public List<Item> getGenderBasedPackaes() {
//System.out.println("getPackages");
if (packaes == null) {
fillPackages();
}
if (configOptionApplicationController.getBooleanValueByKey("Package bill – Reloading of Packages with Consideration of Gender")) {
//System.out.println("option ok");
if (getPatient() == null) {
//System.out.println("pt is null");
return packaes;
} else if (getPatient().getPerson().getSex() == null) {
//System.out.println("sex is null");
return packaes;
} else if (getPatient().getPerson().getSex() == Sex.Male) {
//System.out.println("males");
return malePackaes;
} else if (getPatient().getPerson().getSex() == Sex.Female) {
//System.out.println("females");
return femalePackaes;
} else {
return bothPackaes;
}
}
return packaes;
}

public void setPackaes(List<Item> packaes) {
this.packaes = packaes;
}

public List<Item> getPackaes() {
if(packaes==null){
packaes=itemController.getPackaes();
fillPackages();
}
return packaes;
}

private void fillPackages() {
//System.out.println("fillPackages");
packaes = itemController.getPackaes();
//System.out.println("packaes = " + packaes);
if (packaes == null) {
return;
}
malePackaes = new ArrayList<>();
femalePackaes = new ArrayList<>();
bothPackaes = new ArrayList<>();
for (Item i : packaes) {
//System.out.println("i = " + i);
if (i.getForGender() == null) {
//System.out.println("gender nill");
bothPackaes.add(i);
} else if (i.getForGender().equalsIgnoreCase("Male")) {
//System.out.println("mp = " );
malePackaes.add(i);
} else if (i.getForGender().equalsIgnoreCase("Female")) {
//System.out.println("fp = " );
femalePackaes.add(i);
} else if (i.getForGender().equalsIgnoreCase("Both")) {
bothPackaes.add(i);
malePackaes.add(i);
femalePackaes.add(i);
} else {
bothPackaes.add(i);
}
}
}



}
Loading

0 comments on commit 419a91b

Please sign in to comment.