I have an orders table and a payments table.

I have joined them with a HABTM relationship (A payment may apply to
many orders).

I mean, when a client pays 1000$ (a payment), this payment applies
e.g. as follows: 200$ are for order #1, 500$ are for order #3, 300$
are for order #10.

So, I though of adding an extra field "amount" in the join table
"orders_payments".

I cannot find the way that the payment add view should be created (the
form).

I would like to enter the amount of the payment (the total) and have
underneath a list of orders with amount_due > 0 from which I would
select and apply an amount to each one of them.

Also, how should I make sure that the total amount that is delegated
to each order is equal with the total payment amount?

Is it possible?

Thank you for any help.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to