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}}

{{em-select class="col-sm-4" label="Adjustment Type" @@ -28,7 +26,7 @@ {{em-text label="Reason" property="reason" rows=3 }}
{{date-picker property="dateCompleted" label="Adjustment Date" class="col-sm-4 required"}} - {{select-or-typeahead property="expenseAccount" label="Expense To" list=expenseAccountList selection=expenseAccount class="col-sm-8"}} + {{select-or-typeahead property="expenseAccount" label="Expense To" list=expenseAccountList selection=model.expenseAccount class="col-sm-8"}}
{{/em-form}} {{/modal-dialog}} diff --git a/app/inventory/barcode/controller.js b/app/inventory/barcode/controller.js index cf739595cc..e12f0aeed2 100644 --- a/app/inventory/barcode/controller.js +++ b/app/inventory/barcode/controller.js @@ -1,8 +1,10 @@ import Ember from 'ember'; export default Ember.ObjectController.extend({ + selectedPrinter: null, + barcodeUri: function() { - var id = this.get('id'), - name = this.get('name'); + var id = this.get('model.id'), + name = this.get('model.name'); return Ember.$(document).JsBarcode(id, { width: 1, height: 20, diff --git a/app/inventory/batch/controller.js b/app/inventory/batch/controller.js index ae9e47ddb0..aeb9f310f9 100755 --- a/app/inventory/batch/controller.js +++ b/app/inventory/batch/controller.js @@ -5,11 +5,12 @@ import InventorySelection from 'hospitalrun/mixins/inventory-selection'; import Ember from 'ember'; export default AbstractEditController.extend(InventoryId, InventoryLocations, InventorySelection, { - needs: ['inventory'], - - warehouseList: Ember.computed.alias('controllers.inventory.warehouseList'), - aisleLocationList: Ember.computed.alias('controllers.inventory.aisleLocationList'), - vendorList: Ember.computed.alias('controllers.inventory.vendorList'), + doingUpdate: false, + inventoryController: Ember.inject.controller('inventory'), + inventoryItems: null, + warehouseList: Ember.computed.alias('inventoryController.warehouseList'), + aisleLocationList: Ember.computed.alias('inventoryController.aisleLocationList'), + vendorList: Ember.computed.alias('inventoryController.vendorList'), purchaseAttributes: [ 'expirationDate', 'inventoryItem', @@ -31,41 +32,41 @@ export default AbstractEditController.extend(InventoryId, InventoryLocations, In lookupListsToUpdate: [{ name: 'aisleLocationList', // Name of property containing lookup list - property: 'aisleLocation', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.aisleLocation', // 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: 'vendorList', // Name of property containing lookup list - property: 'vendor', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.vendor', // Corresponding property on model that potentially contains a new value to add to the list id: 'vendor_list' // Id of the lookup list to update }, { name: 'warehouseList', // Name of property containing lookup list - property: 'location', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.location', // 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 }], showDistributionUnit: function() { return this._haveValidInventoryItem(); - }.property('inventoryItemTypeAhead', 'inventoryItem'), + }.property('model.inventoryItemTypeAhead', 'model.inventoryItem'), showInvoiceItems: function() { - var invoiceItems = this.get('invoiceItems'); + var invoiceItems = this.get('model.invoiceItems'); return !Ember.isEmpty(invoiceItems); - }.property('invoiceItems.[]'), + }.property('model.invoiceItems.[]'), totalReceived: function() { - var invoiceItems = this.get('invoiceItems'), + var invoiceItems = this.get('model.invoiceItems'), total = 0; if (!Ember.isEmpty('invoiceItems')) { total = invoiceItems.reduce(function(previousValue, item) { return previousValue + Number(item.get('purchaseCost')); }, total); } - var purchaseCost = this.get('purchaseCost'); - if (this.get('isValid') && !Ember.isEmpty(purchaseCost)) { + var purchaseCost = this.get('model.purchaseCost'); + if (this.get('model.isValid') && !Ember.isEmpty(purchaseCost)) { total += Number(purchaseCost); } return total; - }.property('invoiceItems.[].purchaseCost', 'isValid', 'purchaseCost'), + }.property('model.invoiceItems.[].purchaseCost', 'model.isValid', 'model.purchaseCost'), updateButtonText: 'Save', @@ -75,7 +76,7 @@ export default AbstractEditController.extend(InventoryId, InventoryLocations, In this.generateId().then(function(inventoryId) { var inventoryItem = this.store.createRecord('inventory', { id: inventoryId, - name: this.get('inventoryItemTypeAhead'), + name: this.get('model.inventoryItemTypeAhead'), quantity: 0, // Needed for validation purposes skipSavePurchase: true }); @@ -85,11 +86,11 @@ export default AbstractEditController.extend(InventoryId, InventoryLocations, In _addInventoryItem: function() { var model = this.get('model'), - inventoryItemTypeAhead = this.get('inventoryItemTypeAhead'), - purchaseCost = this.get('purchaseCost'), - quantity = this.get('quantity'); - model.validate().then(function() { - if (this.get('isValid') && !Ember.isEmpty(inventoryItemTypeAhead) && !Ember.isEmpty(quantity) && !Ember.isEmpty(purchaseCost)) { + inventoryItemTypeAhead = this.get('model.inventoryItemTypeAhead'), + purchaseCost = this.get('model.purchaseCost'), + quantity = this.get('model.quantity'); + return model.validate().then(function() { + if (this.get('model.isValid') && !Ember.isEmpty(inventoryItemTypeAhead) && !Ember.isEmpty(quantity) && !Ember.isEmpty(purchaseCost)) { if (this._haveValidInventoryItem()) { this._addInvoiceItem(); } else { @@ -105,22 +106,23 @@ export default AbstractEditController.extend(InventoryId, InventoryLocations, In }, _addInvoiceItem: function() { - var invoiceItems = this.get('invoiceItems'), - itemProperties = this.getProperties(this.get('purchaseAttributes')), + var model = this.get('model'), + invoiceItems = model.get('invoiceItems'), + itemProperties = model.getProperties(this.get('purchaseAttributes')), invoiceItem = Ember.Object.create(itemProperties); invoiceItems.addObject(invoiceItem); - this.set('expirationDate'); - this.set('inventoryItem'); - this.set('inventoryItemTypeAhead'); - this.set('lotNumber'); - this.set('purchaseCost'); - this.set('quantity'); - this.set('selectedInventoryItem'); - this.set('vendorItemNo'); + model.set('expirationDate'); + model.set('inventoryItem'); + model.set('inventoryItemTypeAhead'); + model.set('lotNumber'); + model.set('purchaseCost'); + model.set('quantity'); + model.set('selectedInventoryItem'); + model.set('vendorItemNo'); }, _findInventoryItem: function(purchase) { - var invoiceItems = this.get('invoiceItems'), + var invoiceItems = this.get('model.invoiceItems'), inventoryId = purchase.get('inventoryItem'); if (!Ember.isEmpty(inventoryId)) { var invoiceItem = invoiceItems.find(function(item) { @@ -133,8 +135,8 @@ export default AbstractEditController.extend(InventoryId, InventoryLocations, In }, _haveValidInventoryItem: function() { - var inventoryItemTypeAhead = this.get('inventoryItemTypeAhead'), - inventoryItem = this.get('inventoryItem'); + var inventoryItemTypeAhead = this.get('model.inventoryItemTypeAhead'), + inventoryItem = this.get('model.inventoryItem'); if (Ember.isEmpty(inventoryItemTypeAhead) || Ember.isEmpty(inventoryItem)) { return false; } else { @@ -149,14 +151,15 @@ export default AbstractEditController.extend(InventoryId, InventoryLocations, In }, _savePurchases: function() { - var purchaseDefaults = this.getProperties([ + var model = this.get('model'), + purchaseDefaults = model.getProperties([ 'dateReceived', 'vendor', 'invoiceNo', 'location', 'aisleLocation', 'giftInKind']), - invoiceItems = this.get('invoiceItems'), + invoiceItems = model.get('invoiceItems'), inventoryPurchase, savePromises = []; invoiceItems.forEach(function(invoiceItem) { @@ -202,7 +205,7 @@ export default AbstractEditController.extend(InventoryId, InventoryLocations, In }, addedNewInventoryItem: function(inventoryItem) { - this.set('inventoryItem', inventoryItem); + this.set('model.inventoryItem', inventoryItem); this._addInvoiceItem(); this.send('closeModal'); if (this.get('doingUpdate')) { @@ -211,7 +214,7 @@ export default AbstractEditController.extend(InventoryId, InventoryLocations, In }, removeItem: function(removeInfo) { - var invoiceItems = this.get('invoiceItems'), + var invoiceItems = this.get('model.invoiceItems'), item = removeInfo.itemToRemove; invoiceItems.removeObject(item); this.send('closeModal'); @@ -231,10 +234,11 @@ export default AbstractEditController.extend(InventoryId, InventoryLocations, In */ update: function() { this.set('doingUpdate', true); - var addingNewInventory = this._addInventoryItem(); - if (!addingNewInventory) { - this._savePurchases(); - } + this._addInventoryItem().then(function(addingNewInventory) { + if (!addingNewInventory) { + this._savePurchases(); + } + }); } } }); diff --git a/app/inventory/batch/template.hbs b/app/inventory/batch/template.hbs index 121c2125b1..5a94bd10c0 100755 --- a/app/inventory/batch/template.hbs +++ b/app/inventory/batch/template.hbs @@ -1,13 +1,13 @@ {{#edit-panel editPanelProps=editPanelProps}} - {{#em-form model=this submitButton=false }} + {{#em-form model=model submitButton=false }}
{{date-picker property="dateReceived" label="Date Received" class="col-sm-4 required"}} - {{select-or-typeahead property="vendor" label="Vendor" list=vendorList selection=vendor className="col-sm-4 required"}} + {{select-or-typeahead property="vendor" label="Vendor" list=vendorList selection=model.vendor className="col-sm-4 required"}} {{em-input property="invoiceNo" label="Invoice Number" class="col-sm-4"}}
- {{select-or-typeahead property="location" label="Location" list=warehouseList selection=location className="col-sm-5"}} - {{select-or-typeahead property="aisleLocation" label="Aisle Location" list=aisleLocationList selection=aisleLocation className="col-sm-5"}} + {{select-or-typeahead property="location" label="Location" list=warehouseList selection=model.location className="col-sm-5"}} + {{select-or-typeahead property="aisleLocation" label="Aisle Location" list=aisleLocationList selection=model.aisleLocation className="col-sm-5"}}
{{em-checkbox label="Gift In Kind" property="giftInKind"}} @@ -31,7 +31,7 @@
{{#if showDistributionUnit}} -

{{inventoryItem.distributionUnit}}

+

{{model.inventoryItem.distributionUnit}}

{{/if}}
{{em-input property="purchaseCost" label="Purchase Cost" class="col-sm-2 required"}} @@ -51,7 +51,7 @@
- {{#if invoiceItems}} + {{#if model.invoiceItems}}

Invoice Items

@@ -63,39 +63,39 @@ - {{#each invoiceItems}} + {{#each model.invoiceItems as |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 }}
- Are you sure you wish to delete {{name}}? + Are you sure you wish to delete {{model.name}}?
{{/modal-dialog}} diff --git a/app/inventory/edit/controller.js b/app/inventory/edit/controller.js index d8091f3352..8eed636548 100644 --- a/app/inventory/edit/controller.js +++ b/app/inventory/edit/controller.js @@ -8,6 +8,7 @@ import UserSession from 'hospitalrun/mixins/user-session'; export default AbstractEditController.extend(InventoryLocations, InventoryTypeList, ReturnTo, UnitTypes, UserSession, { inventory: Ember.inject.controller(), + savingNewItem: false, canAddPurchase: function() { return this.currentUserCan('add_inventory_purchase'); @@ -29,15 +30,15 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi lookupListsToUpdate: [{ name: 'aisleLocationList', // Name of property containing lookup list - property: 'aisleLocation', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.aisleLocation', // 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: 'vendorList', // Name of property containing lookup list - property: 'vendor', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.vendor', // Corresponding property on model that potentially contains a new value to add to the list id: 'vendor_list' // Id of the lookup list to update }, { name: 'warehouseList', // Name of property containing lookup list - property: 'location', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.location', // 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 }], @@ -51,12 +52,12 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi }.property('transactions.[]'), locationQuantityTotal: function() { - var locations = this.get('locations'); + var locations = this.get('model.locations'); var total = locations.reduce(function(previousValue, location) { return previousValue + parseInt(location.get('quantity')); }, 0); return total; - }.property('locations'), + }.property('model.locations'), /** * Check to see if the total quantity by location matches the quantity calculated on the item @@ -64,9 +65,9 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi */ quantityDiscrepency: function() { var locationQuantityTotal = this.get('locationQuantityTotal'), - quantity = this.get('quantity'); + quantity = this.get('model.quantity'); return (!Ember.isEmpty(locationQuantityTotal) && !Ember.isEmpty(quantity) && locationQuantityTotal !== quantity); - }.property('locationQuantityTotal', 'quantity'), + }.property('locationQuantityTotal', 'model.quantity'), /** * Get the difference in quantity between the total quantity by location and the quantity on the item. @@ -74,15 +75,15 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi */ quantityDifferential: function() { var locationQuantityTotal = this.get('locationQuantityTotal'), - quantity = this.get('quantity'); + quantity = this.get('model.quantity'); return Math.abs(locationQuantityTotal - quantity); - }.property('locationQuantityTotal', 'quantity'), + }.property('locationQuantityTotal', 'model.quantity'), originalQuantityUpdated: function() { var isNew = this.get('model.isNew'), quantity = this.get('model.originalQuantity'); if (isNew && !Ember.isEmpty(quantity)) { - this.set('quantity', quantity); + this.set('model.quantity', quantity); } }.observes('model.isNew', 'model.originalQuantity'), @@ -124,7 +125,7 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi }, deletePurchase: function(purchase, deleteFromLocation, expire) { - var purchases = this.get('purchases'), + var purchases = this.get('model.purchases'), quantityDeleted = purchase.get('currentQuantity'); if (expire) { purchase.set('expired', true); @@ -158,19 +159,6 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi this.send('openModal', 'inventory.adjust', inventoryLocation); }, - showDeletePurchase: function(purchase) { - this.send('openModal', 'inventory.purchase.delete', purchase); - }, - - showEditPurchase: function(purchase) { - this.send('openModal', 'inventory.purchase.edit', purchase); - }, - - showExpirePurchase: function(purchase) { - purchase.set('expire', true); - this.send('openModal', 'inventory.purchase.delete', purchase); - }, - showTransfer: function(inventoryLocation) { inventoryLocation.set('adjustmentQuantity'); inventoryLocation.set('transferItem', this.get('model')); @@ -220,10 +208,11 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi var sequenceValue = null, friendlyId = sequence.get('prefix'), promises = [], - newPurchase = this.getProperties('aisleLocation', 'dateReceived', + model = this.get('model'), + newPurchase = model.getProperties('aisleLocation', 'dateReceived', 'purchaseCost', 'lotNumber', 'expirationDate', 'giftInKind', 'location', 'vendor', 'vendorItemNo'), - quantity = this.get('quantity'); + quantity = this.get('model.quantity'); if (!Ember.isEmpty(quantity)) { newPurchase.originalQuantity = quantity; newPurchase.currentQuantity = quantity; @@ -240,7 +229,7 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi } else { friendlyId += sequenceValue; } - this.set('friendlyId', friendlyId); + model.set('friendlyId', friendlyId); promises.push(sequence.save()); Ember.RSVP.all(promises, 'All before update done for inventory item').then(function() { resolve(); @@ -298,7 +287,7 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi }, getTransactions: function() { - var inventoryId = this.get('id'); + var inventoryId = this.get('model.id'); this.set('transactions', null); this.store.find('inv-request', { options: { @@ -313,7 +302,7 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi }, beforeUpdate: function() { - if (this.get('isNew')) { + if (this.get('model.isNew')) { var model = this.get('model'), inventoryType = model.get('inventoryType'); return new Ember.RSVP.Promise(function(resolve, reject) { diff --git a/app/inventory/edit/template.hbs b/app/inventory/edit/template.hbs index d8b7dede37..1b32100ba9 100644 --- a/app/inventory/edit/template.hbs +++ b/app/inventory/edit/template.hbs @@ -1,7 +1,7 @@ {{#edit-panel editPanelProps=editPanelProps}} - {{#em-form model=this submitButton=false }} + {{#em-form model=model submitButton=false }} {{partial 'inventory-basic'}} - {{#if isNew}} + {{#if model.isNew}}

Purchase information

{{partial 'inv-purchase'}} {{else}} @@ -10,7 +10,7 @@

- The total quantity ({{quantity}}), does not match the total quantity in the locations ({{locationQuantityTotal}}). + The total quantity ({{model.quantity}}), does not match the total quantity in the locations ({{locationQuantityTotal}}).

Please adjust the quantities on the appropriate location(s) to account for the difference of {{quantityDifferential}}.

@@ -34,7 +34,7 @@ - {{#each purchases as |purchase|}} + {{#each model.purchases as |purchase|}} @@ -52,7 +52,7 @@ {{/each}}
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 }} - Vendor Invoice Number
{{date-format purchase.dateReceived}} {{purchase.purchaseCost}}
{{/if}} - {{#unless isNew}} + {{#unless model.isNew}}

Locations

@@ -63,7 +63,7 @@ {{/if}} - {{#each locations as |location|}} + {{#each model.locations as |location|}} {{#if location.quantity}} 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 }} -
-

- - Are you sure you wish to {{#if expire}}expire{{else}}delete{{/if}} this purchase? -

-

Doing so will {{#if expire}}expire{{else}}remove{{/if}} {{currentQuantity}} items.

-
- {{#em-form model=this submitButton=false }} - {{#if showLocations}} - {{em-select label="Remove From Location" - prompt="Do Not Remove From A Location" - property="deleteFromLocation" content=deleteLocations - optionValuePath="location" optionLabelPath="name" - }} - {{/if}} - {{/em-form}} -{{/modal-dialog}} diff --git a/app/inventory/purchase/edit/controller.js b/app/inventory/purchase/edit/controller.js index 5e5c91fcb3..a1b7f19f56 100644 --- a/app/inventory/purchase/edit/controller.js +++ b/app/inventory/purchase/edit/controller.js @@ -2,33 +2,33 @@ import AbstractEditController from 'hospitalrun/controllers/abstract-edit-contro import Ember from 'ember'; export default AbstractEditController.extend({ - needs: 'inventory', + inventoryController: Ember.inject.controller('inventory'), cancelAction: 'closeModal', canEditQuantity: function() { - var originalQuantity = this.get('originalQuantity'), - currentQuantity = this.get('currentQuantity'); + var originalQuantity = this.get('model.originalQuantity'), + currentQuantity = this.get('model.currentQuantity'); if (currentQuantity < originalQuantity) { return false; } return true; - }.property('currentQuantity'), + }.property('model.currentQuantity', 'model.originalQuantity'), - warehouseList: Ember.computed.alias('controllers.inventory.warehouseList'), - aisleLocationList: Ember.computed.alias('controllers.inventory.aisleLocationList'), - vendorList: Ember.computed.alias('controllers.inventory.vendorList'), + warehouseList: Ember.computed.alias('inventoryController.warehouseList'), + aisleLocationList: Ember.computed.alias('inventoryController.aisleLocationList'), + vendorList: Ember.computed.alias('inventoryController.vendorList'), lookupListsToUpdate: [{ name: 'aisleLocationList', // Name of property containing lookup list - property: 'aisleLocation', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.aisleLocation', // 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: 'vendorList', // Name of property containing lookup list - property: 'vendor', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.vendor', // Corresponding property on model that potentially contains a new value to add to the list id: 'vendor_list' // Id of the lookup list to update }, { name: 'warehouseList', // Name of property containing lookup list - property: 'location', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.location', // 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 }], @@ -39,18 +39,18 @@ export default AbstractEditController.extend({ updateCapability: 'add_inventory_purchase', title: function() { - var isNew = this.get('isNew'); + var isNew = this.get('model.isNew'); if (isNew) { return 'Add Purchase'; } return 'Edit Purchase'; - }.property('isNew'), + }.property('model.isNew'), beforeUpdate: function() { - var isNew = this.get('isNew'), + var isNew = this.get('model.isNew'), changedAttributes = this.get('model').changedAttributes(); if (changedAttributes.originalQuantity) { - this.set('currentQuantity', this.get('originalQuantity')); + this.set('model.currentQuantity', this.get('model.originalQuantity')); if (!isNew) { this.set('updateQuantity', true); } diff --git a/app/inventory/purchase/edit/template.hbs b/app/inventory/purchase/edit/template.hbs index df3c09a536..42b1229c64 100644 --- a/app/inventory/purchase/edit/template.hbs +++ b/app/inventory/purchase/edit/template.hbs @@ -1,11 +1,9 @@ {{#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 }} {{partial 'inv-purchase'}} {{/em-form}} {{/modal-dialog}} diff --git a/app/inventory/quick-add/controller.js b/app/inventory/quick-add/controller.js index 844a9e8844..c088e1d7ff 100644 --- a/app/inventory/quick-add/controller.js +++ b/app/inventory/quick-add/controller.js @@ -11,8 +11,8 @@ export default InventoryEditController.extend({ }, beforeUpdate: function() { - if (this.get('skipSavePurchase')) { - this.set('quantity', null); + if (this.get('model.skipSavePurchase')) { + this.set('model.quantity', null); } return this._super(); }, diff --git a/app/inventory/quick-add/template.hbs b/app/inventory/quick-add/template.hbs index 912d314bf6..69f0afd838 100644 --- a/app/inventory/quick-add/template.hbs +++ b/app/inventory/quick-add/template.hbs @@ -1,12 +1,10 @@ {{#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 }} {{partial 'inventory-basic'}} {{/em-form}} {{/modal-dialog}} diff --git a/app/inventory/reports/controller.js b/app/inventory/reports/controller.js index cd492c13ce..e732e199e5 100644 --- a/app/inventory/reports/controller.js +++ b/app/inventory/reports/controller.js @@ -6,16 +6,17 @@ import ModalHelper from 'hospitalrun/mixins/modal-helper'; import NumberFormat from 'hospitalrun/mixins/number-format'; import SelectValues from 'hospitalrun/utils/select-values'; export default AbstractReportController.extend(LocationName, ModalHelper, NumberFormat, InventoryAdjustmentTypes, { - needs: ['inventory'], + inventoryController: Ember.inject.controller('inventory'), effectiveDate: null, expenseCategories: ['Inventory Consumed', 'Gift In Kind Usage', 'Inventory Obsolence'], expenseMap: null, grandCost: 0, grandQuantity: 0, locationSummary: null, + reportType: 'daysLeft', database: Ember.inject.service(), - warehouseList: Ember.computed.map('controllers.inventory.warehouseList.value', SelectValues.selectValuesMap), + warehouseList: Ember.computed.map('inventoryController.warehouseList.value', SelectValues.selectValuesMap), reportColumns: { date: { label: 'Date', @@ -246,14 +247,14 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number showEffectiveDate: function() { var reportType = this.get('reportType'); if (reportType === 'valuation' || reportType === 'byLocation') { - this.set('startDate', null); - if (Ember.isEmpty(this.get('endDate'))) { - this.set('endDate', new Date()); + this.set('model.startDate', null); + if (Ember.isEmpty(this.get('model.endDate'))) { + this.set('model.endDate', new Date()); } return true; } else { - if (Ember.isEmpty(this.get('startDate'))) { - this.set('startDate', new Date()); + if (Ember.isEmpty(this.get('model.startDate'))) { + this.set('model.startDate', new Date()); } return false; } @@ -801,8 +802,8 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number reportType = this.get('reportType'), reportTimes = this._getDateQueryParams(); if (reportType === 'daysLeft') { - var endDate = this.get('endDate'), - startDate = this.get('startDate'); + var endDate = this.get('model.endDate'), + startDate = this.get('model.startDate'); if (Ember.isEmpty(endDate) || Ember.isEmpty(startDate)) { this.closeProgressModal(); return; @@ -1090,9 +1091,9 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number }, _getDateQueryParams: function() { - var endDate = this.get('endDate'), + var endDate = this.get('model.endDate'), endTime = this.get('maxValue'), - startDate = this.get('startDate'), + startDate = this.get('model.startDate'), startTime; if (!Ember.isEmpty(endDate)) { endTime = moment(endDate).endOf('day').toDate().getTime(); @@ -1161,7 +1162,7 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number * @return {boolean} true if the location should be included. */ _includeLocation: function(location) { - var filterLocation = this.get('filterLocation'); + var filterLocation = this.get('model.filterLocation'); return Ember.isEmpty(filterLocation) || location === filterLocation; }, @@ -1265,10 +1266,10 @@ export default AbstractReportController.extend(LocationName, ModalHelper, Number actions: { generateReport: function() { - var endDate = this.get('endDate'), + var endDate = this.get('model.endDate'), reportRows = this.get('reportRows'), reportType = this.get('reportType'), - startDate = this.get('startDate'); + startDate = this.get('model.startDate'); if (Ember.isEmpty(startDate) && Ember.isEmpty(endDate)) { return; } diff --git a/app/inventory/reports/template.hbs b/app/inventory/reports/template.hbs index b48b91ba17..4f5d5eaddc 100644 --- a/app/inventory/reports/template.hbs +++ b/app/inventory/reports/template.hbs @@ -1,12 +1,19 @@
- {{#em-form model=this submitButton=false }} + {{#em-form model=model submitButton=false }}
- {{em-select class="col-xs-6" label="Report Type" - property="reportType" content=reportTypes - optionValuePath="value" optionLabelPath="name" - selected=reportType - }} +
+ + {{select-list + action=(action (mut reportType)) + class='form-control' + content=reportTypes + id='report-type' + optionValuePath='value' + optionLabelPath='name' + value=reportType + }} +
{{#unless hideLocationFilter}} {{em-select class="col-xs-6" label="Location" property="filterLocation" content=warehouseList @@ -84,9 +91,9 @@
Action
{{location.location}}
- {{#each reportHeaders}} + {{#each reportHeaders as |reportHeader|}} {{/each}} diff --git a/app/inventory/request/controller.js b/app/inventory/request/controller.js index c5dbe64a25..a4f5c548bd 100755 --- a/app/inventory/request/controller.js +++ b/app/inventory/request/controller.js @@ -5,12 +5,13 @@ import InventorySelection from 'hospitalrun/mixins/inventory-selection'; import Ember from 'ember'; export default AbstractEditController.extend(FulfillRequest, InventoryLocations, InventorySelection, { - needs: ['inventory'], + inventoryController: Ember.inject.controller('inventory'), + inventoryItems: null, cancelAction: 'allRequests', - warehouseList: Ember.computed.alias('controllers.inventory.warehouseList'), - aisleLocationList: Ember.computed.alias('controllers.inventory.aisleLocationList'), - expenseAccountList: Ember.computed.alias('controllers.inventory.expenseAccountList'), + warehouseList: Ember.computed.alias('inventoryController.warehouseList'), + aisleLocationList: Ember.computed.alias('inventoryController.aisleLocationList'), + expenseAccountList: Ember.computed.alias('inventoryController.expenseAccountList'), inventoryList: function() { var inventoryItems = this.get('inventoryItems'); @@ -24,42 +25,42 @@ export default AbstractEditController.extend(FulfillRequest, InventoryLocations, lookupListsToUpdate: [{ name: 'expenseAccountList', // Name of property containing lookup list - property: 'expenseAccount', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.expenseAccount', // Corresponding property on model that potentially contains a new value to add to the list id: 'expense_account_list' // Id of the lookup list to update }, { name: 'aisleLocationList', // Name of property containing lookup list - property: 'deliveryAisle', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.deliveryAisle', // 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: 'deliveryLocation', // Corresponding property on model that potentially contains a new value to add to the list + property: 'model.deliveryLocation', // 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 }], canFulfill: function() { - var requestedItems = this.get('requestedItems'); + var requestedItems = this.get('model.requestedItems'); return Ember.isEmpty(requestedItems) && this.currentUserCan('fulfill_inventory'); - }.property('requestedItems.[]'), + }.property('model.requestedItems.[]'), isFulfilling: function() { var canFulfill = this.get('canFulfill'), isRequested = this.get('isRequested'), - fulfillRequest = this.get('shouldFulfillRequest'), + fulfillRequest = this.get('model.shouldFulfillRequest'), isFulfilling = (canFulfill && (isRequested || fulfillRequest)); if (isFulfilling) { - if (Ember.isEmpty(this.get('dateCompleted'))) { - this.set('dateCompleted', new Date()); + if (Ember.isEmpty(this.get('model.dateCompleted'))) { + this.set('model.dateCompleted', new Date()); } } else { - this.set('dateCompleted'); + this.set('model.dateCompleted'); } return isFulfilling; - }.property('isRequested', 'shouldFulfillRequest'), + }.property('isRequested', 'model.shouldFulfillRequest'), isRequested: function() { - var status = this.get('status'); + var status = this.get('model.status'); return (status === 'Requested'); - }.property('status'), + }.property('model.status'), quantityLabel: function() { var selectedInventoryItem = this.get('selectedInventoryItem'); @@ -71,40 +72,40 @@ export default AbstractEditController.extend(FulfillRequest, InventoryLocations, }.property('selectedInventoryItem'), showRequestedItems: function() { - var requestedItems = this.get('requestedItems'); + var requestedItems = this.get('model.requestedItems'); return !Ember.isEmpty(requestedItems); - }.property('requestedItems.[]'), + }.property('model.requestedItems.[]'), updateViaFulfillRequest: false, updateButtonText: function() { if (this.get('isFulfilling')) { return 'Fulfill'; - } else if (this.get('isNew')) { + } else if (this.get('model.isNew')) { return 'Add'; } else { return 'Update'; } - }.property('isNew', 'isFulfilling'), + }.property('model.isNew', 'isFulfilling'), updateCapability: 'add_inventory_request', actions: { addInventoryItem: function() { - var inventoryItem = this.get('inventoryItem'), - model = this.get('model'), - requestedItems = this.get('requestedItems'), - quantity = this.get('quantity'); + var model = this.get('model'), + inventoryItem = model.get('model.inventoryItem'), + requestedItems = model.get('requestedItems'), + quantity = model.get('quantity'); model.validate(); - if (this.get('isValid') && !Ember.isEmpty(inventoryItem) && !Ember.isEmpty(quantity)) { + if (model.get('isValid') && !Ember.isEmpty(inventoryItem) && !Ember.isEmpty(quantity)) { var requestedItem = Ember.Object.create({ item: inventoryItem.get('content'), quantity: quantity }); requestedItems.addObject(requestedItem); - this.set('inventoryItem'); - this.set('inventoryItemTypeAhead'); - this.set('quantity'); + model.set('inventoryItem'); + model.set('inventoryItemTypeAhead'); + model.set('quantity'); this.set('selectedInventoryItem'); } }, @@ -114,7 +115,7 @@ export default AbstractEditController.extend(FulfillRequest, InventoryLocations, }, removeItem: function(removeInfo) { - var requestedItems = this.get('requestedItems'), + var requestedItems = this.get('model.requestedItems'), item = removeInfo.itemToRemove; requestedItems.removeObject(item); this.send('closeModal'); @@ -141,8 +142,8 @@ export default AbstractEditController.extend(FulfillRequest, InventoryLocations, this.updateLookupLists(); this.performFulfillRequest(this.get('model'), false, false, true).then(this.afterUpdate.bind(this)); } else { - var isNew = this.get('isNew'), - requestedItems = this.get('requestedItems'); + var isNew = this.get('model.isNew'), + requestedItems = this.get('model.requestedItems'); if (isNew && !Ember.isEmpty(requestedItems)) { var baseModel = this.get('model'), propertiesToCopy = baseModel.getProperties([ @@ -156,7 +157,7 @@ export default AbstractEditController.extend(FulfillRequest, InventoryLocations, inventoryPromises = [], newModels = [], savePromises = []; - if (!Ember.isEmpty(this.get('inventoryItem')) && !Ember.isEmpty(this.get('quantity'))) { + if (!Ember.isEmpty(this.get('model.inventoryItem')) && !Ember.isEmpty(this.get('model.quantity'))) { savePromises.push(baseModel.save()); } requestedItems.forEach(function(requestedItem) { @@ -203,11 +204,11 @@ export default AbstractEditController.extend(FulfillRequest, InventoryLocations, } else { this.set('updateViaFulfillRequest', false); } - if (this.get('isNew')) { - this.set('dateRequested', new Date()); - this.set('requestedBy', this.get('model').getUserName()); + if (this.get('model.isNew')) { + this.set('model.dateRequested', new Date()); + this.set('model.requestedBy', this.get('model').getUserName()); if (!this.get('isFulfilling')) { - this.set('status', 'Requested'); + this.set('model.status', 'Requested'); } } return Ember.RSVP.resolve(); diff --git a/app/inventory/request/template.hbs b/app/inventory/request/template.hbs index 9b5f867de7..8e9d8707b5 100755 --- a/app/inventory/request/template.hbs +++ b/app/inventory/request/template.hbs @@ -1,5 +1,5 @@ {{#edit-panel editPanelProps=editPanelProps}} - {{#em-form model=this submitButton=false }} + {{#em-form model=model submitButton=false }} {{#if isRequested}}
@@ -38,7 +38,7 @@
- {{#each requestedItems as |requestedItem|}} + {{#each model.requestedItems as |requestedItem|}}
- {{this}} + {{reportHeader}}
Quantity Action
{{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}}

-

{{quantity}}

+

{{model.quantity}}

- {{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 }}
{{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"}} +
+ {{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}}
- {{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}}
-

{{quantity}}

+

{{model.quantity}}

{{/unless}}
{{em-text label="Description" property="description" rows=1 }}
- {{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 +
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 ``, but object proxying is deprecated. Please use `model.patient` instead." }, - { handler: "throw", matchMessage: "You attempted to access `id` from ``, but object proxying is deprecated. Please use `model.id` instead." }, - { handler: "throw", matchMessage: "You attempted to access `isNew` from ``, but object proxying is deprecated. Please use `model.isNew` instead." }, - { handler: "silence", matchMessage: "You tried to look up 'store:main', but this has been deprecated in favor of 'service:store'." }, - { handler: "silence", matchMessage: "Using store.getById() has been deprecated. Use store.peekRecord to get a record by a given type and ID without triggering a fetch." }, - { handler: "silence", matchMessage: "DS.Model#isDirty has been deprecated please use hasDirtyAttributes instead" } + { handler: "silence", matchMessage: "ember-get-helper has been included in Ember 2.0. Use of this package is deprecated." } ] };