$value) { $property[extension]["propertyextension".$k] = $value; } $skip=1; } unset ($COMPANYSIDE); switch ($name) { case "hoaid": $dname="HOA"; $hoafieldsid=1; break; case "hoa2id": $dname="HOA2"; $hoafieldsid=2; break; case "hoa3id": $dname="HOA3"; $hoafieldsid=3; break; } if ($property && !$skip) { if (array_key_exists("propertyid",$property)) { $prefix = "property"; $db_table_prefix =""; $COMPANYSIDE = 1; $hoaid=$property[$name]; }elseif (array_key_exists("clientcompanypropertyid",$property)) { $prefix ="propertyextension"; $db_table_prefix="clientcompany"; } } elseif (clientcompanyid() || $skip) // at this time we are unable to find propertyid or clientcompanypropertyid therefore we assume we are adding new property { $prefix ="propertyextension"; $db_table_prefix="clientcompany"; }elseif (companyid()) { $prefix = "property"; $db_table_prefix =""; $COMPANYSIDE = 1; }else { // Changed from die to dlog so that the previews work with any values if (is_developer()) dlog(hoa,"Developer error. Parameter is missing. HOA parameters passed in: property".$property." value ".$value); else return ""; // I hope we will never get this message. Return blank because of the previews without any values } echo"
$dname :"; $thisstate = $db_table_prefix."propertystate"; $dropdownlengthrestriction=110; if ($COMPANYSIDE || client_portal()) { $sql = "select * from tblhoa where companyid = '".db_number(companyid())."' and hoainactive is null order by hoaname asc"; $my_hoas = db_query($sql); $exclude = ''; if($my_hoas) { foreach($my_hoas as $key => $hoa) { if($exclude) $exclude .= ','; $exclude .= $hoa['hoaid_master']; } $my_hoaarray[0][id]=" "; $my_hoaarray[0][value]="**************** My HOA's *****************"; $my_hoaarray[0][label]=1; $i=1; foreach ($my_hoas as $key=>$hoa) { $my_hoaarray[$i][id]=$hoa['hoaid']; $my_hoaarray[$i][value]=$hoa['hoaname']; $i++; } } } $sql = "select hoaid ,hoaname ,hoaaddress ,hoacity ,hoastate ,hoazip ,hoacontact ,hoaphone ,( 'n-' || coalesce(hoaname,'') || '-a-' || coalesce(hoaaddress,'') || '-c-' || coalesce(hoacity,'') || '-s-' || coalesce(hoastate,'') || '-z-' || coalesce(hoazip,'') || '-ct-' || coalesce(hoacontact,'') || '-p-' || coalesce(hoaphone,'') ) as hoakey from tblhoa"; if ($property) { $sql .=" left join ( select name,code from tblstate where code = '".db_col($property[$thisstate])."' or name ='".db_col($property[$thisstate])."') tblstate on (tblstate.name = hoastate or tblstate.code = hoastate)"; } $sql .=" where companyid = 0 and hoaid_master = 0 "; if($property) $sql .=" and (hoastate = name or hoastate = code) "; $sql.= " and hoainactive is null "; if ($exclude) $sql .=" ". ($exclude ? "and hoaid not in (".$exclude.")" : ""); $sql .= " order by hoaname asc"; global $hoanodups; if($hoanodups && is_array($hoanodups)) $hoas=$hoanodups; else { $hoas = db_query($sql); if($hoas) { if(!strstr($_SERVER['SCRIPT_NAME'],'property_add.php') && ($_GET['action']!='add')) $hoas=hoa_removeduplicate($hoas); //Cache for same page because sometimes same date pulled 3 times. $hoanodups=$hoas; } } if ($hoas) { if ($property) $insertstate ="( $property[$thisstate] )"; $hoaarray[0][id]=" "; $hoaarray[0][value]=" ********* HOA State $insertstate Database **********"; $hoaarray[0][label]=1; $i=1; foreach ($hoas as $key=>$hoa) { $selectiondisplay=$hoa['hoaname']; $dupfields=""; if($hoa['hoacontact']) $dupfields.=" ".$hoa['hoacontact']; if($hoa['hoaphone']) $dupfields.=" (".$hoa['hoaphone'].")"; if($hoa['hoaaddress']) $dupfields.=" ".$hoa['hoaaddress']; if($hoa['hoacity']) $dupfields.=" ".$hoa['hoacity']; if($hoa['hoastate']) $dupfields.=" ".$hoa['hoastate']; if($hoa['hoazip']) $dupfields.=" ".$hoa['hoazip']; if($dupfields) { if((strlen($dupfields)+strlen($selectiondisplay)+4)>$dropdownlengthrestriction) { $duplenrestrict=$dropdownlengthrestriction-(strlen($selectiondisplay)+4); if($duplenrestrict<0) $duplenrestrict=0; $dupfields=substr($dupfields,0,$duplenrestrict)." ..."; } $selectiondisplay=$selectiondisplay." - [".trim($dupfields)."]"; } $hoaarray[$i][id]=$hoa['hoaid']; $hoaarray[$i][value]=$selectiondisplay; $i++; } } if ($my_hoaarray && $hoaarray) $hoaarray = array_merge ($my_hoaarray,$hoaarray); elseif (!$hoaarray) // we got 0 HOA for this state going national. { if ($COMPANYSIDE) { $mystates = get_mystates(); $sql = "select * ,( 'n-' || coalesce(hoaname,'') || '-a-' || coalesce(hoaaddress,'') || '-c-' || coalesce(hoacity,'') || '-s-' || coalesce(hoastate,'') || '-z-' || coalesce(hoazip,'') || '-ct-' || coalesce(hoacontact,'') || '-p-' || coalesce(hoaphone,'') ) as hoakey from tblhoa left join( select name,code from tblstate"; if($property) $sql .=" where code = '".db_col($property[$thisstate])."' or name ='".db_col($property[$thisstate])."')"; if (!$property) $sql .=" where code in ('" .implode("','",$mystates)."') or name in ('" .implode("','",$mystates)."'))"; $sql .=" tblstate on (tblstate.name = hoastate) where (companyid = '".db_number(companyid())."' or companyid = 0) and hoaid_master = 0 and hoainactive is null "; if($property) $sql .=" and (hoastate=name or hoastate=code) "; if (!$property) $sql .="and hoastate in ('" .implode("','",$mystates)."') "; if ($exclude) $sql .=" ". ($exclude ? "and hoaid not in (".$exclude.")" : ""); $sql .=" order by hoaname asc"; global $hoanationalnodups; if($hoanationalnodups && is_array($hoanationalnodups)) $hoas=$hoanationalnodups; else { $hoas = db_query($sql); if($hoas) { if(!strstr($_SERVER['SCRIPT_NAME'],'property_add.php') && ($_GET['action']!='add')) $hoas=hoa_removeduplicate($hoas); //Cache for same page because sometimes same date pulled 3 times. $hoanationalnodups=$hoas; } } if ($hoas) { $insertstate=""; if ($property) $insertstate ="State( $property[$thisstate] ) "; $hoaarray[0][id]=" "; $hoaarray[0][value]=" ********* HOA ".$insertstate."Database **********"; $hoaarray[0][label]=1; $i=1; foreach ($hoas as $key=>$hoa) { $selectiondisplay=$hoa['hoaname']; $dupfields=""; if($hoa['hoacontact']) $dupfields.=" ".$hoa['hoacontact']; if($hoa['hoaphone']) $dupfields.=" (".$hoa['hoaphone'].")"; if($hoa['hoaaddress']) $dupfields.=" ".$hoa['hoaaddress']; if($hoa['hoacity']) $dupfields.=" ".$hoa['hoacity']; if($hoa['hoastate']) $dupfields.=" ".$hoa['hoastate']; if($hoa['hoazip']) $dupfields.=" ".$hoa['hoazip']; if($dupfields) { if((strlen($dupfields)+strlen($selectiondisplay)+4)>$dropdownlengthrestriction) { $duplenrestrict=$dropdownlengthrestriction-(strlen($selectiondisplay)+4); if($duplenrestrict<0) $duplenrestrict=0; $dupfields=substr($dupfields,0,$duplenrestrict)." ..."; } $selectiondisplay=$selectiondisplay." - [".trim($dupfields)."]"; } $hoaarray[$i][id]=$hoa['hoaid']; $hoaarray[$i][value]=$selectiondisplay; $i++; } } if ($my_hoaarray && $hoaarray) { //d("merge",$my_hoaarray); $hoaarray = array_merge ($my_hoaarray,$hoaarray); } else { $hoaarray=$my_hoaarray; } } } if ($COMPANYSIDE) { $hoaprefix="property".strtolower($dname); $sql = " select * from tblproperty where propertyid = '".db_number ($property[propertyid])."'"; $hoadata=db_first($sql); } else { $hoaprefix="propertyextension".strtolower($dname); if ($property) { $hoadata1=$property[extension]; unset($hodata); d($hoadata1); if (is_array($hoadata1)) { foreach ($hoadata1 as $row=>$extension) { if(strstr($row,'propertyextensionhoa')) $hoadata[$row]=$extension[propertyextensionentryvalue]; } $hoaid = $hoadata1[$name][propertyextensionentryvalue]; }else unset ($hoaid); } if (!$hoadata) { $hoadata1=$_POST; unset($hodata); d(myhoa, $hoadata1); if (is_array($hoadata1)) { foreach ($hoadata1 as $extension) { if(strstr($row,'propertyextensionhoa')) $hoadata[$row]=$extension[propertyextensionentryvalue]; } $hoaid = $hoadata1[$name]; }else unset ($hoaid); } if ($skip) { $hoadata = $hoadata1; $hoaid = $hoadata[propertyextensionhoaid]; } // AMC Hack to show any hoa that we have id if ($hoaid) { unset($foundhoa); foreach ($hoaarray as $key=>$value) { if ($value[id] == $hoaid) $foundhoa=1; } if (!$foundhoa) $hoaarray[]=db_first("select hoaid as id, hoaname as value from tblhoa where hoaid=".db_number($hoaid)); } } if (!$hoaid && $GLOBALS[customfield_viewonly]) // no hoa selected in readonly mode no need to process any further { echo "
"; return ob_get_clean(); } ?> "; echo ""; echo" "; // strip prefix and make temparray if ($hoadata) { foreach($hoadata as $fld =>$val) { if (preg_replace("/".$hoaprefix."/","",$fld)!=$fld) { $hoadata[preg_replace("/".$hoaprefix."/","",$fld)]=$hoadata[$fld]; unset ($hoadata[$fld]); } } } $yesvl=0; $novl='checked'; if($hoadata[assessment]) { $yesvl='checked'; $novl=0; } echo "
Monthly Dues $ "; customfield ('money',strtolower($hoaprefix.'dues'),$hoadata[dues]); echo "
Sign Restriction: "; if($hoadata[signrestriction]=='n' ) $hoadata[signrestriction]=""; if($hoadata[signrestriction]=='y' ) $hoadata[signrestriction]="Yes"; $signyn[""]=No; $signyn[Yes]=Yes; customfield('select box',strtolower($hoaprefix.'signrestriction'),$hoadata[signrestriction] ,$signyn,"onchange=\"$('#signrestrictrow$hoafieldsid').hide();if(this.value=='Yes')\$('#signrestrictrow$hoafieldsid').show()\""); echo "
Restriction Note "; customfield ("textarea",strtolower($hoaprefix.'restrictionnote'),$hoadata[restrictionnote],'25','3'); echo"
Payment Plan "; customfield ('select box',strtolower($hoaprefix.'duespayment'),$hoadata[duespayment],"Monthly,Quarterly,Yearly"); echo "
Assessments: "; if($GLOBALS[customfield_viewonly]) echo ($hoadata[assessment]? "Yes":"No"); else echo" Yes No"; echo"
Agency Amount "; customfield("money",strtolower($hoaprefix.'assessmentagencyamount'),$hoadata['assessmentagencyamount']); echo"
Due Date "; $hoadata['assessmentduedate'] = dt_format($hoadata['assessmentduedate']); customfield(datepicker,strtolower($hoaprefix.'assessmentduedate'),$hoadata[assessmentduedate]); echo "
Past Due "; customfield ('money',strtolower($hoaprefix.'assessmentpastdue'),$hoadata[assessmentpastdue]); echo"
Demand "; customfield ('money',strtolower($hoaprefix."demand"),$hoadata[demand]); echo"
Order Demand By "; customfield('select box',$hoaprefix.'orderdemandby',$hoadata[orderdemandby],'fax,phone,online,collection'); echo "
Demand Notes "; customfield ("textarea",strtolower($hoaprefix.'demandnote'),$hoadata[demandnote],'25','3'); echo"
Resale "; customfield ("text",strtolower($hoaprefix.'resale'),$hoadata[resale]); echo"
Order Resale By "; customfield('select box',strtolower($hoaprefix.'orderresaleby'),$hoadata[orderresaleby],'fax,phone,online'); echo "
Resale Notes "; customfield ("textarea",strtolower($hoaprefix.'resalenote'),$hoadata[resalenote],'25','3'); echo "
"; timetrack_stop("customfield_extension_hoa",$name); $content = ob_get_clean(); return $content; } function customfield_extension_propertyextensionutility($value,$property) { return customfield_extension_utility_list($value,$property); } // Utilities function customfield_extension_utility_list($value,$property) { global $customfield_readonly, $customfield_readonly_nextonly; if (companyid()) { if (db_number($property[propertyid])>0) $sql = "select propertyextensionkey,propertyextensionentryvalue from tblpropertyextensionentry where propertyid='".db_number($property[propertyid])."' and propertyextensionkey like 'propertyextensionutil%'"; else $sql = "select propertyextensionkey,propertyextensionentryvalue from tblpropertyextensionentry where clientcompanypropertyid='".db_number($property[clientcompanypropertyid])."' and propertyextensionkey like 'propertyextensionutil%'"; $tmp_arr=db_query($sql); foreach ($tmp_arr as $key=>$tmpfld) { $property[extension][$tmpfld[propertyextensionkey]]=$tmp_arr[$key][propertyextensionentryvalue]; } } unset($COMPANYSIDE); if ($property) { if (array_key_exists("propertyid",$property)) $COMPANYSIDE=1; } else if(companyid()) $COMPANYSIDE=1; $form = !($customfield_readonly||$customfield_readonly_nextonly || $value); if (!$COMPANYSIDE) $form = 0; return utility_list2($property,$form,$COMPANYSIDE); } function customfield_extension_propertyextensionclosingattorneyclientid($val,$property,$par3=0,$par4=0,$par5=0,$par6=0,$par7=0,$par8=0) { $sqltext = "select clientid as id, clientcompanyname as value from tblclient where clienttypeid in (select clienttypeid from tblclienttype where clienttypegroupid in (select clienttypegroupid from tblclienttype where clienttypeid = 3) ) and companyid = " . companyid() . " "; $sqladdition=" and clientinactive is null "; if($val && db_number($val)>0) { $sqladdition=" and ( clientinactive is null or clientid=".db_number($val)." ) "; } $sqltext.=$sqladdition; $sql=db_query($sqltext); customfield('sqldropdown','propertyextensionclosingattorneyclientid',$val,$sql,'[select closing attorney office]',' class="client_select" data-clienttypeid="3" data-contacttypeid="23" data-propertyextensionkey="propertyextensionclosingattorney"'); return; } function customfield_extension_propertyextensionproppresclientid($value,$property=0,$par3=0,$par4=0,$par5=0,$par6=0,$par7=0,$par8=0) { if (clientcompanyid()) { if(is_array($property)) if(is_array($property['extension'])) if(is_array($property['extension']['propertyextensionproppresclientid'])) if ($property['extension']['propertyextensionproppresclientid']['propertyextensionentryvalue']) { $sql = " select clientcompanyname from tblcontact left join tblclient using (clientid) where clientid = '".db_number($property['extension']['propertyextensionproppresclientid']['propertyextensionentryvalue'])."' and contactinactive is null and clientinactive is null group by clientcompanyname"; $result = db_first($sql); echo ucwords($result[clientcompanyname]); }else echo " "; return; } $sql = db_query(" select clientid as id , clientcompanyname as value from tblclient where clienttypeid in ( select clienttypeid from tblclienttype where clienttypegroupid in ( select clienttypegroupid from tblclienttype where clienttypeid = 179 ) ) and companyid = " . companyid() . " and clientinactive is null"); customfield('sqldropdown','propertyextensionproppresclientid',$val,$sql,'',' class="client_select" data-clienttypeid="179" data-contacttypeid="23" data-propertyextensionkey="propertyextensionpropertypreservation"'); return; } function customfield_extension_propertyextensiontitleofficerclientid($val,$property=0,$par3=0,$par4=0,$par5=0,$par6=0,$par7=0,$par8=0) { if (clientcompanyid()) { if(!is_array($property)) { if ($_GET['page'] == 'details' && $_GET['action'] == 'add') return; // This will prevent false positive on Add New Client property action. VL else developer_error('function called without property array'); return; } if ($property['extension']['propertyextensiontitleofficerclientid']['propertyextensionentryvalue']) { $sql = "select clientcompanyname from tblcontact left join tblclient using (clientid) where clientid = '".db_number($property['extension']['propertyextensiontitleofficerclientid']['propertyextensionentryvalue'])."' and contactinactive is null and clientinactive is null group by clientcompanyname"; $result = db_first($sql); echo ucwords($result[clientcompanyname]); }else echo " "; return; } ?> 0) { $sqladdition=" and ( clientinactive is null or clientid=".db_number($val)." ) "; } $sqltext.=$sqladdition; $sql=db_query($sqltext); customfield('sqldropdown','propertyextensiontitleofficerclientid',$val,$sql,'[select title office]',' class="client_select" data-clienttypeid="9" data-contacttypeid="11,3" data-propertyextensionkey="propertyextensiontitleofficer"'); } function customfield_extension_propertyextensionclosinglenderclientid($val,$property,$par3=0,$par4=0,$par5=0,$par6=0,$par7=0,$par8=0){ $sql = db_query("select clientid as id, clientcompanyname as value from tblclient where clienttypeid in (select clienttypeid from tblclienttype where clienttypegroupid in (select clienttypegroupid from tblclienttype where clienttypeid = 74) ) and companyid = " . companyid() . " and clientinactive is null"); customfield('sqldropdown','propertyextensionclosinglenderclientid',$val,$sql,'[select closing lender office]',' class="client_select" data-clienttypeid="74" data-contacttypeid="6" data-propertyextensionkey="propertyextensionfinancinglender"'); } function customfield_extension_propertyextensionpropertyaddress($propertyid) { $prop = db_first("select * from tblproperty where propertyid = ".db_number($propertyid)); //d($prop,"CF_OB"); ob_start(); ?> > Address:* > City:* > County: > State:* > Zip:* $pv) { $propgroupids[$pv[groupid]]=$pv[groupid]; } if(is_array($pegs)) foreach($pegs as $k=>$v) { if(is_array($propgroupids)) if(!in_array($k,array_keys($propgroupids))) { if(is_inactive_staff($v[staffid])) $posttext=" (Inactive) "; if($v[groupid]==0) { //d($v); continue; } $propgroups[$k][id]=$v[staffid]; $propgroups[$k][groupid]=$v[groupid]; $propgroups[$k][value]=mystaffname_fromid(db_number($v[staffid]))." ".$posttext; $propgroups[$k][groupname]=$v[groupname]; } } if(is_array($propgroups)) foreach ($propgroups as $key=>$row) { if ($row[groupid] <> $oldgrpid) { $idx=1; $oldgrpid=$row[groupid]; } if(is_inactive_staff($row[id])) $posttext=" (Inactive) "; $agent_groups[$row[groupid]][sqldropdown][$idx][id]=$row[id]; $agent_groups[$row[groupid]][sqldropdown][$idx][value]=$row[value]." ".$posttext; $agent_groups[$row[groupid]][groupname]=$row[groupname]; $selboxidopts[$row[groupid]][$row[id]]=$row[id]; $idx++; } //d($agent_groups,'ag groups'); //d($selboxidopts,'$selboxidopts'); ob_start(); unset($idx); global $customfield_readonly,$customfield_viewonly; ?> Group Agent $row){ if ($row[groupname]=="Listing Agent") continue; // MTX 18305 Client request to remove. // verify that we have the selected staffid available $selectedstaff=$pegs[$key][staffid]; $nam=mystaffname_fromid($selectedstaff); //d($nam,$row[groupname]); foreach($row[sqldropdown] as $selection=>$selectionidvals) { $idsarray[]=$selectionidvals[id]; } if($selectedstaff && !in_array($selectedstaff,array_values($idsarray))) { //d("Not in ids array: ".$nam); // this staff memeber assigned here has since been deactivated and so they do not get returned with the original query // We will check to see if this selected staffid is in the query, if not, we will get the name to add to thew array for visibility $sql="select stafffname ||' ' || stafflname as staffname from tblstaff where staffid =".db_number($selectedstaff); $ret=db_query($sql); if($ret) { if(is_inactive_staff($selectedstaff)) $posttext=" (Inactive) "; $row[sqldropdown][$selection][id]=$selectedstaff; $row[sqldropdown][$selection][value]=$ret[0][staffname]." ".$posttext; } } $stid=db_number($pegs[$key][staffid]); $selectidops=$selboxidopts[$key]; if(!in_array($stid,$selectidops) && $stid!=0) { if(is_inactive_staff($stid)) $posttext=" (Inactive) "; $row[sqldropdown][$selection][id]=$stid; $row[sqldropdown][$selection][value]=mystaffname_fromid($stid)." ".$posttext; } //d($stid) //d($row); //if($row[groupname]=="BPO Coordinator") // d($stid,$row); if($row[groupname]=="") { //d($row); continue; } ?> $datavals) { if($post[$datakey]) $data[$datakey]=$post[$datakey]; } //d($data,"SAVED DATA"); //d($post,"POSTED DATA"); if(is_array($data[inoffagentsplit]) && is_array($data[autoagent])) $splits=array_merge(array_values($data[inoffagentsplit]),array_values($data[autoagent])); else if(is_array($data[inoffagentsplit]) && !is_array($data[autoagent])) $splits=array_values($data[inoffagentsplit]); else if(!is_array($data[inoffagentsplit]) && is_array($data[autoagent])) $splits=array_values($data[autoagent]); else $splits=array(); $splits[]=$data[commissionstr]; $splits[]=$data[brokercommissionssp]; if(is_array($data[braddoutref]) ) $splits[]=array_values($data[braddoutref]); if(is_array($data[trx_company_deduction]) ) $splits[]=array_values($data[trx_company_deduction]); //d($splits,"All Splits"); return $splits; } function check_usedollars($data) { return 1; $splits=cda_basevalues($data); $usedollars=0; foreach($splits as $splittype=>$values) { if(is_array($values)) { foreach($values as $kk=>$valz) { if($valz[type]=="Flat Fee") $usedollars=1; } } if($values[type]=="Flat Fee") $usedollars=1; } return 1;//$usedollars; } function agent_financialtabsplit($agentid,$propertyid) { $alld=get_allfindata($propertyid); if($alld[autoagent][$agentid]) { $thissplit=strip_dollar_format(cda_dollars("Percentage",$alld[autoagent][$agentid][agentsplit],$alld[data][$propertyid][SUB])); } if($alld[inoffagentsplit][$agentid]) { $thissplit=strip_dollar_format(cda_dollars($alld[inoffagentsplit][$agentid][type],$alld[inoffagentsplit][$agentid][value],$alld[data][$propertyid][SUB])); } return $thissplit; } function customfield_extension_propertyextensionfinancialtab($value, $property) { $showonlyif = app_get('showonlyif'); $fintabcalculate=fntab_calculate($property['propertyid'], 'ALL'); //d($fintabcalculate,"fintabcalc"); if(!is_array($fintabcalculate)) $fintabcalculate=array($fintabcalculate); $commissionvalues = array_shift($fintabcalculate); // 08262015 - turn off company split display $usecompanysplit=0; $calculateflatfeesbeforepercents=1; $enablebox =0; $propertysalepricevalue=get_propertysalesprice($property,"propertyextensionofferacceptedamount"); //d($propertysalepricevalue,'$propertysalepricevalue'); if (db_number($propertysalepricevalue) > 0) $enablebox =1; if (!$_GET['']) $propetyviewmode = "staff"; if(has_access('viewableproperties', 'Broker') || has_access('viewableproperties', 'Accounting')) $propetyviewmode = "broker"; elseif (has_access('viewableproperties', 'Manager') || has_access('viewableproperties', 'Team Leader') || has_access('viewableproperties', 'Agent') ) $propetyviewmode = "agent"; if($value) $data = unserialize($value); if(app_get('financialtab_valueonly')) return $data; $usedollars=check_usedollars($data); //d($usedollars,"Use Dollars"); $delrow = ""; $remrow=""; $delrow=$remrow; ob_start(); ?>

