difficulty with relation of payment tables

Asked

Viewed 270 times

0

I’m having difficulty creating tables in the database to work with payment, I’m creating the pay table with the value of the total payment and other cash tables, promising, check, boleto, card and bemmaterial, each with the payment table id. Someone can help me in the relationship between these tables and whether it can be right or wrong. How it would look in relation to the cancellation of a product within a purchase to reference some payment made

Image of the attached tables:

inserir a descrição da imagem aqui

  • would never make several tables like this... everything is financial movement, everything has date, value, a related person, etc.... and if the customer wants to receive payments by online service (picpay, paypal, etc...) more tables ? and when adding up all this... how many unions will need ? simplify to the maximum, rs

  • If I create a payment-only table and specify the form of payment if it would be money, card, promise etc. If this is how it would be to create 3 promising or billet routes, I would have to duplicate the data ?

  • 3 ways ? I believe that ways you print as many as you want...but only stores one, if you are referring to parcels, each parcel is a different movement, having different dates, and even different values.

  • but would need to store different dates of these tracks(in this case, parcels), maybe different values too, hence how to do this, another table to store these parcels with date and value and the payment id?

  • Each portion, is a different movement, I will elaborate a response and put trying to explain better

  • may be mistaken but creating this form of tables that I presented I could insert as many values I wanted in different forms of payments referred to a single payment (BUT THE PROBLEM ARISES BECAUSE THEY BECOME DEPENDENT ON THIS PAYMENT TO EXIST? for example the check can go from one place to another)

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.