b-b-a / bba-power

1 stars 0 forks source link

Contract Edit - select tender - update contract end date #200

Closed ghost closed 11 years ago

ghost commented 12 years ago

When a contract is changed to select a tender: Update the contract End Date to be the contract Start Date plus the Contract Period (from the tender) less 1 day. Plan is to get a 12 month contract that starts 4/5/2012 to finish on 3/5/2013 etc. The End Date can still be changed manually after this if there needs to be a part month.

ghost commented 12 years ago

Sorry, This needs doing when a Tender is Selected (changed from blank to a value) - 2nd field on the edit display. AND (I missed this) If the new Status is "new" or "Out to tender" or "choosing tender" the status should be changed to "Tender Selected" (i.e. it has to be at least tender selected but could be further on in which case don't set it back.) [But working so far.] [My long term aim is to not have the user need to adjust the Status at all - it should be set when they do things but that could be a loooong time coming! e.g. Update the status to signed when a doc is leaded into the Both Signed or perhaps Client Signed - have to check with Paul when they are used to the Docs]

shaunfreeman commented 12 years ago

I've adapted this now to update whenever a new tender is selected and status is changed on 'new', 'choose', 'tender' to 'selected' now. If the status is any other it is left alone.

ghost commented 12 years ago

Fiddle: When a tender is selected the contract end date is calculated. BUT if the (new) contract status is past 'selected' AND the end date is after the start date, we should not change it. (if the end date is before the start date we should calculate the date whenever a tender is selected.)

i.e. Had a contract that is current with no tender selected - selected it and the date was calculated, unfortunately the contract length is not a whole number of months so the new date was wrong! Need to leave the date alone for the later statuses.

Later: Tried to correct the date - it would not accept my input. Is it calculated on every edit? Please only try to calculate the end date if the tender selected field is changed. (Same with the status field?)

-- Sorry about the large font - lord knows why it is doing that !! --

shaunfreeman commented 12 years ago

I have removed this for now. so I can get it right.

Do you want this happening at the client level?

ghost commented 12 years ago

Do you want this happening at the client level? No, I don't think so. The issue appears to be that the "calculation" is done as part of the submit of an update to the contract. It is less likely to cause a problem if the date calculation is only done when the field - selectedTender is changed ("when it is changed" not "whenever it is found to be set"). Similarly, the change of status should only be done (ie automatic) when the field - selectedTender is changed. Note: The number of months in the tender is a "hint" rather than an accurate piece of information. It is to help the supplier get the tender right and the customer make decisions. Once a tender is chosen the actual dates are set by the BBA User.

Sorry - I was probably not being clear, please feel free to talk if we need to (but after the weekend - I am away).

Eddie

Eddie Pounce Pounce Computer Services 01767 348186 http://www.p-cs.co.uk

On 26/10/2012 14:13, Shaun Freeman wrote:

I have removed this for now. so I can get it right.

Do you want this happening at the client level?

— Reply to this email directly or view it on GitHub https://github.com/b-b-a/bba-power/issues/200#issuecomment-9812436.

shaunfreeman commented 12 years ago

is this OK now