473,803 Members | 3,073 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invoice numbering

I am creating invoices for an app I am busy with.
The transactions for the invoice come from 2 tables which store Sales and
Facilities Hire.

The current arrangement is that I create a temp table using append queries to
get transactions from the 2 tables between selected dates. then draw these into
a report grouped by the Sales and Facilities Hire
This all works fine.
However the customer requires invoices (reports) to have consecutive numbers and
also I need to record the date when this batch of transactions were invoiced,
and subsequently settled.

Trying to figure out the best way of making this happen.
Any thoughts
TIA
David B

Nov 12 '05 #1
3 2840
If invoices are generated as a batch after the sales/hire event, they need
to be permanently stored - not just in a temp table.

The code to create the invoices will:
1. Get a batch number;
2. Get all sales/hire detail records that have not been previously invoiced;
3. Create an invoice for each client who has a record in #2.
4. Create detail records under each client's record for the detail records
in #2.

This is very similar to what you are doing with your temp table, except they
are permanent records. You may want to give the client an End Date (create
invoices up to this sale/hire date), but not a begin date: it must get all
uninvoiced records.

In a really simple system, it may be possible to use the SalesHireDetail
table as the InvoiceDetail as well. This table will have a foreign key field
to the main SalesHire table, and that field is Required (i.e. can't have a
detail record that is not part of a sales record). It will also have a
foreign key field to the Invoice table. This field is Null until an invoice
is created. It's then dead-easy to identify which sales/hire record have not
been invoiced, and group them by ClientID, create the main Invoice record,
and update the Nulls with the new InvoiceID value.

The Invoice table will have the BatchID as a foreign key. You can therefore
identify the invoices that are part of the last batch, and undo the batch if
desired. Likewise, it's very easy for the client to reprint any batch at any
time.

Takes a bit of work, but it's a really robust, flexible, reliable system.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"David B" <da***@marleyco tenospam.fsnet. co.uk> wrote in message
news:bs******** **@news5.svr.po l.co.uk...
I am creating invoices for an app I am busy with.
The transactions for the invoice come from 2 tables which store Sales and
Facilities Hire.

The current arrangement is that I create a temp table using append queries to get transactions from the 2 tables between selected dates. then draw these into a report grouped by the Sales and Facilities Hire
This all works fine.
However the customer requires invoices (reports) to have consecutive numbers and also I need to record the date when this batch of transactions were invoiced, and subsequently settled.

Trying to figure out the best way of making this happen.
Any thoughts
TIA
David B

Nov 12 '05 #2
Allen
Many thanks for your reply. I have things working as your notes apart from the
final step of sending the invoice number back from the invoice table to invoice
detail table. I am trying an update query, latest sql is as follows.

UPDATE invoicetable INNER JOIN invoicedetail ON invoicetable.cu stid =
invoicedetail.c ustomerid SET invoicedetail.i nvoicenum = [invoicenumber];

Get the impression my brain is not at full speed today
Any thoughts , on the sql not my brain

David b
Allen Browne <Al*********@Se eSig.Invalid> wrote in message
news:3f******** **************@ freenews.iinet. net.au...
If invoices are generated as a batch after the sales/hire event, they need
to be permanently stored - not just in a temp table.

The code to create the invoices will:
1. Get a batch number;
2. Get all sales/hire detail records that have not been previously invoiced;
3. Create an invoice for each client who has a record in #2.
4. Create detail records under each client's record for the detail records
in #2.

This is very similar to what you are doing with your temp table, except they
are permanent records. You may want to give the client an End Date (create
invoices up to this sale/hire date), but not a begin date: it must get all
uninvoiced records.

In a really simple system, it may be possible to use the SalesHireDetail
table as the InvoiceDetail as well. This table will have a foreign key field
to the main SalesHire table, and that field is Required (i.e. can't have a
detail record that is not part of a sales record). It will also have a
foreign key field to the Invoice table. This field is Null until an invoice
is created. It's then dead-easy to identify which sales/hire record have not
been invoiced, and group them by ClientID, create the main Invoice record,
and update the Nulls with the new InvoiceID value.

