Author Topic: 3.2B3 - Receipt.html  (Read 2703 times)

RichieD

  • Newbie
  • *
  • Posts: 33
    • View Profile
3.2B3 - Receipt.html
« on: February 21, 2013, 12:38:12 PM »
Hi Corey,

Just been trying receipts and came up with an oddity.

If I edit the receipt.html in the \users\xxx\documents\the tournament director 2\data\templates which I believe is set by default as the receipt file to use for the tournament (Receipts template in the preferences is set as "<datastore>\templates\receipt.html"), then every time I produce a receipt as a result of a print receipt action, the receipt file I have edited gets overwritten with the default receipt.html file from the install folder... ???

If I change the filename of my receipt file and reference it in the receipts preferences, then it works fine...

Have I missed something?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5429
    • View Profile
Re: 3.2B3 - Receipt.html
« Reply #1 on: February 21, 2013, 05:32:57 PM »
Quote
then every time I produce a receipt as a result of a print receipt action, the receipt file I have edited gets overwritten with the default receipt.html file from the install folder...

That WOULD be a problem.  The only time it should even potentially be overwritten is each time the application starts up.  Because included templates, etc, are installed in the "Program Files" area, they have to be copied out to the Data Store.  Each time the app starts up, it copies those files to the current Data Store if necessary.  It uses file time stamps to determine if it is necessary.  If you've modified the receipt template in your Data Store, then it should have a newer time stamp than the receipt template in the install folder, and thus should not copy over it.

It should definitely not be writing anything during receipt creation.  I'll look into this.

RichieD

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: 3.2B3 - Receipt.html
« Reply #2 on: February 21, 2013, 06:32:23 PM »
Ok, thanks for the explanation.. this could be a gotcha for people who have been using previous versions of TD.

I sensibly made a backup of my current datastore...

I installed the beta version of TD and then copied my existing receipt.html from my backup datastore into the new data store - this does not put a new timestamp onto the file (retains original creation date/time) and therefore gets zapped everytime TD starts up (as it has an older date stamp!).

If I edit the receipt.html file and re-save, it gets a new timestamp (newer than the TD install) and everything is OK.

Keep up the good work  :)

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5429
    • View Profile
Re: 3.2B3 - Receipt.html
« Reply #3 on: February 22, 2013, 11:18:15 AM »
Quote
Ok, thanks for the explanation.. this could be a gotcha for people who have been using previous versions of TD.

It can be a gotcha for anyone using version 2.5.6 or later, since that's when Data Stores were added.  That's why the documentation recommends (a) creating backups, and (b) copying any included files to a new file and making modifications to that new file.  That way it won't get written over by the software.

RichieD

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: 3.2B3 - Receipt.html
« Reply #4 on: February 23, 2013, 10:45:19 AM »
Hi Corey,

Any chance you can add the "description" and possibly the "league" and "season" tokens to the receipt handling.. ?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 5429
    • View Profile
Re: 3.2B3 - Receipt.html
« Reply #5 on: February 23, 2013, 02:49:04 PM »
They're already in there.  For the next beta at least.

From the user manual (these are the "Common" export items, available to all exports including receipts):

timestamp: The current time and date.  This item will always contain both the time and the date.
preftimestamp: The current time and date.  This item may only contain the time, if the Show dates preference is disabled.
time: The current time.
date: The current date.
eventtimestamp: The time and date the tournament started.
eventpreftimestamp: The time and date the tournament started.  This item may only contain the time, if the Show dates preference is disabled.
eventtime: The time the tournament started.
eventdate: The date the tournament started.
eventname: The tournament name.
description: The tournament description.
notes: The notes for the tournament.
league: The tournament’s league.
season: The tournament’s season.
buyininfo: A description of the buy-in amount.  For example, “$50 Buy-in”.
rebuyinfo: A description of the rebuy amount.  For example, “$100 to Rebuy, through round 3”, or “No Rebuys”.
addoninfo: A description of the add-on amount.  For example, “$50 to Add-on, through round 3”, or “No Add-ons”.
rebuys: The number of rebuys purchased during the tournament.
addons: The number of add-ons purchased during the tournament.
startingchipstack: The number of chips each player receives in the default buy-in profile.
players: The number of players who participated in the tournament.
pot: The total value of the prize pool.
payouts: The number of prizes awarded to specific ranks.
starttime: The time the tournament started in the format specified on the Preferences Tab.
endtime: The time the tournament ended in the format specified on the Preferences Tab.
elapsedtime: The amount of time that has elapsed since the tournament started.
playingtime: The amount of actual play time that has elapsed since the tournament started.  Note that this sums the time for each round up to the current point in the tournament.  If you change the schedule, set or reset the clock, or skip levels during a tournament, this value will not necessarily be accurate.
history: The tournament history (see Tournament History).
actionsummary: A concise summary of the actions that have occurred in the tournament (see Action Summary).
gamename: The Game Name of the first round of the tournament.
gametype: The Game Type of the first round of the tournament.
charset: The content type that the export token values are determined to be.

Additional items for receipts:

receiptnumber: The receipt number.
salesperson: The sales person.
name: The name of the player, formatted as specified by the Name Format preference.
nickname: The Nickname field of the player.
firstname: The First name field of the player.
lastname: The Last name field of the player.
streetaddress: The Street address field of the player.
city: The City field of the player.
state: The State field of the player.
zipcode: The Zipcode field of the player.
country: The Country field of the player.
phone1: The Phone1 field of the player.
phone2: The Phone2 field of the player.
email1: The Email1 field of the player.
email2: The Email2 field of the player.
notes: The Notes field of the player.
id: The ID field of the player.
profilename: The name of profile (Buy-in, Add-on, or Rebuy) that was used when the transaction was made.
tablename: For buy-in receipts, if the player is already seated (in the case that your settings allow the seating of players who have not yet bought-in to the tournament, or you utilize the Auto Seat option), this will represent the name of the table at which the player is seated.
seatnumber: The seat number at which the player is seated.  See previous token tablename.
seat: The table name and seat number at which the player is seated.  Essentially, this is a combination of tablename and seatnumber.
itemN: The label for an item on the receipt.  Each item listed on the receipt will have a corresponding itemN token.  For example, a buy-in receipt with no other fees will include an item0.  A buy-in receipt that also contains a bounty chip fee will include an item0 and an item1.
amountN: The amount for an item on the receipt.  For each itemN on the receipt there will be a corresponding amountN.
rakeN: The label for one or more rake values on the receipt.
rakeamountN: The amount for a rake on the receipt.  For each rakeN on the receipt there will be a corresponding rakeamountN.
total: The total, or sum, of the receipt.