Skip to content

Commit

Permalink
Issue #428: Modified test for Material Internal Consumption
Browse files Browse the repository at this point in the history
ETP-60: The order of the instructions in the test testCountWithoutDocTypeConfigured was not correct, and the last change was added to the getTransactionsBatchCount function which also made use of the new Date()
  • Loading branch information
jortolanosmf committed Aug 7, 2024
1 parent e1830d5 commit 341afcd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,11 @@ public void testCountWithoutDocTypeConfigured() {

createInternalConsumptionLine(internalConsumption);

TestCostingUtils.runCostingBackground();

processInternalConsumption(internalConsumption);

activeOrDeactiveMaterialManagementConsumptionTable(true);

TestCostingUtils.runCostingBackground();

OBDal.getInstance().commitAndClose();

Expand Down
3 changes: 1 addition & 2 deletions src/org/openbravo/costing/CostingBackground.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,13 @@ private int getTransactionsBatchCount(List<String> orgsWithRule) {
+ " and p.stocked = true"
+ " and trxtype.reference.id = :refid"
+ " and trxtype.searchKey = trx.movementType"
+ " and trx.transactionProcessDate <= :now"
+ " and trx.transactionProcessDate <= now()"
+ " and trx.organization.id in (:orgs)";

//@formatter:on
Query<Long> trxQry = OBDal.getInstance().getSession().createQuery(where, Long.class);

trxQry.setParameter("refid", CostAdjustmentUtils.MovementTypeRefID);
trxQry.setParameter("now", new Date());
trxQry.setParameterList("orgs", orgsWithRule);
trxQry.setMaxResults(1);
return (trxQry.uniqueResult()).intValue();
Expand Down

0 comments on commit 341afcd

Please sign in to comment.