Skip to content

Commit

Permalink
fix(cash): ensure scan barcode opens in all cases.
Browse files Browse the repository at this point in the history
This commit makes the scan barcode modal open in all cases, even if the
modal is dismissed following successful payment.
  • Loading branch information
Jonathan Niles authored and sfount committed Jan 14, 2017
1 parent 37079f3 commit ca1d522
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/src/partials/cash/cash.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@

<div class="checkbox" style="display : inline-block; padding-right:5px;">
<label>
<input type="checkbox" ng-model="CashCtrl.openBarcodeModalOnSuccess"> <span translate>CASH.VOUCHER.OPEN_BARCODE_MODAL</span>
<input type="checkbox" ng-model="CashCtrl.openBarcodeModalOnSuccess" ng-true-value="true" ng-false-value="false"> <span translate>CASH.VOUCHER.OPEN_BARCODE_MODAL</span>
</label>
</div>

Expand Down
5 changes: 2 additions & 3 deletions client/src/partials/cash/cash.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function CashController(Cash, Cashboxes, AppCache, Currencies, Session, Modals,
vm.enterprise = Session.enterprise;

// this toggles whether the form should re-enter the checkbox state
var DEFAULT_BARCODE_CHECKBOX_STATE = (cache.openBarcodeModalOnSuccess || true);
var DEFAULT_BARCODE_CHECKBOX_STATE = true;

// bind methods
vm.submit = submit;
Expand Down Expand Up @@ -111,7 +111,7 @@ function CashController(Cash, Cashboxes, AppCache, Currencies, Session, Modals,
// be sure the cashbox is set
vm.Payment.setCashbox(vm.cashbox);

vm.openBarcodeModalOnSuccess = cache.openBarcodeModalOnSuccess;
cache.openBarcodeModalOnSuccess = vm.openBarcodeModalOnSuccess;

// patient invoices are covered by caution
var hasCaution = vm.Payment.messages.hasPositiveAccountBalance;
Expand Down Expand Up @@ -154,7 +154,6 @@ function CashController(Cash, Cashboxes, AppCache, Currencies, Session, Modals,
return Receipts.cash(response.uuid, true);
})
.then(function () {

// clear and refresh the form
clear(form);

Expand Down
4 changes: 0 additions & 4 deletions client/src/partials/cash/modals/invoices.modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
<i class="fa fa-warning"></i> {{ ::"FORM.ERRORS.MISSING_DEBTOR_ID" | translate }}
</p>

<pre>
{{ CashInvoiceModalCtrl.$params | json }}
</pre>

<!-- ui-grid to select debtor invoices -->
<div ng-if="!CashInvoiceModalCtrl.missingId">
<div ui-grid="CashInvoiceModalCtrl.gridOptions" ui-grid-selection class="modal-grid" id="debtorInvoicesGrid">
Expand Down
2 changes: 1 addition & 1 deletion client/src/partials/cash/modals/scanBarcode.modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="modal-body text-center" style="min-height:300px;">

<!-- state: awaiting barcode input -->
<h2>Scan Barcode</h2>
<h2 translate>CASH.VOUCHER.BARCODE.SCAN</h2>

<h1>
<i class="fa fa-barcode fa-3x"></i>
Expand Down

0 comments on commit ca1d522

Please sign in to comment.