I have added a custom coupon to print when a transaction hits a certain price value. The problem I am having, is I can see the coupon in the journal Viewer, but I'm not sure where to find it in the sql database. I am trying to set up a trigger, but I need to know where in the database the coupon is. Any ideas?
Tommy, The receipts are stored inside of the Journal table in the ReceiptCompressed column. The only problem is that this data is compressed/encrypted by RMS when it is saved, then saved to an array of bytes. There is a way to use one of RMS's .dll files to decompress/decrypt this information into an array of bytes that can be changed to a string, but it has been a long time since I have done this.
I edited the receipt to print a coupon when the ransaction hits a $50 sale increment. I will be changing it, so that it will print based on the the coupon level from the customer database. But I need to find out where this coupon is in the daabase.
I can send you a copy of what I have if you interested.
what coupon are you trying to find? The one that you are creating in the receipt? That is only stored as an image and it is in the Journal table. This is not reusable data - all you can do is retrieve itusing journal viewer and print it from there. You could regenerate a report from the detailed sales report using the same criteria you set in the receipt...
Is there a way to set a trigger or somthing in the xml receipt so it will post to a sql field? Or can I set a trigger in SQL to happen if this receipt is printed?
You would have to look at the transaction and re-evaluate the criteria to determine which transactions would have the coupon. You may be able do that in a report by setting the filters. You may need to do something like a view to simplify the report though - it depends on the criteria.
There is no way to access the contents of the receipt; you have to go back to the transaction data to determine where the receipt *should have* printed your coupon.
You could have an add-in that controls the printing of the coupon rather than doing it within the receipt. In that case, you could write anything you want to the database at the same time. That would be a lot more programming - if the conditions are simple enough that you were able to implement them in a receipt then they should be easily translated into report filters as well.
Glenn Adams Tiber Creek C> Is there a way to set a trigger or somthing in the xml receipt so it will
BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.