@Test public void shouldGenerateLotNumberForProductWithoutLot() throws Exception { String productCode = "02F49"; String expiryDate = "Nov 2017"; assertThat(LotMovementViewModel.generateLotNumberForProductWithoutLot(productCode, expiryDate), is("SEM-LOTE-02F49-112017")); }
public static String generateLotNumberForProductWithoutLot(String productCode, String expiryDate) { try { return "SEM-LOTE-" + productCode.toUpperCase() + "-" + DateUtil.convertDate(expiryDate, DateUtil.DATE_FORMAT_ONLY_MONTH_AND_YEAR, DateUtil.DATE_DIGIT_FORMAT_ONLY_MONTH_AND_YEAR); } catch (ParseException e) { new LMISException(e, "LotMovementViewModel.generateLotNumberForProductWithoutLot").reportToFabric(); } return null; }
LotMovementViewModel implements Serializable { public static String generateLotNumberForProductWithoutLot(String productCode, String expiryDate) { try { return "SEM-LOTE-" + productCode.toUpperCase() + "-" + DateUtil.convertDate(expiryDate, DateUtil.DATE_FORMAT_ONLY_MONTH_AND_YEAR, DateUtil.DATE_DIGIT_FORMAT_ONLY_MONTH_AND_YEAR); } catch (ParseException e) { new LMISException(e, "LotMovementViewModel.generateLotNumberForProductWithoutLot").reportToFabric(); } return null; } }
LotMovementViewModel implements Serializable { public static String generateLotNumberForProductWithoutLot(String productCode, String expiryDate) { try { return "SEM-LOTE-" + productCode.toUpperCase() + "-" + DateUtil.convertDate(expiryDate, DateUtil.DATE_FORMAT_ONLY_MONTH_AND_YEAR, DateUtil.DATE_DIGIT_FORMAT_ONLY_MONTH_AND_YEAR); } catch (ParseException e) { new LMISException(e, "LotMovementViewModel.generateLotNumberForProductWithoutLot").reportToFabric(); } return null; } 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 static String generateLotNumberForProductWithoutLot(String productCode, String expiryDate) { try { return "SEM-LOTE-" + productCode.toUpperCase() + "-" + DateUtil.convertDate(expiryDate, DateUtil.DATE_FORMAT_ONLY_MONTH_AND_YEAR, DateUtil.DATE_DIGIT_FORMAT_ONLY_MONTH_AND_YEAR); } catch (ParseException e) { new LMISException(e, "LotMovementViewModel.generateLotNumberForProductWithoutLot").reportToFabric(); } return null; } 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 static String generateLotNumberForProductWithoutLot(String productCode, String expiryDate) { try { return "SEM-LOTE-" + productCode.toUpperCase() + "-" + DateUtil.convertDate(expiryDate, DateUtil.DATE_FORMAT_ONLY_MONTH_AND_YEAR, DateUtil.DATE_DIGIT_FORMAT_ONLY_MONTH_AND_YEAR); } catch (ParseException e) { new LMISException(e, "LotMovementViewModel.generateLotNumberForProductWithoutLot").reportToFabric(); } return null; } 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();  }