diff --git a/src/org/openbravo/costing/CostingServer.java b/src/org/openbravo/costing/CostingServer.java
--- a/src/org/openbravo/costing/CostingServer.java
+++ b/src/org/openbravo/costing/CostingServer.java
@@ -340,13 +340,14 @@
     // check if closing inventory needs to be adjusted due to a remainder value
     if (trxType == TrxType.InventoryClosing) {
       BigDecimal currentStock = CostAdjustmentUtils.getStockOnTransactionDate(getOrganization(),
-          transaction, costingAlgorithm.costDimensions, transaction.getProduct().isProduction(),
-          costingRule.isBackdatedTransactionsFixed(), transaction.getCurrency());
+          transaction, CostingUtils.getFullDimensions(transaction), transaction.getProduct()
+              .isProduction(), costingRule.isBackdatedTransactionsFixed(), transaction
+              .getCurrency());
 
       if (BigDecimal.ZERO.compareTo(currentStock) == 0) {
         BigDecimal currentValuedStock = CostAdjustmentUtils.getValuedStockOnTransactionDate(
-            getOrganization(), transaction, costingAlgorithm.costDimensions, transaction
-                .getProduct().isProduction(), costingRule.isBackdatedTransactionsFixed(),
+            getOrganization(), transaction, CostingUtils.getFullDimensions(transaction),
+            transaction.getProduct().isProduction(), costingRule.isBackdatedTransactionsFixed(),
             transaction.getCurrency());
 
         if (BigDecimal.ZERO.compareTo(currentValuedStock) != 0) {
diff --git a/src/org/openbravo/costing/CostingUtils.java b/src/org/openbravo/costing/CostingUtils.java
--- a/src/org/openbravo/costing/CostingUtils.java
+++ b/src/org/openbravo/costing/CostingUtils.java
@@ -352,6 +352,15 @@
   }
 
   /**
+   * @return The costDimensions HashMap with values for every dimension.
+   */
+  public static HashMap<CostDimension, BaseOBObject> getFullDimensions(MaterialTransaction trx) {
+    HashMap<CostDimension, BaseOBObject> costDimensions = new HashMap<CostDimension, BaseOBObject>();
+    costDimensions.put(CostDimension.Warehouse, trx.getStorageBin().getWarehouse());
+    return costDimensions;
+  }
+
+  /**
    * Calculates the stock of the product on the given date and for the given cost dimensions. It
    * only takes transactions that have its cost calculated.
    */
