Skip to content

Commit

Permalink
Merge pull request #6769 from hmislk/Issue#6353
Browse files Browse the repository at this point in the history
Issue#6353 Closes #6353
  • Loading branch information
DeshaniPubudu authored Aug 7, 2024
2 parents bf33c62 + cacb0d3 commit 873aced
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 31 deletions.
65 changes: 46 additions & 19 deletions src/main/java/com/divudi/bean/common/BillPackageController.java
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ private void saveBillItemSessions() {
}
}
}

public boolean validatePaymentMethodDeta() {
boolean error = false;

Expand Down Expand Up @@ -349,11 +349,11 @@ public void settleBill() {
if (errorCheck()) {
return;
}

if (validatePaymentMethodDeta()) {
return;
}

savePatient();
if (getBillBean().calculateNumberOfBillsPerOrder(getLstBillEntries()) == 1) {
BilledBill temp = new BilledBill();
Expand Down Expand Up @@ -527,7 +527,7 @@ public List<Payment> createPayments(Bill bill, PaymentMethod pm) {
case Agent:
case Credit:
p.setReferenceNo(paymentMethodData.getCredit().getReferralNo());
p.setComments(paymentMethodData.getCredit().getComment());
p.setComments(paymentMethodData.getCredit().getComment());
case PatientDeposit:
case Slip:
p.setBank(paymentMethodData.getSlip().getInstitution());
Expand Down Expand Up @@ -713,7 +713,7 @@ private boolean errorCheck() {
return true;
}
}

if (configOptionApplicationController.getBooleanValueByKey("Package Bill – Credit Company Policy Number required", false)) {
System.out.println("Chack Policy No");
if (paymentMethod == PaymentMethod.Credit && paymentMethodData.getCredit().getReferralNo().trim().equalsIgnoreCase("")) {
Expand Down Expand Up @@ -1518,23 +1518,17 @@ public void setBothPackaes(List<Item> 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;
Expand All @@ -1552,29 +1546,50 @@ public List<Item> getPackaes() {
packaes = itemController.getPackaes();
fillPackages();
}
System.out.println("packaes = " + packaes.size());
return packaes;
}

private List<Item> listOfTheNonExpiredPackages;

private void fillPackages() {
//System.out.println("fillPackages");
packaes = itemController.getPackaes();
//System.out.println("packaes = " + packaes);
if (packaes == null) {
return;
}


getListOfTheNonExpiredPackages();

if (configOptionApplicationController.getBooleanValueByKey("Package bill – Reloading packages Considering the Expiry Date.", false)) {

int k = 0;
for (Item i : packaes) {
if (i.getExpiryDate() == null) {
listOfTheNonExpiredPackages.add(i);
} else {
if (new Date().after(i.getExpiryDate())) {
} else {
listOfTheNonExpiredPackages.add(i);
}
}
}
}else{
listOfTheNonExpiredPackages = packaes;
}

malePackaes = new ArrayList<>();
femalePackaes = new ArrayList<>();
bothPackaes = new ArrayList<>();
for (Item i : packaes) {
//System.out.println("i = " + i);
bothPackaes = new ArrayList<>();

packaes = listOfTheNonExpiredPackages;

for (Item i : listOfTheNonExpiredPackages) {
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);
Expand All @@ -1583,7 +1598,19 @@ private void fillPackages() {
} else {
bothPackaes.add(i);
}

}
}

public List<Item> getListOfTheNonExpiredPackages() {
if (listOfTheNonExpiredPackages == null) {
listOfTheNonExpiredPackages = new ArrayList<>();
}
return listOfTheNonExpiredPackages;
}

public void setListOfTheNonExpiredPackages(List<Item> listOfTheNonExpiredPackages) {
this.listOfTheNonExpiredPackages = listOfTheNonExpiredPackages;
}

}
4 changes: 2 additions & 2 deletions src/main/java/com/divudi/bean/emr/DataUploadController.java
Original file line number Diff line number Diff line change
Expand Up @@ -3291,6 +3291,7 @@ private List<ItemFee> readCollectingCentrePriceListFromXcel(InputStream inputStr
categoryFacade.edit(category);
}


ItemFee fee = new ItemFee();
fee.setCreatedAt(new Date());
fee.setCreater(sessionController.getLoggedUser());
Expand All @@ -3300,8 +3301,7 @@ private List<ItemFee> readCollectingCentrePriceListFromXcel(InputStream inputStr
fee.setFee(price);
fee.setInstitution(institution);
fee.setDepartment(department);
itemFeeFacade.create(fee);

itemFeeFacade.create(fee);
}
return itemFees;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ public YearMonthDay getYearMonthDay() {
public void setYearMonthDay(YearMonthDay yearMonthDay) {
this.yearMonthDay = yearMonthDay;
}

private List<Stock> stk;

public void fillSelectStock() {
Expand Down Expand Up @@ -663,10 +664,6 @@ public void setStk(List<Stock> stk) {
this.stk = stk;
}





public void fillSelectStock(){
List<Stock> items = new ArrayList<>();

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/com/divudi/entity/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ public class Item implements Serializable, Comparable<Item> {
Date effectiveFrom;
@Temporal(javax.persistence.TemporalType.DATE)
private Date effectiveTo;
@Temporal(javax.persistence.TemporalType.TIMESTAMP)
private Date expiryDate;
private boolean scanFee;
double profitMargin;

Expand Down Expand Up @@ -1408,6 +1410,14 @@ public void setForGender(String forGender) {
this.forGender = forGender;
}

public Date getExpiryDate() {
return expiryDate;
}

public void setExpiryDate(Date expiryDate) {
this.expiryDate = expiryDate;
}

static class ReportItemComparator implements Comparator<ReportItem> {

@Override
Expand Down
2 changes: 0 additions & 2 deletions src/main/resources/META-INF/persistence.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
<property name="eclipselink.logging.parameters" value="false"/>
<property name="javax.persistence.schema-generation.database.action" value="create-or-extend-tables"/>
</properties>
</persistence-unit>
<persistence-unit name="hmisAuditPU" transaction-type="JTA">
Expand All @@ -17,7 +16,6 @@
<properties>
<property name="eclipselink.logging.level.sql" value="SEVERE"/>
<property name="eclipselink.logging.parameters" value="false"/>
<property name="javax.persistence.schema-generation.database.action" value="create-or-extend-tables"/>
</properties>
</persistence-unit>
</persistence>
Expand Down
23 changes: 21 additions & 2 deletions src/main/webapp/admin/pricing/package_name.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<div class="col-7 float-left" >

<p:panel id="gpDetail" class="w-100 no-border" header="Package Details">

value="#{packageNameController.current.id}"
<div class="row">
<div class="col-3">
<h:outputText id="lblName" value="Name" class="mt-2"></h:outputText>
Expand All @@ -82,6 +82,25 @@
</div>
</div>

<div class="row mt-2">
<div class="col-3">
<h:outputText value="Expiry Date" class="mt-2"></h:outputText>
</div>
<div class="col-7">
<p:datePicker
value="#{packageNameController.current.expiryDate}"
id="dpExp"
pattern="dd/MMM/yyyy - hh:mm:ss a"
styleClass="form-control w-100"
showTime="true"
showButtonBar="true"
timeInput="true"
class="w-100"
inputStyleClass="w-100" >
</p:datePicker>
</div>
</div>

<div class="row mt-2">
<div class="col-3">
<h:outputText value="For Whom (Gender)" class="mt-2"></h:outputText>
Expand All @@ -91,7 +110,7 @@
id="cmbSex"
value="#{packageNameController.current.forGender}"
class="w-100">
<f:selectItem itemLabel="Select" />
<f:selectItem itemLabel="Select" />
<f:selectItem itemLabel="Both" itemValue="Both"/>
<f:selectItem itemLabel="Male" itemValue="Male"/>
<f:selectItem itemLabel="Female" itemValue="Female"/>
Expand Down
3 changes: 2 additions & 1 deletion src/main/webapp/collecting_centre/bill.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@
action="#{collectingCentreBillController.settleBill}"
ajax="false"
onclick="if (!confirm('Are you sure you want to Settle This Bill ?'))
return false;"
return false;"

class="ui-button-success ">
</p:commandButton>
<p:commandButton
Expand Down
1 change: 0 additions & 1 deletion src/main/webapp/opd/opd_bill_package.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,6 @@
<h:outputText styleClass="fa-solid fa-circle-plus" />
<h:outputText value="Add New Items" class="mx-4"></h:outputText>
</f:facet>

<p:selectOneListbox
id="advanced"
value="#{billPackageController.currentBillItem.item}"
Expand Down

0 comments on commit 873aced

Please sign in to comment.