Skip to content

Commit

Permalink
improvememt(process of modules for shipments)
Browse files Browse the repository at this point in the history
- Display shipment register to descending order by reference number
- Automatically import shipment description in stock exit modules
- Fix code for hidden expiry date for asset and other non perimable inventory
closes #6824
  • Loading branch information
lomamech committed Sep 28, 2022
1 parent be7c467 commit 6c242a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions client/src/modules/shipment/shipment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ angular.module('bhima.controllers')
ShipmentRegistryController.$inject = [
'$state', 'ShipmentService', 'ShipmentFilter', 'ShipmentModalService', 'ModalService',
'uiGridConstants', 'GridStateService', 'GridColumnService',
'NotifyService', 'bhConstants',
'NotifyService', 'bhConstants', 'GridSortingService',
];

function ShipmentRegistryController(
$state, Shipments, ShipmentFilter, ShipmentModal, Modal,
GridConstants, GridState, Columns,
Notify, Constants,
Notify, Constants, Sorting,
) {
const vm = this;
const cacheKey = 'shipment-grid';
Expand Down Expand Up @@ -55,6 +55,7 @@ function ShipmentRegistryController(
headerTooltip : 'SHIPMENT.REFERENCE',
headerCellFilter : 'translate',
headerCellClass : 'wrappingColHeader',
sortingAlgorithm : Sorting.algorithms.sortByReference,
},
{
field : 'stock_reference',
Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/stock/entry/modals/lots.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function StockDefineLotsModalController(

// Hide columns in the grid when it doesn't apply to this inventory item.
const isAsset = Data.stockLine.is_asset;
const showShowExpirationDate = !(Data.stockLine.tracking_expiration === false || Data.stockLine.is_asset);
const showShowExpirationDate = !(Data.stockLine.tracking_expiration === 0 || Data.stockLine.is_asset);

Data.stockLine.prev_unit_cost = Data.stockLine.unit_cost; // Save for later checks

Expand Down
5 changes: 5 additions & 0 deletions client/src/modules/stock/exit/exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,14 @@ function StockExitController(

//
function onSelectExitType(exitType, entity) {
vm.stockForm.details.description = null;
vm.selectedExitType = exitType;
vm.stockForm.setExitType(exitType.label);

if (entity.shipment) {
vm.stockForm.details.description = entity.shipment.description;
}

switch (exitType.label) {
case 'patient':
vm.stockForm.setPatientDistribution(entity);
Expand Down
1 change: 1 addition & 0 deletions server/controllers/asset_management/shipment/shipment.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ function find(params) {
LEFT JOIN document_map dm2 ON dm2.uuid = sh.document_uuid
`;

filters.setOrder('ORDER BY sh.reference DESC');
const query = filters.applyQuery(sql);
const queryParameters = filters.parameters();
return db.exec(query, queryParameters);
Expand Down

0 comments on commit 6c242a7

Please sign in to comment.