Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Small refactor #541

Merged
merged 2 commits into from
Jul 6, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions app/invoices/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,26 +122,28 @@ export default AbstractEditController.extend(NumberFormat, PatientSubmodule, Pub
},

showDeleteItem: function(itemToDelete, deleteFrom) {
this.send('openModal', 'dialog', Ember.Object.create({
this.showDeleteModal(itemToDelete, Ember.Object.create({
confirmAction: 'deleteCharge',
deleteFrom: deleteFrom,
title: 'Delete Charge',
message: `Are you sure you want to delete ${itemToDelete.get('name')}?`,
itemToDelete: itemToDelete,
updateButtonAction: 'confirm',
updateButtonText: 'Ok'
title: 'Delete Charge'
}));
},

showDeleteLineItem: function(item) {
this.send('openModal', 'dialog', Ember.Object.create({
this.showDeleteModal(item, Ember.Object.create({
confirmAction: 'deleteLineItem',
title: 'Delete Line Item',
title: 'Delete Line Item'
}));
},

showDeleteModal(item, options) {
options = Ember.merge(options, Ember.Object.create({
message: `Are you sure you want to delete ${item.get('name')}?`,
itemToDelete: item,
updateButtonAction: 'confirm',
updateButtonText: 'Ok'
updateButtonText: this.get('i18n').t('buttons.ok')
}));
this.send('openModal', 'dialog', options);
},

showRemovePayment: function(payment) {
Expand Down