Kovah
June 21, 2015, 2:41pm
1
A new release of the InvoicePlane application is available: v1.4.3
You can download the latest version from the InvoicePlane website .
Update Guide | Changelog
This version includes 2 fixes. One for invalid values when saving quotes or invoices and one that shows if a password is entered in the settings.
1 Like
yeu
June 21, 2015, 3:09pm
2
Thank you a lot!
There is the problem about the discount, it should be calculated before than tax… I tried to fix this, but I’m noob and my code is broken.
Do you think it’s possible to resolve this issue? Is it too hard to do it?
Kovah
June 21, 2015, 3:13pm
3
You can change the order of the calculations here: https://github.com/InvoicePlane/InvoicePlane/blob/master/application/modules/invoices/models/mdl_invoice_amounts.php#L58
for example:
$invoice_subtotal = $this->calculate_discount($invoice_id, $invoice_subtotal);
$invoice_total = $invoice_item_subtotal + $invoice_amounts->invoice_item_tax_total;
1 Like
yeu
June 21, 2015, 3:43pm
4
I tried in mdl_quote_amounts.php , but nothing. I tried to edit the public funcions of tax and discount and to change them order… is it the correct way?
Kovah
June 21, 2015, 3:50pm
6
No, just take a look at the linked file and take a look at the example. Two lines were swapped.
1 Like
yeu
June 21, 2015, 3:53pm
7
Great! I’ll try. Many many thanks!
yeu
June 21, 2015, 10:16pm
8
Nothing.
I tried with your code and with this code (I had already made ​​these changes, I thought I had made ​​mistakes, but they were correct in “quote”):
$quote_item_subtotal = $quote_amounts->quote_item_subtotal - $quote_amounts->quote_item_discount;
$quote_subtotal = $this->calculate_discount($quote_id, $quote_item_subtotal);
$quote_total = $quote_subtotal + $quote_amounts->quote_item_tax_total;
What’s wrong?
yeu
June 22, 2015, 8:14am
9
Hello,
I think that the issue is in
public function calculate_quote_taxes
because it calculate amount without the total discount and in
public function calculate_discount
because it is calculated after “taxes function” with the total item + taxes and not only with the total item.
It’s correct, ins’t it?
Kovah
June 22, 2015, 8:26am
10
You would have to change the order in both functions.
yeu
June 22, 2015, 10:16am
11
I tried to do this, but I’m not an expert and it doesn’t work…
yeu
June 22, 2015, 1:12pm
12
Confirm, I tried again and again and again, but I’m not able to fix this problem.
Sorry but I can’t continue.
Felix
June 25, 2015, 9:41pm
14
Unfortunately the release does not include Pitma’s correction for invoice archive, discussed at:
https://community2.invoiceplane.com/t/solved-invoice-in-archive-is-empty-zero-bytes/1056
Kovah
June 26, 2015, 5:21am
15
Yes, sorry. That’s why I always create a bug report for issues instead of just fixing it…
Will be available in 1.4.4
https://development.invoiceplane.com/browse/IP-308
Kovah
Split this topic
January 5, 2016, 3:05pm
16
2 posts were split to a new topic: Wrong calculation order