->single table inheritance
dont understand what youre trying to do, but i'll say something anyway.
You have a transactions-model. then you have two types of transactions: incomings, outgoings.
now you can query: get me all in's. get me all transactions. etc.
Kaste,
I have 2 models in the stockmove controller:
var $models = 'stockmove, product';
I have two functions here:
function outgoing()
function incoming()
when I want to take to the stock any product I can use any quantity because it is incoming goods. when I want to make an outgoing transaction I must validate the quantity you know it is less or equal with the current quantity I have in the stock. Anyway I must to know in the validation the direction of the transaction, (addition/subtraction) I think not a good solution for this, if I begin to make a lot of models. The only difference is in the validation,
I hope I can wrote down clearly what is my problem
sorry, i dont get it.
validate against quantity must be >= 0 ?
of course if it's an outgoing. The main difference is the quantity check and the direction of the operation. The quantity in the post is irrelevant if the request was an incoming operation, but in the other case the quantity is important, and I must be check.
1 to 5 of 5