Yes, its a bug in civicrm webform module as it doesn't record line item correctly. The price field value and price field id are missing. I have a patch(for 7.x-5.0) that works for contribution amount field but not for line item field in webform. If you are using contribution amount than you can give it a try.
diff --git a/includes/wf_crm_webform_postprocess.inc b/includes/wf_crm_webform_postprocess.inc
index ea9dc8f..5a78d2e 100644
--- a/includes/wf_crm_webform_postprocess.inc
+++ b/includes/wf_crm_webform_postprocess.inc
@@ -1552,14 +1552,17 @@ class wf_crm_webform_postprocess extends wf_crm_webform_base {
// Contribution
$fid = 'civicrm_1_contribution_1_contribution_total_amount';
if (isset($this->enabled[$fid]) || $this->getData($fid) > 0) {
- $this->line_items[] = array(
- 'qty' => 1,
- 'unit_price' => $this->getData($fid),
+ $params = [
'financial_type_id' => $this->contribution_page['financial_type_id'],
+ 'total_amount' => $this->getData($fid),
+ ];
+ CRM_Price_BAO_LineItem::getLineItemArray($params, NULL, 'contribution');
+ $lineItem = reset(reset($params['line_item']));
+ $this->line_items[] = array_merge($lineItem, [
'label' => wf_crm_aval($this->node->webform['components'], $this->enabled[$fid] . ':name', t('Contribution')),
'element' => 'civicrm_1_contribution_1',
'entity_table' => 'civicrm_contribution',
- );
+ ]);
}
// LineItems
$fid = "civicrm_1_lineitem_1_contribution_line_total";