I just upgraded from IP 1.5.7 to 1.5.9 and everything looks good except for one thing.
In the window where i create the invoice, the line with the invoice tax is shifted or mixed…After Invoice Tax the order of items is: Amount,- BTW (tax) - 21.00 (percentage) - Trashcan.
I think the amount should be the last in this row to keep the amounts in line.
I cannot find that this a known issue so maybe i something went wrong with the update.
Any help would be appreciated.
You are correct: the content order is reversed, even the wastebasket. This is how it looks in demo
I will check the code and see if there is an explanation for that behaviour.
Did you follow the update instructions in the wiki ?
As for running the setup again, I don’t think it would fix this problem.
Thank you Miquel. I did follow the update as in the wiki and I did some updates in the past without any problemt. So not sure what may cause this issue.
Do you know in which file these fields are made up?
The code that renders this summary table is in file
invoiceplane-v15/application/modules/invoices/views/partial_item_table.php
starting approximately in the line 325-300, and the code for the Invoice Tax row is,
<td><?php _trans('invoice_tax'); ?></td>
<td>
<?php if ($invoice_tax_rates) {
foreach ($invoice_tax_rates as $invoice_tax_rate) { ?>
<form method="post"
action="<?php echo site_url('invoices/delete_invoice_tax/' . $invoice->invoice_id . '/' . $invoice_tax_rate->invoice_tax_rate_id) ?>">
<?php _csrf_field(); ?>
<span class="amount">
<?php echo format_currency($invoice_tax_rate->invoice_tax_rate_amount); ?>
</span>
<span class="text-muted">
<?php echo htmlsc($invoice_tax_rate->invoice_tax_rate_name) . ' ' . format_amount($invoice_tax_rate->invoice_tax_rate_percent) ?>
</span>
<button type="submit" class="btn btn-xs btn-link"
onclick="return confirm('<?php _trans('delete_tax_warning'); ?>');">
<i class="fa fa-trash-o"></i>
</button>
</form>
And now that I see the code the cause of the error is obvious: the string is built concatenating the elements in the reversed order you have reported,
invoice_tax_rate_amount
invoice_tax_rate_name
invoice_tax_rate_percent
fa-trash-o
icon
which is not the one displayed in demo and the one we would expect.
I will investigate why and when the order got reversed and I will submit a pull-request to correct it in v1.5.10.
In the meanwhile, to restore the order, you could replace (make a backup copy of the file before editing it) the code with this one:
<td><?php _trans('invoice_tax'); ?></td>
<td>
<?php if ($invoice_tax_rates) {
foreach ($invoice_tax_rates as $invoice_tax_rate) { ?>
<form method="post"
action="<?php echo site_url('invoices/delete_invoice_tax/' . $invoice->invoice_id . '/' . $invoice_tax_rate->invoice_tax_rate_id) ?>">
<?php _csrf_field(); ?>
<button type="submit" class="btn btn-xs btn-link"
onclick="return confirm('<?php _trans('delete_tax_warning'); ?>');">
<i class="fa fa-trash-o"></i>
</button>
<span class="text-muted">
<?php echo htmlsc($invoice_tax_rate->invoice_tax_rate_name) . ' ' . format_amount($invoice_tax_rate->invoice_tax_rate_percent) ?>
</span>
<span class="amount">
<?php echo format_currency($invoice_tax_rate->invoice_tax_rate_amount); ?>
</span>
</form>
that yields,
1 Like
@Kovah the order was reversed in this commit,
committed 08:51AM - 04 Mar 18 UTC
that also reversed the order of the tax line in quotes view.
Is there a reason to keep it? I have tested the element sorting trash_button + tax_name + tax_rate + tax_amount and the delete feature works, thus, I think it is safe to make that change. Should I open a ticket and submit a PR?
Also, which format do you prefer?
[trash-icon] US Std 7,00% 28,00€
[trash-icon] (US Std 7,00%) 28,00€
[trash-icon] (US Std 7,00 %) 28,00€
none of the above (which one?)
Many thanks, Miquel. I did the change and it is okay now!
Kovah
October 6, 2018, 9:18am
7
Maybe this?
US Std 7,00% 28,00€ [trash-icon]
Not sure, the amount should be the rightmost element if we want it to align with amounts in previous lines.
@Benny54 Ok and thanks for reporting the problem. Whenever you have time, remember to mark as correct answer the post with the solution.
Ticket created:
IP-745 - Reorder tax line in invoice & quote views to display the amount at the right end
and pull-request submitted:
InvoicePlane:v1.5.10
← miquel-cabanas:v1.5.10-ip-745
opened 04:52PM - 06 Oct 18 UTC
Pull Request Checklist
* [x] My code follows the code formatting guidelines… .
* [x] I have an issue ID for this pull request.
* [x] I selected the corresponding branch.
* [x] I have rebased my changes on top of the corresponding branch.
Issue Type (Please check one or more)
* [x] Bugfix
* [ ] Improvement of an existing Feature
* [ ] New Feature
Reorder the elements in the tax line in invoice & quote views to display the amount at the right end of the line as in: [trash-icon] US Std 7,00% 28,00€
system
Closed
October 20, 2018, 4:53pm
12
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.