Skip to content

Commit

Permalink
fix(test and server): Fix the end to end test and the server side log…
Browse files Browse the repository at this point in the history
…ic to filter stock movement by
  • Loading branch information
DedrickEnc committed Aug 15, 2017
1 parent 98f1f27 commit 5c0cd27
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion client/src/modules/stock/entry/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ function StockEntryController(Depots, Inventory, Notify,
.then(function (document) {
vm.Stock.store.clear();
vm.movement = {};
ReceiptModal.stockEntryDepotReceipt(document.uuid, bhConstants.flux.FROM_OTHER_DEPOT);
ReceiptModal.stockEntryDepotReceipt(document.uuid, true);
})
.catch(Notify.handleError);
}
Expand Down
3 changes: 2 additions & 1 deletion server/controllers/stock/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ function getLots(sqlQuery, parameters, finalClauseParameter) {
JOIN stock_movement m ON m.lot_uuid = l.uuid AND m.flux_id = ${flux.FROM_PURCHASE}
JOIN depot d ON d.uuid = m.depot_uuid
`;
db.convert(params, ['uuid', 'depot_uuid', 'lot_uuid', 'inventory_uuid']);
db.convert(params, ['uuid', 'depot_uuid', 'lot_uuid', 'inventory_uuid', 'document_uuid']);
const filters = new FilterParser(params, { autoParseStatements : false });

filters.equals('uuid', 'uuid', 'l');
filters.equals('depot_text', 'text', 'd');
filters.equals('depot_uuid', 'depot_uuid', 'm');
filters.equals('document_uuid', 'document_uuid', 'm');
filters.equals('lot_uuid', 'lot_uuid', 'm');
filters.equals('inventory_uuid', 'uuid', 'i');
filters.equals('text', 'text', 'i');
Expand Down
2 changes: 1 addition & 1 deletion test/end-to-end/stock/stock.adjustment.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ function StockAdjustmentTests() {
});
}

describe('Stock Adustment Test', StockAdjustmentTests);
describe('Stock Adjustment Test', StockAdjustmentTests);
2 changes: 1 addition & 1 deletion test/end-to-end/stock/stock.entry.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function StockExiTests() {

it('Should entry stock from a transfer reception', () => {
// select the movement
page.setTransfer(0);
page.setTransfer(1);

page.setDate(new Date());

Expand Down
12 changes: 6 additions & 6 deletions test/end-to-end/stock/stock.movements.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,37 +80,37 @@ function StockMovementsRegistryTests() {
FU.buttons.search();
FU.uiSelect('$ctrl.bundle.flux_id', 'Commande d\'achat');
FU.modal.submit();
GU.expectRowCount(gridId, 22 + depotGroupingRow);
GU.expectRowCount(gridId, 23 + depotGroupingRow);

// to patient
FU.buttons.search();
FU.uiSelect('$ctrl.bundle.flux_id', 'Vers un patient');
FU.modal.submit();
GU.expectRowCount(gridId, 22 + depotGroupingRow);
GU.expectRowCount(gridId, 23 + depotGroupingRow);

// to depot
FU.buttons.search();
FU.uiSelect('$ctrl.bundle.flux_id', 'Vers un depot');
FU.modal.submit();
GU.expectRowCount(gridId, 22 + depotGroupingRow);
GU.expectRowCount(gridId, 23 + depotGroupingRow);

// from depot
FU.buttons.search();
FU.uiSelect('$ctrl.bundle.flux_id', 'En provenance d\'un depot');
FU.modal.submit();
GU.expectRowCount(gridId, 22 + depotGroupingRow);
GU.expectRowCount(gridId, 23 + depotGroupingRow);

// positive adjustment
FU.buttons.search();
FU.uiSelect('$ctrl.bundle.flux_id', 'Ajustement (Positif)');
FU.modal.submit();
GU.expectRowCount(gridId, 22 + depotGroupingRow);
GU.expectRowCount(gridId, 23 + depotGroupingRow);

// negative adjustment
FU.buttons.search();
FU.uiSelect('$ctrl.bundle.flux_id', 'Ajustement (Negatif)');
FU.modal.submit();
GU.expectRowCount(gridId, 22 + depotGroupingRow);
GU.expectRowCount(gridId, 23 + depotGroupingRow);

// clear filters
FU.buttons.clear();
Expand Down

0 comments on commit 5c0cd27

Please sign in to comment.