Wrong calculate for vendor Payouts?

Hi,

My setting for my Vendors is follow



Include shipping cost in vendors commission: NO



Take payment surcharge from vendors: NO = I take the payment surcharge from the customer





For example the vendor commision is 6%



----

the Order Cost:

[list]

[]Subtotal: CHF 78.00

[
]Shipping cost: CHF 6.50

[]Taxes: CHF 5.78

[
]Payment surcharge: CHF 2.54

[*]Total: CHF 87.04

[/list]

If i calculate the charge Vendor payout i will get.

78.00 - 6% + 6.50 = 79.82 (this is the payout i must give the vendor)



But the system calculate 82.21



can anyone say how the calculate is created?

Contain 82.21 the payment surchage ?

the payment surchage is e part of my cost and not for the vendor.



Thanks for help :)

I found where the calculate is create for de payout.

I hope is the right way, if not i would be happy if someone correct me.





In fn.mve.funktions.php



if ($company_data['commission_type'] == 'P') {
//Calculate commission amount and check if we need to include shipping cost
$commission_amount = (($order_info['total'] - $order_info['payment_surcharge'] - (Registry::get('settings.Suppliers.include_shipping') == 'N' ? $order_info['shipping_cost'] : 0)) * $company_data['commission'])/100;
} else {
$commission_amount = $company_data['commission'];
}
//Check if we need to take payment surcharge from vendor
if (Registry::get('settings.Suppliers.include_payment_surcharge') == 'N' || Registry::get('settings.Suppliers.include_payment_surcharge') == 'Y') {
$commission_amount += $order_info['payment_surcharge'];




this give me the right calculate for vendor payout. if payment surcharge is pay by customer.

Without this code, the commission is credited to the vendor in order total.



Thank you