Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,24 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
<filteredResources>
<filter>
<id>1687118378909</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
27 changes: 17 additions & 10 deletions app/scripts/controllers/reports/XBRLReportController.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,35 @@
XBRLReportController: function (scope, resourceFactory, location, $rootScope) {

scope.xmlData = $rootScope.xmlData;
var html = "<table width='100%' border='1'><tr><th>Title</th><th>Dimension</th><th>Value</th></tr>";
var table = $("<table width='100%' border='1'></table>");
var header = $("<tr></tr>").append("<th>Title</th>", "<th>Dimension</th>", "<th>Value</th>");
table.append(header);

$(scope.xmlData).find("*[contextRef]").each(function (i) {
var contextId = $(this).attr("contextRef");
var context = $(scope.xmlData).find("#" + contextId).find("scenario").text();
html += '<tr>';
html += '<td>' + this.tagName + '</td>';
html += '<td>' + context + '</td>';

var row = $("<tr></tr>");
row.append('<td>' + this.tagName + '</td>');
row.append('<td>' + context + '</td>');

var inputId = this.tagName + "|" + contextId;
html += '<td><input type="text" class="report" id="' + inputId + '" value="' + $(this).text() + '" ></td>';
html += '</tr>';
var input = $('<td><input type="text" class="report"></td>');
input.find('input').attr('id', inputId).val($(this).text());
row.append(input);

table.append(row);
});
$("#xbrlreport").html(html);

$("#xbrlreport").empty().append(table);

scope.saveReport = function () {
var string = (new XMLSerializer()).serializeToString(scope.xmlData);
window.location.href = 'data:Application/octet-stream;Content-Disposition:attachment;filename=file.xml,' + escape(string);
};


}
});
mifosX.ng.application.controller('XBRLReportController', ['$scope', 'ResourceFactory', '$location', '$rootScope', mifosX.controllers.XBRLReportController]).run(function ($log) {
$log.info("XBRLReportController initialized");
});
}(mifosX.controllers || {}));
}(mifosX.controllers || {}));