Description | -Actual Charges | -Discount | -PhilHealth | -HMO/COM | -Excess | -{{t 'labels.action'}} | +Description | +Actual Charges | +Discount | +PhilHealth | +HMO/COM | +Excess | +{{t 'labels.action'}} |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
-
{{input class="form-control" value=item.name }}
- |
{{number-format item.total}} @@ -106,12 +104,12 @@ | ||||||||||||
{{t 'labels.name'}} | -{{t 'labels.quantity'}} | -Price | -Expense To | +{{t 'labels.name'}} | +{{t 'labels.quantity'}} | +Price | +Expense To | Total | -+ | {{#if canAddCharge}} | |||
-
-
+
- {{input class="form-control" value=detail.name }}
-
- | + {{input class="form-control" value=detail.name }} |
diff --git a/app/mixins/medication-details.js b/app/mixins/medication-details.js
index d82d176315..44fffe50e4 100644
--- a/app/mixins/medication-details.js
+++ b/app/mixins/medication-details.js
@@ -7,9 +7,14 @@ export default Ember.Mixin.create({
if (!Ember.isEmpty(medicationTitle)) {
return medicationTitle;
} else {
- this.get(inventoryAttribute).then((inventoryItem) => {
- this.set('medicationTitle', inventoryItem.get('name'));
- });
+ var inventoryObject = this.get(inventoryAttribute);
+ if (inventoryObject.then) {
+ this.get(inventoryAttribute).then((inventoryItem) => {
+ this.set('medicationTitle', inventoryItem.get('name'));
+ });
+ } else {
+ this.set('medicationTitle', inventoryObject.get('name'));
+ }
}
},
@@ -34,12 +39,20 @@ export default Ember.Mixin.create({
price: priceOfMedication
});
} else {
- this.get(inventoryAttribute).then((inventoryItem) => {
+ var objectInventoryItem = this.get(inventoryAttribute);
+ if (objectInventoryItem.then) {
+ this.get(inventoryAttribute).then((inventoryItem) => {
+ resolve({
+ name: inventoryItem.get('name'),
+ price: inventoryItem.get('price')
+ });
+ });
+ } else {
resolve({
- name: inventoryItem.get('name'),
- price: inventoryItem.get('price')
+ name: objectInventoryItem.get('name'),
+ price: objectInventoryItem.get('price')
});
- });
+ }
}
});
},
diff --git a/app/models/invoice.js b/app/models/invoice.js
index 43dd97ecd3..324cf79e51 100644
--- a/app/models/invoice.js
+++ b/app/models/invoice.js
@@ -95,8 +95,7 @@ export default AbstractModel.extend(DateFormat, NumberFormat, {
categoryList.total = this._calculateTotal(categoryList.items, 'total');
}.bind(this));
return byCategory;
- }.property('lineItems.[].amountOwed'),
-
+ }.property('lineItems.@each.amountOwed'),
patientIdChanged: function() {
if (!Ember.isEmpty(this.get('patient'))) {
var patientDisplayName = this.get('patient.displayName'),
@@ -118,7 +117,7 @@ export default AbstractModel.extend(DateFormat, NumberFormat, {
if (remainingBalance <= 0) {
this.set('status', 'Paid');
}
- }.observes('payments.[]', 'payments.[].amount'),
+ }.observes('payments.[]', 'payments.@each.amount'),
validations: {
patientTypeAhead: PatientValidation.patientTypeAhead,
diff --git a/app/models/proc-charge.js b/app/models/proc-charge.js
index f8e16242ff..58c7e7b790 100644
--- a/app/models/proc-charge.js
+++ b/app/models/proc-charge.js
@@ -17,22 +17,18 @@ export default AbstractModel.extend(MedicationDetails, {
dateCharged: DS.attr('date'),
medicationCharge: function() {
- let medicationTitle = this.get('medicationTitle');
- if (!Ember.isEmpty(medicationTitle)) {
- return true;
- }
- var pricingItem = this.get('pricingItem'),
- newMedicationCharge = this.get('newMedicationCharge');
- return (Ember.isEmpty(pricingItem) || newMedicationCharge);
- }.property('medicationTitle', 'pricingItem', 'newMedicationCharge'),
+ let medication = this.get('medication');
+ let newMedicationCharge = this.get('newMedicationCharge');
+ return (!Ember.isEmpty(medication) || !Ember.isEmpty(newMedicationCharge));
+ }.property('medication', 'newMedicationCharge'),
medicationName: function() {
- return this.getMedicationName('medication');
- }.property('medicationTitle', 'medication'),
+ return this.get('medication.name');
+ }.property('medication'),
medicationPrice: function() {
- return this.getMedicationPrice('medication');
- }.property('priceOfMedication', 'medication'),
+ return this.get('medication.price');
+ }.property('medication'),
validations: {
itemName: {
|