How to model plots when you do not know how many?

4

Typically, when it comes to installment payments, you get the idea of 12 installments.

So you soon create a table with 12 fields, one for each parcel.

But I am faced with the situation where the customer is a consumer of continuous service provision: internet radio client.

That is, there is no parcel 1 of x.

In this case, what would the logic of creating the classes and tables look like?

    
asked by anonymous 18.09.2015 / 16:55

2 answers

5

If you want the logic should not be tags PHP and SQL. Nor will I give you everything ready that is not the purpose of the site. I will not go into more detail about these tables because the question gives no details. If you have specific questions, post specific questions.

It's very simple. The error already begins with the idea that fixed benefits exist. The client does not have a debt with 12 installments, he has 12 debts.

You may have a contract that originated these debts and you may want to link to it. If it is the case, just do the linking through a field, just as it will link the debt with the client. If the binding with a contract is mandatory, nor does it need to link with the customer, because the contract will already have this link.

Notice that I'm speculating here, you do not talk about contract or other details. It is harder to help without understanding the whole problem. In fact these problems usually happen because they lack the right conceptualization. And this can not help much without a long conversation, which is not the purpose of the site.

But if you have to manage contracts, you have a lot involved.

In any situation you should use a table with each invoice / boleto / duplicate / promissory note / forecast / etc. Each document must have an entry in this table. So you can have as many as you want, you can have 1, 12 or thousands.

This is especially necessary when the quantity is indeterminate. Each title (generic name given to what is being charged) is being inserted into the system gradually. Probably for a generator. You can not post 3, 12, or 1000 titles to the customer unless there is a contract saying you have that amount. In indefinite contracts each title is generated month by month while the contract is not terminated.

The amount can vary from one month to the next. Whether by correction, change of package, accessory services, discounts for faults, promotions, adjustment of past charges, etc. If you do not know the value, you can not launch automatic, mainly with much anticipation. You can even automate the monthly release.

There must be control over what will be generated if you want to automate this part. Which is a part of contract control I said before. Automation can launch a new title each month with base value. This value can be adjusted by contract management. He may consider manual postings that are made on a month-to-month basis or that are incidentally recorded in the contract or contract addendum.

But it can be done manually with some control if the month's title has been generated for all clients. It's a simpler, less-costly way for the programmer and more for the user.

There are several ways you can implement this, and we'll be able to help you with more details.

Anyway, most systems are more complicated than they seem and it is not possible to pass all information in a single response on any given site.

Learn about standardization .

    
18.09.2015 / 17:10
2

I think the most appropriate thing is to create a table with already paid installments, it depends a little on how your system is.

Paid installments must have the fields, parcel_id, pay_date, value, can have the counter id (if there is an agreed value that will be charged for 12 months, after which a new contract with a new value is made) or id customer.

    
18.09.2015 / 17:10