Log in Session for billing purpose.


I have this idea which I need some help with. Currently I am developing a mysql database with a java interface. It is a hotel management system, and for billing purpose. I have the following tables.

Bill (BillID, ResvID, IssueDate, ToTalBill, ChargedTo)

Employee (EmpID, Name, Age, Nationality, NatId, Mobile, Telephone, Email, Position, Language, Salary, JoinDate)

User(UserID, Password)

as per the requirements, the ID number of the employee (UserID or EmpID) should be printed on the bill.

Any suggestions or ideas about implementing this ?

more ▼

asked Jan 04, 2012 at 02:21 AM in Default

Sasha gravatar image

11 1 1 1

(comments are locked)
10|1200 characters needed characters left

1 answer: sort newest

You have no direct link between the bill and the employee.

There is a ResvID, which I'm guessing is a reservation ID - does that link to a table that has a link to employee?

In fact which employee should it use? The one who made the reservation, the one who confirmed it, the one who checked in the guest, the one who printed the bill? You need more information.
more ▼

answered Jan 04, 2012 at 02:27 AM

Kev Riley gravatar image

Kev Riley ♦♦
54k 47 49 76

+1 from here. I was about to say that more info is required but then find out that you were already on it :) I think you added the details which might not be in the mind of OP :) But my guess is it would be the one who is printing it by looking at the OP's words (UserID or EmpID) where UserID could be there only to login into the system.
Jan 04, 2012 at 02:37 AM Usman Butt

Thanx for your prompt response. Basically, to log in the system the user has to log in (front desk receptionist). The employee table includes list of all the employees, and there is another table User (who are the users of the system, In other words, User has to be an employee and not all the employees are users )

I did not link the reservation table to the employee, but it is linked to the Bill table as the system has to record only the ID of the employee/user who received the payment for the bill.

Thanx again.
Jan 04, 2012 at 02:45 AM Sasha

This is my initial ERD diagram.

Jan 04, 2012 at 02:51 AM Sasha
If I understand correctly, you need to check which user have printed the bill? If I were you I would handle it from application level. It would require minimal changes in your environment. Otherwise, structural change would be an additional change along with application level change.
Jan 04, 2012 at 03:06 AM Usman Butt
As Usman has said, this is an application level concern, unless you store an audit history of who printed what, when
Jan 04, 2012 at 03:16 AM Kev Riley ♦♦
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Jan 04, 2012 at 02:21 AM

Seen: 654 times

Last Updated: Jan 04, 2012 at 02:24 AM