ifThenElse ( entity \ isAttributeChanged ('stage'), stagedt = datetime \ now() ); ifThen ( discountvideo == NULL && client == 'COMCAST', discountvideo = 0 ); ifThen ( discountvoice == NULL && client == 'COMCAST', discountvoice = 0 ); ifThen ( discountinternet == NULL && client == 'COMCAST', discountinternet = 0 ); ifThen ( ccblmrc == NULL && client == 'COMCAST', ccblmrc = 0 ); ifThen ( ccfflmrc == NULL && client == 'COMCAST', ccfflmrc = 0 ); ifThen ( ccmlmrc == NULL && client == 'COMCAST', ccmlmrc = 0 ); ifThen ( ccimrc == NULL && client == 'COMCAST', ccimrc = 0 ); ifThen ( ccbl == NULL && client == 'COMCAST', ccbl = 0 ); ifThen ( ccffl == NULL && client == 'COMCAST', ccffl = 0 ); ifThen ( ccml == NULL && client == 'COMCAST', ccml = 0 ); ifThen ( client == 'COMCAST' && stage == 'Closed Won', mrc = ( ( ccblmrc + ccfflmrc + ccmlmrc + ccimrc + ccvmrc ) - ( discountinternet + discountvideo + discountvoice ) ) );