Individual Payment Receipts (per payment processed)

Is there any easy way to create a process for printing a single payment receipt (not all payments). I need to be able to print a CC slip after Credit Card is processed, but I don’t want to show any other payments that have been processed on the ticket.

Example:

  1. Ticket total of $100
  2. Credit Card processed for $50
  3. Slip prints out for that specific card detail
  4. Other persons credit card is processed for $50
  5. Slip prints out for that specific card detail

I tried to attach the job to the payment processed rule and use SQL to filter for the most recent payment on the ticket, however it appears that the data doesn’t write to the db until I close the ticket.

I guess I could have it close the ticket after each payment is made, but I wondering if there is a simpler way to get this done.

I haven’t found a easy way to LIMIT the payment information other than using SQL and print job parameters.

1 Like

We are looking at this now. I don’t think closing the ticket is good idea. Save ticket action may work better. Save ticket action should allow it to write to database without closing it.

Save ticket action will do as Jesse says. So on payment processed if payment is card, save ticket and then execute print job.

This should return the newest payment for the ticket (I have not tested this btw):

SELECT TOP(1)
    jsonData.pdauth_code,
    jsonData.pdCardHolderName,
    jsonData.pdCardBrand,
    Amount,
    Date
  FROM dbo.Payments p 
    CROSS APPLY OPENJSON(p.PaymentData)
    WITH(
      pdTransactionId   NVARCHAR(MAX) '$.TransactionID',
	  pdauth_code       NVARCHAR(MAX) '$.auth_code',
	  pdCardHolderName  NVARCHAR(MAX) '$.CardHolderName',
	  pdCardHolderBrand NVARCHAR(MAX) '$CardBrand'
	  ) jsonData
  WHERE Id = '@1'
        AND (p.PaymentData != '' && p.PaymentData != NULL)
    ORDER BY Id Desc

@Jesse - Save ticket fixed the timing and I can now get the most recent payment info from the Database in the Payment Processed event. The problem still remains that Print Job Parameters do not seem to work will you’re in a ticket, so I’m unable to pass the {TICKET ID} to the print job. If I put a static value in the print template it works fine, but if I try to use $KEY={TICKET ID} the query results are blank.

$KEY=“Some Static ID” in the print parameters work fine if firing it via an automation command button within the navigation, but we need I need it to work in a ticket. I have another forum post going on that.

We are working to solve it from our end. Should have something soon. I will email you.

While maybe not the most elegant solution I was able to get this working by setting a local variable in the payment processed rule and update the SQL query to use {SETTING:Variable}. I guess I just won’t bother using the print parameter function at this point. @Jesse if you guys have a better solution let me know.

*ignore the ugly printer template, that comes later :wink:

1 Like

That works great for now but I think we will make it work with Payment Processed. We need a better solution.

Well let me rephrase there is nothing wrong with your solution. I just think we should have something not so involved to setup.

Thanks Jesse. Its all working now. I’ve setup it up to automatically print after running the payment and also an option to reprint all credit card receipts in a ticket.

Update Added logic for customer receipt question on initial payment. Changed template to only show transaction information and mocked current merchant processor receipts.

  1. Print individual credit card slip each time a credit card payment is ran. Ask for customer receipt in the process.

image

image

image

