diff --git a/src/main/java/com/divudi/bean/common/SearchController.java b/src/main/java/com/divudi/bean/common/SearchController.java index 4c2420a0eb..c383d137ff 100644 --- a/src/main/java/com/divudi/bean/common/SearchController.java +++ b/src/main/java/com/divudi/bean/common/SearchController.java @@ -2426,6 +2426,11 @@ public void listPharmacyBills(BillType bt, Class bc) { sql += " and ((b.department.name) like :dep )"; m.put("dep", "%" + getSearchKeyword().getDepartment().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 )"; diff --git a/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java b/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java index d888ee88f6..d8bba1621b 100644 --- a/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java +++ b/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java @@ -664,6 +664,39 @@ public void setStk(List stk) { this.stk = stk; } + public void fillSelectStock() { + List items = new ArrayList<>(); + if (stock == null) { + stk = items; + return; + } + String sql; + Map 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 getStk() { + return stk; + } + + public void setStk(List stk) { + this.stk = stk; + } + public void fillSelectStock(){ List items = new ArrayList<>(); diff --git a/src/main/java/com/divudi/bean/store/StoreIssueController.java b/src/main/java/com/divudi/bean/store/StoreIssueController.java index 6e03e1d640..acdf8c627c 100644 --- a/src/main/java/com/divudi/bean/store/StoreIssueController.java +++ b/src/main/java/com/divudi/bean/store/StoreIssueController.java @@ -38,6 +38,7 @@ import com.divudi.facade.StockFacade; import com.divudi.facade.StockHistoryFacade; import com.divudi.bean.common.util.JsfUtil; +import com.divudi.data.BillTypeAtomic; import java.io.Serializable; import java.util.ArrayList; import java.util.Calendar; @@ -414,6 +415,8 @@ private void savePreBillFinally() { getPreBill().setBillTime(new Date()); getPreBill().setFromDepartment(getSessionController().getLoggedUser().getDepartment()); getPreBill().setFromInstitution(getSessionController().getLoggedUser().getDepartment().getInstitution()); + getPreBill().setBillType(BillType.StoreIssue); + getPreBill().setBillTypeAtomic(BillTypeAtomic.STORE_ORDER); if (getPreBill().getId() == null) { getBillFacade().create(getPreBill()); @@ -542,7 +545,7 @@ public void settleBill() { } getPreBill().setPaidAmount(getPreBill().getTotal()); - // ////System.out.println("getPreBill().getPaidAmount() = " + getPreBill().getPaidAmount()); + List tmpBillItems = getPreBill().getBillItems(); getPreBill().setBillItems(null); @@ -973,7 +976,6 @@ public PreBill getPreBill() { if (preBill == null) { preBill = new PreBill(); preBill.setBillType(BillType.StoreIssue); - // preBill.setPaymentScheme(getPaymentSchemeController().getItems().get(0)); } return preBill; } diff --git a/src/main/webapp/resources/store/issue.xhtml b/src/main/webapp/resources/store/issue.xhtml index 04702e05d2..e1aab72504 100644 --- a/src/main/webapp/resources/store/issue.xhtml +++ b/src/main/webapp/resources/store/issue.xhtml @@ -266,12 +266,12 @@ - + - + @@ -306,7 +306,7 @@ - + @@ -326,16 +326,6 @@ - - - - - \ No newline at end of file diff --git a/src/main/webapp/store/store_adjustment_department.xhtml b/src/main/webapp/store/store_adjustment_department.xhtml index b4f8380b88..ca304842cc 100644 --- a/src/main/webapp/store/store_adjustment_department.xhtml +++ b/src/main/webapp/store/store_adjustment_department.xhtml @@ -78,7 +78,7 @@ - - - @@ -37,80 +34,6 @@
-
- - - - - - - - - - #{w.name} - - - #{w.institution.name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -278,6 +201,81 @@
+ +
+ + + + + + + + + + #{w.name} + + + #{w.institution.name} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/src/main/webapp/store/store_reprint_bill_unit_issue.xhtml b/src/main/webapp/store/store_reprint_bill_unit_issue.xhtml index f377bf089f..2727fb4ab1 100644 --- a/src/main/webapp/store/store_reprint_bill_unit_issue.xhtml +++ b/src/main/webapp/store/store_reprint_bill_unit_issue.xhtml @@ -13,41 +13,73 @@ - + - -
- - - - +
+ +
+ + + + + + + +
+
+ +
+ +
+ + + + + + - - + + - +
+
+ + + + + +
- - - - - - - - -
- - - - diff --git a/src/main/webapp/store/store_search_issue_bill.xhtml b/src/main/webapp/store/store_search_issue_bill.xhtml index a1d9df795b..8b808a6aa1 100644 --- a/src/main/webapp/store/store_search_issue_bill.xhtml +++ b/src/main/webapp/store/store_search_issue_bill.xhtml @@ -12,143 +12,161 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - - - - - - - - - - - - - - - -
- - - - - - -
-
- - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + +
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + +
+
+
-
- -