In a Drupal 7 site we are using webform_civicrm for paid event registrations. The webform creates the contribution with the participant fee (civicrm_participant line item) as well as other additional (civicrm_contribution) line items. All is well until one goes to the edit form of the contribution and saves, this recalculates the total amount and tax amount and only includes the first line item (participant fee). Occasionally other line items have been manually added to the contribution with the line item edit extension and those are also civicrm_participant line items, but also ignored.
I did some digging in the civi core code. In the contribution edit submit function it looks as if only civicrm_participant line items are fetched if the contribution is recognised as a participant contribution. And while all the participant line items are added to the $params array, if the price set is quick config it seems deliberate that only the first one is used for the total amount and tax amount. All of our webform_civicrm generated line items fall under the reserved quick config price set 1.
I ended up using some code to check and correct total_amount, tax_amount and net_amount in a hook_civicrm_pre implementation, but I would love it if someone could shed some light on where the fault lies here.