473,386 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Recurring Charges code

13
Does anyone have simple generic code for recurring billing so I don't have to reinvent the wheel?
Nov 16 '07 #1
23 2260
Rabbit
12,516 Expert Mod 8TB
Sorry, as a general rule of thumb, we do not give out wheels. However, if you're willing, we will help you solve any wheel making problems given your wheel's specifications.
Nov 16 '07 #2
FEDERAL
13
Thank you..

Here's what I need to do.

Add a set [PledgeAmount] generated every month (starting at no special day) from
[StartDate ] untll [EndDate] for a [MemberID]

simple?
Nov 16 '07 #3
Rabbit
12,516 Expert Mod 8TB
So if let's say member id "Person A" has date range 1/1/2008 to 3/1/2003, you want to create 3 records with pledge amount in some pledge table?

How much VBA do you know?
Nov 16 '07 #4
FEDERAL
13
That's pretty much it. However, the pledge amount wouldn't be added to the Pledge Table until that month ( with some sort of monthly Update procedure that would update everyone with a pledge amount due that month)

It's been a while and my VBA is week
Nov 17 '07 #5
Rabbit
12,516 Expert Mod 8TB
Are you able to set up a query that returns the records that should be appended for any given month?
Nov 18 '07 #6
FEDERAL
13
No, that would be the first think I could use help with
Nov 18 '07 #7
Rabbit
12,516 Expert Mod 8TB
No, that would be the first think I could use help with
Okay, but before that I need to know how your tables are set up. i.e. what fields it has, their data type, and how the tables are related to each other.
Nov 18 '07 #8
missinglinq
3,532 Expert 2GB
Here's a template from Micro$oft for ACC2000 (and I assume can be run in later versions) that appears to do what you need to have done!

Charitable Contributions Database

Welcome to TheScripts!

Linq ;0)>
Nov 18 '07 #9
FEDERAL
13
Thanks Linq, but this doesn't give me recurring pledges
Nov 18 '07 #10
FEDERAL
13
Okay, Here goes...


Table: tblDonation
Columns
Name Type Size
DonationID Long Integer 4
DonationFor Text 50
DonationAmount Currency 8
DatePledged Date/Time 8
Date Received Date/Time 8
PayMethod Text 50
Check# Text 50
StatementSent Yes/No 1
Payed Yes/No 1
AmountPaid Currency 8
FamilyID Long Integer 4
DateDue Date/Time 8
Table Indexes
Name Number of Fields
AmountPaid 1
Fields: Ascending
DonationID 1
Fields: Ascending
FamilyID 1
Fields: Ascending
PrimaryKey 1
Fields: Ascending
__________________________________________________ ___________________________

Table: tblFamilyID
Columns
Name Type Size
keyID Long Integer 4
FamilyID Long Integer 4
HomeAddress1 Text 255
HomeAddress2 Text 255
HomeCity Text 255
HomeState Text 255
HomeZip Text 9
HomePhone1 Text 255
HomePhone2 Text 50
Relationships
tblFamilyIDtblMembers
tblFamilyID tblMembers
FamilyID FamilyID
Attributes: Not Enforced
RelationshipType: Indeterminate
Table Indexes
Name Number of Fields
FamilyID 1
Fields: Ascending
keyID 1
Fields: Ascending



__________________________________________________ __________________________________________________ ______________
Table: tblMembers
Columns
Name Type Size
MemberID Long Integer 4
FamilyID Long Integer 4
LastName Text 255
FirstName Text 255
DOB Date/Time 8
SpouseID Long Integer 4
BusAddress1 Text 255
BusAddress2 Text 255
BusCity Text 255
BusState Text 255
BusZip Text 9
BusPhone Text 255
Extention Text 255
Fax Text 255
CellPhone Text 50
Email Text 50
Website Text 50
Profession Text 255
Note Memo -
MaritalStatus Text 50
Age Text 50
Gender Text 50
CreationDate Date/Time 8
PotentialDonor Text 50
Company Text 50
Title Text 50
Assistant Text 50

Relationships
tblMemberstblActivityLog
tblMembers tblActivityLog
MemberID 1 MemberID
Attributes: Enforced, Cascade Updates, Cascade Deletes
RelationshipType: One-To-Many
tblFamilyIDtblMembers
tblFamilyID tblMembers
FamilyID FamilyID
Attributes: Not Enforced
RelationshipType: Indeterminate
tblMemberstblAddresses
tblMembers tblAddresses
FamilyID FamilyID
Attributes: Not Enforced
RelationshipType: Indeterminate
tblMemberstblChild
tblMembers tblChild
FamilyID FamilyID
Attributes: Not Enforced
RelationshipType: Indeterminate
tblMemberstblImportantDate
tblMembers tblImportantDate
FamilyID FamilyID
Attributes: Not Enforced
RelationshipType: Indeterminate

