0
I am developing an order control system, and I am finalizing, but now I came across a problem in the payment part scheme:
I’m linking the id_pedido
with the payments, however, when the request costs R$48,90
and the paid person R$50,00
, I have to give R$1,10
in return, I’m saving the R$50,00
in the database to then subtract with the total value, to the note to leave the change value, until then everything right, but when to generate the reports it will give me a lot of headache, and I can not think of another way to make that part of the change, because you need to be saved in the changed note.
The person can pay more one way, let’s assume cash and card.
Tax note? PHP? Ai!. I see no problem there, exveto use the wrong tool for the problem. Unless that’s not the problem and it’s not clear.
– Maniero
Problem is more in logic than in programming. If there is more than one form of payment then you have a relationship 1 to N ( 1 order for N forms of payment), only enter in the Order Relation Table and Payment Type the amount paid in each form. Sum all and subtract from the total order value.
– Don't Panic