本文整理汇总了PHP中key_in_foreign_table函数的典型用法代码示例。如果您正苦于以下问题:PHP key_in_foreign_table函数的具体用法?PHP key_in_foreign_table怎么用?PHP key_in_foreign_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了key_in_foreign_table函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: check_can_delete
function check_can_delete($curr)
{
if ($curr == "") {
return false;
}
// PREVENT DELETES IF DEPENDENT RECORDS IN debtors_master
if (key_in_foreign_table($curr, 'debtors_master', 'curr_code')) {
display_error(_("Cannot delete this currency, because customer accounts have been created referring to this currency."));
return false;
}
if (key_in_foreign_table($curr, 'suppliers', 'curr_code')) {
display_error(_("Cannot delete this currency, because supplier accounts have been created referring to this currency."));
return false;
}
if ($curr == get_company_pref('curr_default')) {
display_error(_("Cannot delete this currency, because the company preferences uses this currency."));
return false;
}
// see if there are any bank accounts that use this currency
if (key_in_foreign_table($curr, 'bank_accounts', 'bank_curr_code')) {
display_error(_("Cannot delete this currency, because thre are bank accounts that use this currency."));
return false;
}
return true;
}
示例2: can_delete
function can_delete($selected_id)
{
if (key_in_foreign_table($selected_id, 'tax_group_items', 'tax_type_id')) {
display_error(_("Cannot delete this tax type because tax groups been created referring to it."));
return false;
}
return true;
}
示例3: check_delete
function check_delete($name)
{
// check if selected profile is used by any user
if ($name == '') {
return 0;
}
// cannot delete system default profile
return key_in_foreign_table($name, 'users', 'print_profile');
}
示例4: can_delete
function can_delete($selected_id)
{
if ($selected_id == "") {
return false;
}
if (key_in_foreign_table($selected_id, 'chart_types', 'class_id')) {
display_error(_("Cannot delete this account class because GL account types have been created referring to it."));
return false;
}
return true;
}
示例5: can_delete
function can_delete($selected_id)
{
if (key_in_foreign_table($selected_id, 'stock_master', 'tax_type_id')) {
display_error(_("Cannot delete this item tax type because items have been created referring to it."));
return false;
}
if (key_in_foreign_table($selected_id, 'stock_category', 'dflt_tax_type')) {
display_error(_("Cannot delete this item tax type because item categories have been created referring to it."));
return false;
}
return true;
}
示例6: can_delete
function can_delete($selected_id)
{
if ($selected_id == -1) {
return false;
}
if (key_in_foreign_table($selected_id, 'cust_branch', 'tax_group_id')) {
display_error(_("Cannot delete this tax group because customer branches been created referring to it."));
return false;
}
if (key_in_foreign_table($selected_id, 'suppliers', 'tax_group_id')) {
display_error(_("Cannot delete this tax group because suppliers been created referring to it."));
return false;
}
return true;
}
示例7: can_delete
function can_delete($type)
{
if ($type == "") {
return false;
}
if (key_in_foreign_table($type, 'chart_master', 'account_type')) {
display_error(_("Cannot delete this account group because GL accounts have been created referring to it."));
return false;
}
if (key_in_foreign_table($type, 'chart_types', 'parent')) {
display_error(_("Cannot delete this account group because GL account groups have been created referring to it."));
return false;
}
return true;
}
示例8: can_delete
function can_delete($selected_account)
{
if ($selected_account == "") {
return false;
}
if (key_in_foreign_table($selected_account, 'gl_trans', 'account')) {
display_error(_("Cannot delete this account because transactions have been created using this account."));
return false;
}
if (gl_account_in_company_defaults($selected_account)) {
display_error(_("Cannot delete this account because it is used as one of the company default GL accounts."));
return false;
}
if (key_in_foreign_table($selected_account, 'bank_accounts', 'account_code')) {
display_error(_("Cannot delete this account because it is used by a bank account."));
return false;
}
if (gl_account_in_stock_category($selected_account)) {
display_error(_("Cannot delete this account because it is used by one or more Item Categories."));
return false;
}
if (gl_account_in_stock_master($selected_account)) {
display_error(_("Cannot delete this account because it is used by one or more Items."));
return false;
}
if (gl_account_in_tax_types($selected_account)) {
display_error(_("Cannot delete this account because it is used by one or more Taxes."));
return false;
}
if (gl_account_in_cust_branch($selected_account)) {
display_error(_("Cannot delete this account because it is used by one or more Customer Branches."));
return false;
}
if (gl_account_in_suppliers($selected_account)) {
display_error(_("Cannot delete this account because it is used by one or more suppliers."));
return false;
}
if (gl_account_in_quick_entry_lines($selected_account)) {
display_error(_("Cannot delete this account because it is used by one or more Quick Entry Lines."));
return false;
}
return true;
}
示例9: can_delete
function can_delete($selected_id)
{
if (key_in_foreign_table($selected_id, 'stock_moves', 'loc_code')) {
display_error(_("Cannot delete this location because item movements have been created using this location."));
return false;
}
if (key_in_foreign_table($selected_id, 'workorders', 'loc_code')) {
display_error(_("Cannot delete this location because it is used by some work orders records."));
return false;
}
if (key_in_foreign_table($selected_id, 'cust_branch', 'default_location')) {
display_error(_("Cannot delete this location because it is used by some branch records as the default location to deliver from."));
return false;
}
if (key_in_foreign_table($selected_id, 'bom', 'loc_code')) {
display_error(_("Cannot delete this location because it is used by some related records in other tables."));
return false;
}
if (key_in_foreign_table($selected_id, 'grn_batch', 'loc_code')) {
display_error(_("Cannot delete this location because it is used by some related records in other tables."));
return false;
}
if (key_in_foreign_table($selected_id, 'purch_orders', 'into_stock_location')) {
display_error(_("Cannot delete this location because it is used by some related records in other tables."));
return false;
}
if (key_in_foreign_table($selected_id, 'sales_orders', 'from_stk_loc')) {
display_error(_("Cannot delete this location because it is used by some related records in other tables."));
return false;
}
if (key_in_foreign_table($selected_id, 'sales_pos', 'pos_location')) {
display_error(_("Cannot delete this location because it is used by some related records in other tables."));
return false;
}
return true;
}
示例10: update_crm_category
}
if ($input_error != 1) {
if ($selected_id != -1) {
update_crm_category($selected_id, get_post('type'), get_post('subtype'), get_post('name'), get_post('description'));
$note = _('Selected contact category has been updated');
} else {
add_crm_category(get_post('type'), get_post('subtype'), get_post('name'), get_post('description'));
$note = _('New contact category has been added');
}
display_notification($note);
$Mode = 'RESET';
}
}
if ($Mode == 'Delete') {
$cancel_delete = 0;
if (key_in_foreign_table($selected_id, 'crm_relations', 'category_id')) {
$cancel_delete = 1;
display_error(_("Cannot delete this category because there are contacts related to it."));
}
if ($cancel_delete == 0) {
delete_crm_category($selected_id);
display_notification(_('Category has been deleted'));
}
$Mode = 'RESET';
}
if ($Mode == 'RESET') {
$selected_id = -1;
$sav = get_post('show_inactive');
unset($_POST);
$_POST['show_inactive'] = $sav;
}
示例11: update_shipper
}
//----------------------------------------------------------------------------------------------
if ($Mode == 'UPDATE_ITEM' && can_process()) {
update_shipper($selected_id, $_POST['shipper_name'], $_POST['contact'], $_POST['phone'], $_POST['phone2'], $_POST['address']);
display_notification(_('Selected shipping company has been updated'));
$Mode = 'RESET';
}
//----------------------------------------------------------------------------------------------
if ($Mode == 'Delete') {
// PREVENT DELETES IF DEPENDENT RECORDS IN 'sales_orders'
if (key_in_foreign_table($selected_id, 'sales_orders', 'ship_via')) {
$cancel_delete = 1;
display_error(_("Cannot delete this shipping company because sales orders have been created using this shipper."));
} else {
// PREVENT DELETES IF DEPENDENT RECORDS IN 'debtor_trans'
if (key_in_foreign_table($selected_id, 'debtor_trans', 'ship_via')) {
$cancel_delete = 1;
display_error(_("Cannot delete this shipping company because invoices have been created using this shipping company."));
} else {
delete_shipper($selected_id);
display_notification(_('Selected shipping company has been deleted'));
}
}
$Mode = 'RESET';
}
if ($Mode == 'RESET') {
$selected_id = -1;
$sav = get_post('show_inactive');
unset($_POST);
$_POST['show_inactive'] = $sav;
}
示例12: display_notification_centered
display_notification_centered(_("The selected user has been updated."));
} else {
add_user($_POST['user_id'], $_POST['real_name'], md5($_POST['password']), $_POST['phone'], $_POST['email'], $_POST['role_id'], $_POST['language'], $_POST['print_profile'], check_value('rep_popup'), $_POST['pos']);
$id = db_insert_id();
// use current user display preferences as start point for new user
$prefs = $_SESSION['wa_current_user']->prefs->get_all();
update_user_prefs($id, array_merge($prefs, get_post(array('print_profile', 'rep_popup' => 0, 'language'))));
display_notification_centered(_("A new user has been added."));
}
$Mode = 'RESET';
}
}
//-------------------------------------------------------------------------------------------------
if ($Mode == 'Delete' && check_csrf_token()) {
$cancel_delete = 0;
if (key_in_foreign_table($selected_id, 'audit_trail', 'user')) {
$cancel_delete = 1;
display_error(_("Cannot delete this user because entries are associated with this user."));
}
if ($cancel_delete == 0) {
delete_user($selected_id);
display_notification_centered(_("User has been deleted."));
}
//end if Delete group
$Mode = 'RESET';
}
//-------------------------------------------------------------------------------------------------
if ($Mode == 'RESET') {
$selected_id = -1;
$sav = get_post('show_inactive', null);
unset($_POST);
示例13: add_salesman
} else {
/*Selected group is null cos no item selected on first time round so must be adding a record must be submitting new entries in the new Sales-person form */
add_salesman($_POST['salesman_name'], $_POST['salesman_phone'], $_POST['salesman_fax'], $_POST['salesman_email'], input_num('provision'), input_num('break_pt'), input_num('provision2'));
}
if ($selected_id != -1) {
display_notification(_('Selected sales person data have been updated'));
} else {
display_notification(_('New sales person data have been added'));
}
$Mode = 'RESET';
}
}
if ($Mode == 'Delete') {
//the link to delete a selected record was clicked instead of the submit button
// PREVENT DELETES IF DEPENDENT RECORDS IN 'debtors_master'
if (key_in_foreign_table($selected_id, 'cust_branch', 'salesman')) {
display_error(_("Cannot delete this sales-person because branches are set up referring to this sales-person - first alter the branches concerned."));
} else {
delete_salesman($selected_id);
display_notification(_('Selected sales person data have been deleted'));
}
$Mode = 'RESET';
}
if ($Mode == 'RESET') {
$selected_id = -1;
$sav = get_post('show_inactive');
unset($_POST);
$_POST['show_inactive'] = $sav;
}
//------------------------------------------------------------------------------------------------
$result = get_salesmen(check_value('show_inactive'));
示例14: _
$note = _('Selected payment terms have been updated');
} else {
add_payment_terms($from_now, $_POST['terms'], $days);
$note = _('New payment terms have been added');
}
//run the sql from either of the above possibilites
display_notification($note);
$Mode = 'RESET';
}
}
if ($Mode == 'Delete') {
// PREVENT DELETES IF DEPENDENT RECORDS IN debtors_master
if (key_in_foreign_table($selected_id, 'debtors_master', 'payment_terms')) {
display_error(_("Cannot delete this payment term, because customer accounts have been created referring to this term."));
} else {
if (key_in_foreign_table($selected_id, 'suppliers', 'payment_terms')) {
display_error(_("Cannot delete this payment term, because supplier accounts have been created referring to this term"));
} else {
//only delete if used in neither customer or supplier accounts
delete_payment_terms($selected_id);
display_notification(_('Selected payment terms have been deleted'));
}
}
//end if payment terms used in customer or supplier accounts
$Mode = 'RESET';
}
if ($Mode == 'RESET') {
$selected_id = -1;
$sav = get_post('show_inactive');
unset($_POST);
$_POST['show_inactive'] = $sav;
示例15: supplier_settings
function supplier_settings(&$supplier_id)
{
start_outer_table(TABLESTYLE2);
table_section(1);
if ($supplier_id) {
//SupplierID exists - either passed when calling the form or from the form itself
$myrow = get_supplier($_POST['supplier_id']);
$_POST['supp_name'] = $myrow["supp_name"];
$_POST['supp_ref'] = $myrow["supp_ref"];
$_POST['address'] = $myrow["address"];
$_POST['supp_address'] = $myrow["supp_address"];
$_POST['gst_no'] = $myrow["gst_no"];
$_POST['website'] = $myrow["website"];
$_POST['supp_account_no'] = $myrow["supp_account_no"];
$_POST['bank_account'] = $myrow["bank_account"];
$_POST['dimension_id'] = $myrow["dimension_id"];
$_POST['dimension2_id'] = $myrow["dimension2_id"];
$_POST['curr_code'] = $myrow["curr_code"];
$_POST['payment_terms'] = $myrow["payment_terms"];
$_POST['credit_limit'] = price_format($myrow["credit_limit"]);
$_POST['tax_group_id'] = $myrow["tax_group_id"];
$_POST['tax_included'] = $myrow["tax_included"];
$_POST['payable_account'] = $myrow["payable_account"];
$_POST['purchase_account'] = $myrow["purchase_account"];
$_POST['payment_discount_account'] = $myrow["payment_discount_account"];
$_POST['notes'] = $myrow["notes"];
$_POST['inactive'] = $myrow["inactive"];
} else {
$_POST['supp_name'] = $_POST['supp_ref'] = $_POST['address'] = $_POST['supp_address'] = $_POST['tax_group_id'] = $_POST['website'] = $_POST['supp_account_no'] = $_POST['notes'] = '';
$_POST['dimension_id'] = 0;
$_POST['dimension2_id'] = 0;
$_POST['tax_included'] = 0;
$_POST['sales_type'] = -1;
$_POST['gst_no'] = $_POST['bank_account'] = '';
$_POST['payment_terms'] = '';
$_POST['credit_limit'] = price_format(0);
$company_record = get_company_prefs();
$_POST['curr_code'] = $company_record["curr_default"];
$_POST['payable_account'] = $company_record["creditors_act"];
$_POST['purchase_account'] = '';
// default/item's cogs account
$_POST['payment_discount_account'] = $company_record['pyt_discount_act'];
}
table_section_title(_("Basic Data"));
text_row(_("Supplier Name:"), 'supp_name', null, 42, 40);
text_row(_("Supplier Short Name:"), 'supp_ref', null, 30, 30);
text_row(_("GSTNo:"), 'gst_no', null, 42, 40);
link_row(_("Website:"), 'website', null, 35, 55);
if ($supplier_id && !is_new_supplier($supplier_id) && (key_in_foreign_table($_POST['supplier_id'], 'supp_trans', 'supplier_id') || key_in_foreign_table($_POST['supplier_id'], 'purch_orders', 'supplier_id'))) {
label_row(_("Supplier's Currency:"), $_POST['curr_code']);
hidden('curr_code', $_POST['curr_code']);
} else {
currencies_list_row(_("Supplier's Currency:"), 'curr_code', null);
}
tax_groups_list_row(_("Tax Group:"), 'tax_group_id', null);
text_row(_("Our Customer No:"), 'supp_account_no', null, 42, 40);
table_section_title(_("Purchasing"));
text_row(_("Bank Name/Account:"), 'bank_account', null, 42, 40);
amount_row(_("Credit Limit:"), 'credit_limit', null);
payment_terms_list_row(_("Payment Terms:"), 'payment_terms', null);
//
// tax_included option from supplier record is used directly in update_average_cost() function,
// therefore we can't edit the option after any transaction waas done for the supplier.
//
if (is_new_supplier($supplier_id)) {
check_row(_("Prices contain tax included:"), 'tax_included');
} else {
hidden('tax_included');
label_row(_("Prices contain tax included:"), $_POST['tax_included'] ? _('Yes') : _('No'));
}
table_section_title(_("Accounts"));
gl_all_accounts_list_row(_("Accounts Payable Account:"), 'payable_account', $_POST['payable_account']);
gl_all_accounts_list_row(_("Purchase Account:"), 'purchase_account', $_POST['purchase_account'], false, false, _("Use Item Inventory/COGS Account"));
gl_all_accounts_list_row(_("Purchase Discount Account:"), 'payment_discount_account', $_POST['payment_discount_account']);
if (!$supplier_id) {
table_section_title(_("Contact Data"));
text_row(_("Phone Number:"), 'phone', null, 32, 30);
text_row(_("Secondary Phone Number:"), 'phone2', null, 32, 30);
}
table_section(2);
$dim = get_company_pref('use_dimension');
if ($dim >= 1) {
table_section_title(_("Dimension"));
dimensions_list_row(_("Dimension") . " 1:", 'dimension_id', null, true, " ", false, 1);
if ($dim > 1) {
dimensions_list_row(_("Dimension") . " 2:", 'dimension2_id', null, true, " ", false, 2);
}
}
if ($dim < 1) {
hidden('dimension_id', 0);
}
if ($dim < 2) {
hidden('dimension2_id', 0);
}
table_section_title(_("Addresses"));
textarea_row(_("Mailing Address:"), 'address', null, 35, 5);
textarea_row(_("Physical Address:"), 'supp_address', null, 35, 5);
table_section_title(_("General"));
textarea_row(_("General Notes:"), 'notes', null, 35, 5);
if ($supplier_id) {
//.........这里部分代码省略.........