| Line 660... |
Line 660... |
| 660 |
reserve = inventoryItem.getReserve();
|
660 |
reserve = inventoryItem.getReserve();
|
| 661 |
defaultinventory = inventoryItem.getDefaultInventory();
|
661 |
defaultinventory = inventoryItem.getDefaultInventory();
|
| 662 |
holdinventory = inventoryItem.getHoldInventory();
|
662 |
holdinventory = inventoryItem.getHoldInventory();
|
| 663 |
totalheld = inventoryItem.getTotalHeldInventory();
|
663 |
totalheld = inventoryItem.getTotalHeldInventory();
|
| 664 |
heldforsource = inventoryItem.getHeldForSource();
|
664 |
heldforsource = inventoryItem.getHeldForSource();
|
| 665 |
allocable = available - reserve - totalheld - holdinventory;
|
- |
|
| - |
|
665 |
|
| 666 |
if(itemIdpendingOrdersMap.containsKey(sku)){
|
666 |
if(itemIdpendingOrdersMap.containsKey(sku)){
|
| 667 |
heldorders = itemIdpendingOrdersMap.get(sku);
|
667 |
heldorders = itemIdpendingOrdersMap.get(sku);
|
| 668 |
if(heldorders < 0){
|
668 |
if(heldorders < 0){
|
| 669 |
heldorders = 0;
|
669 |
heldorders = 0;
|
| 670 |
}
|
670 |
}
|
| 671 |
}
|
671 |
}
|
| 672 |
System.out.println("itemId: " + inventoryItem.getId() + "\trisky: " + inventoryItem.getRisky()+ "\tavailable: " + inventoryItem.getAvailability() + "\treserve: " + inventoryItem.getReserve() + "\theldForSource:" + inventoryItem.getHeldForSource() + "\twebsite_hold: " + inventoryItem.getHoldInventory() + "\tdefault_inv: " +inventoryItem.getDefaultInventory() + "\theldorders " + heldorders);
|
672 |
System.out.println("itemId: " + inventoryItem.getId() + "\trisky: " + inventoryItem.getRisky()+ "\tavailable: " + inventoryItem.getAvailability() + "\treserve: " + inventoryItem.getReserve() + "\theldForSource:" + inventoryItem.getHeldForSource() + "\twebsite_hold: " + inventoryItem.getHoldInventory() + "\tdefault_inv: " +inventoryItem.getDefaultInventory() + "\theldorders " + heldorders);
|
| 673 |
row = sheet.getRow((short) iterator);
|
673 |
row = sheet.getRow((short) iterator);
|
| 674 |
if(allocable < 0){
|
- |
|
| 675 |
allocable = 0;
|
- |
|
| 676 |
}
|
674 |
|
| 677 |
if(inventoryItem.getRisky()){
|
675 |
if(inventoryItem.getRisky()){
|
| - |
|
676 |
allocable = available - reserve - totalheld - holdinventory;
|
| - |
|
677 |
if(allocable < 0){
|
| - |
|
678 |
allocable = 0;
|
| - |
|
679 |
}
|
| 678 |
sent_inventory = Math.round(allocable*2/3) + heldforsource - heldorders ;
|
680 |
sent_inventory = Math.round(allocable*2/3) + heldforsource - heldorders ;
|
| 679 |
System.out.println("allocable" + allocable + "\t2/3allocable" + Math.round(allocable*2/3) + "\theld for source" + heldforsource + "\ttotal held" + totalheld +"\theldorders" + heldorders + "\tFinal Value is : " + (Math.round(allocable*2/3) + heldforsource - heldorders));
|
681 |
System.out.println("allocable" + allocable + "\t2/3allocable" + Math.round(allocable*2/3) + "\theld for source" + heldforsource + "\ttotal held" + totalheld +"\theldorders" + heldorders + "\tFinal Value is : " + (Math.round(allocable*2/3) + heldforsource - heldorders));
|
| 680 |
if(sent_inventory < 0){
|
682 |
if(sent_inventory < 0){
|
| 681 |
sent_inventory = 0;
|
683 |
sent_inventory = 0;
|
| 682 |
}
|
684 |
}
|
| 683 |
}
|
685 |
}
|
| 684 |
else{
|
686 |
else{
|
| - |
|
687 |
allocable = available - reserve - totalheld;
|
| - |
|
688 |
if(allocable < 0){
|
| - |
|
689 |
allocable = 0;
|
| - |
|
690 |
}
|
| 685 |
if((allocable + heldforsource + holdinventory) > defaultinventory){
|
691 |
if((allocable + heldforsource ) > defaultinventory){
|
| 686 |
sent_inventory = Math.round(allocable*2/3) + heldforsource - heldorders + holdinventory;
|
692 |
sent_inventory = Math.round(allocable*2/3) + heldforsource - heldorders;
|
| 687 |
System.out.println("actual" + allocable + "\t2/3actual" + Math.round(allocable*2/3) + "\theld for source" + heldforsource + "\theldorders" + heldorders + "\tFinal Value is : " + (Math.round(allocable*2/3) + heldforsource - heldorders + holdinventory));
|
693 |
System.out.println("actual" + allocable + "\t2/3actual" + Math.round(allocable*2/3) + "\theld for source" + heldforsource + "\theldorders" + heldorders + "\tFinal Value is : " + (Math.round(allocable*2/3) + heldforsource - heldorders));
|
| 688 |
if(sent_inventory < 0){
|
694 |
if(sent_inventory < 0){
|
| 689 |
sent_inventory = 0;
|
695 |
sent_inventory = 0;
|
| 690 |
}
|
696 |
}
|
| 691 |
}
|
697 |
}
|
| 692 |
else{
|
698 |
else{
|