Skip to content

Commit

Permalink
Fixed field identifier on taxpayer creation view. Moved qualifiers for
Browse files Browse the repository at this point in the history
application.properties. Added export options to document situation,
document error messages and taxpayers view.
  • Loading branch information
RivelinoPatricio committed Sep 22, 2022
1 parent 01e5ed3 commit 80e6c85
Show file tree
Hide file tree
Showing 13 changed files with 1,058 additions and 866 deletions.
6 changes: 6 additions & 0 deletions web/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ ministry.short.name=<MF>
ministry.full.name=<Ministry of Finance>
ta.full.country=<Country Name>
ta.full.address= <T.A. Full Address>
# Qualifiers
taxpayer.qualifier.1=Economic Sector
taxpayer.qualifier.2=Legal Entity
taxpayer.qualifier.3=County
taxpayer.qualifier.4=Size of Company
taxpayer.qualifier.5=Tax Regime

# Provide the URL for registering itself as a service at Eureka Server
eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
Expand Down
5 changes: 0 additions & 5 deletions web/src/main/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,6 @@ taxpayer.id=Taxpayer ID
taxpayer.name=Name
taxpayer.address=Address
taxpayer.zip.code=Zip Code
taxpayer.qualifier.1=Economic Sector
taxpayer.qualifier.2=Legal Entity
taxpayer.qualifier.3=County
taxpayer.qualifier.4=Size of Company
taxpayer.qualifier.5=Tax Regime
taxpayer.missing.taxpayer.id=Missing taxpayer ID
taxpayers.analysis=Analysis
taxpayers.analysis.vertical.and.horizontal=Vertical and Horizontal Analysis
Expand Down
1,617 changes: 806 additions & 811 deletions web/src/main/resources/messages_es.properties

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions web/src/main/resources/qualifiers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
taxpayer.qualifier.1=Economic Sector
taxpayer.qualifier.2=Legal Entity
taxpayer.qualifier.3=County
taxpayer.qualifier.4=Size of Company
taxpayer.qualifier.5=Tax Regime
5 changes: 5 additions & 0 deletions web/src/main/resources/qualifiers_es.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
taxpayer.qualifier.1=Sector económico
taxpayer.qualifier.2=Calificador 2
taxpayer.qualifier.3=Calificador 3
taxpayer.qualifier.4=Cualificador 4
taxpayer.qualifier.5=Cualificador 5
10 changes: 5 additions & 5 deletions web/src/main/resources/templates/analysis/general_analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ <h2 class="ui header">
<div class="ui field" id="qualifiersView">
<label th:text="#{taxpayers.analysis.general.qualifiers}">Qualifiers</label>
<select class="ui dropdown" id="qualifiers">
<option value="qualifier1" th:text="#{taxpayer.qualifier.1}">Qualifier
<option value="qualifier1" th:text="${@environment.getProperty('taxpayer.qualifier.1')}">Qualifier
1</option>
<option value="qualifier2" th:text="#{taxpayer.qualifier.2}">Qualifier
<option value="qualifier2" th:text="${@environment.getProperty('taxpayer.qualifier.2')}">Qualifier
2</option>
<option value="qualifier3" th:text="#{taxpayer.qualifier.3}">Qualifier
<option value="qualifier3" th:text="${@environment.getProperty('taxpayer.qualifier.3')}">Qualifier
3</option>
<option value="qualifier4" th:text="#{taxpayer.qualifier.4}">Qualifier
<option value="qualifier4" th:text="${@environment.getProperty('taxpayer.qualifier.4')}">Qualifier
4</option>
<option value="qualifier5" th:text="#{taxpayer.qualifier.5}">Qualifier
<option value="qualifier5" th:text="${@environment.getProperty('taxpayer.qualifier.5')}">Qualifier
5</option>
</select>
</div>
Expand Down
66 changes: 63 additions & 3 deletions web/src/main/resources/templates/docs/doc_errors.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<link rel="stylesheet" type="text/css" class="ui" href="/css/tabulator_semantic-ui.min.css">
<script src="/js/tabulator.min.js"></script>
<script src="/js/luxon.min.js"><</script>
<script type="text/javascript" src="/js/xlsx.full.min.js"></script>
<script type="text/javascript" src="/js/jspdf.umd.min.js"></script>
<script type="text/javascript" src="/js/jspdf.plugin.autotable.js"></script>
</head>
<body>
<!--/* Fix to avoid overlap from the Menu */-->
Expand Down Expand Up @@ -46,6 +49,8 @@ <h2 class="ui header">

let documentId = /*[[${documentId}]]*/ null;

let documentName = /*[[#{doc.error.messages}]]*/ 'messages';

