Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Receipt Number Generation


Database Designs of Ohio, Inc.

Recommended Posts

I have a payment database that I need to have a receipt number generated for. My problem is, I have two types of accounts that are making payments. If 1 type of account makes a payment my receipt number must start with 50000 and be sequential. If the other type of account makes a payment, The receipt number must start with 3000 and also be sequential. How can I do this?

Link to comment
Share on other sites

dbDesigns,

 

Create two global fields gAcctOne and gAcctTwo and set them to the next sequential value to be used. Then when making payment, assuming you've determined which account you'll pay from (a radio button display?), set the displayed "ReceiptNumber" equal to the respective global account hold and then set the global at gAcctOne + 1, ready for the next payment.

 

The Payment Script would look like:

 

If ["PaymentAccount = "One""]

Set Field ["ReceiptNumber", "gAcctOne"

Set Field ["gAcctOne", "gAcctOne + 1"]

Else

Set Field ["ReceiptNumber", "gAcctTwo"]

Set Field ["gAcctTwo", "gAcctTwo + 1"]

End If

#Other lines doing payment routine entries

#Other lines doing payment routine entries

#Other lines doing payment routine entries

 

This would be a case statement if you had three or more payment accounts. Using Global fields works if all payments are done from one workstation / user.

 

Let me know if I misunderstood and I hope this helps,

 

Kevin K

FileSquire

Link to comment
Share on other sites

dbDesigns,

Noticing your post on Global fields, if I could suggest further on this receipt number generation "thing". You could create a variable file (probably hidden, single record) that holds the multiple running receipt numbers. Also a constant in payments and variables to relate them.

 

Obsessing on a Friday,

 

Kevin K

FileSquire

Link to comment
Share on other sites

Hi,

Once you overcome the issues with the use of global fields in multi-user mode, the approach suggested by Kevin is workable, but has the drawback of requiring allocation of your serial numbers via a script - which users will have to remember to run every time they process a payment. The first time someone processes a payment without using the script, the integrity of the numbering process will be shot.

 

Alternatively, there is a way to make the allocation of independent sequences of serial numbers totally automatic - an approach that will enable you to implement a 'set-and-forget' number allocation system.

 

If you are interested, a free demo file of the technique is available for download from my web site at the URL:

 

http://www.nightwing.com.au/FileMaker/demos/CustomSerial.zip

 

It uses the example of inependently incrementing serial numbers for different clients rather than accounts, but the technique is one which can be readily adapted to the purposes you've outlined.

Link to comment
Share on other sites



×
×
  • Create New...

Important Information

Terms of Use