Page 1 of 1

custom report - calculating an additional value

Posted: Wed Oct 09, 2019 9:11 pm
by burley
I have a custom report to which I want to add an additional value. The value needs to be calculated, which (as it is php) should be pretty easy. But for some reason the value is not calculated when the report is generated. Below is the original code from the reports controller file and the modified code.

What am I doing wrong?

Original code

Code: Select all

$net_sales = $agent_order['total'] - ($agent_order['shipping'] + $agent_order['tax'] + $agent_order['other_fees'] + -$agent_order['coupon']);
Modified code

Code: Select all

$net_sales = ($agent_order['total'] - ($agent_order['shipping'] + $agent_order['tax'] + $agent_order['other_fees'] + -$agent_order['coupon'])) * $commission;
$commission is set to the value of 0.15

Re: custom report - calculating an additional value

Posted: Tue Oct 22, 2019 11:05 pm
by burley
No body has any clue?

Re: custom report - calculating an additional value

Posted: Wed Oct 23, 2019 2:38 pm
by grgr
The code is correct.

You won't get any further answer I don't suppose at it is not opencart code.

You probably have a zero in there somewhere, who knows. Print out the variables to check.

Re: custom report - calculating an additional value

Posted: Wed Oct 23, 2019 5:29 pm
by burley
Thank you for your reply!

Well I set the $commission variable to 0.15, so perhaps that is the issue.