Commit 7e55c903 authored by Víctor Martínez Romanos's avatar Víctor Martínez Romanos
Browse files

Related to ISSUE-50259: fixed code formatting

parent ad3772f4
......@@ -378,8 +378,8 @@ public class ProcessIssue extends BaseProcessActionHandler {
" where sp.processInstance= :pinstanceId" +
" and sb.id <> :storageBinId" +
" order by sp.priority asc";
//@formatter:off
//@formatter:on
return OBDal.getInstance()
.createQuery(StockProposed.class, hql)
.setNamedParameter("pinstanceId", pInstanceID)
......@@ -414,7 +414,10 @@ public class ProcessIssue extends BaseProcessActionHandler {
* @return The pinstanceid, from which you will get the result in StockProposed
*/
private static String callProcessGetStock(final String recordID, final String clientId, final String orgId, final String productId, final String uomId, final String warehouseId, final String attributesetinstanceId, final BigDecimal quantity, final String warehouseRuleId, final String reservationId) {
private static String callProcessGetStock(final String recordID, final String clientId,
final String orgId, final String productId, final String uomId, final String warehouseId,
final String attributesetinstanceId, final BigDecimal quantity, final String warehouseRuleId,
final String reservationId) {
final String processId = SequenceIdData.getUUID();
OBContext.setAdminMode(false);
try {
......@@ -429,7 +432,8 @@ public class ProcessIssue extends BaseProcessActionHandler {
StockUtils.getStock(processId, recordID, quantity, productId, null, warehouseId, null, orgId,
attributesetinstanceId, OBContext.getOBContext().getUser().getId(), clientId,
warehouseRuleId, uomId, null, null, null, null, null, reservationId, "N");
final long elapsedGetStockProcedureCall = (System.currentTimeMillis() - initGetStockProcedureCall);
final long elapsedGetStockProcedureCall = (System.currentTimeMillis()
- initGetStockProcedureCall);
if (log.isDebugEnabled()) {
log.debug("Partial time to execute callGetStock Procedure Call() : "
+ elapsedGetStockProcedureCall);
......@@ -458,11 +462,14 @@ public class ProcessIssue extends BaseProcessActionHandler {
* The Line No. of the created Movement Line
* @param locator
* The Distribution Order Issue Warehouse's OverIssue Locator
* @return movement line
* The Movement Line created
* @return movement line The Movement Line created
*/
private static InternalMovementLine createAndSaveMovementLine(final InternalMovement movement, final DistributionOrderLine distOrdline, final StockProposed stock, final BigDecimal movementQty, final long lineno, final Locator locator, final Map<String, String> existingProductIds) {
final InternalMovementLine movementline = OBProvider.getInstance().get(InternalMovementLine.class);
private static InternalMovementLine createAndSaveMovementLine(final InternalMovement movement,
final DistributionOrderLine distOrdline, final StockProposed stock,
final BigDecimal movementQty, final long lineno, final Locator locator,
final Map<String, String> existingProductIds) {
final InternalMovementLine movementline = OBProvider.getInstance()
.get(InternalMovementLine.class);
movementline.setOrganization(movement.getOrganization());
movementline.setClient(movement.getClient());
movementline.setMovement(movement);
......@@ -487,24 +494,26 @@ private static InternalMovementLine createAndSaveMovementLine(final InternalMove
return movementline;
}
/**
* Creates or updates an existing line to work with negative stock if possible
*
* @param distOrdline
* - The Distribution Order Line
* @param movement
* - The Internal Movement
* @param locator
* - The Locator
* @param movementQty
* - The Movement Quantity for Movement Line
* @param lineno
* - The Line no to be set in case new Movement Line to be created
* @return line count
* - The No.of lines added, being -1 if no possible to work with negative stock, 0 if an existing line have been reused and 1 if a new line has been created
*/
/**
* Creates or updates an existing line to work with negative stock if possible
*
* @param distOrdline
* - The Distribution Order Line
* @param movement
* - The Internal Movement
* @param locator
* - The Locator
* @param movementQty
* - The Movement Quantity for Movement Line
* @param lineno
* - The Line no to be set in case new Movement Line to be created
* @return line count - The No.of lines added, being -1 if no possible to work with negative
* stock, 0 if an existing line have been reused and 1 if a new line has been created
*/
private static int workWithNegativeStockIfPossible(DistributionOrderLine distOrdline, InternalMovement movement, Locator locator, BigDecimal movementQty, long lineno, final Map<String, String> existingProductIds) {
private static int workWithNegativeStockIfPossible(DistributionOrderLine distOrdline,
InternalMovement movement, Locator locator, BigDecimal movementQty, long lineno,
final Map<String, String> existingProductIds) {
int lineCount = -1;
// Create Movement Lines only when product does not have attribute set
if (distOrdline.getProduct().getAttributeSet() == null) {
......@@ -514,15 +523,16 @@ private static InternalMovementLine createAndSaveMovementLine(final InternalMove
InternalMovementLine movementline = null;
if (existingProductIds.containsKey(productId)) {
// get movementLine if it already exists for Product proposed in new line
movementline = OBDal.getInstance().get(InternalMovementLine.class, existingProductIds.get(productId));
movementline = OBDal.getInstance()
.get(InternalMovementLine.class, existingProductIds.get(productId));
}
if (movementline != null) {
movementline.setMovementQuantity(movementline.getMovementQuantity().add(movementQty));
OBDal.getInstance().save(movementline);
lineCount = 0;
} else {
createAndSaveMovementLine(movement, distOrdline, null, movementQty, lineno,
locator, existingProductIds);
createAndSaveMovementLine(movement, distOrdline, null, movementQty, lineno, locator,
existingProductIds);
lineCount = 1;
}
}
......@@ -531,7 +541,9 @@ private static InternalMovementLine createAndSaveMovementLine(final InternalMove
/**
* Returns OverIssue Bin from the Issue Warehouse of Distribution Order
* @param warehouse - Issue Warehouse of Distribution Order
*
* @param warehouse
* - Issue Warehouse of Distribution Order
* @return Locator with over issue inventory status
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment