473,396 Members | 2,004 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,396 software developers and data experts.

Invoicing table structure question

I am desiging an invoicing program that will do recurring billing as
well as charging for any additional service at a given time. All
charges will be service oriented. I am particularly concerned with
being able to seperate uninvoiced charges and invoiced charges and
would appreciate advice on do's or dont's, or any Ideas for a better
way to do it..

I have the usual tables [Customers],[Invoices],
[InvoiceDetails],[Services]...

I plan on to use one table (InvoiceDetails) for both invoiced and
noninvoiced charges and using a field to mark a record when it is
invoiced, this field would then be used in my queries or I could just
assume that if a record has an invoice number and an invoice date that
it has been invoiced. What would be the best way to do this?

Also, for recurring billing I plan to generate a billing schedule in a
seperate table with a date field at a user specified frequency e.g.
monthtly, semi-anually ect.ect. using a customerID as a FK, Then I can
use code however I wish to access tohose billng dates. Is this a good
way to do this?

William Roberts
Nov 12 '05 #1
2 4737
It is possible to create the child records with no parent, i.e. the foreign
key InvoiceDetails.InvoiceID is Null, and you then write the code to collect
all the invoiced items for each client at the end of the period (month?) and
assign the foreign key value now they are invoiced.

If the fields of the existing record (work order?) are quite different form
the fields of the InvoiceDetail table, another approach would be to use a
foreign key between the two tables. If there is no record in InvoiceDetail
that references the work order, then your CreateInvoice() code will create
the record for both Invoice and InvoiceDetail when it is run.

Recurring billing is an interesting beast, as it sometimes has to cope with
vagaries where a client is given a month for free or is lapsed for a time,
or ... If you are happy with the idea that the payment is always due 1
period after their *last* regular payment, then the approach you suggest
will be fine. You can define fields for a Period (whole number) and a
PeriodType. PeriodType accepts valid values for DateAdd, such as "d", "m",
"yyyy". The next time the payment is due is then:
DateAdd([Period], [PeriodType], [DateOfLastRegularPayment])
where the date of last regular payment is typically retrieved with a
subquery. The value of this two-field approach is that it's very flexible,
e.g. allowing monthly payments regardless of the number of days in the
month.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"William Roberts" <wi*********@hotmail.com> wrote in message
news:d6**************************@posting.google.c om...
I am desiging an invoicing program that will do recurring billing as
well as charging for any additional service at a given time. All
charges will be service oriented. I am particularly concerned with
being able to seperate uninvoiced charges and invoiced charges and
would appreciate advice on do's or dont's, or any Ideas for a better
way to do it..

I have the usual tables [Customers],[Invoices],
[InvoiceDetails],[Services]...

I plan on to use one table (InvoiceDetails) for both invoiced and
noninvoiced charges and using a field to mark a record when it is
invoiced, this field would then be used in my queries or I could just
assume that if a record has an invoice number and an invoice date that
it has been invoiced. What would be the best way to do this?

Also, for recurring billing I plan to generate a billing schedule in a
seperate table with a date field at a user specified frequency e.g.
monthtly, semi-anually ect.ect. using a customerID as a FK, Then I can
use code however I wish to access tohose billng dates. Is this a good
way to do this?

William Roberts

Nov 12 '05 #2
Thanks Allen,
I checked out your web site, it has a lot of helpfull stuff.
Regards
William Roberts

"Allen Browne" <ab***************@bigpond.net.au> wrote in message
news:ls********************@news-server.bigpond.net.au...
It is possible to create the child records with no parent, i.e. the foreign key InvoiceDetails.InvoiceID is Null, and you then write the code to collect all the invoiced items for each client at the end of the period (month?) and assign the foreign key value now they are invoiced.

If the fields of the existing record (work order?) are quite different form the fields of the InvoiceDetail table, another approach would be to use a
foreign key between the two tables. If there is no record in InvoiceDetail
that references the work order, then your CreateInvoice() code will create
the record for both Invoice and InvoiceDetail when it is run.

Recurring billing is an interesting beast, as it sometimes has to cope with vagaries where a client is given a month for free or is lapsed for a time,
or ... If you are happy with the idea that the payment is always due 1
period after their *last* regular payment, then the approach you suggest
will be fine. You can define fields for a Period (whole number) and a
PeriodType. PeriodType accepts valid values for DateAdd, such as "d", "m",
"yyyy". The next time the payment is due is then:
DateAdd([Period], [PeriodType], [DateOfLastRegularPayment])
where the date of last regular payment is typically retrieved with a
subquery. The value of this two-field approach is that it's very flexible,
e.g. allowing monthly payments regardless of the number of days in the
month.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html

"William Roberts" <wi*********@hotmail.com> wrote in message
news:d6**************************@posting.google.c om...
I am desiging an invoicing program that will do recurring billing as
well as charging for any additional service at a given time. All
charges will be service oriented. I am particularly concerned with
being able to seperate uninvoiced charges and invoiced charges and
would appreciate advice on do's or dont's, or any Ideas for a better
way to do it..

I have the usual tables [Customers],[Invoices],
[InvoiceDetails],[Services]...

I plan on to use one table (InvoiceDetails) for both invoiced and
noninvoiced charges and using a field to mark a record when it is
invoiced, this field would then be used in my queries or I could just
assume that if a record has an invoice number and an invoice date that
it has been invoiced. What would be the best way to do this?

Also, for recurring billing I plan to generate a billing schedule in a
seperate table with a date field at a user specified frequency e.g.
monthtly, semi-anually ect.ect. using a customerID as a FK, Then I can
use code however I wish to access tohose billng dates. Is this a good
way to do this?

William Roberts


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: QWERTY | last post by:
--------------Boundary-00=_O5I3QL80000000000000 Content-Type: Multipart/Alternative; boundary="------------Boundary-00=_O5I3LVC0000000000000" --------------Boundary-00=_O5I3LVC0000000000000...
5
by: David B | last post by:
I have an app which includes invoicing, which is working fine. I am wondering how best to deal with the situation where the amount paid is different from the amount invoiced. Would it be best to...
10
by: MLH | last post by:
I have an A97 table with a Yes/No field named TowJob and a form bound to that table. The TowJob control on the form is bound to the same field. It is an option group with Yes and No bttns valued...
3
by: CAD Fiend | last post by:
Hello, I have a land development project that has a many-to-many relationship. I have ONE question regarding table structures, and ONE question on how to make a Form with two Subforms, below. ...
0
by: David B | last post by:
Back in Dec 03 I was working on an app which included invoicing. With some help from Allen Browne I got something that has worked with no probs. I modifyed the origional app last March to handle a...
6
by: Kyle Teague | last post by:
What would give better performance, serializing a multidimensional array and storing it in a single entry in a table or storing each element of the array in a separate table and associating the...
9
by: sck10 | last post by:
Hello, I am building a web form that will be used to gather information for marketing plans. The form will have 15 questions which must be answered. Each question can have large blocks of text....
2
by: antheana | last post by:
Hi there, NeoPa and mccarthy have helped me with some table design advice previously, but I made a bit of a boo boo. It is with regards to invoicing for a job. tblJobs tblInvoices Now, I...
2
by: Dave Ekhaus | last post by:
hi i'm new to javascript. i'm hoping to get some help and find out if what i want to do is possible and - assuming it is, get some tips on how to accomplish the task. ok - assume i have a...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.