The Invoice table will have the BatchID as a foreign key. You can therefore
identify the invoices that are part of the last batch, and undo the batch if
desired. Likewise, it's very easy for the client to reprint any batch at any
time.

Takes a bit of work, but it's a really robust, flexible, reliable system.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"David B" <da***@marleyco tenospam.fsnet. co.uk> wrote in message
news:bs******** **@news5.svr.po l.co.uk...
I am creating invoices for an app I am busy with.
The transactions for the invoice come from 2 tables which store Sales and
Facilities Hire.

The current arrangement is that I create a temp table using append

queries to
get transactions from the 2 tables between selected dates. then draw these

into
a report grouped by the Sales and Facilities Hire
This all works fine.
However the customer requires invoices (reports) to have consecutive

numbers and
also I need to record the date when this batch of transactions were

invoiced,
and subsequently settled.

Trying to figure out the best way of making this happen.
Any thoughts
TIA
David B



Nov 12 '05 #3
Hmm. The 4th step will depend on a bunch of other details about your system
that I don't have.

It looks like your InvoiceDetail table has a CustomerID field? Normally it
would not: that would be in the main InvoiceTable only. So perhaps you are
using this temporarily until the InvoiceNum is assigned? If so, and
assuming you are generating just one invoice for the client for the period,
and you have created the main InvoiceTable record, you would select the
records where the InvoiceNum is blank in the related table, and the records
of the particular batch in the main table:

"WHERE (InvoiceDetail. InvoiceNum Is Null) AND (InvoiceTable.B atchID = " &
lngBatchID & ");"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"David B" <da***@marleyco tenospam.fsnet. co.uk> wrote in message
news:bs******** **@news5.svr.po l.co.uk...
Allen
Many thanks for your reply. I have things working as your notes apart from the final step of sending the invoice number back from the invoice table to invoice detail table. I am trying an update query, latest sql is as follows.

UPDATE invoicetable INNER JOIN invoicedetail ON invoicetable.cu stid =
invoicedetail.c ustomerid SET invoicedetail.i nvoicenum = [invoicenumber];

Get the impression my brain is not at full speed today
Any thoughts , on the sql not my brain

David b
Allen Browne <Al*********@Se eSig.Invalid> wrote in message
news:3f******** **************@ freenews.iinet. net.au...
If invoices are generated as a batch after the sales/hire event, they need to be permanently stored - not just in a temp table.

The code to create the invoices will:
1. Get a batch number;
2. Get all sales/hire detail records that have not been previously invoiced; 3. Create an invoice for each client who has a record in #2.
4. Create detail records under each client's record for the detail records in #2.

This is very similar to what you are doing with your temp table, except they are permanent records. You may want to give the client an End Date (create invoices up to this sale/hire date), but not a begin date: it must get all uninvoiced records.

