Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. help me with outstanding rental payments

help me with outstanding rental payments

Scheduled Pinned Locked Moved Database
helpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    twsted f8
    wrote on last edited by
    #1

    Hi I am currently developing hostel management software for a local hostel. I am trying to find a way of identifying those residents who have outstanding rent payments. The hotel/ youth hostel requires that its guests pay their rentals at the beginning of the month. The residents often stay at the hostel for periods that are often over 5 months.I need to find a way of finding out which residents have paid their renatals, and which ones have not paid their rents. This is further complicated by the fact that some residents will make one large payment at the beginning of their session and this is meant to cover them for the duration of their stay. Each session has one account, and the total payments made are stored in the acount. I have also included the rate charged per day and the startdate of the session into the table, such that it is possible to calculate the amount that is owed and this figure can be some how be compared to the amount that has been paid. Given these circumstances, how can I find the residents who have outstanding rents. I havce included the table defs below. Please do feel free to help me. create table sessions ( sessionNumber int Identity Not null Primary Key, startdate smalldatetime not null, enddate smalldatetime not null, sessionType char(15) not null, duration int not null, roomNumber char(5) not null references Rooms (roomNumber), idNumber char(15) Not null references guestinfo (idnumber), ) create table accounts ( receiptNumber int Identity Not Null primary key, amountpaid money not Null, datepaid smalldatetime not null, roomNumber char(5) not null references rooms(roomNumber), sessionNumber int Not null references sessions(sessionNumber), paymentType char(10), userName char(15) Not Null references users (username), ) ---create table accpayments--- ( accountNumber int identity Not Null primary key, sessionNumber int not null references sessions(sessionNumber), totalpaymentsmade money not null, amountowing money not null, rate money not null ) twsted f8

    P 1 Reply Last reply
    0
    • T twsted f8

      Hi I am currently developing hostel management software for a local hostel. I am trying to find a way of identifying those residents who have outstanding rent payments. The hotel/ youth hostel requires that its guests pay their rentals at the beginning of the month. The residents often stay at the hostel for periods that are often over 5 months.I need to find a way of finding out which residents have paid their renatals, and which ones have not paid their rents. This is further complicated by the fact that some residents will make one large payment at the beginning of their session and this is meant to cover them for the duration of their stay. Each session has one account, and the total payments made are stored in the acount. I have also included the rate charged per day and the startdate of the session into the table, such that it is possible to calculate the amount that is owed and this figure can be some how be compared to the amount that has been paid. Given these circumstances, how can I find the residents who have outstanding rents. I havce included the table defs below. Please do feel free to help me. create table sessions ( sessionNumber int Identity Not null Primary Key, startdate smalldatetime not null, enddate smalldatetime not null, sessionType char(15) not null, duration int not null, roomNumber char(5) not null references Rooms (roomNumber), idNumber char(15) Not null references guestinfo (idnumber), ) create table accounts ( receiptNumber int Identity Not Null primary key, amountpaid money not Null, datepaid smalldatetime not null, roomNumber char(5) not null references rooms(roomNumber), sessionNumber int Not null references sessions(sessionNumber), paymentType char(10), userName char(15) Not Null references users (username), ) ---create table accpayments--- ( accountNumber int identity Not Null primary key, sessionNumber int not null references sessions(sessionNumber), totalpaymentsmade money not null, amountowing money not null, rate money not null ) twsted f8

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      You would need to write a query that returns: i) the total rent incurred thus far by each guest. This would presumably be the the number of days elapsed since the guest began their stay, multiplied by their daily rate ii) the total amount paid by the guest thus far Subtracting ii) from i) should give you the total amount currently owed by each guest. Regards Paul

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups