Skip to content

Commit

Permalink
fix: merge issues
Browse files Browse the repository at this point in the history
This commit fixes the following issues with the latest merge from
master:
 1. reference groups - broken routes in app.js
 2. accounts - the API changed, breaking billing_services
 3. bh-date-editor -  the patient invoice module no longer has two
 "date" labels
 4. patient registration - the registration page now routes to
 patients/edit.
  • Loading branch information
jniles committed Mar 31, 2016
1 parent 2125153 commit 474eea2
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 29 deletions.
8 changes: 5 additions & 3 deletions client/src/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ function bhimaConfig($stateProvider, $urlRouterProvider, $urlMatcherFactoryProvi
})

/* 2.X Journal routes */
.when('/journal', {
.state('journal', {
url : '/journal',
controller : 'JournalController as JournalCtrl',
templateUrl : 'partials/2.X-journal/journal.html'
})
Expand All @@ -326,7 +327,8 @@ function bhimaConfig($stateProvider, $urlRouterProvider, $urlMatcherFactoryProvi
controller: 'ReferenceController',
templateUrl: 'partials/references/references.html'
})
.state('/references/groups', {
.state('referenceGroups', {
url : '/references/groups',
controller: 'ReferenceGroupController as ReferenceGroupCtrl',
templateUrl: 'partials/references/groups/groups.html'
})
Expand Down Expand Up @@ -495,7 +497,7 @@ function bhimaConfig($stateProvider, $urlRouterProvider, $urlMatcherFactoryProvi
templateUrl: 'partials/patients/edit/edit.html'
})

/* */
/* Patient Invoicing */

.state('patientInvoice', {
url : '/invoices/patient',
Expand Down
8 changes: 4 additions & 4 deletions client/src/js/services/AccountService.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ function AccountService($http, util, sessionService) {
.then(util.unwrapHttpResponse)
.then(function (accounts) {

// if we recieved an array of accounts from the server,
// if we received an array of accounts from the server,
// label the accounts with a nice human readable label
if (angular.isArray(accounts)) {
accounts.forEach(function (account) {
account.label = label(account);
account.hrlabel = label(account);
});
}

Expand All @@ -66,7 +66,7 @@ function AccountService($http, util, sessionService) {
// FIXME - make /accounts return the account type w/o query string
// and preformat the numberLabel elsewhere
accounts.forEach(function (account) {
account.label = label(account);
account.hrlabel = label(account);
});

return accounts;
Expand All @@ -81,7 +81,7 @@ function AccountService($http, util, sessionService) {
}

function label(account) {
return account.account_number + ' - ' + account.account_txt;
return account.number + ' - ' + account.label;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion client/src/js/services/BillingServicesService.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function BillingServicesService($http, util) {
// remove unneeded properties
delete data.updated_at;
delete data.created_at;
delete data.account_number;
delete data.number; // account number

return $http.put(target, { billingService : data } )
.then(util.unwrapHttpResponse);
Expand Down
2 changes: 1 addition & 1 deletion client/src/partials/billing_services/modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h4>{{ BillingServicesFormCtrl.title | translate }}<span ng-show="BillingService
name="account"
ng-model="BillingServicesFormCtrl.model.account"
placeholder="{{ 'PLACEHOLDERS.ENTER.ACCOUNT' | translate }}"
uib-typeahead="account as account.label for account in BillingServicesFormCtrl.accounts | filter:$viewValue | limitTo:6"
uib-typeahead="account as account.hrlabel for account in BillingServicesFormCtrl.accounts | filter:$viewValue | limitTo:6"
typeahead-editable="false"
typeahead-template-url="partials/templates/typeahead/accounts.html"
required>
Expand Down
4 changes: 2 additions & 2 deletions client/src/partials/billing_services/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ function BillingServicesUpdateController($state, BillingServices, Accounts, Moda
.then(function (data) {
ModalInstance.close(data.id);
})
.catch(function (error) {
vm.error = error;
.catch(function (response) {
vm.error = response.data;
});
}

Expand Down
17 changes: 7 additions & 10 deletions client/src/partials/patient_invoice/patientInvoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,13 @@
<!--
@todo - since we know this is a financial date, we could set min and max for periods etc.
-->
<div class="form-group has-feedback">
<label class="control-label">{{ "COLUMNS.DATE" | translate }}</label>
<bh-date-editor
date-value="PatientInvoiceCtrl.Invoice.details.date"
form="detailsForm"
validation-trigger="detailsForm.$submitted"
min-date="PatientInvoiceCtrl.minimumDate"
max-date="PatientInvoiceCtrl.timestamp">
</bh-date-editor>
</div>
<bh-date-editor
date-value="PatientInvoiceCtrl.Invoice.details.date"
form="detailsForm"
validation-trigger="detailsForm.$submitted"
min-date="PatientInvoiceCtrl.minimumDate"
max-date="PatientInvoiceCtrl.timestamp">
</bh-date-editor>

<div class="form-group">
<label for="invoice-note">{{ "FORM.NOTES" | translate }}</label>
Expand Down
12 changes: 7 additions & 5 deletions client/src/partials/patients/registration/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,26 @@ function PatientRegistrationController($location, ScrollTo, Patients, Debtors, S
return Patients.logVisit(result.uuid);
})
.then(function (confirmation) {
var patientCardPath = '/invoice/patient/';
//var patientCardPath = '/invoices/patient/';
/** @fixme - temporary path for end to end tests while we develop receipts */
var patientCardPath = '/patients/edit/';

//TODO Hospital card should recieve a value that notifies the user of register success
//TODO Hospital card should receive a value that notifies the user of register success
$location.path(patientCardPath.concat(confirmation.uuid));
})
.catch(handleServerError);
};
}

/**
* Date and location utility methods
*/
function enableFullDate() {
viewModel.fullDateEnabled = true;
};
}

function calculateYOB(value) {
viewModel.medical.dob = value && value.length === 4 ? new Date(value + '-' + util.defaultBirthMonth) : undefined;
};
}

/**
* This method is responsible for handling exceptions thrown by the server
Expand Down
2 changes: 1 addition & 1 deletion client/src/partials/vouchers/simple.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
class="form-control"
name="fromAccount"
placeholder="{{ 'PLACEHOLDERS.ENTER.ACCOUNT' | translate }}..."
uib-typeahead="account as account.label for account in SimpleVoucherCtrl.accounts | filter:$viewValue | limitTo:10"
uib-typeahead="account as account.hrlabel for account in SimpleVoucherCtrl.accounts | filter:$viewValue | limitTo:10"
typeahead-template-url="partials/templates/typeahead/accounts.html"
ng-model="SimpleVoucherCtrl.voucher.fromAccount"
required>
Expand Down
2 changes: 1 addition & 1 deletion client/test/e2e/patient/registration.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('patient registration', function () {
// submit the patient registration form
FU.buttons.submit();

expect(browser.getCurrentUrl()).to.eventually.contain(browser.baseUrl + '#/invoice/patient/')
expect(browser.getCurrentUrl()).to.eventually.contain(browser.baseUrl + '#/patients/edit/')
.then(function () {
done();
});
Expand Down
1 change: 1 addition & 0 deletions client/test/e2e/vouchers/simple.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var expect = chai.expect;
// import testing utiliites
var components = require('../shared/components');
var FU = require('../shared/FormUtils');

var helpers = require('../shared/helpers');
helpers.configure(chai);

Expand Down
2 changes: 1 addition & 1 deletion server/controllers/finance/billingServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ exports.list = function list(req, res, next) {
if (req.query.detailed === '1') {
sql =
'SELECT bs.id, bs.label, bs.created_at, bs.updated_at, bs.account_id, ' +
'bs.description, bs.value, a.account_txt, a.account_number ' +
'bs.description, bs.value, a.number ' +
'FROM billing_service AS bs JOIN account AS a ' +
'ON bs.account_id = a.id ' +
'ORDER BY bs.id;';
Expand Down

0 comments on commit 474eea2

Please sign in to comment.