This processing, too, will require change (at a minimum) to the referrer_main page's header_php.php, possibly its template (tpl_referrer_main_default.php) and the admin-level page. You might also need to add some type of flag to the 'commissions' table to identify a commission's status.
Thank you.
I've been playing with the mod a bit, and figured out a way to display the unpaid commissions by adding a 0.0000001 as the commission paid therefore releasing these amounts in the summary from current sales and unpaid commissions. I'm sure this isn't ideal and will eventually backfire on me at some point but at least for now it does what I need.
I made some (I'm sure horrendous) changes to the header_php.php and the admin level page to calculate and discount the payment fees. Paypal and Square which are the only two payment modules we use, have the same charges so that was sort of easy. But as horrendous as they might be, they work.
On includes/modules/pages/referrer_main/header_php.php at around line 124 in added
PHP Code:
//bof discount payment fee 1 of 2
$fee = ((($orders->fields['order_total']) - $current_exclusion) * 2.9)/100 + .3;
$finalAmount = round($fee , 2);
//eof discount payment fee 1 of 2
and changed this
PHP Code:
$current_amount = floatval($orders->fields['order_total']) - $current_exclusion;
for this
PHP Code:
//bof discount payment fee 2 of 2
//$current_amount = floatval($orders->fields['order_total']) - $current_exclusion;
$current_amount = floatval($orders->fields['order_total']) - $current_exclusion - $finalAmount;
//eof discount payment fee 2 of 2
I don't know if it's the correct way, but it works. It displays the correct final amount for the order with the payment fees deducted providing the right amount for the commission we need to pay.
On admin/referrers.php I added at around line 910 a similar piece of code
PHP Code:
//bof discount payment fee 1 of 2
$fee = (($order['order_total'] - $order['value']) * 2.9)/100 + .3;
$finalAmount = round($fee , 2);
//eof discount payment fee 1 of 2
and replaced this line
PHP Code:
$commissionable_total = $order['order_total'] - $order['value'];
with this
PHP Code:
//bof discount payment fee 2 of 2
//$commissionable_total = $order['order_total'] - $order['value'];
$commissionable_total = $order['order_total'] - $order['value'] - $finalAmount;
//eof discount payment fee 2 of 2
This one works in terms of calculating the correct amount for the order and the commission that needs to be paid. However I haven't been able to figure out how to display the same one this line
PHP Code:
<td class="center history<?php echo $toggle; ?>"><?php echo $currencies->format( ($current_orders_status === $orders_status) ? $total : 0 ); /*v2.5.0c*/ ?></td>
I'm not a programmer so if you could give me some pointers I would appreciate it. =)
Bookmarks