__________________________________________________ ______________

Table: tblPledgeRecords

Columns
Name Type Size
PledgeRecordID Long Integer 4
MemberID Long Integer 4
ProjectID Text 50
AmountContributed Currency 8
PaymentDate Date/Time 8
ReceiptSentDate Yes/No 1
Table Indexes
Name Number of Fields
MemberID 1
Fields: Ascending
PledgeRecordID 1
Fields: Ascending
PrimaryKey 1
Fields: Ascending
ProjectID 1
Fields: Ascending


The table"tblFamilyID" is used to join spouses so that they can be entered as individual members but still share common Family info. (ie. home address, children, donations etc.)
Nov 18 '07 #11
FEDERAL
13
To much info? Where did everyone go?!
Nov 20 '07 #12
Rabbit
12,516 Expert Mod 8TB
To much info? Where did everyone go?!
Sorry, this fell through the cracks. I'll take a look right now.
Nov 20 '07 #13
Rabbit
12,516 Expert Mod 8TB
Ok, that was a lot. Sorry, I didn't mean for you to post all your tables, I only needed the ones related to your problem, which is:

tblPledgeRecords
PledgeRecordID Long Integer 4
AmountContributed Currency 8
ReceiptSentDate Yes/No 1

tblDonation
DonationID Long Integer 4
DonationAmount Currency 8
DatePledged Date/Time 8

Ok, these look to be the important fields/tables. However, there were a few things I was confused by. There seems to be payment in both the Donations table and the Pledge table. Why is that? I was under the impression that Donation holds the information about each donation and the Pledge holds monthly payment information.

Here's what it should look like:

tblDonation
DonationID; Autonumber; PK
StartDate; Date
EndDate; Date
Amount; Currency

tblPledgeRecords
PledgeID; Autonumber; PK
DonationID; FK
RecordDate; Date
Nov 20 '07 #14
FEDERAL
13
thanks for coming back.

"tblPledgeRecords" doesn't exist any longer.(it was from an earlier version. I don't know why it showed up_)
Nov 20 '07 #15
Rabbit
12,516 Expert Mod 8TB
tblDonation
DonationID; Autonumber; PK
StartDate; Date
EndDate; Date
Amount; Currency

tblMonthlyPayments
MonthlyPaymentID; Autonumber; PK
DonationID; FK
RecordDate; Date

Well, using those two tables I laid out, you can create a query that will let you know which Donations don't have a record in Monthly Payments. Then it's a simple matter of appending those into the table.
Nov 20 '07 #16
FEDERAL
13
OK, I got to that point and now have a query that shows by "FamilyID" in the "tblDonation" that has an amount >0 in "Amount"...

Now what?
Nov 20 '07 #17
FEDERAL
13
But shouldn't the pledge info (start date, end date, amount) be with the Member or Family table and then added to the donation table if the date =Month() and amount is >0 ?
Nov 20 '07 #18
Rabbit
12,516 Expert Mod 8TB
But shouldn't the pledge info (start date, end date, amount) be with the Member or Family table and then added to the donation table if the date =Month() and amount is >0 ?
I don't see anything in your Member/Family tables that would denote that each family member makes individual donations.

From what I can tell, the donation agreement sets out how much per month, when it starts, and when it ends. And each agreement is tied to a family and each family has multiple members. I don't see a field in your member table showing that each member may have differing amounts.
Nov 20 '07 #19
FEDERAL
13
I meant to say...
If month() is between "StartDate" and "EndDate" then add record to
"tblDonation" where "DonationAmount" is "Amount" from "tblFamily"
Nov 20 '07 #20
FEDERAL
13
I did get it to work, Thanks
Now I just need to figure how to not allow the append to happen more than once a month. and to just use the month/year (no day) in the criteria
Nov 20 '07 #21
Rabbit
12,516 Expert Mod 8TB
tblDonation
DonationID; Autonumber; PK
StartDate; Date
EndDate; Date
FamilyID; FK

tblMonthlyPayments
MonthlyPaymentID; Autonumber; PK
DonationID; FK
RecordDate; Date

tblFamily
FamilyID; Autonumber; PK
Amount; Currency

