diff --git a/pom.xml b/pom.xml index d47b8e5cf0..716e938d03 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ ruhunuDemo 3.0.0 war - ruhunu + ruhunuDemo ${project.build.directory}/endorsed diff --git a/src/main/java/com/divudi/bean/pharmacy/GrnController.java b/src/main/java/com/divudi/bean/pharmacy/GrnController.java index 0917b9ca19..6abd653fd8 100644 --- a/src/main/java/com/divudi/bean/pharmacy/GrnController.java +++ b/src/main/java/com/divudi/bean/pharmacy/GrnController.java @@ -1078,12 +1078,15 @@ public void onEdit(RowEditEvent event) { } public void checkQty(BillItem bi) { + if (bi.getTmpQty() < 0.0) { bi.setTmpQty(0.0); } + if (bi.getTmpFreeQty() < 0.0) { bi.setTmpFreeQty(0.0); } + onEdit(bi); } @@ -1091,21 +1094,11 @@ public void onEdit(BillItem tmp) { setBatch(tmp); double remains = getPharmacyCalculation().getRemainingQty(tmp.getPharmaceuticalBillItem()); -// System.err.println("1 " + tmp.getTmpQty()); -// System.err.println("2 " + tmp.getQty()); -// System.err.println("3 " + tmp.getPharmaceuticalBillItem().getQty()); -// System.err.println("4 " + tmp.getPharmaceuticalBillItem().getQtyInUnit()); -//System.out.println("remains = " + remains); -// System.out.println("tmp.getPharmaceuticalBillItem().getQtyInUnit() = " + tmp.getPharmaceuticalBillItem().getQtyInUnit()); + if (remains < tmp.getPharmaceuticalBillItem().getQtyInUnit()) { tmp.setTmpQty(remains); JsfUtil.addErrorMessage("You cant Change Qty than Remaining qty"); } -// System.out.println("tmp.getPreviousRecieveQtyInUnit() = " + tmp.getPreviousRecieveQtyInUnit()); -// if(tmp.getPreviousRecieveQtyInUnit() < tmp.getPharmaceuticalBillItem().getQtyInUnit()){ -// tmp.setTmpQty(tmp.getPreviousRecieveQtyInUnit()); -// JsfUtil.addErrorMessage("You cant Order Qty than Remaining qty to recieve"); -// } if (tmp.getPharmaceuticalBillItem().getPurchaseRate() > tmp.getPharmaceuticalBillItem().getRetailRate()) { tmp.getPharmaceuticalBillItem().setRetailRate(getRetailPrice(tmp.getPharmaceuticalBillItem().getBillItem())); @@ -1119,8 +1112,6 @@ public void onEdit(BillItem tmp) { // return; } } -// manually set Wholesale Rate************** -// tmp.getPharmaceuticalBillItem().setWholesaleRate((tmp.getPharmaceuticalBillItem().getPurchaseRate() * 1.08)* (tmp.getPharmaceuticalBillItem().getQtyInUnit())/(tmp.getPharmaceuticalBillItem().getQtyInUnit() + tmp.getPharmaceuticalBillItem().getFreeQtyInUnit()) ); calGrossTotal(); calDifference(); @@ -1133,21 +1124,6 @@ public void onEditPurchaseRate(BillItem tmp) { } -// private List getSuggession(Item item) { -// List suggessions = new ArrayList<>(); -// -// if (item instanceof Amp) { -// suggessions = getPharmacyBillBean().findItem((Amp) item, suggessions); -// } else if (item instanceof Ampp) { -// suggessions = getPharmacyBillBean().findItem((Ampp) item, suggessions); -// } else if (item instanceof Vmp) { -// suggessions = getPharmacyBillBean().findItem((Vmp) item, suggessions); -// } else if (item instanceof Vmpp) { -// suggessions = getPharmacyBillBean().findItem((Vmpp) item, suggessions); -// } -// -// return suggessions; -// } public void calGrossTotal() { double tmp = 0.0; int serialNo = 0; diff --git a/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java b/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java index bbd2be82d1..c1035c68ce 100644 --- a/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java +++ b/src/main/java/com/divudi/bean/store/StoreAdjustmentController.java @@ -7,6 +7,7 @@ import com.divudi.bean.common.SessionController; import com.divudi.bean.common.util.JsfUtil; +import com.divudi.bean.pharmacy.ConsumableCategoryController; import com.divudi.data.BillClassType; import com.divudi.data.BillNumberSuffix; import com.divudi.data.BillType; @@ -627,5 +628,43 @@ public YearMonthDay getYearMonthDay() { public void setYearMonthDay(YearMonthDay yearMonthDay) { this.yearMonthDay = yearMonthDay; } + private List 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; + } + + + + } diff --git a/src/main/webapp/store/store_adjustment_department.xhtml b/src/main/webapp/store/store_adjustment_department.xhtml index 494049e982..ca304842cc 100644 --- a/src/main/webapp/store/store_adjustment_department.xhtml +++ b/src/main/webapp/store/store_adjustment_department.xhtml @@ -9,7 +9,6 @@ - @@ -31,6 +30,10 @@ var="i" itemLabel="#{i.itemBatch.item.name}" itemValue="#{i}" > + @@ -72,6 +75,44 @@ + + + + + + + + + + + + + + + + + + + + + + @@ -176,11 +217,7 @@ - - - -