Closed paulmallett closed 12 years ago
I think a hard error would be better for this. ie user cannot create a new meter if it exits already. could have the error message with a link to the meter that already exits on the system
error text is "A meter with "1234" MPAN already exists, please edit the existing meter." Need to change this - MPAN is only for Electric and editting the existing meter may not be appropriate. Suggest "This meter cannot be added as the meter Main No. already exists." (Note: We may need to adjust the comparison check to include numberTop - please see email discussion first) (Note-update: numberMain is unique so "as you were"). Also - Same hard check on Serial Number - "This meter cannot be added as the meter Serial No. already exists."
Summary and update (adding Water changes the rules a bit): The meter_numberMain is NO LONGER a required field. Hard error on duplicate meter_numberMain Hard error on duplicate meter_numberSerial Messages change: "This meter cannot be added as the meter Main No. already exists." (and Serial No.) Zero is not allowed in Top, Main, Serial Soft error if: Elec & Gas - meter_numberMain is empty; Water - meter_numberSerial is empty. e.g. "A Main No. has not been entered. Are you sure you want to continue?" Hard error if: Water - meter_numberMain & Top not empty; Gas - meter_numberTop not empty. "This meter cannot be added as a Main No. has been entered. (Main No. is not allowed for Water meters.)"
Just some notes of caution:
meter_numberMain must be allowed to be empty/blank, or entered as 0000000000000 with no duplication check, as we often start in a situtaion where we don't know meter_numberMain.
Stopping meter_numberMain being a required field is my preference.
I'm allowing for electric meters:
electric meters have a check digit and so can be validated as to a real meter number using this digit. the check digit is the last digit in the mpan number and validates the previous 12 digits, the algorithm is worked out thus:
We don't need the 0 thank you (I will remove them all from the DB). Just empty/blank and a real number. Having that check digit checked will be a real help.
Eddie
Excelent. Re: "Soft error if: Elec & Gas - meter_numberMain is empty; Water - meter_numberSerial is empty." Is it easy to split this check so the Elec & Gas only checks meter_numberMain and Water on;y check meter_numberSerial? (and have different messages?)
done a quick fix, hope it's what you are looking for.
Thats it - Thanks. Small problem with Gas - it always says a MainNo is not entered even if it is!!
Users should be prevented from creating a meter with the same MPAN13. They should be presented with a message that says something like "A meter with this MPAN already exists. Please edit the existing meter".
We do need to start generating 'soft' and 'hard' errors and have a method of handling them.