Skip to content

Commit

Permalink
fix(reports): client-side validation Aged Debtors
Browse files Browse the repository at this point in the history
This commit implements form validation on the Aged Debtors report.  It
also removes the old Aged Debtors code.
  • Loading branch information
jniles committed Aug 4, 2017
1 parent f2e09a2 commit bf3a8a9
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 100 deletions.

This file was deleted.

33 changes: 0 additions & 33 deletions client/src/modules/finance/reports/aged-debtors/aged-debtors.html

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function AgedDebtorsConfigController($sce, Notify, SavedReports, AppCache, repor
.catch(Notify.handleError);
};

vm.onSelectPeriod = function onSelectPeriod(period){
vm.onSelectPeriod = function onSelectPeriod(period) {
vm.reportDetails.date = period.end_date;
};

Expand All @@ -57,4 +57,4 @@ function AgedDebtorsConfigController($sce, Notify, SavedReports, AppCache, repor
vm.reportDetails = angular.copy(cache.reportDetails);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ <h3 class="text-capitalize" translate>REPORT.AGED_DEBTORS.TITLE</h3>
<div class="panel-body">
<form name="ConfigForm" bh-submit="ReportConfigCtrl.preview(ConfigForm)" novalidate>
<bh-report-period-select
periodId = "ReportConfigCtrl.reportDetails.date"
name = "period"
on-select-callback = "ReportConfigCtrl.onSelectPeriod(period)">
periodId="ReportConfigCtrl.reportDetails.date"
name="period"
on-select-callback="ReportConfigCtrl.onSelectPeriod(period)"
validation-trigger="ConfigForm.$submitted">
</bh-report-period-select>

<!-- included Total Zeros -->
Expand All @@ -44,4 +45,4 @@ <h3 class="text-capitalize" translate>REPORT.AGED_DEBTORS.TITLE</h3>
</div>
</div>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions client/src/modules/templates/bhReportPeriodSelect.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<label class="control-label" translate>
{{ $ctrl.label }}
</label>
<ui-select name="period_id"
<ui-select name="period_id"
ng-model="$ctrl.periodId"
on-select="$ctrl.onSelect($item, $model)" required>
<ui-select-match placeholder="{{ 'FORM.SELECT.PERIOD' | translate }}">{{$select.selected.monthYear}}</span></ui-select-match>
Expand All @@ -18,4 +18,4 @@
<div ng-messages-include="modules/templates/messages.tmpl.html"></div>
</div>
</div>
</div>
</div>

0 comments on commit bf3a8a9

Please sign in to comment.