Skip to content

Commit

Permalink
change the select to the typehead select in patient invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
Ebed-meleck committed Feb 13, 2024
1 parent 9ee830c commit 0f38406
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
22 changes: 7 additions & 15 deletions client/src/modules/invoices/patientInvoice.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,13 @@
</bh-find-patient>
</div>

<div class="form-group"
ng-class="{'has-error' : InvoiceForm.$submitted && InvoiceForm.service.$invalid }">
<label class="control-label" translate>FORM.LABELS.SERVICE</label>
<select
class="form-control"
name="service"
ng-model="PatientInvoiceCtrl.Invoice.details.service_uuid"
ng-options="service.uuid as service.name for service in PatientInvoiceCtrl.Invoice.services"
required>
<option disabled="disabled" value="" translate>FORM.LABELS.SERVICE</option>
</select>
<div class="help-block" ng-messages="InvoiceForm.service.$error" ng-show="InvoiceForm.$submitted">
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
</div>
<bh-service-select
service-uuid="PatientInvoiceCtrl.Invoice.details.service_uuid"
name="service_uuid"
on-select-callback="PatientInvoiceCtrl.onSelectService(service)"
required="true">
</bh-service-select>

</div>

<div class="col-md-6">
Expand Down
9 changes: 7 additions & 2 deletions client/src/modules/invoices/patientInvoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ PatientInvoiceController.$inject = [
*/
function PatientInvoiceController(
Patients, PatientInvoices, PatientInvoiceForm, util, Session, Receipts, Notify,
Constants, Exchange, moment
Constants, Exchange, moment,
) {
const vm = this;

Expand Down Expand Up @@ -85,7 +85,7 @@ function PatientInvoiceController(
data : vm.Invoice.store.data,
};

// called when the grid is initialized
// called when the grid is initialized
function exposeGridScroll(gridApi) {
vm.gridApi = gridApi;
}
Expand Down Expand Up @@ -197,6 +197,11 @@ function PatientInvoiceController(
vm.patientBalance = null;
}

// select service
vm.onSelectService = (service) => {
vm.Invoice.details.service_uuid = service.uuid;
};

vm.gridOptions = gridOptions;
vm.setPatient = setPatient;
vm.submit = submit;
Expand Down

0 comments on commit 0f38406

Please sign in to comment.