From 1d3b49684a02770fe874ff82437cb0f94ff92ea0 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Wed, 8 Apr 2015 10:30:30 -0400 Subject: [PATCH] Added expense account to adjustments Resolves HospitalRun/frontend#83 --- app/inventory/adjust/controller.js | 2 ++ app/inventory/adjust/template.hbs | 3 ++- app/inventory/edit/controller.js | 1 + app/inventory/edit/template.hbs | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/inventory/adjust/controller.js b/app/inventory/adjust/controller.js index c4052b9117..8098ca0799 100644 --- a/app/inventory/adjust/controller.js +++ b/app/inventory/adjust/controller.js @@ -16,6 +16,8 @@ export default AbstractEditController.extend({ name: 'Write Off', type: 'Write Off' }], + + expenseAccountList: Ember.computed.alias('controllers.inventory.expenseAccountList'), title: 'Adjustment', diff --git a/app/inventory/adjust/template.hbs b/app/inventory/adjust/template.hbs index bca247201b..d9b7852cb6 100644 --- a/app/inventory/adjust/template.hbs +++ b/app/inventory/adjust/template.hbs @@ -12,7 +12,7 @@

{{quantity}}

- {{em-select class="col-sm-3" label="Adjustment Type" + {{em-select class="col-sm-4" label="Adjustment Type" property="transactionType" content=adjustmentTypes optionValuePath="content.type" optionLabelPath="content.name" }} @@ -21,5 +21,6 @@ {{em-text label="Reason" property="reason" rows=3 }}
{{date-picker property="dateCompleted" label="Adjustment Date" class="col-sm-4"}} + {{select-or-typeahead property="expenseAccount" label="Expense Account" list=expenseAccountList selection=expenseAccount class="col-sm-8"}}
{{/em-form}} \ No newline at end of file diff --git a/app/inventory/edit/controller.js b/app/inventory/edit/controller.js index e5fd4461e7..a106b3de34 100644 --- a/app/inventory/edit/controller.js +++ b/app/inventory/edit/controller.js @@ -108,6 +108,7 @@ export default AbstractEditController.extend(InventoryLocations, InventoryTypeLi request = this.get('store').createRecord('inv-request', { adjustPurchases: true, dateCompleted: inventoryLocation.get('dateCompleted'), + expenseAccount: inventoryLocation.get('expenseAccount'), inventoryItem: inventoryItem, quantity: adjustmentQuantity, transactionType: transactionType, diff --git a/app/inventory/edit/template.hbs b/app/inventory/edit/template.hbs index 72759cd562..173beecd82 100644 --- a/app/inventory/edit/template.hbs +++ b/app/inventory/edit/template.hbs @@ -115,6 +115,7 @@ Date Completed Quantity Transaction + Expense Account Details {{#if haveTransactions}} @@ -123,6 +124,7 @@ {{date-format dateCompleted}} {{quantity}} {{transactionType}} + {{expenseAccount}} {{#if isAdjustment}} {{#if haveReason}}