Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#300 Allow Invoice Payment Only If totalAmount >= 108 EUR #313

Merged
merged 3 commits into from
Jan 5, 2021

Conversation

criske
Copy link
Contributor

@criske criske commented Jan 4, 2021

fixes #300

Also active invoices with 0 total amount can't be downloaded. (I think this bug was reintroduced after we moved the pdf generation logic on server)

@charlesmike
Copy link

@criske thank you for your Pull Request. I'll assign someone to review it soon.

@criske
Copy link
Contributor Author

criske commented Jan 4, 2021

no bounty

@charlesmike
Copy link

@amihaiemil please review this Pull Request. Deadline (when it should be merged or closed) is 2021-01-07T19:38:53.822733.

You should check if the requirements have been implemented (partially or in full), if there are unit tests covering the changes and if the CI build passes. Feel free to reject the PR or ask for changes if it's too big or not clear enough.

Estimation here is 30 minutes, that's how much you will be paid. You will be paid even if this PR gets rejected.

@criske
Copy link
Contributor Author

criske commented Jan 4, 2021

@amihaiemil speaking of pdf invoices, shouldn't we delete them from server after user finished the download?

@@ -157,13 +157,17 @@ var projectContractsCount = -1;
+ "</a> ";
if (invoice.paymentTime == "null" && invoice.transactionId == "null") {
status = "Active";
if (parseFloat(invoice.totalAmount) > 0.0) {
var totalAmount = parseFloat(invoice.totalAmount.substring(0, invoice.totalAmount.length - 1))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have a bug here though, total amount has comma as decimal separator and messes the parseFloat.

@amihaiemil
Copy link
Member

@criske > Also active invoices with 0 total amount can't be downloaded.

Please change this pack, I want to allow invoice download even if the value is 0 :D
This way, the client and/or the contributor can see early if there is any problem with the Billing Info they entered.

Yes, we could remove the invoices after download, but I'm not sure how to do that in the Spring RestController.

@criske
Copy link
Contributor Author

criske commented Jan 5, 2021

Please change this pack, I want to allow invoice download even if the value is 0 :D
This way, the client and/or the contributor can see early if there is any problem with the Billing Info they entered.

Right, that makes sense.

Yes, we could remove the invoices after download, but I'm not sure how to do that in the Spring RestController.

The easiest way is to use StreamingResponseBody, I think. When we're closing the stream in StreamingResponseBody#writeTo(OutputStream) we delete the file too.

@amihaiemil
Copy link
Member

@criske

The easiest way is to use StreamingResponseBody, I think. When we're closing the stream in StreamingResponseBody#writeTo(OutputStream) we delete the file too.

Open an Issue about this and I'll assign it to you :D

@amihaiemil amihaiemil merged commit b6142ef into self-xdsd:master Jan 5, 2021
@charlesmike
Copy link

@amihaiemil thank you for resolving this ticket. I've just added it to your active invoice. You can always check all your invoices and more on the Contributor Dashboard.

@criske criske deleted the issue300 branch January 6, 2021 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Invoice Payment Only If totalAmount >= 108 EUR
3 participants