Author Topic: Rake details on Receipt  (Read 2896 times)

Rassal

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Rassal's Casino & Games
Rake details on Receipt
« on: February 16, 2013, 05:24:25 PM »
Hi,

Been using the software for a while now, and i love it.

For our next season, i am introducing the receipts so people can know which table and seat they are assigned to.

We also use bounty... but i would like to add the details of the buy-in, which would explain the rakes on the receipt...

Now on the receipt, the only 2 amount i see, are the buy-in amount and the bounty chip amount...

I am using the latest Beta and lots have been done to the receipt... wish there was some more added ;-)

Is there any way i can detail the rakes in the buy-in, because we have like 5 different rakes on there i would like to explain...

Thanks

Here's what i have now:

LOGO HERE
16/02/2013 - 18:18:03
Receipt #1

Sattelite Tournament #12

Table : 1
Seat : 1

Buy-in             $28.00
Bounty chip       $2.00

                     =====
Total              $30.00


What i would like to have:

LOGO HERE
16/02/2013 - 18:18:03
Receipt #1

Sattelite Tournament #12

Table : 1
Seat : 1

Buy-in              $23.00
  Rake 1             $1.00
  Rake 2             $1.00
  Rake 3             $1.00
  Rake 4             $1.00
  Rake 5             $1.00
Bounty chip       $2.00

                     =====
