Answers.Body: <p>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.</p>
  
  <pre><code>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-&gt;enabled[$fid]) || $this-&gt;getData($fid) &gt; 0) {
  -      $this-&gt;line_items[] = array(
  -        'qty' =&gt; 1,
  -        'unit_price' =&gt; $this-&gt;getData($fid),
  +      $params = [
           'financial_type_id' =&gt; $this-&gt;contribution_page['financial_type_id'],
  +        'total_amount' =&gt; $this-&gt;getData($fid),
  +      ];
  +      CRM_Price_BAO_LineItem::getLineItemArray($params, NULL, 'contribution');
  +      $lineItem = reset(reset($params['line_item']));
  +      $this-&gt;line_items[] = array_merge($lineItem, [
           'label' =&gt; wf_crm_aval($this-&gt;node-&gt;webform['components'], $this-&gt;enabled[$fid] . ':name', t('Contribution')),
           'element' =&gt; 'civicrm_1_contribution_1',
           'entity_table' =&gt; 'civicrm_contribution',
  -      );
  +      ]);
       }
       // LineItems
       $fid = "civicrm_1_lineitem_1_contribution_line_total";
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T08:33:44.633Z
Answers.Text: Thanks for this - Where do i post this patch?
Answers.UserDisplayName: Moe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T08:43:37.287Z
Answers.Text: Did the patch work for you?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T08:45:11.580Z
Answers.Text: I am not sure how to apply the patch, so want to figure that out first. Sorry :(
Answers.UserDisplayName: Moe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T08:47:37.890Z
Answers.Text: The patch should be on 7.x - 5.0 version of the module... But it should also work for version greater than 7.x-24... you can either apply it manually or use command
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T08:48:21.863Z
Answers.Text: You need to apply the patch for webform CiviCRM module
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T09:01:44.603Z
Answers.Text: Any Guides that teaches me how to do this?
Answers.UserDisplayName: Moe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T09:16:21.753Z
Answers.Text: ParseError: syntax error, unexpected ';', expecting ')' in module_load_include() (line 1524 of
Answers.UserDisplayName: Moe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-12T09:39:52.973Z
Answers.Text: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/104352/discussion-between-moe-and-pradeep-nayak).
Answers.UserDisplayName: Moe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-11T22:50:00.550Z
Answers.LastActivityDate: 2020-02-11T22:50:00.550Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I have setup a webform using the Civi/Drupal webform module, which allows people to submit payments they intend to make and keep it as Pending before they make it.</p>
  
  <p>What is happening is the contribution goes in as Pending but when you change the amount and go to record a payment the amount stays as the original amount. This is because a payment was recorded.</p>
  
  <p>How do i stop contribution page from recording a payment and i just want the contribution to be Pending in CiviCRM Contribution Page on that users account.</p>
  
  <p>Thanks</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-11T20:34:33.497Z
Comments.Text: drupal 7? would that be?
Comments.UserDisplayName: petednz - fuzion
Tags: <drupal><contribution-page><payment>
Title: Contribution Page Creates Payment
ThreadText: # Contribution Page Creates Payment
  
  (Asked by: username_0 on 2020-02-11)
  
  I have setup a webform using the Civi/Drupal webform module, which allows people to submit payments they intend to make and keep it as Pending before they make it.
  
  What is happening is the contribution goes in as Pending but when you change the amount and go to record a payment the amount stays as the original amount. This is because a payment was recorded.
  
  How do i stop contribution page from recording a payment and i just want the contribution to be Pending in CiviCRM Contribution Page on that users account.
  
  Thanks
  
  **Tags:** drupal, contribution-page, payment
  
  > **Comments:**
  > **username_1**: drupal 7? would that be?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-02-11. Score: 1 | Accepted answer
  
  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";
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks for this - Where do i post this patch?  
  > **username_2**: Did the patch work for you?  
  > **username_0**: I am not sure how to apply the patch, so want to figure that out first. Sorry :(  
  > **username_2**: The patch should be on 7.x - 5.0 version of the module... But it should also work for version greater than 7.x-24... you can either apply it manually or use command  
  > **username_2**: You need to apply the patch for webform CiviCRM module  
  > **username_0**: Any Guides that teaches me how to do this?  
  > **username_0**: ParseError: syntax error, unexpected ';', expecting ')' in module_load_include() (line 1524 of  
  > **username_0**: Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/104352/discussion-between-moe-and-username_2).  
  
  ---
  
  