b-b-a / bba-power

1 stars 0 forks source link

Changing tender selected if no meters #218

Closed ghost closed 11 years ago

ghost commented 11 years ago

Once of the checks is that a contract status cannot be changed from NEW if there is not at least one meter and a tender on it. At present, if a tender is added and then selected the status goes to tenderselected even if there is no meter on it. The check above is enforced by not giving the user the option - perhaps the tender selected field should be greyed out if there is no tender or no meter?

ghost commented 11 years ago

Update fails but No error message.

shaunfreeman commented 11 years ago

This seem to be working as asked

ghost commented 11 years ago

More detail: When I select a tender I expect the contract end date (and the status) to change. The tender selected is being set but the contract end date and the status are not (so partly correct but not required). However, it is not valid to select a tender when there are no meters (business logic - a tender is for a set of meters!!) We already disallow changing the contract status away from new when no meters. I suggest that the same logic that restricts the status to new only is used to grey out (or not show) the "select a tender" row. (we could also hide the 3 "new contract" document uploads - but leave for now). Also: Can we move the "select a tender" row to after the Type; before the Status.

shaunfreeman commented 11 years ago

tender select is greyed out if no meters on the contract.

The end date and status are changed if in the tendering process and then a tender is selected, otherwise these are not changed.

Is this OK?

ghost commented 11 years ago

Looking good - tender select is also greyed out if no tenders - this is good. Can I be a pain and suggest the status is done the same - greyed out if no meters or no tenders? (i.e. perhaps? edit.php - delete lines 108-111, insert 75 to grey out status?) (No need to force its content to just new of course)