Adding a "Print CC Slip" button to Transactions

Top  Previous  Next

DISCLAIMER: This article involves Advanced Customizations, which can be technically challenging to get working and is not part of standard support.  This is programming and must be done precisely or the results can be unpredictable.  This information is provided as a service for those who have the technical skills to work through it -- we cannot help you solve any issues with getting it working.  For more information about Advanced Customizations, see the full documentation:

https://campgroundmaster.com/help/overview32.html

 

 

 

Certain commands can be activated through functions in the Advanced Customizations, and one of those is printing a Form.  So we can use that function to print a credit card slip (or any selected Form) when the user clicks a button.  In this example, we'll add a button to the Reservation Transactions dialog that prints the Credit Card Slip.  This can be used to manually print an extra copy of the cc slip, either because the automatically printed one got messed up, or because we want to wait and print a 2nd one after we've torn off the first one that's auto-printed (rather then printing both copies at once and having to tear them apart afterwards).

 

1. The first step is to add a Dialog definition that's an Add-on to the Reservation Transactions dialog. Go to Maintenance / Advanced Customizations / Dialogs, and click "Add dialog definition".

 

Note: Only one Add-on definition can be active for a given dialog, so if you already had such a definition then you would just add elements on to the existing one instead of creating a new one here (in which case, skip to step 3).

 

2. Give it a name, such as "Resv Transactions add-on".  Then check the "Add-on" box and select "Reservation Transactions" from the list. Also make sure the "Enabled" box is checked.

 

3. Click Add Element.  Set the fields as follows:

 

Element Type: Add New Control

Control Name: cc button

Control Type: Button

Left: 200

Top: 440

Width: 90

Height: 18

 

4. Click Edit Action Expr.., and enter this for the expression:

 

PrintFormForRecord("Credit Card Slip, fixed-pitch font", ThisResv(), .T., .T.)

 

Note: Spacing, capitalization, and punctuation are critical, it must be typed EXACTLY as shown.

 

This will print the Form with that name -- if you use a different form for cc slips, enter that name instead but make sure the name is exact.

The last 2 parameters of ".T." tell it to show a preview and then show a Print dialog (so you can cancel it, etc).  Once you've tested the functionality, you could change those to ".F." (false) so it just prints it immediately with no extra steps involved.

 

5. Click Save and then Save again to get back to Edit Dialog Definition.

 

OK, now you're ready to test it. Click "Save & Test dialog" to see what it looks like. It will use the most recent reservation added for the test, so if that reservation has no credit card transactions then the slip itself would only have the heading.

 

Note that the button position above used would overlap the "Window Tag" button if you have that option enabled, so you might need to change the Left and Top parameters to put it somewhere else -- that takes some experimentation.

 


Page URL https://CampgroundMaster.com/help/addingaprintccslipbutton.html

Campground Master Home