Skip to content

Commit

Permalink
fix(invoices): only show item error if configured
Browse files Browse the repository at this point in the history
This commit ensures that the global error message is only shown if there
is no sales account _after_ the item has been configured.  Previously,
this resulted in showing large error messages during perfectly normal
operation.

Closes #1046.
  • Loading branch information
Jonathan Niles authored and sfount committed Dec 15, 2016
1 parent 2558882 commit 2105991
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/src/js/services/PatientInvoiceForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ function PatientInvoiceFormService(Patients, PriceLists, Inventory, AppCache, St
var invalidItems = this.store.data.filter(function (row) {
row[ROW_ERROR_FLAG] = highlight ? row._invalid : false;

// this sets the global configuration error if a
if (!row._hasSalesAccount) {
// this sets the global configuration error if there is no sales account
// and the row has already been configured.
if (row._initialised && !row._hasSalesAccount) {
globalConfigurationError = row._message;
}

Expand Down

0 comments on commit 2105991

Please sign in to comment.