Attach a payment to one or multiple services

I have a structure of 3 tables: 

1) Booking Table
2) Service Table
3) Payments Table

I want to enter payments to the payment table, which should basically show as a total amount paid by the customer. And then have the ability to attach the payment to one or multiple services in the service table.

Is there any sample app or guide for this?

0 3 79
3 REPLIES 3

Sounds like you're developing an app for the horizontal business loll ๐Ÿ˜†

@Denny774 Hahah nice one!

I will try to explain in a better way:

Goal: Attach a payment that is entered to a specific service under a booking.

App description: It is a service booking app for a pet boarding facility. The tables available in the system are:

(1) Customer Database - Contains the customer details.  
(2) Pet Details - Contains pet related details
(3) Service Bookings - Contains bookings that are created with a reference to a pet.
(4) Service Availed - Contains variety of services availed under a single booking.
(5) Service Details - This acts like a master for all the services provided by the facility along with the price of each service.
(6) Payment Details - Payment made by the customer is entered here.

Currently, the relationship is as follows:

One customer can have multiple pets --> One pet can have multiple bookings --> One booking can have multiple services & payments.

So, as soon as I enter a service under a booking, it showcases the price of the service & total amount to be paid.

Once the customer pays for the services availed, I enter it in the payment table.

I want to know how can I assign a payment to one or multiple services under one booking so that the total amount due becomes 0.

Please assist on this. 

Aditya_Vinayak__0-1706466173989.png

These are the fields for the service availed table

Top Labels in this Space