diff --git a/app/controllers/abstract-report-controller.js b/app/controllers/abstract-report-controller.js index 72f2cac11e..732b7e7bb6 100644 --- a/app/controllers/abstract-report-controller.js +++ b/app/controllers/abstract-report-controller.js @@ -12,6 +12,7 @@ export default Ember.ArrayController.extend(DateFormat, ModalHelper, NumberForma progressMessage: 'Please wait while your report is generated.', progressTitle: 'Generating Report', reportColumns: null, + reportHeaders: null, reportRows: [], reportTitle: null, reportType: null, diff --git a/app/inventory/adjust/controller.js b/app/inventory/adjust/controller.js index 9d1b148f72..1dcee17c81 100644 --- a/app/inventory/adjust/controller.js +++ b/app/inventory/adjust/controller.js @@ -2,21 +2,21 @@ import AbstractEditController from 'hospitalrun/controllers/abstract-edit-contro import AdjustmentTypes from 'hospitalrun/mixins/inventory-adjustment-types'; import Ember from 'ember'; export default AbstractEditController.extend(AdjustmentTypes, { - needs: 'inventory', + inventoryController: Ember.inject.controller('inventory'), - expenseAccountList: Ember.computed.alias('controllers.inventory.expenseAccountList'), + expenseAccountList: Ember.computed.alias('inventoryController.expenseAccountList'), title: 'Adjustment', transactionTypeChanged: function() { Ember.run.once(this, function() { - this.get('model').validate(); + this.get('model').validate().catch(); }); }.observes('transactionType'), updateButtonText: function() { - return this.get('transactionType'); - }.property('transactionType'), + return this.get('model.transactionType'); + }.property('model.transactionType'), updateButtonAction: 'adjust', diff --git a/app/inventory/adjust/template.hbs b/app/inventory/adjust/template.hbs index 3f01cc8029..2972a2c8b4 100644 --- a/app/inventory/adjust/template.hbs +++ b/app/inventory/adjust/template.hbs @@ -1,22 +1,20 @@ {{#modal-dialog - hideCancelButton=hideCancelButton - hideUpdateButton=hideUpdateButton isUpdateDisabled=isUpdateDisabled title=title updateButtonAction=updateButtonAction updateButtonText=updateButtonText }} - {{#em-form model=this submitButton=false }} + {{#em-form model=model submitButton=false }}
{{adjustmentItem.name}}
+{{model.adjustmentItem.name}}
{{locationName}}
+{{model.locationName}}
{{quantity}}
+{{model.quantity}}
{{inventoryItem.distributionUnit}}
+{{model.inventoryItem.distributionUnit}}
{{/if}}Expiration Date | Action | |||||||
---|---|---|---|---|---|---|---|---|
- {{inventoryItem.name}} + {{invoiceItem.inventoryItem.name}} |
- {{input class="form-control" value=quantity }}
+ {{input class="form-control" value=invoiceItem.quantity }}
- {{inventoryItem.distributionUnit}}
+ {{invoiceItem.inventoryItem.distributionUnit}}
|
- {{input class="form-control" value=purchaseCost }}
+ {{input class="form-control" value=invoiceItem.purchaseCost }}
|
- {{input class="form-control" value=vendorItemNo }}
+ {{input class="form-control" value=invoiceItem.vendorItemNo }}
|
- {{input class="form-control" value=lotNumber }}
+ {{input class="form-control" value=invoiceItem.lotNumber }}
|
- {{date-picker property="expirationDate" minDate="now" model=this }} + {{date-picker property="expirationDate" minDate="now" model=invoiceItem }} | - | diff --git a/app/inventory/delete/template.hbs b/app/inventory/delete/template.hbs index f04702d852..0eb27f7c05 100644 --- a/app/inventory/delete/template.hbs +++ b/app/inventory/delete/template.hbs @@ -1,12 +1,10 @@ {{#modal-dialog - hideCancelButton=hideCancelButton - hideUpdateButton=hideUpdateButton isUpdateDisabled=isUpdateDisabled title=title updateButtonAction=updateButtonAction updateButtonText=updateButtonText }}Vendor | Invoice Number |
{{date-format purchase.dateReceived}} | {{purchase.purchaseCost}} | @@ -52,7 +52,7 @@ {{/each}}
Action | {{/if}}||||
---|---|---|---|---|
{{location.location}} | diff --git a/app/inventory/purchase/delete/controller.js b/app/inventory/purchase/delete/controller.js deleted file mode 100644 index ab402a7000..0000000000 --- a/app/inventory/purchase/delete/controller.js +++ /dev/null @@ -1,73 +0,0 @@ -import Ember from 'ember'; -import InventoryLocations from 'hospitalrun/mixins/inventory-locations'; -export default Ember.ObjectController.extend(InventoryLocations, { - needs: 'inventory/edit', - - locations: Ember.computed.alias('controllers.inventory/edit.locations'), - - deleteLocations: Ember.computed.map('filteredLocations', function(location) { - return { - name: '%@ (%@ available)'.fmt(location.get('locationName'), location.get('quantity')), - location: location - }; - }), - - locationChanged: function() { - var originalAisle = this.get('aisleLocation'), - originalLocation = this.get('location'), - locations = this.get('locations'); - this.set('locationToFind', originalLocation); - this.set('aisleToFind', originalAisle); - var defaultLocation = locations.find(this.findLocation, this); - this.set('deleteFromLocation', defaultLocation); - }.observes('aisleLocation', 'location'), - - filteredLocations: function() { - var currentQuantity = this.get('currentQuantity'), - locations = this.get('locations'); - return locations.filter(function(location) { - var locationQuantity = location.get('quantity'); - return (locationQuantity >= currentQuantity); - }); - }.property('locations', 'currentQuantity'), - - showLocations: function() { - var locations = this.get('locations'); - return (locations.get('length') > 0); - }.property('locations'), - - updateButtonText: function() { - var expire = this.get('expire'); - if (!Ember.isEmpty(expire) && expire === true) { - return 'Expire'; - } - return 'Delete'; - }.property('expire'), - updateButtonAction: 'delete', - isUpdateDisabled: false, - showUpdateButton: true, - title: function() { - var expire = this.get('expire'); - if (!Ember.isEmpty(expire) && expire === true) { - return 'Expire'; - } - return 'Delete Purchase'; - }.property('expire'), - - actions: { - cancel: function() { - this.set('expire'); - this.send('closeModal'); - }, - - delete: function() { - var deleteFromLocation = this.get('deleteFromLocation'), - expire = this.get('expire'); - if (!Ember.isEmpty(expire) && expire === true) { - this.send('expirePurchase', this.get('model'), deleteFromLocation); - } else { - this.send('deletePurchase', this.get('model'), deleteFromLocation); - } - } - } -}); diff --git a/app/inventory/purchase/delete/template.hbs b/app/inventory/purchase/delete/template.hbs deleted file mode 100644 index a210d494ae..0000000000 --- a/app/inventory/purchase/delete/template.hbs +++ /dev/null @@ -1,24 +0,0 @@ -{{#modal-dialog - hideCancelButton=hideCancelButton - hideUpdateButton=hideUpdateButton - isUpdateDisabled=isUpdateDisabled - title=title - updateButtonAction=updateButtonAction - updateButtonText=updateButtonText }} -
- {{this}} + {{reportHeader}} | {{/each}}Quantity | Action | - {{#each requestedItems as |requestedItem|}} + {{#each model.requestedItems as |requestedItem|}}
---|
{{requestedItem.item.name}}
@@ -65,14 +65,14 @@
{{em-checkbox label="Fulfill Request Now" property="shouldFulfillRequest"}}
{{/if}}
{{/if}}
- {{select-or-typeahead property="deliveryLocation" label="Delivery Location" list=warehouseList selection=deliveryLocation }}
- {{select-or-typeahead property="deliveryAisle" label="Delivery Aisle" list=aisleLocationList selection=deliveryAisle }}
- {{select-or-typeahead property="expenseAccount" label="Bill To" list=expenseAccountList selection=expenseAccount }}
+ {{select-or-typeahead property="deliveryLocation" label="Delivery Location" list=warehouseList selection=model.deliveryLocation }}
+ {{select-or-typeahead property="deliveryAisle" label="Delivery Aisle" list=aisleLocationList selection=model.deliveryAisle }}
+ {{select-or-typeahead property="expenseAccount" label="Bill To" list=expenseAccountList selection=model.expenseAccount }}
{{#if isFulfilling}}
{{date-picker property="dateCompleted" label="Date Completed" class="col-sm-4"}}
- {{inventory-location-picker label="Pull From" quantityRequested=quantity
+ {{inventory-location-picker label="Pull From" quantityRequested=model.quantity
locationList=model.inventoryItem.availableLocations
selectedLocations=model.inventoryLocations
}}
diff --git a/app/inventory/transfer/controller.js b/app/inventory/transfer/controller.js
index 24dcc16644..71480ab926 100644
--- a/app/inventory/transfer/controller.js
+++ b/app/inventory/transfer/controller.js
@@ -1,18 +1,18 @@
import AbstractEditController from 'hospitalrun/controllers/abstract-edit-controller';
import Ember from 'ember';
export default AbstractEditController.extend({
- needs: 'inventory',
+ inventoryController: Ember.inject.controller('inventory'),
- warehouseList: Ember.computed.alias('controllers.inventory.warehouseList'),
- aisleLocationList: Ember.computed.alias('controllers.inventory.aisleLocationList'),
+ warehouseList: Ember.computed.alias('inventoryController.warehouseList'),
+ aisleLocationList: Ember.computed.alias('inventoryController.aisleLocationList'),
lookupListsToUpdate: [{
name: 'aisleLocationList', // Name of property containing lookup list
- property: 'transferAisleLocation', // Corresponding property on model that potentially contains a new value to add to the list
+ property: 'model.transferAisleLocation', // Corresponding property on model that potentially contains a new value to add to the list
id: 'aisle_location_list' // Id of the lookup list to update
}, {
name: 'warehouseList', // Name of property containing lookup list
- property: 'transferLocation', // Corresponding property on model that potentially contains a new value to add to the list
+ property: 'model.transferLocation', // Corresponding property on model that potentially contains a new value to add to the list
id: 'warehouse_list' // Id of the lookup list to update
}],
diff --git a/app/inventory/transfer/template.hbs b/app/inventory/transfer/template.hbs
index e5a1c6d263..35449d0f93 100644
--- a/app/inventory/transfer/template.hbs
+++ b/app/inventory/transfer/template.hbs
@@ -1,25 +1,23 @@
{{#modal-dialog
- hideCancelButton=hideCancelButton
- hideUpdateButton=hideUpdateButton
isUpdateDisabled=isUpdateDisabled
title=title
updateButtonAction=updateButtonAction
updateButtonText=updateButtonText }}
- {{#em-form model=this submitButton=false }}
+ {{#em-form model=model submitButton=false }}
-
{{transferItem.name}} +{{model.transferItem.name}}
-
{{locationName}} +{{model.locationName}}
-
- {{select-or-typeahead class="required" property="transferLocation" label="Transfer To Location" list=warehouseList selection=transferLocation }}
- {{select-or-typeahead property="transferAisleLocation" label="Transfer To Aisle Location" list=aisleLocationList selection=transferAisleLocation }}
+ {{select-or-typeahead class="required" property="transferLocation" label="Transfer To Location" list=warehouseList selection=model.transferLocation }}
+ {{select-or-typeahead property="transferAisleLocation" label="Transfer To Aisle Location" list=aisleLocationList selection=model.transferAisleLocation }}
{{quantity}} +{{model.quantity}}
{{em-input property="adjustmentQuantity" label="Quantity" class="col-sm-3 required"}}
diff --git a/app/templates/inv-purchase.hbs b/app/templates/inv-purchase.hbs
index 7a8376a9c1..bab3449aec 100644
--- a/app/templates/inv-purchase.hbs
+++ b/app/templates/inv-purchase.hbs
@@ -7,7 +7,7 @@
{{else}}
- {{input class="form-control" value=model.originalQuantity type="text" disabled=true }}
+ {{input class="form-control" value=model.originalQuantity type="text" disabled=true }}
{{/if}}
@@ -17,12 +17,12 @@
{{date-picker property="expirationDate" label="Expiration Date" minDate="now" class="col-sm-4"}}
-
- {{select-or-typeahead property="vendor" label="Vendor" list=vendorList selection=vendor className="col-sm-6 required"}}
- {{em-input property="vendorItemNo" label="Vendor Item Number" class="col-sm-6"}}
+
diff --git a/config/deprecation-workflow.js b/config/deprecation-workflow.js
index 3f11e0cae3..5d560ddfdd 100644
--- a/config/deprecation-workflow.js
+++ b/config/deprecation-workflow.js
@@ -3,16 +3,8 @@ window.deprecationWorkflow.config = {
workflow: [
{ handler: "silence", matchMessage: "Ember.create is deprecated in favor of Object.create" },
{ handler: "silence", matchMessage: "`lookup` was called on a Registry. The `initializer` API no longer receives a container, and you should use an `instanceInitializer` to look up objects from the container." },
- { handler: "silence", matchMessage: "The LoginControllerMixin is deprecated. Use the session's authenticate method directly instead." },
- { handler: "silence", matchMessage: "The AuthenticationControllerMixin is deprecated. Use the session's authenticate method directly instead." },
+ { handler: "silence", matchMessage: "Ember.keys is deprecated in favor of Object.keys" },
{ handler: "silence", matchMessage: "`Ember.ArrayController` is deprecated." },
- { handler: "silence", matchMessage: "ember-get-helper has been included in Ember 2.0. Use of this package is deprecated." },
- { handler: "silence", matchMessage: "Ember.ObjectController is deprecated, please use Ember.Controller and use `model.propertyName`." },
- { handler: "throw", matchMessage: "You attempted to access `patient` from `
+ {{select-or-typeahead property="vendor" label="Vendor" list=vendorList selection=model.vendor className="col-sm-6 required"}}
+ {{em-input property="vendorItemNo" label="Vendor Item Number" class="col-sm-6"}}
-{{#if isNew}}
- {{select-or-typeahead property="location" label="Location" list=warehouseList selection=location }}
- {{select-or-typeahead property="aisleLocation" label="Aisle Location" list=aisleLocationList selection=aisleLocation }}
+{{#if model.isNew}}
+ {{select-or-typeahead property="location" label="Location" list=warehouseList selection=model.location }}
+ {{select-or-typeahead property="aisleLocation" label="Aisle Location" list=aisleLocationList selection=model.aisleLocation }}
{{/if}}
-{{em-checkbox label="Gift In Kind" property="giftInKind"}}
\ No newline at end of file
+{{em-checkbox label="Gift In Kind" property="giftInKind"}}
diff --git a/app/templates/inventory-basic.hbs b/app/templates/inventory-basic.hbs
index 1f2fd438bb..4a63a18522 100644
--- a/app/templates/inventory-basic.hbs
+++ b/app/templates/inventory-basic.hbs
@@ -1,23 +1,23 @@
- {{#unless isNew}}
+ {{#unless model.isNew}}
{{em-text label="Description" property="description" rows=1 }}
- {{input class="form-control" value=friendlyId type="text" disabled=true }}
+ {{input class="form-control" value=model.friendlyId type="text" disabled=true }}
{{/unless}}
{{em-input property="name" label="Name" class="required col-sm-8"}}
- {{#unless isNew}}
+ {{#unless model.isNew}}
-
{{/unless}}
{{quantity}} +{{model.quantity}}
- {{em-select label="Type" property="inventoryType"
- content=inventoryTypes
+ {{em-select label="Type" property="inventoryType"
+ content=inventoryTypes
class="required col-sm-4"
prompt=" "
}}
@@ -31,4 +31,4 @@
content=unitListForSelect
prompt=" "
}}
-
\ No newline at end of file
+ |