Total               $30.00
« Last Edit: February 16, 2013, 09:36:46 PM by Rassal »

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Rake details on Receipt
« Reply #1 on: February 18, 2013, 01:20:03 PM »
It's there.  Hard to believe it wasn't there before (and no one's ever asked, to my knowledge), but I added the rake information in the first beta of 3.2.  They can be utilized in the receipt as <rakeN> and <rakeamountN>, where <N> is the rake number, starting at 0.  So, if you have 3 rakes defined, the tokens <rake0>, <rakeamount0>, <rake1>, <rakeamount1>, <rake2>, and <rakeamount2>.

Rassal

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Rassal's Casino & Games
Re: Rake details on Receipt
« Reply #2 on: February 18, 2013, 03:44:54 PM »
Thanks...

Works like a charm!

Rassal

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Rassal's Casino & Games
Re: Rake details on Receipt
« Reply #3 on: February 18, 2013, 07:11:09 PM »
Or almost like a charm....

I added my rakes as i should, and they print on the receipt...

But when the value is 0, why is it printing?

Is there an option somewhere, when a rake is at 0 to not print on the receipt?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Rake details on Receipt
« Reply #4 on: February 19, 2013, 10:43:06 AM »
All rakes are passed to the exported file, regardless of value.  The converse could also be true if it didn't pass $0 values, right?  Someone might want to always print a rake, even if it is $0.

I'll have to add an option for this.  But I think there's a workaround you can apply to your receipts template.  Here's the Receipt.html template that I modified that appears to work for me (additions in bold/blue):


<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=<charset>" />
    <title>Receipt</title>
  </head>

  <style type="text/css">

    BODY, TD
    {
      background-color: #ffffff;
      color: #000000;
      font-family: Courier New;
      font-size: 10pt;
    }

  </style>

  <script>
var mRakes = [
  "<rakeamount0>",
  "<rakeamount1>",
  "<rakeamount2>",
  "<rakeamount3>",
  "<rakeamount4>"
];

function trimMoney(inAmount)
{
  return inAmount.replace(/[^\d]*/, "") * 1;
}

function hideZeroRakes()
{
  for(var i=0; i < mRakes.length; i++)
  {
    var theRow = document.getElementById("rakeRow" + i);

    if(theRow)
      theRow.style.display = trimMoney(mRakes[ i]) > 0 ? "" : "none";
  }
}

  </script>

  <body onload="hideZeroRakes()" onbeforeprint="hideZeroRakes()">

    <table border="0">
      <tr>
        <td>

          <table border="0" width="100%">
            <tr>
              <td align="center" style="font-size: 36pt"><nobr>Your Logo</nobr></td>
            </tr>
            <tr>
              <td align="center"><nobr><date> <time></nobr></td>
            </tr>
            <tr>
              <td align="center"><nobr>Receipt #<receiptnumber></nobr></td>
            </tr>
            <tr>
              <td align="center"><nobr>Salesperson: <salesperson></nobr></td>
            </tr>
            <tr>
              <td><div style="height: 16px"></td>
            </tr>
            <tr>
              <td align="center"><nobr><eventname></nobr></td>
            </tr>
            <tr>
              <td><div style="height: 16px"></div></td>
            </tr>
          </table>

          <table border="0" width="100%">
            <tr>
              <td align="left"><nobr><item0></nobr></td>
              <td align="right"><nobr><amount0><nobr></td>
            </tr>
            <tr>
              <td align="left"><nobr><item1></nobr></td>
              <td align="right"><nobr><amount1><nobr></td>
            </tr>
            <tr>
              <td align="left"><nobr><item2></nobr></td>
              <td align="right"><nobr><amount2><nobr></td>
            </tr>
            <tr>
              <td align="left"><nobr><item3></nobr></td>
              <td align="right"><nobr><amount3><nobr></td>
            </tr>
            <tr>
              <td align="left"><nobr><item4></nobr></td>
              <td align="right"><nobr><amount4><nobr></td>
            </tr>
            <tr id="rakeRow0">
              <td align="left"><nobr><rake0></nobr></td>
              <td align="right"><nobr><rakeamount0><nobr></td>
            </tr>
            <tr id="rakeRow1">
              <td align="left"><nobr><rake1></nobr></td>
              <td align="right"><nobr><rakeamount1><nobr></td>
            </tr>
            <tr id="rakeRow2">
              <td align="left"><nobr><rake2></nobr></td>
              <td align="right"><nobr><rakeamount2><nobr></td>
            </tr>
            <tr id="rakeRow3">
              <td align="left"><nobr><rake3></nobr></td>
              <td align="right"><nobr><rakeamount3><nobr></td>
            </tr>
            <tr id="rakeRow4">
              <td align="left"><nobr><rake4></nobr></td>
              <td align="right"><nobr><rakeamount4><nobr></td>
            </tr>

            <tr>
              <td align="left"></td>
              <td align="right"><div style="height: 4px; width: 75px; border-top: double #000000;"></div></td>
            </tr>
            <tr>
              <td align="left"><nobr>Total</nobr></td>
              <td align="right"><nobr><total><nobr></td>
            </tr>
          </table>

        </td>
      </tr>
    </table>

  </body>
</html>


The code essentially hides the rakes that have a zero value.  They're still exported to the receipt, but hidden before being displayed or printed.  You can adapt this to your receipt, or email your receipt template to me and I can help.

Rassal

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Rassal's Casino & Games
Re: Rake details on Receipt
« Reply #5 on: February 19, 2013, 12:43:11 PM »
You are the best!!!

This has the exact result i wanted.

Thanks!

Doing it in the receipt.html is good enough for me.

Rassal

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Rassal's Casino & Games
Re: Rake details on Receipt
« Reply #6 on: February 21, 2013, 02:05:14 PM »
Found out something wierd with that modification i did in the receipt.html to reflect the way to hide the 0$ transaction...

When i buy in someone, everything is fine, and all rakes with an amount higher than 0$ gets printed on the receipt, and this is whatever the type of buy-in profile i use.

What is wierd, is IF i have to proceed with an undo-buy-in, then it gets a different amount that was initialy paid...

And i think this is only happening on the receipt, because the summary tab gets updated correctly...

What i saw is like this:

Buy In * 28$
- Rake1 * 1$
- Rake2 * 1$
- Rake3 * 1$
- Rake4 * 5$

Bounty * 2$

Total * 30$

Now if i do a undo buy-in of that same person, this is what get printed:

Buy In * -28$
- Rake1 * -1$
- Rake2 * -1$
- Rake3 * -1$
- Rake4 * -5$

Bounty * 2$

Total * -26$

I know that i only display the rakes from the way you explained in your prior response... and it works fine... only wierd numbers get printed, and if i ever have to proceed with a undo-buy-in someone will ask why they are short 4$...

As you can see... it negates the 28$ of the buy-in with a -28$ but it doesn't negate the Bounty on the receipt... it says 2$... instead of -2$

And all rakes are only displayed...

I can provide you my receipt.html if you want, but i want to know if this is a known error... i will try tonight with the default receipt.html file from the installation setup TD3.2b3...

I taught that if someone does a buy-in of 30$, the un-do should be -30$... but it goes to -26$... i wonder why....


Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Rake details on Receipt
« Reply #7 on: February 21, 2013, 05:28:16 PM »
Sounds like a bug.  I'll look into it.

Rassal

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Rassal's Casino & Games
Re: Rake details on Receipt
« Reply #8 on: February 21, 2013, 11:16:36 PM »
Hi,

Played around it again tonight, and it`s something about the bounty when you undo a buy-in that something is wrong.

And it seems only wrong on the receipt calculation... because inside the TD the summary is 0$...

I attached 2 receipt... one is the result of undo-ing a buy-in with bounty... and one without bounty...

The one without bounty has everything right... buy-in was 33$, and refund is 33$.

But if i add bounty with a 2$ value on bounty... the buy-in totals to 35$ which is ok... but the undo buy-in totals to -31$ and the bounty value printed on the receipt is not -2$... it`s 2$... so it sounds like it`s not deducting 2$ to refund you, it actually charge the bounty again on the refund... which would be logical if you paid 2$ at the buy-in and another 2$ at the refund... seems to be around that...


Rassal

  • Newbie
  • *
  • Posts: 34
    • View Profile
    • Rassal's Casino & Games
Re: Rake details on Receipt
« Reply #9 on: February 22, 2013, 07:33:38 AM »
Hi Corey,

So it`s something about the bounty, i played again around with it, and if i raise the bounty to 3$... then the buy-in goes up to 36$, but if i issue a refund of that buy-in the receipt gets printed with a -30$ instead of a -36$.

So really, it`s the bounty that gets charged again when you issue a refund.


ALSO.... if you do an add-on on a buy-in, and issue a refund on the add-on, you get the warning that removing this player will result in a removal of the player, but will also remove the add-on and rebuy and will remove the player from the game, but the receipt printed is only printed for the buy-in amount... the add-on doesn`t get refunded... and doesn`t get printed... which doesn`t balance out.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Rake details on Receipt
« Reply #10 on: February 22, 2013, 11:16:15 AM »
Yes, the bounty amount simply isn't negated on the "undo" receipts.  Also, another thing I found when looking into this, is that undo receipts use the same receipt # as the original transaction's receipt.  Not good, but not terrible, unless you're saving receipts as files as well as printing them, in which case the original transaction's receipt file is overwritten.

Quote
ALSO.... if you do an add-on on a buy-in, and issue a refund on the add-on, you get the warning that removing this player will result in a removal of the player, but will also remove the add-on and rebuy and will remove the player from the game, but the receipt printed is only printed for the buy-in amount... the add-on doesn`t get refunded... and doesn`t get printed... which doesn`t balance out.

Correct.  The software won't queue-up and print a bunch of "undo" receipts if you remove a player from the tournament.  If you want a receipt for each of those, you'll have to undo each in turn.  Frankly, I'm conflicted as to whether removing a player from the tournament should even print the "undo buy-in" receipt.