Skip to content

Commit

Permalink
fix(partials): incorporate stock management
Browse files Browse the repository at this point in the history
This commit migrates the stock management code to the new `modules/`
file structure.  All the names are changed to match those found in the
refactor-build-structure branch.
  • Loading branch information
Jonathan Niles authored and sfount committed Apr 11, 2017
1 parent b2e61fa commit 7b7ef1f
Show file tree
Hide file tree
Showing 74 changed files with 74 additions and 74 deletions.
4 changes: 2 additions & 2 deletions client/src/js/components/bhDatePicker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
angular.module('bhima.components')
.component('bhDatePicker', {
templateUrl : '/partials/templates/bhDatePickerAction.tmpl.html',
templateUrl : '/modules/templates/bhDatePickerAction.tmpl.html',
controller : DatePickerController,
bindings : {
date : '<', // set the date once as the initial date and use callbacks to change it later
Expand All @@ -27,7 +27,7 @@ function DatePickerController(Modal, bhConstants) {
size : 'sm',
backdrop : 'static',
animation : true,
templateUrl : '/partials/templates/bhDatePicker.tmpl.html',
templateUrl : '/modules/templates/bhDatePicker.tmpl.html',
controller : DatePickerModalController,
controllerAs : '$ctrl',
};
Expand Down
2 changes: 1 addition & 1 deletion client/src/js/components/bhDepotDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ angular.module('bhima.components')
bindings : {
onSelect : '&',
},
templateUrl : 'partials/templates/bhDepotDropdown.tmpl.html',
templateUrl : 'modules/templates/bhDepotDropdown.tmpl.html',
controller : bhDepotController,
controllerAs : '$ctrl',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ function GeneralLedgerAccountsController(GeneralLedger, Session, Notify, uiGridC
{ field : 'number',
displayName : 'TABLE.COLUMNS.ACCOUNT',
enableFiltering : true,
cellTemplate : '/modules/general_ledger/templates/account_number.cell.html',
cellTemplate : '/modules/general-ledger/templates/account_number.cell.html',
headerCellFilter : 'translate',
width : '10%' },

{ field : 'label',
displayName : 'TABLE.COLUMNS.LABEL',
cellTemplate : '/modules/general_ledger/templates/account_label.cell.html',
cellTemplate : '/modules/general-ledger/templates/account_label.cell.html',
enableFiltering : true,
headerCellFilter : 'translate' },

Expand All @@ -38,21 +38,21 @@ function GeneralLedgerAccountsController(GeneralLedger, Session, Notify, uiGridC
enableFiltering : false,
headerCellFilter : 'translate',
headerCellClass : 'text-center',
cellTemplate : '/modules/general_ledger/templates/debtor.cell.html',
cellTemplate : '/modules/general-ledger/templates/debtor.cell.html',
width : '15%' },

{ field : 'creditor_sold',
displayName : 'TABLE.COLUMNS.CREDITOR_SOLD',
enableFiltering : false,
headerCellFilter : 'translate',
headerCellClass : 'text-center',
cellTemplate : '/modules/general_ledger/templates/creditor.cell.html',
cellTemplate : '/modules/general-ledger/templates/creditor.cell.html',
width : '15%' },

{
field : 'action',
displayName : '',
cellTemplate : '/modules/general_ledger/templates/action.cell.html',
cellTemplate : '/modules/general-ledger/templates/action.cell.html',
enableFiltering : false,
enableSorting : false,
enableColumnMenu : false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
required>
</textarea>
<div class="help-block" ng-messages="StockForm.description.$error" ng-show="StockForm.$submitted">
<div ng-messages-include="partials/templates/messages.tmpl.html"></div>
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,45 +37,45 @@ function StockAdjustmentController(Depots, Inventory, Notify,
{ field : 'status',
width : 25,
displayName : '',
cellTemplate : 'partials/stock/exit/templates/status.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/status.tmpl.html' },

{ field : 'code',
width : 120,
displayName : 'TABLE.COLUMNS.CODE',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/code.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/code.tmpl.html' },

{ field : 'description',
displayName : 'TABLE.COLUMNS.DESCRIPTION',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/description.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/description.tmpl.html' },

{ field : 'lot',
width : 150,
displayName : 'TABLE.COLUMNS.LOT',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/lot.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/lot.tmpl.html' },

{ field : 'quantity',
width : 150,
displayName : 'TABLE.COLUMNS.QUANTITY',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/adjustment/templates/quantity.tmpl.html',
cellTemplate : 'modules/stock/adjustment/templates/quantity.tmpl.html',
treeAggregationType : uiGridGroupingConstants.aggregation.SUM },

{ field : 'available_lot',
width : 150,
displayName : 'TABLE.COLUMNS.AVAILABLE',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/available.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/available.tmpl.html' },

{ field : 'expiration_date',
width : 150,
displayName : 'TABLE.COLUMNS.EXPIRATION_DATE',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/expiration.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/expiration.tmpl.html' },

{ field: 'actions', width: 25, cellTemplate: 'partials/stock/exit/templates/actions.tmpl.html' },
{ field: 'actions', width: 25, cellTemplate: 'modules/stock/exit/templates/actions.tmpl.html' },
];

// grid options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
required>
</textarea>
<div class="help-block" ng-messages="StockForm.description.$error" ng-show="StockForm.$submitted">
<div ng-messages-include="partials/templates/messages.tmpl.html"></div>
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,33 +51,33 @@ function StockEntryController(Depots, Inventory, Notify,
{ field : 'status',
width : 25,
displayName : '',
cellTemplate : 'partials/stock/entry/templates/status.tmpl.html' },
cellTemplate : 'modules/stock/entry/templates/status.tmpl.html' },

{ field : 'code',
width : 120,
displayName : 'TABLE.COLUMNS.CODE',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/entry/templates/code.tmpl.html' },
cellTemplate : 'modules/stock/entry/templates/code.tmpl.html' },

{ field : 'description',
displayName : 'TABLE.COLUMNS.DESCRIPTION',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/entry/templates/description.tmpl.html' },
cellTemplate : 'modules/stock/entry/templates/description.tmpl.html' },

{ field : 'lot',
width : 150,
displayName : 'TABLE.COLUMNS.LOT',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/entry/templates/lot.tmpl.html' },
cellTemplate : 'modules/stock/entry/templates/lot.tmpl.html' },

{ field : 'quantity',
width : 150,
displayName : 'TABLE.COLUMNS.QUANTITY',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/entry/templates/quantity.tmpl.html',
cellTemplate : 'modules/stock/entry/templates/quantity.tmpl.html',
aggregationType : uiGridConstants.aggregationTypes.sum },

{ field: 'actions', width: 25, cellTemplate: 'partials/stock/entry/templates/actions.tmpl.html' },
{ field: 'actions', width: 25, cellTemplate: 'modules/stock/entry/templates/actions.tmpl.html' },
],
onRegisterApi : onRegisterApi,
data : vm.Stock.store.data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function StockFindPurchaseModalController(Instance, Purchase, Notify,
{ field : 'reference',
displayName : 'TABLE.COLUMNS.REFERENCE',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/entry/modals/templates/purchase.reference.tmpl.html' },
cellTemplate : 'modules/stock/entry/modals/templates/purchase.reference.tmpl.html' },
{
field : 'date',
cellFilter : 'date',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ StockDefineLotsModalController.$inject = [

function StockDefineLotsModalController(Instance, Notify, uiGridConstants, Data, Session) {
var vm = this;

// globals
vm.inventory = { lots: [] };
vm.gridApi = {};
Expand All @@ -27,31 +27,31 @@ function StockDefineLotsModalController(Instance, Notify, uiGridConstants, Data,
{ field : 'status',
width : 25,
displayName : '',
cellTemplate : 'partials/stock/entry/modals/templates/lot.status.tmpl.html' },
cellTemplate : 'modules/stock/entry/modals/templates/lot.status.tmpl.html' },

{ field : 'lot',
displayName : 'TABLE.COLUMNS.LOT',
headerCellFilter : 'translate',
aggregationType : uiGridConstants.aggregationTypes.count,
cellTemplate : 'partials/stock/entry/modals/templates/lot.input.tmpl.html' },
cellTemplate : 'modules/stock/entry/modals/templates/lot.input.tmpl.html' },

{ field : 'quantity',
width : 150,
displayName : 'TABLE.COLUMNS.QUANTITY',
headerCellFilter : 'translate',
aggregationType : uiGridConstants.aggregationTypes.sum,
footerCellClass : 'text-right',
cellTemplate : 'partials/stock/entry/modals/templates/lot.quantity.tmpl.html' },
cellTemplate : 'modules/stock/entry/modals/templates/lot.quantity.tmpl.html' },

{ field : 'expiration_date',
width : 150,
displayName : 'TABLE.COLUMNS.EXPIRATION_DATE',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/entry/modals/templates/lot.expiration.tmpl.html' },
cellTemplate : 'modules/stock/entry/modals/templates/lot.expiration.tmpl.html' },

{ field : 'actions',
width : 25,
cellTemplate : 'partials/stock/entry/modals/templates/lot.actions.tmpl.html' },
width : 25,
cellTemplate : 'modules/stock/entry/modals/templates/lot.actions.tmpl.html' },
],
onRegisterApi : onRegisterApi,
};
Expand Down Expand Up @@ -80,7 +80,7 @@ function StockDefineLotsModalController(Instance, Notify, uiGridConstants, Data,
vm.gridOptions.data = vm.inventory.lots;
} else {
addLot();
}
}
}

// add lot
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="ui-grid-cell-contents">
<input type="text"
<input type="text"
class="form-control"
ng-model="row.entity.lot"
ng-model-options="{ 'debounce' : { 'default' : 150, 'blur' : 0 }}"
ng-change="grid.appScope.handleChange(row.entity)"
required>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
typeahead-editable="false"
typeahead-append-to-body="true"
uib-typeahead="item as item for item in grid.appScope.inventories | filter:$viewValue | limitTo:8"
typeahead-template-url="/partials/templates/inventoryItems.tmpl.html"
typeahead-template-url="/modules/templates/inventoryItems.tmpl.html"
typeahead-on-select="grid.appScope.configureItem(row.entity)">
</div>
<div ng-if="row.entity._initialised">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
required>
</textarea>
<div class="help-block" ng-messages="StockForm.description.$error" ng-show="StockForm.$submitted">
<div ng-messages-include="partials/templates/messages.tmpl.html"></div>
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,63 +51,63 @@ function StockExitController(Depots, Inventory, Notify,
{ field : 'status',
width : 25,
displayName : '',
cellTemplate : 'partials/stock/exit/templates/status.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/status.tmpl.html' },

{ field : 'code',
width : 120,
displayName : 'TABLE.COLUMNS.CODE',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/code.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/code.tmpl.html' },

{ field : 'description',
displayName : 'TABLE.COLUMNS.DESCRIPTION',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/description.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/description.tmpl.html' },

{ field : 'lot',
width : 150,
displayName : 'TABLE.COLUMNS.LOT',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/lot.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/lot.tmpl.html' },

{ field : 'unit_price',
width : 150,
displayName : 'TABLE.COLUMNS.UNIT_PRICE',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/price.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/price.tmpl.html' },

{ field : 'quantity',
width : 150,
displayName : 'TABLE.COLUMNS.QUANTITY',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/quantity.tmpl.html',
cellTemplate : 'modules/stock/exit/templates/quantity.tmpl.html',
treeAggregationType : uiGridGroupingConstants.aggregation.SUM },

{ field : 'unit_type',
width : 75,
displayName : 'TABLE.COLUMNS.UNIT',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/unit.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/unit.tmpl.html' },

{ field : 'available_lot',
width : 150,
displayName : 'TABLE.COLUMNS.AVAILABLE',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/available.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/available.tmpl.html' },

{ field : 'amount',
width : 150,
displayName : 'TABLE.COLUMNS.AMOUNT',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/amount.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/amount.tmpl.html' },

{ field : 'expiration_date',
width : 150,
displayName : 'TABLE.COLUMNS.EXPIRATION_DATE',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/exit/templates/expiration.tmpl.html' },
cellTemplate : 'modules/stock/exit/templates/expiration.tmpl.html' },

{ field: 'actions', width: 25, cellTemplate: 'partials/stock/exit/templates/actions.tmpl.html' },
{ field: 'actions', width: 25, cellTemplate: 'modules/stock/exit/templates/actions.tmpl.html' },
],
onRegisterApi : onRegisterApi,
data : vm.Stock.store.data,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
typeahead-editable="false"
typeahead-append-to-body="true"
uib-typeahead="item as item for item in grid.appScope.selectableInventories | filter:$viewValue | limitTo:8"
typeahead-template-url="/partials/templates/inventoryItem.tmpl.html"
typeahead-template-url="/modules/templates/inventoryItem.tmpl.html"
typeahead-on-select="grid.appScope.configureItem(row.entity)" required>
</div>
<div ng-if="row.entity._initialised">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ function StockInventoriesController(Stock, Notify,
width : 75,
displayName : 'TABLE.COLUMNS.UNIT',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/inventories/templates/unit.tmpl.html' },
cellTemplate : 'modules/stock/inventories/templates/unit.tmpl.html' },

{ field : 'status',
displayName : 'STOCK.STATUS.LABEL',
headerCellFilter : 'translate',
enableFiltering : false,
enableSorting : false,
cellTemplate : 'partials/stock/inventories/templates/status.cell.html' },
cellTemplate : 'modules/stock/inventories/templates/status.cell.html' },

{ field : 'avg_consumption',
displayName : 'CM',
Expand Down Expand Up @@ -100,7 +100,7 @@ function StockInventoriesController(Stock, Notify,
enableFiltering : false,
enableSorting : false,
cellClass : 'text-right',
cellTemplate : 'partials/stock/inventories/templates/appro.cell.html' },
cellTemplate : 'modules/stock/inventories/templates/appro.cell.html' },
];

// options for the UI grid
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function StockLotsController(Stock, Notify,
width : 75,
displayName : 'TABLE.COLUMNS.UNIT',
headerCellFilter : 'translate',
cellTemplate : 'partials/stock/inventories/templates/unit.tmpl.html' },
cellTemplate : 'modules/stock/inventories/templates/unit.tmpl.html' },

{ field: 'entry_date', displayName: 'STOCK.ENTRY_DATE', headerCellFilter: 'translate', cellFilter: 'date' },
{ field: 'expiration_date', displayName: 'STOCK.EXPIRATION_DATE', headerCellFilter: 'translate', cellFilter: 'date' },
Expand Down
Loading

0 comments on commit 7b7ef1f

Please sign in to comment.