Purchase Invoice Question

I am Tring to add two type of expenses in Purchase invoice
1- Charge expenses affect supplier
2-local expenses affect local Customs clearance supplier

i found in the purchase invoice that i can add Taxes and Charges in the invoice as i understand it will affect supplier , i want to add expenses into purchase invoice but affect to another account like ( expenses,customes clearance supplier ) somethinglike that
i found that in other systems by the way its name was infinity

i have another problem that i want to make system count sales commission not on the invoice but by the received amounts , i mean by the recevied from customer , can erpnext count commission by received ??