[LAYOUT]
<EC>
-- Alternative logo method
-- <img src="C:\Users\josep\Documents\SambaPOS5\plogo.png">
<div style="font-size:13px;text-align:center;font-family:'Calibri'">113 E Holly Street<br>Bellingham, WA 98225<br>(360) 933-4301</div>

    {REPORT SQL DETAILS:SELECT TOP 1 [Id]
    ,jsonData.[pdauth_code]
    ,jsonData.[pdCardHolderName]
    ,jsonData.[pdCardBrand]
    ,jsonData.[pdAccount]
    ,jsonData.[pdTransactionID]
    ,[Date]
    ,[Amount]
    ,[Name]
    ,Format([Date],'hh.mm tt') as Time
    FROM [Payments] p
    CROSS APPLY OPENJSON(p.[PaymentData])
    -- this WITH portion allows explicit definition of the schema JSON Keys for output
    -- and gives references to the columns/fields above in the SELECT portion
    -- we can also use these as filters in the WHERE clause below
    WITH (   
     pdTransactionID varchar(1000) '$.TransactionID'
    ,pdauth_code varchar(1000) '$.auth_code'
    ,pdCardHolderName varchar(1000) '$.CardHolderName'
    ,pdCardBrand varchar(1000) '$.CardBrand'
    ,pdAccount varchar(1000) '$.Account'
    ,pdTransactionID varchar(1000) '$.TransactionID'
    ) jsonData
    WHERE 1=1
    AND [Name]='Credit Card'
    AND [TicketID]='@1'
    ORDER BY [Id] desc
    ;{SETTING:CC_Slip_TID}
    :F.Date
    ,F.Amount
    ,F.Id
    ,F.pdauth_code
    ,F.pdCardHolderName
    ,F.pdCardBrand
    ,F.pdAccount
    ,F.Time
    ,F.pdTransactionID::
    <div style="font-size\:10px;font-weight\:bold;margin\:20 10 0 20;text-align\:justify;font-family\:'Calibri'">
    <table>
    <tr>
    <td align="left">Acct\: {6}<br />MerchId\: xxxxinsertyourmerchid <br />TransId\: {8}<br />Auth Code\: {3}<br />Card Type\: {5}</td><td align="right">{0}<br />{7}<br/> Server\: {ENTITY NAME:Server}<br />Pay ID\: {2}</td>
    </tr>
    <tr>
    <td align="left"><br /><span  style="font-size\:13px;">Total (USD)\:</span></td><td align="right"><Br /><span  style="font-size\:13px;">${1}</span></td>
    </tr>
    </table>
    </div>
    </div>

    <div style="font-weight\:normal;margin\:20 10 0 20;padding\:0 0 0 0;border\:1 1 1 1;border-color\:black;font-size\:15px;text-align\:center;font-family\:'Calibri'">
    <table border="1">
    <tr>
    <td style="background-color\:black;"><SPAN STYLE="color\:black;font-weight\:bold;">TIP</span></td>
    </tr>
    </table>
    <table>
    <tr>
    <td width="30"><span style='font-size\:20px;'>&#10063;</span></td>
    <td width="30" align=left>15%</td>
    <td width="80">Tip\: $[=F(Math.round((TN('{1}') * 0.15)*100)/100,'0.00')]</td>
    <td width="80">Total\: $[=F(Math.round((TN('{1}') * 0.15)*100)/100 + {1},'0.00')]</td>
    </tr>
    <tr>
    <td width="30"><span style='font-size\:20px;'>&#10063;</span></td>
    <td width="30" align=left>18%</td>
    <td width="80">Tip\: $[=F(Math.round((TN('{1}') * 0.18)*100)/100,'0.00')]</td>
    <td width="80">Total\: $[=F(Math.round((TN('{1}') * 0.18)*100)/100 + {1},'0.00')]</td>
    </tr>
    <tr>
    <td width="30"><span style='font-size\:20px;'>&#10063;</span></td>
    <td width="30" align=left>20%</td>
    <td width="80">Tip\: $[=F(Math.round((TN('{1}') * 0.20)*100)/100,'0.00')]</td>
    <td width="80">Total\: $[=F(Math.round((TN('{1}') * 0.20)*100)/100 + {1},'0.00')]</td>
    </tr>
    <tr>
    <td width="30"><span style='font-size\:20px;'>&#10063;</span></td>
    <td width="30" align=left>25%</td>
    <td width="80">Tip\: $[=F(Math.round((TN('{1}') * 0.25)*100)/100,'0.00')]</td>
    <td width="80">Total\: $[=F(Math.round((TN('{1}') * 0.25)*100)/100 + {1},'0.00')]</td>
    </tr>
    <tr>
    <td width="30"><span style='font-size\:20px;'>&#10063;</span></td>
    <td width="100" align="center">$&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</td>
    <td width="100" align="center">$&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</td>
    </tr>
    <tr>
    <td width="30"><span style='font-size\:20px;'>&zwnj;</span></td>
    <td width="100" align="center">Custom Tip</td>
    <td width="100" align="center">Total</td>
    </tr>
    </table>
    </div>
    }

    <div style="font-size:15px;font-weight:normal;text-align:center;font-family:'Calibri'">
    <table>
    <tr>
    <td><span style="font-size: 9pt"><Br />I agree to pay the above total amount <br>according to the card issuer agreement.<br />(Merchant Agreement if Credit Voucher)</span></td>
    </tr>
    <tr><td>&zwnj;</td>
    </tr>
    </tr>
    <tr><td>X&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;
    <br /><br /><Br /><Br />
    -- <span style="font-size: 9pt">powered by SambaPOS</span>
    </td>
    </tr>
    <tr><td>&zwnj;</td>
    </tr>
    </table>
    </div>
  1. Print all credit card receipts within a ticket.

