@Test public void shouldNotExpiredLot() throws Exception { Calendar expireLot=Calendar.getInstance(); DateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT_ONLY_MONTH_AND_YEAR); viewModel.setExpiryDate(dateFormat.format(expireLot.getTime())); assertEquals(viewModel.isExpiredLot(), false); }
public boolean isExpiredLot() { if (getExpiryDate() == null) { return true; } Calendar nowCalender = Calendar.getInstance(); Date expireDate = DateUtil.parseString(getExpiryDate(), DateUtil.DATE_FORMAT_ONLY_MONTH_AND_YEAR); if (expireDate != null) { Calendar expireCalender = Calendar.getInstance(); expireCalender.setTime(expireDate); expireCalender.add(Calendar.MONTH, 1); expireCalender.set(Calendar.DAY_OF_MONTH, 1); return expireCalender.before(nowCalender); } return false; }
LotMovementViewModel implements Serializable { public boolean isExpiredLot() { if (getExpiryDate() == null) { return true; } Calendar nowCalender = Calendar.getInstance(); Date expireDate = DateUtil.parseString(getExpiryDate(), DateUtil.DATE_FORMAT_ONLY_MONTH_AND_YEAR); if (expireDate != null) { Calendar expireCalender = Calendar.getInstance(); expireCalender.setTime(expireDate); expireCalender.add(Calendar.MONTH, 1); expireCalender.set(Calendar.DAY_OF_MONTH, 1); return expireCalender.before(nowCalender); } return false; } }
LotMovementViewModel implements Serializable { public boolean isExpiredLot() { if (getExpiryDate() == null) { return true; } Calendar nowCalender = Calendar.getInstance(); Date expireDate = DateUtil.parseString(getExpiryDate(), DateUtil.DATE_FORMAT_ONLY_MONTH_AND_YEAR); if (expireDate != null) { Calendar expireCalender = Calendar.getInstance(); expireCalender.setTime(expireDate); expireCalender.add(Calendar.MONTH, 1); expireCalender.set(Calendar.DAY_OF_MONTH, 1); return expireCalender.before(nowCalender); } return false; } LotMovementViewModel(String lotNumber, String expiryDate, MovementReasonManager.MovementType movementType);  LotMovementViewModel(String lotNumber, String expiryDate, String quantityOnHand, MovementReasonManager.MovementType movementType);  LotMovementViewModel(String lotNumber, String expiryDate, MovementReasonManager.MovementType movementType, String quantity); }
LotMovementViewModel implements Serializable { public boolean isExpiredLot() { if (getExpiryDate() == null) { return true; } Calendar nowCalender = Calendar.getInstance(); Date expireDate = DateUtil.parseString(getExpiryDate(), DateUtil.DATE_FORMAT_ONLY_MONTH_AND_YEAR); if (expireDate != null) { Calendar expireCalender = Calendar.getInstance(); expireCalender.setTime(expireDate); expireCalender.add(Calendar.MONTH, 1); expireCalender.set(Calendar.DAY_OF_MONTH, 1); return expireCalender.before(nowCalender); } return false; } LotMovementViewModel(String lotNumber, String expiryDate, MovementReasonManager.MovementType movementType);  LotMovementViewModel(String lotNumber, String expiryDate, String quantityOnHand, MovementReasonManager.MovementType movementType);  LotMovementViewModel(String lotNumber, String expiryDate, MovementReasonManager.MovementType movementType, String quantity); boolean validateQuantityNotGreaterThanSOH(); LotMovementItem convertViewToModel(Product product); boolean quantityGreaterThanZero(); LotMovementItem convertViewToModelAndResetSOH(Product product); boolean validateLotWithPositiveQuantity(); boolean validateLotWithNoEmptyFields(); boolean isExpiredLot(); boolean isNewAdded(); static String generateLotNumberForProductWithoutLot(String productCode, String expiryDate); long getAdjustmentQuantity(); @Override String toString(); }
LotMovementViewModel implements Serializable { public boolean isExpiredLot() { if (getExpiryDate() == null) { return true; } Calendar nowCalender = Calendar.getInstance(); Date expireDate = DateUtil.parseString(getExpiryDate(), DateUtil.DATE_FORMAT_ONLY_MONTH_AND_YEAR); if (expireDate != null) { Calendar expireCalender = Calendar.getInstance(); expireCalender.setTime(expireDate); expireCalender.add(Calendar.MONTH, 1); expireCalender.set(Calendar.DAY_OF_MONTH, 1); return expireCalender.before(nowCalender); } return false; } LotMovementViewModel(String lotNumber, String expiryDate, MovementReasonManager.MovementType movementType);  LotMovementViewModel(String lotNumber, String expiryDate, String quantityOnHand, MovementReasonManager.MovementType movementType);  LotMovementViewModel(String lotNumber, String expiryDate, MovementReasonManager.MovementType movementType, String quantity); boolean validateQuantityNotGreaterThanSOH(); LotMovementItem convertViewToModel(Product product); boolean quantityGreaterThanZero(); LotMovementItem convertViewToModelAndResetSOH(Product product); boolean validateLotWithPositiveQuantity(); boolean validateLotWithNoEmptyFields(); boolean isExpiredLot(); boolean isNewAdded(); static String generateLotNumberForProductWithoutLot(String productCode, String expiryDate); long getAdjustmentQuantity(); @Override String toString();  }