473,385 Members | 1,409 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,385 software developers and data experts.

Create Recurring Invoice

106 100+
Hi,

I am looking for guidelines to create a monthly recurring invoice using the following criteria.

We manage vehicles for Rental companies and therefore we require to invoice same amount each month. (monthly fee is based on 28-day month)

Invoice report must show vehicle reg, date vehicle acquired (or discharged) and management fee for each vehicle,

at the moment we have a set number of vehicles to manage but in future, a new vehicle may be acquired mid-month or it may be discharged mid-month and therefore payment will be calculated on the number of days managed (noofdays*(monthly fee/28))

table ACCVehicles - holds ownerID, Reg, DateAcquired, DateDischarged and data of managed vehicles

where do I go from Here?

As always, your help is appreciated and thanking you in advance.
Oct 17 '09 #1
12 6704
Yene
13
You have everything you need to create an invoice table. but I think you might also need a table for your customers and the cars you manage. After creating the 3 tables all you have to do is link the tables. are you using MS access or SQL for ur Database?
Oct 17 '09 #2
NeoPa
32,556 Expert Mod 16PB
What is the rate for these vehicles? Does it vary per vehicle, or is it global?
Do you store anywhere what has already been charged and, separately, what has been paid?

It really is most important that the data structure is sorted out first before any further design is done. Designing to the wrong structure is a very slow way to progress, and quite disheartening, as you have to keep throwing away and starting again.
Oct 18 '09 #3
tasawer
106 100+
Hi,

the rate for vehciles is global.
it is based on 28-day month
if we hold a vehicle for 10-days we charge (Rate/28)*10
if we hold for more then 28 days per month, the exra days are for free.

one method in mind is to create one Invoice with details of all vehicles per client and to copy this invoice every subsequent month.
If a vehicle is added or discharged, this can be dealt individually.
Fear is that all vehicles may not get included especially when one client hold 100+ vehicles.

The method in mind was to
1. Open Invoice Form
2. Select Client - and display all vehicles for this client
3. Create Invoice - All vehciles would be added to InvoiceDetail and charge rate calculated automatically.
Oct 18 '09 #4
NeoPa
32,556 Expert Mod 16PB
@tasawer
We figured you wanted to use Access rather than Excel.

I cannot recommend this approach for the sorts of figures you seem to be dealing with. A database approach would be far more suitable. That would include storing the relevant data in appropriate tables and producing an invoice in a Report which (obviously) would be designed around a query.

If you're interested in proceeding with a database approach I'm sure we can help you, assuming you can pass us the relevant information. Where, for instance, do you hold the value for the rate charged (not the calculation)?
Oct 18 '09 #5
tasawer
106 100+
I prefer the database method as this is an addition to my main database project that you have already seen.

I can certainly pass the database or other relevant details to you.

For the management rate, I could create a table with datestart and dateend fields. During invoiceing, rate can be picked up according to the date.
(Similar to what I did with the VAT rate)

I have a vehicle Managements table that is used to record each vehicle acitivty with VMREF as the invoice invoice number.
I prefer to use this table to hold the header info for the Management and use VMREF as the invoice number.

how would like the information.

Regards
Oct 18 '09 #6
Yene
13
It seems to me you have every thing in order, unless you want some help in putting the database together. i.e one car can have only one client owner, but a clinet can have more than one car. one car hold one slot in a holding plot. but holding plot can have many car and so on......
Oct 18 '09 #7
NeoPa
32,556 Expert Mod 16PB
I can't understand your answer tasawer. I thought it was a simple question. Where is the rate stored?

Your answer seems to introduce the idea that it is variable by date. This contradicts what has already been stated. I'm stuck on this until I get an answer that is consistent with your explanation so far - or some sort of explanation why it might not be.
Oct 18 '09 #8
tasawer
106 100+
sorry about the the confusion NEOPA.

we have been using the same rate in all our invoices for the last coupleof years, but planning ahead, I believe it will be better for the rate to be variable by date period.
Oct 19 '09 #9
NeoPa
32,556 Expert Mod 16PB
It's generally a good idea to keep the question still until a satisfactory answer has been received at least. I expect you can understand quite easily why this would be. Once an answer is working then variation may be introduced without danger of confusing everything too much.