So your tables are something like that.

Well, the first thing is to find out which ones don't yet have a record for that month. And the first step to do that is to find out which ones do have a record.
Expand|Select|Wrap|Line Numbers
  1. Query1:
  2.  
  3. SELECT tblDonation.DonationID
  4. FROM tblDonation INNER JOIN tblMonthlyPayments ON tblDonation.DonationID = tblMonthlyPayments.DonationID
  5. WHERE Month(Date()) = Month(RecordDate) AND Year(Date()) = Year(RecordDate);
  6.  
Then you find the ones that don't have a record.
Expand|Select|Wrap|Line Numbers
  1. Query2:
  2.  
  3. SELECT DISTINCT DonationID, Amount
  4. FROM tblDonation INNER JOIN tblFamily ON tblDonation.FamilyID = tblFamily.FamilyID
  5. WHERE DonationID NOT IN (SELECT * FROM Query1);
  6.  
Then you add those records.
Expand|Select|Wrap|Line Numbers
  1. Query 3:
  2.  
  3. INSERT INTO tblMonthlyPayments
  4. SELECT *
  5. FROM Query2;
  6.  
Nov 20 '07 #22
FEDERAL
13
Thanks but I couldn't make it work. Query3 gave me an error (couldn't find field Expr1 )

But I'm not sure I understand what this does anyway.

I Started by just using:

tblDonation
DonationID; Autonumber; PK
Monthly; Y/N
Recorded; Date
FamilyID; FK


tblFamily
FamilyID; Autonumber; PK
MonthlyPledge; Currency
StartPledge; Date
EndPledge; Date
Monthy; Y/N

Query1 - (Find all the FamilyID's with Monthly Pledges set up within a set Start Stop Date range)

SELECT tblFamilyID.FamilyID, tblFamilyID.MonthlyPledge, tblFamilyID.Monthly, tblFamilyID.StartPledge, tblFamilyID.EndPledge
FROM tblFamilyID
WHERE (((tblFamilyID.Monthly)=Yes) AND ((tblFamilyID.StartPledge)<=[Date]))
WITH OWNERACCESS OPTION;

Query2 - (Append record to tblDonation

INSERT INTO tblDonation ( FamilyID, DonationFor, DonationAmount, Monthly )
SELECT [qryMonthlyY/N].FamilyID, "Donation" AS [For], [qryMonthlyY/N].MonthlyPledge, [qryMonthlyY/N].Monthly
FROM [qryMonthlyY/N]
ORDER BY [qryMonthlyY/N].FamilyID
WITH OWNERACCESS OPTION;
Nov 22 '07 #23
Rabbit
12,516 Expert Mod 8TB
Maybe you need to take a closer look at my queries, what you have is nothing like my example.
Nov 22 '07 #24

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Shabam | last post by:
I'm having a calendar feature developed whereby users can add recurring events. These recurring events can have start and end dates, meaning they will recur only within a date range. For...
5
by: gil | last post by:
I initially tried building a coded system where numbers 1 through 10 referenced a certain type of recurring appointment, and would then call a specific function for each, but as more appointments...
1
by: steve | last post by:
Hi All I am writing a program for a gymnasium for membership control It is the first time I have had to deal with appointment diaries and I want to know the best way to store recurring...
2
by: nepdae | last post by:
Please forgive me, this is a long one. My 11-user Access 2000 database is having recurring corruption problems. The symptoms include the following: 1) corrupted fields in recently created or...
0
by: malcolm | last post by:
Bank Charges Refunded Free help to recover your bank or credit card charges from www.bankchargesrefunded.co.uk Its your money and its better in your pocket!
1
by: TC | last post by:
Hi, I have an app that is going to require recurring diary entries, it's a relatively simple app but I have no idea how to go about the recurring entry side of things. The functionality needs to...
0
by: =?Utf-8?B?TWVlbWEgSnVkeQ==?= | last post by:
I have a Verizon Palm Treo 755p and use Outlook 2002 on my new HP Pavilion (Vista 64-bit). When I was syncing on my old XP PC, everything worked fine. On the Vista PC, when I finally got it to...
2
by: Kshetra | last post by:
Hi All, I wanted to know more about how monthly recurring of payments is done through paypal.I need to integrate payments through paypal in my application such that No where I will track the...
23
by: CFFAN | last post by:
Is it possible recurring payment using PayPal Pro? How to use paypal.cfc? Is paypal java sdk needed for this? can anyone gve detail description to applay paypal in coldfusion?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.