image

{REPORT SQL DETAILS:SELECT [Id]
,jsonData.[pdauth_code]
,jsonData.[pdCardHolderName]
,jsonData.[pdCardBrand]
,jsonData.[pdAccount]
,jsonData.[pdTransactionID]
,[Date]
,[Amount]
,[Name]
,Format([Date],'hh.mm tt') as Time
FROM [Payments] p
CROSS APPLY OPENJSON(p.[PaymentData])
-- this WITH portion allows explicit definition of the schema JSON Keys for output
-- and gives references to the columns/fields above in the SELECT portion
-- we can also use these as filters in the WHERE clause below
WITH (   
 pdTransactionID varchar(1000) '$.TransactionID'
,pdauth_code varchar(1000) '$.auth_code'
,pdCardHolderName varchar(1000) '$.CardHolderName'
,pdCardBrand varchar(1000) '$.CardBrand'
,pdAccount varchar(1000) '$.Account'
,pdTransactionID varchar(1000) '$.TransactionID'
) jsonData
WHERE 1=1
AND [Name]='Credit Card'
AND [Id]='@1'
;{SETTING:PaymentId}
:F.Date
,F.Amount
,F.Id
,F.pdauth_code
,F.pdCardHolderName
,F.pdCardBrand
,F.pdAccount
,F.Time
,F.pdTransactionID::
<div style="font-size\:10px;font-weight\:bold;margin\:20 10 0 20;text-align\:justify;font-family\:'Calibri'">
<table>
<tr>
<td align="left">Acct\: {6}<br />MerchId\: XXXXYourMerchID<br />TransId\: {8}<br />Auth Code\: {3}<br />Card Type\: {5}</td><td align="right">{0}<br />{7}<br/> Server\: {ENTITY NAME:Server}<br />Pay ID\: {2}</td>
</tr>
<tr>
<td align="left"><br /><span  style="font-size\:13px;">Total (USD)\:</span></td><td align="right"><Br /><span  style="font-size\:13px;">${1}</span></td>
</tr>
</table>
</div>
</div>

<div style="font-weight\:normal;margin\:20 10 0 20;padding\:0 0 0 0;border\:1 1 1 1;border-color\:black;font-size\:15px;text-align\:center;font-family\:'Calibri'">
<table border="1">
<tr>
<td style="background-color\:black;"><SPAN STYLE="color\:black;font-weight\:bold;">TIP</span></td>
</tr>
</table>
<table>
<tr>
<td width="30"><span style='font-size\:20px;'>&#10063;</span></td>
<td width="30" align=left>15%</td>
<td width="80">Tip\: $[=F(Math.round((TN('{1}') * 0.15)*100)/100,'0.00')]</td>
<td width="80">Total\: $[=F(Math.round((TN('{1}') * 0.15)*100)/100 + {1},'0.00')]</td>
</tr>
<tr>
<td width="30"><span style='font-size\:20px;'>&#10063;</span></td>
<td width="30" align=left>18%</td>
<td width="80">Tip\: $[=F(Math.round((TN('{1}') * 0.18)*100)/100,'0.00')]</td>
<td width="80">Total\: $[=F(Math.round((TN('{1}') * 0.18)*100)/100 + {1},'0.00')]</td>
</tr>
<tr>
<td width="30"><span style='font-size\:20px;'>&#10063;</span></td>
<td width="30" align=left>20%</td>
<td width="80">Tip\: $[=F(Math.round((TN('{1}') * 0.20)*100)/100,'0.00')]</td>
<td width="80">Total\: $[=F(Math.round((TN('{1}') * 0.20)*100)/100 + {1},'0.00')]</td>
</tr>
<tr>
<td width="30"><span style='font-size\:20px;'>&#10063;</span></td>
<td width="30" align=left>25%</td>
<td width="80">Tip\: $[=F(Math.round((TN('{1}') * 0.25)*100)/100,'0.00')]</td>
<td width="80">Total\: $[=F(Math.round((TN('{1}') * 0.25)*100)/100 + {1},'0.00')]</td>
</tr>
<tr>
<td width="30"><span style='font-size\:20px;'>&#10063;</span></td>
<td width="100" align="center">$&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</td>
<td width="100" align="center">$&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;&#95;</td>
</tr>
<tr>
<td width="30"><span style='font-size\:20px;'>&zwnj;</span></td>
<td width="100" align="center">Custom Tip</td>
<td width="100" align="center">Total</td>
</tr>
</table>
</div>
}

image

1 Like