Doubt of Concept when registering parcels in the database

Asked

Viewed 430 times

1

Personal case I have a sale to be registered, with contract number, customer data and among others and I have sales fields with plots... Here comes my question, should I create a table of plots interconnected by the sales number and each record of a sale generates multiple plots record? For example I make a sale in 3x and register 3 records in my table of interconnected plots by the same purchase ID? Also because I need to inform the payment date of each one, if there was discount and finally.

  • What are your options? I mean, if not in another table, how would you store this information that you already know you need?

  • @Caffé I have no option, I ask because this is the only one I thought, I wanted to know what is done today in the "market".

  • 1

    Got it. Considering the requirements you described, it’s done just like you suggested.

  • Okay! Thank you so much @Caffé

  • @Rafaelassmann a tip is to remember to have a control also of the amount due. Because it often occurs that one pays only a part of a plot.

  • @Giovaniracipaganini yes! I have the balance in the database, thank you very much!

Show 1 more comment

1 answer

1

I am a commercial system developer and I suggest the following: Since you need to control the payment and discount of each, the ideal is to create the table in the way you described by relating by ID. I also suggest that you create a routine to not exclude these installments in case of chargeback, or cancellation of the sale. One way to do this is to place an "active" field in the plot table, if true the plot is active. A basic structure would be: Id, Sale ID, Installment Date, Payment Date, Installment Value, Value Paid, Active

Other fields would be: status: em_cobrança_tel, em_cobrança_juridica, acordo etc

  • I understood perfectly, thank you very much!

Browser other questions tagged

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