Skip to content

Commit

Permalink
Update configurable analysis report
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcameron committed May 25, 2022
1 parent bd14d4b commit d70f064
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 44 deletions.
1 change: 1 addition & 0 deletions client/src/i18n/en/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"TITLE": "Compare invoiced items to received stock"
},
"CONFIGURABLE_ANALYSIS_REPORT" : {
"CONFIGURE_ANALYSIS_TOOLS": "Click here to configure the analysis tools",
"HIDE_ACCOUNT_DETAILS": "Hide account details",
"HIDE_DETAILS_TYPES": "Hide details of types",
"TITLE": "Configurable analysis report"
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/fr/report.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"TITLE": "Comparaison des articles facturés sur les reçus"
},
"CONFIGURABLE_ANALYSIS_REPORT" : {
"CONFIGURE_ANALYSIS_TOOLS": "Cliquez ici pour configurer les outils d'analyse",
"HIDE_ACCOUNT_DETAILS": "Cacher les détailles des comptes",
"HIDE_DETAILS_TYPES": "Cacher les détailles des types",
"TITLE": "Rapport d'analyse configurable"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div ng-show="!ReportConfigCtrl.previewGenerated">
<div class="row">
<div class="col-md-12">
<h3 class="text-capitalize" translate>REPORT.CONFIGURABLE_ANALYSIS_REPORT.TITLE</h3>
<h2 class="text-capitalize" translate>REPORT.CONFIGURABLE_ANALYSIS_REPORT.TITLE</h2>
</div>
</div>

Expand All @@ -21,54 +21,63 @@ <h3 class="text-capitalize" translate>REPORT.CONFIGURABLE_ANALYSIS_REPORT.TITLE<

<div class="panel-body">
<form name="ConfigForm" bh-submit="ReportConfigCtrl.preview(ConfigForm)" novalidate>
<bh-fiscal-period-select
on-select-fiscal-callback="ReportConfigCtrl.onSelectFiscal(fiscal)"
on-select-period-from-callback="ReportConfigCtrl.onSelectPeriodFrom(period)"
on-select-period-to-callback="ReportConfigCtrl.onSelectPeriodTo(period)">
</bh-fiscal-period-select>

<hr>
<bh-multiple-cashbox-select
cashbox-ids="ReportConfigCtrl.reportDetails.cashboxes"
on-change="ReportConfigCtrl.onSelectCashboxes(cashboxes)"
required="true">
</bh-multiple-cashbox-select>

<hr>
<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.hide_account_details" ng-true-value="0" ng-false-value="1">
<span translate>REPORT.CONFIGURABLE_ANALYSIS_REPORT.HIDE_ACCOUNT_DETAILS</span>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.hide_details_types" ng-true-value="0" ng-false-value="1">
<span translate>REPORT.CONFIGURABLE_ANALYSIS_REPORT.HIDE_DETAILS_TYPES</span>
</label>
<div ng-if="ReportConfigCtrl.configurationsAreMissing" style="margin-bottom: 1em;">
<p class="alert alert-danger text-capitalize" style="padding: 6px 0;">
<i class="fa fa-exclamation-triangle"></i>
<span style="font-size: 1.25em;" translate> FORM.INFO.THE_NECESSARY_CONFIG_MISSING </span>
</p>
<p class="text-center">
<a href ui-sref="configuration_analysis_tools"><strong translate>REPORT.CONFIGURABLE_ANALYSIS_REPORT.CONFIGURE_ANALYSIS_TOOLS</strong></a>
</p>
</div>

<hr>
<bh-yes-no-radios
value="ReportConfigCtrl.reportDetails.includeUnpostedValues"
on-change-callback="ReportConfigCtrl.onChangeUnpostedValues(value)"
name="includeUnpostedValues"
label="REPORT.OPTIONS.INCLUDE_UNPOSTED_RECORDS"
help-text="REPORT.OPTIONS.INCLUDE_UNPOSTED_RECORDS_HELP">
</bh-yes-no-radios>
<fieldset
ng-show="!ReportConfigCtrl.configurationsAreMissing">

<div ng-if="!ReportConfigCtrl.configurationsAreMissing">
<bh-loading-button loading-state="ConfigForm.$loading">
<span translate>REPORT.UTIL.PREVIEW</span>
</bh-loading-button>
</div>
<bh-fiscal-period-select
on-select-fiscal-callback="ReportConfigCtrl.onSelectFiscal(fiscal)"
on-select-period-from-callback="ReportConfigCtrl.onSelectPeriodFrom(period)"
on-select-period-to-callback="ReportConfigCtrl.onSelectPeriodTo(period)">
</bh-fiscal-period-select>

<div ng-if="ReportConfigCtrl.configurationsAreMissing">
<span class="label label-warning text-capitalize">
<i class="fa fa-exclamation-triangle"></i>
<span style="font-size: 14px" translate> FORM.INFO.THE_NECESSARY_CONFIG_MISSING </span>
</span>
</div>
<hr>
<bh-multiple-cashbox-select
cashbox-ids="ReportConfigCtrl.reportDetails.cashboxes"
on-change="ReportConfigCtrl.onSelectCashboxes(cashboxes)"
required="true">
</bh-multiple-cashbox-select>

<hr>
<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.hide_account_details" ng-true-value="0" ng-false-value="1">
<span translate>REPORT.CONFIGURABLE_ANALYSIS_REPORT.HIDE_ACCOUNT_DETAILS</span>
</label>
</div>
<div class="checkbox">
<label>
<input type="checkbox" ng-model="ReportConfigCtrl.reportDetails.hide_details_types" ng-true-value="0" ng-false-value="1">
<span translate>REPORT.CONFIGURABLE_ANALYSIS_REPORT.HIDE_DETAILS_TYPES</span>
</label>
</div>

<hr>
<bh-yes-no-radios
value="ReportConfigCtrl.reportDetails.includeUnpostedValues"
on-change-callback="ReportConfigCtrl.onChangeUnpostedValues(value)"
name="includeUnpostedValues"
label="REPORT.OPTIONS.INCLUDE_UNPOSTED_RECORDS"
help-text="REPORT.OPTIONS.INCLUDE_UNPOSTED_RECORDS_HELP">
</bh-yes-no-radios>

<div ng-if="!ReportConfigCtrl.configurationsAreMissing">
<bh-loading-button loading-state="ConfigForm.$loading">
<span translate>REPORT.UTIL.PREVIEW</span>
</bh-loading-button>
</div>

</fieldset>
</form>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ function report(req, res, next) {
data.type = type;
data.config = config;
data.dataConfig = dataConfig;
data.provisionary = params.includeUnpostedValues;

const checkConfiguration = (data.type.length && data.config.length && data.dataConfig.length);

Expand Down

0 comments on commit d70f064

Please sign in to comment.