Skip to content

Commit

Permalink
fix(reports): client-side validation Balance Sheet
Browse files Browse the repository at this point in the history
This commit adds validation checks to the Balance Sheet report.  It also
fixes some incorrect CSS styling and classes.
  • Loading branch information
jniles committed Aug 4, 2017
1 parent eedebc3 commit f2e09a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function BalanceSheetReportConfigController($sce, Notify, SavedReports, AppCache

vm.previewGenerated = false;

// FIXME(@jniles) - why is this needed?
$timeout(function run() {
vm.reportDetails = { date : new Date() };
}, 0);
Expand Down Expand Up @@ -41,6 +42,8 @@ function BalanceSheetReportConfigController($sce, Notify, SavedReports, AppCache
};

vm.preview = function preview(form) {
if (form.$invalid) { return; }

// update cached configuration
cache.reportDetails = angular.copy(vm.reportDetails);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ <h3 class="text-capitalize" translate>REPORT.BALANCE_SHEET.TITLE</h3>

<div class="panel-body">
<form name="ConfigForm" bh-submit="ReportConfigCtrl.preview(ConfigForm)" novalidate>

<!-- choose date until -->
<bh-date-editor
date-value="ReportConfigCtrl.reportDetails.date">
</bh-date-editor>

<!--display also revenue and expense-->
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox"
<input type="checkbox"
ng-model="ReportConfigCtrl.reportDetails.showExploitation"
ng-true-value="1" ng-false-value="0">
<span translate>REPORT.BALANCE_SHEET.SHOW_EXPLOITATION</span>
Expand Down

0 comments on commit f2e09a2

Please sign in to comment.