1. This should work and should always show the system's current date and current time. You don't need a field for this, use the text tool to click on your layout and then use the Insert menu to insert these text markers into the layout text object where you clicked.
2. Sorry, but you'll need that field. Not only do you need the field to format with your drop down list, but isn't the type of payment important info that you need to keep in order to fully document this transaction? That also requires a field.
1. Okay, Date & Time are now working. Just deleted and redid the text boxes. So not sure what was problem, but that is clear.
2. I accept that we need to add a receipt field to the policy record, but this is only used to indicate how the policy was actually paid for and is to replace the manual writing out of receipts. The policy already has a payment method field, but this is how the policy should be paid e.g. Direct Debit or Credit/Debit Card and is different to the reality of the payment actually being done which can be by a different method. So I have added a "receipt_type" field to the policy record ( set on the database as validated list - dropbox e.g. Cash, Bnk Tfr, Card). How can I get the Print Receipt button to prompt the User to select the "receipt_type" from a dropdown list and then this value be passed to the Receipt Report layout to be printed.
3. We would like, in a similar vein, for a prompt to enable the User to add a comment which would appear on the receipt e.g. "part 500€ for 3 policies". Can this be done via a global variable ?
I have no idea what tables make up the data model for your database. Policy? Receipt? ???
How can I get the Print Receipt button to prompt the User to select the "receipt_type" from a dropdown list
The button should perform a script. The script should use an If block to check to see if the field is empty and pop up a message in a custom dialog if it is missing a value.
and then this value be passed to the Receipt Report layout to be printed.
It would seem that you have a table of "policies" and a table of "receipts". If they are correctly linked in a relationship, any data in any field of Policy (not just this one field) can be added to your Receipt layout.
The datamodel is simply Clients, policies, claims. The receipt that we are printing out is simply confirmation of a payment received for a policy. The receipt is logged as a comment on the policies record and not as a transaction as this database is not used for accounting purposes. OUr ticket / receipt prints out perfectly. The only additional thing we would like to do is
1. Add a User input comment on the ticket
2. Print out 2 copies, the the first saying "client receipt" and the second saying "original" on it. SO this I understand requires a loop to be performed.
The bit I cannot find examples of how to do, is of a script to pop up a dialog box to capture the User input comment, save this as a variable and then print it on the ticket. Could you suggest a way to do this please
You should add a related table of receipts in place of using a field in Policies for your reciepts. This is not for accounting purposes but in order to more flexibly manage this data. A comment field for User input could be a field in such a table.
A portal on the Policy layout can be used to record all such input and then a layout based on this receipts table can then be used to print the receipt.
If you still want to pop up a dialog, you can use up to three input fields as part of a custom dialog opened by the Show Custom Dialog script step or you can use New Window in combination with go to Layout to open a window with modal dialog behavior for collecting user input.
In FileMaker 13, a popover might be used.
Thanks PhilModJunk for pointing me in the right direction.
I have managed to do a solution by adding 3 extra fields to the policy record. I know that if we want too develop the system to have the receipt record as part of an audited accounting system this would not be appropriate, but for now this gives the company a solution that resolves their issue of staff not being able to write legible!! And anyway looks more professional.
(May not be the most eloquent code... But it works perfectly. Just need to control which printer now.)
Print-Receipt from Policy Layout
Enter Browse Mode
Go to Layout[ “Print - Receipt” (policies) ]
Go to Related Record [ From table:“policies”; Using layout: <Current Layout> ]
# Check if Policy found
If [ Get ( LastError ) = 401]
Show Custom Dialog [ Title:"No Policy Found Error Message"; Message: "Sorry, no policy found."; Default Button: “OK”,
Commit:“Yes”; Button 2: “Cancel”, Commit: “No” ]
Show Custom Dialog [ Title:"Payment Method for Receipt"; Message: "Please Enter Payment Method."; Default Button: “OK”,
Commit:“Yes”; Button 2: “Cancel”, Commit: “No”; Input #1: policies::ReceiptType, "Payment Type"; Input #2: policies::
ReceiptComment, "Enter AMOUNT PAID"; Input #3: policies::ReceiptComment3 , "Enter a Comment here" ]
Set Variable[ $$LoopCounter; Value:0 ]
If [ Get ( LastMessageChoice )=2 //Cancel button was clicked
Go to Layout[ “Policies” (policies) ]
Exit Script[ ]
Else If[ Get ( LastMessageChoice )=1 //Enter key or OK button was clicked ]
Set Variable[ $$LoopCounter; Value:$$LoopCounter + 1 ]
If [ $$LoopCounter = 1]
Insert Text [ policies::ReceiptComment2 ; “Office Copy” ]
Else If[ $$LoopCounter = 2]
Insert Text [ policies::ReceiptComment2 ; “Client Copy” ]
Print[ Current record; All Pages; Orientation: Portrait; Paper size: 2.83" x 8.26" ]
[ Restore: POS-80; No dialog ]
# User must press ENTER key after tearing off Office Copy
Exit Loop If [ $$LoopCounter = 2]
Pause/Resume Script [ Indefinitely ]
Go to Layout[ “Policies” (policies) ]
I will repeat from my last post, my suggestion was to make working with this data simpler and more flexible, not simply to provide support for any "accounting" being done.