In a really simple system, it may be possible to use the SalesHireDetail
table as the InvoiceDetail as well. This table will have a foreign key field to the main SalesHire table, and that field is Required (i.e. can't have a detail record that is not part of a sales record). It will also have a
foreign key field to the Invoice table. This field is Null until an invoice is created. It's then dead-easy to identify which sales/hire record have not been invoiced, and group them by ClientID, create the main Invoice record, and update the Nulls with the new InvoiceID value.

The Invoice table will have the BatchID as a foreign key. You can therefore identify the invoices that are part of the last batch, and undo the batch if desired. Likewise, it's very easy for the client to reprint any batch at any time.

Takes a bit of work, but it's a really robust, flexible, reliable system.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"David B" <da***@marleyco tenospam.fsnet. co.uk> wrote in message
news:bs******** **@news5.svr.po l.co.uk...
I am creating invoices for an app I am busy with.
The transactions for the invoice come from 2 tables which store Sales and Facilities Hire.

The current arrangement is that I create a temp table using append

queries to
get transactions from the 2 tables between selected dates. then draw
these into
a report grouped by the Sales and Facilities Hire
This all works fine.
However the customer requires invoices (reports) to have consecutive

numbers and
also I need to record the date when this batch of transactions were

invoiced,
and subsequently settled.

Trying to figure out the best way of making this happen.
Any thoughts
TIA
David B

Nov 12 '05 #4

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

Similar topics

7
4170
by: Peter Young | last post by:
I need to be able to generate an invoice from an ASP page. Currently, the invoice is drawn in a web page and my client prints the page from their browser. This doesn't work too well in terms of graphics resolution and also requires endless positioning tweaking on my part. Is there a way to use Word or Excel on the client, and send the invoice data down so that some sort of invoice template could be used? This needs to work on a Mac and...
2
4026
by: Andy Glew | last post by:
I have long looked for (and occasionally posted questions to groups such as this about) a tool that can take a group of HTML pages (nowadays XHTML, or XML) and produce a nicely formatted printable documented, featuring. * pagination * section numbering * including Dewey decimal section numbering such as Section 1.2.3 for H3
0
1042
by: Ivan Palèiæ | last post by:
Hi i need to make an invoice(report) with nummbers (like 1/04, 2/04...) but each Customer must have invoice starting with 1/04 referring to the date they must pay. An example Customer: Something MustPay_Date: 27/06 Invoice_NR: 01/04 following MustPay_Date: 30/06
15
5284
by: NomoreSpam4Me | last post by:
Hi there i have a little problem with my invoice. Here it is: i have a main menu with buttons, one of my button is "Create new invoice", when click on it a form pop up so i can enter my information and one of the field (the user cannot change the info in it.) is invoice #. Right now, everythime i click on "Create new invoice", the invoice # add 1. But my problem is sometime the employee dont fill it (for x reason) and shut it down,...
3
2893
by: Guoqi Zheng | last post by:
Dear sir, Our E-commerce site needs to print out a few 100s invoice a day. I do not know what is the best way to print invoice. Those invoice has to be printed on a very precise position on our invoice format paper. I am thinking about the following to print the invoice. 1. Ms Access Report. 2. ASP.NET web form.
1
4850
by: Herman Beeksma | last post by:
Hi there! I have two tables: Customer (ID, Name) Invoice (ID, Date, Customer, Amount) and want to select only the *last* invoice for each customer. It's easy to get each customer's last invoice date: SELECT Customer.Name, MAX(Invoice.Date) FROM Customer INNER JOIN Invoice ON Custimer.ID = Invoice.Customer
14
10484
by: eyalco | last post by:
I'm building a receipt/invoice database - I've started with the invoice first, then the receipt. I have invoice = parents and sons + receipt = parents and sons tables + a customer table. I want to issue 1 receipt with 12 payments (1 check for each month of the year) and then, everytime a check comes to delivery, the invoice is printed out with the receipt number. What would be the relation between the receipt/invoice tables and how do I...
6
5912
by: ConfusedMay | last post by:
Hi I need some helps in calculating the invoice amount in access 2003 report. Basically I have an access report that shows invoice#, invoice amount, payment amount, and payment date. The problem is some customers paid 2 - 3 times for 1 invoices (different amount and date) so when I total the invoice amount it duplicated since the report will show the same invoice amount for 2 payments for example: invoice number invoice amount ...
4
6678
by: gazza10001 | last post by:
Hi i hope you can help my company uses access and has modified for its needs usually what happens is you serach for the invoice by its number and then it brings all the information up such as entry fields and so there is a button you press which then takes to through to a print preview of the invoice and you print out the invoice but recent ly this message ahs started appearing and does not allow you to view the print preview of the invoice...
0
9703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9566
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10555
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10300
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2974
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.