[WIP] Reworked ability to edit invoices, as well as many fixes and smaller changes. #2079
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This draft PR is part of a larger overhaul of the invoicing of Fossbilling.
Here is a list of current changes:
Changed the Invoice Detail view in the Admin area to be more condensed
Removed the ability to edit most of the invoice details.
Modifying invoice date, due date and paid date is only possible as long as the invoice is unpaid.
Added the ability to refresh the invoice's client data from the client record
Invoices can't be deleted anymore if the client had the possibility to see it (Meaning: The invoice has the state of "approved")
Instead, invoices can be revoked if they're unpaid. Paid, refunded, cancelled or revoked Invoices can't be deleted.
If an unpaid invoice isn't approved, it can be deleted just as before.
Revoking an Invoice removes it from the associated order, making the order "available" again for manual or automated renewal.
Added an Archive tab to the invoice list to quickly see revoked Invoices. (And so they don't show up in the invoice list)
Fixed the Missing Price field in the Invoice item list, changed formatting so it's more consistent
Changed colors (and batch formats) for invoice states so they are consistent between admin and client interfaces
As most helpfully implemented by @gilesytheking in Add "Due At" Column on Admin Invoice Overview #1992, I've changed the due date / paid date fields in the tables, as well as changing many smaller inconsistencies around
format_date
Added "Refunded" and "Revoked" tabs to the client Invoice overview (Only displayed if the client has refunded or revoked invoices)
Changed the wording for most Client-Side Things around refunded Invoices to "Credit Note"
Todos
Filtering for invoices is broken unless and until a Client is selected.
VAT % and Amounts are not stored in the invoice. invoice item price is the same as total in the database. Currently, it's a workaround that calculates the values in Situ, which has to be fixed.
For the Revoke functionality, no tests exist yet, and while I'm at it, I'll go over the other existing tests for the Invoice Module