$sql_data_array = array('contact_id' => $cInfo->id, 'log_date' => $_POST['crm_date'], 'entered_by' => $_POST['crm_rep_id'], 'action' => $_POST['crm_action'], 'notes' => db_prepare_input($_POST['crm_note'])); db_perform(TABLE_CONTACTS_LOG, $sql_data_array, 'insert'); } $_REQUEST['action'] = 'main'; break; } $_REQUEST['action'] = 'edit'; break; case 'edit': case 'properties': $cInfo->getContact(); break; case 'delete': case 'crm_delete': validate_security($security_level, 4); $short_name = gen_get_contact_name($cInfo->id); $temp = $cInfo->delete(); if ($temp == true) { gen_add_audit_log(TEXT_CONTACTS . '-' . TEXT_DELETE . '-' . constant('ACT_' . strtoupper($type) . '_TYPE_NAME'), $short_name); } else { $error = $messageStack->add($temp, 'error'); } break; case 'download': $cID = db_prepare_input($_POST['id']); $imgID = db_prepare_input($_POST['rowSeq']); $filename = 'contacts_' . $cID . '_' . $imgID . '.zip'; if (file_exists(CONTACTS_DIR_ATTACHMENTS . $filename)) { require_once DIR_FS_MODULES . 'phreedom/classes/backup.php'; $backup = new backup(); $backup->download(CONTACTS_DIR_ATTACHMENTS, $filename, true);
// load sku stock status and open orders switch ($jID) { case '9': case '10': case '12': case '19': // check for stock available for SO, Customer Quote and Sales if ($qty > $inventory_array['branch_qty_in_stock'] && strpos(COG_ITEM_TYPES, $inventory_array['inventory_type']) !== false) { $stock_note[] = ORD_INV_STOCK_LOW; $stock_note[] = ORD_INV_STOCK_BAL . $inventory_array['branch_qty_in_stock']; // fetch open orders $sku_history = gather_history($inventory_array['sku']); if (is_array($sku_history['open_po'])) { $stock_note[] = ORD_INV_OPEN_POS; foreach ($sku_history['open_po'] as $value) { $store = $value['store_id'] ? gen_get_contact_name($value['store_id']) : COMPANY_NAME; // get name from id $stock_note[] = sprintf(ORD_INV_STOCK_STATUS, $store, $value['purchase_invoice_id'], $value['qty'], gen_locale_date($value['date_1'])); } } } break; default: } if ($jID == 4) { $inventory_array['item_cost'] = $inventory_array['item_cost'] * $inventory_array['purch_package_quantity']; // build the sales price $xml .= xmlEntry("sales_price", $sales_price * $inventory_array['purch_package_quantity']); } else { // build the sales price $xml .= xmlEntry("sales_price", $sales_price);
// | Copyright(c) 2008-2014 PhreeSoft (www.PhreeSoft.com) | // +-----------------------------------------------------------------+ // | This program is free software: you can redistribute it and/or | // | modify it under the terms of the GNU General Public License as | // | published by the Free Software Foundation, either version 3 of | // | the License, or any later version. | // | | // | This program is distributed in the hope that it will be useful, | // | but WITHOUT ANY WARRANTY; without even the implied warranty of | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | // | GNU General Public License for more details. | // +-----------------------------------------------------------------+ // Path: /modules/contacts/pages/main/template_i_general.php // // some setup $acct_def = !$cInfo->dept_rep_id ? array() : array(array('id' => $cInfo->dept_rep_id, 'text' => gen_get_contact_name($cInfo->dept_rep_id))); // *********************** Display account information ****************************** ?> <div id="tab_general"> <fieldset> <legend><?php echo ACT_CATEGORY_CONTACT; ?> </legend> <table> <tr> <td align="right"><?php echo ACT_SHORT_NAME; ?> </td> <td>
// if it's a CRM entry, we need some primary information $result = $db->Execute("select id, short_name, contact_first, contact_middle, contact_last, account_number, gov_id_number \n\t\t\tfrom " . TABLE_CONTACTS . " where id = " . $result->fields['ref_id'] . " limit 1"); $xml .= xmlEntry('contact_id', $result->fields['id']); $xml .= xmlEntry('short_name', $result->fields['short_name']); $xml .= xmlEntry('contact_middle', $result->fields['contact_middle']); $xml .= xmlEntry('contact_first', $result->fields['contact_first']); $xml .= xmlEntry('contact_last', $result->fields['contact_last']); $xml .= xmlEntry('account_number', $result->fields['account_number']); $xml .= xmlEntry('gov_id_number', $result->fields['gov_id_number']); break; case 'rm_address': $id = $_GET['aID']; $result = $db->Execute("select ref_id, type from " . TABLE_ADDRESS_BOOK . " where address_id = {$id}"); if ($result->fields['type'] == 'im') { // it's a contact record, also delete record $short_name = gen_get_contact_name($id); $contact = new contacts(); if ($contact->delete($result->fields['ref_id'])) { gen_add_audit_log(TEXT_CONTACTS . '-' . TEXT_DELETE . '-' . constant('ACT_' . strtoupper($type) . '_TYPE_NAME'), $short_name); $message[] = 'The record was successfully deleted!'; } else { $message[] = ACT_ERROR_CANNOT_DELETE; } } else { // just delete the address $db->Execute('delete from ' . TABLE_ADDRESS_BOOK . " where address_id = {$id}"); } $message[] = 'The record was successfully deleted!'; $xml .= xmlEntry('address_id', $id); break; case 'get_payment':
</td> <td><?php echo $sku_text; ?> </td> <td><?php echo $sku_desc; ?> </td> <?php if (ENABLE_MULTI_BRANCH) { $store_name = $query_result->fields['store_id'] == '0' ? COMPANY_ID : gen_get_contact_name($query_result->fields['store_id']); echo ' <td align="center">' . $store_name . '</td>' . chr(10); } if (ENABLE_MULTI_BRANCH && $adj_type == 'xfr') { $store_name = $query_result->fields['bill_acct_id'] == '0' ? COMPANY_ID : gen_get_contact_name($query_result->fields['bill_acct_id']); echo ' <td align="center">' . $store_name . '</td>' . chr(10); } ?> </tr> <?php $query_result->MoveNext(); $odd = !$odd; } ?> </tbody> </table> <div style="float:right"><?php echo $query_split->display_links(); ?> </div>
<tr class="<?php echo $odd ? 'odd' : 'even'; ?> " style="cursor:pointer" onclick='setReturnEntry(<?php echo $query_result->fields['id']; ?> )'> <td><?php echo gen_locale_date($query_result->fields['post_date']); ?> </td> <?php if (ENABLE_MULTI_BRANCH) { ?> <td><?php echo $query_result->fields['store_id'] ? gen_get_contact_name($query_result->fields['store_id']) : COMPANY_ID; ?> </td> <?php } ?> <td><?php echo $query_result->fields['purchase_invoice_id']; ?> </td> <td><?php echo $currencies->format($query_result->fields['total_amount']); ?> </td> <td><?php echo $query_result->fields['bill_primary_name'];