We need the ability to see how a code was used, by whom, time/date, etc. In addition, when a person is removed from an event or membership, the code count should reflect that change.

Comments

dharmatech’s picture

Can't fully implement this feature until CRM-7490 is resolved.

dharmatech’s picture

Status: Active » Fixed

Fixed in latest -dev release. You may need to wait 24 hours for the next release.

Implemented basic tracking and reporting functionality:

  • A "Discount Log" tab on the contact record displays a record of code usage for that contact.
  • In the discount code summary screen, the number of uses links to a usage summary screen for that code.
  • * If a contact is deleted from a membership or event, the code usage count is decremented appropriately.

* If you're using CiviCRM 3.3.3 or older, you must patch according to CRM-7490. CiviCRM 3.3.4 and 3.4 already have the patches applied.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

kathc’s picture

I get the following when I try to display a discount code usage (if I go to the user's record, I can see the code used properly, but I can't get a list of people who've registered with a code). I'm using CiviCRM 3.3.5, with the latest version of this module.

Sorry. A non-recoverable error has occurred.
DB Error: no such field
Error Details
Additional Details:

Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)

[code] => -19
[message] => DB Error: no such field
[mode] => 16
[debug_info] => SELECT id, display_name FROM civicrm_contact [nativecode=1054 ** Unknown column 'display_name' in 'field list']
[type] => DB_Error
[user_info] => SELECT id, display_name FROM civicrm_contact [nativecode=1054 ** Unknown column 'display_name' in 'field list']
[to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT id, display_name FROM civicrm_contact [nativecode=1054 ** Unknown column 'display_name' in 'field list']"]
)

Return to home page.

dharmatech’s picture

Fixed in latest -dev release. You may need to wait 24 hours for the next release.

kathc’s picture

I have a new result (still clicking on the redeemed number link):

Sorry. A non-recoverable error has occurred.
DB Error: syntax error
Error Details
Additional Details:

Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)

[code] => -2
[message] => DB Error: syntax error
[mode] => 16
[debug_info] => SELECT id, display_name_en_USfr_CAes_ESfr_FR AS name FROM civicrm_contact [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fr_CAes_ESfr_FR AS name FROM civicrm_contact' at line 1]
[type] => DB_Error
[user_info] => SELECT id, display_name_en_USfr_CAes_ESfr_FR AS name FROM civicrm_contact [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fr_CAes_ESfr_FR AS name FROM civicrm_contact' at line 1]
[to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT id, display_name_en_USfr_CAes_ESfr_FR AS name FROM civicrm_contact [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fr_CAes_ESfr_FR AS name FROM civicrm_contact' at line 1]"]
)

And now when I try to edit a code:

Sorry. A non-recoverable error has occurred.
DB Error: syntax error
Error Details
Additional Details:

Array
(
[callback] => Array
(
[0] => CRM_Core_Error
[1] => handle
)

[code] => -2
[message] => DB Error: syntax error
[mode] => 16
[debug_info] => SELECT id, display_name_en_USfr_CAes_ESfr_FR AS name FROM civicrm_contact_en_US WHERE contact_type = 'Organization' AND is_deleted = 0 ORDER BY sort_name_en_USfr_CAes_ESfr_FR [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fr_CAes_ESfr_FR AS name FROM civicrm_contact_en_US WHERE contact_type = 'Orga' at line 1]
[type] => DB_Error
[user_info] => SELECT id, display_name_en_USfr_CAes_ESfr_FR AS name FROM civicrm_contact_en_US WHERE contact_type = 'Organization' AND is_deleted = 0 ORDER BY sort_name_en_USfr_CAes_ESfr_FR [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fr_CAes_ESfr_FR AS name FROM civicrm_contact_en_US WHERE contact_type = 'Orga' at line 1]
[to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="SELECT id, display_name_en_USfr_CAes_ESfr_FR AS name FROM civicrm_contact_en_US WHERE contact_type = 'Organization' AND is_deleted = 0 ORDER BY sort_name_en_USfr_CAes_ESfr_FR [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'fr_CAes_ESfr_FR AS name FROM civicrm_contact_en_US WHERE contact_type = 'Orga' at line 1]"]
)

I'll be reverting to the last version for now because we need to be able to use codes, even if we can't quite see where they've gone.

dharmatech’s picture

kathc,

Sorry about that, multi-lang was poorly tested. Fixed in latest -dev release. You may need to wait 24 hours for the next release.

kathc’s picture

It's working beautifully now. Thank you!