let table = new Tabulator('#table', {
index: "id",
layout:"fitDataFill",
Expand Down Expand Up @@ -77,7 +82,10 @@ <h2 class="ui header">
persistentLayout:true,
persistenceID:"doc_error_messages_persistence",
placeholder: /*[[#{no.data.available}]]*/ "No data available", //display message to user on empty table
footerElement: "<button id='filter' class='ui left floated compact button' href='javascript: filter();'><i class='icon filter'></i>[(#{filters})]</button>",
footerElement: "<button id='filter' class='ui left floated compact button' href='javascript: filter();'><i class='icon filter'></i>[(#{filters})]</button>" +
"<button id='exportXLS' class='ui left floated compact button tabulator-footer'><i class='icon download'></i>[(#{export.xls})]</button>" +
"<button id='exportCSV' class='ui left floated compact button tabulator-footer'><i class='icon download'></i>[(#{export.csv})]</button>" +
"<button id='exportPDF' class='ui left floated compact button tabulator-footer'><i class='icon download'></i>[(#{export.pdf})]</button>",
locale:'xx',
columns:[ //Define Table Columns
{title: /*[[#{taxpayer.id}]] */ "Taxpayer Id", field:"taxPayerId", headerFilter: true},
Expand All @@ -97,8 +105,60 @@ <h2 class="ui header">
$('.tabulator-col').height(showHeaderFilter ? 64 : 43)
}

table.on("tableBuilt", function(){
$('#filter').click( toggleFilter )
table.on("tableBuilt", function(){
document.getElementById('exportXLS').addEventListener("click", function(){
exportType = "XLSX";
table.download("xlsx", documentName + ".xlsx", {sheetName:documentName});
});
document.getElementById('exportCSV').addEventListener("click", function(){
exportType = "CSV";
table.download("csv", documentName);
});
document.getElementById('exportPDF').addEventListener("click", function(){
exportType = "PDF";
let author = /*[[${#authentication.name}]]*/'';
let title = documentName;
table.download("pdf", documentName, {
orientation:"landscape", //set page orientation to landscape
autoTable:function(doc) {
doc.setFontSize(8); //Want the tables font to be this size
// Optional - set properties on the document
doc.setProperties({
title: title,
author: author,
subject: documentName,
keywords: 'generated, javascript, web 2.0, ajax',
creator: 'CACAO'
});
return {
styles: {cellPadding: 2, fontSize: 8},
headStyles: { valign: 'middle', lineWidth: 1 },
//columnStyles: pdfColumnStyles,
margin: { left: 15, right: 5, top: 45, botton: 15 },
willDrawCell: function(data) {
if (data.row.section === 'head' && ( data.column.dataKey === 0 || data.column.dataKey > 4 ) ) {
data.cell.styles.halign = 'center';
}
},
didDrawPage: function (data) {
//Add header
doc.setFont(undefined, 'bold');
doc.text(title, 15, 20);
//doc.text(taxpayer[0], 15, 30);
//doc.text(taxpayer[1], 15, 40).setFont(undefined, 'normal');

//Add page number
let str = /*[[#{page}]]*/'';
str = str + " " + doc.internal.getNumberOfPages();
let textWidth = doc.getStringUnitWidth(str) * doc.internal.getFontSize() / doc.internal.scaleFactor;
let textOffset = (doc.internal.pageSize.width - textWidth) / 2;
doc.text(str, textOffset, doc.internal.pageSize.height - 10);
}
};
},
});
});
$('#filter').click( toggleFilter )
toggleFilter()
})
</script>
Expand Down
63 changes: 63 additions & 0 deletions web/src/main/resources/templates/docs/doc_situations.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<link rel="stylesheet" type="text/css" class="ui" href="/css/tabulator_semantic-ui.min.css">
<script src="/js/tabulator.min.js"></script>
<script src="/js/luxon.min.js"><</script>
<script type="text/javascript" src="/js/xlsx.full.min.js"></script>
<script type="text/javascript" src="/js/jspdf.umd.min.js"></script>
<script type="text/javascript" src="/js/jspdf.plugin.autotable.js"></script>
</head>
<body>
<!--/* Fix to avoid overlap from the Menu */-->
Expand Down Expand Up @@ -42,6 +45,8 @@ <h2 class="ui header">

let documentId = /*[[${documentId}]]*/ null;

let documentName = /*[[#{doc.situation.history}]]*/ 'situation history';

let table = new Tabulator('#table', {
layout:"fitDataFill",
pagination: false,
Expand All @@ -63,6 +68,9 @@ <h2 class="ui header">
},
persistenceID:"doc_situation_history_persistence",
placeholder: /*[[#{no.data.available}]]*/ "No data available", //display message to user on empty table
footerElement: "<button id='exportXLS' class='ui left floated compact button tabulator-footer'><i class='icon download'></i>[(#{export.xls})]</button>" +
"<button id='exportCSV' class='ui left floated compact button tabulator-footer'><i class='icon download'></i>[(#{export.csv})]</button>" +
"<button id='exportPDF' class='ui left floated compact button tabulator-footer'><i class='icon download'></i>[(#{export.pdf})]</button>",
columns:[ //Define Table Columns
{title: /*[[#{taxpayer.id}]]*/ "Taxpayer Id", field:"taxPayerId", minWidth: 120, headerFilter:this.headerFilter},
{title: /*[[#{doc.timestamp}]]*/ "Upload date/time", field:"timestamp", formatter: dateFormatter, headerFilter:this.headerFilter},
Expand All @@ -72,6 +80,61 @@ <h2 class="ui header">
{title: /*[[#{doc.situation.history.documentFilename}]]*/ "Document Filename", field:"documentFilename", headerFilter:this.headerFilter},
]
})

table.on("tableBuilt", function(){
document.getElementById('exportXLS').addEventListener("click", function(){
exportType = "XLSX";
table.download("xlsx", documentName + ".xlsx", {sheetName:documentName});
});
document.getElementById('exportCSV').addEventListener("click", function(){
exportType = "CSV";
table.download("csv", documentName);
});
document.getElementById('exportPDF').addEventListener("click", function(){
exportType = "PDF";
let author = /*[[${#authentication.name}]]*/'';
let title = documentName;
table.download("pdf", documentName, {
orientation:"landscape", //set page orientation to landscape
autoTable:function(doc) {
doc.setFontSize(8); //Want the tables font to be this size
// Optional - set properties on the document
doc.setProperties({
title: title,
author: author,
subject: documentName,
keywords: 'generated, javascript, web 2.0, ajax',
creator: 'CACAO'
});
return {
styles: {cellPadding: 2, fontSize: 8},
headStyles: { valign: 'middle', lineWidth: 1 },
//columnStyles: pdfColumnStyles,
margin: { left: 15, right: 5, top: 45, botton: 15 },
willDrawCell: function(data) {
if (data.row.section === 'head' && ( data.column.dataKey === 0 || data.column.dataKey > 4 ) ) {
data.cell.styles.halign = 'center';
}
},
didDrawPage: function (data) {
//Add header
doc.setFont(undefined, 'bold');
doc.text(title, 15, 20);
//doc.text(taxpayer[0], 15, 30);
//doc.text(taxpayer[1], 15, 40).setFont(undefined, 'normal');

//Add page number
let str = /*[[#{page}]]*/'';
str = str + " " + doc.internal.getNumberOfPages();
let textWidth = doc.getStringUnitWidth(str) * doc.internal.getFontSize() / doc.internal.scaleFactor;
let textOffset = (doc.internal.pageSize.width - textWidth) / 2;
doc.text(str, textOffset, doc.internal.pageSize.height - 10);
}
};
},
});
});
})

</script>
</body>
Expand Down
15 changes: 9 additions & 6 deletions web/src/main/resources/templates/docs/docs_search.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@
<h2 class="ui header">
<i class="archive icon"></i>
<span class="content" th:text="#{docs.history}">All Uploads</span>
</h2>
<div id="table" class="ui orange compact table"></div>
<div class="ui column right floated" th:unless="${@DocumentStoreService.isPresentationMode()}">
<div class="ui right floated primary labeled icon">
</h2>
<div class="ui grid right floated" th:unless="${@DocumentStoreService.isPresentationMode()}">
<div class="right primary labeled icon">
<a th:href="@{/docs}" class="ui primary button"><i class="plus icon"></i><span th:text="#{docs.main.upload}">Upload Documents</span></a>
</div>
</div>
<div class="right primary labeled icon">
<button id='filter' class='ui primary button' href='javascript: filter();'><i class='icon filter'></i>[(#{filters})]</button>
</div>
</div>
<div id="table" class="ui orange compact table"></div>
<div class="ui top aligned tiny modal" id="chooseRangeModal">
<div class="header">Choose a date range</div>
<div class="content">
Expand Down Expand Up @@ -192,7 +195,7 @@ <h2 class="ui header">
filterMode:"remote",
sortMode: "remote",
headerFilterLiveFilterDelay:700,
footerElement: "<button id='filter' class='ui left floated compact button' href='javascript: filter();'><i class='icon filter'></i>[(#{filters})]</button>",
//footerElement: "<button id='filter' class='ui left floated compact button' href='javascript: filter();'><i class='icon filter'></i>[(#{filters})]</button>",
ajaxURL: /*[[@{/api/docs-search}]]*/ "/api/docs-seach", //set url for ajax request
ajaxURLGenerator: function(url, config, params ){
p= new URLSearchParams()
Expand Down
24 changes: 12 additions & 12 deletions web/src/main/resources/templates/taxpayers/add-taxpayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ <h2 class="ui header">
<input type="text" th:field="*{taxPayerId}" class="form-control" id="taxPayerId" th:placeholder="#{taxpayer.id}">
</div>
<div class="ten wide field">
<label th:text="#{user.name}" style="margin-bottom: 0px; text-transform: uppercase;">User Name</label>
<input type="text" th:field="*{name}" th:value="*{name}" class="form-control" id="name" placeholder="Name" th:placeholder="#{user.name}">
<label th:text="#{taxpayer.name}" style="margin-bottom: 0px; text-transform: uppercase;">User Name</label>
<input type="text" th:field="*{name}" th:value="*{name}" class="form-control" id="name" placeholder="Name" th:placeholder="#{taxpayer.name}">
</div>
</div>
<div class="field">
Expand All @@ -46,28 +46,28 @@ <h2 class="ui header">
<input type="text" th:field="*{zipCode}" class="form-control" id="zipCode" th:placeholder="#{taxpayer.zip.code}">
</div>
<div class="eight wide field">
<label th:text="#{taxpayer.qualifier.1}" style="margin-bottom: 0px; text-transform: uppercase;">Qualifier 1</label>
<input type="text" th:field="*{qualifier1}" class="form-control" id="qualifier1" th:placeholder="#{taxpayer.qualifier.1}">
<label th:text="${@environment.getProperty('taxpayer.qualifier.1')}" style="margin-bottom: 0px; text-transform: uppercase;">Qualifier 1</label>
<input type="text" th:field="*{qualifier1}" class="form-control" id="qualifier1" th:placeholder="${@environment.getProperty('taxpayer.qualifier.1')}">
</div>
</div>
<div class="fields">
<div class="eight wide field">
<label th:text="#{taxpayer.qualifier.2}" style="margin-bottom: 0px; text-transform: uppercase;">Qualifier 2</label>
<input type="text" th:field="*{qualifier2}" class="form-control" id="qualifier2" th:placeholder="#{taxpayer.qualifier.2}">
<label th:text="${@environment.getProperty('taxpayer.qualifier.2')}" style="margin-bottom: 0px; text-transform: uppercase;">Qualifier 2</label>
<input type="text" th:field="*{qualifier2}" class="form-control" id="qualifier2" th:placeholder="${@environment.getProperty('taxpayer.qualifier.2')}">
</div>
<div class="eight wide field">
<label th:text="#{taxpayer.qualifier.3}" style="margin-bottom: 0px; text-transform: uppercase;">Qualifier 3</label>
<input type="text" th:field="*{qualifier3}" class="form-control" id="qualifier3" th:placeholder="#{taxpayer.qualifier.3}">
<label th:text="${@environment.getProperty('taxpayer.qualifier.3')}" style="margin-bottom: 0px; text-transform: uppercase;">Qualifier 3</label>
<input type="text" th:field="*{qualifier3}" class="form-control" id="qualifier3" th:placeholder="${@environment.getProperty('taxpayer.qualifier.3')}">
</div>
</div>
<div class="fields">
<div class="eight wide field">
<label th:text="#{taxpayer.qualifier.4}" style="margin-bottom: 0px; text-transform: uppercase;">Qualifier 4</label>
<input type="text" th:field="*{qualifier4}" class="form-control" id="qualifier4" th:placeholder="#{taxpayer.qualifier.4}">
<label th:text="${@environment.getProperty('taxpayer.qualifier.4')}" style="margin-bottom: 0px; text-transform: uppercase;">Qualifier 4</label>
<input type="text" th:field="*{qualifier4}" class="form-control" id="qualifier4" th:placeholder="${@environment.getProperty('taxpayer.qualifier.4')}">
</div>
<div class="eight wide field">
<label th:text="#{taxpayer.qualifier.5}" style="margin-bottom: 0px; text-transform: uppercase;">Qualifier 5</label>
<input type="text" th:field="*{qualifier5}" class="form-control" id="qualifier5" th:placeholder="#{taxpayer.qualifier.5}">
<label th:text="${@environment.getProperty('taxpayer.qualifier.5')}" style="margin-bottom: 0px; text-transform: uppercase;">Qualifier 5</label>
<input type="text" th:field="*{qualifier5}" class="form-control" id="qualifier5" th:placeholder="${@environment.getProperty('taxpayer.qualifier.5')}">
</div>
</div>
<div class="row">
Expand Down
Loading

0 comments on commit 80e6c85

Please sign in to comment.