← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20279: PT new option: skip rounding.

 

------------------------------------------------------------
revno: 20279
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-09-22 09:05:39 +0300
message:
  PT new option: skip rounding.
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2015-09-15 10:40:23 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/reporttable/ReportTable.java	2015-09-22 06:05:39 +0000
@@ -191,6 +191,11 @@
      */
     private boolean showDimensionLabels;
 
+    /**
+     * Indicates rounding values.
+     */
+    private boolean skipRounding;
+
     // -------------------------------------------------------------------------
     // Transient properties
     // -------------------------------------------------------------------------
@@ -960,11 +965,22 @@
         this.showDimensionLabels = showDimensionLabels;
     }
 
+    @JsonProperty
+    @JsonView( { DetailedView.class, ExportView.class, DimensionalView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    public boolean isSkipRounding() {
+		return skipRounding;
+	}
+
+	public void setSkipRounding(boolean skipRounding) {
+		this.skipRounding = skipRounding;
+	}    
+
     // -------------------------------------------------------------------------
     // Get- and set-methods for transient properties
     // -------------------------------------------------------------------------
 
-    @JsonIgnore
+	@JsonIgnore
     public String getReportingPeriodName()
     {
         return reportingPeriodName;
@@ -1027,6 +1043,7 @@
             hideEmptyRows = reportTable.isHideEmptyRows();
             showHierarchy = reportTable.isShowHierarchy();
             showDimensionLabels = reportTable.isShowDimensionLabels();
+            skipRounding = reportTable.isSkipRounding();
             hideEmptyRows = reportTable.isHideEmptyRows();
             topLimit = reportTable.getTopLimit();
             sortOrder = reportTable.getSortOrder();

=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2015-09-17 08:55:40 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2015-09-22 06:05:39 +0000
@@ -448,6 +448,7 @@
         executeSql( "update eventchart set hidenadata = false where hidenadata is null" );
         executeSql( "update reporttable set showdimensionlabels = false where showdimensionlabels is null" );
         executeSql( "update eventreport set showdimensionlabels = false where showdimensionlabels is null" );
+        executeSql( "update reporttable set skiprounding = false where skiprounding is null" );
 
         // move timelydays from system setting => dataset property
         executeSql( "update dataset set timelydays = 15 where timelydays is null" );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml	2015-09-17 07:17:45 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/reporttable/hibernate/ReportTable.hbm.xml	2015-09-22 06:05:39 +0000
@@ -182,6 +182,8 @@
     <property name="showHierarchy" />
 
     <property name="showDimensionLabels" />
+    
+    <property name="skipRounding" />
 
     <!-- Access properties -->
     <property name="externalAccess" />

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties	2015-09-21 09:53:31 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/i18n/i18n_app.properties	2015-09-22 06:05:39 +0000
@@ -205,3 +205,4 @@
 comma=Comma
 space=Space
 download_data=Download data
+skip_rounding=Skip rounding

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-09-21 09:53:31 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/app.js	2015-09-22 06:05:39 +0000
@@ -515,6 +515,7 @@
             showRowSubTotals,
 			showDimensionLabels,
 			hideEmptyRows,
+            skipRounding,
             aggregationType,
             dataApprovalLevel,
 			showHierarchy,
@@ -570,7 +571,12 @@
 
 		hideEmptyRows = Ext.create('Ext.form.field.Checkbox', {
 			boxLabel: NS.i18n.hide_empty_rows,
-			style: 'margin-bottom:' + checkboxBottomMargin + 'px',
+			style: 'margin-bottom:' + checkboxBottomMargin + 'px'
+		});
+
+		skipRounding = Ext.create('Ext.form.field.Checkbox', {
+			boxLabel: NS.i18n.skip_rounding,
+			style: 'margin-top:' + separatorTopMargin + 'px; margin-bottom:' + comboBottomMargin + 'px'
 		});
 
 		aggregationType = Ext.create('Ext.form.field.ComboBox', {
@@ -796,6 +802,7 @@
                 showRowSubTotals,
                 showDimensionLabels,
 				hideEmptyRows,
+                skipRounding,
                 aggregationType,
                 dataApprovalLevel
 			]
@@ -859,6 +866,7 @@
                     showRowSubTotals: showRowSubTotals.getValue(),
                     showDimensionLabels: showDimensionLabels.getValue(),
 					hideEmptyRows: hideEmptyRows.getValue(),
+					skipRounding: skipRounding.getValue(),
                     aggregationType: aggregationType.getValue(),
                     dataApprovalLevel: {id: dataApprovalLevel.getValue()},
 					showHierarchy: showHierarchy.getValue(),
@@ -883,6 +891,7 @@
 				showRowSubTotals.setValue(Ext.isBoolean(layout.showRowSubTotals) ? layout.showRowSubTotals : true);
 				showDimensionLabels.setValue(Ext.isBoolean(layout.showDimensionLabels) ? layout.showDimensionLabels : true);
 				hideEmptyRows.setValue(Ext.isBoolean(layout.hideEmptyRows) ? layout.hideEmptyRows : false);
+                skipRounding.setValue(Ext.isBoolean(layout.skipRounding) ? layout.skipRounding : false);
                 aggregationType.setValue(Ext.isString(layout.aggregationType) ? layout.aggregationType : finalsStyleConf.default_);
 				dataApprovalLevel.setValue(Ext.isObject(layout.dataApprovalLevel) && Ext.isString(layout.dataApprovalLevel.id) ? layout.dataApprovalLevel.id : finalsStyleConf.default_);
 				showHierarchy.setValue(Ext.isBoolean(layout.showHierarchy) ? layout.showHierarchy : false);
@@ -1009,6 +1018,7 @@
 					w.showRowSubTotals = showRowSubTotals;
                     w.showDimensionLabels = showDimensionLabels;
 					w.hideEmptyRows = hideEmptyRows;
+                    w.skipRounding = skipRounding;
                     w.aggregationType = aggregationType;
                     w.dataApprovalLevel = dataApprovalLevel;
 					w.showHierarchy = showHierarchy;
@@ -6673,6 +6683,7 @@
 				url += '&columns=' + columnNames.join(';');
 				url += '&rows=' + rowNames.join(';');
 				url += ns.app.layout.hideEmptyRows ? '&hideEmptyRows=true' : '';
+                url += ns.app.layout.skipRounding ? '&skipRounding=true' : '';
 
 				window.open(url, isNewTab ? '_blank' : '_top');
 			}

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js	2015-09-15 22:59:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/core.js	2015-09-22 06:05:39 +0000
@@ -407,6 +407,8 @@
 
 				// hideEmptyRows: boolean (false)
 
+                // skipRounding: boolean (false)
+
                 // aggregationType: string ('DEFAULT') - 'DEFAULT', 'COUNT', 'SUM', 'STDDEV', 'VARIANCE', 'MIN', 'MAX'
 
                 // dataApprovalLevel: object
@@ -588,6 +590,7 @@
 					layout.showRowSubTotals = Ext.isBoolean(config.rowSubTotals) ? config.rowSubTotals : (Ext.isBoolean(config.showRowSubTotals) ? config.showRowSubTotals : true);
 					layout.showDimensionLabels = Ext.isBoolean(config.showDimensionLabels) ? config.showDimensionLabels : (Ext.isBoolean(config.showDimensionLabels) ? config.showDimensionLabels : true);
 					layout.hideEmptyRows = Ext.isBoolean(config.hideEmptyRows) ? config.hideEmptyRows : false;
+                    layout.skipRounding = Ext.isBoolean(config.skipRounding) ? config.skipRounding : false;
                     layout.aggregationType = Ext.isString(config.aggregationType) ? config.aggregationType : conf.finals.style.default_;
 					layout.dataApprovalLevel = Ext.isObject(config.dataApprovalLevel) && Ext.isString(config.dataApprovalLevel.id) ? config.dataApprovalLevel : null;
 
@@ -1748,6 +1751,10 @@
 					delete layout.hideEmptyRows;
 				}
 
+				if (!layout.skipRounding) {
+					delete layout.skipRounding;
+				}
+
 				if (!layout.showHierarchy) {
 					delete layout.showHierarchy;
 				}
@@ -2182,6 +2189,11 @@
                     paramString += '&relativePeriodDate=' + xLayout.relativePeriodDate;
                 }
 
+                // skip rounding
+                if (xLayout.skipRounding) {
+                    paramString += '&skipRounding=true';
+                }
+
 				return paramString.replace(/#/g, '.');
 			};