Invert shipping rate position with VAT field
I assume that you know how to create a module and what a hook is, you can use hook_commerce_price_component_type_info_alter like this:

&lt;?php
function mymodule_checkout_commerce_price_formatted_components_alter(&amp;$components, $price, $entity) {
  if (isset($components['commerce_price_formatted_amount']['weight'])){

    // Get the row weight of total sum.
    $last_weight = $components['commerce_price_formatted_amount']['weight'];

    // Increase the row weight of the total row, so we can place the vat directly before.        
    $last_weight = $last_weight + 100;
    $components['commerce_price_formatted_amount']['weight'] = $last_weight;
  }

  if (is_array($components) &amp;&amp; count($components)&gt;0){
    foreach ($components as $name =&gt; &amp;$component){

      // Set the weight of the VAT row to the last position before the total sum.
      if (substr($name, 0, 3) == 'vat'){
        $component['weight'] = ($last_weight-1);
      }          
    }
  }

  return;
}