$assocrecord = trim($assocrecord[0]); $q = "SELECT setype, assoc_display " . "FROM vtiger_crmentity INNER JOIN vtiger_accounting_payments " . "ON vtiger_crmentity.crmid = vtiger_accounting_payments.associnv " . "WHERE vtiger_crmentity.crmid = ? LIMIT 1"; $res = $adb->pquery($q, array($assocrecord)); $nassoc = $adb->num_rows($res); $assocmod = ""; $assocdisplay = ""; if ($nassoc > 0) { $assocmod = $adb->query_result($res, 0, "setype"); $assocdisplay = $adb->query_result($res, 0, "assoc_display"); } $entry[$index] = '<a href="index.php?module=' . $assocmod . '&parenttab=' . $assocmod . '&action=DetailView&record=' . $assocrecord . '">' . $assocdisplay . '</a>'; } } else { if ($keys[$index] == 'accountingstate') { $payments = array(); $payments = Accounting::getPayments($acc_record); $expired = false; if ($partialpaymentview == 'true') { $hideheaders = array($index); } foreach ($payments as $payment) { if ($payment["paid"] == "0") { $exp_date = $payment["paymentduedate"]; $todays_date = date("Y-m-d"); $today = strtotime($todays_date); $expiration_date = strtotime((string) $exp_date); if ($expiration_date < $today) { $expired = true; break; } }
} } $entry[$index] = $type; } else { if ($index == 7) { $recordpos1 = strpos($entry[7], ">"); $recordpos2 = strpos($entry[7], "<", $recordpos1); $record = substr($entry[7], $recordpos1 + 1, $recordpos2 - $recordpos1 - 7); $entry[7] = substr($entry[7], 0, $recordpos1 + 1) . $lang['LBL_ADD_A_PAYMENT'] . substr($entry[7], $recordpos2); } } } } $id = $entryKey; $payments = array(); $payments = Accounting::getPayments($id); $config = Accounting::loadConfigParams(); $config['npayments'] = count($payments); $config['decimalseparator'] = "."; global $current_user; $paid = 0; foreach ($payments as &$payment) { $payment_date = $payment["paymentduedate"]; if ($payment["paid"] == "1") { $paid += $payment["amount"]; } if ($payment["paymentduedate"] == "" || $payment["paymentduedate"] == "0000-00-00") { $payment["paymentduedate"] = $current_user->date_format; $payment["paymentduedate"] = str_replace("yyyy", "0000", $payment["paymentduedate"]); $payment["paymentduedate"] = str_replace("mm", "00", $payment["paymentduedate"]); $payment["paymentduedate"] = str_replace("dd", "00", $payment["paymentduedate"]);
$smarty->assign('EDIT_DUPLICATE', 'permitted'); } if (isPermitted($currentModule, 'Delete', $record) == 'yes') { $smarty->assign('DELETE', 'permitted'); } $smarty->assign('BLOCKS', getBlocks($currentModule, 'detail_view', '', $focus->column_fields)); // Gather the custom link information to display include_once 'vtlib/Vtiger/Link.php'; $customlink_params = array('MODULE' => $currentModule, 'RECORD' => $focus->id, 'ACTION' => vtlib_purify($_REQUEST['action'])); $smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), array('DETAILVIEWBASIC', 'DETAILVIEW'), $customlink_params)); // END // Record Change Notification $focus->markAsViewed($current_user->id); // END $payments = array(); $payments = Accounting::getPayments($focus->id); $config = array(); $config['npayments'] = count($payments); $config['decimalseparator'] = "."; global $current_user; $paid = 0; foreach ($payments as &$payment) { $payment_date = $payment["paymentduedate"]; if ($payment["paid"] == "1") { $paid += $payment["amount"]; } if ($payment["paymentduedate"] == "" || $payment["paymentduedate"] == "0000-00-00") { $payment["paymentduedate"] = $current_user->date_format; $payment["paymentduedate"] = str_replace("yyyy", "0000", $payment["paymentduedate"]); $payment["paymentduedate"] = str_replace("mm", "00", $payment["paymentduedate"]); $payment["paymentduedate"] = str_replace("dd", "00", $payment["paymentduedate"]);
$mod_seq_no = $adb->query_result($mod_seq_string, 0, 'cur_id'); if ($adb->num_rows($mod_seq_string) == 0 || $focus->checkModuleSeqNumber($focus->table_name, $mod_seq_field['column'], $mod_seq_prefix . $mod_seq_no)) { echo '<br><font color="#FF0000"><b>' . getTranslatedString('LBL_DUPLICATE') . ' ' . getTranslatedString($mod_seq_field['label']) . ' - ' . getTranslatedString('LBL_CLICK') . ' <a href="index.php?module=Settings&action=CustomModEntityNo&parenttab=Settings&selmodule=' . $currentModule . '">' . getTranslatedString('LBL_HERE') . '</a> ' . getTranslatedString('LBL_TO_CONFIGURE') . ' ' . getTranslatedString($mod_seq_field['label']) . '</b></font>'; } else { $smarty->assign("MOD_SEQ_ID", $autostr); } } else { $smarty->assign("MOD_SEQ_ID", $focus->column_fields[$mod_seq_field['name']]); } // END // Gather the help information associated with fields $smarty->assign('FIELDHELPINFO', vtlib_getFieldHelpInfo($currentModule)); // END $payments = array(); if (isset($_REQUEST['record'])) { $payments = Accounting::getPayments($_REQUEST['record']); } $config = Accounting::loadConfigParams(); $config['npayments'] = count($payments); $config['decimalseparator'] = "."; $_SESSION['associnvoice'] = $config['associnvoice']; global $current_user; $paid = 0; foreach ($payments as &$payment) { if ($payment["paid"] == "1") { $paid += $payment["amount"]; } if ($payment["paymentduedate"] == "" || $payment["paymentduedate"] == "0000-00-00") { $payment["paymentduedate"] = $current_user->date_format; $payment["paymentduedate"] = str_replace("yyyy", "0000", $payment["paymentduedate"]); $payment["paymentduedate"] = str_replace("mm", "00", $payment["paymentduedate"]);