urlgensow = string \ concatenate ( 'http://crm.teamamericom.com/phpexcel/test4.php?accountid1=', id ); ifThenElse ( entity \ isAttributeChanged ('orderstatus'), orderstatusdt = datetime \ now() ); ifThenElse ( entity \ isAttributeChanged ('orderstatusi'), orderstatusdt = datetime \ now() ); ifThenElse ( entity \ isAttributeChanged ('orderstatusv'), orderstatusdt = 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', mrc = ifThenElse ( voice == 'New', ccblmrc + ccfflmrc + ccmlmrc - discountvoice, 0 ) + ifThenElse ( internet == 'New', ccimrc - discountinternet, 0 ) + ifThenElse ( video == 'New', ccvmrc - discountvideo, 0 ) ); ifThen ( client == 'COMCAST' && term == '24 Mo', commission = ifThenElse ( voice == 'New', ( ccblmrc + ccfflmrc + ccmlmrc - discountvoice ) * 0.5, 0 ) + ifThenElse ( internet == 'New', (ccimrc - discountinternet) * 0.5, 0 ) + ifThenElse ( video == 'New' && ( string \ CONTAINS ( string \ lowerCase (ccbcvideo), 'private' ) ), (ccvmrc - discountvideo) * 0.5, 0 ) + ifThenElse ( video == 'New' && ( string \ CONTAINS ( string \ lowerCase (ccbcvideo), 'public' ) ), (ccvmrc - discountvideo) * 1.5, 0 ) + ifThenElse ( phonesystemcommission != NULL, phonesystemcommission, 0 ) ); ifThen ( client == 'COMCAST' && term == '36 Mo', commission = ifThenElse ( voice == 'New', ( ccblmrc + ccfflmrc + ccmlmrc - discountvoice ) * 1.0, 0 ) + ifThenElse ( internet == 'New', (ccimrc - discountinternet) * 1.0, 0 ) + ifThenElse ( video == 'New' && ( string \ CONTAINS ( string \ lowerCase (ccbcvideo), 'private' ) ), (ccvmrc - discountvideo) * 1.0, 0 ) + ifThenElse ( video == 'New' && ( string \ CONTAINS ( string \ lowerCase (ccbcvideo), 'public' ) ), (ccvmrc - discountvideo) * 1.5, 0 ) + ifThenElse ( phonesystemcommission != NULL, phonesystemcommission, 0 ) );