<p>I just updated the Charge 2 plugin to latest (version 2.2.1) and when I try to create a new coupon, I get this error: </p>

<pre><code>CDbException
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General
error: 1366 Incorrect integer value: '' for column 'amountOff' at row 1. 
</code></pre>

<p>I've tried various scenarios; entering a fixed amount for the coupon, a percentage amount as well as trying various payment types, and it gives the same error above, regardless of whether I choose a fixed or percentage amount. </p>

<p>Has anyone else ran into this issue and if so, have you figured out a solution for it?</p>

<p>I also tried reverting back to previous versions of the plugin, and I get the same error. That last version that worked with coupons was Charge 2.1.8. </p>

<p>I'm running Craft 2.6.2997, PHP 7.1, MySQL 5.7.2. </p>

CC BY-SA 3.0
2017-11-29T05:29:10.623Z
I'm not sure if this is the correct place to ask this question since it seems to be a plugin related bug. Unless you want to try to fix it in the code by yourself you should rather contact the developer. I could be totally wrong but my guess is: the value is not populated correctly or gets lost during the process. You could check the code step by step.
Robin Schambach
CC BY-SA 3.0
2017-12-01T01:48:14.923Z
Thank you for the feedback. There are some posts with tags 'plugin' and 'plugin-charge' that have some helpful answers, so I was hoping for similar results. [link](https://craftcms.stackexchange.com/questions/tagged/plugin-charge) 
I contacted the developer regarding this & other issues but have yet to hear back. Not sure if it's still being actively developed, unfortunately. Also tried stepping through the plugin code & db to try to make sense but no luck yet. I will keep trying. In the meantime, hoping perhaps someone else out there has encountered this as well & has a solution.
Resident Agency
<plugins><error-message><mysql><plugin-charge>
Creating coupon using Charge 2 plugin
# Creating coupon using Charge 2 plugin

(Asked by: username_0 on 2017-11-29)

I just updated the Charge 2 plugin to latest (version 2.2.1) and when I try to create a new coupon, I get this error: 
CDbException
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General
error: 1366 Incorrect integer value: '' for column 'amountOff' at row 1. 

I've tried various scenarios; entering a fixed amount for the coupon, a percentage amount as well as trying various payment types, and it gives the same error above, regardless of whether I choose a fixed or percentage amount. 
Has anyone else ran into this issue and if so, have you figured out a solution for it?
I also tried reverting back to previous versions of the plugin, and I get the same error. That last version that worked with coupons was Charge 2.1.8. 
I'm running Craft 2.6.2997, PHP 7.1, MySQL 5.7.2.

**Tags:** plugins, error-message, mysql, plugin-charge
> **Comments:**
> **username_1**: I'm not sure if this is the correct place to ask this question since it seems to be a plugin related bug. Unless you want to try to fix it in the code by yourself you should rather contact the developer. I could be totally wrong but my guess is: the value is not populated correctly or gets lost during the process. You could check the code step by step.  
> **username_0**: Thank you for the feedback. There are some posts with tags 'plugin' and 'plugin-charge' that have some helpful answers, so I was hoping for similar results. [link](https://craftcms.stackexchange.com/questions/tagged/plugin-charge)  I contacted the developer regarding this & other issues but have yet to hear back. Not sure if it's still being actively developed, unfortunately. Also tried stepping through the plugin code & db to try to make sense but no luck yet. I will keep trying. In the meantime, hoping perhaps someone else out there has encountered this as well & has a solution.  

---

## 0 answers

