• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

[email protected]
#1 Posted : Monday, May 11, 2009 4:42:44 PM(UTC)
gdelorey@mitcs.com

Rank: Member

Joined: 10/11/2006(UTC)
Posts: 162

Thanks: 1 times
Hi -

I had a client who decided to manually created their own gift certificates (hard copies) for an event and gave out about 40 of them to be used on their web site. Since BV creates it's own numbers, or codes, I'm wondering if it is possible to manually modify the gift certificate codes in the dbo.bvc_GiftCertificate table to match their numbers. The way I see it, I might have to do the following:

1. Create certificate product (say $25.00) in the products area
2. Purchase the gift certificate product to get a redeemable certificate created in the DB
3. Manually change the CertificateCode in the database table
4. Repeat 39 times :(

It looks like it wouldn't be hard to manually create redeemable GC's in the table, however, they all have unique BVIN's and LineItemID's so I don't know how to go about doing it that way. Huge PITA...

Thanks for any help!

: Greg
Aaron
#2 Posted : Wednesday, October 1, 2014 3:03:18 PM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,381
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Here's a SQL script that we wrote to generate gift certificates without a corresponding gift certificate product OR order. In other words, you can use this to arbitrarily generate gift certificates of any amount; just set the @amount variable at the top of the script. This script generates a certificate code like this:

GIFT100-2749699242

Here's the script:

Code:
DECLARE @amount DECIMAL
SET @amount = 100.00

INSERT INTO bvc_GiftCertificate(bvin, LineItemId, CertificateCode, DateIssued, OriginalAmount, CurrentAmount, AssociatedProductId, LastUpdated)
VALUES(LOWER(NEWID()), '', 'GIFT' + CAST(@amount AS VARCHAR) + '-' + CAST(CAST(ROUND(RAND((DATEPART(mm, GETDATE()) * 100000 )+ (DATEPART(ss, GETDATE()) * 1000 )+ DATEPART(ms, GETDATE()) ) * 10000000000,0,1) AS bigint) AS NVARCHAR), GETDATE(), @amount, @amount, '', GETDATE())

SELECT top 1 *
FROM bvc_GiftCertificate
ORDER BY DateIssued desc
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012