Asked by: Rodolfo Lozano
Currently I have a project in which we register the payments of our clients in a table named payments (id, id_payment_type, bank, reference_number, value, description)
, I have a invoice table (id, client_id, value)
and a client table (id,name,address,etc)
too.
The relationship that I have used for payments - invoices have been many to many.
I haven't got any issues so far with fully payments, we can add a new payment from a client for multiple invoices but I would like to implement partials payments for a given invoice and I really can't think in a proper way to do this.
I want to add like another section for example: Partial Payment, where I can select a single invoice and pay whatever value he paid me in advance, and save this info in the db, I don't know if i should add a new table or keep using payments table (since the relationship that I'm using is many to many).
Also I should reflect the new value of the invoice(after the partial payment) in the next payment, but not modifying the original total amount of the invoice.
Sorry if I don't make myself clear enough, English its not my native language.
I appreciate any kind of suggestions and thanks in advance for you time.
No comments:
Post a Comment