Skip to content

Commit

Permalink
#300 Allow Invoice Payment Only If totalAmount >= 108 EUR
Browse files Browse the repository at this point in the history
- fixed transformation currency to float
  • Loading branch information
criske committed Jan 5, 2021
1 parent efc8433 commit 37c5912
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/main/resources/public/js/getAndAddContracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,6 @@ var projectContractsCount = -1;
+ "<i class='fa fa-credit-card fa-lg'></i>"
+ "</a>";
}
if(totalAmount === 0.0){
downloadLink = "";
}
} else {
status = "Paid";
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/resources/public/js/wallets.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,9 @@ function payInvoice(invoice, contract, payButton) {
*/
function newInvoiceAsTableRow(invoice) {
var status = "Active"
var totalAmount = parseFloat(invoice.totalAmount.substring(0, invoice.totalAmount.length - 1)
.replace(",",".").trim())
var downloadLink = totalAmount > 0.0 ? "<a href='#' title='Download Invoice' class='downloadInvoice'>"
var downloadLink ="<a href='#' title='Download Invoice' class='downloadInvoice'>"
+ "<i class='fa fa-file-pdf-o fa-lg'></i>"
+ "</a>": "";
+ "</a>";
return "<tr>" +
"<td>" + invoice.id + "</td>" +
"<td>" + invoice.createdAt.split('T')[0] + "</td>" +
Expand Down

0 comments on commit 37c5912

Please sign in to comment.