Let me look at your updated question though, and see what I can come up with. It is clear now at least (as far as I can see now at least).
Oct 19 '09 #10
NeoPa
32,556 Expert Mod 16PB
So, working to the following data (you didn't give details of your Rate table so I made one up myself) :
Table = [tblRate]
Expand|Select|Wrap|Line Numbers
  1. Field      Type       Index
  2. Month      Date/Time  PK
  3. Rate       Currency
The Month value would be the Primary Key and would be the date of the first day of the month. The value returned for February from CDate("February 2010") in fact.
Table = [ACCVehicles]
Expand|Select|Wrap|Line Numbers
  1. Field           Type       Index
  2. ownerID         Number     FK
  3. Reg             String     PK
  4. DateAcquired    Date/Time
  5. DateDischarged  Date/Time
There would need to be a form ([frmInvoice]) with a control ([txtMonth]) containing the Date value of the month the invoice is required for.

The query (upon which the report could be built) would be something along the lines of :
Expand|Select|Wrap|Line Numbers
  1. SELECT tAV.Reg,
  2.        IIf(tAV.DateAcquired<CDate(Forms!frmInvoice.txtMonth),
  3.            CDate(Forms!frmInvoice.txtMonth),
  4.            tAV.DateAcquired) AS StartDate,
  5.        IIf(tAV.DateDischarged>=DateAdd('m',1,CDate(Forms!frmInvoice.txtMonth)),
  6.            DateAdd('m',1,CDate(Forms!frmInvoice.txtMonth))-1,
  7.            tAV.DateDischarged) AS EndDate,
  8.        tR.Rate*
  9.            IIf(DateDiff('d',StartDate,Enddate)>28,28,
  10.                DateDiff('d',StartDate,Enddate))/
  11.            28 AS MgmtFee
  12.  
  13. FROM   [ACCVehicles] AS tAV,
  14.        [tblRate] AS tR
  15.  
  16. WHERE  ((tAV.DateAcquired<DateAdd('m',1,CDate(Forms!frmInvoice.txtMonth)))
  17.   AND   (tAV.DateDischarged>=CDate(Forms!frmInvoice.txtMonth))
  18.   AND   (tR.Month=CDate(Forms!frmInvoice.txtMonth)))
NB. This produces a Cartesian Product set of data until the WHERE clause kicks in. It should nevertheless produce the correct results (assuming I've got it right).

Clearly, you can choose your own names for the objects, but the code would need to reflect these changes if you choose to.
Oct 19 '09 #11
tasawer
106 100+
Excellent solution NeoPa especially when my information was breif. I have a better understanding of it now.

let me give more details now that I understand it better:

Below are the fields used in the table "VehicleManagement" and form "mgmtInvoice"
Expand|Select|Wrap|Line Numbers
  1. ManagedID Autonumber
  2. VMRef (invoice Number)
  3. ManagedCoID (VehicleOwner) (Same as VehicleOwnerID in ACC_Vehicles)
  4. mgmtMonth (Month for Invoice)
  5. mgmtFEE
  6.  
on the form "mgmtInvoice"
  • I create a new invoice and VMREF is inserted using DMAX
  • Month for invoicing is automatically inserted in mgmtMonth
  • mgmtFEE is picked up from a table of Rates
  • using a combox, I select my customer ManagedCoID
at this point, in a subform, I want to list all the vehicles for this customer and assign the mgmtFEE to each vehicle.

we manage vehicles for long period of time therefore we need to invoice for every month of management. (Your current solution lists only discharged vehicles)
if a vehicle comes in on January 24th 2008, and discharged December 20th 2009, we will charge 7 days for January and 20 days for december but full mgmtFEE for all other months. Thereafter this vehicle must not be listed in any of the invoices.

query will be named mgmtDetails

I hope this is clearer.
Oct 21 '09 #12
NeoPa
32,556 Expert Mod 16PB
I don't really want to start rethinking all this again from scratch, but I realise now that it does indeed ignore items where there is no discharged date. That concept wasn't really introduced, to be fair, but had I thought about it more deeply I would have realised it must be so.

What I propose is that I give an example of what is required using the scenario outlined before, and you can implement that within your own scenario. Should you then encounter difficulties then come back and explain what you are struggling with, and I'll do what I can to help.
Expand|Select|Wrap|Line Numbers
  1. SELECT tAV.Reg,
  2.        IIf(tAV.DateAcquired<CDate(Forms!frmInvoice.txtMonth),
  3.            CDate(Forms!frmInvoice.txtMonth),
  4.            tAV.DateAcquired) AS StartDate,
  5.        IIf((tAV.DateDischarged Is Null)
  6.         OR (tAV.DateDischarged>=DateAdd('m',1,CDate(Forms!frmInvoice.txtMonth))),
  7.            DateAdd('m',1,CDate(Forms!frmInvoice.txtMonth))-1,
  8.            tAV.DateDischarged) AS EndDate,
  9.        tR.Rate*
  10.            IIf(DateDiff('d',StartDate,Enddate)>28,28,
  11.                DateDiff('d',StartDate,Enddate))/
  12.            28 AS MgmtFee
  13.  
  14. FROM   [ACCVehicles] AS tAV,
  15.        [tblRate] AS tR
  16.  
  17. WHERE  ((tAV.DateAcquired<DateAdd('m',1,CDate(Forms!frmInvoice.txtMonth)))
  18.   AND   ((tAV.DateDischarged>=CDate(Forms!frmInvoice.txtMonth))
  19.    OR    (tAV.DateDischarged Is Null))
  20.   AND   (tR.Month=CDate(Forms!frmInvoice.txtMonth)))
Oct 21 '09 #13

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...
7
by: Patrick Fisher | last post by:
Hi I have a table which Contains entries with RefCode field containing INVP or INVPD Common fields in each entry would be InvoiceNo, Total and PurTyp for example. You could have ...
1
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...
2
by: rrhistory | last post by:
I have an access database with information such as name, address, item buying, cost, qty etc. This was in excel originally, but I thought Access would be the better way to create the forms I need. ...
4
by: lawazia | last post by:
I am doing a project in which I have to create INVOICE reports I am using VB6 and Active reports. I am facing problem while creating a multipage invoice report. If the invoice report generated...
2
by: kathnicole | last post by:
Hi All, i am using MS Access 2003 and i need to know how generate an invoice in ms word from Access database with the invoice date to be the same. for example, the invoice consists of the...
4
by: ringer | last post by:
I have a db where each record is a certain task to be done. Each record includes the date the task should be completed. Some of the tasks are one time only but some are recurring. I have been having...
3
by: mlb992000 | last post by:
I am creating an invoice with a subform. I have a table with the vendor info and an invoice table. I am able to create a form that will pull up all the information on a particular vendor when I...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.