Transaction Commission:

Commission:

"; echo ""; } ?>
Add Additional Commission
$dat){ echo ""; $i++; } ?>
Commission Amount  
"; customfield ("text","propertyextensionfinancialtab[additonalcomm][" . $k . "][descr]",$dat["descr"]); echo ""; customfield ("money","propertyextensionfinancialtab[additonalcomm][" . $k . "][value]",$dat["value"]); echo "" . $delrow . "
$dat) { echo ""; echo ""; } } if ($enablebox){ ?>
Gross Commission Income (GCI):
Add Outgoing Referral
$dat){ echo ""; $nk++; } ?>
Name of Referral Commission Type
"; customfield ("text","propertyextensionfinancialtab[braddoutref][" . $k . "][descr]",$dat["descr"]); echo ""; customfield (($dat['type'] == "Percentage" ? "floatpercent" : "money"),"propertyextensionfinancialtab[braddoutref][" . $k . "][value]",$dat["value"]); echo ""; customfield ("radios","propertyextensionfinancialtab[braddoutref][" . $k . "][type]",($dat['type'] ? $dat['type'] : "Flat Fee"),"Percentage,Flat Fee"); echo $delrow . "
Adjusted GCI:
Transaction Company Deductions '; }else { $buttonheader='
Add Transaction Company Deduction
'; } // this will onmy be editable by the above perms, but it can still be viewed by staff, just no editing... In Development JTrull 08272015 if ($enablebox){ ?>
$trxvalues){ //d($customfield_readonly,'$customfield_readonly'); ?>
Name of Transaction Company Deduction Amount Type
Sub Total
Add agent

In Office Agent Split:

$values){ if($values[type]=="Flat Fee" ) { $agsplitcalcagainst=$agsplitcalcagainst-strip_dollar_format($values[value]); $inagtotal+=strip_dollar_format($values[value]); }else if($values[type]=="Percentage") { $agpercstaken+=strip_dollar_format($values[value]); } } }else { if(is_array($data['inoffagentsplit'])) foreach ($data['inoffagentsplit'] as $agentid => $values){ if($values[type]=="Flat Fee" ) { $flatfeetotal+=strip_dollar_format($values[value]); $inagtotal+=strip_dollar_format(cda_dollars($values[type],$values[value],$commissionvalues['SUB'])); } } if(is_array($data['inoffagentsplit'])) foreach ($data['inoffagentsplit'] as $agentid => $values){ if($values[type]=="Percentage") { $subminusflatfees=$commissionvalues['SUB']-$flatfeetotal; $inagtotal+=strip_dollar_format(cda_dollars($values[type],$values[value],$subminusflatfees)); $agpercstaken+=strip_dollar_format($values[value]); //d($inagtotal); } } } $showdollars=1; if (is_array($data['autoagent'])){ ?> $values){ //d($values,"autoagentvalues"); if(!is_numeric($agentid)) continue; echo "

Agent

"; echo contactcard ( $agentid, 0, 0 ); echo ""; if($agsplitcalcagainst) { $perctakeaway=$values['agentsplit']; if($agpercstaken) $perctakeaway=100-$agpercstaken; $calcsplitdollars=strip_dollar_format($perctakeaway/100)*$agsplitcalcagainst; $actualsplitdollars=dollar_format($calcsplitdollars) ; } if($showdollars) { if(!$calculateflatfeesbeforepercents) { ?>

Commission: $0

Commission: $0

Commission:
Fatal error: Uncaught Error: Call to undefined function dollar_format() in /data/webs/rio_api_dev/_inc/functions_customfield_ob.php:1483 Stack trace: #0 {main} thrown in /data/webs/rio_api_dev/_inc/functions_customfield_ob.php on line 1483