Skip to content

Commit

Permalink
Merge pull request #6800 from hmislk/Issue#6784
Browse files Browse the repository at this point in the history
Issue#6784 Closes #6784
  • Loading branch information
DeshaniPubudu authored Aug 7, 2024
2 parents c359de8 + eac7a1c commit dae1e99
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 108 deletions.
2 changes: 1 addition & 1 deletion .github/counter.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
20
50 changes: 15 additions & 35 deletions src/main/java/com/divudi/bean/common/SearchController.java
Original file line number Diff line number Diff line change
Expand Up @@ -2475,6 +2475,11 @@ public void listPharmacyBills(BillType bt, Class bc) {
m.put("dep", "%" + getSearchKeyword().getToDepartment().trim().toUpperCase() + "%");
}

if (getSearchKeyword().getToDepartment() != null && !getSearchKeyword().getToDepartment().trim().equals("")) {
sql += " and ((b.toDepartment.name) like :dep )";
m.put("dep", "%" + getSearchKeyword().getToDepartment().trim().toUpperCase() + "%");
}

if (getSearchKeyword().getNetTotal() != null && !getSearchKeyword().getNetTotal().trim().equals("")) {
sql += " and ((b.netTotal) like :netTotal )";
m.put("netTotal", "%" + getSearchKeyword().getNetTotal().trim().toUpperCase() + "%");
Expand Down Expand Up @@ -2567,7 +2572,6 @@ public void createTableBht(BillType btp) {
m.put("fd", getFromDate());
m.put("td", getToDate());
m.put("ins", getSessionController().getInstitution());
m.put("dep", getSessionController().getDepartment());
String sql;

sql = "Select b from Bill b "
Expand All @@ -2576,9 +2580,18 @@ public void createTableBht(BillType btp) {
+ " and b.createdAt between :fd and :td "
+ " and b.billType=:bt"
+ " and b.institution=:ins "
+ " and b.department=:dep "
+ " and type(b)=:class ";

if (webUserController.hasPrivilege("StoreAdministration")) {
if (getSearchKeyword().getDepartment() != null && !getSearchKeyword().getDepartment().trim().equals("")) {
sql += " and ((b.department.name) like :dep )";
m.put("dep", "%" + getSearchKeyword().getDepartment().trim().toUpperCase() + "%");
}
} else {
sql += "and b.department=:dep ";
m.put("dep", getSessionController().getDepartment());

}
if (getSearchKeyword().getPatientName() != null && !getSearchKeyword().getPatientName().trim().equals("")) {
sql += " and ((b.patientEncounter.patient.person.name) like :patientName )";
m.put("patientName", "%" + getSearchKeyword().getPatientName().trim().toUpperCase() + "%");
Expand Down Expand Up @@ -7194,39 +7207,6 @@ public void createCollectingCentreBillSearch() {

}

public void createStaffCreditBillList() {
String jpql;
Map m = new HashMap();
List<BillTypeAtomic> btas = new ArrayList<>();
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.cancelled = false "
+ "and b.refunded = false ";
jpql += " and b.billTypeAtomic in :btas ";
if (staff != null) {
jpql += " and b.toStaff=:staff ";
m.put("staff", staff);
}

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

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

m.put("fromDate", fromDate);
m.put("toDate", toDate);
m.put("btas", btas);

System.out.println("m = " + m);
System.out.println("jpql = " + jpql);

bills = getBillFacade().findByJpql(jpql, m, TemporalType.TIMESTAMP);
System.out.println("bills = " + bills);
}

public void createGeneralCreditBillList() {
String jpql;
Map m = new HashMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,7 @@ public void setStk(List<Stock> stk) {
this.stk = stk;
}


// public void fillSelectStock(){
// List<Stock> items = new ArrayList<>();
//
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0.20240807.20
3.0.0.20240807.20
2 changes: 0 additions & 2 deletions src/main/webapp/resources/store/inward/issueBill.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@
<h:outputLabel value="-----------------------------------------------" />
</div>



<div >

<table style="width: 100%;" >
Expand Down
25 changes: 14 additions & 11 deletions src/main/webapp/store/store_retail_sale_bht.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -103,33 +103,36 @@
<p:outputLabel value="Add Items" class="mx-2" ></p:outputLabel>
</f:facet>
<div class="d-flex justify-content-between">
<div>
<div class="d-flex gap-2">
<p:autoComplete
accesskey="i"
forceSelection="true"
id="acStock"
value="#{storeSaleBhtController.stock}"
completeMethod="#{storeSaleBhtController.completeAvailableStocksStore}"
var="i"
style="width: 400px;"
inputStyleClass="form-control"
maxResults="25"
scrollHeight="600"
itemLabel="#{i.itemBatch.item.name}"
itemValue="#{i}"
placeholder="Medicines/Devices"
placeholder="Store Item / Devices"
>

<p:column headerText="Item">
<p:column headerText="Item" style="padding:6px; width: 500px;">
<h:outputLabel value="#{i.itemBatch.item.name}" ></h:outputLabel>
</p:column>
<p:column headerText="Code">
<p:column headerText="Code" style="padding:6px; width: 100px;">
<h:outputLabel value="#{i.itemBatch.item.code}" ></h:outputLabel>
</p:column>
<p:column headerText="Stocks">
<h:outputLabel value="#{i.stock}" >
<f:convertNumber pattern="#,###.0" ></f:convertNumber>
<p:column headerText="Stocks" style="padding:6px; width: 80px;">
<h:outputLabel value="#{i.stock}" style="text-align: right;" class="w-100">
<f:convertNumber pattern="#,###" ></f:convertNumber>
</h:outputLabel>
</p:column>
<p:column headerText="Expiry">
<p:column headerText="Expiry" style="padding:6px; width: 130px;">
<h:outputLabel value="#{i.itemBatch.dateOfExpire}" >
<f:convertDateTime pattern="#{sessionController.applicationPreference.longDateFormat}" ></f:convertDateTime>
<f:convertDateTime pattern="#{sessionController.applicationPreference.shortDateFormat}" ></f:convertDateTime>
</h:outputLabel>
</p:column>
<p:ajax event="focus" process="acStock" ></p:ajax>
Expand All @@ -141,9 +144,9 @@
autocomplete="off"
accesskey="q"
id="txtQty"
style="width: 150px;"
value="#{storeSaleBhtController.qty}"
placeholder="Quantity"
class="mx-5"
>
<p:ajax event="keyup" listener="#{storeSaleBhtController.calculateBillItemListner}" process="acStock txtQty"></p:ajax>
<p:ajax event="blur" listener="#{storeSaleBhtController.calculateBillItemListner}" process="acStock txtQty"></p:ajax>
Expand Down
Loading

0 comments on commit dae1e99

Please sign in to comment.