'tr_ad_ar_payment','AR_PAYMENT','A','D',1,'create trigger tr_ad_ar_payment after delete on AR_PAYMENT referencing old as deleted for each row begin if deleted.ref_ar_payment_origination_cd=''P'' then call sp_ar_payment_sales_post(deleted.loc,deleted.accounting_day,deleted.sales_year_month,deleted.payment_amount,deleted.discount_taken,-1) end if end', 'tr_ad_classification_return','CLASSIFICATION_RETURN','A','D',1,'create trigger tr_ad_classification_return after delete on CLASSIFICATION_RETURN referencing old as deleted for each row begin declare v_url varchar(50);declare v_msg_type varchar(30);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=deleted.loc),10)=1 then set v_msg_type=''PO_IN_RETURN'';set v_msg_action=''Delete'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=deleted.loc);insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(deleted.loc,deleted.classification_session_id,v_msg_type,v_msg_action,v_url) end if end', 'tr_ad_customer','CUSTOMER','A','D',1,'create trigger tr_ad_customer after delete on CUSTOMER referencing old as deleted for each row begin declare v_url varchar(50);declare v_msg_type varchar(30);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=deleted.loc),10)=1 then set v_msg_type=''CUST_IN'';set v_msg_action=''Delete'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=deleted.loc);insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(deleted.loc,deleted.customer_num,v_msg_type,v_msg_action,v_url) end if end', 'tr_ad_customer_custom_pricing','CUSTOMER_CUSTOM_PRICING','A','D',1,'create trigger tr_ad_customer_custom_pricing after delete on CUSTOMER_CUSTOM_PRICING referencing old as deleted for each row begin declare i_next_id integer;declare i_customer_number integer;declare v_customer_name varchar(40);declare v_customer_type varchar(1);declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=1;set v_pricing_tracker_action=''U'';if fn_pricing_tracker_in_use(deleted.loc)=''Y'' then select customer_num,name,ref_customer_type_cd into i_customer_number,v_customer_name,v_customer_type from customer where id=deleted.customer_id and loc=deleted.loc;if v_customer_type=''A'' then if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=deleted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=v_customer_name where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=deleted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',deleted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,deleted.loc,i_pricing_tracker_type,v_pricing_tracker_action,i_customer_number,v_customer_name) end if end if end if end', 'tr_ad_customer_pricing_profile','CUSTOMER_PRICING_PROFILE','A','D',1,'create trigger tr_ad_customer_pricing_profile after delete on CUSTOMER_PRICING_PROFILE referencing old as deleted for each row begin declare i_next_id integer;declare i_customer_number integer;declare v_customer_name varchar(40);declare v_customer_type varchar(1);declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=1;set v_pricing_tracker_action=''U'';if fn_pricing_tracker_in_use(deleted.loc)=''Y'' then select customer_num,name,ref_customer_type_cd into i_customer_number,v_customer_name,v_customer_type from customer where id=deleted.customer_id and loc=deleted.loc;if v_customer_type=''A'' then if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=deleted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=v_customer_name where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=deleted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',deleted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,deleted.loc,i_pricing_tracker_type,v_pricing_tracker_action,i_customer_number,v_customer_name) end if end if end if;call sp_re_rank_customer_pricing_profile(deleted.customer_id,deleted.ref_customer_pricing_profile_type_cd,deleted.loc,deleted.last_modified_date,deleted.modified_by_employee_id) end', 'tr_ad_invoice_message_profile','INVOICE_MESSAGE_PROFILE','A','D',1,'create trigger tr_ad_invoice_message_profile after delete on INVOICE_MESSAGE_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_DAY_OF_WEEK_ID;call sp_log_file_insdel_activity(deleted.LOC,98,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_ad_invoice_payment','INVOICE_PAYMENT','A','D',1,'create trigger tr_ad_invoice_payment after delete on INVOICE_PAYMENT referencing old as deleted for each row begin declare i_invoice_number integer;declare ti_ref_transaction_type_id tinyint;declare i_customer_id integer;declare ts_invoice_date timestamp;declare c_po_number varchar(30);declare i_original_invoice_id integer;declare c_ref_credit_debit_rebill_cd char(1);declare d_tax_amount_1 decimal(8,2);declare d_tax_amount_2 decimal(8,2);declare d_delivery_charge decimal(10,2);declare d_invoice_total decimal(12,2);declare d_roa_discount decimal(8,2);declare si_st_pro_acct_day smallint;declare dt_st_pro_sales_yr_mon date;declare ti_invoice_acct_day tinyint;declare dt_invoice_sales_yr_mon date;declare i_store_daily_sales_id integer;declare c_store_number char(9);declare ti_print_statements tinyint;declare c_store_type char(1);declare c_ref_country_cd char(2);declare ti_jobber_acct_in_use tinyint;declare si_default_ar_terms_id smallint;declare si_primary_tax_table_id smallint;declare si_secondary_tax_table_id smallint;declare si_invoice_acct_day smallint;select invoice_number,ref_transaction_type_id,customer_id,invoice_date,po_number,original_invoice_id,ref_credit_debit_rebill_cd,tax_amount_1,tax_amount_2,delivery_charge,invoice_total,roa_discount,st_pro.curr_acct_day,st_pro.current_sales_year_month,invoice.accounting_day,invoice.sales_year_month,st_pro.store_num,ar_pro.print_statements,st_pro.store_type,st_pro.ref_country_cd,st_pro.jobber_acct_in_use,ar_pro.default_ar_terms_id,primary_tax_table_id,secondary_tax_table_id,invoice.accounting_day into i_invoice_number,ti_ref_transaction_type_id,i_customer_id,ts_invoice_date,c_po_number,i_original_invoice_id,c_ref_credit_debit_rebill_cd,d_tax_amount_1,d_tax_amount_2,d_delivery_charge,d_invoice_total,d_roa_discount,si_st_pro_acct_day,dt_st_pro_sales_yr_mon,ti_invoice_acct_day,dt_invoice_sales_yr_mon,c_store_number,ti_print_statements,c_store_type,c_ref_country_cd,ti_jobber_acct_in_use,si_default_ar_terms_id,si_primary_tax_table_id,si_secondary_tax_table_id,si_invoice_acct_day from invoice,store_profile as st_pro,ar_profile as ar_pro where invoice.id=deleted.invoice_id and invoice.loc=deleted.loc and st_pro.loc=invoice.loc and ar_pro.loc=st_pro.loc;if dt_st_pro_sales_yr_mon=dt_invoice_sales_yr_mon and si_st_pro_acct_day=si_invoice_acct_day then select id into i_store_daily_sales_id from store_daily_sales where loc=deleted.loc and sales_year_month=dt_invoice_sales_yr_mon and accounting_day=si_invoice_acct_day;call sp_invoice_payment_sales_post(-1,deleted.loc,i_store_daily_sales_id,deleted.ref_tender_type_id,deleted.amount_applied,2) end if;if(deleted.ref_tender_type_id=1) or(ti_ref_transaction_type_id=3) then call sp_invoice_ar_post(deleted.invoice_id,deleted.loc,i_invoice_number,ti_ref_transaction_type_id,i_customer_id,ts_invoice_date,ti_invoice_acct_day,dt_invoice_sales_yr_mon,c_po_number,i_original_invoice_id,c_ref_credit_debit_rebill_cd,d_tax_amount_1,d_tax_amount_2,d_delivery_charge,d_invoice_total,d_roa_discount,deleted.ref_tender_type_id,null,null,null,-1,deleted.last_modified_date,deleted.modified_by_employee_id,2,1,null,si_primary_tax_table_id,si_secondary_tax_table_id,null) end if end', 'tr_ad_po_header','PO_HEADER','A','D',1,'create trigger tr_ad_po_header after delete on PO_HEADER referencing old as deleted for each row begin declare v_url varchar(50);declare v_msg_type varchar(30);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=deleted.loc),10)=1 then set v_msg_type=''PO_IN'';set v_msg_action=''Delete'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=deleted.loc);insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(deleted.loc,deleted.purchase_order_number,v_msg_type,v_msg_action,v_url) end if end', 'tr_ad_pricing_profile','PRICING_PROFILE','A','D',1,'create trigger tr_ad_pricing_profile after delete on PRICING_PROFILE referencing old as deleted for each row begin declare i_next_id integer;declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=2;set v_pricing_tracker_action=''D'';if fn_pricing_tracker_in_use(deleted.loc)=''Y'' then if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=deleted.id and loc=deleted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=deleted.description where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=deleted.id and loc=deleted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',deleted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,deleted.loc,i_pricing_tracker_type,v_pricing_tracker_action,deleted.id,deleted.description) end if end if end', 'tr_ad_pricing_profile_detail','PRICING_PROFILE_DETAIL','A','D',1,'create trigger tr_ad_pricing_profile_detail after delete on PRICING_PROFILE_DETAIL referencing old as deleted for each row begin declare i_next_id integer;declare v_pricing_profile_description varchar(50);declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=2;set v_pricing_tracker_action=''U'';if fn_pricing_tracker_in_use(deleted.loc)=''Y'' then select description into v_pricing_profile_description from pricing_profile where id=deleted.pricing_profile_id and loc=deleted.loc;if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=deleted.pricing_profile_id and loc=deleted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=v_pricing_profile_description where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=deleted.pricing_profile_id and loc=deleted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',deleted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,deleted.loc,i_pricing_tracker_type,v_pricing_tracker_action,deleted.pricing_profile_id,v_pricing_profile_description) end if end if end', 'tr_ad_product_line','PRODUCT_LINE','A','D',1,'create trigger tr_ad_product_line after delete on PRODUCT_LINE referencing old as deleted for each row begin if exists(select line_abbrev from product_line_edit_audit where line_abbrev=deleted.line_abbrev and group_code=deleted.group_code and loc=deleted.loc) then update product_line_edit_audit set edit_type=''D'',primary_stocking_ref_class_cd=deleted.primary_stocking_ref_class_cd,tractor_stocking_ref_class_cd=deleted.tractor_stocking_ref_class_cd,high_performance_stocking_ref_class_cd=deleted.high_performance_stocking_ref_class_cd,optional_stocking_ref_class_cd=deleted.optional_stocking_ref_class_cd,machine_shop_stocking_ref_class_cd=deleted.machine_shop_stocking_ref_class_cd,return_in_std_pkg=deleted.return_in_std_pkg,additional_stocking_months=deleted.additional_stocking_months,last_modified_date=current timestamp where line_abbrev=deleted.line_abbrev and group_code=deleted.group_code and loc=deleted.loc else insert into product_line_edit_audit(loc,line_abbrev,group_code,edit_type,primary_stocking_ref_class_cd,tractor_stocking_ref_class_cd,high_performance_stocking_ref_class_cd,optional_stocking_ref_class_cd,machine_shop_stocking_ref_class_cd,return_in_std_pkg,additional_stocking_months) values(deleted.loc,deleted.line_abbrev,deleted.group_code,''D'',deleted.primary_stocking_ref_class_cd,deleted.tractor_stocking_ref_class_cd,deleted.high_performance_stocking_ref_class_cd,deleted.optional_stocking_ref_class_cd,deleted.machine_shop_stocking_ref_class_cd,deleted.return_in_std_pkg,deleted.additional_stocking_months) end if end', 'tr_ad_saved_invoice','SAVED_INVOICE','A','D',1,'create trigger tr_ad_saved_invoice after delete on SAVED_INVOICE referencing old as deleted for each row begin declare v_url varchar(50);declare v_msg_type varchar(30);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=deleted.loc),10)=1 and not exists(select*from saved_invoice where wms_transaction_identifier=deleted.wms_transaction_identifier and loc=deleted.loc) then if deleted.wms_transaction_identifier like ''TO%'' then set v_msg_type=''TRANSFER'' else set v_msg_type=''ORDER'' end if;set v_msg_action=''Delete'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=deleted.loc);insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(deleted.loc,deleted.wms_transaction_identifier,v_msg_type,v_msg_action,v_url) end if end', 'tr_ad_saved_invoice_line_item','SAVED_INVOICE_LINE_ITEM','A','D',1,'create trigger tr_ad_saved_invoice_line_item after delete on SAVED_INVOICE_LINE_ITEM referencing old as deleted for each row begin declare i_order_type integer;declare i_invoice_line_item_count integer;declare i_invoice_note_count integer;declare i_total_count integer;select SALES_ORDER.REF_ORDER_SUB_TYPE_ID into i_order_type from SAVED_INVOICE join SALES_ORDER on SAVED_INVOICE.SALES_ORDER_ID=SALES_ORDER.ID where SAVED_INVOICE.ID=deleted.saved_invoice_id;if(i_order_type=1) then if((select COUNT() from SAVED_INVOICE_LINE_ITEM where SAVED_INVOICE_ID=deleted.saved_invoice_id)=0) then delete from SAVED_INVOICE_NOTE where SAVED_INVOICE_ID=deleted.saved_invoice_id else delete from SAVED_INVOICE_NOTE where SAVED_INVOICE_ID=deleted.saved_invoice_id and GENERATED_BY_SEQUENCE=deleted.SEQUENCE end if;select COUNT(SAVED_INVOICE_ID) into i_invoice_line_item_count from SAVED_INVOICE_LINE_ITEM where SAVED_INVOICE_ID=deleted.saved_invoice_id;select COUNT(SAVED_INVOICE_ID) into i_invoice_note_count from SAVED_INVOICE_NOTE where SAVED_INVOICE_ID=deleted.saved_invoice_id;set i_total_count=i_invoice_line_item_count+i_invoice_note_count;update SAVED_INVOICE set NUMBER_OF_LINES=i_total_count,WORK_IN_PROGRESS_UPDATED=(if i_total_count=0 then ''N'' else WORK_IN_PROGRESS_UPDATED endif) where ID=deleted.saved_invoice_id end if end', 'tr_ad_user_profile','USER_PROFILE','A','D',1,'create trigger tr_ad_user_profile after delete on USER_PROFILE referencing old as deleted for each row begin if deleted.user_name in(''store_read'',''store_write'') then raiserror 18018 ''tr_ad_user_profile: Delete not allowed. Use tams_dba.sp_set_user_pwd to set a blank password instead.'' end if end', 'tr_ai_alert','ALERT','A','I',1,'create trigger tr_ai_alert after insert on ALERT referencing new as inserted for each row begin if(inserted.message_number is not null and(inserted.text is not null or inserted.summary is not null)) then raiserror 18086 ''tr_ai_alert: message_number and text'' || '' cannot both have values.'' end if end', 'tr_ai_ar_payment','AR_PAYMENT','A','I',1,'create trigger tr_ai_ar_payment after insert on AR_PAYMENT referencing new as inserted for each row begin declare i_store_transaction_date_id integer;if inserted.ref_ar_payment_origination_cd=''P'' then call sp_ar_payment_sales_post(inserted.loc,inserted.accounting_day,inserted.sales_year_month,inserted.payment_amount,inserted.discount_taken,1) end if;if not exists(select id from store_transaction_date where calendar_date=DATE(inserted.payment_entry_date) and sales_year_month=inserted.sales_year_month and accounting_day=inserted.accounting_day and loc=inserted.loc) then set i_store_transaction_date_id=sp_get_seq(''STORE_TRANSACTION_DATE'',inserted.loc);insert into store_transaction_date(id,loc,accounting_day,calendar_date,sales_year_month) values(i_store_transaction_date_id,inserted.loc,inserted.accounting_day,DATE(inserted.payment_entry_date),inserted.sales_year_month) end if end', 'tr_ai_ar_transaction','AR_TRANSACTION','A','I',1,'create trigger tr_ai_ar_transaction after insert on AR_TRANSACTION referencing new as inserted for each row begin declare i_store_transaction_date_id integer;if not exists(select id from store_transaction_date where calendar_date=DATE(inserted.date_of_original_transaction) and sales_year_month=inserted.sales_year_month and accounting_day=inserted.accounting_day and loc=inserted.loc) then set i_store_transaction_date_id=sp_get_seq(''STORE_TRANSACTION_DATE'',inserted.loc);insert into store_transaction_date(id,loc,accounting_day,calendar_date,sales_year_month) values(i_store_transaction_date_id,inserted.loc,inserted.accounting_day,DATE(inserted.date_of_original_transaction),inserted.sales_year_month) end if end', 'tr_ai_barcode','BARCODE','A','I',1,'create trigger tr_ai_barcode after insert on BARCODE referencing new as inserted for each row begin declare i_inventory_id integer;declare v_url varchar(50);declare v_msg_type varchar(45);declare v_msg_action varchar(10);declare i_loc integer;select loc into i_loc from store_profile;if MOD((select indago_in_use from store_profile where loc=i_loc),10)=1 then select id into i_inventory_id from inventory where line_abbrev=inserted.line_abbrev and part_number=inserted.part_number and loc=i_loc;if i_inventory_id is not null then set v_msg_type=''PRODUCT_IN'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=i_loc);set v_msg_action=''Update'';insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(i_loc,i_inventory_id,v_msg_type,v_msg_action,v_url) end if end if end', 'tr_ai_classification_return','CLASSIFICATION_RETURN','A','I',1,'create trigger tr_ai_classification_return after insert on CLASSIFICATION_RETURN referencing new as inserted for each row begin declare v_url varchar(50);declare v_msg_type varchar(30);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 then set v_msg_type=''PO_IN_RETURN'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);set v_msg_action=''New'';insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,inserted.CLASSIFICATION_SESSION_ID,v_msg_type,v_msg_action,v_url) end if end', 'tr_ai_classification_return_item','CLASSIFICATION_RETURN_ITEM','A','I',1,'create trigger tr_ai_classification_return_item after insert on CLASSIFICATION_RETURN_ITEM referencing new as inserted for each row begin declare v_url varchar(50);declare v_classification_session_id varchar(21);declare v_msg_type varchar(30);declare v_msg_action varchar(10);declare i_wms_transaction_status integer;if MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 then set v_msg_type=''PO_IN_RETURN'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);select classification_session_id into v_classification_session_id from classification_return where id=inserted.classification_return_id and loc=inserted.loc;select wms_transaction_status into i_wms_transaction_status from classification_session where id=(select classification_session_id from classification_return where id=inserted.classification_return_id) and loc=inserted.loc;if inserted.item_posted=''N'' then set v_msg_action=''Update'';if not exists(select message_record_id from indago_outbound_message where message_type=''PO_IN_RETURN'' and message_action in(''Update'',''New'') and ISNULL(STRING(MESSAGE_RECORD_ID),'''')=ISNULL(v_classification_session_id,'''')) and(i_wms_transaction_status <> 2 or i_wms_transaction_status <> 3) then update classification_session set wms_transaction_status=1 where id=(select classification_session_id from classification_return where id=inserted.classification_return_id);insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,v_classification_session_id,v_msg_type,v_msg_action,v_url) end if end if end if end', 'tr_ai_communication_directory','COMMUNICATION_DIRECTORY','A','I',1,'create trigger tr_ai_communication_directory after insert on COMMUNICATION_DIRECTORY referencing old as existed new as inserted for each row begin if(((select send_customer_domain from store_profile)=''Y'' and ISNULL(inserted.INVOICE_TO_CUSTOMER_ID,0) > 0) and(select count() from customer_change_queue where customer_id=inserted.INVOICE_TO_CUSTOMER_ID and loc=inserted.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0) then if inserting then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(inserted.INVOICE_TO_CUSTOMER_ID,inserted.loc,''I'',''COMMUNICATION_DIRECTORY'',inserted.id) end if end if end', 'tr_ai_customer','CUSTOMER','A','I',1,'create trigger tr_ai_customer after insert on CUSTOMER referencing new as inserted for each row begin declare v_url varchar(50);if inserted.customer_num=41050 and inserted.ref_billing_type_cd <> ''C'' then update customer set ref_billing_type_cd=''C'' where id=inserted.id and loc=inserted.loc end if;if(select MOD(indago_in_use,10) from store_profile where loc=inserted.loc)=1 then select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,inserted.customer_num,''CUST_IN'',''New'',v_url) end if end', 'tr_ai_customer_ar','CUSTOMER_AR','A','I',1,'create trigger tr_ai_customer_ar after insert on CUSTOMER_AR referencing new as inserted for each row begin if MOD((select gpc_owned from store_profile where loc=inserted.loc),10)=1 and MOD((select print_statements from ar_profile where loc=inserted.loc),10)=0 and inserted.ref_statement_type_id <> 2 then update customer_ar set ref_statement_type_id=2 where customer_id=inserted.customer_id and loc=inserted.loc end if end', 'tr_ai_customer_custom_pricing','CUSTOMER_CUSTOM_PRICING','A','I',1,'create trigger tr_ai_customer_custom_pricing after insert on CUSTOMER_CUSTOM_PRICING referencing new as inserted for each row begin declare i_next_id integer;declare i_customer_number integer;declare v_customer_name varchar(40);declare v_customer_type varchar(1);declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=1;set v_pricing_tracker_action=''U'';if fn_pricing_tracker_in_use(inserted.loc)=''Y'' then select customer_num,name,ref_customer_type_cd into i_customer_number,v_customer_name,v_customer_type from customer where id=inserted.customer_id and loc=inserted.loc;if v_customer_type=''A'' then if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=inserted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=v_customer_name where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=inserted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',inserted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,inserted.loc,i_pricing_tracker_type,v_pricing_tracker_action,i_customer_number,v_customer_name) end if end if end if end', 'tr_ai_customer_pricing_profile','CUSTOMER_PRICING_PROFILE','A','I',1,'create trigger tr_ai_customer_pricing_profile after insert on CUSTOMER_PRICING_PROFILE referencing new as inserted for each row begin declare i_next_id integer;declare i_customer_number integer;declare v_customer_name varchar(40);declare v_customer_type varchar(1);declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=1;set v_pricing_tracker_action=''U'';if fn_pricing_tracker_in_use(inserted.loc)=''Y'' then select customer_num,name,ref_customer_type_cd into i_customer_number,v_customer_name,v_customer_type from customer where id=inserted.customer_id and loc=inserted.loc;if v_customer_type=''A'' then if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=inserted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=v_customer_name where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=inserted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',inserted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,inserted.loc,i_pricing_tracker_type,v_pricing_tracker_action,i_customer_number,v_customer_name) end if end if end if end', 'tr_ai_inventory','INVENTORY','A','I',1,'create trigger tr_ai_inventory after insert on INVENTORY referencing new as inserted for each row begin declare v_url varchar(50);declare v_msg_type varchar(45);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 then set v_msg_type=''PRODUCT_IN'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);set v_msg_action=''New'';insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,inserted.id,v_msg_type,v_msg_action,v_url) end if;if((select MOD(use_inventory_feed,10) from inventory_profile)=1) and(TRIM(inserted.part_number) <> '''') then insert into inventory_change_queue(id,inventory_id,loc,line_abbrev,part_number,action,trigger_source) values(null,inserted.id,inserted.loc,inserted.line_abbrev,inserted.part_number,''U'',1) end if end', 'tr_ai_inventory_sales','INVENTORY_SALES','A','I',1,'create trigger tr_ai_inventory_sales after insert on INVENTORY_SALES referencing new as inserted for each row begin if inserted.SALES_QTY > 0 then call sp_log_file_update_activity(inserted.loc,178,5,inserted.id,null,null,null,inserted.SALES_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,null,1) end if;if inserted.RETURN_QTY > 0 then call sp_log_file_update_activity(inserted.loc,178,9,inserted.id,null,null,null,inserted.RETURN_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,null,1) end if end', 'tr_ai_inventory_stock','INVENTORY_STOCK','A','I',1,'create trigger tr_ai_inventory_stock after insert on INVENTORY_STOCK referencing new as inserted for each row begin declare v_line_abbrev varchar(3);declare v_part_number varchar(22);if((select MOD(use_inventory_feed,10) from inventory_profile)=1 and not exists(select 1 from kit_participation where kit_inventory_id=inserted.inventory_id)) then select line_abbrev,part_number into v_line_abbrev,v_part_number from inventory where id=inserted.inventory_id;if(TRIM(v_part_number) <> '''' and(inserted.on_hand <> 0 or inserted.work_in_progress <> 0 or inserted.minimum_stock_qty <> 0 or inserted.maximum_stock_qty <> 0 or inserted.minimum_sale_qty <> 0 or inserted.on_order <> 0 or inserted.on_backorder <> 0 or inserted.on_factory_order <> 0)) then insert into inventory_stock_change_queue(id,inventory_id,loc,line_abbrev,part_number,action,trigger_source) values(null,inserted.inventory_id,inserted.loc,v_line_abbrev,v_part_number,''U'',1) end if end if end', 'tr_ai_inventory_stock_location','INVENTORY_STOCK_LOCATION','A','I',1,'create trigger tr_ai_inventory_stock_location after insert on INVENTORY_STOCK_LOCATION referencing new as inserted for each row begin if(select MOD(use_inventory_feed,10) from inventory_profile)=1 then insert into inventory_stock_location_change_queue(id,inventory_stock_location_id,loc,action,trigger_source) values(null,inserted.id,inserted.loc,''U'',1) end if end', 'tr_ai_invoice','INVOICE','A','I',1,'create trigger tr_ai_invoice after insert on INVOICE referencing new as inserted for each row begin call sp_invoice_sales_post(1,inserted.loc,inserted.ref_transaction_type_id,inserted.counterman_employee_id,inserted.customer_id,inserted.primary_tax_table_id,inserted.secondary_tax_table_id,inserted.invoice_date,inserted.accounting_day,inserted.invoice_cost,inserted.invoice_total,inserted.invoice_rebate,inserted.invoice_net_sales,inserted.roa_discount,inserted.sales_year_month,inserted.taxable_sales_1,inserted.tax_amount_1,inserted.taxable_sales_2,inserted.tax_amount_2,inserted.excise_taxable_amount,inserted.misc_adjustments,inserted.delivery_charge,0,inserted.delivery_charge_taxable_1,inserted.delivery_charge_taxable_2,1,inserted.ref_napa_customer_category_id);call sp_invoice_customer_post(inserted.loc,1,inserted.invoice_date,inserted.customer_id,inserted.ref_transaction_type_id,inserted.invoice_total,inserted.last_modified_date,inserted.modified_by_employee_id,0,inserted.invoice_number,inserted.roa_discount);if(select MOD(use_invoice_feed,10) from invoicing_profile)=1 and exists(select 1 from store_profile where curr_acct_day=inserted.accounting_day and current_sales_year_month=inserted.sales_year_month) then insert into invoice_change_queue(invoice_id,loc,action,trigger_source) values(inserted.id,inserted.loc,''U'',1) end if end', 'tr_ai_invoice_line_item','INVOICE_LINE_ITEM','A','I',1,'create trigger tr_ai_invoice_line_item after insert on INVOICE_LINE_ITEM referencing new as inserted for each row begin declare i_invoice_number integer;declare i_customer_id integer;declare ts_invoice_date timestamp;declare ti_accounting_day tinyint;declare dt_sales_year_month date;declare ti_ref_txn_type_id tinyint;declare i_salesperson_id integer;declare i_cashier_id integer;declare c_delivery_flag char(1);declare si_primary_tax_id smallint;declare si_secondary_tax_id smallint;declare ti_ref_napa_customer_category_id tinyint;declare i_inventory_id integer;declare c_ref_class_cd char(2);declare si_invoice_count smallint;declare si_delivered_count smallint;declare i_store_daily_sales_id integer;declare ti_rgn_in_use tinyint;declare c_kit_component_flag char(1);declare c_kit_replacement_part char(1);set si_invoice_count=0;set si_delivered_count=0;set c_kit_replacement_part=''N'';if not exists(select*from ref_unit_designator where cd=inserted.ref_unit_designator) then raiserror 19004 ''tr_ai_invoice_line_item: invalid ref_unit_designator: '' || inserted.ref_unit_designator end if;if inserted.kit_component=''Y'' and inserted.generated_by_sequence is not null and inserted.auto_generated_misc_chg=''N'' and inserted.core_transaction=''N'' and(inserted.part_number=any(select ili.part_number from invoice_line_item as ili where ili.sequence=inserted.generated_by_sequence and ili.invoice_id=inserted.invoice_id) and inserted.line_abbrev=any(select ili.line_abbrev from invoice_line_item as ili where ili.sequence=inserted.generated_by_sequence and ili.invoice_id=inserted.invoice_id)) then set c_kit_replacement_part=''Y'' end if;set c_kit_component_flag=''Y'';if(inserted.generated_by_sequence is not null and inserted.kit_component=''Y'' and c_kit_replacement_part=''N'') then set c_kit_component_flag=''N'' end if;select invoice_number,customer_id,invoice_date,accounting_day,sales_year_month,ref_transaction_type_id,salesman_employee_id,cashier_employee_id,delivery_flag,primary_tax_table_id,secondary_tax_table_id,ref_napa_customer_category_id into i_invoice_number,i_customer_id,ts_invoice_date,ti_accounting_day,dt_sales_year_month,ti_ref_txn_type_id,i_salesperson_id,i_cashier_id,c_delivery_flag,si_primary_tax_id,si_secondary_tax_id,ti_ref_napa_customer_category_id from invoice where id=inserted.invoice_id and loc=inserted.loc;select id,current_year_ref_class_cd into i_inventory_id,c_ref_class_cd from inventory where line_abbrev=inserted.line_abbrev and part_number=inserted.part_number and loc=inserted.loc;select id into i_store_daily_sales_id from store_daily_sales where loc=inserted.loc and sales_year_month=dt_sales_year_month and accounting_day=ti_accounting_day;select rgn_in_use into ti_rgn_in_use from store_profile where loc=inserted.loc;select COUNT() into si_invoice_count from invoice_line_item where invoice_id=inserted.invoice_id and loc=inserted.loc;if si_invoice_count <> 1 then set si_invoice_count=0 else if c_delivery_flag=''Y'' then set si_delivered_count=1 end if end if;call sp_invoice_line_sales_post(1,ti_ref_txn_type_id,ti_accounting_day,c_delivery_flag,i_inventory_id,c_ref_class_cd,i_customer_id,i_cashier_id,i_salesperson_id,si_primary_tax_id,si_secondary_tax_id,dt_sales_year_month,si_invoice_count,si_delivered_count,0,i_store_daily_sales_id,inserted.loc,inserted.ref_invoice_line_item_type_id,inserted.department_id,inserted.sub_department_id,inserted.store_group_id,inserted.counterman_employee_id,inserted.ref_invoice_line_item_origin_id,inserted.does_not_affect_sales_history,inserted.non_stocking,inserted.defective,inserted.warranty_labor_claim,inserted.taxable_1,inserted.taxable_2,inserted.case_price,inserted.pickup_item,inserted.core_transaction,inserted.rebate_item,inserted.line_abbrev,inserted.group_code,inserted.quantity_billed,inserted.unit_price,inserted.unit_cost,inserted.misc_adjustments,inserted.unit_rebate,inserted.last_modified_date,inserted.modified_by_employee_id,0,1,ti_ref_napa_customer_category_id,c_kit_component_flag);if inserted.ref_invoice_line_item_type_id not in(3,4,7,8,9,10,11,13,14) and inserted.pickup_item=''N'' and inserted.policy_adjustment=''N'' and inserted.backorder=''N'' and not(inserted.kit_component=''Y'' and inserted.generated_by_sequence is null) and c_kit_replacement_part=''N'' then call sp_invoice_line_inventory_post(i_inventory_id,c_ref_class_cd,i_customer_id,ts_invoice_date,inserted.loc,inserted.ref_invoice_line_item_type_id,inserted.core_transaction,inserted.defective,inserted.does_not_affect_sales_history,inserted.update_return_cores_on_hand,inserted.special_sale,inserted.special_sale_code,inserted.warranty_item,inserted.warranty_labor_claim,inserted.quantity_billed,1,inserted.picked_by_rads,inserted.last_modified_date,inserted.modified_by_employee_id) end if;if inserted.buyout_po_number is not null then call sp_invoice_buyout_post(inserted.invoice_id,inserted.loc,i_invoice_number,i_customer_id,ts_invoice_date,1,inserted.sequence,inserted.line_abbrev,inserted.part_number,inserted.core_transaction,inserted.unit_price,inserted.unit_cost,inserted.buyout_po_number,inserted.last_modified_date,inserted.modified_by_employee_id,0) end if end', 'tr_ai_invoice_payment','INVOICE_PAYMENT','A','I',1,'create trigger tr_ai_invoice_payment after insert on INVOICE_PAYMENT referencing new as inserted for each row begin declare i_invoice_number integer;declare ti_ref_transaction_type_id tinyint;declare i_customer_id integer;declare ts_invoice_date timestamp;declare c_po_number varchar(30);declare i_original_invoice_id integer;declare c_ref_credit_debit_rebill_cd char(1);declare d_tax_amount_1 decimal(8,2);declare d_tax_amount_2 decimal(8,2);declare d_delivery_charge decimal(10,2);declare d_invoice_total decimal(12,2);declare d_roa_discount decimal(8,2);declare si_st_pro_acct_day smallint;declare dt_st_pro_sales_yr_mon date;declare ti_invoice_acct_day tinyint;declare dt_invoice_sales_yr_mon date;declare i_store_daily_sales_id integer;declare c_store_number char(9);declare ti_print_statements tinyint;declare c_store_type char(1);declare c_ref_country_cd char(2);declare ti_jobber_acct_in_use tinyint;declare si_default_ar_terms_id smallint;declare si_primary_tax_table_id smallint;declare si_secondary_tax_table_id smallint;select invoice_number,ref_transaction_type_id,customer_id,invoice_date,po_number,original_invoice_id,ref_credit_debit_rebill_cd,tax_amount_1,tax_amount_2,delivery_charge,invoice_total,roa_discount,st_pro.curr_acct_day,st_pro.current_sales_year_month,invoice.accounting_day,invoice.sales_year_month,st_pro.store_num,ar_pro.print_statements,st_pro.store_type,st_pro.ref_country_cd,st_pro.jobber_acct_in_use,ar_pro.default_ar_terms_id,primary_tax_table_id,secondary_tax_table_id into i_invoice_number,ti_ref_transaction_type_id,i_customer_id,ts_invoice_date,c_po_number,i_original_invoice_id,c_ref_credit_debit_rebill_cd,d_tax_amount_1,d_tax_amount_2,d_delivery_charge,d_invoice_total,d_roa_discount,si_st_pro_acct_day,dt_st_pro_sales_yr_mon,ti_invoice_acct_day,dt_invoice_sales_yr_mon,c_store_number,ti_print_statements,c_store_type,c_ref_country_cd,ti_jobber_acct_in_use,si_default_ar_terms_id,si_primary_tax_table_id,si_secondary_tax_table_id from invoice,store_profile as st_pro,ar_profile as ar_pro where invoice.id=inserted.invoice_id and invoice.loc=inserted.loc and st_pro.loc=invoice.loc and ar_pro.loc=st_pro.loc;select id into i_store_daily_sales_id from store_daily_sales where loc=inserted.loc and sales_year_month=dt_invoice_sales_yr_mon and accounting_day=ti_invoice_acct_day;call sp_invoice_payment_sales_post(1,inserted.loc,i_store_daily_sales_id,inserted.ref_tender_type_id,inserted.amount_applied,0);if(inserted.ref_tender_type_id=1 and MOD(ti_print_statements,10)=1) or(ti_ref_transaction_type_id=3 and(c_store_type=''J'' or MOD(ti_print_statements,10)=1 or MOD(ti_jobber_acct_in_use,10)=1)) then call sp_invoice_ar_post(inserted.invoice_id,inserted.loc,i_invoice_number,ti_ref_transaction_type_id,i_customer_id,ts_invoice_date,ti_invoice_acct_day,dt_invoice_sales_yr_mon,c_po_number,i_original_invoice_id,c_ref_credit_debit_rebill_cd,d_tax_amount_1,d_tax_amount_2,d_delivery_charge,d_invoice_total,d_roa_discount,inserted.ref_tender_type_id,inserted.credit_card_or_check_number,c_store_number,si_default_ar_terms_id,1,inserted.last_modified_date,inserted.modified_by_employee_id,0,1,null,si_primary_tax_table_id,si_secondary_tax_table_id,inserted.check_number) end if end', 'tr_ai_po_header','PO_HEADER','A','I',1,'create trigger tr_ai_po_header after insert on PO_HEADER referencing new as inserted for each row begin declare v_url varchar(50);declare v_msg_type varchar(30);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 then set v_msg_type=''PO_IN'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);set v_msg_action=''New'';insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,inserted.purchase_order_number,v_msg_type,v_msg_action,v_url) end if end', 'tr_ai_po_item','PO_ITEM','A','I',1,'create trigger tr_ai_po_item after insert on PO_ITEM referencing new as inserted for each row begin declare v_url varchar(50);declare v_purchase_order_number varchar(21);declare v_msg_type varchar(30);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 then set v_msg_type=''PO_IN'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);select purchase_order_number into v_purchase_order_number from po_header where id=inserted.po_header_id and loc=inserted.loc;if inserted.order_qty=0 and inserted.po_item_status=''N'' then set v_msg_action=''Update'';if not exists(select message_record_id from indago_outbound_message where message_type=''PO_IN'' and message_action=''Update'' and ISNULL(STRING(MESSAGE_RECORD_ID),'''')=ISNULL(v_purchase_order_number,'''')) then insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,v_purchase_order_number,v_msg_type,v_msg_action,v_url) end if end if end if end', 'tr_ai_po_item_store','PO_ITEM_STORE','A','I',1,'create trigger tr_ai_po_item_store after insert on PO_ITEM_STORE referencing new as inserted for each row begin declare v_url varchar(50);declare v_msg_type varchar(45);declare v_msg_action varchar(10);declare i_loc integer;declare v_main_store_num varchar(9);select loc into i_loc from store_profile;select store_num into v_main_store_num from store_profile;if MOD((select indago_in_use from store_profile where loc=i_loc),10)=1 then set v_msg_type=''BACK_ORDER'';set v_msg_action=''New'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=i_loc);if not exists(select i.MESSAGE_RECORD_ID from indago_outbound_message as i where i.message_type=''BACK_ORDER'' and ISNULL(STRING(i.MESSAGE_RECORD_ID),'''')=ISNULL(STRING(inserted.purchase_order_number),'''')) and(inserted.ORDER_FOR_STORE_NUMBER <> v_main_store_num) then insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(i_loc,inserted.purchase_order_number,v_msg_type,v_msg_action,v_url) end if end if end', 'tr_ai_pricing_profile','PRICING_PROFILE','A','I',1,'create trigger tr_ai_pricing_profile after insert on PRICING_PROFILE referencing new as inserted for each row begin declare i_next_id integer;declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=2;set v_pricing_tracker_action=''A'';if fn_pricing_tracker_in_use(inserted.loc)=''Y'' then if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=inserted.id and loc=inserted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=inserted.description where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=inserted.id and loc=inserted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',inserted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,inserted.loc,i_pricing_tracker_type,v_pricing_tracker_action,inserted.id,inserted.description) end if end if end', 'tr_ai_pricing_profile_detail','PRICING_PROFILE_DETAIL','A','I',1,'create trigger tr_ai_pricing_profile_detail after insert on PRICING_PROFILE_DETAIL referencing new as inserted for each row begin declare i_next_id integer;declare v_pricing_profile_description varchar(50);declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=2;set v_pricing_tracker_action=''U'';if fn_pricing_tracker_in_use(inserted.loc)=''Y'' then select description into v_pricing_profile_description from pricing_profile where id=inserted.pricing_profile_id and loc=inserted.loc;if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=inserted.pricing_profile_id and loc=inserted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=v_pricing_profile_description where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=inserted.pricing_profile_id and loc=inserted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',inserted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,inserted.loc,i_pricing_tracker_type,v_pricing_tracker_action,inserted.pricing_profile_id,v_pricing_profile_description) end if end if end', 'tr_ai_product_line','PRODUCT_LINE','A','I',1,'create trigger tr_ai_product_line after insert on PRODUCT_LINE referencing new as inserted for each row begin if inserted.group_code <> 0 then if not exists(select id from product_line where line_abbrev=inserted.line_abbrev and group_code=0 and loc=inserted.loc) then raiserror 18008 ''tr_bi_product_line: group_code 0 for line_abbrev '' || inserted.line_abbrev || '' does not exist!'' end if end if;if exists(select line_abbrev from product_line_edit_audit where line_abbrev=inserted.line_abbrev and group_code=inserted.group_code and loc=inserted.loc) then update product_line_edit_audit set edit_type=''C'',primary_stocking_ref_class_cd=inserted.primary_stocking_ref_class_cd,tractor_stocking_ref_class_cd=inserted.tractor_stocking_ref_class_cd,high_performance_stocking_ref_class_cd=inserted.high_performance_stocking_ref_class_cd,optional_stocking_ref_class_cd=inserted.optional_stocking_ref_class_cd,machine_shop_stocking_ref_class_cd=inserted.machine_shop_stocking_ref_class_cd,return_in_std_pkg=inserted.return_in_std_pkg,additional_stocking_months=inserted.additional_stocking_months,last_modified_date=current timestamp where line_abbrev=inserted.line_abbrev and group_code=inserted.group_code and loc=inserted.loc else insert into product_line_edit_audit(loc,line_abbrev,group_code,edit_type,primary_stocking_ref_class_cd,tractor_stocking_ref_class_cd,high_performance_stocking_ref_class_cd,optional_stocking_ref_class_cd,machine_shop_stocking_ref_class_cd,return_in_std_pkg,additional_stocking_months) values(inserted.loc,inserted.line_abbrev,inserted.group_code,''C'',inserted.primary_stocking_ref_class_cd,inserted.tractor_stocking_ref_class_cd,inserted.high_performance_stocking_ref_class_cd,inserted.optional_stocking_ref_class_cd,inserted.machine_shop_stocking_ref_class_cd,inserted.return_in_std_pkg,inserted.additional_stocking_months) end if;if(select MOD(use_inventory_feed,10) from inventory_profile)=1 then insert into product_line_change_queue(id,product_line_id,loc,action,trigger_source) values(null,inserted.id,inserted.loc,''U'',1) end if end', 'tr_ai_rads_item','RADS_ITEM','A','I',1,'create trigger tr_ai_rads_item after insert on RADS_ITEM referencing new as inserted for each row begin declare i_po_header_id integer;declare i_po_item_id integer;declare v_line_abbrev varchar(3);declare v_part_number varchar(22);declare d_cost decimal(12,4);declare d_core_cost decimal(12,4);declare v_purchase_order_number varchar(9);if(inserted.rads_request_status <> 97 and inserted.rads_request_status <> 98 and inserted.rads_request_status <> 99) then select line_abbrev,part_number,cost,core_cost into v_line_abbrev,v_part_number,d_cost,d_core_cost from inventory where id=inserted.inventory_id and loc=inserted.loc;set v_purchase_order_number=inserted.transaction_number;set v_purchase_order_number=v_purchase_order_number || RIGHT(''000'' || inserted.saved_invoice_line_item_sequence,4);set i_po_header_id=sp_get_seq(''po_header'',inserted.loc);insert into po_header(id,loc,ref_order_type_cd,purchase_order_number,vendor_id,order_group_id,factory_order_table_id,terms,shipping_instructions,update_on_order_qtys,creation_date,created_by_employee_id,created_by_multi_store,order_from_loc,total_order_value,total_discount_value,line_items_ordered,line_items_received,total_receipt_value,last_receipt_date,posting_complete_date,ref_factory_backorder_handling_cd,received_by_vendor_date,anticipated_ship_date,acknowledged_total_order_value,acknowledged_line_items_ordered,rads_po,last_modified_date,modified_by_employee_id,total_order_qty,total_received_qty) values(i_po_header_id,inserted.loc,''J'',v_purchase_order_number,null,null,null,null,null,''Y'',inserted.last_modified_date,inserted.modified_by_employee_id,''N'',null,((d_cost+d_core_cost)*inserted.order_qty),0,1,0,0,null,null,null,null,null,null,null,''Y'',inserted.last_modified_date,inserted.modified_by_employee_id,inserted.order_qty,0);set i_po_item_id=sp_get_seq(''po_item'',inserted.loc);insert into po_item(id,loc,po_header_id,line_abbrev,part_number,ref_receipt_type_cd,damaged_qty,order_qty,shipped_qty,backordered_qty,received_qty,unit_cost,unit_discount,unit_core_cost,shipping_code_cd,order_handling_cd,po_item_status,posted_date,partial_ship_flag,backorder_edit_flag,last_modified_date,modified_by_employee_id) values(i_po_item_id,inserted.loc,i_po_header_id,v_line_abbrev,v_part_number,''T'',0,inserted.order_qty,0,0,0,d_cost,0,d_core_cost,''NRM'',''1'',''N'',inserted.last_modified_date,''N'',''N'',inserted.last_modified_date,inserted.modified_by_employee_id);update rads_item set po_header_id=i_po_header_id,last_status_change_date=inserted.last_modified_date,last_modified_date=inserted.last_modified_date,modified_by_employee_id=inserted.modified_by_employee_id where rads_item.loc=inserted.loc and rads_item.transaction_number=inserted.transaction_number and rads_item.transaction_sequence=inserted.transaction_sequence end if end', 'tr_ai_rads_item_supersede','RADS_ITEM_SUPERSEDE','A','I',1,'create trigger tr_ai_rads_item_supersede after insert on RADS_ITEM_SUPERSEDE referencing new as inserted for each row begin declare i_po_header_id integer;declare i_po_item_id integer;declare i_no_of_rads_item_supersede integer;declare v_line_abbrev varchar(3);declare v_part_number varchar(22);declare d_cost decimal(12,4);declare d_core_cost decimal(12,4);declare i_line_items_ordered integer;declare i_line_items_received integer;declare i_inventory_id integer;declare i_loc integer;declare ti_rads_request_status tinyint;declare ts_last_modified_date timestamp;declare i_modified_by_employee_id integer;declare d_total_order_value decimal(12,4);declare i_order_qty integer;set i_loc=inserted.loc;set i_no_of_rads_item_supersede=0;select po_header_id,inventory_id,rads_request_status,order_qty,last_modified_date,modified_by_employee_id into i_po_header_id,i_inventory_id,ti_rads_request_status,i_order_qty,ts_last_modified_date,i_modified_by_employee_id from rads_item where rads_item.loc=inserted.loc and rads_item.transaction_number=inserted.rads_item_transaction_number and rads_item.transaction_sequence=inserted.rads_item_transaction_sequence;select COUNT(id) into i_no_of_rads_item_supersede from rads_item_supersede where rads_item_supersede.loc=i_loc and rads_item_supersede.rads_item_transaction_number=inserted.rads_item_transaction_number and rads_item_supersede.rads_item_transaction_sequence=inserted.rads_item_transaction_sequence;if(i_no_of_rads_item_supersede=1) then select inventory.part_number,inventory.line_abbrev into v_part_number,v_line_abbrev from inventory where inventory.id=i_inventory_id and inventory.loc=i_loc;delete from po_item where po_item.po_header_id=i_po_header_id and po_item.loc=i_loc and po_item.part_number=v_part_number and po_item.line_abbrev=v_line_abbrev;update po_header set line_items_ordered=0,line_items_received=0,total_order_value=0,last_receipt_date=null,last_modified_date=ts_last_modified_date,modified_by_employee_id=i_modified_by_employee_id where po_header.id=i_po_header_id and po_header.loc=i_loc end if;select part_number,line_abbrev,cost,core_cost into v_part_number,v_line_abbrev,d_cost,d_core_cost from inventory where inventory.id=inserted.inventory_id and inventory.loc=inserted.loc;set i_po_item_id=sp_get_seq(''po_item'',i_loc);set d_total_order_value=(d_cost+d_core_cost)*i_order_qty;if i_po_header_id is not null then if ti_rads_request_status=5 then insert into po_item(id,loc,po_header_id,line_abbrev,part_number,ref_receipt_type_cd,damaged_qty,order_qty,shipped_qty,backordered_qty,received_qty,unit_cost,unit_discount,unit_core_cost,shipping_code_cd,order_handling_cd,po_item_status,posted_date,partial_ship_flag,backorder_edit_flag,last_modified_date,modified_by_employee_id) values(i_po_item_id,i_loc,i_po_header_id,v_line_abbrev,v_part_number,''T'',0,i_order_qty,0,0,inserted.sent_qty,d_cost,0,d_core_cost,''NRM'',''1'',''R'',current date,''N'',''N'',ts_last_modified_date,i_modified_by_employee_id);select line_items_ordered,line_items_received into i_line_items_ordered,i_line_items_received from po_header where po_header.id=i_po_header_id and po_header.loc=i_loc;update po_header set line_items_ordered=(i_line_items_ordered+1),line_items_received=(i_line_items_received+1),total_order_value=d_total_order_value,last_receipt_date=ts_last_modified_date,last_modified_date=ts_last_modified_date,modified_by_employee_id=i_modified_by_employee_id where po_header.id=i_po_header_id and po_header.loc=i_loc else insert into po_item(id,loc,po_header_id,line_abbrev,part_number,ref_receipt_type_cd,damaged_qty,order_qty,shipped_qty,backordered_qty,received_qty,unit_cost,unit_discount,unit_core_cost,shipping_code_cd,order_handling_cd,po_item_status,posted_date,partial_ship_flag,backorder_edit_flag,last_modified_date,modified_by_employee_id) values(i_po_item_id,i_loc,i_po_header_id,v_line_abbrev,v_part_number,''T'',0,i_order_qty,0,0,0,d_cost,0,d_core_cost,''NRM'',''1'',''N'',null,''N'',''N'',ts_last_modified_date,i_modified_by_employee_id);select line_items_ordered,line_items_received into i_line_items_ordered,i_line_items_received from po_header where po_header.id=i_po_header_id and po_header.loc=i_loc;update po_header set line_items_ordered=(i_line_items_ordered+1),total_order_value=d_total_order_value,last_modified_date=ts_last_modified_date,modified_by_employee_id=i_modified_by_employee_id where po_header.id=i_po_header_id and po_header.loc=i_loc end if end if end', 'tr_ai_saved_invoice_line_item','SAVED_INVOICE_LINE_ITEM','A','I',1,'create trigger tr_ai_saved_invoice_line_item after insert on SAVED_INVOICE_LINE_ITEM referencing new as inserted for each row begin declare v_work_in_progress_updated varchar(1);declare v_update_work_in_progress varchar(1);declare i_counterman_employee_id integer;declare ts_saved_date timestamp;declare i_inventory_id integer;declare v_msg_type varchar(30);declare v_url varchar(30);declare v_msg_action varchar(10);declare i_napa_customer_category_id integer;declare v_wms_transaction_identifier varchar(30);declare v_po_number varchar(30);declare i_customer_id integer;declare i_wms_transaction_status integer;set v_update_work_in_progress=''N'';set v_work_in_progress_updated=''N'';select work_in_progress_updated,counterman_employee_id,saved_date into v_work_in_progress_updated,i_counterman_employee_id,ts_saved_date from saved_invoice where id=inserted.saved_invoice_id and loc=inserted.loc;if v_work_in_progress_updated=''Y'' and inserted.quantity_billed >=0 and inserted.pickup_item=''N'' and inserted.policy_adjustment=''N'' and inserted.core_transaction=''N'' and inserted.defective=''N'' and(inserted.generated_by_sequence is null or(inserted.generated_by_sequence is not null and inserted.kit_component=''Y'')) and not(inserted.generated_by_sequence is null and inserted.kit_component=''Y'') and inserted.warranty_item=''N'' and inserted.warranty_labor_claim=''N'' and inserted.auto_generated_misc_chg=''N'' and inserted.ref_invoice_line_item_type_id in(0,1,5,12) then set v_update_work_in_progress=''Y'' end if;select id into i_inventory_id from inventory where line_abbrev=inserted.line_abbrev and part_number=inserted.part_number and loc=inserted.loc;if i_inventory_id is not null then if not exists(select*from inventory_stock where inventory_id=i_inventory_id and loc=inserted.loc) then if v_update_work_in_progress=''Y'' then insert into inventory_stock(inventory_id,loc,work_in_progress,last_modified_date,modified_by_employee_id) values(i_inventory_id,inserted.loc,inserted.quantity_billed,ts_saved_date,i_counterman_employee_id) else insert into inventory_stock(inventory_id,loc,last_modified_date,modified_by_employee_id) values(i_inventory_id,inserted.loc,ts_saved_date,i_counterman_employee_id) end if else if v_update_work_in_progress=''Y'' then update inventory_stock set work_in_progress=(work_in_progress+inserted.quantity_billed),last_modified_date=ts_saved_date,modified_by_employee_id=i_counterman_employee_id where loc=inserted.loc and inventory_id=i_inventory_id end if end if end if;if MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 then select wms_transaction_identifier,po_number,customer_id,wms_transaction_status into v_wms_transaction_identifier,v_po_number,i_customer_id,i_wms_transaction_status from saved_invoice where id=inserted.saved_invoice_id and loc=inserted.loc;if(v_wms_transaction_identifier is null or(not exists(select id from indago_outbound_message where message_record_id=v_wms_transaction_identifier and loc=inserted.loc and message_action=''Update'')) and(v_wms_transaction_identifier is not null and(select COUNT(id) from saved_invoice where wms_transaction_identifier=v_wms_transaction_identifier and loc=inserted.loc) > 1)) then select ref_napa_customer_category_id into i_napa_customer_category_id from customer where customer.id=i_customer_id and customer.loc=inserted.loc;if((i_napa_customer_category_id is not null and(i_napa_customer_category_id=17 or i_napa_customer_category_id=20)) or(v_po_number is not null and inserted.REF_INVOICE_LINE_ITEM_ORIGIN_ID=1) or(inserted.REF_INVOICE_LINE_ITEM_ORIGIN_ID=10)) then set v_msg_type=''TRANSFER'' else set v_msg_type=''ORDER'' end if;if v_wms_transaction_identifier is not null and(i_wms_transaction_status <> 2 or i_wms_transaction_status <> 3) then set v_msg_action=''Update'';update saved_invoice set wms_transaction_status=1 where id=inserted.saved_invoice_id else set v_msg_action=''New'';if v_msg_type=''TRANSFER'' then update saved_invoice set wms_transaction_identifier=''TO'' || inserted.saved_invoice_id where id=inserted.saved_invoice_id else update saved_invoice set wms_transaction_identifier=''SO'' || inserted.saved_invoice_id where id=inserted.saved_invoice_id end if end if;select wms_transaction_identifier into v_wms_transaction_identifier from saved_invoice where id=inserted.saved_invoice_id and loc=inserted.loc;select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,v_wms_transaction_identifier,v_msg_type,v_msg_action,v_url) end if;if v_wms_transaction_identifier is not null and(i_wms_transaction_status <> 2 or i_wms_transaction_status <> 3) and(v_msg_action is null or v_msg_action='''' or v_msg_action <> ''New'') and(v_wms_transaction_identifier is not null and(select COUNT(id) from saved_invoice where wms_transaction_identifier=v_wms_transaction_identifier and loc=inserted.loc) > 1) then update saved_invoice set wms_transaction_status=1 where id=inserted.saved_invoice_id end if end if end', 'tr_ai_tax_table_bracket','TAX_TABLE_BRACKET','A','I',1,'create trigger tr_ai_tax_table_bracket after insert on TAX_TABLE_BRACKET referencing new as inserted for each row begin declare i_max_tax_bracket decimal(4,2);select MAX(TAXABLE_SALE_AMOUNT) into i_max_tax_bracket from TAX_TABLE_BRACKET where TAX_TABLE_ID=inserted.TAX_TABLE_ID;update TAX_TABLE set MAXIMUM_TAX_BRACKET=ROUND(i_max_tax_bracket,0) where ID=inserted.TAX_TABLE_ID and LOC=inserted.LOC end', 'tr_ai_tmp_transin_receipts','TMP_TRANSIN_RECEIPTS','A','I',1,'create trigger tr_ai_tmp_transin_receipts after insert on TMP_TRANSIN_RECEIPTS referencing new as inserted for each row begin declare v_url varchar(50);declare v_msg_type varchar(45);declare v_msg_action varchar(10);declare i_loc integer;select loc into i_loc from store_profile;if MOD((select indago_in_use from store_profile where loc=i_loc),10)=1 then set v_msg_type=''ASN'';set v_msg_action=''New'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=i_loc);if not exists(select i.MESSAGE_RECORD_ID from indago_outbound_message as i where i.message_type=''ASN'' and ISNULL(STRING(i.MESSAGE_RECORD_ID),'''')=ISNULL(STRING(inserted.purchase_order_number),'''')) and(inserted.REF_RECEIPT_TYPE_CD not in(''L'',''N'')) and(inserted.SHIPMENT_NUMBER > 0) then insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(i_loc,inserted.purchase_order_number,v_msg_type,v_msg_action,v_url) end if end if end', 'tr_ai_user_profile','USER_PROFILE','A','I',1,'create trigger tr_ai_user_profile after insert on USER_PROFILE referencing new as inserted for each row begin if inserted.user_name in(''store_read'',''store_write'') then if inserted.pwd <> '''' then raiserror 18018 ''tr_ai_user_profile: User must be inserted with blank password. Use tams_dba.sp_set_user_pwd to change passwords.'' end if else raiserror 18018 ''tr_ai_user_profile: Insert only allowed for specific users.'' end if end', 'tr_aiu_customer_blanket_po','CUSTOMER_BLANKET_PO','A','B',1,'create trigger tr_aiu_customer_blanket_po after insert,update on CUSTOMER_BLANKET_PO referencing old as existed new as inserted for each row begin if((select send_customer_domain from store_profile)=''Y'') then if inserting then if(select count() from customer_change_queue where customer_id=inserted.CUSTOMER_ID and loc=inserted.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0 then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(inserted.customer_id,inserted.loc,''I'',''CUSTOMER_BLANKET_PO'',inserted.id) end if elseif updating then if(select count() from customer_change_queue where customer_id=existed.CUSTOMER_ID and loc=existed.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0 then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(existed.customer_id,existed.loc,''U'',''CUSTOMER_BLANKET_PO'',existed.id) end if end if end if end', 'tr_aiu_customer_certification','CUSTOMER_CERTIFICATION','A','B',1,'create trigger tr_aiu_customer_certification after insert,update on CUSTOMER_CERTIFICATION referencing old as existed new as inserted for each row begin if((select send_customer_domain from store_profile)=''Y'') then if inserting then if(select count() from customer_change_queue where customer_id=inserted.CUSTOMER_ID and loc=inserted.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0 then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(inserted.customer_id,inserted.loc,''I'',''CUSTOMER_CERTIFICATION'',inserted.id) end if elseif updating then if(select count() from customer_change_queue where customer_id=existed.CUSTOMER_ID and loc=existed.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0 then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(existed.customer_id,existed.loc,''U'',''CUSTOMER_CERTIFICATION'',existed.id) end if end if end if end', 'tr_aiu_customer_contact','CUSTOMER_CONTACT','A','B',1,'create trigger tr_aiu_customer_contact after insert,update on CUSTOMER_CONTACT referencing old as existed new as inserted for each row begin if((select send_customer_domain from store_profile)=''Y'') then if inserting then if(select count() from customer_change_queue where customer_id=inserted.CUSTOMER_ID and loc=inserted.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0 then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(inserted.customer_id,inserted.loc,''I'',''CUSTOMER_CONTACT'',inserted.id) end if elseif updating then if(select count() from customer_change_queue where customer_id=existed.CUSTOMER_ID and loc=existed.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0 then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(existed.customer_id,existed.loc,''U'',''CUSTOMER_CONTACT'',existed.id) end if end if end if end', 'tr_aiu_customer_delivery','CUSTOMER_DELIVERY','A','B',1,'create trigger tr_aiu_customer_delivery after insert,update on CUSTOMER_DELIVERY referencing old as existed new as inserted for each row begin if((select send_customer_domain from store_profile)=''Y'') then if inserting then if(select count() from customer_change_queue where customer_id=inserted.CUSTOMER_ID and loc=inserted.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0 then insert into customer_change_queue(customer_id,loc,action,trigger_source) values(inserted.customer_id,inserted.loc,''I'',''CUSTOMER_DELIVERY'') end if elseif updating then if(select count() from customer_change_queue where customer_id=existed.CUSTOMER_ID and loc=existed.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0 then insert into customer_change_queue(customer_id,loc,action,trigger_source) values(existed.customer_id,existed.loc,''U'',''CUSTOMER_DELIVERY'') end if end if end if end', 'tr_aiu_customer_statement_address','CUSTOMER_STATEMENT_ADDRESS','A','B',1,'create trigger tr_aiu_customer_statement_address after insert,update on CUSTOMER_STATEMENT_ADDRESS referencing old as existed new as inserted for each row begin if((select send_customer_domain from store_profile)=''Y'') then if inserting then if(select count() from customer_change_queue where customer_id=inserted.CUSTOMER_ID and loc=inserted.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0 then insert into customer_change_queue(customer_id,loc,action,trigger_source) values(inserted.customer_id,inserted.loc,''I'',''CUSTOMER_STATEMENT_ADDRESS'') end if elseif updating then if(select count() from customer_change_queue where customer_id=existed.CUSTOMER_ID and loc=existed.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0 then insert into customer_change_queue(customer_id,loc,action,trigger_source) values(existed.customer_id,existed.loc,''U'',''CUSTOMER_STATEMENT_ADDRESS'') end if end if end if end', 'tr_au_alert','ALERT','A','U',1,'create trigger tr_au_alert after update on ALERT referencing old as deleted new as inserted for each row begin if(inserted.message_number is not null and(inserted.text is not null or inserted.summary is not null)) then raiserror 18086 ''tr_au_alert: message_number and text'' || '' cannot both have values.'' end if end', 'tr_au_ar_profile','AR_PROFILE','A','U',1,'create trigger tr_au_ar_profile after update on AR_PROFILE referencing old as deleted new as inserted for each row begin if((select send_customer_domain from store_profile)=''Y'') then if ISNULL(deleted.MAIN_AR_STORE_NUMBER,'''') <> ISNULL(inserted.MAIN_AR_STORE_NUMBER,'''') then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(0,deleted.loc,''U'',''AR_PROFILE'',deleted.main_ar_store_number) end if end if end', 'tr_au_barcode','BARCODE','A','U',1,'create trigger tr_au_barcode after update on BARCODE referencing old as deleted new as inserted for each row begin declare i_inventory_id integer;declare v_url varchar(50);declare v_msg_type varchar(45);declare v_msg_action varchar(10);declare i_loc integer;select loc into i_loc from store_profile;if MOD((select indago_in_use from store_profile where loc=i_loc),10)=1 and(ISNULL(deleted.PKG_QTY,'''') <> ISNULL(inserted.PKG_QTY,'''') or ISNULL(deleted.BARCODE,'''') <> ISNULL(inserted.BARCODE,'''')) then select id into i_inventory_id from inventory where line_abbrev=inserted.line_abbrev and part_number=inserted.part_number and loc=i_loc;if i_inventory_id is not null then set v_msg_type=''PRODUCT_IN'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=i_loc);set v_msg_action=''Update'';insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(i_loc,i_inventory_id,v_msg_type,v_msg_action,v_url) end if end if end', 'tr_au_classification_return_item','CLASSIFICATION_RETURN_ITEM','A','U',1,'create trigger tr_au_classification_return_item after update on CLASSIFICATION_RETURN_ITEM referencing old as deleted new as inserted for each row begin declare v_work_in_progress_updated varchar(1);declare i_counterman_employee_id integer;declare v_update_work_in_progress varchar(1);declare d_work_in_progress decimal(8,2);declare v_url varchar(50);declare v_msg_type varchar(45);declare v_msg_action varchar(10);declare v_wms_transaction_identifier varchar(10);declare i_wms_transaction_status integer;if(MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 and(ISNULL(deleted.ENDING_RETURN_QUANTITY,'''') <> ISNULL(inserted.ENDING_RETURN_QUANTITY,'''')) and(select wms_transaction_status from classification_session where id=(select classification_session_id from classification_return where id=inserted.classification_return_id) and loc=inserted.loc) < 2) then select id,wms_transaction_status into v_wms_transaction_identifier,i_wms_transaction_status from classification_session where id=(select classification_session_id from classification_return where id=inserted.classification_return_id) and loc=inserted.loc;if(v_wms_transaction_identifier is not null and not exists(select id from indago_outbound_message where message_record_id=v_wms_transaction_identifier and loc=inserted.loc and message_action=''Update'') and(i_wms_transaction_status <> 2 or i_wms_transaction_status <> 3)) then set v_msg_type=''PO_IN_RETURN'';if(i_wms_transaction_status=0) then update classification_session set wms_transaction_status=1 where id=(select classification_session_id from classification_return where id=inserted.classification_return_id) end if;select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);set v_msg_action=''Update'';insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,v_wms_transaction_identifier,v_msg_type,v_msg_action,v_url) end if end if end', 'tr_au_classification_session','CLASSIFICATION_SESSION','A','U',1,'create trigger tr_au_classification_session after update on CLASSIFICATION_SESSION referencing old as deleted new as inserted for each row begin declare v_url varchar(50);declare v_msg_type varchar(30);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 then set v_msg_type=''PO_IN_RETURN'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);if inserted.session_finalized_date is not null and inserted.POSTED_RETURN_VALUE > 0 then set v_msg_action=''Delete'';insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,inserted.id,v_msg_type,v_msg_action,v_url) end if end if end', 'tr_au_customer','CUSTOMER','A','U',1,'create trigger tr_au_customer after update on CUSTOMER referencing old as deleted new as inserted for each row begin declare i_next_id integer;declare v_url varchar(50);if inserted.customer_num=41050 and inserted.ref_billing_type_cd <> ''C'' then update customer set ref_billing_type_cd=''C'' where id=inserted.id and loc=inserted.loc end if;if inserted.usual_ref_price_sheet_cd <> deleted.usual_ref_price_sheet_cd or inserted.usual_price_markup_percent <> deleted.usual_price_markup_percent or inserted.usual_price_ref_currency_rounding_cd <> deleted.usual_price_ref_currency_rounding_cd then if fn_pricing_tracker_in_use(inserted.loc)=''Y'' and inserted.ref_customer_type_cd=''A'' then if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=1 and pricing_tracker_number=inserted.customer_num and loc=inserted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=''U'',description=inserted.name where ref_pricing_tracker_type_id=1 and pricing_tracker_number=inserted.customer_num and loc=inserted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',inserted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,inserted.loc,1,''U'',inserted.customer_num,inserted.name) end if end if end if;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') or ISNULL(deleted.ADDRESS1,'''') <> ISNULL(inserted.ADDRESS1,'''') or ISNULL(deleted.ADDRESS2,'''') <> ISNULL(inserted.ADDRESS2,'''') or ISNULL(deleted.CITY,'''') <> ISNULL(inserted.CITY,'''') or ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') or ISNULL(deleted.PHONE,'''') <> ISNULL(inserted.PHONE,'''') or ISNULL(deleted.FAX_NUMBER,'''') <> ISNULL(inserted.FAX_NUMBER,'''') or ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then if(select MOD(indago_in_use,10) from store_profile where loc=inserted.loc)=1 then select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);if not exists(select MESSAGE_RECORD_ID from indago_outbound_message where message_type=''CUST_IN'' and ISNULL(STRING(MESSAGE_RECORD_ID),'''')=ISNULL(STRING(inserted.id),'''')) then insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,inserted.customer_num,''CUST_IN'',''Update'',v_url) end if end if end if end', 'tr_au_customer_ar','CUSTOMER_AR','A','U',1,'create trigger tr_au_customer_ar after update on CUSTOMER_AR referencing old as deleted new as inserted for each row begin if MOD((select gpc_owned from store_profile where loc=inserted.loc),10)=1 and MOD((select print_statements from ar_profile where loc=inserted.loc),10)=0 and inserted.ref_statement_type_id <> 2 then update customer_ar set ref_statement_type_id=2 where customer_id=inserted.customer_id and loc=inserted.loc end if end', 'tr_au_customer_custom_pricing','CUSTOMER_CUSTOM_PRICING','A','U',1,'create trigger tr_au_customer_custom_pricing after update on CUSTOMER_CUSTOM_PRICING referencing old as deleted new as inserted for each row begin declare i_next_id integer;declare i_customer_number integer;declare v_customer_name varchar(40);declare v_customer_type varchar(1);declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=1;set v_pricing_tracker_action=''U'';if fn_pricing_tracker_in_use(inserted.loc)=''Y'' then select customer_num,name,ref_customer_type_cd into i_customer_number,v_customer_name,v_customer_type from customer where id=inserted.customer_id and loc=inserted.loc;if v_customer_type=''A'' then if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=inserted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=v_customer_name where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=inserted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',inserted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,inserted.loc,i_pricing_tracker_type,v_pricing_tracker_action,i_customer_number,v_customer_name) end if end if end if end', 'tr_au_customer_pricing_profile','CUSTOMER_PRICING_PROFILE','A','U',1,'create trigger tr_au_customer_pricing_profile after update on CUSTOMER_PRICING_PROFILE referencing old as deleted new as inserted for each row begin declare i_next_id integer;declare i_customer_number integer;declare v_customer_name varchar(40);declare v_customer_type varchar(1);declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=1;set v_pricing_tracker_action=''U'';if fn_pricing_tracker_in_use(inserted.loc)=''Y'' then select customer_num,name,ref_customer_type_cd into i_customer_number,v_customer_name,v_customer_type from customer where id=inserted.customer_id and loc=inserted.loc;if v_customer_type=''A'' then if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=inserted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=v_customer_name where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=i_customer_number and loc=inserted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',inserted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,inserted.loc,i_pricing_tracker_type,v_pricing_tracker_action,i_customer_number,v_customer_name) end if end if end if end', 'tr_au_indago_profile','INDAGO_PROFILE','A','U',1,'create trigger tr_au_indago_profile after update on INDAGO_PROFILE referencing old as deleted new as inserted for each row begin if ISNULL(deleted.last_msg_id_created,'''') <> ISNULL(inserted.last_msg_id_created,'''') then if inserted.last_msg_id_created >=9999999999 then update indago_profile set last_msg_id_created=0 where loc=inserted.loc end if end if end', 'tr_au_inventory','INVENTORY','A','U',1,'create trigger tr_au_inventory after update on INVENTORY referencing old as deleted new as inserted for each row begin declare v_url varchar(50);declare v_msg_type varchar(45);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 and(ISNULL(deleted.description,'''') <> ISNULL(inserted.description,'''') or ISNULL(STRING(deleted.ref_unit_designator_cd),'''') <> ISNULL(STRING(inserted.ref_unit_designator_cd),'''') or ISNULL(STRING(deleted.cost),'''') <> ISNULL(STRING(inserted.cost),'''') or ISNULL(STRING(deleted.list),'''') <> ISNULL(STRING(inserted.list),'''')) then set v_msg_type=''PRODUCT_IN'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);set v_msg_action=''Update'';insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,inserted.id,v_msg_type,v_msg_action,v_url) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') or ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') or ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') or ISNULL(deleted.GROUP_CODE,'''') <> ISNULL(inserted.GROUP_CODE,'''') or ISNULL(deleted.STORE_GROUP_ID,'''') <> ISNULL(inserted.STORE_GROUP_ID,'''') or ISNULL(deleted.COST,'''') <> ISNULL(inserted.COST,'''') or ISNULL(deleted.CORE_COST,'''') <> ISNULL(inserted.CORE_COST,'''') or ISNULL(deleted.LIST,'''') <> ISNULL(inserted.LIST,'''') or ISNULL(deleted.SUPPLIER_ID,'''') <> ISNULL(inserted.SUPPLIER_ID,'''') or ISNULL(deleted.REF_UNIT_DESIGNATOR_CD,'''') <> ISNULL(inserted.REF_UNIT_DESIGNATOR_CD,'''') or ISNULL(deleted.PER_CAR_QTY,'''') <> ISNULL(inserted.PER_CAR_QTY,'''') or ISNULL(STRING(deleted.STANDARD_PKG),'''') <> ISNULL(STRING(inserted.STANDARD_PKG),'''') or ISNULL(STRING(deleted.FACTORY_STD_PKG),'''') <> ISNULL(STRING(inserted.FACTORY_STD_PKG),'''') then if((select MOD(use_inventory_feed,10) from inventory_profile)=1) and(TRIM(inserted.part_number) <> '''') then insert into inventory_change_queue(id,inventory_id,loc,line_abbrev,part_number,action,trigger_source) values(null,inserted.id,inserted.loc,inserted.line_abbrev,inserted.part_number,''U'',1) end if end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') or ISNULL(STRING(deleted.REF_UNIT_DESIGNATOR_CD),'''') <> ISNULL(STRING(inserted.REF_UNIT_DESIGNATOR_CD),'''') or ISNULL(STRING(deleted.STANDARD_PKG),'''') <> ISNULL(STRING(inserted.STANDARD_PKG),'''') then if exists(select*from INVENTORY_STOCK where inventory_id=inserted.id) and((select MOD(use_inventory_feed,10) from inventory_profile)=1) and(TRIM(inserted.part_number) <> '''') then insert into inventory_stock_change_queue(id,inventory_id,loc,line_abbrev,part_number,action,trigger_source) values(null,inserted.id,inserted.loc,inserted.line_abbrev,inserted.part_number,''U'',1) end if end if end', 'tr_au_inventory_stock','INVENTORY_STOCK','A','U',1,'create trigger tr_au_inventory_stock after update on INVENTORY_STOCK referencing old as deleted new as inserted for each row begin declare v_line_abbrev varchar(3);declare v_part_number varchar(22);if ISNULL(STRING(deleted.ON_HAND),'''') <> ISNULL(STRING(inserted.ON_HAND),'''') or ISNULL(STRING(deleted.WORK_IN_PROGRESS),'''') <> ISNULL(STRING(inserted.WORK_IN_PROGRESS),'''') or ISNULL(STRING(deleted.MINIMUM_STOCK_QTY),'''') <> ISNULL(STRING(inserted.MINIMUM_STOCK_QTY),'''') or ISNULL(STRING(deleted.MAXIMUM_STOCK_QTY),'''') <> ISNULL(STRING(inserted.MAXIMUM_STOCK_QTY),'''') or ISNULL(STRING(deleted.MINIMUM_SALE_QTY),'''') <> ISNULL(STRING(inserted.MINIMUM_SALE_QTY),'''') or ISNULL(STRING(deleted.ON_ORDER),'''') <> ISNULL(STRING(inserted.ON_ORDER),'''') or ISNULL(STRING(deleted.ON_BACKORDER),'''') <> ISNULL(STRING(inserted.ON_BACKORDER),'''') or ISNULL(STRING(deleted.ON_FACTORY_ORDER),'''') <> ISNULL(STRING(inserted.ON_FACTORY_ORDER),'''') or ISNULL(STRING(deleted.INITIAL_STOCKING_DATE),'''') <> ISNULL(STRING(inserted.INITIAL_STOCKING_DATE),'''') or ISNULL(STRING(deleted.LAST_SALE_DATE),'''') <> ISNULL(STRING(inserted.LAST_SALE_DATE),'''') or ISNULL(STRING(deleted.LAST_RECEIPT_DATE),'''') <> ISNULL(STRING(inserted.LAST_RECEIPT_DATE),'''') or ISNULL(STRING(deleted.REF_ORDER_SUSPENSE_CD),'''') <> ISNULL(STRING(inserted.REF_ORDER_SUSPENSE_CD),'''') or ISNULL(STRING(deleted.REF_MIN_MAX_STATUS_CD),'''') <> ISNULL(STRING(inserted.REF_MIN_MAX_STATUS_CD),'''') then if((select MOD(use_inventory_feed,10) from inventory_profile)=1 and not exists(select 1 from kit_participation where kit_inventory_id=inserted.inventory_id)) then select line_abbrev,part_number into v_line_abbrev,v_part_number from inventory where id=inserted.inventory_id;if(TRIM(v_part_number) <> '''') then insert into inventory_stock_change_queue(id,inventory_id,loc,line_abbrev,part_number,action,trigger_source) values(null,inserted.inventory_id,inserted.loc,v_line_abbrev,v_part_number,''U'',1) end if end if end if end', 'tr_au_inventory_stock_location','INVENTORY_STOCK_LOCATION','A','U',1,'create trigger tr_au_inventory_stock_location after update on INVENTORY_STOCK_LOCATION referencing old as deleted new as inserted for each row begin if ISNULL(deleted.STOCK_LOCATION,'''') <> ISNULL(inserted.STOCK_LOCATION,'''') or ISNULL(STRING(deleted.DISPLAY_QTY),'''') <> ISNULL(STRING(inserted.DISPLAY_QTY),'''') then if(select MOD(use_inventory_feed,10) from inventory_profile)=1 then insert into inventory_stock_location_change_queue(id,inventory_stock_location_id,loc,action,trigger_source) values(null,inserted.id,inserted.loc,''U'',1) end if end if end', 'tr_au_invoice','INVOICE','A','U',1,'create trigger tr_au_invoice after update on INVOICE referencing old as deleted new as inserted for each row begin if ISNULL(deleted.po_number,'''') <> ISNULL(inserted.po_number,'''') and inserted.ref_transaction_type_id=2 then call sp_invoice_ar_post(inserted.id,inserted.loc,inserted.invoice_number,inserted.ref_transaction_type_id,inserted.customer_id,inserted.invoice_date,inserted.accounting_day,inserted.sales_year_month,inserted.po_number,inserted.original_invoice_id,inserted.ref_credit_debit_rebill_cd,inserted.tax_amount_1,inserted.tax_amount_2,inserted.delivery_charge,inserted.invoice_total,inserted.roa_discount,null,null,null,null,1,inserted.last_modified_date,inserted.modified_by_employee_id,4,1,null,inserted.primary_tax_table_id,inserted.secondary_tax_table_id,null) end if;if deleted.voided <> inserted.voided and inserted.voided=''Y'' then call sp_invoice_sales_post(-1,inserted.loc,inserted.ref_transaction_type_id,inserted.counterman_employee_id,inserted.customer_id,inserted.primary_tax_table_id,inserted.secondary_tax_table_id,inserted.invoice_date,inserted.accounting_day,inserted.invoice_cost,inserted.invoice_total,inserted.invoice_rebate,inserted.invoice_net_sales,inserted.roa_discount,inserted.sales_year_month,inserted.taxable_sales_1,inserted.tax_amount_1,inserted.taxable_sales_2,inserted.tax_amount_2,inserted.excise_taxable_amount,inserted.misc_adjustments,inserted.delivery_charge,0,inserted.delivery_charge_taxable_1,inserted.delivery_charge_taxable_2,1,inserted.ref_napa_customer_category_id);call sp_invoice_detail_process(inserted.id,inserted.loc,-1,1,0);call sp_invoice_customer_post(inserted.loc,-1,inserted.invoice_date,inserted.customer_id,inserted.ref_transaction_type_id,inserted.invoice_total,inserted.last_modified_date,inserted.modified_by_employee_id,0,inserted.invoice_number,inserted.roa_discount);if inserted.ref_transaction_type_id <> 1 then call sp_invoice_ar_post(inserted.id,inserted.loc,inserted.invoice_number,inserted.ref_transaction_type_id,inserted.customer_id,inserted.invoice_date,inserted.accounting_day,inserted.sales_year_month,inserted.po_number,inserted.original_invoice_id,inserted.ref_credit_debit_rebill_cd,inserted.tax_amount_1,inserted.tax_amount_2,inserted.delivery_charge,inserted.invoice_total,inserted.roa_discount,null,null,null,null,-1,inserted.last_modified_date,inserted.modified_by_employee_id,0,1,null,inserted.primary_tax_table_id,inserted.secondary_tax_table_id,null) end if end if;if deleted.ref_transaction_type_id <> inserted.ref_transaction_type_id then call sp_invoice_sales_post(1,inserted.loc,deleted.ref_transaction_type_id,inserted.counterman_employee_id,inserted.customer_id,inserted.primary_tax_table_id,inserted.secondary_tax_table_id,inserted.invoice_date,inserted.accounting_day,inserted.invoice_cost*-1,inserted.invoice_total*-1,inserted.invoice_rebate*-1,inserted.invoice_net_sales*-1,inserted.roa_discount*-1,inserted.sales_year_month,inserted.taxable_sales_1*-1,inserted.tax_amount_1*-1,inserted.taxable_sales_2*-1,inserted.tax_amount_2*-1,inserted.excise_taxable_amount*-1,inserted.misc_adjustments*-1,inserted.delivery_charge*-1,2,inserted.delivery_charge_taxable_1,inserted.delivery_charge_taxable_2,1,inserted.ref_napa_customer_category_id);call sp_invoice_sales_post(1,inserted.loc,inserted.ref_transaction_type_id,inserted.counterman_employee_id,inserted.customer_id,inserted.primary_tax_table_id,inserted.secondary_tax_table_id,inserted.invoice_date,inserted.accounting_day,inserted.invoice_cost,inserted.invoice_total,inserted.invoice_rebate,inserted.invoice_net_sales,inserted.roa_discount,inserted.sales_year_month,inserted.taxable_sales_1,inserted.tax_amount_1,inserted.taxable_sales_2,inserted.tax_amount_2,inserted.excise_taxable_amount,inserted.misc_adjustments,inserted.delivery_charge,2,inserted.delivery_charge_taxable_1,inserted.delivery_charge_taxable_2,1,inserted.ref_napa_customer_category_id);call sp_invoice_detail_process(inserted.id,inserted.loc,1,0,2);call sp_invoice_customer_post(inserted.loc,1,inserted.invoice_date,inserted.customer_id,deleted.ref_transaction_type_id,inserted.invoice_total*-1,inserted.last_modified_date,inserted.modified_by_employee_id,2,inserted.invoice_number,inserted.roa_discount);call sp_invoice_customer_post(inserted.loc,1,inserted.invoice_date,inserted.customer_id,inserted.ref_transaction_type_id,inserted.invoice_total,inserted.last_modified_date,inserted.modified_by_employee_id,2,inserted.invoice_number,inserted.roa_discount) end if;if deleted.invoice_rebate <> inserted.invoice_rebate then call sp_invoice_sales_post(1,inserted.loc,inserted.ref_transaction_type_id,inserted.counterman_employee_id,inserted.customer_id,inserted.primary_tax_table_id,inserted.secondary_tax_table_id,inserted.invoice_date,inserted.accounting_day,0,0,inserted.invoice_rebate-deleted.invoice_rebate,0,0,inserted.sales_year_month,0,0,0,0,0,0,0,3,inserted.delivery_charge_taxable_1,inserted.delivery_charge_taxable_2,1,inserted.ref_napa_customer_category_id) end if;if deleted.invoice_cost <> inserted.invoice_cost or deleted.invoice_total <> inserted.invoice_total then call sp_invoice_sales_post(1,inserted.loc,inserted.ref_transaction_type_id,inserted.counterman_employee_id,inserted.customer_id,inserted.primary_tax_table_id,inserted.secondary_tax_table_id,inserted.invoice_date,inserted.accounting_day,inserted.invoice_cost-deleted.invoice_cost,inserted.invoice_total-deleted.invoice_total,0,0,0,inserted.sales_year_month,0,0,0,0,0,0,0,1,inserted.delivery_charge_taxable_1,inserted.delivery_charge_taxable_2,1,inserted.ref_napa_customer_category_id) end if;if deleted.voided <> inserted.voided and inserted.voided=''Y'' then for invoice_line_items as curInvoice_lines_item dynamic scroll cursor for select invoice_line_item.invoice_id as i_invoice_id,invoice_line_item.loc as i_loc,invoice_line_item.sequence as i_sequence from invoice_line_item where invoice_line_item.invoice_id=deleted.id and invoice_line_item.picked_by_rads=''Y'' for read only do call sp_insert_rads_discrepancy_log(i_loc,i_invoice_id,i_sequence,null,null,4,null,null,inserted.modified_by_employee_id) end for end if;if(select MOD(use_invoice_feed,10) from invoicing_profile)=1 and exists(select 1 from store_profile where curr_acct_day=inserted.accounting_day and current_sales_year_month=inserted.sales_year_month) then insert into invoice_change_queue(invoice_id,loc,action,trigger_source) values(inserted.id,inserted.loc,''U'',1) end if end', 'tr_au_invoice_delivery','INVOICE_DELIVERY','A','U',1,'create trigger tr_au_invoice_delivery after update on INVOICE_DELIVERY referencing old as deleted new as inserted for each row begin if(select MOD(use_invoice_feed,10) from invoicing_profile)=1 then insert into invoice_change_queue(id,invoice_id,loc,action,trigger_source) values(null,inserted.invoice_id,inserted.loc,''U'',1) end if end', 'tr_au_invoice_line_item','INVOICE_LINE_ITEM','A','U',1,'create trigger tr_au_invoice_line_item after update on INVOICE_LINE_ITEM referencing old as deleted new as inserted for each row begin declare i_invoice_number integer;declare i_customer_id integer;declare ts_invoice_date timestamp;declare ti_accounting_day tinyint;declare dt_sales_year_month date;declare ti_ref_txn_type_id tinyint;declare i_salesperson_id integer;declare i_cashier_id integer;declare c_delivery_flag char(1);declare si_primary_tax_id smallint;declare si_secondary_tax_id smallint;declare ti_ref_napa_customer_category_id tinyint;declare i_inventory_id integer;declare c_ref_class_cd char(2);declare i_store_daily_sales_id integer;select invoice_number,customer_id,invoice_date,accounting_day,sales_year_month,ref_transaction_type_id,salesman_employee_id,cashier_employee_id,delivery_flag,primary_tax_table_id,secondary_tax_table_id,ref_napa_customer_category_id into i_invoice_number,i_customer_id,ts_invoice_date,ti_accounting_day,dt_sales_year_month,ti_ref_txn_type_id,i_salesperson_id,i_cashier_id,c_delivery_flag,si_primary_tax_id,si_secondary_tax_id,ti_ref_napa_customer_category_id from invoice where id=inserted.invoice_id and loc=inserted.loc;select id,current_year_ref_class_cd into i_inventory_id,c_ref_class_cd from inventory where line_abbrev=inserted.line_abbrev and part_number=inserted.part_number and loc=inserted.loc;select id into i_store_daily_sales_id from store_daily_sales where loc=inserted.loc and sales_year_month=dt_sales_year_month and accounting_day=ti_accounting_day;if deleted.rebate_item <> inserted.rebate_item then call sp_invoice_line_sales_post(1,ti_ref_txn_type_id,ti_accounting_day,c_delivery_flag,i_inventory_id,c_ref_class_cd,i_customer_id,i_cashier_id,i_salesperson_id,si_primary_tax_id,si_secondary_tax_id,dt_sales_year_month,0,0,0,i_store_daily_sales_id,deleted.loc,deleted.ref_invoice_line_item_type_id,deleted.department_id,deleted.sub_department_id,deleted.store_group_id,deleted.counterman_employee_id,deleted.ref_invoice_line_item_origin_id,deleted.does_not_affect_sales_history,deleted.non_stocking,deleted.defective,deleted.warranty_labor_claim,deleted.taxable_1,deleted.taxable_2,deleted.case_price,deleted.pickup_item,deleted.core_transaction,deleted.rebate_item,deleted.line_abbrev,deleted.group_code,deleted.quantity_billed,deleted.unit_price*-1,deleted.unit_cost*-1,deleted.misc_adjustments*-1,deleted.unit_rebate*-1,deleted.last_modified_date,deleted.modified_by_employee_id,3,1,ti_ref_napa_customer_category_id);call sp_invoice_line_sales_post(1,ti_ref_txn_type_id,ti_accounting_day,c_delivery_flag,i_inventory_id,c_ref_class_cd,i_customer_id,i_cashier_id,i_salesperson_id,si_primary_tax_id,si_secondary_tax_id,dt_sales_year_month,0,0,0,i_store_daily_sales_id,deleted.loc,deleted.ref_invoice_line_item_type_id,deleted.department_id,deleted.sub_department_id,deleted.store_group_id,deleted.counterman_employee_id,deleted.ref_invoice_line_item_origin_id,deleted.does_not_affect_sales_history,deleted.non_stocking,deleted.defective,deleted.warranty_labor_claim,deleted.taxable_1,deleted.taxable_2,deleted.case_price,deleted.pickup_item,deleted.core_transaction,inserted.rebate_item,deleted.line_abbrev,deleted.group_code,deleted.quantity_billed,deleted.unit_price,deleted.unit_cost,deleted.misc_adjustments,deleted.unit_rebate,deleted.last_modified_date,deleted.modified_by_employee_id,3,1,ti_ref_napa_customer_category_id) end if;if deleted.unit_cost <> inserted.unit_cost or deleted.unit_rebate <> inserted.unit_rebate then call sp_invoice_line_sales_post(1,ti_ref_txn_type_id,ti_accounting_day,c_delivery_flag,i_inventory_id,c_ref_class_cd,i_customer_id,i_cashier_id,i_salesperson_id,si_primary_tax_id,si_secondary_tax_id,dt_sales_year_month,0,0,0,i_store_daily_sales_id,inserted.loc,inserted.ref_invoice_line_item_type_id,inserted.department_id,inserted.sub_department_id,inserted.store_group_id,inserted.counterman_employee_id,inserted.ref_invoice_line_item_origin_id,inserted.does_not_affect_sales_history,inserted.non_stocking,inserted.defective,inserted.warranty_labor_claim,inserted.taxable_1,inserted.taxable_2,inserted.case_price,inserted.pickup_item,inserted.core_transaction,inserted.rebate_item,inserted.line_abbrev,inserted.group_code,inserted.quantity_billed,inserted.unit_price-deleted.unit_price,inserted.unit_cost-deleted.unit_cost,inserted.misc_adjustments-deleted.misc_adjustments,inserted.unit_rebate-deleted.unit_rebate,inserted.last_modified_date,inserted.modified_by_employee_id,1,1,ti_ref_napa_customer_category_id) end if;if inserted.buyout_po_number is not null and inserted.unit_cost <> deleted.unit_cost then call sp_invoice_buyout_post(inserted.invoice_id,inserted.loc,i_invoice_number,i_customer_id,ts_invoice_date,1,inserted.sequence,inserted.line_abbrev,inserted.part_number,inserted.core_transaction,inserted.unit_price,inserted.unit_cost,inserted.buyout_po_number,inserted.last_modified_date,inserted.modified_by_employee_id,1) end if end', 'tr_au_invoice_payment','INVOICE_PAYMENT','A','U',1,'create trigger tr_au_invoice_payment after update on INVOICE_PAYMENT referencing old as deleted new as inserted for each row begin if(select MOD(use_invoice_feed,10) from invoicing_profile)=1 then insert into invoice_change_queue(id,invoice_id,loc,action,trigger_source) values(null,inserted.invoice_id,inserted.loc,''U'',1) end if end', 'tr_au_invoicing_profile','INVOICING_PROFILE','A','U',1,'create trigger tr_au_invoicing_profile after update on INVOICING_PROFILE referencing old as deleted new as inserted for each row begin if ISNULL(STRING(deleted.ask_for_item_return_info),'''') <> ISNULL(STRING(inserted.ask_for_item_return_info),'''') and MOD(inserted.ask_for_item_return_info,10)=0 then if exists(select use_core_bank_maintenance from invoicing_profile where loc=inserted.loc and MOD(use_core_bank_maintenance,10)=1) then raiserror 18016 ''18016: tr_au_invoicing_profile: ASK_FOR_ITEM_RETURN_INFO can not be set to 0 or 10 when USE_CORE_BANK_MAINTENANCE is set to 1 or 11.'' end if end if;if ISNULL(STRING(deleted.use_core_bank_maintenance),'''') <> ISNULL(STRING(inserted.use_core_bank_maintenance),'''') and MOD(inserted.use_core_bank_maintenance,10)=1 then if exists(select ask_for_item_return_info from invoicing_profile where loc=inserted.loc and MOD(ask_for_item_return_info,10)=0) then raiserror 18017 ''18017: tr_au_invoicing_profile: USE_CORE_BANK_MAINTENANCE can not be set to 1 or 11 when ASK_FOR_ITEM_RETURN_INFO is set to 0 or 10.'' end if end if;if ISNULL(STRING(deleted.use_integrated_payments),'''') <> ISNULL(STRING(inserted.use_integrated_payments),'''') and MOD(inserted.use_integrated_payments,10)=1 then update invoicing_profile set ask_for_credit_card_info=11,print_credit_card_info_on_invoice=11,allow_multiple_tender_types=11 where loc=inserted.loc end if;if ISNULL(STRING(deleted.use_integrated_payments),'''') <> ISNULL(STRING(inserted.use_integrated_payments),'''') and MOD(inserted.use_integrated_payments,10)=0 then update invoicing_profile set ask_for_credit_card_info=1,print_credit_card_info_on_invoice=1,allow_multiple_tender_types=1 where loc=inserted.loc end if;if ISNULL(STRING(deleted.use_rads),'''') <> ISNULL(STRING(inserted.use_rads),'''') and MOD(inserted.use_rads,10)=1 then if inserted.keep_saved_invoices_days=0 then update invoicing_profile set keep_saved_invoices_days=1 where loc=inserted.loc end if end if;if ISNULL(STRING(deleted.require_tax_identifier_for_tax_refund_on_core),'''') <> ISNULL(STRING(inserted.require_tax_identifier_for_tax_refund_on_core),'''') and MOD(inserted.require_tax_identifier_for_tax_refund_on_core,10)=0 then update tax_table set require_tax_identifier_for_tax_refund_on_core=''N'' where loc=inserted.loc end if end', 'tr_au_po_header','PO_HEADER','A','U',1,'create trigger tr_au_po_header after update on PO_HEADER referencing old as deleted new as inserted for each row begin declare v_url varchar(50);declare v_msg_type varchar(30);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 then set v_msg_type=''PO_IN'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);if inserted.posting_complete_date is not null then set v_msg_action=''Delete'';insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,inserted.purchase_order_number,v_msg_type,v_msg_action,v_url) end if end if end', 'tr_au_pricing_profile','PRICING_PROFILE','A','U',1,'create trigger tr_au_pricing_profile after update on PRICING_PROFILE referencing old as deleted new as inserted for each row begin declare i_next_id integer;declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=2;set v_pricing_tracker_action=''U'';if fn_pricing_tracker_in_use(inserted.loc)=''Y'' then if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=inserted.id and loc=inserted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=inserted.description where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=inserted.id and loc=inserted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',inserted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,inserted.loc,i_pricing_tracker_type,v_pricing_tracker_action,inserted.id,inserted.description) end if end if end', 'tr_au_pricing_profile_detail','PRICING_PROFILE_DETAIL','A','U',1,'create trigger tr_au_pricing_profile_detail after update on PRICING_PROFILE_DETAIL referencing old as deleted new as inserted for each row begin declare i_next_id integer;declare v_pricing_profile_description varchar(50);declare i_pricing_tracker_type integer;declare v_pricing_tracker_action varchar(1);set i_pricing_tracker_type=2;set v_pricing_tracker_action=''U'';if fn_pricing_tracker_in_use(inserted.loc)=''Y'' then select description into v_pricing_profile_description from pricing_profile where id=inserted.pricing_profile_id and loc=inserted.loc;if exists(select*from pricing_tracker where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=inserted.pricing_profile_id and loc=inserted.loc) then update pricing_tracker set ref_pricing_tracker_action_cd=v_pricing_tracker_action,description=v_pricing_profile_description where ref_pricing_tracker_type_id=i_pricing_tracker_type and pricing_tracker_number=inserted.pricing_profile_id and loc=inserted.loc else i_next_id=call sp_get_seq(''PRICING_TRACKER'',inserted.loc);insert into pricing_tracker(id,loc,ref_pricing_tracker_type_id,ref_pricing_tracker_action_cd,pricing_tracker_number,description) values(i_next_id,inserted.loc,i_pricing_tracker_type,v_pricing_tracker_action,inserted.pricing_profile_id,v_pricing_profile_description) end if end if end', 'tr_au_product_line','PRODUCT_LINE','A','U',1,'create trigger tr_au_product_line after update on PRODUCT_LINE referencing old as deleted new as inserted for each row begin if ISNULL(deleted.PRIMARY_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.PRIMARY_STOCKING_REF_CLASS_CD,'''') or ISNULL(deleted.TRACTOR_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.TRACTOR_STOCKING_REF_CLASS_CD,'''') or ISNULL(deleted.HIGH_PERFORMANCE_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.HIGH_PERFORMANCE_STOCKING_REF_CLASS_CD,'''') or ISNULL(deleted.OPTIONAL_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.OPTIONAL_STOCKING_REF_CLASS_CD,'''') or ISNULL(deleted.MACHINE_SHOP_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.MACHINE_SHOP_STOCKING_REF_CLASS_CD,'''') or ISNULL(deleted.RETURN_IN_STD_PKG,'''') <> ISNULL(inserted.RETURN_IN_STD_PKG,'''') or ISNULL(deleted.ADDITIONAL_STOCKING_MONTHS,'''') <> ISNULL(inserted.ADDITIONAL_STOCKING_MONTHS,'''') then if exists(select line_abbrev from product_line_edit_audit where line_abbrev=inserted.line_abbrev and group_code=inserted.group_code and loc=inserted.loc) then update product_line_edit_audit set edit_type=''C'',primary_stocking_ref_class_cd=inserted.primary_stocking_ref_class_cd,tractor_stocking_ref_class_cd=inserted.tractor_stocking_ref_class_cd,high_performance_stocking_ref_class_cd=inserted.high_performance_stocking_ref_class_cd,optional_stocking_ref_class_cd=inserted.optional_stocking_ref_class_cd,machine_shop_stocking_ref_class_cd=inserted.machine_shop_stocking_ref_class_cd,return_in_std_pkg=inserted.return_in_std_pkg,additional_stocking_months=inserted.additional_stocking_months,last_modified_date=current timestamp where line_abbrev=inserted.line_abbrev and group_code=inserted.group_code and loc=inserted.loc else insert into product_line_edit_audit(loc,line_abbrev,group_code,edit_type,primary_stocking_ref_class_cd,tractor_stocking_ref_class_cd,high_performance_stocking_ref_class_cd,optional_stocking_ref_class_cd,machine_shop_stocking_ref_class_cd,return_in_std_pkg,additional_stocking_months) values(inserted.loc,inserted.line_abbrev,inserted.group_code,''C'',inserted.primary_stocking_ref_class_cd,inserted.tractor_stocking_ref_class_cd,inserted.high_performance_stocking_ref_class_cd,inserted.optional_stocking_ref_class_cd,inserted.machine_shop_stocking_ref_class_cd,inserted.return_in_std_pkg,inserted.additional_stocking_months) end if end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') or ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') or ISNULL(deleted.HQ_LINE_ABBREV,'''') <> ISNULL(inserted.HQ_LINE_ABBREV,'''') or ISNULL(STRING(deleted.STOCKING_DEPTH_DAYS),'''') <> ISNULL(STRING(inserted.STOCKING_DEPTH_DAYS),'''') or ISNULL(STRING(deleted.REORDER_PERIOD_DAYS),'''') <> ISNULL(STRING(inserted.REORDER_PERIOD_DAYS),'''') then if(select MOD(use_inventory_feed,10) from inventory_profile)=1 then insert into product_line_change_queue(id,product_line_id,loc,action,trigger_source) values(null,inserted.id,inserted.loc,''U'',1) end if end if end', 'tr_au_purge_type_profile','PURGE_TYPE_PROFILE','A','U',1,'create trigger tr_au_purge_type_profile after update on PURGE_TYPE_PROFILE referencing old as deleted new as inserted for each row begin if ISNULL(STRING(deleted.purge_data),'''') <> ISNULL(STRING(inserted.purge_data),'''') and MOD(inserted.purge_data,10)=0 then update purge_type_profile set keep_data_duration=0 where ref_purge_type_id=1 end if end', 'tr_au_rads_item','RADS_ITEM','A','U',1,'create trigger tr_au_rads_item after update on RADS_ITEM referencing old as deleted new as inserted for each row begin declare ti_old_ref_rads_response_id tinyint;declare ti_new_ref_rads_response_id tinyint;declare ti_old_rads_request_status tinyint;declare ti_new_rads_request_status tinyint;declare i_po_header_id integer;declare i_loc integer;declare i_inventory_id integer;declare i_po_item_id integer;declare i_saved_invoice_id integer;declare i_transaction_number integer;declare si_transaction_sequence smallint;declare si_saved_invoice_line_item_sequence smallint;declare i_sent_qty integer;declare i_order_qty integer;declare ts_last_modified_date timestamp;declare i_modified_by_employee_id integer;declare v_line_abbrev varchar(3);declare v_part_number varchar(22);declare d_cost decimal(12,4);declare d_unit_cost decimal(12,4);declare d_core_cost decimal(12,4);declare v_po_update varchar(1);declare v_saved_invoice_line_item_picked_by_rads_update varchar(1);declare v_saved_invoice_line_item_quantity_billed_update varchar(1);declare v_inventory_stock_on_hand_update varchar(1);declare v_inventory_stock_work_in_progress_update varchar(1);declare v_rads_item_last_status_change_date_update varchar(1);declare v_rads_item_received_date_update varchar(1);declare d_quantity_billed decimal(7,2);declare i_supersede_total_received_qty integer;declare i_wip_qty integer;declare v_superseded_part varchar(1);declare ti_ref_rads_discrepancy_type_id tinyint;declare v_rads_discrepancy_log_sent_qty_update varchar;set ti_old_ref_rads_response_id=deleted.ref_rads_response_id;set ti_new_ref_rads_response_id=inserted.ref_rads_response_id;set ti_old_rads_request_status=deleted.rads_request_status;set ti_new_rads_request_status=inserted.rads_request_status;set i_loc=deleted.loc;set i_inventory_id=deleted.inventory_id;set i_order_qty=deleted.order_qty;set ts_last_modified_date=inserted.last_modified_date;set i_modified_by_employee_id=inserted.modified_by_employee_id;set i_transaction_number=inserted.transaction_number;set si_transaction_sequence=inserted.transaction_sequence;set i_saved_invoice_id=inserted.saved_invoice_id;set si_saved_invoice_line_item_sequence=inserted.saved_invoice_line_item_sequence;set i_sent_qty=0;set i_supersede_total_received_qty=0;if inserted.sent_qty is not null then set i_sent_qty=inserted.sent_qty else if deleted.sent_qty is not null then set i_sent_qty=deleted.sent_qty end if end if;select inventory.line_abbrev,inventory.part_number,inventory.cost,inventory.core_cost into v_line_abbrev,v_part_number,d_cost,d_core_cost from inventory where inventory.id=i_inventory_id and inventory.loc=i_loc;set i_po_header_id=deleted.po_header_id;if ti_old_rads_request_status <> 5 and ti_new_rads_request_status=5 then set v_inventory_stock_on_hand_update=''Y'';if(select rads_item.po_header_id from rads_item where rads_item.transaction_number=i_transaction_number and rads_item.transaction_sequence=si_transaction_sequence and rads_item.loc=i_loc) is not null then if i_order_qty is null then set i_order_qty=0 end if;set v_rads_item_received_date_update=''Y'';set v_po_update=''Y'';if ti_old_ref_rads_response_id <> 5 and ti_new_ref_rads_response_id=5 then if i_saved_invoice_id is not null and si_saved_invoice_line_item_sequence is not null then set v_saved_invoice_line_item_picked_by_rads_update=''Y'';select quantity_billed into d_quantity_billed from saved_invoice_line_item where loc=i_loc and saved_invoice_id=i_saved_invoice_id and sequence=si_saved_invoice_line_item_sequence;if i_sent_qty <> d_quantity_billed and not exists(select si.id from saved_invoice as si join sales_order as so on so.id=si.sales_order_id and so.loc=si.loc where si.id=i_saved_invoice_id and si.loc=i_loc and so.id is not null and so.nol_order_number is not null and so.ref_order_sub_type_id is not null and so.ref_order_sub_type_id=1) then set v_saved_invoice_line_item_quantity_billed_update=''Y'' end if end if end if end if else if(ti_old_ref_rads_response_id <> ti_new_ref_rads_response_id) and(ti_new_ref_rads_response_id=10 and ti_old_rads_request_status <> 12 and ti_old_rads_request_status <> 13 and ti_old_rads_request_status <> 15 and ti_old_rads_request_status <> 16 and ti_old_rads_request_status <> 17 and ti_old_rads_request_status <> 18 and ti_old_rads_request_status <> 19) then call sp_insert_rads_discrepancy_log(i_loc,null,null,null,null,6,i_transaction_number,si_transaction_sequence,null) else if ti_old_ref_rads_response_id <> 51 and ti_new_ref_rads_response_id=51 then call sp_insert_rads_discrepancy_log(i_loc,null,null,null,null,11,i_transaction_number,si_transaction_sequence,null) end if end if end if;if((ti_old_ref_rads_response_id <> ti_new_ref_rads_response_id) and(ti_new_ref_rads_response_id=7 or ti_new_ref_rads_response_id=8)) then set v_saved_invoice_line_item_quantity_billed_update=''Y'';set i_sent_qty=0 end if;if((ti_old_rads_request_status <> ti_new_rads_request_status) and(ti_new_rads_request_status=7 or ti_new_rads_request_status=8 or ti_new_rads_request_status=12 or ti_new_rads_request_status=13 or ti_new_rads_request_status=15 or ti_new_rads_request_status=16 or ti_new_rads_request_status=17 or ti_new_rads_request_status=18 or ti_new_rads_request_status=19)) then delete from po_check_in where po_check_in.po_header_id=i_po_header_id and po_check_in.loc=i_loc;delete from po_note where po_note.po_header_id=i_po_header_id and po_note.loc=i_loc;delete from po_item where po_item.po_header_id=i_po_header_id and po_item.loc=i_loc;update RADS_ITEM set po_header_id=null,last_modified_date=ts_last_modified_date,modified_by_employee_id=i_modified_by_employee_id where transaction_number=i_transaction_number and transaction_sequence=si_transaction_sequence and loc=i_loc;delete from po_header where po_header.id=i_po_header_id and po_header.loc=i_loc end if;if(ti_old_ref_rads_response_id <> ti_new_ref_rads_response_id) or(ti_old_rads_request_status <> ti_new_rads_request_status) then set v_rads_item_last_status_change_date_update=''Y'' end if;if v_rads_item_received_date_update=''Y'' then update rads_item set received_date=ts_last_modified_date,last_status_change_date=ts_last_modified_date where rads_item.transaction_number=i_transaction_number and rads_item.transaction_sequence=si_transaction_sequence and rads_item.loc=i_loc else if v_rads_item_last_status_change_date_update=''Y'' then update rads_item set last_status_change_date=ts_last_modified_date,last_modified_date=ts_last_modified_date,modified_by_employee_id=i_modified_by_employee_id where rads_item.transaction_number=i_transaction_number and rads_item.transaction_sequence=si_transaction_sequence and rads_item.loc=i_loc end if end if;if v_saved_invoice_line_item_picked_by_rads_update=''Y'' and v_saved_invoice_line_item_quantity_billed_update=''Y'' then update saved_invoice_line_item set saved_invoice_line_item.picked_by_rads=''Y'',saved_invoice_line_item.quantity_billed=i_sent_qty where saved_invoice_line_item.saved_invoice_id=i_saved_invoice_id and saved_invoice_line_item.sequence=si_saved_invoice_line_item_sequence and saved_invoice_line_item.loc=i_loc;update saved_invoice_line_item set saved_invoice_line_item.quantity_billed=i_sent_qty where saved_invoice_line_item.saved_invoice_id=i_saved_invoice_id and saved_invoice_line_item.generated_by_sequence=si_saved_invoice_line_item_sequence and saved_invoice_line_item.loc=i_loc else if v_saved_invoice_line_item_picked_by_rads_update=''Y'' then update saved_invoice_line_item set saved_invoice_line_item.picked_by_rads=''Y'' where saved_invoice_line_item.saved_invoice_id=i_saved_invoice_id and saved_invoice_line_item.sequence=si_saved_invoice_line_item_sequence and saved_invoice_line_item.loc=i_loc else if v_saved_invoice_line_item_quantity_billed_update=''Y'' then update saved_invoice_line_item set saved_invoice_line_item.quantity_billed=i_sent_qty where saved_invoice_line_item.saved_invoice_id=i_saved_invoice_id and saved_invoice_line_item.sequence=si_saved_invoice_line_item_sequence and saved_invoice_line_item.loc=i_loc;update saved_invoice_line_item set saved_invoice_line_item.quantity_billed=i_sent_qty where saved_invoice_line_item.saved_invoice_id=i_saved_invoice_id and saved_invoice_line_item.generated_by_sequence=si_saved_invoice_line_item_sequence and saved_invoice_line_item.loc=i_loc end if end if end if;if v_po_update=''Y'' then update po_header set line_items_received=1,total_received_qty=i_sent_qty,last_receipt_date=ts_last_modified_date,last_modified_date=ts_last_modified_date,modified_by_employee_id=i_modified_by_employee_id where id=i_po_header_id and loc=i_loc;update po_item set po_item_status=''R'',received_qty=i_sent_qty,last_modified_date=ts_last_modified_date,modified_by_employee_id=i_modified_by_employee_id where po_item.po_header_id=i_po_header_id and po_item.loc=i_loc and po_item.part_number=v_part_number and po_item.line_abbrev=v_line_abbrev;set v_superseded_part=''N'';for rads_item_supersedes as curRads_supersede dynamic scroll cursor for select rads_item_supersede.sent_qty as i_supersede_sent_qty,inventory.part_number as v_supersede_part_number,inventory.line_abbrev as v_supersede_line_abbrev from rads_item_supersede join inventory on rads_item_supersede.inventory_id=inventory.id and rads_item_supersede.loc=inventory.loc where rads_item_supersede.loc=i_loc and rads_item_supersede.rads_item_transaction_number=i_transaction_number and rads_item_supersede.rads_item_transaction_sequence=si_transaction_sequence for read only do update po_item set po_item_status=''R'',order_qty=i_order_qty,received_qty=i_supersede_sent_qty,posted_date=ts_last_modified_date,last_modified_date=ts_last_modified_date,modified_by_employee_id=i_modified_by_employee_id where po_item.po_header_id=i_po_header_id and po_item.loc=i_loc and po_item.part_number=v_supersede_part_number and po_item.line_abbrev=v_supersede_line_abbrev;set v_superseded_part=''Y'';set i_supersede_total_received_qty=i_supersede_total_received_qty+i_supersede_sent_qty end for;if v_superseded_part=''Y'' then update po_header set total_received_qty=i_supersede_total_received_qty,last_receipt_date=ts_last_modified_date,last_modified_date=ts_last_modified_date,modified_by_employee_id=i_modified_by_employee_id where po_header.id=i_po_header_id and po_header.loc=i_loc end if end if;if(i_sent_qty=0 or i_sent_qty < 0) and((ti_old_ref_rads_response_id <> ti_new_ref_rads_response_id) and(ti_new_ref_rads_response_id=7 or ti_new_ref_rads_response_id=8)) then set i_wip_qty=i_order_qty else set i_wip_qty=i_sent_qty end if;if v_inventory_stock_on_hand_update=''Y'' then update inventory_stock set inventory_stock.on_hand=(select SUM(inventory_stock.on_hand+i_sent_qty) from inventory_stock where inventory_stock.inventory_id=i_inventory_id and inventory_stock.loc=i_loc),inventory_stock.last_modified_date=ts_last_modified_date,inventory_stock.modified_by_employee_id=i_modified_by_employee_id where inventory_stock.inventory_id=i_inventory_id and inventory_stock.loc=i_loc end if end', 'tr_au_saved_invoice','SAVED_INVOICE','A','U',1,'create trigger tr_au_saved_invoice after update on SAVED_INVOICE referencing old as deleted new as inserted for each row begin declare v_url varchar(50);declare v_msg_type varchar(45);declare v_msg_action varchar(10);if MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 and(inserted.DELETED_DATE is not null or ISNULL(deleted.DELETED_BY_EMPLOYEE_ID,'''') <> ISNULL(inserted.DELETED_BY_EMPLOYEE_ID,'''')) then if inserted.wms_transaction_identifier like ''TO%'' then set v_msg_type=''TRANSFER'' else set v_msg_type=''ORDER'' end if;set v_msg_action=''Delete'';select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,inserted.wms_transaction_identifier,v_msg_type,v_msg_action,v_url) end if end', 'tr_au_saved_invoice_line_item','SAVED_INVOICE_LINE_ITEM','A','U',1,'create trigger tr_au_saved_invoice_line_item after update on SAVED_INVOICE_LINE_ITEM referencing old as deleted new as inserted for each row begin declare v_work_in_progress_updated varchar(1);declare i_counterman_employee_id integer;declare ts_saved_date timestamp;declare v_update_work_in_progress varchar(1);declare d_work_in_progress decimal(8,2);declare v_url varchar(50);declare v_msg_type varchar(45);declare v_msg_action varchar(10);declare v_wms_transaction_identifier varchar(10);declare i_wms_transaction_status integer;set v_update_work_in_progress=''N'';set v_work_in_progress_updated=''N'';select work_in_progress_updated,counterman_employee_id,saved_date into v_work_in_progress_updated,i_counterman_employee_id,ts_saved_date from saved_invoice where id=inserted.saved_invoice_id and loc=inserted.loc;if v_work_in_progress_updated=''Y'' and inserted.pickup_item=''N'' and inserted.policy_adjustment=''N'' and inserted.core_transaction=''N'' and inserted.defective=''N'' and(inserted.generated_by_sequence is null or(inserted.generated_by_sequence is not null and inserted.kit_component=''Y'')) and not(inserted.generated_by_sequence is null and inserted.kit_component=''Y'') and inserted.warranty_item=''N'' and inserted.warranty_labor_claim=''N'' and inserted.auto_generated_misc_chg=''N'' and inserted.ref_invoice_line_item_type_id in(0,1,5,12) then set v_update_work_in_progress=''Y'' end if;if v_update_work_in_progress=''Y'' then select work_in_progress into d_work_in_progress from inventory_stock where loc=inserted.loc and inventory_id=(select id from inventory where line_abbrev=deleted.line_abbrev and part_number=deleted.part_number and loc=deleted.loc);if(deleted.quantity_billed > 0) then set d_work_in_progress=d_work_in_progress-deleted.quantity_billed end if;if(d_work_in_progress < 0) then set d_work_in_progress=0.0 end if;if(inserted.quantity_billed > 0) then set d_work_in_progress=d_work_in_progress+inserted.quantity_billed end if;update inventory_stock set work_in_progress=d_work_in_progress,last_modified_date=ts_saved_date,modified_by_employee_id=i_counterman_employee_id where loc=inserted.loc and inventory_id=(select id from inventory where line_abbrev=deleted.line_abbrev and part_number=deleted.part_number and loc=deleted.loc) end if;if(MOD((select indago_in_use from store_profile where loc=inserted.loc),10)=1 and(ISNULL(deleted.quantity_billed,'''') <> ISNULL(inserted.quantity_billed,'''')) and(select wms_transaction_status from saved_invoice where id=inserted.saved_invoice_id and loc=inserted.loc) < 2) then select wms_transaction_identifier,wms_transaction_status into v_wms_transaction_identifier,i_wms_transaction_status from saved_invoice where id=inserted.saved_invoice_id and loc=inserted.loc;if(v_wms_transaction_identifier is not null and not exists(select id from indago_outbound_message where message_record_id=v_wms_transaction_identifier and loc=inserted.loc and message_action=''Update'')) then if v_wms_transaction_identifier like ''TO%'' then set v_msg_type=''TRANSFER'' else set v_msg_type=''ORDER'' end if;if(i_wms_transaction_status=0) then update saved_invoice set wms_transaction_status=1 where id=inserted.saved_invoice_id end if;select url into v_url from communication_url where id=(select communication_url_id from indago_profile where loc=inserted.loc);set v_msg_action=''Update'';insert into indago_outbound_message(loc,message_record_id,message_type,message_action,jndi_url) values(inserted.loc,v_wms_transaction_identifier,v_msg_type,v_msg_action,v_url) end if end if end', 'tr_au_store_profile','STORE_PROFILE','A','U',1,'create trigger tr_au_store_profile after update on STORE_PROFILE referencing old as deleted new as inserted for each row begin if ISNULL(STRING(deleted.GPC_OWNED),'''') <> ISNULL(STRING(inserted.GPC_OWNED),'''') then call sp_apply_seav_rules(inserted.LOC,inserted.MODIFIED_BY_EMPLOYEE_ID,inserted.LAST_MODIFIED_DATE) end if;if ISNULL(STRING(deleted.EMPLOYEE_ACCESS_VALIDATION),'''') <> ISNULL(STRING(inserted.EMPLOYEE_ACCESS_VALIDATION),'''') then call sp_apply_seav_rules(inserted.LOC,inserted.MODIFIED_BY_EMPLOYEE_ID,inserted.LAST_MODIFIED_DATE) end if;if ISNULL(STRING(deleted.CURRENCY_CONVERSION_FACTOR),'''') <> ISNULL(STRING(inserted.CURRENCY_CONVERSION_FACTOR),'''') then if inserted.CURRENCY_CONVERSION_FACTOR > 0 then update report_answer set answer=''L'' where ref_report_question_id=15 else update report_answer set answer=''S'' where ref_report_question_id=15 end if end if;if ISNULL(STRING(deleted.STORE_NUM),'''') <> ISNULL(STRING(inserted.STORE_NUM),'''') then update store_profile set ipc_store_number=null;update invoicing_profile set use_integrated_payments=0;if((select send_customer_domain from store_profile)=''Y'') then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(0,deleted.loc,''U'',''STORE_PROFILE'',deleted.store_num) end if end if;if ISNULL(STRING(deleted.NAPA_ACCT_DC_CODE),'''') <> ISNULL(STRING(inserted.NAPA_ACCT_DC_CODE),'''') then if((select send_customer_domain from store_profile)=''Y'') then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(0,deleted.loc,''U'',''STORE_PROFILE'',deleted.napa_acct_dc_code) end if end if end', 'tr_au_tax_table_bracket','TAX_TABLE_BRACKET','A','U',1,'create trigger tr_au_tax_table_bracket after update on TAX_TABLE_BRACKET referencing old as deleted new as inserted for each row begin declare i_max_tax_bracket decimal(4,2);if ISNULL(STRING(deleted.TAXABLE_SALE_AMOUNT),'''') <> ISNULL(STRING(inserted.TAXABLE_SALE_AMOUNT),'''') then select MAX(TAXABLE_SALE_AMOUNT) into i_max_tax_bracket from TAX_TABLE_BRACKET where TAX_TABLE_ID=deleted.TAX_TABLE_ID;update TAX_TABLE set MAXIMUM_TAX_BRACKET=ROUND(i_max_tax_bracket,0) where ID=deleted.TAX_TABLE_ID and LOC=deleted.LOC end if end', 'tr_au_user_profile','USER_PROFILE','A','U',1,'create trigger tr_au_user_profile after update on USER_PROFILE referencing old as deleted new as inserted for each row begin declare column_not_found exception for sqlstate value ''52003'';if v_sp_name <> ''sp_set_user_pwd'' then raiserror 18018 ''tr_au_user_profile: Direct update not allowed. Use tams_dba.sp_set_user_pwd to change passwords.'' end if exception when column_not_found then raiserror 18018 ''tr_au_user_profile: Direct update not allowed. Use tams_dba.sp_set_user_pwd to change passwords.'' when others then resignal end', 'tr_bd_ap_check','DISB_CHECK','B','D',1,'create trigger tr_bd_ap_check before delete on DISB_CHECK referencing old as deleted for each row begin declare v_text varchar(254);delete from DISB_CHECK_GL_CODE where DISB_CHECK_GL_CODE.DISB_CHECK_ID=deleted.ID and DISB_CHECK_GL_CODE.LOC=deleted.LOC;delete from DISB_CHECK_INVOICE where DISB_CHECK_INVOICE.DISB_CHECK_ID=deleted.ID and DISB_CHECK_INVOICE.LOC=deleted.LOC;set v_text=deleted.CHECK_DATE || ''|'' || deleted.VENDOR_ID;call sp_log_file_insdel_activity(deleted.loc,455,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_ar_application','AR_APPLICATION','B','D',1,'create trigger tr_bd_ar_application before delete on AR_APPLICATION referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.APPLIED_AR_TRANSACTION_ID;call sp_log_file_insdel_activity(deleted.loc,406,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_ar_payment','AR_PAYMENT','B','D',1,'create trigger tr_bd_ar_payment before delete on AR_PAYMENT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CUSTOMER_ID || ''|'' || deleted.PAYMENT_ENTRY_DATE;set v_text=v_text || ''|'' || deleted.PAYMENT_REFERENCE;call sp_log_file_insdel_activity(deleted.loc,402,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);if deleted.historical=0 then update ar_application set applied_batch_ar_payment_id=null where applied_batch_ar_payment_id=deleted.id and loc=deleted.loc;update ar_application set last_modified_date=deleted.last_modified_date,modified_by_employee_id=deleted.modified_by_employee_id where applied_ar_payment_id=deleted.id and loc=deleted.loc end if end', 'tr_bd_ar_profile','AR_PROFILE','B','D',1,'create trigger tr_bd_ar_profile before delete on AR_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.MAIN_AR_STORE_NUMBER || ''|'' || deleted.DEFAULT_AR_TERMS_ID;set v_text=v_text || ''|'' || deleted.TAX_SUMMARY_ON_STMT;call sp_log_file_insdel_activity(deleted.loc,105,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_ar_terms','AR_TERMS','B','D',1,'create trigger tr_bd_ar_terms before delete on AR_TERMS referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION || ''|'' || deleted.DUE_DISCOUNT_DATE_CODE_CD;call sp_log_file_insdel_activity(deleted.loc,76,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_ar_transaction','AR_TRANSACTION','B','D',1,'create trigger tr_bd_ar_transaction before delete on AR_TRANSACTION referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CUSTOMER_ID || ''|'' || deleted.TRANSACTION_DATE;set v_text=v_text || ''|'' || deleted.TRANSACTION_REFERENCE;call sp_log_file_insdel_activity(deleted.loc,403,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_barcode','BARCODE','B','D',1,'create trigger tr_bd_barcode before delete on BARCODE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.BARCODE || ''|'' || deleted.LINE_ABBREV;set v_text=v_text || ''|'' || deleted.PART_NUMBER;call sp_log_file_insdel_activity(deleted.modified_by_employee_loc,135,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_barcode_use','BARCODE_USE','B','D',1,'create trigger tr_bd_barcode_use before delete on BARCODE_USE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,452,deleted.barcode_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_buyout','BUYOUT','B','D',1,'create trigger tr_bd_buyout before delete on BUYOUT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PO_NUMBER || ''|'' || deleted.VENDOR_ID;set v_text=v_text || ''|'' || deleted.INTENDED_REF_BUYOUT_PAYMENT_TYPE_CD;call sp_log_file_insdel_activity(deleted.loc,237,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_buyout_item','BUYOUT_ITEM','B','D',1,'create trigger tr_bd_buyout_item before delete on BUYOUT_ITEM referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,241,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_buyout_one_time_vendor','BUYOUT_ONE_TIME_VENDOR','B','D',1,'create trigger tr_bd_buyout_one_time_vendor before delete on BUYOUT_ONE_TIME_VENDOR referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,246,deleted.BUYOUT_ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_buyout_profile','BUYOUT_PROFILE','B','D',1,'create trigger tr_bd_buyout_profile before delete on BUYOUT_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LOC;call sp_log_file_insdel_activity(deleted.LOC,235,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_buyout_vendor_invoice','BUYOUT_VENDOR_INVOICE','B','D',1,'create trigger tr_bd_buyout_vendor_invoice before delete on BUYOUT_VENDOR_INVOICE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,245,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_cash_journal','CASH_JOURNAL','B','D',1,'create trigger tr_bd_cash_journal before delete on CASH_JOURNAL referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.ACCOUNTING_DATE || ''|'' || deleted.CALENDAR_DATE;call sp_log_file_insdel_activity(deleted.LOC,640,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_cash_journal_check','CASH_JOURNAL_CHECK','B','D',1,'create trigger tr_bd_cash_journal_check before delete on CASH_JOURNAL_CHECK referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CASH_JOURNAL_ID || ''|'' || deleted.CUSTOMER_NUMBER;set v_text=v_text || ''|'' || deleted.CHECK_NUMBER;call sp_log_file_insdel_activity(deleted.LOC,647,deleted.ID,null,null,v_text,''D'',null,null,1) end', 'tr_bd_cash_journal_currency_deposit','CASH_JOURNAL_CURRENCY_DEPOSIT','B','D',1,'create trigger tr_bd_cash_journal_currency_deposit before delete on CASH_JOURNAL_CURRENCY_DEPOSIT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CASH_JOURNAL_ID;call sp_log_file_insdel_activity(deleted.LOC,642,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_cash_journal_eft_deposit','CASH_JOURNAL_EFT_DEPOSIT','B','D',1,'create trigger tr_bd_cash_journal_eft_deposit before delete on CASH_JOURNAL_EFT_DEPOSIT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CASH_JOURNAL_ID || ''|'' || deleted.CUSTOMER_NUMBER;set v_text=v_text || ''|'' || deleted.EFT_IDENTIFIER;call sp_log_file_insdel_activity(deleted.LOC,643,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_cash_journal_misc_receipt','CASH_JOURNAL_MISC_RECEIPT','B','D',1,'create trigger tr_bd_cash_journal_misc_receipt before delete on CASH_JOURNAL_MISC_RECEIPT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CASH_JOURNAL_ID || ''|'' || deleted.GL_CODE;call sp_log_file_insdel_activity(deleted.LOC,645,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_cash_journal_other_deposit','CASH_JOURNAL_OTHER_DEPOSIT','B','D',1,'create trigger tr_bd_cash_journal_other_deposit before delete on CASH_JOURNAL_OTHER_DEPOSIT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CASH_JOURNAL_ID || ''|'' || deleted.REF_TENDER_TYPE_ID;call sp_log_file_insdel_activity(deleted.LOC,641,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_cash_journal_over_short','CASH_JOURNAL_OVER_SHORT','B','D',1,'create trigger tr_bd_cash_journal_over_short before delete on CASH_JOURNAL_OVER_SHORT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CASH_JOURNAL_ID;call sp_log_file_insdel_activity(deleted.LOC,644,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_cash_journal_paid_out','CASH_JOURNAL_PAID_OUT','B','D',1,'create trigger tr_bd_cash_journal_paid_out before delete on CASH_JOURNAL_PAID_OUT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CASH_JOURNAL_ID || ''|'' || deleted.GL_CODE;call sp_log_file_insdel_activity(deleted.LOC,646,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_cash_journal_profile','CASH_JOURNAL_PROFILE','B','D',1,'create trigger tr_bd_cash_journal_profile before delete on CASH_JOURNAL_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LOC;call sp_log_file_insdel_activity(deleted.LOC,473,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_cash_journal_roa','CASH_JOURNAL_ROA','B','D',1,'create trigger tr_bd_cash_journal_roa before delete on CASH_JOURNAL_ROA referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CASH_JOURNAL_ID || ''|'' || deleted.CUSTOMER_NUMBER;set v_text=v_text || ''|'' || deleted.PAYMENT_REFERENCE;call sp_log_file_insdel_activity(deleted.LOC,648,deleted.ID,null,null,v_text,''D'',null,null,1) end', 'tr_bd_cash_journal_roa_application','CASH_JOURNAL_ROA_APPLICATION','B','D',1,'create trigger tr_bd_cash_journal_roa_application before delete on CASH_JOURNAL_ROA_APPLICATION referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CASH_JOURNAL_ROA_ID || ''|'' || deleted.INVOICE_NUMBER;call sp_log_file_insdel_activity(deleted.LOC,649,deleted.ID,null,null,v_text,''D'',null,null,1) end', 'tr_bd_certificate_state','CERTIFICATION_STATE','B','D',1,'create trigger tr_bd_certificate_state before delete on CERTIFICATION_STATE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.ref_state_cd || ''|'' || deleted.ref_country_cd;call sp_log_file_insdel_activity(1,675,deleted.certification_part_group_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_certification_part','CERTIFICATION_PART','B','D',1,'create trigger tr_bd_certification_part before delete on CERTIFICATION_PART referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,676,deleted.inventory_id,deleted.certification_part_group_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_certification_part_group','CERTIFICATION_PART_GROUP','B','D',1,'create trigger tr_bd_certification_part_group before delete on CERTIFICATION_PART_GROUP referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.certification_category || ''|'' || deleted.certification_group;call sp_log_file_insdel_activity(1,674,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_classification_order','CLASSIFICATION_ORDER','B','D',1,'create trigger tr_bd_classification_order before delete on CLASSIFICATION_ORDER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CLASSIFICATION_SESSION_ID || ''|'' || deleted.PO_NUMBER;set v_text=v_text || ''|'' || deleted.DATE_CREATED;call sp_log_file_insdel_activity(deleted.loc,537,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_classification_profile','CLASSIFICATION_PROFILE','B','D',1,'create trigger tr_bd_classification_profile before delete on CLASSIFICATION_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LOC;call sp_log_file_insdel_activity(deleted.LOC,536,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_classification_return','CLASSIFICATION_RETURN','B','D',1,'create trigger tr_bd_classification_return before delete on CLASSIFICATION_RETURN referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CLASSIFICATION_SESSION_ID || ''|'' || deleted.DATE_CREATED;set v_text=v_text || ''|'' || deleted.RGN_NUMBER;call sp_log_file_insdel_activity(deleted.loc,548,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_classification_session','CLASSIFICATION_SESSION','B','D',1,'create trigger tr_bd_classification_session before delete on CLASSIFICATION_SESSION referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.SESSION_CREATED_DATE || ''|'' || deleted.REF_CLASS_METHOD_ID;set v_text=v_text || ''|'' || deleted.REF_CLASS_TYPE_ID;call sp_log_file_insdel_activity(deleted.loc,540,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_communication_access_number','COMMUNICATION_ACCESS_NUMBER','B','D',1,'create trigger tr_bd_communication_access_number before delete on COMMUNICATION_ACCESS_NUMBER referencing old as deleted for each row begin declare v_text varchar(254);declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from communication_directory where id=deleted.communication_directory_id and loc=deleted.loc;set v_text=deleted.COMMUNICATION_DIRECTORY_ID;call sp_log_file_insdel_activity(deleted.loc,469,deleted.id,null,null,v_text,''D'',v_last_modified_date,v_modified_by_employee_id,1) end', 'tr_bd_communication_directory','COMMUNICATION_DIRECTORY','B','D',1,'create trigger tr_bd_communication_directory before delete on COMMUNICATION_DIRECTORY referencing old as deleted for each row begin declare v_text varchar(254);declare v_CQT_text varchar(1000);delete from PHONE_ROOM_STORE where PHONE_ROOM_STORE.COMMUNICATION_DIRECTORY_ID=deleted.ID and PHONE_ROOM_STORE.LOC=deleted.LOC;delete from PRICING_TRACKER_COMMUNICATION where PRICING_TRACKER_COMMUNICATION.COMMUNICATION_DIRECTORY_ID=deleted.ID and PRICING_TRACKER_COMMUNICATION.LOC=deleted.LOC;delete from STORE_COMMUNICATION where STORE_COMMUNICATION.COMMUNICATION_DIRECTORY_ID=deleted.ID and STORE_COMMUNICATION.LOC=deleted.LOC;delete from COMMUNICATION_USAGE where COMMUNICATION_USAGE.COMMUNICATION_DIRECTORY_ID=deleted.ID and COMMUNICATION_USAGE.LOC=deleted.LOC;delete from COMMUNICATION_ACCESS_NUMBER where COMMUNICATION_ACCESS_NUMBER.COMMUNICATION_DIRECTORY_ID=deleted.ID and COMMUNICATION_ACCESS_NUMBER.LOC=deleted.LOC;set v_text=deleted.REF_COMMUNICATION_TYPE_ID || ''|'' || deleted.PASSWORD;call sp_log_file_insdel_activity(deleted.loc,462,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);if(MOD((select use_site_relationship_feed from store_profile where loc=deleted.loc),10)=1) and deleted.ref_communication_type_id=2 then insert into communication_directory_change_queue(id,communication_directory_id,loc,action) values(null,deleted.id,deleted.loc,''U'') end if;if((select send_customer_domain from store_profile)=''Y'') and ISNULL(deleted.INVOICE_TO_CUSTOMER_ID,0) > 0 and(select count() from customer_change_queue where customer_id=deleted.INVOICE_TO_CUSTOMER_ID and loc=deleted.loc and validation_cd=''T'' and action=''D'' and trigger_source=''CUSTOMER'')=0 then set v_CQT_text=deleted.INVOICE_TO_CUSTOMER_ID || ''|'' || deleted.id || ''|'' || deleted.REF_COMMUNICATION_TYPE_ID || ''|'' || deleted.NAME;set v_CQT_text=v_CQT_text || ''|'' || deleted.PASSWORD || ''|'' || deleted.LAST_LOGIN_DATE || ''|'' || deleted.TIMEOUT_MINUTES;set v_CQT_text=v_CQT_text || ''|'' || deleted.ALLOW_DC_STOCK_CHECK || ''|'' || deleted.PROLINK_ACCOUNT_NUMBER;set v_CQT_text=v_CQT_text || ''|'' || deleted.DISPLAY_ON_HAND_DETAILS || ''|'' || deleted.STORE_NUMBER;set v_CQT_text=v_CQT_text || ''|'' || deleted.LAST_MODIFIED_DATE || ''|'' || deleted.MODIFIED_BY_EMPLOYEE_ID;insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(deleted.INVOICE_TO_CUSTOMER_ID,deleted.loc,''D'',''COMMUNICATION_DIRECTORY'',v_CQT_text) end if end', 'tr_bd_company','COMPANY','B','D',1,'create trigger tr_bd_company before delete on COMPANY referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.NAME;call sp_log_file_insdel_activity(deleted.MODIFIED_BY_EMPLOYEE_LOC,8,deleted.ID,null,null,v_text,''D'',deleted.DATE_MODIFIED,deleted.MODIFIED_BY_EMPLOYEE_ID,1) end', 'tr_bd_core_bank_maintenance','CORE_BANK_MAINTENANCE','B','D',1,'create trigger tr_bd_core_bank_maintenance before delete on CORE_BANK_MAINTENANCE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PURCHASE_INVOICE_ID || ''|'' || deleted.PURCHASE_INVOICE_NUMBER;set v_text=v_text || ''|'' || deleted.PURCHASE_INVOICE_DATE || ''|'' || deleted.LINE_ABBREV;set v_text=v_text || ''|'' || deleted.PART_NUMBER;call sp_log_file_insdel_activity(deleted.LOC,663,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_core_bank_profile','CORE_BANK_PROFILE','B','D',1,'create trigger tr_bd_core_bank_profile before delete on CORE_BANK_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LAST_WRITEOFF_DATE || ''|'' || deleted.WRITEOFF_START_MONTH;set v_text=v_text || ''|'' || deleted.WRITEOFF_START_DAY || ''|'' || deleted.WRITEOFF_END_MONTH;set v_text=v_text || ''|'' || deleted.WRITEOFF_END_DAY;call sp_log_file_insdel_activity(deleted.LOC,664,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_customer','CUSTOMER','B','D',1,'create trigger tr_bd_customer before delete on CUSTOMER referencing old as deleted for each row begin declare v_text varchar(254);declare v_CQT_text varchar(1000);set v_text=deleted.CUSTOMER_NUM || ''|'' || deleted.ALPHA_KEY;set v_text=v_text || ''|'' || deleted.NAME || ''|'' || deleted.ADDRESS1;set v_text=v_text || ''|'' || deleted.PHONE;set v_CQT_text=deleted.ID || ''|'' || deleted.CUSTOMER_NUM || ''|'' || deleted.GLOBAL_CUSTOMER_ID;set v_CQT_text=v_CQT_text || ''|'' || deleted.LAST_MODIFIED_DATE || ''|'' || deleted.MODIFIED_BY_EMPLOYEE_ID;call sp_log_file_insdel_activity(deleted.loc,68,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);if((select send_customer_domain from store_profile)=''Y'') then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(deleted.id,deleted.loc,''D'',''CUSTOMER'',v_CQT_text) end if end', 'tr_bd_customer_ar','CUSTOMER_AR','B','D',1,'create trigger tr_bd_customer_ar before delete on CUSTOMER_AR referencing old as deleted for each row begin declare v_text varchar(254);declare v_CQT_text varchar(1000);set v_text=deleted.AR_TERMS_ID || ''|'' || deleted.CREDIT_LIMIT;set v_text=v_text || ''|'' || deleted.CURRENT_BAL;call sp_log_file_insdel_activity(deleted.loc,71,deleted.customer_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);if(((select send_customer_domain from store_profile)=''Y'') and(select count() from customer_change_queue where customer_id=deleted.CUSTOMER_ID and loc=deleted.loc and validation_cd=''T'' and action=''D'' and trigger_source=''CUSTOMER'')=0) then set v_CQT_text=deleted.CUSTOMER_ID || ''|'' || deleted.AR_TERMS_ID || ''|'' || deleted.REF_STATEMENT_TYPE_ID || ''|'' || deleted.STATEMENT_CUSTOMER_ID;set v_CQT_text=v_CQT_text || ''|'' || deleted.LOC || ''|'' || deleted.EXTRA_STATEMENT_COPIES || ''|'' || deleted.COMBINED_STATEMENT;set v_CQT_text=v_CQT_text || ''|'' || deleted.CREDIT_LIMIT || ''|'' || deleted.STORE_RESPONSIBILITY || ''|'' || deleted.AGE_CUSTOMER;set v_CQT_text=v_CQT_text || ''|'' || deleted.BAD_DEBT_ACCT || ''|'' || deleted.ACCT_SUMMARY_DAYS || ''|'' || deleted.INVOICE_COPY_DAYS;set v_CQT_text=v_CQT_text || ''|'' || deleted.RETURNED_CHECK_COUNT || ''|'' || deleted.ACCEPT_CHECK_IF_PRIOR_BAD_CHECK;set v_CQT_text=v_CQT_text || ''|'' || deleted.REF_STATEMENT_FORMAT_ID || ''|'' || deleted.STATEMENT_EMAIL_ADDRESS;set v_CQT_text=v_CQT_text || ''|'' || deleted.LAST_COD_DATE || ''|'' || deleted.NUM_OF_TIMES_COD;insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(deleted.customer_id,deleted.loc,''D'',''CUSTOMER_AR'',v_CQT_text) end if end', 'tr_bd_customer_blanket_po','CUSTOMER_BLANKET_PO','B','D',1,'create trigger tr_bd_customer_blanket_po before delete on CUSTOMER_BLANKET_PO referencing old as deleted for each row begin declare v_text varchar(254);declare v_CQT_text varchar(1000);set v_text=deleted.CUSTOMER_ID || ''|'' || deleted.BLANKET_PO_NUM;set v_text=v_text || ''|'' || deleted.END_DATE || ''|'' || deleted.MAXIMUM_AMOUNT_ALLOWED;call sp_log_file_insdel_activity(deleted.loc,108,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);if(((select send_customer_domain from store_profile)=''Y'') and(select count() from customer_change_queue where customer_id=deleted.CUSTOMER_ID and loc=deleted.loc and validation_cd=''T'' and action=''D'' and trigger_source=''CUSTOMER'')=0) then set v_CQT_text=deleted.CUSTOMER_ID || ''|'' || deleted.id || ''|'' || deleted.BLANKET_PO_NUM || ''|'' || deleted.BEGIN_DATE;set v_CQT_text=v_CQT_text || ''|'' || deleted.END_DATE || ''|'' || deleted.MAXIMUM_AMOUNT_ALLOWED;set v_CQT_text=v_CQT_text || ''|'' || deleted.LAST_MODIFIED_DATE || ''|'' || deleted.MODIFIED_BY_EMPLOYEE_ID;insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(deleted.customer_id,deleted.loc,''D'',''CUSTOMER_BLANKET_PO'',v_CQT_text) end if end', 'tr_bd_customer_card_on_file','CUSTOMER_CARD_ON_FILE','B','D',1,'create trigger tr_bd_customer_card_on_file before delete on CUSTOMER_CARD_ON_FILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CUSTOMER_ID || ''|'' || deleted.CARD_NUMBER;call sp_log_file_insdel_activity(deleted.loc,81,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_customer_certification','CUSTOMER_CERTIFICATION','B','D',1,'create trigger tr_bd_customer_certification before delete on CUSTOMER_CERTIFICATION referencing old as deleted for each row begin declare v_text varchar(254);declare v_CQT_text varchar(1000);set v_text=deleted.certification_part_group_id || ''|'' || deleted.technician_name;set v_text=v_text || ''|'' || deleted.certificate_number || ''|'' || deleted.end_date;call sp_log_file_insdel_activity(deleted.loc,677,deleted.id,deleted.customer_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);if(((select send_customer_domain from store_profile)=''Y'') and(select count() from customer_change_queue where customer_id=deleted.CUSTOMER_ID and loc=deleted.loc and validation_cd=''T'' and action=''D'' and trigger_source=''CUSTOMER'')=0) then set v_CQT_text=deleted.CUSTOMER_ID || ''|'' || deleted.id || ''|'' || deleted.certification_part_group_id || ''|'' || deleted.technician_name;set v_CQT_text=v_CQT_text || ''|'' || deleted.BEGIN_DATE || ''|'' || deleted.END_DATE || ''|'' || deleted.certificate_number;set v_CQT_text=v_CQT_text || ''|'' || deleted.LAST_MODIFIED_DATE || ''|'' || deleted.MODIFIED_BY_EMPLOYEE_ID;insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(deleted.customer_id,deleted.loc,''D'',''CUSTOMER_CERTIFICATION'',v_CQT_text) end if end', 'tr_bd_customer_comment','CUSTOMER_COMMENT','B','D',1,'create trigger tr_bd_customer_comment before delete on CUSTOMER_COMMENT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CUSTOMER_ID || ''|'' || deleted.TEXT;call sp_log_file_insdel_activity(deleted.loc,112,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_customer_contact','CUSTOMER_CONTACT','B','D',1,'create trigger tr_bd_customer_contact before delete on CUSTOMER_CONTACT referencing old as deleted for each row begin declare v_text varchar(254);declare v_CQT_text varchar(1000);set v_text=deleted.CUSTOMER_ID || ''|'' || deleted.NAME;set v_text=v_text || ''|'' || deleted.ADDRESS1 || ''|'' || deleted.PHONE;set v_text=v_text || ''|'' || deleted.AUTHORIZED_BUYER;call sp_log_file_insdel_activity(deleted.loc,124,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);if(((select send_customer_domain from store_profile)=''Y'') and(select count() from customer_change_queue where customer_id=deleted.CUSTOMER_ID and loc=deleted.loc and validation_cd=''T'' and action=''D'' and trigger_source=''CUSTOMER'')=0) then set v_CQT_text=deleted.CUSTOMER_ID || ''|'' || deleted.id || ''|'' || deleted.NAME || ''|'' || deleted.TITLE || ''|'' || deleted.PHONE;set v_CQT_text=v_CQT_text || ''|'' || deleted.EXTENSION || ''|'' || deleted.CELL_PHONE || ''|'' || deleted.PAGER;set v_CQT_text=v_CQT_text || ''|'' || deleted.HOME_PHONE || ''|'' || deleted.FAX_NUMBER || ''|'' || deleted.AUTHORIZED_BUYER;set v_CQT_text=v_CQT_text || ''|'' || deleted.ADDRESS1 || ''|'' || deleted.ADDRESS2 || ''|'' || deleted.ADDRESS3 || ''|'' || deleted.ADDRESS4;set v_CQT_text=v_CQT_text || ''|'' || deleted.CITY || ''|'' || deleted.REF_STATE_CD || ''|'' || deleted.POSTAL_CODE;set v_CQT_text=v_CQT_text || ''|'' || deleted.REF_COUNTRY_CD || ''|'' || deleted.NOTE || ''|'' || deleted.EMAIL;set v_CQT_text=v_CQT_text || ''|'' || deleted.LAST_MODIFIED_DATE || ''|'' || deleted.MODIFIED_BY_EMPLOYEE_ID;insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(deleted.customer_id,deleted.loc,''D'',''CUSTOMER_CONTACT'',v_CQT_text) end if end', 'tr_bd_customer_custom_pricing','CUSTOMER_CUSTOM_PRICING','B','D',1,'create trigger tr_bd_customer_custom_pricing before delete on CUSTOMER_CUSTOM_PRICING referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CUSTOMER_ID || ''|'' || deleted.REF_PRICING_TYPE_CD;set v_text=v_text || ''|'' || deleted.LINE_ABBREV || ''|'' || deleted.STORE_GROUP_ID;set v_text=v_text || ''|'' || deleted.DEPARTMENT_ID || ''|'' || deleted.SUB_DEPARTMENT_ID;set v_text=v_text || ''|'' || deleted.GROUP_CODE || ''|'' || deleted.PART_PREFIX;set v_text=v_text || ''|'' || deleted.REF_CLASS_CD || ''|'' || deleted.STORE_DEPARTMENT_ID;set v_text=v_text || ''|'' || deleted.BEGIN_DATE || ''|'' || deleted.END_DATE;set v_text=v_text || ''|'' || deleted.REPORTABLE || ''|'' || deleted.REF_PRICE_SHEET_CD;set v_text=v_text || ''|'' || deleted.MARKUP_PERCENT || ''|'' || deleted.REF_CURRENCY_ROUNDING_CD;call sp_log_file_insdel_activity(deleted.loc,170,deleted.id,deleted.customer_id,deleted.ref_pricing_type_cd,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_customer_delivery','CUSTOMER_DELIVERY','B','D',1,'create trigger tr_bd_customer_delivery before delete on CUSTOMER_DELIVERY referencing old as deleted for each row begin declare v_text varchar(254);declare v_CQT_text varchar(1000);set v_text=deleted.DELIVERY_REF_OPTION_CD || ''|'' || deleted.DELIVERY_ROUTE_CD;set v_text=v_text || ''|'' || deleted.DELIVERY_PRIORITY_ID;call sp_log_file_insdel_activity(deleted.loc,79,deleted.customer_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);if(((select send_customer_domain from store_profile)=''Y'') and(select count() from customer_change_queue where customer_id=deleted.CUSTOMER_ID and loc=deleted.loc and validation_cd=''T'' and action=''D'' and trigger_source=''CUSTOMER'')=0) then set v_CQT_text=deleted.CUSTOMER_ID || ''|'' || deleted.DELIVERY_REF_OPTION_CD || ''|'' || deleted.DELIVERY_ROUTE_CD;set v_CQT_text=v_CQT_text || ''|'' || deleted.DELIVERY_PRIORITY_ID || ''|'' || deleted.TRAVEL_TIME_CUSTOMER;set v_CQT_text=v_CQT_text || ''|'' || deleted.DISTANCE_TO_CUSTOMER || ''|'' || deleted.DIRECTIONS;set v_CQT_text=v_CQT_text || ''|'' || deleted.MIN_AMT_FREE_DELIVERY || ''|'' || deleted.DELIVERY_CHARGE;insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(deleted.customer_id,deleted.loc,''D'',''CUSTOMER_DELIVERY'',v_CQT_text) end if end', 'tr_bd_customer_fixed_pricing','CUSTOMER_FIXED_PRICING','B','D',1,'create trigger tr_bd_customer_fixed_pricing before delete on CUSTOMER_FIXED_PRICING referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LINE_ABBREV || ''|'' || deleted.PART_NUMBER;set v_text=v_text || ''|'' || deleted.BEGIN_DATE || ''|'' || deleted.END_DATE;set v_text=v_text || ''|'' || deleted.PART_PRICE || ''|'' || deleted.REPORTABLE;call sp_log_file_insdel_activity(deleted.loc,680,deleted.id,deleted.customer_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_customer_note','CUSTOMER_NOTE','B','D',1,'create trigger tr_bd_customer_note before delete on CUSTOMER_NOTE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.TEXT || ''|'' || deleted.REF_NOTE_HANDLING_ID;call sp_log_file_insdel_activity(deleted.loc,73,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_customer_pricing_profile','CUSTOMER_PRICING_PROFILE','B','D',1,'create trigger tr_bd_customer_pricing_profile before delete on CUSTOMER_PRICING_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PRIORITY;call sp_log_file_insdel_activity(deleted.loc,169,deleted.customer_id,deleted.pricing_profile_id,deleted.ref_customer_pricing_profile_type_cd,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_customer_pu_gp','CUSTOMER_PU_GP','B','D',1,'create trigger tr_bd_customer_pu_gp before delete on CUSTOMER_PU_GP referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CUSTOMER_ID || ''|'' || deleted.AMOUNT_BEGIN;set v_text=v_text || ''|'' || deleted.AMOUNT_END || ''|'' || deleted.PERCENT;call sp_log_file_insdel_activity(deleted.loc,110,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_customer_statement_address','CUSTOMER_STATEMENT_ADDRESS','B','D',1,'create trigger tr_bd_customer_statement_address before delete on CUSTOMER_STATEMENT_ADDRESS referencing old as deleted for each row begin declare v_text varchar(254);declare v_CQT_text varchar(1000);set v_text=deleted.NAME;call sp_log_file_insdel_activity(deleted.loc,70,deleted.customer_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);if(((select send_customer_domain from store_profile)=''Y'') and(select count() from customer_change_queue where customer_id=deleted.CUSTOMER_ID and loc=deleted.loc and validation_cd=''T'' and action=''D'' and trigger_source=''CUSTOMER'')=0) then set v_CQT_text=deleted.CUSTOMER_ID || ''|'' || deleted.NAME || ''|'' || deleted.ADDRESS1 || ''|'' || deleted.ADDRESS2;set v_CQT_text=v_CQT_text || ''|'' || deleted.ADDRESS3 || ''|'' || deleted.ADDRESS4 || ''|'' || deleted.CITY;set v_CQT_text=v_CQT_text || ''|'' || deleted.REF_STATE_CD || ''|'' || deleted.POSTAL_CODE || ''|'' || deleted.REF_COUNTRY_CD;insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(deleted.customer_id,deleted.loc,''D'',''CUSTOMER_STATEMENT_ADDRESS'',v_CQT_text) end if end', 'tr_bd_customer_tracking_code','CUSTOMER_TRACKING_CODE','B','D',1,'create trigger tr_bd_customer_tracking_code before delete on CUSTOMER_TRACKING_CODE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,183,deleted.customer_id,deleted.tracking_code_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_customer_user_defined_field','CUSTOMER_USER_DEFINED_FIELD','B','D',1,'create trigger tr_bd_customer_user_defined_field before delete on CUSTOMER_USER_DEFINED_FIELD referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.TEXT;call sp_log_file_insdel_activity(deleted.loc,227,deleted.customer_id,deleted.user_defined_field_name_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_daily_returns_audit','DAILY_RETURNS_AUDIT','B','D',1,'create trigger tr_bd_daily_returns_audit before delete on DAILY_RETURNS_AUDIT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_RGN_TYPE_ID || ''|'' || deleted.UNIQUE_BARCODE;set v_text=v_text || ''|'' || deleted.RETURN_QUANTITY;call sp_log_file_insdel_activity(deleted.loc,622,deleted.INVOICE_LINE_ITEM_INVOICE_ID,deleted.INVOICE_LINE_ITEM_SEQUENCE,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_data_review_report','DATA_REVIEW_REPORT','B','D',1,'create trigger tr_bd_data_review_report before delete on DATA_REVIEW_REPORT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REPORT_TITLE;call sp_log_file_insdel_activity(deleted.loc,615,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_data_review_report_criteria','DATA_REVIEW_REPORT_CRITERIA','B','D',1,'create trigger tr_bd_data_review_report_criteria before delete on DATA_REVIEW_REPORT_CRITERIA referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DATA_REVIEW_REPORT_ID || ''|'' || deleted.REF_LOOKUP_COLUMN_ID;set v_text=v_text || ''|'' || deleted.REF_LOOKUP_OPERATOR_ID || ''|'' || deleted.OPERAND1;call sp_log_file_insdel_activity(deleted.loc,618,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_data_review_report_display','DATA_REVIEW_REPORT_DISPLAY','B','D',1,'create trigger tr_bd_data_review_report_display before delete on DATA_REVIEW_REPORT_DISPLAY referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DATA_REVIEW_REPORT_ID || ''|'' || deleted.REF_LOOKUP_COLUMN_ID;call sp_log_file_insdel_activity(deleted.loc,616,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_data_review_report_sort_option','DATA_REVIEW_REPORT_SORT_OPTION','B','D',1,'create trigger tr_bd_data_review_report_sort_option before delete on DATA_REVIEW_REPORT_SORT_OPTION referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DATA_REVIEW_REPORT_ID || ''|'' || deleted.REF_LOOKUP_COLUMN_ID;set v_text=v_text || ''|'' || deleted.REF_LOOKUP_SORT_DIRECTION_ID || ''|'' || deleted.SORT_SEQUENCE;call sp_log_file_insdel_activity(deleted.loc,617,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_dc_address','DC_ADDRESS','B','D',1,'create trigger tr_bd_dc_address before delete on DC_ADDRESS referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DC_CITY || ''|'' || deleted.DC_PHONE_NUMBER;call sp_log_file_insdel_activity(deleted.loc,639,deleted.NAPA_ACCT_DC_CODE,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_delivery_priority','DELIVERY_PRIORITY','B','D',1,'create trigger tr_bd_delivery_priority before delete on DELIVERY_PRIORITY referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.NUM_MINUTES_FOR_DELIVERY;call sp_log_file_insdel_activity(deleted.loc,77,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_delivery_route','DELIVERY_ROUTE','B','D',1,'create trigger tr_bd_delivery_route before delete on DELIVERY_ROUTE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.loc,82,null,null,deleted.cd,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_department','DEPARTMENT','B','D',1,'create trigger tr_bd_department before delete on DEPARTMENT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.loc,213,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_disbursements_profile','DISBURSEMENTS_PROFILE','B','D',1,'create trigger tr_bd_disbursements_profile before delete on DISBURSEMENTS_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,103,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_dollar_rounding','DOLLAR_ROUNDING','B','D',1,'create trigger tr_bd_dollar_rounding before delete on DOLLAR_ROUNDING referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.BEGIN_RANGE || ''|'' || deleted.END_RANGE;call sp_log_file_insdel_activity(deleted.loc,307,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_electronic_invoicing_profile','ELECTRONIC_INVOICING_PROFILE','B','D',1,'create trigger tr_bd_electronic_invoicing_profile before delete on ELECTRONIC_INVOICING_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_ELECTRONIC_INVOICE_VENDOR_ID || ''|'' || deleted.NAME;set v_text=v_text || ''|'' || deleted.EMAIL;call sp_log_file_insdel_activity(1,687,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_employee','EMPLOYEE','B','D',1,'create trigger tr_bd_employee before delete on EMPLOYEE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LAST_NAME || ''|'' || deleted.FIRST_NAME;set v_text=v_text || ''|'' || deleted.EMPLOYEE_NUM;call sp_log_file_insdel_activity(deleted.loc,19,deleted.id,null,null,v_text,''D'',deleted.date_modified,deleted.modified_by_employee_id,1) end', 'tr_bd_employee_clock','EMPLOYEE_CLOCK','B','D',1,'create trigger tr_bd_employee_clock before delete on EMPLOYEE_CLOCK referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.EMPLOYEE_ID || ''|'' || deleted.CLOCK_IN_DATE;call sp_log_file_insdel_activity(deleted.loc,6,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_employee_comments','EMPLOYEE_COMMENTS','B','D',1,'create trigger tr_bd_employee_comments before delete on EMPLOYEE_COMMENTS referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.EMPLOYEE_ID || ''|'' || deleted.TEXT;call sp_log_file_insdel_activity(deleted.loc,113,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_employee_non_worked_hours','EMPLOYEE_NON_WORKED_HOURS','B','D',1,'create trigger tr_bd_employee_non_worked_hours before delete on EMPLOYEE_NON_WORKED_HOURS referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.EMPLOYEE_ID || ''|'' || deleted.ACTIVITY_DATE;call sp_log_file_insdel_activity(deleted.loc,26,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_employee_security_answer','EMPLOYEE_SECURITY_ANSWER','B','D',1,'create trigger tr_bd_employee_security_answer before delete on EMPLOYEE_SECURITY_ANSWER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.EMPLOYEE_ID || ''|'' || deleted.SEQUENCE;set v_text=v_text || ''|'' || deleted.REF_EMPLOYEE_SECURITY_QUESTION_ID;call sp_log_file_insdel_activity(deleted.loc,671,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_employee_training','EMPLOYEE_TRAINING','B','D',1,'create trigger tr_bd_employee_training before delete on EMPLOYEE_TRAINING referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.EMPLOYEE_ID || ''|'' || deleted.TRAINING_COURSE;call sp_log_file_insdel_activity(deleted.loc,5,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_end_of_day_monitor','END_OF_DAY_MONITOR','B','D',1,'create trigger tr_bd_end_of_day_monitor before delete on END_OF_DAY_MONITOR referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,669,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_end_of_day_profile','END_OF_DAY_PROFILE','B','D',1,'create trigger tr_bd_end_of_day_profile before delete on END_OF_DAY_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LOC;call sp_log_file_insdel_activity(deleted.LOC,96,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_end_of_month_profile','END_OF_MONTH_PROFILE','B','D',1,'create trigger tr_bd_end_of_month_profile before delete on END_OF_MONTH_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.SALES_MONTH_END_DATE;call sp_log_file_insdel_activity(deleted.loc,474,deleted.REF_MONTH_OF_YEAR_ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_eod_task_details','EOD_TASK_DETAILS','A','D',1,'create trigger tr_bd_eod_task_details after delete on EOD_TASK_DETAILS referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,614,deleted.ref_eod_task_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_factory_order_table','FACTORY_ORDER_TABLE','B','D',1,'create trigger tr_bd_factory_order_table before delete on FACTORY_ORDER_TABLE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.IDENTIFIER || ''|'' || deleted.NAPA_RESERVED;call sp_log_file_insdel_activity(deleted.loc,205,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_factory_order_table_part','FACTORY_ORDER_TABLE_PART','B','D',1,'create trigger tr_bd_factory_order_table_part before delete on FACTORY_ORDER_TABLE_PART referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.FACTORY_ORDER_TABLE_ID || ''|'' || deleted.LINE_ABBREV;set v_text=v_text || ''|'' || deleted.PART_NUMBER;call sp_log_file_insdel_activity(deleted.loc,208,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_factory_order_table_prefix','FACTORY_ORDER_TABLE_PREFIX','B','D',1,'create trigger tr_bd_factory_order_table_prefix before delete on FACTORY_ORDER_TABLE_PREFIX referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.FACTORY_ORDER_TABLE_ID || ''|'' || deleted.LINE_ABBREV;set v_text=v_text || ''|'' || deleted.GROUP_CODE || ''|'' || deleted.PART_PREFIX;call sp_log_file_insdel_activity(deleted.loc,206,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_fulfillment','FULFILLMENT','B','D',1,'create trigger tr_bd_fulfillment before delete on FULFILLMENT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.SALES_ORDER_ID;call sp_log_file_insdel_activity(deleted.loc,682,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_fulfillment_identifier','FULFILLMENT_IDENTIFIER','B','D',1,'create trigger tr_bd_fulfillment_identifier before delete on FULFILLMENT_IDENTIFIER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.FULFILLMENT_IDENTIFIER;call sp_log_file_insdel_activity(1,683,deleted.fulfillment_id,deleted.ref_fulfillment_identifier_type_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_fulfillment_item','FULFILLMENT_ITEM','B','D',1,'create trigger tr_bd_fulfillment_item before delete on FULFILLMENT_ITEM referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.FULFILLMENT_ID;call sp_log_file_insdel_activity(1,684,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_fulfillment_note','FULFILLMENT_NOTE','B','D',1,'create trigger tr_bd_fulfillment_note before delete on FULFILLMENT_NOTE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.FULFILLMENT_ID;call sp_log_file_insdel_activity(1,685,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_gl_code','GL_CODE','B','D',1,'create trigger tr_bd_gl_code before delete on GL_CODE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.GL_CODE_NUMBER || ''|'' || deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.loc,442,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_gl_code_ap_check','DISB_CHECK_GL_CODE','B','D',1,'create trigger tr_bd_gl_code_ap_check before delete on DISB_CHECK_GL_CODE referencing old as deleted for each row begin declare v_text varchar(254);declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from disb_check where id=deleted.disb_check_id and loc=deleted.loc;set v_text=deleted.DISB_CHECK_ID || ''|'' || deleted.GL_CODE;call sp_log_file_insdel_activity(deleted.loc,456,deleted.id,null,null,v_text,''D'',v_last_modified_date,v_modified_by_employee_id,1) end', 'tr_bd_hazardous_materials','HAZARDOUS_MATERIALS','B','D',1,'create trigger tr_bd_hazardous_materials before delete on HAZARDOUS_MATERIALS referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.SHIPPING_NAME;call sp_log_file_insdel_activity(deleted.loc,224,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_inventory','INVENTORY','B','D',1,'create trigger tr_bd_inventory before delete on INVENTORY referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LINE_ABBREV || ''|'' || deleted.PART_NUMBER;call sp_log_file_insdel_activity(deleted.loc,133,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);delete from inventory_stock where inventory_id=deleted.id and loc=deleted.loc end', 'tr_bd_inventory_adjustment_document','INVENTORY_ADJUSTMENT_DOCUMENT','B','D',1,'create trigger tr_bd_inventory_adjustment_document before delete on INVENTORY_ADJUSTMENT_DOCUMENT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DOCUMENT_NUMBER;call sp_log_file_insdel_activity(deleted.LOC,650,deleted.ID,null,null,v_text,''D'',null,null,1) end', 'tr_bd_inventory_adjustment_log','INVENTORY_ADJUSTMENT_LOG','B','D',1,'create trigger tr_bd_inventory_adjustment_log before delete on INVENTORY_ADJUSTMENT_LOG referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.INVENTORY_ADJUSTMENT_DOCUMENT_ID || ''|'' || deleted.LINE_ABBREV;set v_text=v_text || ''|'' || deleted.PART_NUMBER;call sp_log_file_insdel_activity(deleted.LOC,651,deleted.ID,null,null,v_text,''D'',null,null,1) end', 'tr_bd_inventory_misc_chg','INVENTORY_MISC_CHG','B','D',1,'create trigger tr_bd_inventory_misc_chg before delete on INVENTORY_MISC_CHG referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,159,deleted.inventory_id,deleted.misc_chg_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_inventory_note','INVENTORY_NOTE','B','D',1,'create trigger tr_bd_inventory_note before delete on INVENTORY_NOTE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.TEXT;call sp_log_file_insdel_activity(deleted.loc,134,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_inventory_profile','INVENTORY_PROFILE','B','D',1,'create trigger tr_bd_inventory_profile before delete on INVENTORY_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,225,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_inventory_promo','INVENTORY_PROMO','B','D',1,'create trigger tr_bd_inventory_promo before delete on INVENTORY_PROMO referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PRODUCT_LINE_ID || ''|'' || deleted.TEXT1;call sp_log_file_insdel_activity(deleted.loc,132,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_inventory_sales','INVENTORY_SALES','B','D',1,'create trigger tr_bd_inventory_sales before delete on INVENTORY_SALES referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.INVENTORY_ID || ''|'' || deleted.YEAR_MONTH;call sp_log_file_insdel_activity(deleted.loc,178,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_inventory_special_sale','INVENTORY_SPECIAL_SALE','B','D',1,'create trigger tr_bd_inventory_special_sale before delete on INVENTORY_SPECIAL_SALE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.INVENTORY_ID || ''|'' || deleted.CODE;call sp_log_file_insdel_activity(deleted.loc,162,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_inventory_stock','INVENTORY_STOCK','B','D',1,'create trigger tr_bd_inventory_stock before delete on INVENTORY_STOCK referencing old as deleted for each row begin declare v_line_abbrev varchar(3);declare v_part_number varchar(22);declare v_text varchar(254);set v_text=(select LINE_ABBREV || ''|'' || PART_NUMBER from INVENTORY where INVENTORY.ID=deleted.INVENTORY_ID and INVENTORY.LOC=deleted.LOC);call sp_log_file_insdel_activity(deleted.loc,127,deleted.inventory_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1);if((select MOD(use_inventory_feed,10) from inventory_profile)=1 and not exists(select 1 from kit_participation where kit_inventory_id=deleted.inventory_id)) then select line_abbrev,part_number into v_line_abbrev,v_part_number from inventory where id=deleted.inventory_id;if(TRIM(v_part_number) <> '''') then insert into inventory_stock_change_queue(id,inventory_id,loc,line_abbrev,part_number,action,trigger_source) values(null,deleted.inventory_id,deleted.loc,v_line_abbrev,v_part_number,''D'',1) end if end if end', 'tr_bd_inventory_stock_location','INVENTORY_STOCK_LOCATION','B','D',1,'create trigger tr_bd_inventory_stock_location before delete on INVENTORY_STOCK_LOCATION referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.INVENTORY_ID || ''|'' || deleted.STOCK_LOCATION;set v_text=v_text || ''|'' || deleted.PLANOGRAM_REFERENCE;call sp_log_file_insdel_activity(deleted.loc,177,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_inventory_user_defined_field','INVENTORY_USER_DEFINED_FIELD','B','D',1,'create trigger tr_bd_inventory_user_defined_field before delete on INVENTORY_USER_DEFINED_FIELD referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.TEXT;call sp_log_file_insdel_activity(deleted.loc,228,deleted.inventory_id,deleted.user_defined_field_name_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_invoice','INVOICE','B','D',1,'create trigger tr_bd_invoice before delete on INVOICE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.INVOICE_NUMBER || ''|'' || deleted.SALES_YEAR_MONTH;set v_text=v_text || ''|'' || deleted.ACCOUNTING_DAY;call sp_log_file_insdel_activity(deleted.loc,232,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_invoice_delivery','INVOICE_DELIVERY','B','D',1,'create trigger tr_bd_invoice_delivery before delete on INVOICE_DELIVERY referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,284,deleted.invoice_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_invoice_delivery_exception','INVOICE_DELIVERY_EXCEPTION','B','D',1,'create trigger tr_bd_invoice_delivery_exception before delete on INVOICE_DELIVERY_EXCEPTION referencing old as deleted for each row begin declare v_text varchar(254);declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=deleted.INVOICE_id and LOC=deleted.LOC;set v_text='''';call sp_log_file_insdel_activity(deleted.LOC,653,deleted.INVOICE_ID,null,null,v_text,''D'',v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,1) end', 'tr_bd_invoice_line_item','INVOICE_LINE_ITEM','B','D',1,'create trigger tr_bd_invoice_line_item before delete on INVOICE_LINE_ITEM referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LINE_ABBREV || ''|'' || deleted.PART_NUMBER;call sp_log_file_insdel_activity(deleted.loc,236,deleted.INVOICE_ID,deleted.SEQUENCE,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_invoice_line_item_deposit','INVOICE_LINE_ITEM_DEPOSIT','B','D',1,'create trigger tr_bd_invoice_line_item_deposit before delete on INVOICE_LINE_ITEM_DEPOSIT referencing old as deleted for each row begin declare v_text varchar(254);declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=deleted.INVOICE_id and LOC=deleted.LOC;set v_text='''';call sp_log_file_insdel_activity(deleted.LOC,654,deleted.INVOICE_ID,deleted.SEQUENCE,null,v_text,''D'',v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,1) end', 'tr_bd_invoice_line_item_return','INVOICE_LINE_ITEM_RETURN','B','D',1,'create trigger tr_bd_invoice_line_item_return before delete on INVOICE_LINE_ITEM_RETURN referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.INVOICE_ID || ''|'' || deleted.SEQUENCE;call sp_log_file_insdel_activity(deleted.loc,655,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_invoice_note','INVOICE_NOTE','B','D',1,'create trigger tr_bd_invoice_note before delete on INVOICE_NOTE referencing old as deleted for each row begin declare v_text varchar(254);declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=deleted.INVOICE_id and LOC=deleted.LOC;set v_text='''';call sp_log_file_insdel_activity(deleted.LOC,656,deleted.INVOICE_ID,deleted.SEQUENCE,null,v_text,''D'',v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,1) end', 'tr_bd_invoice_payment','INVOICE_PAYMENT','B','D',1,'create trigger tr_bd_invoice_payment before delete on INVOICE_PAYMENT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_TENDER_TYPE_ID;call sp_log_file_insdel_activity(deleted.loc,274,deleted.invoice_id,deleted.sequence,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_invoice_return','INVOICE_RETURN','B','D',1,'create trigger tr_bd_invoice_return before delete on INVOICE_RETURN referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.LOC,657,deleted.invoice_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_invoice_roa','INVOICE_ROA','B','D',1,'create trigger tr_bd_invoice_roa before delete on INVOICE_ROA referencing old as deleted for each row begin declare v_text varchar(254);declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=deleted.INVOICE_id and LOC=deleted.LOC;set v_text=deleted.INVOICE_ID || ''|'' || deleted.INVOICE_NUMBER_PAID;call sp_log_file_insdel_activity(deleted.LOC,658,deleted.ID,null,null,v_text,''D'',v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,1) end', 'tr_bd_invoicing_profile','INVOICING_PROFILE','B','D',1,'create trigger tr_bd_invoicing_profile before delete on INVOICING_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,107,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_joei_preload','JOEI_PRELOAD','B','D',1,'create trigger tr_bd_joei_preload before delete on JOEI_PRELOAD referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LINE_ABBREV || ''|'' || deleted.PART_NUMBER;set v_text=v_text || ''|'' || deleted.CUSTOMER_ID;call sp_log_file_insdel_activity(deleted.loc,460,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_min_max_profile','MIN_MAX_PROFILE','B','D',1,'create trigger tr_bd_min_max_profile before delete on MIN_MAX_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,355,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_min_max_session','MIN_MAX_SESSION','B','D',1,'create trigger tr_bd_min_max_session before delete on MIN_MAX_SESSION referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.description;call sp_log_file_insdel_activity(deleted.loc,1,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_misc_chg','MISC_CHG','B','D',1,'create trigger tr_bd_misc_chg before delete on MISC_CHG referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_RESERVED_LINE_CD || ''|'' || deleted.CODE;set v_text=v_text || ''|'' || deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.loc,160,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_misc_chg_exempt','MISC_CHG_EXEMPT','B','D',1,'create trigger tr_bd_misc_chg_exempt before delete on MISC_CHG_EXEMPT referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,161,deleted.customer_id,deleted.misc_chg_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_misc_chg_group_code','MISC_CHG_GROUP_CODE','B','D',1,'create trigger tr_bd_misc_chg_group_code before delete on MISC_CHG_GROUP_CODE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.loc,252,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_misc_chg_state_detail','MISC_CHG_STATE_DETAIL','B','D',1,'create trigger tr_bd_misc_chg_state_detail before delete on MISC_CHG_STATE_DETAIL referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.MISC_CHG_ID || ''|'' || deleted.REF_STATE_CD;set v_text=v_text || ''|'' || deleted.REF_COUNTRY_CD;call sp_log_file_insdel_activity(deleted.loc,254,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_modem','MODEM','B','D',1,'create trigger tr_bd_modem before delete on MODEM referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_DEVICE_CONNECTION_TYPE_ID || ''|'' || deleted.DESCRIPTION;set v_text=v_text || ''|'' || deleted.REF_MODEM_TYPE_ID;call sp_log_file_insdel_activity(deleted.loc,317,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_multistore_profile','MULTI_STORE_PROFILE','B','D',1,'create trigger tr_bd_multistore_profile before delete on MULTI_STORE_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.LOC,251,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_non_pool_rgn_class_returns','NON_POOL_RGN_CLASS_RETURNS','B','D',1,'create trigger tr_bd_non_pool_rgn_class_returns before delete on NON_POOL_RGN_CLASS_RETURNS referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_HEADER_ID || ''|'' || deleted.CLASSIFICATION_RETURN_ITEM_ID;set v_text=v_text || ''|'' || deleted.RGN_CREDIT_ID;call sp_log_file_insdel_activity(deleted.loc,627,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_non_pool_rgn_competitive_stocking_line_changeover','NON_POOL_RGN_COMPETITIVE_STOCKING_LINE_CHANGEOVER','B','D',1,'create trigger tr_bd_non_pool_rgn_competitive_stocking_line_changeover before delete on NON_POOL_RGN_COMPETITIVE_STOCKING_LINE_CHANGEOVER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_HEADER_ID || ''|'' || deleted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || deleted.INVENTORY_ID;call sp_log_file_insdel_activity(deleted.loc,630,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_non_pool_rgn_dealer_customer_changeover','NON_POOL_RGN_DEALER_CUSTOMER_CHANGEOVER','B','D',1,'create trigger tr_bd_non_pool_rgn_dealer_customer_changeover before delete on NON_POOL_RGN_DEALER_CUSTOMER_CHANGEOVER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_HEADER_ID || ''|'' || deleted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || deleted.COST_OF_CREDIT || ''|'' || deleted.EXPECTED_CREDIT;call sp_log_file_insdel_activity(deleted.loc,628,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_non_pool_rgn_miscellaneous_return','NON_POOL_RGN_MISCELLANEOUS_RETURN','B','D',1,'create trigger tr_bd_non_pool_rgn_miscellaneous_return before delete on NON_POOL_RGN_MISCELLANEOUS_RETURN referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_HEADER_ID || ''|'' || deleted.RGN_CREDIT_ID;call sp_log_file_insdel_activity(deleted.loc,629,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_non_pool_rgn_new_merchandise','NON_POOL_RGN_NEW_MERCHANDISE','B','D',1,'create trigger tr_bd_non_pool_rgn_new_merchandise before delete on NON_POOL_RGN_NEW_MERCHANDISE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_HEADER_ID || ''|'' || deleted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || deleted.INVENTORY_ID;call sp_log_file_insdel_activity(deleted.loc,633,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_non_pool_rgn_osd','NON_POOL_RGN_OSD','B','D',1,'create trigger tr_bd_non_pool_rgn_osd before delete on NON_POOL_RGN_OSD referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_HEADER_ID || ''|'' || deleted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || deleted.INVENTORY_ID || ''|'' || deleted.REF_OSD_TYPE_ID;set v_text=v_text || ''|'' || deleted.REF_OSD_CD;call sp_log_file_insdel_activity(deleted.loc,632,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_non_pool_rgn_repair_return','NON_POOL_RGN_REPAIR_RETURN','B','D',1,'create trigger tr_bd_non_pool_rgn_repair_return before delete on NON_POOL_RGN_REPAIR_RETURN referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_HEADER_ID || ''|'' || deleted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || deleted.INVENTORY_ID;call sp_log_file_insdel_activity(deleted.loc,631,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_non_pool_rgn_reportable_sales','NON_POOL_RGN_REPORTABLE_SALES','B','D',1,'create trigger tr_bd_non_pool_rgn_reportable_sales before delete on NON_POOL_RGN_REPORTABLE_SALES referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_HEADER_ID || ''|'' || deleted.SALES_YEAR_MONTH;set v_text=v_text || ''|'' || deleted.REPORTABLE_SALES_CONTROL_SERIAL_NUMBER;call sp_log_file_insdel_activity(deleted.loc,626,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_order_group','ORDER_GROUP','B','D',1,'create trigger tr_bd_order_group before delete on ORDER_GROUP referencing old as deleted for each row begin declare v_text varchar(254);delete from ORDER_GROUP_HISTORY where ORDER_GROUP_HISTORY.ORDER_GROUP_ID=deleted.ID and ORDER_GROUP_HISTORY.LOC=deleted.LOC;delete from ORDER_GROUP_STORE where ORDER_GROUP_STORE.ORDER_GROUP_ID=deleted.ID and ORDER_GROUP_STORE.LOC=deleted.LOC;delete from ORDER_GROUP_PART where ORDER_GROUP_PART.ORDER_GROUP_ID=deleted.ID and ORDER_GROUP_PART.LOC=deleted.LOC;delete from ORDER_GROUP_PREFIX where ORDER_GROUP_PREFIX.ORDER_GROUP_ID=deleted.ID and ORDER_GROUP_PREFIX.LOC=deleted.LOC;delete from ORDER_GROUP_SUPPLIER where ORDER_GROUP_SUPPLIER.ORDER_GROUP_ID=deleted.ID and ORDER_GROUP_SUPPLIER.LOC=deleted.LOC;delete from ORDER_GROUP_CLASS where ORDER_GROUP_CLASS.ORDER_GROUP_ID=deleted.ID and ORDER_GROUP_CLASS.LOC=deleted.LOC;set v_text=deleted.REF_ORDER_TYPE_CD || ''|'' || deleted.NUMBER;set v_text=v_text || ''|'' || deleted.ALIAS || ''|'' || deleted.VENDOR_ID;call sp_log_file_insdel_activity(deleted.loc,144,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_order_group_class','ORDER_GROUP_CLASS','B','D',1,'create trigger tr_bd_order_group_class before delete on ORDER_GROUP_CLASS referencing old as deleted for each row begin declare v_text varchar(254);declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=deleted.order_group_id and loc=deleted.loc;set v_text=deleted.ORDER_GROUP_ID || ''|'' || deleted.REF_CLASS_CD;call sp_log_file_insdel_activity(deleted.loc,145,deleted.id,null,null,v_text,''D'',v_last_modified_date,v_modified_by_employee_id,1) end', 'tr_bd_order_group_part','ORDER_GROUP_PART','B','D',1,'create trigger tr_bd_order_group_part before delete on ORDER_GROUP_PART referencing old as deleted for each row begin declare v_text varchar(254);declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=deleted.order_group_id and loc=deleted.loc;set v_text=deleted.ORDER_GROUP_ID || ''|'' || deleted.LINE_ABBREV;set v_text=v_text || ''|'' || deleted.PART_NUMBER;call sp_log_file_insdel_activity(deleted.loc,148,deleted.id,null,null,v_text,''D'',v_last_modified_date,v_modified_by_employee_id,1) end', 'tr_bd_order_group_prefix','ORDER_GROUP_PREFIX','B','D',1,'create trigger tr_bd_order_group_prefix before delete on ORDER_GROUP_PREFIX referencing old as deleted for each row begin declare v_text varchar(254);declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=deleted.order_group_id and loc=deleted.loc;set v_text=deleted.ORDER_GROUP_ID || ''|'' || deleted.LINE_ABBREV;set v_text=v_text || ''|'' || deleted.GROUP_CODE || ''|'' || deleted.PART_NUMBER_PREFIX;call sp_log_file_insdel_activity(deleted.loc,147,deleted.id,null,null,v_text,''D'',v_last_modified_date,v_modified_by_employee_id,1) end', 'tr_bd_order_group_store','ORDER_GROUP_STORE','B','D',1,'create trigger tr_bd_order_group_store before delete on ORDER_GROUP_STORE referencing old as deleted for each row begin declare v_text varchar(254);declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=deleted.order_group_id and loc=deleted.loc;set v_text=deleted.ORDER_GROUP_ID;call sp_log_file_insdel_activity(deleted.loc,229,deleted.id,null,null,v_text,''D'',v_last_modified_date,v_modified_by_employee_id,1) end', 'tr_bd_order_group_supplier','ORDER_GROUP_SUPPLIER','B','D',1,'create trigger tr_bd_order_group_supplier before delete on ORDER_GROUP_SUPPLIER referencing old as deleted for each row begin declare v_text varchar(254);declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=deleted.order_group_id and loc=deleted.loc;set v_text=deleted.ORDER_GROUP_ID || ''|'' || deleted.SUPPLIER_ID;call sp_log_file_insdel_activity(deleted.loc,146,deleted.id,null,null,v_text,''D'',v_last_modified_date,v_modified_by_employee_id,1) end', 'tr_bd_order_handling','ORDER_HANDLING','B','D',1,'create trigger tr_bd_order_handling before delete on ORDER_HANDLING referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.LOC,164,null,null,deleted.CD,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_order_header','ORDER_HEADER','B','D',1,'create trigger tr_bd_order_header before delete on ORDER_HEADER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_ORDER_TYPE_CD || ''|'' || deleted.PURCHASE_ORDER_NUMBER;set v_text=v_text || ''|'' || deleted.CREATION_DATE;call sp_log_file_insdel_activity(deleted.loc,153,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_pay_period_profile','PAY_PERIOD_PROFILE','B','D',1,'create trigger tr_bd_pay_period_profile before delete on PAY_PERIOD_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PROFILE_NAME;call sp_log_file_insdel_activity(deleted.loc,41,deleted.id,null,null,v_text,''D'',deleted.date_modified,deleted.modified_by_employee_id,1) end', 'tr_bd_pay_period_profile_activity','PAY_PERIOD_PROFILE_ACTIVITY','B','D',1,'create trigger tr_bd_pay_period_profile_activity before delete on PAY_PERIOD_PROFILE_ACTIVITY referencing old as deleted for each row begin declare v_text varchar(254);declare v_date_modified timestamp;declare v_modified_by_employee_id integer;select date_modified,modified_by_employee_id into v_date_modified,v_modified_by_employee_id from pay_period_profile where id=deleted.pay_period_profile_id and loc=deleted.loc;set v_text='''';call sp_log_file_insdel_activity(deleted.loc,201,deleted.pay_period_profile_id,deleted.ref_activity_type_id,null,v_text,''D'',v_date_modified,v_modified_by_employee_id,1) end', 'tr_bd_penny_rounding','PENNY_ROUNDING','B','D',1,'create trigger tr_bd_penny_rounding before delete on PENNY_ROUNDING referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.BEGIN_RANGE || ''|'' || deleted.END_RANGE;call sp_log_file_insdel_activity(deleted.loc,100,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_phone_room_group','PHONE_ROOM_GROUP','B','D',1,'create trigger tr_bd_phone_room_group before delete on PHONE_ROOM_GROUP referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.NAME;call sp_log_file_insdel_activity(deleted.loc,666,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_phone_room_profile','PHONE_ROOM_PROFILE','B','D',1,'create trigger tr_bd_phone_room_profile before delete on PHONE_ROOM_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,688,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_phone_room_store','PHONE_ROOM_STORE','B','D',1,'create trigger tr_bd_phone_room_store before delete on PHONE_ROOM_STORE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PHONE_ROOM_GROUP_ID || ''|'' || deleted.COMMUNICATION_DIRECTORY_ID;call sp_log_file_insdel_activity(deleted.loc,667,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_physical_inventory_location','PHYSICAL_INVENTORY_LOCATION','B','D',1,'create trigger tr_bd_physical_inventory_location before delete on PHYSICAL_INVENTORY_LOCATION referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PHYSICAL_INVENTORY_PART_ID;call sp_log_file_insdel_activity(deleted.loc,315,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_po_header','PO_HEADER','B','D',1,'create trigger tr_bd_po_header before delete on PO_HEADER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_ORDER_TYPE_CD || ''|'' || deleted.PURCHASE_ORDER_NUMBER;set v_text=v_text || ''|'' || deleted.CREATION_DATE;call sp_log_file_insdel_activity(deleted.loc,152,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_po_item','PO_ITEM','B','D',1,'create trigger tr_bd_po_item before delete on PO_ITEM referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PO_HEADER_ID || ''|'' || deleted.LINE_ABBREV;set v_text=v_text || ''|'' || deleted.PART_NUMBER;call sp_log_file_insdel_activity(deleted.loc,151,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_po_item_store','PO_ITEM_STORE','B','D',1,'create trigger tr_bd_po_item_store before delete on PO_ITEM_STORE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PO_ITEM_ID || ''|'' || deleted.ORDER_FOR_STORE_NUMBER;call sp_log_file_insdel_activity(deleted.loc,230,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_po_note','PO_NOTE','B','D',1,'create trigger tr_bd_po_note before delete on PO_NOTE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PO_HEADER_ID;call sp_log_file_insdel_activity(deleted.loc,686,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_pricing_profile','PRICING_PROFILE','B','D',1,'create trigger tr_bd_pricing_profile before delete on PRICING_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION || ''|'' || deleted.USUAL_REF_PRICE_SHEET_CD;set v_text=v_text || ''|'' || deleted.USUAL_PRICE_MARKUP_PERCENT || ''|'' || deleted.USUAL_PRICE_REF_CURRENCY_ROUNDING_CD;call sp_log_file_insdel_activity(deleted.loc,168,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_pricing_profile_detail','PRICING_PROFILE_DETAIL','B','D',1,'create trigger tr_bd_pricing_profile_detail before delete on PRICING_PROFILE_DETAIL referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PRICING_PROFILE_ID || ''|'' || deleted.REF_PRICING_TYPE_CD;set v_text=v_text || ''|'' || deleted.LINE_ABBREV || ''|'' || deleted.STORE_GROUP_ID;set v_text=v_text || ''|'' || deleted.DEPARTMENT_ID || ''|'' || deleted.SUB_DEPARTMENT_ID;set v_text=v_text || ''|'' || deleted.GROUP_CODE || ''|'' || deleted.PART_PREFIX;set v_text=v_text || ''|'' || deleted.REF_CLASS_CD || ''|'' || deleted.STORE_DEPARTMENT_ID;set v_text=v_text || ''|'' || deleted.BEGIN_DATE || ''|'' || deleted.END_DATE;set v_text=v_text || ''|'' || deleted.REPORTABLE || ''|'' || deleted.REF_PRICE_SHEET_CD;set v_text=v_text || ''|'' || deleted.MARKUP_PERCENT || ''|'' || deleted.REF_CURRENCY_ROUNDING_CD;call sp_log_file_insdel_activity(deleted.loc,92,deleted.id,deleted.pricing_profile_id,deleted.ref_pricing_type_cd,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_pricing_profile_fixed_detail','PRICING_PROFILE_FIXED_DETAIL','B','D',1,'create trigger tr_bd_pricing_profile_fixed_detail before delete on PRICING_PROFILE_FIXED_DETAIL referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LINE_ABBREV || ''|'' || deleted.PART_NUMBER;set v_text=v_text || ''|'' || deleted.BEGIN_DATE || ''|'' || deleted.END_DATE;set v_text=v_text || ''|'' || deleted.PART_PRICE || ''|'' || deleted.REPORTABLE;call sp_log_file_insdel_activity(deleted.loc,679,deleted.id,deleted.pricing_profile_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_printer','PRINTER','B','D',1,'create trigger tr_bd_printer before delete on PRINTER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_DEVICE_CONNECTION_TYPE_ID || ''|'' || deleted.DESCRIPTION;set v_text=v_text || ''|'' || deleted.REF_PRINTER_MODEL_ID || ''|'' || deleted.PRINTER_NUMBER;call sp_log_file_insdel_activity(deleted.loc,318,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_pro_rata_warranty','PRO_RATA_WARRANTY','B','D',1,'create trigger tr_bd_pro_rata_warranty before delete on PRO_RATA_WARRANTY referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.line_abbrev || ''|'' || deleted.part_number;set v_text=v_text || ''|'' || deleted.purchase_begin_date || ''|'' || deleted.purchase_end_date;call sp_log_file_insdel_activity(deleted.loc,672,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_product_line','PRODUCT_LINE','B','D',1,'create trigger tr_bd_product_line before delete on PRODUCT_LINE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LINE_ABBREV || ''|'' || deleted.GROUP_CODE;call sp_log_file_insdel_activity(deleted.loc,128,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_product_line_out_of_class','PRODUCT_LINE_OUT_OF_CLASS','B','D',1,'create trigger tr_bd_product_line_out_of_class before delete on PRODUCT_LINE_OUT_OF_CLASS referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PRODUCT_LINE_ID || ''|'' || deleted.REF_CLASS_CD;call sp_log_file_insdel_activity(deleted.LOC,136,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_product_line_sales','PRODUCT_LINE_SALES','B','D',1,'create trigger tr_bd_product_line_sales before delete on PRODUCT_LINE_SALES referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PRODUCT_LINE_ID || ''|'' || deleted.YEAR_MONTH;call sp_log_file_insdel_activity(deleted.loc,174,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_protobase_prior_authorizations','PROTOBASE_PRIOR_AUTHORIZATION','B','D',1,'create trigger tr_bd_protobase_prior_authorizations before delete on PROTOBASE_PRIOR_AUTHORIZATION referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CARD_NUMBER || ''|'' || deleted.INVOICE_NUMBER;call sp_log_file_insdel_activity(deleted.loc,613,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_purchase_card','STORE_PURCHASE_CARD','B','D',1,'create trigger tr_bd_purchase_card before delete on STORE_PURCHASE_CARD referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PURCHASE_CARD_NUMBER || ''|'' || deleted.CARD_EXPIRATION_DATE;set v_text=v_text || ''|'' || deleted.CARDHOLDER_NAME;call sp_log_file_insdel_activity(deleted.loc,450,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_purge_type_profile','PURGE_TYPE_PROFILE','B','D',1,'create trigger tr_bd_purge_type_profile before delete on PURGE_TYPE_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.PURGE_DATA || ''|'' || deleted.KEEP_DATA_DURATION;call sp_log_file_insdel_activity(deleted.LOC,662,deleted.REF_PURGE_TYPE_ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_rads_profile','RADS_PROFILE','B','D',1,'create trigger tr_bd_rads_profile before delete on RADS_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,670,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_ref_store_configuration','REF_STORE_CONFIGURATION','B','D',1,'create trigger tr_bd_ref_store_configuration before delete on REF_STORE_CONFIGURATION referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(1,689,deleted.id,null,null,v_text,''D'',null,null,1) end', 'tr_bd_remote_system_profile','REMOTE_SYSTEM_PROFILE','B','D',1,'create trigger tr_bd_remote_system_profile before delete on REMOTE_SYSTEM_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(1,678,deleted.REF_REMOTE_SYSTEM_ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_report_criteria','REPORT_CRITERIA','B','D',1,'create trigger tr_bd_report_criteria before delete on REPORT_CRITERIA referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_REPORT_ID || ''|'' || deleted.REF_REPORT_TIMEFRAME_ID;set v_text=v_text || ''|'' || deleted.EMPLOYEE_ID;call sp_log_file_insdel_activity(deleted.loc,419,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_report_schedule','REPORT_SCHEDULE','B','D',1,'create trigger tr_bd_report_schedule before delete on REPORT_SCHEDULE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_REPORT_PAPER_SIZE_ID || ''|'' || deleted.REF_REPORT_ID;set v_text=v_text || ''|'' || deleted.EMPLOYEE_ID || ''|'' || deleted.SCHEDULED_RUN_DATE;call sp_log_file_insdel_activity(deleted.loc,415,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_returned_check','RETURNED_CHECK','B','D',1,'create trigger tr_bd_returned_check before delete on RETURNED_CHECK referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.NAME_ON_CHECK || ''|'' || deleted.CHECK_NUMBER;set v_text=v_text || ''|'' || deleted.CHECK_DATE;call sp_log_file_insdel_activity(deleted.loc,367,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_rgn_credit','RGN_CREDIT','B','D',1,'create trigger tr_bd_rgn_credit before delete on RGN_CREDIT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.CREDIT_RECEIVED || ''|'' || deleted.EXPENSE_AMOUNT;call sp_log_file_insdel_activity(deleted.loc,635,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_rgn_credit_audit','RGN_CREDIT_AUDIT','B','D',1,'create trigger tr_bd_rgn_credit_audit before delete on RGN_CREDIT_AUDIT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_CREDIT_ID || ''|'' || deleted.REF_CREDIT_TYPE_ID;set v_text=v_text || ''|'' || deleted.AMOUNT_APPLIED;call sp_log_file_insdel_activity(deleted.loc,636,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_rgn_header','RGN_HEADER','B','D',1,'create trigger tr_bd_rgn_header before delete on RGN_HEADER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_NUMBER || ''|'' || deleted.TOTAL_RGN_AMOUNT;set v_text=v_text || ''|'' || deleted.CREATION_DATE;call sp_log_file_insdel_activity(deleted.loc,624,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_rgn_item_from_pool','RGN_ITEM_FROM_POOL','B','D',1,'create trigger tr_bd_rgn_item_from_pool before delete on RGN_ITEM_FROM_POOL referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.RGN_HEADER_ID || ''|'' || deleted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || deleted.RETURN_QUANTITY;call sp_log_file_insdel_activity(deleted.loc,625,deleted.rgn_pool_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_rgn_pool','RGN_POOL','B','D',1,'create trigger tr_bd_rgn_pool before delete on RGN_POOL referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.INVOICE_LINE_ITEM_INVOICE_ID || ''|'' || deleted.INVOICE_LINE_ITEM_SEQUENCE;set v_text=v_text || ''|'' || deleted.INVENTORY_ID || ''|'' || deleted.RETURN_QUANTITY;call sp_log_file_insdel_activity(deleted.loc,623,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_rgn_profile','RGN_PROFILE','B','D',1,'create trigger tr_bd_rgn_profile before delete on RGN_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LOC;call sp_log_file_insdel_activity(deleted.LOC,341,null,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_sales_order','SALES_ORDER','B','D',1,'create trigger tr_bd_sales_order before delete on SALES_ORDER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.STORE_NUM;call sp_log_file_insdel_activity(deleted.loc,681,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_saved_invoice','SAVED_INVOICE','B','D',1,'create trigger tr_bd_saved_invoice before delete on SAVED_INVOICE referencing old as deleted for each row begin if deleted.work_in_progress_updated=''Y'' then for invoice_line_items as curInvoice_lines dynamic scroll cursor for select line_abbrev as c_line_abbrev,part_number as c_part_number,quantity_billed as d_quantity_billed from saved_invoice_line_item where saved_invoice_id=deleted.id and loc=deleted.loc and quantity_billed >=0 and pickup_item=''N'' and policy_adjustment=''N'' and core_transaction=''N'' and defective=''N'' and(generated_by_sequence is null or(generated_by_sequence is not null and kit_component=''Y'')) and not(generated_by_sequence is null and kit_component=''Y'') and warranty_item=''N'' and warranty_labor_claim=''N'' and auto_generated_misc_chg=''N'' and ref_invoice_line_item_type_id in(0,1,5,12) for read only do update inventory_stock set work_in_progress=(if work_in_progress-d_quantity_billed < 0 then 0 else work_in_progress-d_quantity_billed endif),last_modified_date=deleted.saved_date,modified_by_employee_id=deleted.counterman_employee_id where loc=deleted.loc and inventory_id=(select id from inventory where line_abbrev=c_line_abbrev and part_number=c_part_number and loc=deleted.loc) end for end if;delete from rads_saved_invoice where rads_saved_invoice.saved_invoice_id=deleted.id and rads_saved_invoice.loc=deleted.loc end', 'tr_bd_saved_invoice_line_item','SAVED_INVOICE_LINE_ITEM','B','D',1,'create trigger tr_bd_saved_invoice_line_item before delete on SAVED_INVOICE_LINE_ITEM referencing old as deleted for each row begin declare i_rads_item_saved_invoice_id integer;declare si_rads_item_saved_invoice_line_item_sequence smallint;declare i_rads_item_supersede_saved_invoice_id integer;declare si_rads_item_supersede_saved_invoice_line_item_sequence smallint;declare v_work_in_progress_updated varchar(1);declare i_counterman_employee_id integer;declare ts_saved_date timestamp;declare v_update_work_in_progress varchar(1);set v_update_work_in_progress=''N'';set v_work_in_progress_updated=''N'';select work_in_progress_updated,counterman_employee_id,saved_date into v_work_in_progress_updated,i_counterman_employee_id,ts_saved_date from saved_invoice where id=deleted.saved_invoice_id and loc=deleted.loc;if v_work_in_progress_updated=''Y'' and deleted.quantity_billed >=0 and deleted.pickup_item=''N'' and deleted.policy_adjustment=''N'' and deleted.core_transaction=''N'' and deleted.defective=''N'' and(deleted.generated_by_sequence is null or(deleted.generated_by_sequence is not null and deleted.kit_component=''Y'')) and not(deleted.generated_by_sequence is null and deleted.kit_component=''Y'') and deleted.warranty_item=''N'' and deleted.warranty_labor_claim=''N'' and deleted.auto_generated_misc_chg=''N'' and deleted.ref_invoice_line_item_type_id in(0,1,5,12) then set v_update_work_in_progress=''Y'' end if;if v_update_work_in_progress=''Y'' then update inventory_stock set work_in_progress=(if work_in_progress-deleted.quantity_billed < 0 then 0 else work_in_progress-deleted.quantity_billed endif),last_modified_date=ts_saved_date,modified_by_employee_id=i_counterman_employee_id where loc=deleted.loc and inventory_id=(select id from inventory where line_abbrev=deleted.line_abbrev and part_number=deleted.part_number and loc=deleted.loc) end if;select saved_invoice_id,saved_invoice_line_item_sequence into i_rads_item_saved_invoice_id,si_rads_item_saved_invoice_line_item_sequence from rads_item where saved_invoice_id=deleted.saved_invoice_id and saved_invoice_line_item_sequence=deleted.sequence and loc=deleted.loc;select saved_invoice_id,saved_invoice_line_item_sequence into i_rads_item_supersede_saved_invoice_id,si_rads_item_supersede_saved_invoice_line_item_sequence from rads_item_supersede where saved_invoice_id=deleted.saved_invoice_id and saved_invoice_line_item_sequence=deleted.sequence and loc=deleted.loc;if(i_rads_item_saved_invoice_id is not null and si_rads_item_saved_invoice_line_item_sequence is not null) then update rads_item set saved_invoice_id=null,saved_invoice_line_item_sequence=null where saved_invoice_id=deleted.saved_invoice_id and saved_invoice_line_item_sequence=deleted.sequence and loc=deleted.loc end if;if(i_rads_item_supersede_saved_invoice_id is not null and si_rads_item_supersede_saved_invoice_line_item_sequence is not null) then update rads_item_supersede set saved_invoice_id=null,saved_invoice_line_item_sequence=null where saved_invoice_id=deleted.saved_invoice_id and saved_invoice_line_item_sequence=deleted.sequence and loc=deleted.loc end if end', 'tr_bd_scanner','SCANNER','B','D',1,'create trigger tr_bd_scanner before delete on SCANNER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_DEVICE_CONNECTION_TYPE_ID || ''|'' || deleted.DESCRIPTION;set v_text=v_text || ''|'' || deleted.IP_ADDRESS || ''|'' || deleted.REF_SCANNER_TYPE_ID;call sp_log_file_insdel_activity(deleted.loc,319,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_shipping_code','SHIPPING_CODE','B','D',1,'create trigger tr_bd_shipping_code before delete on SHIPPING_CODE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION || ''|'' || deleted.JOEI_SHIPPING_CD;call sp_log_file_insdel_activity(deleted.LOC,163,null,null,deleted.CD,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_store_category','STORE_CATEGORY','B','D',1,'create trigger tr_bd_store_category before delete on STORE_CATEGORY referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.loc,85,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_store_department','STORE_DEPARTMENT','B','D',1,'create trigger tr_bd_store_department before delete on STORE_DEPARTMENT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.loc,215,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_store_group','STORE_GROUP','B','D',1,'create trigger tr_bd_store_group before delete on STORE_GROUP referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.STORE_GROUP_NUM || ''|'' || deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.loc,185,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_store_profile','STORE_PROFILE','B','D',1,'create trigger tr_bd_store_profile before delete on STORE_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,7,deleted.ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_store_pu_gp','STORE_PU_GP','B','D',1,'create trigger tr_bd_store_pu_gp before delete on STORE_PU_GP referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.AMOUNT_BEGIN || ''|'' || deleted.AMOUNT_END;call sp_log_file_insdel_activity(deleted.loc,125,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_sub_department','SUB_DEPARTMENT','B','D',1,'create trigger tr_bd_sub_department before delete on SUB_DEPARTMENT referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.loc,214,deleted.department_id,deleted.id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_supersede','SUPERSEDE','B','D',1,'create trigger tr_bd_supersede before delete on SUPERSEDE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LINE_ABBREV || ''|'' || deleted.PART_NUMBER;call sp_log_file_insdel_activity(deleted.loc,131,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_supersede_part','SUPERSEDE_PART','B','D',1,'create trigger tr_bd_supersede_part before delete on SUPERSEDE_PART referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.SUPERSEDE_ID || ''|'' || deleted.REF_SUPERSEDE_TYPE_ID;set v_text=v_text || ''|'' || deleted.SUPERSEDING_LINE_ABBREV || ''|'' || deleted.SUPERSEDING_PART_NUMBER;call sp_log_file_insdel_activity(deleted.loc,200,deleted.id,deleted.supersede_id,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_supplier','SUPPLIER','B','D',1,'create trigger tr_bd_supplier before delete on SUPPLIER referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.NAME;call sp_log_file_insdel_activity(deleted.loc,281,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_tax_table','TAX_TABLE','B','D',1,'create trigger tr_bd_tax_table before delete on TAX_TABLE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.DESCRIPTION || ''|'' || deleted.SECONDARY_TAX_TABLE_ID;call sp_log_file_insdel_activity(deleted.loc,89,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_tender_type_profile','TENDER_TYPE_PROFILE','B','D',1,'create trigger tr_bd_tender_type_profile before delete on TENDER_TYPE_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.TENDER_TYPE_ACCEPTED;call sp_log_file_insdel_activity(deleted.LOC,276,deleted.REF_TENDER_TYPE_ID,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_terminal','TERMINAL','B','D',1,'create trigger tr_bd_terminal before delete on TERMINAL referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_DEVICE_CONNECTION_TYPE_ID || ''|'' || deleted.DESCRIPTION;set v_text=v_text || ''|'' || deleted.IP_ADDRESS || ''|'' || deleted.ALLOW_INTERNET_ACCESS;call sp_log_file_insdel_activity(deleted.loc,303,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_time_tracking_profile','TIME_TRACKING_PROFILE','B','D',1,'create trigger tr_bd_time_tracking_profile before delete on TIME_TRACKING_PROFILE referencing old as deleted for each row begin declare v_text varchar(254);set v_text='''';call sp_log_file_insdel_activity(deleted.loc,37,deleted.id,null,null,v_text,''D'',deleted.date_modified,deleted.modified_by_employee_id,1) end', 'tr_bd_tracking_code','TRACKING_CODE','B','D',1,'create trigger tr_bd_tracking_code before delete on TRACKING_CODE referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.REF_TRACKING_TYPE_CD || ''|'' || deleted.CODE;set v_text=v_text || ''|'' || deleted.DESCRIPTION;call sp_log_file_insdel_activity(deleted.loc,184,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_user_defined_field_name','USER_DEFINED_FIELD_NAME','B','D',1,'create trigger tr_bd_user_defined_field_name before delete on USER_DEFINED_FIELD_NAME referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.APPLIES_TO_TABLE_CODE || ''|'' || deleted.SEQUENCE;set v_text=v_text || ''|'' || deleted.FIELD_NAME;call sp_log_file_insdel_activity(deleted.loc,226,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_vendor','VENDOR','B','D',1,'create trigger tr_bd_vendor before delete on VENDOR referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.NAME;call sp_log_file_insdel_activity(deleted.loc,143,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_vendor_alternate_address','VENDOR_ALTERNATE_ADDRESS','B','D',1,'create trigger tr_bd_vendor_alternate_address before delete on VENDOR_ALTERNATE_ADDRESS referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.NAME;call sp_log_file_insdel_activity(deleted.loc,266,deleted.vendor_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_vendor_invoice','DISB_CHECK_INVOICE','B','D',1,'create trigger tr_bd_vendor_invoice before delete on DISB_CHECK_INVOICE referencing old as deleted for each row begin declare v_text varchar(254);declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from disb_check where id=deleted.disb_check_id and loc=deleted.loc;set v_text=deleted.DISB_CHECK_ID || ''|'' || deleted.INVOICE_NUMBER;call sp_log_file_insdel_activity(deleted.loc,457,deleted.id,null,null,v_text,''D'',v_last_modified_date,v_modified_by_employee_id,1) end', 'tr_bd_warranty','WARRANTY','B','D',1,'create trigger tr_bd_warranty before delete on WARRANTY referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.LINE_ABBREV || ''|'' || deleted.PART_NUMBER;call sp_log_file_insdel_activity(deleted.loc,130,deleted.id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bd_warranty_period','WARRANTY_PERIOD','B','D',1,'create trigger tr_bd_warranty_period before delete on WARRANTY_PERIOD referencing old as deleted for each row begin declare v_text varchar(254);set v_text=deleted.period_months;call sp_log_file_insdel_activity(deleted.loc,673,deleted.pro_rata_warranty_id,null,null,v_text,''D'',deleted.last_modified_date,deleted.modified_by_employee_id,1) end', 'tr_bi_alert','ALERT','B','I',1,'create trigger tr_bi_alert before insert on ALERT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.SUMMARY;i_return_status=call sp_log_file_insdel_activity(inserted.loc,593,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_ap_check','DISB_CHECK','B','I',1,'create trigger tr_bi_ap_check before insert on DISB_CHECK referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CHECK_DATE || ''|'' || inserted.VENDOR_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,455,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_ar_application','AR_APPLICATION','B','I',1,'create trigger tr_bi_ar_application before insert on AR_APPLICATION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.APPLIED_AR_TRANSACTION_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,406,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.applied_ar_payment_id is not null then begin declare d_payment_amount decimal(9,2);declare d_applied_total decimal(12,2);set d_payment_amount=(select payment_amount+discount_taken from ar_payment where id=inserted.applied_ar_payment_id and loc=inserted.loc);set d_applied_total=inserted.applied_amount+ISNULL((select SUM(applied_amount) from ar_application where applied_ar_payment_id=inserted.applied_ar_payment_id and loc=inserted.loc and id <> inserted.id),0);if d_applied_total < 0 then raiserror 18031 ''tr_bi_ar_application: Balance for payment cannot exceed original amount+discount.'' end if;if d_applied_total > ABS(d_payment_amount) then raiserror 18030 ''tr_bi_ar_application: Cannot over-apply payment.'' end if end end if;if inserted.applied_ar_transaction_id is not null then begin declare d_transaction_amount decimal(9,2);declare d_applied_total decimal(12,2);set d_transaction_amount=(select gross_amount from ar_transaction where id=inserted.applied_ar_transaction_id and loc=inserted.loc);set d_applied_total=inserted.applied_amount+ISNULL((select SUM(applied_amount) from ar_application where applied_ar_transaction_id=inserted.applied_ar_transaction_id and loc=inserted.loc and id <> inserted.id),0);if d_applied_total < 0 then raiserror 18033 ''tr_bi_ar_application: Balance for transaction cannot exceed original amount'' end if;if d_applied_total > ABS(d_transaction_amount) then raiserror 18032 ''tr_bi_ar_application: Cannot over-apply transaction.'' end if end end if;if inserted.applied_to_ar_transaction_id is not null then begin declare d_transaction_amount decimal(9,2);declare d_applied_total decimal(12,2);set d_transaction_amount=(select gross_amount from ar_transaction where id=inserted.applied_to_ar_transaction_id and loc=inserted.loc);set d_applied_total=inserted.applied_amount+ISNULL((select SUM(applied_amount) from ar_application where applied_to_ar_transaction_id=inserted.applied_to_ar_transaction_id and loc=inserted.loc and id <> inserted.id),0);if d_applied_total < 0 then raiserror 18033 ''tr_bi_ar_application: Balance for transaction cannot exceed original amount'' end if;if d_applied_total > ABS(d_transaction_amount) then raiserror 18032 ''tr_bi_ar_application: Cannot over-apply transaction.'' end if end end if end', 'tr_bi_ar_payment','AR_PAYMENT','B','I',1,'create trigger tr_bi_ar_payment before insert on AR_PAYMENT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CUSTOMER_ID || ''|'' || inserted.PAYMENT_ENTRY_DATE;set v_text=v_text || ''|'' || inserted.PAYMENT_REFERENCE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,402,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if(inserted.payment_amount > 0 and inserted.unapplied_amount < 0) or(inserted.payment_amount < 0 and inserted.unapplied_amount > 0) then raiserror 18030 ''tr_bi_ar_payment: Cannot over-apply payment.'' end if;if(inserted.payment_amount > 0 and inserted.unapplied_amount > inserted.payment_amount+inserted.discount_taken) or(inserted.payment_amount < 0 and inserted.unapplied_amount < inserted.payment_amount+inserted.discount_taken) then raiserror 18031 ''tr_bi_ar_payment: Balance for payment cannot exceed original amount+discount.'' end if end', 'tr_bi_ar_profile','AR_PROFILE','B','I',1,'create trigger tr_bi_ar_profile before insert on AR_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.MAIN_AR_STORE_NUMBER || ''|'' || inserted.DEFAULT_AR_TERMS_ID;set v_text=v_text || ''|'' || inserted.TAX_SUMMARY_ON_STMT;i_return_status=call sp_log_file_insdel_activity(inserted.loc,105,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_ar_terms','AR_TERMS','B','I',1,'create trigger tr_bi_ar_terms before insert on AR_TERMS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION || ''|'' || inserted.DUE_DISCOUNT_DATE_CODE_CD;i_return_status=call sp_log_file_insdel_activity(inserted.loc,76,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_ar_transaction','AR_TRANSACTION','B','I',1,'create trigger tr_bi_ar_transaction before insert on AR_TRANSACTION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CUSTOMER_ID || ''|'' || inserted.TRANSACTION_DATE;set v_text=v_text || ''|'' || inserted.TRANSACTION_REFERENCE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,403,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if(inserted.gross_amount > 0 and inserted.current_balance < 0) or(inserted.gross_amount < 0 and inserted.current_balance > 0) then raiserror 18032 ''tr_bi_ar_transaction: Cannot over-apply transaction.'' end if;if(inserted.gross_amount > 0 and inserted.current_balance > inserted.gross_amount) or(inserted.gross_amount < 0 and inserted.current_balance < inserted.gross_amount) then raiserror 18033 ''tr_bi_ar_transaction: Balance for transaction cannot exceed original amount'' end if end', 'tr_bi_barcode','BARCODE','B','I',1,'create trigger tr_bi_barcode before insert on BARCODE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.BARCODE || ''|'' || inserted.LINE_ABBREV;set v_text=v_text || ''|'' || inserted.PART_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.modified_by_employee_loc,135,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_barcode_use','BARCODE_USE','B','I',1,'create trigger tr_bi_barcode_use before insert on BARCODE_USE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,452,inserted.barcode_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_buyout','BUYOUT','B','I',1,'create trigger tr_bi_buyout before insert on BUYOUT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PO_NUMBER || ''|'' || inserted.VENDOR_ID;set v_text=v_text || ''|'' || inserted.INTENDED_REF_BUYOUT_PAYMENT_TYPE_CD;i_return_status=call sp_log_file_insdel_activity(inserted.loc,237,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_buyout_item','BUYOUT_ITEM','B','I',1,'create trigger tr_bi_buyout_item before insert on BUYOUT_ITEM referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,241,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if fn_stripped_part_number(inserted.expanded_part_number) <> inserted.part_number then raiserror 18023 ''tr_bi_buyout_item: expanded_part_number '' || inserted.expanded_part_number || '' does not match part_number '' || inserted.part_number || ''.'' end if end', 'tr_bi_buyout_one_time_vendor','BUYOUT_ONE_TIME_VENDOR','B','I',1,'create trigger tr_bi_buyout_one_time_vendor before insert on BUYOUT_ONE_TIME_VENDOR referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,246,inserted.BUYOUT_ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_buyout_profile','BUYOUT_PROFILE','B','I',1,'create trigger tr_bi_buyout_profile before insert on BUYOUT_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LOC;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,235,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_buyout_vendor_invoice','BUYOUT_VENDOR_INVOICE','B','I',1,'create trigger tr_bi_buyout_vendor_invoice before insert on BUYOUT_VENDOR_INVOICE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,245,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_cash_journal','CASH_JOURNAL','B','I',1,'create trigger tr_bi_cash_journal before insert on CASH_JOURNAL referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.ACCOUNTING_DATE || ''|'' || inserted.CALENDAR_DATE;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,640,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_cash_journal_check','CASH_JOURNAL_CHECK','B','I',1,'create trigger tr_bi_cash_journal_check before insert on CASH_JOURNAL_CHECK referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CASH_JOURNAL_ID || ''|'' || inserted.CUSTOMER_NUMBER;set v_text=v_text || ''|'' || inserted.CHECK_NUMBER;call sp_log_file_insdel_activity(inserted.LOC,647,inserted.ID,null,null,v_text,''A'',null,null,1) end', 'tr_bi_cash_journal_currency_deposit','CASH_JOURNAL_CURRENCY_DEPOSIT','B','I',1,'create trigger tr_bi_cash_journal_currency_deposit before insert on CASH_JOURNAL_CURRENCY_DEPOSIT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CASH_JOURNAL_ID;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,642,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_cash_journal_eft_deposit','CASH_JOURNAL_EFT_DEPOSIT','B','I',1,'create trigger tr_bi_cash_journal_eft_deposit before insert on CASH_JOURNAL_EFT_DEPOSIT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CASH_JOURNAL_ID || ''|'' || inserted.CUSTOMER_NUMBER;set v_text=v_text || ''|'' || inserted.EFT_IDENTIFIER;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,643,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_cash_journal_misc_receipt','CASH_JOURNAL_MISC_RECEIPT','B','I',1,'create trigger tr_bi_cash_journal_misc_receipt before insert on CASH_JOURNAL_MISC_RECEIPT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CASH_JOURNAL_ID || ''|'' || inserted.GL_CODE;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,645,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_cash_journal_other_deposit','CASH_JOURNAL_OTHER_DEPOSIT','B','I',1,'create trigger tr_bi_cash_journal_other_deposit before insert on CASH_JOURNAL_OTHER_DEPOSIT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CASH_JOURNAL_ID || ''|'' || inserted.REF_TENDER_TYPE_ID;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,641,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_cash_journal_over_short','CASH_JOURNAL_OVER_SHORT','B','I',1,'create trigger tr_bi_cash_journal_over_short before insert on CASH_JOURNAL_OVER_SHORT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CASH_JOURNAL_ID;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,644,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_cash_journal_paid_out','CASH_JOURNAL_PAID_OUT','B','I',1,'create trigger tr_bi_cash_journal_paid_out before insert on CASH_JOURNAL_PAID_OUT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CASH_JOURNAL_ID || ''|'' || inserted.GL_CODE;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,646,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_cash_journal_profile','CASH_JOURNAL_PROFILE','B','I',1,'create trigger tr_bi_cash_journal_profile before insert on CASH_JOURNAL_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LOC;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,473,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_cash_journal_roa','CASH_JOURNAL_ROA','B','I',1,'create trigger tr_bi_cash_journal_roa before insert on CASH_JOURNAL_ROA referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CASH_JOURNAL_ID || ''|'' || inserted.CUSTOMER_NUMBER;set v_text=v_text || ''|'' || inserted.PAYMENT_REFERENCE;call sp_log_file_insdel_activity(inserted.LOC,648,inserted.ID,null,null,v_text,''A'',null,null,1) end', 'tr_bi_cash_journal_roa_application','CASH_JOURNAL_ROA_APPLICATION','B','I',1,'create trigger tr_bi_cash_journal_roa_application before insert on CASH_JOURNAL_ROA_APPLICATION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CASH_JOURNAL_ROA_ID || ''|'' || inserted.INVOICE_NUMBER;call sp_log_file_insdel_activity(inserted.LOC,649,inserted.ID,null,null,v_text,''A'',null,null,1) end', 'tr_bi_certificate_state','CERTIFICATION_STATE','B','I',1,'create trigger tr_bi_certificate_state before insert on CERTIFICATION_STATE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.ref_state_cd || ''|'' || inserted.ref_country_cd;i_return_status=call sp_log_file_insdel_activity(1,675,inserted.certification_part_group_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_certification_part','CERTIFICATION_PART','B','I',1,'create trigger tr_bi_certification_part before insert on CERTIFICATION_PART referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,676,inserted.inventory_id,inserted.certification_part_group_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_certification_part_group','CERTIFICATION_PART_GROUP','B','I',1,'create trigger tr_bi_certification_part_group before insert on CERTIFICATION_PART_GROUP referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.certification_category || ''|'' || inserted.certification_group;i_return_status=call sp_log_file_insdel_activity(1,674,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_classification_order','CLASSIFICATION_ORDER','B','I',1,'create trigger tr_bi_classification_order before insert on CLASSIFICATION_ORDER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CLASSIFICATION_SESSION_ID || ''|'' || inserted.PO_NUMBER;set v_text=v_text || ''|'' || inserted.DATE_CREATED;i_return_status=call sp_log_file_insdel_activity(inserted.loc,537,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_classification_profile','CLASSIFICATION_PROFILE','B','I',1,'create trigger tr_bi_classification_profile before insert on CLASSIFICATION_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LOC;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,536,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_classification_return','CLASSIFICATION_RETURN','B','I',1,'create trigger tr_bi_classification_return before insert on CLASSIFICATION_RETURN referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CLASSIFICATION_SESSION_ID || ''|'' || inserted.DATE_CREATED;set v_text=v_text || ''|'' || inserted.RGN_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,548,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_classification_session','CLASSIFICATION_SESSION','B','I',1,'create trigger tr_bi_classification_session before insert on CLASSIFICATION_SESSION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.SESSION_CREATED_DATE || ''|'' || inserted.REF_CLASS_METHOD_ID;set v_text=v_text || ''|'' || inserted.REF_CLASS_TYPE_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,540,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_communication_access_number','COMMUNICATION_ACCESS_NUMBER','B','I',1,'create trigger tr_bi_communication_access_number before insert on COMMUNICATION_ACCESS_NUMBER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from communication_directory where id=inserted.communication_directory_id and loc=inserted.loc;set v_text=inserted.COMMUNICATION_DIRECTORY_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,469,inserted.id,null,null,v_text,''A'',v_last_modified_date,v_modified_by_employee_id,1);if i_return_status=-1 then update communication_directory set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.communication_directory_id and loc=inserted.loc end if end', 'tr_bi_communication_directory','COMMUNICATION_DIRECTORY','B','I',1,'create trigger tr_bi_communication_directory before insert on COMMUNICATION_DIRECTORY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_COMMUNICATION_TYPE_ID || ''|'' || inserted.PASSWORD;i_return_status=call sp_log_file_insdel_activity(inserted.loc,462,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if(MOD((select use_site_relationship_feed from store_profile where loc=inserted.loc),10)=1) and inserted.ref_communication_type_id=2 then insert into communication_directory_change_queue(id,communication_directory_id,loc,action) values(null,inserted.id,inserted.loc,''U'') end if;if(inserted.store_on_vpn is not null and inserted.ref_communication_type_id <> 2) then raiserror 18025 ''18025: tr_bi_communication_directory: communication_directory.store_on_vpn can not be set for non-interstore.'' end if;if(inserted.store_on_vpn is null and inserted.ref_communication_type_id=2) then raiserror 18025 ''18025: tr_bi_communication_directory: communication_directory.store_on_vpn must be either Y or N for interstore.'' end if;if(inserted.store_number is not null and inserted.ref_communication_type_id <> 2) then raiserror 18096 ''18096: tr_bi_communication_directory: communication_directory.store_number can not be set for non-interstore.'' end if;if(inserted.issc_search_sequence is not null and inserted.ref_communication_type_id <> 2) then raiserror 18097 ''18097: tr_bi_communication_directory: communication_directory.issc_search_sequence can not be set for non-interstore.'' end if end', 'tr_bi_company','COMPANY','B','I',1,'create trigger tr_bi_company before insert on COMPANY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.NAME;i_return_status=call sp_log_file_insdel_activity(inserted.MODIFIED_BY_EMPLOYEE_LOC,8,inserted.ID,null,null,v_text,''A'',inserted.DATE_MODIFIED,inserted.MODIFIED_BY_EMPLOYEE_ID,1);if i_return_status=-1 then set inserted.MODIFIED_BY_EMPLOYEE_ID=null;set inserted.DATE_MODIFIED=current timestamp end if end', 'tr_bi_core_bank_maintenance','CORE_BANK_MAINTENANCE','B','I',1,'create trigger tr_bi_core_bank_maintenance before insert on CORE_BANK_MAINTENANCE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PURCHASE_INVOICE_ID || ''|'' || inserted.PURCHASE_INVOICE_NUMBER;set v_text=v_text || ''|'' || inserted.PURCHASE_INVOICE_DATE || ''|'' || inserted.LINE_ABBREV;set v_text=v_text || ''|'' || inserted.PART_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,663,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_core_bank_profile','CORE_BANK_PROFILE','B','I',1,'create trigger tr_bi_core_bank_profile before insert on CORE_BANK_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LAST_WRITEOFF_DATE || ''|'' || inserted.WRITEOFF_START_MONTH;set v_text=v_text || ''|'' || inserted.WRITEOFF_START_DAY || ''|'' || inserted.WRITEOFF_END_MONTH;set v_text=v_text || ''|'' || inserted.WRITEOFF_END_DAY;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,664,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer','CUSTOMER','B','I',1,'create trigger tr_bi_customer before insert on CUSTOMER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CUSTOMER_NUM || ''|'' || inserted.ALPHA_KEY;set v_text=v_text || ''|'' || inserted.NAME || ''|'' || inserted.ADDRESS1;set v_text=v_text || ''|'' || inserted.PHONE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,68,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if((select send_customer_domain from store_profile)=''Y'') then insert into customer_change_queue(customer_id,loc,action,trigger_source) values(inserted.id,inserted.loc,''I'',''CUSTOMER'') end if end', 'tr_bi_customer_ar','CUSTOMER_AR','B','I',1,'create trigger tr_bi_customer_ar before insert on CUSTOMER_AR referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.AR_TERMS_ID || ''|'' || inserted.CREDIT_LIMIT;set v_text=v_text || ''|'' || inserted.CURRENT_BAL;i_return_status=call sp_log_file_insdel_activity(inserted.loc,71,inserted.customer_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if(((select send_customer_domain from store_profile)=''Y'') and(select count() from customer_change_queue where customer_id=inserted.CUSTOMER_ID and loc=inserted.loc and validation_cd=''T'' and action=''I'' and trigger_source=''CUSTOMER'')=0) then insert into customer_change_queue(customer_id,loc,action,trigger_source) values(inserted.customer_id,inserted.loc,''I'',''CUSTOMER_AR'') end if;if inserted.statement_customer_id is not null and inserted.statement_customer_id <> inserted.customer_id then if exists(select customer_id from customer_ar where customer_id=inserted.statement_customer_id and statement_customer_id is not null and statement_customer_id <> customer_id) then raiserror 18500 ''18500: tr_bi_customer_ar: STATEMENT_CUSTOMER_ID cannot reference a customer already assigned to another customer''''s statement.'' end if;if exists(select customer_id from customer_ar where statement_customer_id=inserted.customer_id and customer_id <> inserted.customer_id) then raiserror 18501 ''18501: tr_bi_customer_ar: STATEMENT_CUSTOMER_ID cannot be set when customer is referenced by other customers.'' end if end if end', 'tr_bi_customer_blanket_po','CUSTOMER_BLANKET_PO','B','I',1,'create trigger tr_bi_customer_blanket_po before insert on CUSTOMER_BLANKET_PO referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;if exists(select*from CUSTOMER_BLANKET_PO where CUSTOMER_ID=inserted.CUSTOMER_ID and BLANKET_PO_NUM=inserted.BLANKET_PO_NUM and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bi_customer_blanket_po: Duplicate value for UNIQUE index XAK1CUSTOMER_BLANKET_PO.'' end if;set v_text=inserted.CUSTOMER_ID || ''|'' || inserted.BLANKET_PO_NUM;set v_text=v_text || ''|'' || inserted.END_DATE || ''|'' || inserted.MAXIMUM_AMOUNT_ALLOWED;i_return_status=call sp_log_file_insdel_activity(inserted.loc,108,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_card_on_file','CUSTOMER_CARD_ON_FILE','B','I',1,'create trigger tr_bi_customer_card_on_file before insert on CUSTOMER_CARD_ON_FILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CUSTOMER_ID || ''|'' || inserted.CARD_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,81,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_certification','CUSTOMER_CERTIFICATION','B','I',1,'create trigger tr_bi_customer_certification before insert on CUSTOMER_CERTIFICATION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.certification_part_group_id || ''|'' || inserted.technician_name;set v_text=v_text || ''|'' || inserted.certificate_number || ''|'' || inserted.end_date;i_return_status=call sp_log_file_insdel_activity(inserted.loc,677,inserted.id,inserted.customer_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_comment','CUSTOMER_COMMENT','B','I',1,'create trigger tr_bi_customer_comment before insert on CUSTOMER_COMMENT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CUSTOMER_ID || ''|'' || inserted.TEXT;i_return_status=call sp_log_file_insdel_activity(inserted.loc,112,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_contact','CUSTOMER_CONTACT','B','I',1,'create trigger tr_bi_customer_contact before insert on CUSTOMER_CONTACT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CUSTOMER_ID || ''|'' || inserted.NAME;set v_text=v_text || ''|'' || inserted.ADDRESS1 || ''|'' || inserted.PHONE;set v_text=v_text || ''|'' || inserted.AUTHORIZED_BUYER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,124,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_custom_pricing','CUSTOMER_CUSTOM_PRICING','B','I',1,'create trigger tr_bi_customer_custom_pricing before insert on CUSTOMER_CUSTOM_PRICING referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CUSTOMER_ID || ''|'' || inserted.REF_PRICING_TYPE_CD;set v_text=v_text || ''|'' || inserted.LINE_ABBREV || ''|'' || inserted.STORE_GROUP_ID;set v_text=v_text || ''|'' || inserted.DEPARTMENT_ID || ''|'' || inserted.SUB_DEPARTMENT_ID;set v_text=v_text || ''|'' || inserted.GROUP_CODE || ''|'' || inserted.PART_PREFIX;set v_text=v_text || ''|'' || inserted.REF_CLASS_CD || ''|'' || inserted.STORE_DEPARTMENT_ID;set v_text=v_text || ''|'' || inserted.BEGIN_DATE || ''|'' || inserted.END_DATE;set v_text=v_text || ''|'' || inserted.REPORTABLE || ''|'' || inserted.REF_PRICE_SHEET_CD;set v_text=v_text || ''|'' || inserted.MARKUP_PERCENT || ''|'' || inserted.REF_CURRENCY_ROUNDING_CD;i_return_status=call sp_log_file_insdel_activity(inserted.loc,170,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.LINE_ABBREV is not null then if exists(select*from CUSTOMER_CUSTOM_PRICING where CUSTOMER_ID=inserted.CUSTOMER_ID and REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and LINE_ABBREV=inserted.LINE_ABBREV and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bi_customer_custom_pricing: Duplicate value for UNIQUE index XAK1CUSTOMER_CUSTOM_PRICING.'' end if else if exists(select*from CUSTOMER_CUSTOM_PRICING where CUSTOMER_ID=inserted.CUSTOMER_ID and REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bi_customer_custom_pricing: Duplicate value for UNIQUE index XAK1CUSTOMER_CUSTOM_PRICING.'' end if end if;if inserted.ref_price_sheet_cd is null then raiserror 18001 ''tr_bi_customer_custom_pricing: REF_PRICE_SHEET_CD cannot be NULL.'' end if;if inserted.markup_percent is null then raiserror 18001 ''tr_bi_customer_custom_pricing: MARKUP_PERCENT cannot be NULL.'' end if;if inserted.ref_currency_rounding_cd is null then raiserror 18001 ''tr_bi_customer_custom_pricing: REF_CURRENCY_ROUNDING_CD cannot be NULL.'' end if;if inserted.ref_pricing_type_cd=''R'' and inserted.reportable is null then raiserror 18001 ''tr_bi_customer_custom_pricing: REPORTABLE cannot be NULL.'' end if;if inserted.department_id is null and inserted.sub_department_id is not null then raiserror 18001 ''tr_bi_customer_custom_pricing: SUB_DEPARTMENT cannot exist without DEPARTMENT.'' end if end', 'tr_bi_customer_delivery','CUSTOMER_DELIVERY','B','I',1,'create trigger tr_bi_customer_delivery before insert on CUSTOMER_DELIVERY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DELIVERY_REF_OPTION_CD || ''|'' || inserted.DELIVERY_ROUTE_CD;set v_text=v_text || ''|'' || inserted.DELIVERY_PRIORITY_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,79,inserted.customer_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_fixed_pricing','CUSTOMER_FIXED_PRICING','B','I',1,'create trigger tr_bi_customer_fixed_pricing before insert on CUSTOMER_FIXED_PRICING referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;if exists(select*from CUSTOMER_FIXED_PRICING where CUSTOMER_ID=inserted.CUSTOMER_ID and LINE_ABBREV=inserted.LINE_ABBREV and PART_NUMBER=inserted.PART_NUMBER and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bi_customer_fixed_pricing: Duplicate value for UNIQUE index XAK1CUSTOMER_FIXED_PRICING.'' end if;set v_text=inserted.LINE_ABBREV || ''|'' || inserted.PART_NUMBER;set v_text=v_text || ''|'' || inserted.BEGIN_DATE || ''|'' || inserted.END_DATE;set v_text=v_text || ''|'' || inserted.PART_PRICE || ''|'' || inserted.REPORTABLE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,680,inserted.id,inserted.customer_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_note','CUSTOMER_NOTE','B','I',1,'create trigger tr_bi_customer_note before insert on CUSTOMER_NOTE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.TEXT || ''|'' || inserted.REF_NOTE_HANDLING_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,73,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_pricing_profile','CUSTOMER_PRICING_PROFILE','B','I',1,'create trigger tr_bi_customer_pricing_profile before insert on CUSTOMER_PRICING_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PRIORITY;i_return_status=call sp_log_file_insdel_activity(inserted.loc,169,inserted.customer_id,inserted.pricing_profile_id,inserted.ref_customer_pricing_profile_type_cd,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_pu_gp','CUSTOMER_PU_GP','B','I',1,'create trigger tr_bi_customer_pu_gp before insert on CUSTOMER_PU_GP referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CUSTOMER_ID || ''|'' || inserted.AMOUNT_BEGIN;set v_text=v_text || ''|'' || inserted.AMOUNT_END || ''|'' || inserted.PERCENT;i_return_status=call sp_log_file_insdel_activity(inserted.loc,110,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_sales','CUSTOMER_SALES','B','I',1,'create trigger tr_bi_customer_sales before insert on CUSTOMER_SALES referencing new as inserted for each row begin if exists(select*from CUSTOMER_SALES where CUSTOMER_ID=inserted.CUSTOMER_ID and YEAR_MONTH=inserted.YEAR_MONTH and REF_CUSTOMER_SALES_TYPE_CD=inserted.REF_CUSTOMER_SALES_TYPE_CD and ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ID <> inserted.ID) then raiserror 18147 ''tr_bi_customer_sales: Duplicate value for UNIQUE index XAK1CUSTOMER_SALES.'' end if end', 'tr_bi_customer_statement_address','CUSTOMER_STATEMENT_ADDRESS','B','I',1,'create trigger tr_bi_customer_statement_address before insert on CUSTOMER_STATEMENT_ADDRESS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.NAME;i_return_status=call sp_log_file_insdel_activity(inserted.loc,70,inserted.customer_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_to_customer_segment','CUSTOMER_TO_CUSTOMER_SEGMENT','B','I',1,'create trigger tr_bi_customer_to_customer_segment before insert on CUSTOMER_TO_CUSTOMER_SEGMENT referencing new as inserted for each row begin if inserted.effective_from_date > inserted.effective_to_date then raiserror 18255 ''tr_bi_customer_to_customer_segment: EFFECTIVE_TO_DATE cannot be earlier than EFFECTIVE_FROM_DATE.'' end if;delete from CUSTOMER_TO_CUSTOMER_SEGMENT where customer_number=inserted.customer_number and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and source_updated_ts <=inserted.source_updated_ts and id <> inserted.id;if exists(select*from CUSTOMER_TO_CUSTOMER_SEGMENT where customer_number=inserted.customer_number and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and source_updated_ts > inserted.source_updated_ts and id <> inserted.id) then raiserror 18250 ''tr_bi_customer_to_customer_segment: Newer record with conflicting criteria already exists.'' end if end', 'tr_bi_customer_to_item_pricing','CUSTOMER_TO_ITEM_PRICING','B','I',1,'create trigger tr_bi_customer_to_item_pricing before insert on CUSTOMER_TO_ITEM_PRICING referencing new as inserted for each row begin if(case when inserted.price_level is null then 0 else 1 end+case when inserted.ref_price_sheet_cd is null then 0 else 1 end+case when inserted.exact_price is null then 0 else 1 end) <> 1 then raiserror 18253 ''tr_bi_customer_to_item_pricing: Must have a value for exactly one of PRICE_LEVEL,REF_PRICE_SHEET_CD,and EXACT_PRICE(the others must be NULL).'' end if;if(case when inserted.ref_price_sheet_cd is null then 0 else 1 end+case when inserted.markup_percent is null then 0 else 1 end)=1 then raiserror 18254 ''tr_bi_customer_to_item_pricing: Either REF_PRICE_SHEET_CD and MARKUP_PERCENT both must have a value or neither must have a value.'' end if;if inserted.effective_from_date > inserted.effective_to_date then raiserror 18255 ''tr_bi_customer_to_item_pricing: EFFECTIVE_TO_DATE cannot be earlier than EFFECTIVE_FROM_DATE.'' end if;delete from CUSTOMER_TO_ITEM_PRICING where customer_number=inserted.customer_number and line_abbrev=inserted.line_abbrev and part_number=inserted.part_number and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and source_updated_ts <=inserted.source_updated_ts and id <> inserted.id;if exists(select*from CUSTOMER_TO_ITEM_PRICING where customer_number=inserted.customer_number and line_abbrev=inserted.line_abbrev and part_number=inserted.part_number and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and source_updated_ts > inserted.source_updated_ts and id <> inserted.id) then raiserror 18250 ''tr_bi_customer_to_item_pricing: Newer record with conflicting criteria already exists.'' end if end', 'tr_bi_customer_to_product_segment_pricing','CUSTOMER_TO_PRODUCT_SEGMENT_PRICING','B','I',1,'create trigger tr_bi_customer_to_product_segment_pricing before insert on CUSTOMER_TO_PRODUCT_SEGMENT_PRICING referencing new as inserted for each row begin if(case when inserted.line_abbrev is null then 0 else 1 end+case when inserted.product_category is null then 0 else 1 end) <> 1 then raiserror 18251 ''tr_bi_customer_to_product_segment_pricing: Must have a value for only one of LINE_ABBREV and PRODUCT_CATEGORY(the other must be NULL).'' end if;if inserted.line_abbrev is null and inserted.group_code is not null then raiserror 18252 ''tr_bi_customer_to_product_segment_pricing: Cannot have value for GROUP_CODE without a value for LINE_ABBREV.'' end if;if(case when inserted.price_level is null then 0 else 1 end+case when inserted.ref_price_sheet_cd is null then 0 else 1 end+case when inserted.exact_price is null then 0 else 1 end) <> 1 then raiserror 18253 ''tr_bi_customer_to_product_segment_pricing: Must have a value for exactly one of PRICE_LEVEL,REF_PRICE_SHEET_CD,and EXACT_PRICE(the others must be NULL).'' end if;if(case when inserted.ref_price_sheet_cd is null then 0 else 1 end+case when inserted.markup_percent is null then 0 else 1 end)=1 then raiserror 18254 ''tr_bi_customer_to_product_segment_pricing: Either REF_PRICE_SHEET_CD and MARKUP_PERCENT both must have a value or neither must have a value.'' end if;if inserted.effective_from_date > inserted.effective_to_date then raiserror 18255 ''tr_bi_customer_to_product_segment_pricing: EFFECTIVE_TO_DATE cannot be earlier than EFFECTIVE_FROM_DATE.'' end if;if inserted.line_abbrev is not null then delete from CUSTOMER_TO_PRODUCT_SEGMENT_PRICING where customer_number=inserted.customer_number and product_category is null and line_abbrev=inserted.line_abbrev and ISNULL(group_code,-1)=ISNULL(inserted.group_code,-1) and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and source_updated_ts <=inserted.source_updated_ts and id <> inserted.id;if exists(select*from CUSTOMER_TO_PRODUCT_SEGMENT_PRICING where customer_number=inserted.customer_number and product_category is null and line_abbrev=inserted.line_abbrev and ISNULL(group_code,-1)=ISNULL(inserted.group_code,-1) and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and source_updated_ts > inserted.source_updated_ts and id <> inserted.id) then raiserror 18250 ''tr_bi_customer_to_product_segment_pricing: Newer record with conflicting criteria already exists.'' end if else delete from CUSTOMER_TO_PRODUCT_SEGMENT_PRICING where customer_number=inserted.customer_number and product_category=inserted.product_category and line_abbrev is null and group_code is null and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and source_updated_ts <=inserted.source_updated_ts and id <> inserted.id;if exists(select*from CUSTOMER_TO_PRODUCT_SEGMENT_PRICING where customer_number=inserted.customer_number and product_category=inserted.product_category and line_abbrev is null and group_code is null and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and source_updated_ts > inserted.source_updated_ts and id <> inserted.id) then raiserror 18250 ''tr_bi_customer_to_product_segment_pricing: Newer record with conflicting criteria already exists.'' end if end if end', 'tr_bi_customer_tracking_code','CUSTOMER_TRACKING_CODE','B','I',1,'create trigger tr_bi_customer_tracking_code before insert on CUSTOMER_TRACKING_CODE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,183,inserted.customer_id,inserted.tracking_code_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_customer_user_defined_field','CUSTOMER_USER_DEFINED_FIELD','B','I',1,'create trigger tr_bi_customer_user_defined_field before insert on CUSTOMER_USER_DEFINED_FIELD referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.TEXT;i_return_status=call sp_log_file_insdel_activity(inserted.loc,227,inserted.customer_id,inserted.user_defined_field_name_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_daily_returns_audit','DAILY_RETURNS_AUDIT','B','I',1,'create trigger tr_bi_daily_returns_audit before insert on DAILY_RETURNS_AUDIT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_RGN_TYPE_ID || ''|'' || inserted.UNIQUE_BARCODE;set v_text=v_text || ''|'' || inserted.RETURN_QUANTITY;i_return_status=call sp_log_file_insdel_activity(inserted.loc,622,inserted.INVOICE_LINE_ITEM_INVOICE_ID,inserted.INVOICE_LINE_ITEM_SEQUENCE,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_data_review_report','DATA_REVIEW_REPORT','B','I',1,'create trigger tr_bi_data_review_report before insert on DATA_REVIEW_REPORT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REPORT_TITLE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,615,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_data_review_report_criteria','DATA_REVIEW_REPORT_CRITERIA','B','I',1,'create trigger tr_bi_data_review_report_criteria before insert on DATA_REVIEW_REPORT_CRITERIA referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DATA_REVIEW_REPORT_ID || ''|'' || inserted.REF_LOOKUP_COLUMN_ID;set v_text=v_text || ''|'' || inserted.REF_LOOKUP_OPERATOR_ID || ''|'' || inserted.OPERAND1;i_return_status=call sp_log_file_insdel_activity(inserted.loc,618,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_data_review_report_display','DATA_REVIEW_REPORT_DISPLAY','B','I',1,'create trigger tr_bi_data_review_report_display before insert on DATA_REVIEW_REPORT_DISPLAY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DATA_REVIEW_REPORT_ID || ''|'' || inserted.REF_LOOKUP_COLUMN_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,616,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_data_review_report_sort_option','DATA_REVIEW_REPORT_SORT_OPTION','B','I',1,'create trigger tr_bi_data_review_report_sort_option before insert on DATA_REVIEW_REPORT_SORT_OPTION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DATA_REVIEW_REPORT_ID || ''|'' || inserted.REF_LOOKUP_COLUMN_ID;set v_text=v_text || ''|'' || inserted.REF_LOOKUP_SORT_DIRECTION_ID || ''|'' || inserted.SORT_SEQUENCE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,617,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_dc_address','DC_ADDRESS','B','I',1,'create trigger tr_bi_dc_address before insert on DC_ADDRESS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DC_CITY || ''|'' || inserted.DC_PHONE_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,639,inserted.NAPA_ACCT_DC_CODE,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_delivery_priority','DELIVERY_PRIORITY','B','I',1,'create trigger tr_bi_delivery_priority before insert on DELIVERY_PRIORITY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.NUM_MINUTES_FOR_DELIVERY;i_return_status=call sp_log_file_insdel_activity(inserted.loc,77,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_delivery_route','DELIVERY_ROUTE','B','I',1,'create trigger tr_bi_delivery_route before insert on DELIVERY_ROUTE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.loc,82,null,null,inserted.cd,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_department','DEPARTMENT','B','I',1,'create trigger tr_bi_department before insert on DEPARTMENT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.loc,213,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_disbursements_profile','DISBURSEMENTS_PROFILE','B','I',1,'create trigger tr_bi_disbursements_profile before insert on DISBURSEMENTS_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,103,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_dollar_rounding','DOLLAR_ROUNDING','B','I',1,'create trigger tr_bi_dollar_rounding before insert on DOLLAR_ROUNDING referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.BEGIN_RANGE || ''|'' || inserted.END_RANGE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,307,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_electronic_invoicing_profile','ELECTRONIC_INVOICING_PROFILE','B','I',1,'create trigger tr_bi_electronic_invoicing_profile before insert on ELECTRONIC_INVOICING_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_ELECTRONIC_INVOICE_VENDOR_ID || ''|'' || inserted.NAME;set v_text=v_text || ''|'' || inserted.EMAIL;i_return_status=call sp_log_file_insdel_activity(1,687,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_employee','EMPLOYEE','B','I',1,'create trigger tr_bi_employee before insert on EMPLOYEE referencing new as inserted for each row begin declare new_id integer;declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LAST_NAME || ''|'' || inserted.FIRST_NAME;set v_text=v_text || ''|'' || inserted.EMPLOYEE_NUM;i_return_status=call sp_log_file_insdel_activity(inserted.loc,19,inserted.id,null,null,v_text,''A'',inserted.date_modified,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.date_modified=current timestamp end if;select sp_get_seq(''FW_USER'',inserted.loc) into new_id;insert into fw_user(id,loc,name) values(new_id,inserted.loc,inserted.employee_num || '' '' || inserted.last_name || '','' || inserted.first_name);set inserted.fw_user_id=new_id end', 'tr_bi_employee_clock','EMPLOYEE_CLOCK','B','I',1,'create trigger tr_bi_employee_clock before insert on EMPLOYEE_CLOCK referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.EMPLOYEE_ID || ''|'' || inserted.CLOCK_IN_DATE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,6,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_employee_comments','EMPLOYEE_COMMENTS','B','I',1,'create trigger tr_bi_employee_comments before insert on EMPLOYEE_COMMENTS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.EMPLOYEE_ID || ''|'' || inserted.TEXT;i_return_status=call sp_log_file_insdel_activity(inserted.loc,113,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_employee_non_worked_hours','EMPLOYEE_NON_WORKED_HOURS','B','I',1,'create trigger tr_bi_employee_non_worked_hours before insert on EMPLOYEE_NON_WORKED_HOURS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.EMPLOYEE_ID || ''|'' || inserted.ACTIVITY_DATE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,26,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_employee_security_answer','EMPLOYEE_SECURITY_ANSWER','B','I',1,'create trigger tr_bi_employee_security_answer before insert on EMPLOYEE_SECURITY_ANSWER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.EMPLOYEE_ID || ''|'' || inserted.SEQUENCE;set v_text=v_text || ''|'' || inserted.REF_EMPLOYEE_SECURITY_QUESTION_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,671,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_employee_training','EMPLOYEE_TRAINING','B','I',1,'create trigger tr_bi_employee_training before insert on EMPLOYEE_TRAINING referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.EMPLOYEE_ID || ''|'' || inserted.TRAINING_COURSE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,5,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_end_of_day_monitor','END_OF_DAY_MONITOR','B','I',1,'create trigger tr_bi_end_of_day_monitor before insert on END_OF_DAY_MONITOR referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,669,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_end_of_day_profile','END_OF_DAY_PROFILE','B','I',1,'create trigger tr_bi_end_of_day_profile before insert on END_OF_DAY_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LOC;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,96,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_end_of_month_profile','END_OF_MONTH_PROFILE','B','I',1,'create trigger tr_bi_end_of_month_profile before insert on END_OF_MONTH_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.SALES_MONTH_END_DATE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,474,inserted.REF_MONTH_OF_YEAR_ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_eod_task_details','EOD_TASK_DETAILS','B','I',1,'create trigger tr_bi_eod_task_details before insert on EOD_TASK_DETAILS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,614,inserted.ref_eod_task_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_factory_order_table','FACTORY_ORDER_TABLE','B','I',1,'create trigger tr_bi_factory_order_table before insert on FACTORY_ORDER_TABLE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.IDENTIFIER || ''|'' || inserted.NAPA_RESERVED;i_return_status=call sp_log_file_insdel_activity(inserted.loc,205,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_factory_order_table_part','FACTORY_ORDER_TABLE_PART','B','I',1,'create trigger tr_bi_factory_order_table_part before insert on FACTORY_ORDER_TABLE_PART referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.FACTORY_ORDER_TABLE_ID || ''|'' || inserted.LINE_ABBREV;set v_text=v_text || ''|'' || inserted.PART_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,208,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_factory_order_table_prefix','FACTORY_ORDER_TABLE_PREFIX','B','I',1,'create trigger tr_bi_factory_order_table_prefix before insert on FACTORY_ORDER_TABLE_PREFIX referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;if exists(select*from FACTORY_ORDER_TABLE_PREFIX where FACTORY_ORDER_TABLE_ID=inserted.FACTORY_ORDER_TABLE_ID and LINE_ABBREV=inserted.LINE_ABBREV and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ID <> inserted.ID) then raiserror 18147 ''tr_bi_factory_order_table_prefix: Duplicate value for UNIQUE index XAK1FACTORY_ORDER_TABLE_PREFIX.'' end if;set v_text=inserted.FACTORY_ORDER_TABLE_ID || ''|'' || inserted.LINE_ABBREV;set v_text=v_text || ''|'' || inserted.GROUP_CODE || ''|'' || inserted.PART_PREFIX;i_return_status=call sp_log_file_insdel_activity(inserted.loc,206,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_fulfillment','FULFILLMENT','B','I',1,'create trigger tr_bi_fulfillment before insert on FULFILLMENT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.SALES_ORDER_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,682,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_fulfillment_identifier','FULFILLMENT_IDENTIFIER','B','I',1,'create trigger tr_bi_fulfillment_identifier before insert on FULFILLMENT_IDENTIFIER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.FULFILLMENT_IDENTIFIER;i_return_status=call sp_log_file_insdel_activity(1,683,inserted.fulfillment_id,inserted.ref_fulfillment_identifier_type_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_fulfillment_item','FULFILLMENT_ITEM','B','I',1,'create trigger tr_bi_fulfillment_item before insert on FULFILLMENT_ITEM referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.FULFILLMENT_ID;i_return_status=call sp_log_file_insdel_activity(1,684,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_fulfillment_note','FULFILLMENT_NOTE','B','I',1,'create trigger tr_bi_fulfillment_note before insert on FULFILLMENT_NOTE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.FULFILLMENT_ID;i_return_status=call sp_log_file_insdel_activity(1,685,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_gl_code','GL_CODE','B','I',1,'create trigger tr_bi_gl_code before insert on GL_CODE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.GL_CODE_NUMBER || ''|'' || inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.loc,442,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_gl_code_ap_check','DISB_CHECK_GL_CODE','B','I',1,'create trigger tr_bi_gl_code_ap_check before insert on DISB_CHECK_GL_CODE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from disb_check where id=inserted.disb_check_id and loc=inserted.loc;set v_text=inserted.DISB_CHECK_ID || ''|'' || inserted.GL_CODE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,456,inserted.id,null,null,v_text,''A'',v_last_modified_date,v_modified_by_employee_id,1);if i_return_status=-1 then update disb_check set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.disb_check_id and loc=inserted.loc end if end', 'tr_bi_hazardous_materials','HAZARDOUS_MATERIALS','B','I',1,'create trigger tr_bi_hazardous_materials before insert on HAZARDOUS_MATERIALS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.SHIPPING_NAME;i_return_status=call sp_log_file_insdel_activity(inserted.loc,224,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_inventory','INVENTORY','B','I',1,'create trigger tr_bi_inventory before insert on INVENTORY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LINE_ABBREV || ''|'' || inserted.PART_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,133,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.department_id is null and inserted.sub_department_id is not null then raiserror 18023 ''tr_bi_inventory: SUB_DEPARTMENT cannot exist without DEPARTMENT.'' end if;if not exists(select id from product_line where product_line.loc=inserted.loc and product_line.line_abbrev=inserted.line_abbrev and not inserted.line_abbrev=any(select ref_reserved_line_cd from ref_reserved_line_country where ref_country_cd=(select ref_country_cd from store_profile where loc=inserted.loc))) then raiserror 18023 ''tr_bi_inventory: line_abbrev '' || inserted.line_abbrev || ''is reserved or does not exist.'' end if;if fn_stripped_part_number(inserted.expanded_part_number) <> inserted.part_number then raiserror 18023 ''tr_bi_inventory: expanded_part_number '' || inserted.expanded_part_number || '' does not match part_number '' || inserted.part_number || ''.'' end if end', 'tr_bi_inventory_adjustment_document','INVENTORY_ADJUSTMENT_DOCUMENT','B','I',1,'create trigger tr_bi_inventory_adjustment_document before insert on INVENTORY_ADJUSTMENT_DOCUMENT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DOCUMENT_NUMBER;call sp_log_file_insdel_activity(inserted.LOC,650,inserted.ID,null,null,v_text,''A'',null,null,1) end', 'tr_bi_inventory_adjustment_log','INVENTORY_ADJUSTMENT_LOG','B','I',1,'create trigger tr_bi_inventory_adjustment_log before insert on INVENTORY_ADJUSTMENT_LOG referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.INVENTORY_ADJUSTMENT_DOCUMENT_ID || ''|'' || inserted.LINE_ABBREV;set v_text=v_text || ''|'' || inserted.PART_NUMBER;call sp_log_file_insdel_activity(inserted.LOC,651,inserted.ID,null,null,v_text,''A'',null,null,1) end', 'tr_bi_inventory_misc_chg','INVENTORY_MISC_CHG','B','I',1,'create trigger tr_bi_inventory_misc_chg before insert on INVENTORY_MISC_CHG referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,159,inserted.inventory_id,inserted.misc_chg_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_inventory_note','INVENTORY_NOTE','B','I',1,'create trigger tr_bi_inventory_note before insert on INVENTORY_NOTE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.TEXT;i_return_status=call sp_log_file_insdel_activity(inserted.loc,134,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_inventory_profile','INVENTORY_PROFILE','B','I',1,'create trigger tr_bi_inventory_profile before insert on INVENTORY_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,225,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_inventory_promo','INVENTORY_PROMO','B','I',1,'create trigger tr_bi_inventory_promo before insert on INVENTORY_PROMO referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PRODUCT_LINE_ID || ''|'' || inserted.TEXT1;i_return_status=call sp_log_file_insdel_activity(inserted.loc,132,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_inventory_sales','INVENTORY_SALES','B','I',1,'create trigger tr_bi_inventory_sales before insert on INVENTORY_SALES referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.INVENTORY_ID || ''|'' || inserted.YEAR_MONTH;i_return_status=call sp_log_file_insdel_activity(inserted.loc,178,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_inventory_special_sale','INVENTORY_SPECIAL_SALE','B','I',1,'create trigger tr_bi_inventory_special_sale before insert on INVENTORY_SPECIAL_SALE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.INVENTORY_ID || ''|'' || inserted.CODE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,162,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_inventory_stock','INVENTORY_STOCK','B','I',1,'create trigger tr_bi_inventory_stock before insert on INVENTORY_STOCK referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=(select LINE_ABBREV || ''|'' || PART_NUMBER from INVENTORY where INVENTORY.ID=inserted.INVENTORY_ID and INVENTORY.LOC=inserted.LOC);i_return_status=call sp_log_file_insdel_activity(inserted.loc,127,inserted.inventory_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.minimum_stock_qty > 0 then set inserted.initial_stocking_date=current date end if end', 'tr_bi_inventory_stock_location','INVENTORY_STOCK_LOCATION','B','I',1,'create trigger tr_bi_inventory_stock_location before insert on INVENTORY_STOCK_LOCATION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.INVENTORY_ID || ''|'' || inserted.STOCK_LOCATION;set v_text=v_text || ''|'' || inserted.PLANOGRAM_REFERENCE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,177,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_inventory_user_defined_field','INVENTORY_USER_DEFINED_FIELD','B','I',1,'create trigger tr_bi_inventory_user_defined_field before insert on INVENTORY_USER_DEFINED_FIELD referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.TEXT;i_return_status=call sp_log_file_insdel_activity(inserted.loc,228,inserted.inventory_id,inserted.user_defined_field_name_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_invoice','INVOICE','B','I',1,'create trigger tr_bi_invoice before insert on INVOICE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.INVOICE_NUMBER || ''|'' || inserted.SALES_YEAR_MONTH;set v_text=v_text || ''|'' || inserted.ACCOUNTING_DAY;i_return_status=call sp_log_file_insdel_activity(inserted.loc,232,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if ISNULL(inserted.work_order_number,'''')='''' and ISNULL(inserted.asset_unit_number,'''') <> '''' or ISNULL(inserted.work_order_number,'''') <> '''' and ISNULL(inserted.asset_unit_number,'''')='''' then raiserror 18019 ''tr_bi_invoice: If work_order_number or asset_unit_number is populated,both must be.'' end if end', 'tr_bi_invoice_delivery','INVOICE_DELIVERY','B','I',1,'create trigger tr_bi_invoice_delivery before insert on INVOICE_DELIVERY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,284,inserted.invoice_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_invoice_delivery_exception','INVOICE_DELIVERY_EXCEPTION','B','I',1,'create trigger tr_bi_invoice_delivery_exception before insert on INVOICE_DELIVERY_EXCEPTION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=inserted.INVOICE_id and LOC=inserted.LOC;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.LOC,653,inserted.INVOICE_ID,null,null,v_text,''A'',v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,1);if i_return_status=-1 then update INVOICE set MODIFIED_BY_EMPLOYEE_ID=null,LAST_MODIFIED_DATE=current timestamp where id=inserted.INVOICE_id and LOC=inserted.LOC end if end', 'tr_bi_invoice_line_item','INVOICE_LINE_ITEM','B','I',1,'create trigger tr_bi_invoice_line_item before insert on INVOICE_LINE_ITEM referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LINE_ABBREV || ''|'' || inserted.PART_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,236,inserted.INVOICE_ID,inserted.SEQUENCE,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if not exists(select*from ref_unit_designator where cd=inserted.ref_unit_designator) then raiserror 19004 ''tr_bi_invoice_line_item: the ref_unit_designator specified is invalid.'' end if end', 'tr_bi_invoice_line_item_deposit','INVOICE_LINE_ITEM_DEPOSIT','B','I',1,'create trigger tr_bi_invoice_line_item_deposit before insert on INVOICE_LINE_ITEM_DEPOSIT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=inserted.INVOICE_id and LOC=inserted.LOC;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.LOC,654,inserted.INVOICE_ID,inserted.SEQUENCE,null,v_text,''A'',v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,1);if i_return_status=-1 then update INVOICE set MODIFIED_BY_EMPLOYEE_ID=null,LAST_MODIFIED_DATE=current timestamp where id=inserted.INVOICE_id and LOC=inserted.LOC end if end', 'tr_bi_invoice_line_item_return','INVOICE_LINE_ITEM_RETURN','B','I',1,'create trigger tr_bi_invoice_line_item_return before insert on INVOICE_LINE_ITEM_RETURN referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.INVOICE_ID || ''|'' || inserted.SEQUENCE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,655,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_invoice_message_profile','INVOICE_MESSAGE_PROFILE','B','I',1,'create trigger tr_bi_invoice_message_profile before insert on INVOICE_MESSAGE_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_DAY_OF_WEEK_ID;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,98,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_invoice_note','INVOICE_NOTE','B','I',1,'create trigger tr_bi_invoice_note before insert on INVOICE_NOTE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=inserted.INVOICE_id and LOC=inserted.LOC;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.LOC,656,inserted.INVOICE_ID,inserted.SEQUENCE,null,v_text,''A'',v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,1);if i_return_status=-1 then update INVOICE set MODIFIED_BY_EMPLOYEE_ID=null,LAST_MODIFIED_DATE=current timestamp where id=inserted.INVOICE_id and LOC=inserted.LOC end if end', 'tr_bi_invoice_payment','INVOICE_PAYMENT','B','I',1,'create trigger tr_bi_invoice_payment before insert on INVOICE_PAYMENT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_TENDER_TYPE_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,274,inserted.invoice_id,inserted.sequence,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_invoice_return','INVOICE_RETURN','B','I',1,'create trigger tr_bi_invoice_return before insert on INVOICE_RETURN referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.LOC,657,inserted.invoice_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_invoice_roa','INVOICE_ROA','B','I',1,'create trigger tr_bi_invoice_roa before insert on INVOICE_ROA referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=inserted.INVOICE_id and LOC=inserted.LOC;set v_text=inserted.INVOICE_ID || ''|'' || inserted.INVOICE_NUMBER_PAID;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,658,inserted.ID,null,null,v_text,''A'',v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,1);if i_return_status=-1 then update INVOICE set MODIFIED_BY_EMPLOYEE_ID=null,LAST_MODIFIED_DATE=current timestamp where id=inserted.INVOICE_id and LOC=inserted.LOC end if end', 'tr_bi_invoicing_profile','INVOICING_PROFILE','B','I',1,'create trigger tr_bi_invoicing_profile before insert on INVOICING_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,107,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_joei_preload','JOEI_PRELOAD','B','I',1,'create trigger tr_bi_joei_preload before insert on JOEI_PRELOAD referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LINE_ABBREV || ''|'' || inserted.PART_NUMBER;set v_text=v_text || ''|'' || inserted.CUSTOMER_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,460,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_min_max_profile','MIN_MAX_PROFILE','B','I',1,'create trigger tr_bi_min_max_profile before insert on MIN_MAX_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,355,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_min_max_session','MIN_MAX_SESSION','B','I',1,'create trigger tr_bi_min_max_session before insert on MIN_MAX_SESSION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.description;i_return_status=call sp_log_file_insdel_activity(inserted.loc,1,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_misc_chg','MISC_CHG','B','I',1,'create trigger tr_bi_misc_chg before insert on MISC_CHG referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_RESERVED_LINE_CD || ''|'' || inserted.CODE;set v_text=v_text || ''|'' || inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.loc,160,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_misc_chg_exempt','MISC_CHG_EXEMPT','B','I',1,'create trigger tr_bi_misc_chg_exempt before insert on MISC_CHG_EXEMPT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,161,inserted.customer_id,inserted.misc_chg_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_misc_chg_group_code','MISC_CHG_GROUP_CODE','B','I',1,'create trigger tr_bi_misc_chg_group_code before insert on MISC_CHG_GROUP_CODE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.loc,252,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_misc_chg_state_detail','MISC_CHG_STATE_DETAIL','B','I',1,'create trigger tr_bi_misc_chg_state_detail before insert on MISC_CHG_STATE_DETAIL referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;if exists(select*from MISC_CHG_STATE_DETAIL where MISC_CHG_ID=inserted.MISC_CHG_ID and ISNULL(REF_STATE_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_STATE_CD,REPLICATE(''Z'',30)) and ISNULL(REF_COUNTRY_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_COUNTRY_CD,REPLICATE(''Z'',30)) and ID <> inserted.ID) then raiserror 18147 ''tr_bi_misc_chg_state_detail: Duplicate value for UNIQUE index XAK1MISC_CHG_STATE_DETAIL.'' end if;set v_text=inserted.MISC_CHG_ID || ''|'' || inserted.REF_STATE_CD;set v_text=v_text || ''|'' || inserted.REF_COUNTRY_CD;i_return_status=call sp_log_file_insdel_activity(inserted.loc,254,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_modem','MODEM','B','I',1,'create trigger tr_bi_modem before insert on MODEM referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_DEVICE_CONNECTION_TYPE_ID || ''|'' || inserted.DESCRIPTION;set v_text=v_text || ''|'' || inserted.REF_MODEM_TYPE_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,317,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if(inserted.box_number is null and inserted.port_number is not null) or(inserted.box_number is not null and inserted.port_number is null) then raiserror 18048 ''tr_bi_modem: box_number and port_number must both have values or both be NULL.'' else if inserted.box_number is not null and inserted.port_number is not null then if exists(select*from printer where box_number=inserted.box_number and port_number=inserted.port_number union select*from modem where box_number=inserted.box_number and port_number=inserted.port_number) then raiserror 18048 ''tr_bi_modem: box_number/port_number is not unique.'' end if end if end if end', 'tr_bi_multistore_profile','MULTI_STORE_PROFILE','B','I',1,'create trigger tr_bi_multistore_profile before insert on MULTI_STORE_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.LOC,251,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_non_pool_rgn_class_returns','NON_POOL_RGN_CLASS_RETURNS','B','I',1,'create trigger tr_bi_non_pool_rgn_class_returns before insert on NON_POOL_RGN_CLASS_RETURNS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_HEADER_ID || ''|'' || inserted.CLASSIFICATION_RETURN_ITEM_ID;set v_text=v_text || ''|'' || inserted.RGN_CREDIT_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,627,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_non_pool_rgn_competitive_stocking_line_changeover','NON_POOL_RGN_COMPETITIVE_STOCKING_LINE_CHANGEOVER','B','I',1,'create trigger tr_bi_non_pool_rgn_competitive_stocking_line_changeover before insert on NON_POOL_RGN_COMPETITIVE_STOCKING_LINE_CHANGEOVER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_HEADER_ID || ''|'' || inserted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || inserted.INVENTORY_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,630,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_non_pool_rgn_dealer_customer_changeover','NON_POOL_RGN_DEALER_CUSTOMER_CHANGEOVER','B','I',1,'create trigger tr_bi_non_pool_rgn_dealer_customer_changeover before insert on NON_POOL_RGN_DEALER_CUSTOMER_CHANGEOVER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_HEADER_ID || ''|'' || inserted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || inserted.COST_OF_CREDIT || ''|'' || inserted.EXPECTED_CREDIT;i_return_status=call sp_log_file_insdel_activity(inserted.loc,628,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_non_pool_rgn_miscellaneous_return','NON_POOL_RGN_MISCELLANEOUS_RETURN','B','I',1,'create trigger tr_bi_non_pool_rgn_miscellaneous_return before insert on NON_POOL_RGN_MISCELLANEOUS_RETURN referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_HEADER_ID || ''|'' || inserted.RGN_CREDIT_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,629,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_non_pool_rgn_new_merchandise','NON_POOL_RGN_NEW_MERCHANDISE','B','I',1,'create trigger tr_bi_non_pool_rgn_new_merchandise before insert on NON_POOL_RGN_NEW_MERCHANDISE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_HEADER_ID || ''|'' || inserted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || inserted.INVENTORY_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,633,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_non_pool_rgn_osd','NON_POOL_RGN_OSD','B','I',1,'create trigger tr_bi_non_pool_rgn_osd before insert on NON_POOL_RGN_OSD referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_HEADER_ID || ''|'' || inserted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || inserted.INVENTORY_ID || ''|'' || inserted.REF_OSD_TYPE_ID;set v_text=v_text || ''|'' || inserted.REF_OSD_CD;i_return_status=call sp_log_file_insdel_activity(inserted.loc,632,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_non_pool_rgn_repair_return','NON_POOL_RGN_REPAIR_RETURN','B','I',1,'create trigger tr_bi_non_pool_rgn_repair_return before insert on NON_POOL_RGN_REPAIR_RETURN referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_HEADER_ID || ''|'' || inserted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || inserted.INVENTORY_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,631,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_non_pool_rgn_reportable_sales','NON_POOL_RGN_REPORTABLE_SALES','B','I',1,'create trigger tr_bi_non_pool_rgn_reportable_sales before insert on NON_POOL_RGN_REPORTABLE_SALES referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_HEADER_ID || ''|'' || inserted.SALES_YEAR_MONTH;set v_text=v_text || ''|'' || inserted.REPORTABLE_SALES_CONTROL_SERIAL_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,626,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_order_criteria_class','ORDER_CRITERIA_CLASS','B','I',1,'create trigger tr_bi_order_criteria_class before insert on ORDER_CRITERIA_CLASS referencing new as inserted for each row begin if exists(select*from ORDER_CRITERIA_CLASS where ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ORDER_HEADER_ID=inserted.ORDER_HEADER_ID and ID <> inserted.ID) then raiserror 18147 ''tr_bi_order_criteria_class: Duplicate value for UNIQUE index XAK1ORDER_CRITERIA_CLASS.'' end if end', 'tr_bi_order_group','ORDER_GROUP','B','I',1,'create trigger tr_bi_order_group before insert on ORDER_GROUP referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_ORDER_TYPE_CD || ''|'' || inserted.NUMBER;set v_text=v_text || ''|'' || inserted.ALIAS || ''|'' || inserted.VENDOR_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,144,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_order_group_class','ORDER_GROUP_CLASS','B','I',1,'create trigger tr_bi_order_group_class before insert on ORDER_GROUP_CLASS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=inserted.order_group_id and loc=inserted.loc;set v_text=inserted.ORDER_GROUP_ID || ''|'' || inserted.REF_CLASS_CD;i_return_status=call sp_log_file_insdel_activity(inserted.loc,145,inserted.id,null,null,v_text,''A'',v_last_modified_date,v_modified_by_employee_id,1);if i_return_status=-1 then update order_group set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.order_group_id and loc=inserted.loc end if end', 'tr_bi_order_group_part','ORDER_GROUP_PART','B','I',1,'create trigger tr_bi_order_group_part before insert on ORDER_GROUP_PART referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=inserted.order_group_id and loc=inserted.loc;set v_text=inserted.ORDER_GROUP_ID || ''|'' || inserted.LINE_ABBREV;set v_text=v_text || ''|'' || inserted.PART_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,148,inserted.id,null,null,v_text,''A'',v_last_modified_date,v_modified_by_employee_id,1);if i_return_status=-1 then update order_group set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.order_group_id and loc=inserted.loc end if end', 'tr_bi_order_group_prefix','ORDER_GROUP_PREFIX','B','I',1,'create trigger tr_bi_order_group_prefix before insert on ORDER_GROUP_PREFIX referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=inserted.order_group_id and loc=inserted.loc;if exists(select*from ORDER_GROUP_PREFIX where ISNULL(PART_NUMBER_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_NUMBER_PREFIX,REPLICATE(''Z'',30)) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ORDER_GROUP_ID=inserted.ORDER_GROUP_ID and ID <> inserted.ID) then raiserror 18147 ''tr_bi_order_group_prefix: Duplicate value for UNIQUE index XAK1ORDER_GROUP_PREFIX.'' end if;set v_text=inserted.ORDER_GROUP_ID || ''|'' || inserted.LINE_ABBREV;set v_text=v_text || ''|'' || inserted.GROUP_CODE || ''|'' || inserted.PART_NUMBER_PREFIX;i_return_status=call sp_log_file_insdel_activity(inserted.loc,147,inserted.id,null,null,v_text,''A'',v_last_modified_date,v_modified_by_employee_id,1);if i_return_status=-1 then update order_group set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.order_group_id and loc=inserted.loc end if end', 'tr_bi_order_group_store','ORDER_GROUP_STORE','B','I',1,'create trigger tr_bi_order_group_store before insert on ORDER_GROUP_STORE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=inserted.order_group_id and loc=inserted.loc;set v_text=inserted.ORDER_GROUP_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,229,inserted.id,null,null,v_text,''A'',v_last_modified_date,v_modified_by_employee_id,1);if i_return_status=-1 then update order_group set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.order_group_id and loc=inserted.loc end if end', 'tr_bi_order_group_supplier','ORDER_GROUP_SUPPLIER','B','I',1,'create trigger tr_bi_order_group_supplier before insert on ORDER_GROUP_SUPPLIER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=inserted.order_group_id and loc=inserted.loc;set v_text=inserted.ORDER_GROUP_ID || ''|'' || inserted.SUPPLIER_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,146,inserted.id,null,null,v_text,''A'',v_last_modified_date,v_modified_by_employee_id,1);if i_return_status=-1 then update order_group set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.order_group_id and loc=inserted.loc end if end', 'tr_bi_order_handling','ORDER_HANDLING','B','I',1,'create trigger tr_bi_order_handling before insert on ORDER_HANDLING referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,164,null,null,inserted.CD,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_order_header','ORDER_HEADER','B','I',1,'create trigger tr_bi_order_header before insert on ORDER_HEADER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_ORDER_TYPE_CD || ''|'' || inserted.PURCHASE_ORDER_NUMBER;set v_text=v_text || ''|'' || inserted.CREATION_DATE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,153,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_pay_period_profile','PAY_PERIOD_PROFILE','B','I',1,'create trigger tr_bi_pay_period_profile before insert on PAY_PERIOD_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PROFILE_NAME;i_return_status=call sp_log_file_insdel_activity(inserted.loc,41,inserted.id,null,null,v_text,''A'',inserted.date_modified,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.date_modified=current timestamp end if end', 'tr_bi_pay_period_profile_activity','PAY_PERIOD_PROFILE_ACTIVITY','B','I',1,'create trigger tr_bi_pay_period_profile_activity before insert on PAY_PERIOD_PROFILE_ACTIVITY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_date_modified timestamp;declare v_modified_by_employee_id integer;select date_modified,modified_by_employee_id into v_date_modified,v_modified_by_employee_id from pay_period_profile where id=inserted.pay_period_profile_id and loc=inserted.loc;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,201,inserted.pay_period_profile_id,inserted.ref_activity_type_id,null,v_text,''A'',v_date_modified,v_modified_by_employee_id,1);if i_return_status=-1 then update pay_period_profile set modified_by_employee_id=null,date_modified=current timestamp where id=inserted.pay_period_profile_id and loc=inserted.loc end if end', 'tr_bi_penny_rounding','PENNY_ROUNDING','B','I',1,'create trigger tr_bi_penny_rounding before insert on PENNY_ROUNDING referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.BEGIN_RANGE || ''|'' || inserted.END_RANGE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,100,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_phone_room_group','PHONE_ROOM_GROUP','B','I',1,'create trigger tr_bi_phone_room_group before insert on PHONE_ROOM_GROUP referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.NAME;i_return_status=call sp_log_file_insdel_activity(inserted.loc,666,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_phone_room_profile','PHONE_ROOM_PROFILE','B','I',1,'create trigger tr_bi_phone_room_profile before insert on PHONE_ROOM_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,688,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_phone_room_store','PHONE_ROOM_STORE','B','I',1,'create trigger tr_bi_phone_room_store before insert on PHONE_ROOM_STORE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;if exists(select*from PHONE_ROOM_STORE where PHONE_ROOM_GROUP_ID=inserted.PHONE_ROOM_GROUP_ID and ISNULL(COMMUNICATION_DIRECTORY_ID,-1)=ISNULL(inserted.COMMUNICATION_DIRECTORY_ID,-1) and ID <> inserted.ID) then raiserror 18147 ''tr_bi_phone_room_store: Duplicate value for UNIQUE index XAK1PHONE_ROOM_STORE.'' end if;set v_text=inserted.PHONE_ROOM_GROUP_ID || ''|'' || inserted.COMMUNICATION_DIRECTORY_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,667,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_physical_inventory_excluded_product_line','PHYSICAL_INVENTORY_EXCLUDED_PRODUCT_LINE','B','I',1,'create trigger tr_bi_physical_inventory_excluded_product_line before insert on PHYSICAL_INVENTORY_EXCLUDED_PRODUCT_LINE referencing new as inserted for each row begin if not exists(select id from product_line where product_line.loc=inserted.loc and product_line.group_code=0 and product_line.line_abbrev=(select line_abbrev from product_line where product_line.loc=inserted.loc and product_line.id=inserted.product_line_id)) then raiserror 18023 ''tr_bi_physical_inventory_excluded_product_line: product_line_id '' || inserted.product_line_id || '' does not contain group code 0.'' end if end', 'tr_bi_physical_inventory_location','PHYSICAL_INVENTORY_LOCATION','B','I',1,'create trigger tr_bi_physical_inventory_location before insert on PHYSICAL_INVENTORY_LOCATION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PHYSICAL_INVENTORY_PART_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,315,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_po_check_in','PO_CHECK_IN','B','I',1,'create trigger tr_bi_po_check_in before insert on PO_CHECK_IN referencing new as inserted for each row begin if exists(select*from PO_CHECK_IN where PO_HEADER_ID=inserted.PO_HEADER_ID and ISNULL(SHIPMENT_NUMBER,-1)=ISNULL(inserted.SHIPMENT_NUMBER,-1) and ID <> inserted.ID) then raiserror 18147 ''tr_bi_po_check_in: Duplicate value for UNIQUE index XAK1PO_CHECK_IN.'' end if end', 'tr_bi_po_header','PO_HEADER','B','I',1,'create trigger tr_bi_po_header before insert on PO_HEADER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_ORDER_TYPE_CD || ''|'' || inserted.PURCHASE_ORDER_NUMBER;set v_text=v_text || ''|'' || inserted.CREATION_DATE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,152,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_po_item','PO_ITEM','B','I',1,'create trigger tr_bi_po_item before insert on PO_ITEM referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PO_HEADER_ID || ''|'' || inserted.LINE_ABBREV;set v_text=v_text || ''|'' || inserted.PART_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,151,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_po_item_store','PO_ITEM_STORE','B','I',1,'create trigger tr_bi_po_item_store before insert on PO_ITEM_STORE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;if exists(select*from PO_ITEM_STORE where PO_ITEM_ID=inserted.PO_ITEM_ID and ORDER_FOR_STORE_NUMBER=inserted.ORDER_FOR_STORE_NUMBER and ISNULL(PURCHASE_ORDER_NUMBER,REPLICATE(''Z'',30))=ISNULL(inserted.PURCHASE_ORDER_NUMBER,REPLICATE(''Z'',30)) and ID <> inserted.ID) then raiserror 18147 ''tr_bi_po_item_store: Duplicate value for UNIQUE index XAK1PO_ITEM_STORE.'' end if;set v_text=inserted.PO_ITEM_ID || ''|'' || inserted.ORDER_FOR_STORE_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,230,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_po_note','PO_NOTE','B','I',1,'create trigger tr_bi_po_note before insert on PO_NOTE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PO_HEADER_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,686,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_po_shipping_address','PO_SHIPPING_ADDRESS','B','I',1,'create trigger tr_bi_po_shipping_address before insert on PO_SHIPPING_ADDRESS referencing new as inserted for each row begin if inserted.SHIP_TO_STORE_NUMBER is null then if inserted.ADDRESS1 is null then raiserror 18001 ''tr_bi_po_shipping_address: ADDRESS1 cannot be null when SHIP_TO_STORE_NUMBER is NULL'' end if;if inserted.REF_STATE_CD is null then raiserror 18001 ''tr_bi_po_shipping_address: REF_STATE_CD cannot be null when SHIP_TO_STORE_NUMBER is NULL'' end if;if inserted.CITY is null then raiserror 18001 ''tr_bi_po_shipping_address: CITY cannot be null when SHIP_TO_STORE_NUMBER is NULL'' end if;if inserted.REF_COUNTRY_CD is null then raiserror 18001 ''tr_bi_po_shipping_address: REF_COUNTRY_CD cannot be null when SHIP_TO_STORE_NUMBER is NULL'' end if;if inserted.POSTAL_CODE is null then raiserror 18001 ''tr_bi_po_shipping_address: POSTAL_CODE cannot be null when SHIP_TO_STORE_NUMBER is NULL'' end if end if end', 'tr_bi_price_factor','PRICE_FACTOR','B','I',1,'create trigger tr_bi_price_factor before insert on PRICE_FACTOR referencing new as inserted for each row begin if exists(select*from PRICE_FACTOR where ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_NUMBER_OR_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_NUMBER_OR_PREFIX,REPLICATE(''Z'',30)) and PART_OR_PREFIX_FLAG=inserted.PART_OR_PREFIX_FLAG and SHEET_CODE=inserted.SHEET_CODE) then raiserror 18147 ''tr_bi_price_factor: Duplicate value for UNIQUE index XAK1PRICE_FACTOR.'' end if end', 'tr_bi_pricing_profile','PRICING_PROFILE','B','I',1,'create trigger tr_bi_pricing_profile before insert on PRICING_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION || ''|'' || inserted.USUAL_REF_PRICE_SHEET_CD;set v_text=v_text || ''|'' || inserted.USUAL_PRICE_MARKUP_PERCENT || ''|'' || inserted.USUAL_PRICE_REF_CURRENCY_ROUNDING_CD;i_return_status=call sp_log_file_insdel_activity(inserted.loc,168,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_pricing_profile_detail','PRICING_PROFILE_DETAIL','B','I',1,'create trigger tr_bi_pricing_profile_detail before insert on PRICING_PROFILE_DETAIL referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PRICING_PROFILE_ID || ''|'' || inserted.REF_PRICING_TYPE_CD;set v_text=v_text || ''|'' || inserted.LINE_ABBREV || ''|'' || inserted.STORE_GROUP_ID;set v_text=v_text || ''|'' || inserted.DEPARTMENT_ID || ''|'' || inserted.SUB_DEPARTMENT_ID;set v_text=v_text || ''|'' || inserted.GROUP_CODE || ''|'' || inserted.PART_PREFIX;set v_text=v_text || ''|'' || inserted.REF_CLASS_CD || ''|'' || inserted.STORE_DEPARTMENT_ID;set v_text=v_text || ''|'' || inserted.BEGIN_DATE || ''|'' || inserted.END_DATE;set v_text=v_text || ''|'' || inserted.REPORTABLE || ''|'' || inserted.REF_PRICE_SHEET_CD;set v_text=v_text || ''|'' || inserted.MARKUP_PERCENT || ''|'' || inserted.REF_CURRENCY_ROUNDING_CD;i_return_status=call sp_log_file_insdel_activity(inserted.loc,92,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.LINE_ABBREV is not null then if exists(select*from PRICING_PROFILE_DETAIL where PRICING_PROFILE_ID=inserted.PRICING_PROFILE_ID and REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and LINE_ABBREV=inserted.LINE_ABBREV and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bi_pricing_profile_detail: Duplicate value for UNIQUE index XAK1PRICING_PROFILE_DETAIL.'' end if else if exists(select*from PRICING_PROFILE_DETAIL where PRICING_PROFILE_ID=inserted.PRICING_PROFILE_ID and REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bi_pricing_profile_detail: Duplicate value for UNIQUE index XAK1PRICING_PROFILE_DETAIL.'' end if end if;if inserted.ref_price_sheet_cd is null then raiserror 18001 ''tr_bi_pricing_profile_detail: REF_PRICE_SHEET_CD cannot be NULL.'' end if;if inserted.markup_percent is null then raiserror 18001 ''tr_bi_pricing_profile_detail: MARKUP_PERCENT cannot be NULL.'' end if;if inserted.ref_currency_rounding_cd is null then raiserror 18001 ''tr_bi_pricing_profile_detail: REF_CURRENCY_ROUNDING_CD cannot be NULL.'' end if;if inserted.ref_pricing_type_cd=''R'' and inserted.reportable is null then raiserror 18001 ''tr_bi_pricing_profile_detail: REPORTABLE cannot be NULL.'' end if;if inserted.department_id is null and inserted.sub_department_id is not null then raiserror 18001 ''tr_bi_pricing_profile_detail: SUB_DEPARTMENT cannot exist without DEPARTMENT.'' end if end', 'tr_bi_pricing_profile_fixed_detail','PRICING_PROFILE_FIXED_DETAIL','B','I',1,'create trigger tr_bi_pricing_profile_fixed_detail before insert on PRICING_PROFILE_FIXED_DETAIL referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;if exists(select*from PRICING_PROFILE_FIXED_DETAIL where PRICING_PROFILE_ID=inserted.PRICING_PROFILE_ID and LINE_ABBREV=inserted.LINE_ABBREV and PART_NUMBER=inserted.PART_NUMBER and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bi_pricing_profile_fixed_detail: Duplicate value for UNIQUE index XAK1PRICING_PROFILE_FIXED_DETAIL.'' end if;set v_text=inserted.LINE_ABBREV || ''|'' || inserted.PART_NUMBER;set v_text=v_text || ''|'' || inserted.BEGIN_DATE || ''|'' || inserted.END_DATE;set v_text=v_text || ''|'' || inserted.PART_PRICE || ''|'' || inserted.REPORTABLE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,679,inserted.id,inserted.pricing_profile_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_printer','PRINTER','B','I',1,'create trigger tr_bi_printer before insert on PRINTER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_DEVICE_CONNECTION_TYPE_ID || ''|'' || inserted.DESCRIPTION;set v_text=v_text || ''|'' || inserted.REF_PRINTER_MODEL_ID || ''|'' || inserted.PRINTER_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,318,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if(inserted.box_number is null and inserted.port_number is not null) or(inserted.box_number is not null and inserted.port_number is null) then raiserror 18047 ''tr_bi_printer: box_number and port_number must both have values or both be NULL.'' else if inserted.box_number is not null and inserted.port_number is not null then if exists(select*from printer where box_number=inserted.box_number and port_number=inserted.port_number union select*from modem where box_number=inserted.box_number and port_number=inserted.port_number) then raiserror 18047 ''tr_bi_printer: box_number/port_number is not unique.'' end if end if end if end', 'tr_bi_pro_rata_warranty','PRO_RATA_WARRANTY','B','I',1,'create trigger tr_bi_pro_rata_warranty before insert on PRO_RATA_WARRANTY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.line_abbrev || ''|'' || inserted.part_number;set v_text=v_text || ''|'' || inserted.purchase_begin_date || ''|'' || inserted.purchase_end_date;i_return_status=call sp_log_file_insdel_activity(inserted.loc,672,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_product_line','PRODUCT_LINE','B','I',1,'create trigger tr_bi_product_line before insert on PRODUCT_LINE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LINE_ABBREV || ''|'' || inserted.GROUP_CODE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,128,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_product_line_out_of_class','PRODUCT_LINE_OUT_OF_CLASS','B','I',1,'create trigger tr_bi_product_line_out_of_class before insert on PRODUCT_LINE_OUT_OF_CLASS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PRODUCT_LINE_ID || ''|'' || inserted.REF_CLASS_CD;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,136,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_product_line_rebate','PRODUCT_LINE_REBATE','B','I',1,'create trigger tr_bi_product_line_rebate before insert on PRODUCT_LINE_REBATE referencing new as inserted for each row begin if(inserted.rebate_entry_1 is null and inserted.max_gp_entry_1 is not null) or(inserted.rebate_entry_2 is null and inserted.max_gp_entry_2 is not null) or(inserted.rebate_entry_3 is null and inserted.max_gp_entry_3 is not null) then raiserror 18017 ''18017: tr_bu_product_line_rebate: max_gp_entry can not be set when matching rebate_entry is NULL'' end if end', 'tr_bi_product_line_sales','PRODUCT_LINE_SALES','B','I',1,'create trigger tr_bi_product_line_sales before insert on PRODUCT_LINE_SALES referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PRODUCT_LINE_ID || ''|'' || inserted.YEAR_MONTH;i_return_status=call sp_log_file_insdel_activity(inserted.loc,174,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_protobase_prior_authorizations','PROTOBASE_PRIOR_AUTHORIZATION','B','I',1,'create trigger tr_bi_protobase_prior_authorizations before insert on PROTOBASE_PRIOR_AUTHORIZATION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CARD_NUMBER || ''|'' || inserted.INVOICE_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,613,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_purchase_card','STORE_PURCHASE_CARD','B','I',1,'create trigger tr_bi_purchase_card before insert on STORE_PURCHASE_CARD referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PURCHASE_CARD_NUMBER || ''|'' || inserted.CARD_EXPIRATION_DATE;set v_text=v_text || ''|'' || inserted.CARDHOLDER_NAME;i_return_status=call sp_log_file_insdel_activity(inserted.loc,450,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_purge_type_profile','PURGE_TYPE_PROFILE','B','I',1,'create trigger tr_bi_purge_type_profile before insert on PURGE_TYPE_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.PURGE_DATA || ''|'' || inserted.KEEP_DATA_DURATION;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,662,inserted.REF_PURGE_TYPE_ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_rads_profile','RADS_PROFILE','B','I',1,'create trigger tr_bi_rads_profile before insert on RADS_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,670,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_ref_file_activity_purge_profile','REF_FILE_ACTIVITY_PURGE_PROFILE','B','I',1,'create trigger tr_bi_ref_file_activity_purge_profile before insert on REF_FILE_ACTIVITY_PURGE_PROFILE referencing new as inserted for each row begin if exists(select*from REF_FILE_ACTIVITY_PURGE_PROFILE where ISNULL(REF_FILE_ACTIVITY_ACTION_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_FILE_ACTIVITY_ACTION_CD,REPLICATE(''Z'',30)) and ISNULL(REF_FILE_ACTIVITY_TABLE_NAME_ID,-1)=ISNULL(inserted.REF_FILE_ACTIVITY_TABLE_NAME_ID,-1) and ISNULL(REF_FILE_ACTIVITY_COLUMN_NAME_ID,-1)=ISNULL(inserted.REF_FILE_ACTIVITY_COLUMN_NAME_ID,-1) and ID <> inserted.ID) then raiserror 18147 ''tr_bi_ref_file_activity_purge_profile: Duplicate value for UNIQUE index XAK1REF_FILE_ACTIVITY_PURGE_PROFILE.'' end if end', 'tr_bi_ref_store_configuration','REF_STORE_CONFIGURATION','B','I',1,'create trigger tr_bi_ref_store_configuration before insert on REF_STORE_CONFIGURATION referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';call sp_log_file_insdel_activity(1,689,inserted.id,null,null,v_text,''A'',null,null,1) end', 'tr_bi_remote_system_profile','REMOTE_SYSTEM_PROFILE','B','I',1,'create trigger tr_bi_remote_system_profile before insert on REMOTE_SYSTEM_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(1,678,inserted.REF_REMOTE_SYSTEM_ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_report_answer','REPORT_ANSWER','B','I',1,'create trigger tr_bi_report_answer before insert on REPORT_ANSWER referencing new as inserted for each row begin if inserted.answer is null then if inserted.answer_type <> ''S'' then raiserror 18087 ''tr_bi_report_answer: NULL answers must be Single answer_type.'' end if;if inserted.data_type=''B'' then raiserror 18087 ''tr_bi_report_answer: NULL not allowed for Boolean data_type.'' end if end if;if inserted.answer is not null then if inserted.data_type=''N'' and PATINDEX(''%[^0-9.|-]%'',inserted.answer) <> 0 then raiserror 18087 ''tr_bi_report_answer: non-numeric character in numeric answer: '' || inserted.answer end if;if inserted.data_type=''B'' and inserted.answer not in(''Y'',''N'') then raiserror 18087 ''tr_bi_report_answer: Boolean data_type must by Y/N : '' || inserted.answer end if;if inserted.answer_type=''R'' then if CHARINDEX(''|'',inserted.answer)=0 or PATINDEX(''%|%|%'',inserted.answer) <> 0 then raiserror 18087 ''tr_bi_report_answer: Range answer_type must have exactly two elements: '' || inserted.answer end if end if end if end', 'tr_bi_report_criteria','REPORT_CRITERIA','B','I',1,'create trigger tr_bi_report_criteria before insert on REPORT_CRITERIA referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;if exists(select*from REPORT_CRITERIA where ISNULL(EMPLOYEE_ID,-1)=ISNULL(inserted.EMPLOYEE_ID,-1) and REF_REPORT_TIMEFRAME_ID=inserted.REF_REPORT_TIMEFRAME_ID and REF_REPORT_ID=inserted.REF_REPORT_ID and ID <> inserted.ID) then raiserror 18147 ''tr_bi_report_criteria: Duplicate value for UNIQUE index XAK1REPORT_CRITERIA.'' end if;set v_text=inserted.REF_REPORT_ID || ''|'' || inserted.REF_REPORT_TIMEFRAME_ID;set v_text=v_text || ''|'' || inserted.EMPLOYEE_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,419,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_report_schedule','REPORT_SCHEDULE','B','I',1,'create trigger tr_bi_report_schedule before insert on REPORT_SCHEDULE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_REPORT_PAPER_SIZE_ID || ''|'' || inserted.REF_REPORT_ID;set v_text=v_text || ''|'' || inserted.EMPLOYEE_ID || ''|'' || inserted.SCHEDULED_RUN_DATE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,415,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_returned_check','RETURNED_CHECK','B','I',1,'create trigger tr_bi_returned_check before insert on RETURNED_CHECK referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.NAME_ON_CHECK || ''|'' || inserted.CHECK_NUMBER;set v_text=v_text || ''|'' || inserted.CHECK_DATE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,367,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_rgn_credit','RGN_CREDIT','B','I',1,'create trigger tr_bi_rgn_credit before insert on RGN_CREDIT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.CREDIT_RECEIVED || ''|'' || inserted.EXPENSE_AMOUNT;i_return_status=call sp_log_file_insdel_activity(inserted.loc,635,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_rgn_credit_audit','RGN_CREDIT_AUDIT','B','I',1,'create trigger tr_bi_rgn_credit_audit before insert on RGN_CREDIT_AUDIT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_CREDIT_ID || ''|'' || inserted.REF_CREDIT_TYPE_ID;set v_text=v_text || ''|'' || inserted.AMOUNT_APPLIED;i_return_status=call sp_log_file_insdel_activity(inserted.loc,636,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_rgn_header','RGN_HEADER','B','I',1,'create trigger tr_bi_rgn_header before insert on RGN_HEADER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_NUMBER || ''|'' || inserted.TOTAL_RGN_AMOUNT;set v_text=v_text || ''|'' || inserted.CREATION_DATE;i_return_status=call sp_log_file_insdel_activity(inserted.loc,624,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_rgn_item_from_pool','RGN_ITEM_FROM_POOL','B','I',1,'create trigger tr_bi_rgn_item_from_pool before insert on RGN_ITEM_FROM_POOL referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.RGN_HEADER_ID || ''|'' || inserted.RGN_CREDIT_ID;set v_text=v_text || ''|'' || inserted.RETURN_QUANTITY;i_return_status=call sp_log_file_insdel_activity(inserted.loc,625,inserted.rgn_pool_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_rgn_pool','RGN_POOL','B','I',1,'create trigger tr_bi_rgn_pool before insert on RGN_POOL referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.INVOICE_LINE_ITEM_INVOICE_ID || ''|'' || inserted.INVOICE_LINE_ITEM_SEQUENCE;set v_text=v_text || ''|'' || inserted.INVENTORY_ID || ''|'' || inserted.RETURN_QUANTITY;i_return_status=call sp_log_file_insdel_activity(inserted.loc,623,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_rgn_profile','RGN_PROFILE','B','I',1,'create trigger tr_bi_rgn_profile before insert on RGN_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LOC;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,341,null,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_sales_order','SALES_ORDER','B','I',1,'create trigger tr_bi_sales_order before insert on SALES_ORDER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.STORE_NUM;i_return_status=call sp_log_file_insdel_activity(inserted.loc,681,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_sales_order_shipping_address','SALES_ORDER_SHIPPING_ADDRESS','B','I',1,'create trigger tr_bi_sales_order_shipping_address before insert on SALES_ORDER_SHIPPING_ADDRESS referencing new as inserted for each row begin if inserted.SHIP_TO_STORE_NUMBER is null then if inserted.ADDRESS1 is null then raiserror 18001 ''tr_bi_sales_order_shipping_address: ADDRESS1 cannot be null when SHIP_TO_STORE_NUMBER is NULL'' end if;if inserted.REF_STATE_CD is null then raiserror 18001 ''tr_bi_sales_order_shipping_address: REF_STATE_CD cannot be null when SHIP_TO_STORE_NUMBER is NULL'' end if;if inserted.CITY is null then raiserror 18001 ''tr_bi_sales_order_shipping_address: CITY cannot be null when SHIP_TO_STORE_NUMBER is NULL'' end if;if inserted.REF_COUNTRY_CD is null then raiserror 18001 ''tr_bi_sales_order_shipping_address: REF_COUNTRY_CD cannot be null when SHIP_TO_STORE_NUMBER is NULL'' end if;if inserted.POSTAL_CODE is null then raiserror 18001 ''tr_bi_sales_order_shipping_address: POSTAL_CODE cannot be null when SHIP_TO_STORE_NUMBER is NULL'' end if end if end', 'tr_bi_scanner','SCANNER','B','I',1,'create trigger tr_bi_scanner before insert on SCANNER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_DEVICE_CONNECTION_TYPE_ID || ''|'' || inserted.DESCRIPTION;set v_text=v_text || ''|'' || inserted.IP_ADDRESS || ''|'' || inserted.REF_SCANNER_TYPE_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,319,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_shipping_code','SHIPPING_CODE','B','I',1,'create trigger tr_bi_shipping_code before insert on SHIPPING_CODE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION || ''|'' || inserted.JOEI_SHIPPING_CD;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,163,null,null,inserted.CD,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_store_category','STORE_CATEGORY','B','I',1,'create trigger tr_bi_store_category before insert on STORE_CATEGORY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.loc,85,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_store_department','STORE_DEPARTMENT','B','I',1,'create trigger tr_bi_store_department before insert on STORE_DEPARTMENT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.loc,215,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_store_group','STORE_GROUP','B','I',1,'create trigger tr_bi_store_group before insert on STORE_GROUP referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.STORE_GROUP_NUM || ''|'' || inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.loc,185,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_store_profile','STORE_PROFILE','B','I',1,'create trigger tr_bi_store_profile before insert on STORE_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';if MOD((inserted.use_site_relationship_feed),10)=1 then insert into communication_directory_change_queue(id,communication_directory_id,loc,action) values(null,null,inserted.loc,''U'') end if;if ISNULL(STRING(inserted.GPC_OWNED),'''')=1 then update employee set display_gross_profit_and_cost=''N'' where loc=inserted.loc end if;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,7,inserted.ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_store_pu_gp','STORE_PU_GP','B','I',1,'create trigger tr_bi_store_pu_gp before insert on STORE_PU_GP referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.AMOUNT_BEGIN || ''|'' || inserted.AMOUNT_END;i_return_status=call sp_log_file_insdel_activity(inserted.loc,125,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_sub_department','SUB_DEPARTMENT','B','I',1,'create trigger tr_bi_sub_department before insert on SUB_DEPARTMENT referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.loc,214,inserted.department_id,inserted.id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_supersede','SUPERSEDE','B','I',1,'create trigger tr_bi_supersede before insert on SUPERSEDE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LINE_ABBREV || ''|'' || inserted.PART_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,131,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_supersede_part','SUPERSEDE_PART','B','I',1,'create trigger tr_bi_supersede_part before insert on SUPERSEDE_PART referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.SUPERSEDE_ID || ''|'' || inserted.REF_SUPERSEDE_TYPE_ID;set v_text=v_text || ''|'' || inserted.SUPERSEDING_LINE_ABBREV || ''|'' || inserted.SUPERSEDING_PART_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,200,inserted.id,inserted.supersede_id,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_supplier','SUPPLIER','B','I',1,'create trigger tr_bi_supplier before insert on SUPPLIER referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.NAME;i_return_status=call sp_log_file_insdel_activity(inserted.loc,281,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_tax_table','TAX_TABLE','B','I',1,'create trigger tr_bi_tax_table before insert on TAX_TABLE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.DESCRIPTION || ''|'' || inserted.SECONDARY_TAX_TABLE_ID;i_return_status=call sp_log_file_insdel_activity(inserted.loc,89,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.secondary_tax_table_id is not null then if inserted.secondary_tax_table_id=inserted.id then raiserror 18009 ''SECONDARY_TAX_TABLE_ID cannot point to itself.'' end if;if(select secondary_tax_table_id from tax_table where id=inserted.secondary_tax_table_id and loc=inserted.loc) is not null then raiserror 18009 ''SECONDARY_TAX_TABLE_ID cannot point to a primary tax table.'' end if end if end', 'tr_bi_temp_customer_pricing','TEMP_CUSTOMER_PRICING','B','I',1,'create trigger tr_bi_temp_customer_pricing before insert on TEMP_CUSTOMER_PRICING referencing new as inserted for each row begin if inserted.REF_PRICING_TYPE_CD=''F'' then if exists(select*from temp_customer_pricing where REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and LINE_ABBREV=inserted.LINE_ABBREV and PART_PREFIX=inserted.PART_PREFIX and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bi_temp_customer_pricing: Duplicate value for UNIQUE index XAK1TEMP_CUSTOMER_PRICING.'' end if else if inserted.LINE_ABBREV is not null then if exists(select*from temp_customer_pricing where REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and LINE_ABBREV=inserted.LINE_ABBREV and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bi_temp_customer_pricing: Duplicate value for UNIQUE index XAK1TEMP_CUSTOMER_PRICING.'' end if else if exists(select*from temp_customer_pricing where REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bi_temp_customer_pricing: Duplicate value for UNIQUE index XAK1TEMP_CUSTOMER_PRICING.'' end if end if end if;if inserted.ref_pricing_type_cd=''F'' then if inserted.line_abbrev is null then raiserror 18001 ''tr_bi_temp_customer_pricing: Fixed pricing: LINE_ABBREV cannot be NULL.'' end if;if inserted.part_prefix is null then raiserror 18001 ''tr_bi_temp_customer_pricing: Fixed pricing: PART_PREFIX cannot be NULL.'' end if;if inserted.reportable is null then raiserror 18001 ''tr_bi_temp_customer_pricing: Fixed pricing: REPORTABLE cannot be NULL.'' end if;if inserted.part_price is null then raiserror 18001 ''tr_bi_temp_customer_pricing: Fixed pricing: PART_PRICE cannot be NULL.'' end if else if inserted.ref_price_sheet_cd is null then raiserror 18001 ''tr_bi_temp_customer_pricing: REF_PRICE_SHEET_CD cannot be NULL.'' end if;if inserted.markup_percent is null then raiserror 18001 ''tr_bi_temp_customer_pricing: MARKUP_PERCENT cannot be NULL.'' end if;if inserted.ref_currency_rounding_cd is null then raiserror 18001 ''tr_bi_temp_customer_pricing: REF_CURRENCY_ROUNDING_CD cannot be NULL.'' end if;if inserted.ref_pricing_type_cd=''R'' and inserted.reportable is null then raiserror 18001 ''tr_bi_temp_customer_pricing: REPORTABLE cannot be NULL.'' end if end if;if inserted.department_id is null and inserted.sub_department_id is not null then raiserror 18001 ''tr_bi_temp_customer_pricing: SUB_DEPARTMENT cannot exist without DEPARTMENT.'' end if end', 'tr_bi_tender_type_profile','TENDER_TYPE_PROFILE','B','I',1,'create trigger tr_bi_tender_type_profile before insert on TENDER_TYPE_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.TENDER_TYPE_ACCEPTED;i_return_status=call sp_log_file_insdel_activity(inserted.LOC,276,inserted.REF_TENDER_TYPE_ID,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.ref_tender_type_id <> 2 and inserted.tender_type_accepted not in(0,1,10,11) then raiserror 19003 ''tr_bi_tender_type_profile: tender_type_accepted: '' || inserted.tender_type_accepted || '' value is only allowed for tender_type 2(Check).'' end if end', 'tr_bi_terminal','TERMINAL','B','I',1,'create trigger tr_bi_terminal before insert on TERMINAL referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_DEVICE_CONNECTION_TYPE_ID || ''|'' || inserted.DESCRIPTION;set v_text=v_text || ''|'' || inserted.IP_ADDRESS || ''|'' || inserted.ALLOW_INTERNET_ACCESS;i_return_status=call sp_log_file_insdel_activity(inserted.loc,303,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_time_tracking_profile','TIME_TRACKING_PROFILE','B','I',1,'create trigger tr_bi_time_tracking_profile before insert on TIME_TRACKING_PROFILE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text='''';i_return_status=call sp_log_file_insdel_activity(inserted.loc,37,inserted.id,null,null,v_text,''A'',inserted.date_modified,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.date_modified=current timestamp end if end', 'tr_bi_tmp_transin_receipts','TMP_TRANSIN_RECEIPTS','B','I',1,'create trigger tr_bi_tmp_transin_receipts before insert on TMP_TRANSIN_RECEIPTS referencing new as inserted for each row begin if inserted.part_number is not null and inserted.expanded_part_number is not null then if fn_stripped_part_number(inserted.expanded_part_number) <> inserted.part_number then raiserror 18023 ''18023: tr_bi_tmp_transin_receipts: expanded_part_number '' || inserted.expanded_part_number || '' does not match part_number '' || inserted.part_number || ''.'' end if end if end', 'tr_bi_tracking_code','TRACKING_CODE','B','I',1,'create trigger tr_bi_tracking_code before insert on TRACKING_CODE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.REF_TRACKING_TYPE_CD || ''|'' || inserted.CODE;set v_text=v_text || ''|'' || inserted.DESCRIPTION;i_return_status=call sp_log_file_insdel_activity(inserted.loc,184,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_user_defined_field_name','USER_DEFINED_FIELD_NAME','B','I',1,'create trigger tr_bi_user_defined_field_name before insert on USER_DEFINED_FIELD_NAME referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.APPLIES_TO_TABLE_CODE || ''|'' || inserted.SEQUENCE;set v_text=v_text || ''|'' || inserted.FIELD_NAME;i_return_status=call sp_log_file_insdel_activity(inserted.loc,226,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_vendor','VENDOR','B','I',1,'create trigger tr_bi_vendor before insert on VENDOR referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.NAME;i_return_status=call sp_log_file_insdel_activity(inserted.loc,143,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_vendor_alternate_address','VENDOR_ALTERNATE_ADDRESS','B','I',1,'create trigger tr_bi_vendor_alternate_address before insert on VENDOR_ALTERNATE_ADDRESS referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.NAME;i_return_status=call sp_log_file_insdel_activity(inserted.loc,266,inserted.vendor_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_vendor_invoice','DISB_CHECK_INVOICE','B','I',1,'create trigger tr_bi_vendor_invoice before insert on DISB_CHECK_INVOICE referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from disb_check where id=inserted.disb_check_id and loc=inserted.loc;set v_text=inserted.DISB_CHECK_ID || ''|'' || inserted.INVOICE_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,457,inserted.id,null,null,v_text,''A'',v_last_modified_date,v_modified_by_employee_id,1);if i_return_status=-1 then update disb_check set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.disb_check_id and loc=inserted.loc end if end', 'tr_bi_warranty','WARRANTY','B','I',1,'create trigger tr_bi_warranty before insert on WARRANTY referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.LINE_ABBREV || ''|'' || inserted.PART_NUMBER;i_return_status=call sp_log_file_insdel_activity(inserted.loc,130,inserted.id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bi_warranty_period','WARRANTY_PERIOD','B','I',1,'create trigger tr_bi_warranty_period before insert on WARRANTY_PERIOD referencing new as inserted for each row begin declare v_text varchar(254);declare i_return_status integer;set v_text=inserted.period_months;i_return_status=call sp_log_file_insdel_activity(inserted.loc,673,inserted.pro_rata_warranty_id,null,null,v_text,''A'',inserted.last_modified_date,inserted.modified_by_employee_id,1);if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_alert','ALERT','B','U',1,'create trigger tr_bu_alert before update on ALERT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.SUMMARY,'''') <> ISNULL(inserted.SUMMARY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,593,1,inserted.id,null,null,deleted.SUMMARY,inserted.SUMMARY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TEXT,'''') <> ISNULL(inserted.TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,593,2,inserted.id,null,null,deleted.TEXT,inserted.TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INACTIVE,'''') <> ISNULL(inserted.INACTIVE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,593,3,inserted.id,null,null,deleted.INACTIVE,inserted.INACTIVE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FIRST_EFFECTIVE_DATE),'''') <> ISNULL(STRING(inserted.FIRST_EFFECTIVE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,593,4,inserted.id,null,null,deleted.FIRST_EFFECTIVE_DATE,inserted.FIRST_EFFECTIVE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_ap_check','DISB_CHECK','B','U',1,'create trigger tr_bu_ap_check before update on DISB_CHECK referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CHECK_NUMBER),'''') <> ISNULL(STRING(inserted.CHECK_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,1,inserted.id,null,null,deleted.CHECK_NUMBER,inserted.CHECK_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CHECK_DATE),'''') <> ISNULL(STRING(inserted.CHECK_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,2,inserted.id,null,null,deleted.CHECK_DATE,inserted.CHECK_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VENDOR_ID),'''') <> ISNULL(STRING(inserted.VENDOR_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,3,inserted.id,null,null,deleted.VENDOR_ID,inserted.VENDOR_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DELETED,'''') <> ISNULL(inserted.DELETED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,4,inserted.id,null,null,deleted.DELETED,inserted.DELETED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.VOID,'''') <> ISNULL(inserted.VOID,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,5,inserted.id,null,null,deleted.VOID,inserted.VOID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MANUAL_CHECK,'''') <> ISNULL(inserted.MANUAL_CHECK,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,6,inserted.id,null,null,deleted.MANUAL_CHECK,inserted.MANUAL_CHECK,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MESSAGE_TEXT,'''') <> ISNULL(inserted.MESSAGE_TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,7,inserted.id,null,null,deleted.MESSAGE_TEXT,inserted.MESSAGE_TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_DISB_CHECK_TYPE_CD,'''') <> ISNULL(inserted.REF_DISB_CHECK_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,8,inserted.id,null,null,deleted.REF_DISB_CHECK_TYPE_CD,inserted.REF_DISB_CHECK_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_DISB_CHECK_STATUS_ID),'''') <> ISNULL(STRING(inserted.REF_DISB_CHECK_STATUS_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,9,inserted.id,null,null,deleted.REF_DISB_CHECK_STATUS_ID,inserted.REF_DISB_CHECK_STATUS_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CHECK_AMOUNT),'''') <> ISNULL(STRING(inserted.CHECK_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,10,inserted.id,null,null,deleted.CHECK_AMOUNT,inserted.CHECK_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_AMOUNT),'''') <> ISNULL(STRING(inserted.DISCOUNT_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,11,inserted.id,null,null,deleted.DISCOUNT_AMOUNT,inserted.DISCOUNT_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DC_IDENTIFIER,'''') <> ISNULL(inserted.DC_IDENTIFIER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,12,inserted.id,null,null,deleted.DC_IDENTIFIER,inserted.DC_IDENTIFIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STORE_NUMBER),'''') <> ISNULL(STRING(inserted.STORE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,13,inserted.id,null,null,deleted.STORE_NUMBER,inserted.STORE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCOUNTING_MONTH),'''') <> ISNULL(STRING(inserted.ACCOUNTING_MONTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,455,14,inserted.id,null,null,deleted.ACCOUNTING_MONTH,inserted.ACCOUNTING_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_ar_application','AR_APPLICATION','B','U',1,'create trigger tr_bu_ar_application before update on AR_APPLICATION referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.APPLIED_AR_PAYMENT_ID),'''') <> ISNULL(STRING(inserted.APPLIED_AR_PAYMENT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,406,1,inserted.id,null,null,deleted.APPLIED_AR_PAYMENT_ID,inserted.APPLIED_AR_PAYMENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.APPLIED_AR_TRANSACTION_ID),'''') <> ISNULL(STRING(inserted.APPLIED_AR_TRANSACTION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,406,2,inserted.id,null,null,deleted.APPLIED_AR_TRANSACTION_ID,inserted.APPLIED_AR_TRANSACTION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.APPLIED_TO_AR_TRANSACTION_ID),'''') <> ISNULL(STRING(inserted.APPLIED_TO_AR_TRANSACTION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,406,3,inserted.id,null,null,deleted.APPLIED_TO_AR_TRANSACTION_ID,inserted.APPLIED_TO_AR_TRANSACTION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_AR_APPLICATION_TYPE_CD,'''') <> ISNULL(inserted.REF_AR_APPLICATION_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,406,4,inserted.id,null,null,deleted.REF_AR_APPLICATION_TYPE_CD,inserted.REF_AR_APPLICATION_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAYMENT_APPLIED_DATE),'''') <> ISNULL(STRING(inserted.PAYMENT_APPLIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,406,5,inserted.id,null,null,deleted.PAYMENT_APPLIED_DATE,inserted.PAYMENT_APPLIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.APPLIED_AMOUNT),'''') <> ISNULL(STRING(inserted.APPLIED_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,406,6,inserted.id,null,null,deleted.APPLIED_AMOUNT,inserted.APPLIED_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_EARNED),'''') <> ISNULL(STRING(inserted.DISCOUNT_EARNED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,406,7,inserted.id,null,null,deleted.DISCOUNT_EARNED,inserted.DISCOUNT_EARNED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCOUNTING_DAY),'''') <> ISNULL(STRING(inserted.ACCOUNTING_DAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,406,8,inserted.id,null,null,deleted.ACCOUNTING_DAY,inserted.ACCOUNTING_DAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES_YEAR_MONTH),'''') <> ISNULL(STRING(inserted.SALES_YEAR_MONTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,406,9,inserted.id,null,null,deleted.SALES_YEAR_MONTH,inserted.SALES_YEAR_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.applied_ar_payment_id is not null then begin declare d_payment_amount decimal(9,2);declare d_applied_total decimal(12,2);set d_payment_amount=(select payment_amount+discount_taken from ar_payment where id=inserted.applied_ar_payment_id and loc=inserted.loc);set d_applied_total=inserted.applied_amount+ISNULL((select SUM(applied_amount) from ar_application where applied_ar_payment_id=inserted.applied_ar_payment_id and loc=inserted.loc and id <> inserted.id),0);if d_applied_total < 0 then raiserror 18031 ''tr_bu_ar_application: Balance for payment cannot exceed original amount+discount.'' end if;if d_applied_total > ABS(d_payment_amount) then raiserror 18030 ''tr_bu_ar_application: Cannot over-apply payment.'' end if end end if;if inserted.applied_ar_transaction_id is not null then begin declare d_transaction_amount decimal(9,2);declare d_applied_total decimal(12,2);set d_transaction_amount=(select gross_amount from ar_transaction where id=inserted.applied_ar_transaction_id and loc=inserted.loc);set d_applied_total=inserted.applied_amount+ISNULL((select SUM(applied_amount) from ar_application where applied_ar_transaction_id=inserted.applied_ar_transaction_id and loc=inserted.loc and id <> inserted.id),0);if d_applied_total < 0 then raiserror 18033 ''tr_bu_ar_application: Balance for transaction cannot exceed original amount'' end if;if d_applied_total > ABS(d_transaction_amount) then raiserror 18032 ''tr_bu_ar_application: Cannot over-apply transaction.'' end if end end if;if inserted.applied_to_ar_transaction_id is not null then begin declare d_transaction_amount decimal(9,2);declare d_applied_total decimal(12,2);set d_transaction_amount=(select gross_amount from ar_transaction where id=inserted.applied_to_ar_transaction_id and loc=inserted.loc);set d_applied_total=inserted.applied_amount+ISNULL((select SUM(applied_amount) from ar_application where applied_to_ar_transaction_id=inserted.applied_to_ar_transaction_id and loc=inserted.loc and id <> inserted.id),0);if d_applied_total < 0 then raiserror 18033 ''tr_bu_ar_application: Balance for transaction cannot exceed original amount'' end if;if d_applied_total > ABS(d_transaction_amount) then raiserror 18032 ''tr_bu_ar_application: Cannot over-apply transaction.'' end if end end if end', 'tr_bu_ar_payment','AR_PAYMENT','B','U',1,'create trigger tr_bu_ar_payment before update on AR_PAYMENT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.CUSTOMER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,1,inserted.id,null,null,deleted.CUSTOMER_ID,inserted.CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAYMENT_ENTRY_DATE),'''') <> ISNULL(STRING(inserted.PAYMENT_ENTRY_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,2,inserted.id,null,null,deleted.PAYMENT_ENTRY_DATE,inserted.PAYMENT_ENTRY_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAYMENT_REFERENCE),'''') <> ISNULL(STRING(inserted.PAYMENT_REFERENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,3,inserted.id,null,null,deleted.PAYMENT_REFERENCE,inserted.PAYMENT_REFERENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAYMENT_IDENTIFIER),'''') <> ISNULL(STRING(inserted.PAYMENT_IDENTIFIER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,4,inserted.id,null,null,deleted.PAYMENT_IDENTIFIER,inserted.PAYMENT_IDENTIFIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CHECK_NUMBER,'''') <> ISNULL(inserted.CHECK_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,5,inserted.id,null,null,deleted.CHECK_NUMBER,inserted.CHECK_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAYMENT_DATE),'''') <> ISNULL(STRING(inserted.PAYMENT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,6,inserted.id,null,null,deleted.PAYMENT_DATE,inserted.PAYMENT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAYMENT_AMOUNT),'''') <> ISNULL(STRING(inserted.PAYMENT_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,7,inserted.id,null,null,deleted.PAYMENT_AMOUNT,inserted.PAYMENT_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNAPPLIED_AMOUNT),'''') <> ISNULL(STRING(inserted.UNAPPLIED_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,8,inserted.id,null,null,deleted.UNAPPLIED_AMOUNT,inserted.UNAPPLIED_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_EARNED),'''') <> ISNULL(STRING(inserted.DISCOUNT_EARNED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,9,inserted.id,null,null,deleted.DISCOUNT_EARNED,inserted.DISCOUNT_EARNED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_TAKEN),'''') <> ISNULL(STRING(inserted.DISCOUNT_TAKEN),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,10,inserted.id,null,null,deleted.DISCOUNT_TAKEN,inserted.DISCOUNT_TAKEN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_TENDER_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_TENDER_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,12,inserted.id,null,null,deleted.REF_TENDER_TYPE_ID,inserted.REF_TENDER_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BRANCH_NUMBER),'''') <> ISNULL(STRING(inserted.BRANCH_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,13,inserted.id,null,null,deleted.BRANCH_NUMBER,inserted.BRANCH_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UPDATE_FLAG,'''') <> ISNULL(inserted.UPDATE_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,14,inserted.id,null,null,deleted.UPDATE_FLAG,inserted.UPDATE_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUMBER_OF_STMT_APPEARANCES),'''') <> ISNULL(STRING(inserted.NUMBER_OF_STMT_APPEARANCES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,15,inserted.id,null,null,deleted.NUMBER_OF_STMT_APPEARANCES,inserted.NUMBER_OF_STMT_APPEARANCES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCOUNTING_DAY),'''') <> ISNULL(STRING(inserted.ACCOUNTING_DAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,11,inserted.id,null,null,deleted.ACCOUNTING_DAY,inserted.ACCOUNTING_DAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES_YEAR_MONTH),'''') <> ISNULL(STRING(inserted.SALES_YEAR_MONTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,17,inserted.id,null,null,deleted.SALES_YEAR_MONTH,inserted.SALES_YEAR_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.HISTORICAL),'''') <> ISNULL(STRING(inserted.HISTORICAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,18,inserted.id,null,null,deleted.HISTORICAL,inserted.HISTORICAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_AR_PAYMENT_ORIGINATION_CD,'''') <> ISNULL(inserted.REF_AR_PAYMENT_ORIGINATION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,16,inserted.id,null,null,deleted.REF_AR_PAYMENT_ORIGINATION_CD,inserted.REF_AR_PAYMENT_ORIGINATION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STATEMENT_NOTE,'''') <> ISNULL(inserted.STATEMENT_NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,19,inserted.id,null,null,deleted.STATEMENT_NOTE,inserted.STATEMENT_NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BOOKKEEPING_NOTE,'''') <> ISNULL(inserted.BOOKKEEPING_NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,402,20,inserted.id,null,null,deleted.BOOKKEEPING_NOTE,inserted.BOOKKEEPING_NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if(inserted.payment_amount > 0 and inserted.unapplied_amount < 0) or(inserted.payment_amount < 0 and inserted.unapplied_amount > 0) then raiserror 18030 ''tr_bu_ar_payment: Cannot over-apply payment.'' end if;if(inserted.payment_amount > 0 and inserted.unapplied_amount > inserted.payment_amount+inserted.discount_taken) or(inserted.payment_amount < 0 and inserted.unapplied_amount < inserted.payment_amount+inserted.discount_taken) then raiserror 18031 ''tr_bu_ar_payment: Balance for payment cannot exceed original amount+discount.'' end if end', 'tr_bu_ar_profile','AR_PROFILE','B','U',1,'create trigger tr_bu_ar_profile before update on AR_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.PRINT_STATEMENTS),'''') <> ISNULL(STRING(inserted.PRINT_STATEMENTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,1,inserted.id,null,null,deleted.PRINT_STATEMENTS,inserted.PRINT_STATEMENTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STATEMENTS_USE_CUSTOMER_LANGUAGE),'''') <> ISNULL(STRING(inserted.STATEMENTS_USE_CUSTOMER_LANGUAGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,15,inserted.id,null,null,deleted.STATEMENTS_USE_CUSTOMER_LANGUAGE,inserted.STATEMENTS_USE_CUSTOMER_LANGUAGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MAIN_AR_STORE_NUMBER,'''') <> ISNULL(inserted.MAIN_AR_STORE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,2,inserted.id,null,null,deleted.MAIN_AR_STORE_NUMBER,inserted.MAIN_AR_STORE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEFAULT_AR_TERMS_ID),'''') <> ISNULL(STRING(inserted.DEFAULT_AR_TERMS_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,3,inserted.id,null,null,deleted.DEFAULT_AR_TERMS_ID,inserted.DEFAULT_AR_TERMS_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MONTHS_TO_SAVE_STMTS),'''') <> ISNULL(STRING(inserted.MONTHS_TO_SAVE_STMTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,4,inserted.id,null,null,deleted.MONTHS_TO_SAVE_STMTS,inserted.MONTHS_TO_SAVE_STMTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MONTHS_TO_SAVE_AR_HISTORY),'''') <> ISNULL(STRING(inserted.MONTHS_TO_SAVE_AR_HISTORY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,14,inserted.id,null,null,deleted.MONTHS_TO_SAVE_AR_HISTORY,inserted.MONTHS_TO_SAVE_AR_HISTORY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_CUSTOMER_SALES_HISTORY_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_CUSTOMER_SALES_HISTORY_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,16,inserted.id,null,null,deleted.KEEP_CUSTOMER_SALES_HISTORY_MONTHS,inserted.KEEP_CUSTOMER_SALES_HISTORY_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_RUN_DATE),'''') <> ISNULL(STRING(inserted.LAST_STMT_RUN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,5,inserted.id,null,null,deleted.LAST_STMT_RUN_DATE,inserted.LAST_STMT_RUN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_ACCT_DAY),'''') <> ISNULL(STRING(inserted.LAST_STMT_ACCT_DAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,6,inserted.id,null,null,deleted.LAST_STMT_ACCT_DAY,inserted.LAST_STMT_ACCT_DAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_ROA_RECEIPTS),'''') <> ISNULL(STRING(inserted.PRINT_ROA_RECEIPTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,7,inserted.id,null,null,deleted.PRINT_ROA_RECEIPTS,inserted.PRINT_ROA_RECEIPTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_AR_STATEMENT_FORM_ID),'''') <> ISNULL(STRING(inserted.REF_AR_STATEMENT_FORM_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,8,inserted.id,null,null,deleted.REF_AR_STATEMENT_FORM_ID,inserted.REF_AR_STATEMENT_FORM_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_STORE_NAME_ON_STMT),'''') <> ISNULL(STRING(inserted.PRINT_STORE_NAME_ON_STMT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,9,inserted.id,null,null,deleted.PRINT_STORE_NAME_ON_STMT,inserted.PRINT_STORE_NAME_ON_STMT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_CREDITCARD_ROA),'''') <> ISNULL(STRING(inserted.ALLOW_CREDITCARD_ROA),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,10,inserted.id,null,null,deleted.ALLOW_CREDITCARD_ROA,inserted.ALLOW_CREDITCARD_ROA,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACTIVITY_SUMMARY_ON_STMT),'''') <> ISNULL(STRING(inserted.ACTIVITY_SUMMARY_ON_STMT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,11,inserted.id,null,null,deleted.ACTIVITY_SUMMARY_ON_STMT,inserted.ACTIVITY_SUMMARY_ON_STMT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMITTANCE_NAME,'''') <> ISNULL(inserted.REMITTANCE_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,17,inserted.id,null,null,deleted.REMITTANCE_NAME,inserted.REMITTANCE_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMITTANCE_ADDRESS1,'''') <> ISNULL(inserted.REMITTANCE_ADDRESS1,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,18,inserted.id,null,null,deleted.REMITTANCE_ADDRESS1,inserted.REMITTANCE_ADDRESS1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMITTANCE_ADDRESS2,'''') <> ISNULL(inserted.REMITTANCE_ADDRESS2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,19,inserted.id,null,null,deleted.REMITTANCE_ADDRESS2,inserted.REMITTANCE_ADDRESS2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMITTANCE_ADDRESS3,'''') <> ISNULL(inserted.REMITTANCE_ADDRESS3,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,20,inserted.id,null,null,deleted.REMITTANCE_ADDRESS3,inserted.REMITTANCE_ADDRESS3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMITTANCE_ADDRESS4,'''') <> ISNULL(inserted.REMITTANCE_ADDRESS4,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,21,inserted.id,null,null,deleted.REMITTANCE_ADDRESS4,inserted.REMITTANCE_ADDRESS4,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMITTANCE_CITY,'''') <> ISNULL(inserted.REMITTANCE_CITY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,22,inserted.id,null,null,deleted.REMITTANCE_CITY,inserted.REMITTANCE_CITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMITTANCE_REF_STATE_CD,'''') <> ISNULL(inserted.REMITTANCE_REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,23,inserted.id,null,null,deleted.REMITTANCE_REF_STATE_CD,inserted.REMITTANCE_REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMITTANCE_POSTAL_CODE,'''') <> ISNULL(inserted.REMITTANCE_POSTAL_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,24,inserted.id,null,null,deleted.REMITTANCE_POSTAL_CODE,inserted.REMITTANCE_POSTAL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMITTANCE_REF_COUNTRY_CD,'''') <> ISNULL(inserted.REMITTANCE_REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,25,inserted.id,null,null,deleted.REMITTANCE_REF_COUNTRY_CD,inserted.REMITTANCE_REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALERT_DAYS_FOR_PRICING_EXPIRE),'''') <> ISNULL(STRING(inserted.ALERT_DAYS_FOR_PRICING_EXPIRE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,12,inserted.id,null,null,deleted.ALERT_DAYS_FOR_PRICING_EXPIRE,inserted.ALERT_DAYS_FOR_PRICING_EXPIRE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALERT_DAYS_FOR_CUSTOMER_FOLLOW_UP),'''') <> ISNULL(STRING(inserted.ALERT_DAYS_FOR_CUSTOMER_FOLLOW_UP),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,13,inserted.id,null,null,deleted.ALERT_DAYS_FOR_CUSTOMER_FOLLOW_UP,inserted.ALERT_DAYS_FOR_CUSTOMER_FOLLOW_UP,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TAX_SUMMARY_ON_STMT),'''') <> ISNULL(STRING(inserted.TAX_SUMMARY_ON_STMT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,26,inserted.id,null,null,deleted.TAX_SUMMARY_ON_STMT,inserted.TAX_SUMMARY_ON_STMT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_SALES_YEAR_MONTH),'''') <> ISNULL(STRING(inserted.LAST_STMT_SALES_YEAR_MONTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,27,inserted.id,null,null,deleted.LAST_STMT_SALES_YEAR_MONTH,inserted.LAST_STMT_SALES_YEAR_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_AR_STORE_TYPE_CD,'''') <> ISNULL(inserted.REF_AR_STORE_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,28,inserted.id,null,null,deleted.REF_AR_STORE_TYPE_CD,inserted.REF_AR_STORE_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ONLINE_STATEMENT_FTP_URL,'''') <> ISNULL(inserted.ONLINE_STATEMENT_FTP_URL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,29,inserted.id,null,null,deleted.ONLINE_STATEMENT_FTP_URL,inserted.ONLINE_STATEMENT_FTP_URL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ONLINE_STATEMENT_FTP_USER_NAME,'''') <> ISNULL(inserted.ONLINE_STATEMENT_FTP_USER_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,30,inserted.id,null,null,deleted.ONLINE_STATEMENT_FTP_USER_NAME,inserted.ONLINE_STATEMENT_FTP_USER_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ONLINE_STATEMENT_FTP_PASSWORD,'''') <> ISNULL(inserted.ONLINE_STATEMENT_FTP_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,31,inserted.id,null,null,deleted.ONLINE_STATEMENT_FTP_PASSWORD,inserted.ONLINE_STATEMENT_FTP_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_STATEMENT_DOMAIN_FEED_SERVICE,'''') <> ISNULL(inserted.USE_STATEMENT_DOMAIN_FEED_SERVICE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,32,inserted.id,null,null,deleted.USE_STATEMENT_DOMAIN_FEED_SERVICE,inserted.USE_STATEMENT_DOMAIN_FEED_SERVICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LAST_STMT_RUN_DATE_STATUS,'''') <> ISNULL(inserted.LAST_STMT_RUN_DATE_STATUS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,33,inserted.id,null,null,deleted.LAST_STMT_RUN_DATE_STATUS,inserted.LAST_STMT_RUN_DATE_STATUS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LAST_STMT_RUN_DATE_SCORECARD_STATUS,'''') <> ISNULL(inserted.LAST_STMT_RUN_DATE_SCORECARD_STATUS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,34,inserted.id,null,null,deleted.LAST_STMT_RUN_DATE_SCORECARD_STATUS,inserted.LAST_STMT_RUN_DATE_SCORECARD_STATUS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RESEND_STMT_RUN_DATE),'''') <> ISNULL(STRING(inserted.RESEND_STMT_RUN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,35,inserted.id,null,null,deleted.RESEND_STMT_RUN_DATE,inserted.RESEND_STMT_RUN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RESEND_STMT_RUN_DATE_STATUS,'''') <> ISNULL(inserted.RESEND_STMT_RUN_DATE_STATUS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,36,inserted.id,null,null,deleted.RESEND_STMT_RUN_DATE_STATUS,inserted.RESEND_STMT_RUN_DATE_STATUS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RESEND_STMT_RUN_DATE_SCORECARD_STATUS,'''') <> ISNULL(inserted.RESEND_STMT_RUN_DATE_SCORECARD_STATUS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,37,inserted.id,null,null,deleted.RESEND_STMT_RUN_DATE_SCORECARD_STATUS,inserted.RESEND_STMT_RUN_DATE_SCORECARD_STATUS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCEPT_EXTERNAL_PAYMENT),'''') <> ISNULL(STRING(inserted.ACCEPT_EXTERNAL_PAYMENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,38,inserted.id,null,null,deleted.ACCEPT_EXTERNAL_PAYMENT,inserted.ACCEPT_EXTERNAL_PAYMENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_ALL_OPEN_INVOICES_FOR_INTERIM_STMT,'''') <> ISNULL(inserted.INCLUDE_ALL_OPEN_INVOICES_FOR_INTERIM_STMT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,105,39,inserted.id,null,null,deleted.INCLUDE_ALL_OPEN_INVOICES_FOR_INTERIM_STMT,inserted.INCLUDE_ALL_OPEN_INVOICES_FOR_INTERIM_STMT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_ar_terms','AR_TERMS','B','U',1,'create trigger tr_bu_ar_terms before update on AR_TERMS referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,1,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DUE_DISCOUNT_DATE_CODE_CD,'''') <> ISNULL(inserted.DUE_DISCOUNT_DATE_CODE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,2,inserted.id,null,null,deleted.DUE_DISCOUNT_DATE_CODE_CD,inserted.DUE_DISCOUNT_DATE_CODE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DUE_DAYS),'''') <> ISNULL(STRING(inserted.DUE_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,3,inserted.id,null,null,deleted.DUE_DAYS,inserted.DUE_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SVC_CHG_PREVIOUS_SVC_CHG,'''') <> ISNULL(inserted.SVC_CHG_PREVIOUS_SVC_CHG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,4,inserted.id,null,null,deleted.SVC_CHG_PREVIOUS_SVC_CHG,inserted.SVC_CHG_PREVIOUS_SVC_CHG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SERVICE_CHARGE_PERCENT),'''') <> ISNULL(STRING(inserted.SERVICE_CHARGE_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,5,inserted.id,null,null,deleted.SERVICE_CHARGE_PERCENT,inserted.SERVICE_CHARGE_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MIN_SVC_CHG_AMOUNT),'''') <> ISNULL(STRING(inserted.MIN_SVC_CHG_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,6,inserted.id,null,null,deleted.MIN_SVC_CHG_AMOUNT,inserted.MIN_SVC_CHG_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MIN_SVC_CHG_BALANCE),'''') <> ISNULL(STRING(inserted.MIN_SVC_CHG_BALANCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,7,inserted.id,null,null,deleted.MIN_SVC_CHG_BALANCE,inserted.MIN_SVC_CHG_BALANCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_STATEMENT_FREQUENCY_ID),'''') <> ISNULL(STRING(inserted.REF_STATEMENT_FREQUENCY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,25,inserted.id,null,null,deleted.REF_STATEMENT_FREQUENCY_ID,inserted.REF_STATEMENT_FREQUENCY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_DAYS),'''') <> ISNULL(STRING(inserted.DISCOUNT_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,9,inserted.id,null,null,deleted.DISCOUNT_DAYS,inserted.DISCOUNT_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_EXTRA_DAYS),'''') <> ISNULL(STRING(inserted.DISCOUNT_EXTRA_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,10,inserted.id,null,null,deleted.DISCOUNT_EXTRA_DAYS,inserted.DISCOUNT_EXTRA_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_DATING_DEBITS,'''') <> ISNULL(inserted.DISCOUNT_DATING_DEBITS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,11,inserted.id,null,null,deleted.DISCOUNT_DATING_DEBITS,inserted.DISCOUNT_DATING_DEBITS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_PERCENT),'''') <> ISNULL(STRING(inserted.DISCOUNT_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,12,inserted.id,null,null,deleted.DISCOUNT_PERCENT,inserted.DISCOUNT_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_LABOR,'''') <> ISNULL(inserted.DISCOUNT_LABOR,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,13,inserted.id,null,null,deleted.DISCOUNT_LABOR,inserted.DISCOUNT_LABOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_FREIGHT,'''') <> ISNULL(inserted.DISCOUNT_FREIGHT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,14,inserted.id,null,null,deleted.DISCOUNT_FREIGHT,inserted.DISCOUNT_FREIGHT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_TELEPHONE,'''') <> ISNULL(inserted.DISCOUNT_TELEPHONE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,15,inserted.id,null,null,deleted.DISCOUNT_TELEPHONE,inserted.DISCOUNT_TELEPHONE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_OTHER,'''') <> ISNULL(inserted.DISCOUNT_OTHER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,16,inserted.id,null,null,deleted.DISCOUNT_OTHER,inserted.DISCOUNT_OTHER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_MISC,'''') <> ISNULL(inserted.DISCOUNT_MISC,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,17,inserted.id,null,null,deleted.DISCOUNT_MISC,inserted.DISCOUNT_MISC,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_SALES_TAX,'''') <> ISNULL(inserted.DISCOUNT_SALES_TAX,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,18,inserted.id,null,null,deleted.DISCOUNT_SALES_TAX,inserted.DISCOUNT_SALES_TAX,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_PICKUPS,'''') <> ISNULL(inserted.DISCOUNT_PICKUPS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,19,inserted.id,null,null,deleted.DISCOUNT_PICKUPS,inserted.DISCOUNT_PICKUPS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_JOURNAL_ENTRIES,'''') <> ISNULL(inserted.DISCOUNT_JOURNAL_ENTRIES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,20,inserted.id,null,null,deleted.DISCOUNT_JOURNAL_ENTRIES,inserted.DISCOUNT_JOURNAL_ENTRIES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,21,inserted.id,null,null,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_AR_AGING_METHOD_ID),'''') <> ISNULL(STRING(inserted.REF_AR_AGING_METHOD_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,22,inserted.id,null,null,deleted.REF_AR_AGING_METHOD_ID,inserted.REF_AR_AGING_METHOD_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAST_DUE_DAYS_UNTIL_COD),'''') <> ISNULL(STRING(inserted.PAST_DUE_DAYS_UNTIL_COD),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,23,inserted.id,null,null,deleted.PAST_DUE_DAYS_UNTIL_COD,inserted.PAST_DUE_DAYS_UNTIL_COD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAST_DUE_AMOUNT_FOR_COD),'''') <> ISNULL(STRING(inserted.PAST_DUE_AMOUNT_FOR_COD),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,76,24,inserted.id,null,null,deleted.PAST_DUE_AMOUNT_FOR_COD,inserted.PAST_DUE_AMOUNT_FOR_COD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_ar_transaction','AR_TRANSACTION','B','U',1,'create trigger tr_bu_ar_transaction before update on AR_TRANSACTION referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.CUSTOMER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,1,inserted.id,null,null,deleted.CUSTOMER_ID,inserted.CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TRANSACTION_REFERENCE),'''') <> ISNULL(STRING(inserted.TRANSACTION_REFERENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,2,inserted.id,null,null,deleted.TRANSACTION_REFERENCE,inserted.TRANSACTION_REFERENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TRANSACTION_IDENTIFIER),'''') <> ISNULL(STRING(inserted.TRANSACTION_IDENTIFIER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,3,inserted.id,null,null,deleted.TRANSACTION_IDENTIFIER,inserted.TRANSACTION_IDENTIFIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BRANCH_NUMBER),'''') <> ISNULL(STRING(inserted.BRANCH_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,4,inserted.id,null,null,deleted.BRANCH_NUMBER,inserted.BRANCH_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_AR_TRANSACTION_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_AR_TRANSACTION_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,5,inserted.id,null,null,deleted.REF_AR_TRANSACTION_TYPE_ID,inserted.REF_AR_TRANSACTION_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TRANSACTION_DATE),'''') <> ISNULL(STRING(inserted.TRANSACTION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,6,inserted.id,null,null,deleted.TRANSACTION_DATE,inserted.TRANSACTION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GROSS_AMOUNT),'''') <> ISNULL(STRING(inserted.GROSS_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,7,inserted.id,null,null,deleted.GROSS_AMOUNT,inserted.GROSS_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENT_BALANCE),'''') <> ISNULL(STRING(inserted.CURRENT_BALANCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,8,inserted.id,null,null,deleted.CURRENT_BALANCE,inserted.CURRENT_BALANCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACTUAL_PAID),'''') <> ISNULL(STRING(inserted.ACTUAL_PAID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,9,inserted.id,null,null,deleted.ACTUAL_PAID,inserted.ACTUAL_PAID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EARNED_DISCOUNT_DATE),'''') <> ISNULL(STRING(inserted.EARNED_DISCOUNT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,10,inserted.id,null,null,deleted.EARNED_DISCOUNT_DATE,inserted.EARNED_DISCOUNT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PO_OR_CHECK_NUMBER,'''') <> ISNULL(inserted.PO_OR_CHECK_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,11,inserted.id,null,null,deleted.PO_OR_CHECK_NUMBER,inserted.PO_OR_CHECK_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DATE_OF_ORIGINAL_TRANSACTION),'''') <> ISNULL(STRING(inserted.DATE_OF_ORIGINAL_TRANSACTION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,12,inserted.id,null,null,deleted.DATE_OF_ORIGINAL_TRANSACTION,inserted.DATE_OF_ORIGINAL_TRANSACTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CREATED_BY_DATING,'''') <> ISNULL(inserted.CREATED_BY_DATING,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,21,inserted.id,null,null,deleted.CREATED_BY_DATING,inserted.CREATED_BY_DATING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EARNABLE_DISCOUNT),'''') <> ISNULL(STRING(inserted.EARNABLE_DISCOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,13,inserted.id,null,null,deleted.EARNABLE_DISCOUNT,inserted.EARNABLE_DISCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TRANSACTION_DUE_DATE),'''') <> ISNULL(STRING(inserted.TRANSACTION_DUE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,14,inserted.id,null,null,deleted.TRANSACTION_DUE_DATE,inserted.TRANSACTION_DUE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UPDATE_FLAG,'''') <> ISNULL(inserted.UPDATE_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,15,inserted.id,null,null,deleted.UPDATE_FLAG,inserted.UPDATE_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUMBER_OF_STMT_APPEARANCES),'''') <> ISNULL(STRING(inserted.NUMBER_OF_STMT_APPEARANCES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,16,inserted.id,null,null,deleted.NUMBER_OF_STMT_APPEARANCES,inserted.NUMBER_OF_STMT_APPEARANCES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCOUNTING_DAY),'''') <> ISNULL(STRING(inserted.ACCOUNTING_DAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,17,inserted.id,null,null,deleted.ACCOUNTING_DAY,inserted.ACCOUNTING_DAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES_YEAR_MONTH),'''') <> ISNULL(STRING(inserted.SALES_YEAR_MONTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,18,inserted.id,null,null,deleted.SALES_YEAR_MONTH,inserted.SALES_YEAR_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.HISTORICAL),'''') <> ISNULL(STRING(inserted.HISTORICAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,22,inserted.id,null,null,deleted.HISTORICAL,inserted.HISTORICAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORIGINAL_INVOICE_NUMBER),'''') <> ISNULL(STRING(inserted.ORIGINAL_INVOICE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,19,inserted.id,null,null,deleted.ORIGINAL_INVOICE_NUMBER,inserted.ORIGINAL_INVOICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_CREDIT_DEBIT_REBILL_CD,'''') <> ISNULL(inserted.REF_CREDIT_DEBIT_REBILL_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,20,inserted.id,null,null,deleted.REF_CREDIT_DEBIT_REBILL_CD,inserted.REF_CREDIT_DEBIT_REBILL_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STATEMENT_NOTE,'''') <> ISNULL(inserted.STATEMENT_NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,23,inserted.id,null,null,deleted.STATEMENT_NOTE,inserted.STATEMENT_NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BOOKKEEPING_NOTE,'''') <> ISNULL(inserted.BOOKKEEPING_NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,24,inserted.id,null,null,deleted.BOOKKEEPING_NOTE,inserted.BOOKKEEPING_NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TAX_AMOUNT_1),'''') <> ISNULL(STRING(inserted.TAX_AMOUNT_1),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,25,inserted.id,null,null,deleted.TAX_AMOUNT_1,inserted.TAX_AMOUNT_1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TAX_AMOUNT_2),'''') <> ISNULL(STRING(inserted.TAX_AMOUNT_2),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,26,inserted.id,null,null,deleted.TAX_AMOUNT_2,inserted.TAX_AMOUNT_2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRIMARY_TAX_TABLE_ID),'''') <> ISNULL(STRING(inserted.PRIMARY_TAX_TABLE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,27,inserted.id,null,null,deleted.PRIMARY_TAX_TABLE_ID,inserted.PRIMARY_TAX_TABLE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SECONDARY_TAX_TABLE_ID),'''') <> ISNULL(STRING(inserted.SECONDARY_TAX_TABLE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,28,inserted.id,null,null,deleted.SECONDARY_TAX_TABLE_ID,inserted.SECONDARY_TAX_TABLE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TRANSACTION_SPLIT_TO_DATED_INVOICES,'''') <> ISNULL(inserted.TRANSACTION_SPLIT_TO_DATED_INVOICES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,403,29,inserted.id,null,null,deleted.TRANSACTION_SPLIT_TO_DATED_INVOICES,inserted.TRANSACTION_SPLIT_TO_DATED_INVOICES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if(inserted.gross_amount > 0 and inserted.current_balance < 0) or(inserted.gross_amount < 0 and inserted.current_balance > 0) then raiserror 18032 ''tr_bu_ar_transaction: Cannot over-apply transaction.'' end if;if(inserted.gross_amount > 0 and inserted.current_balance > inserted.gross_amount) or(inserted.gross_amount < 0 and inserted.current_balance < inserted.gross_amount) then raiserror 18033 ''tr_bu_ar_transaction: Balance for transaction cannot exceed original amount'' end if end', 'tr_bu_barcode','BARCODE','B','U',1,'create trigger tr_bu_barcode before update on BARCODE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.BARCODE,'''') <> ISNULL(inserted.BARCODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.modified_by_employee_loc,135,1,inserted.id,null,null,deleted.BARCODE,inserted.BARCODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.modified_by_employee_loc,135,2,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.modified_by_employee_loc,135,3,inserted.id,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PKG_QTY),'''') <> ISNULL(STRING(inserted.PKG_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.modified_by_employee_loc,135,4,inserted.id,null,null,deleted.PKG_QTY,inserted.PKG_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_DVD_UPDATE,'''') <> ISNULL(inserted.ALLOW_DVD_UPDATE,'''') then i_return_status=call sp_log_file_update_activity(inserted.modified_by_employee_loc,135,5,inserted.id,null,null,deleted.ALLOW_DVD_UPDATE,inserted.ALLOW_DVD_UPDATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_barcode_use','BARCODE_USE','B','U',1,'create trigger tr_bu_barcode_use before update on BARCODE_USE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.USE_FOR_BIN_LABEL,'''') <> ISNULL(inserted.USE_FOR_BIN_LABEL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,452,6,inserted.barcode_id,null,null,deleted.USE_FOR_BIN_LABEL,inserted.USE_FOR_BIN_LABEL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_FOR_PLANOGRAM,'''') <> ISNULL(inserted.USE_FOR_PLANOGRAM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,452,7,inserted.barcode_id,null,null,deleted.USE_FOR_PLANOGRAM,inserted.USE_FOR_PLANOGRAM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_buyout','BUYOUT','B','U',1,'create trigger tr_bu_buyout before update on BUYOUT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.PO_NUMBER,'''') <> ISNULL(inserted.PO_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,1,inserted.id,null,null,deleted.PO_NUMBER,inserted.PO_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VENDOR_ID),'''') <> ISNULL(STRING(inserted.VENDOR_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,2,inserted.id,null,null,deleted.VENDOR_ID,inserted.VENDOR_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DC_VENDOR_NUMBER),'''') <> ISNULL(STRING(inserted.DC_VENDOR_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,3,inserted.id,null,null,deleted.DC_VENDOR_NUMBER,inserted.DC_VENDOR_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATION_DATE),'''') <> ISNULL(STRING(inserted.CREATION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,4,inserted.id,null,null,deleted.CREATION_DATE,inserted.CREATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INTENDED_REF_BUYOUT_PAYMENT_TYPE_CD,'''') <> ISNULL(inserted.INTENDED_REF_BUYOUT_PAYMENT_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,5,inserted.id,null,null,deleted.INTENDED_REF_BUYOUT_PAYMENT_TYPE_CD,inserted.INTENDED_REF_BUYOUT_PAYMENT_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_BUYOUT_STATUS_CD,'''') <> ISNULL(inserted.REF_BUYOUT_STATUS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,6,inserted.id,null,null,deleted.REF_BUYOUT_STATUS_CD,inserted.REF_BUYOUT_STATUS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.COST_VERIFIED,'''') <> ISNULL(inserted.COST_VERIFIED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,7,inserted.id,null,null,deleted.COST_VERIFIED,inserted.COST_VERIFIED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.APPROVED_OR_CANCELED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.APPROVED_OR_CANCELED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,8,inserted.id,null,null,deleted.APPROVED_OR_CANCELED_BY_EMPLOYEE_ID,inserted.APPROVED_OR_CANCELED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.APPROVED_OR_CANCELED_DATE),'''') <> ISNULL(STRING(inserted.APPROVED_OR_CANCELED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,9,inserted.id,null,null,deleted.APPROVED_OR_CANCELED_DATE,inserted.APPROVED_OR_CANCELED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ENTERED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.ENTERED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,10,inserted.id,null,null,deleted.ENTERED_BY_EMPLOYEE_ID,inserted.ENTERED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EDITED_TODAY,'''') <> ISNULL(inserted.EDITED_TODAY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,11,inserted.id,null,null,deleted.EDITED_TODAY,inserted.EDITED_TODAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TRANSMITTED,'''') <> ISNULL(inserted.TRANSMITTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,18,inserted.id,null,null,deleted.TRANSMITTED,inserted.TRANSMITTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_ORDER_VALUE),'''') <> ISNULL(STRING(inserted.TOTAL_ORDER_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,12,inserted.id,null,null,deleted.TOTAL_ORDER_VALUE,inserted.TOTAL_ORDER_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_RECEIVED_VALUE),'''') <> ISNULL(STRING(inserted.TOTAL_RECEIVED_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,13,inserted.id,null,null,deleted.TOTAL_RECEIVED_VALUE,inserted.TOTAL_RECEIVED_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LINE_ITEMS_ORDERED),'''') <> ISNULL(STRING(inserted.LINE_ITEMS_ORDERED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,14,inserted.id,null,null,deleted.LINE_ITEMS_ORDERED,inserted.LINE_ITEMS_ORDERED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORIGINAL_PO_NUMBER,'''') <> ISNULL(inserted.ORIGINAL_PO_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,15,inserted.id,null,null,deleted.ORIGINAL_PO_NUMBER,inserted.ORIGINAL_PO_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INTENDED_STORE_PURCHASE_CARD_NUMBER,'''') <> ISNULL(inserted.INTENDED_STORE_PURCHASE_CARD_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,237,17,inserted.id,null,null,deleted.INTENDED_STORE_PURCHASE_CARD_NUMBER,inserted.INTENDED_STORE_PURCHASE_CARD_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_buyout_item','BUYOUT_ITEM','B','U',1,'create trigger tr_bu_buyout_item before update on BUYOUT_ITEM referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.BUYOUT_ID),'''') <> ISNULL(STRING(inserted.BUYOUT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,1,inserted.id,null,null,deleted.BUYOUT_ID,inserted.BUYOUT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SEQUENCE),'''') <> ISNULL(STRING(inserted.SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,2,inserted.id,null,null,deleted.SEQUENCE,inserted.SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,3,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,4,inserted.id,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXPANDED_PART_NUMBER,'''') <> ISNULL(inserted.EXPANDED_PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,5,inserted.id,null,null,deleted.EXPANDED_PART_NUMBER,inserted.EXPANDED_PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUANTITY),'''') <> ISNULL(STRING(inserted.QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,6,inserted.id,null,null,deleted.QUANTITY,inserted.QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_COST),'''') <> ISNULL(STRING(inserted.UNIT_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,7,inserted.id,null,null,deleted.UNIT_COST,inserted.UNIT_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CORE_COST),'''') <> ISNULL(STRING(inserted.CORE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,8,inserted.id,null,null,deleted.CORE_COST,inserted.CORE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,9,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RECEIVED_QTY),'''') <> ISNULL(STRING(inserted.RECEIVED_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,10,inserted.id,null,null,deleted.RECEIVED_QTY,inserted.RECEIVED_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BACKORDER_QTY),'''') <> ISNULL(STRING(inserted.BACKORDER_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,11,inserted.id,null,null,deleted.BACKORDER_QTY,inserted.BACKORDER_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BILLED_TO_INVOICE_NUMBER),'''') <> ISNULL(STRING(inserted.BILLED_TO_INVOICE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,12,inserted.id,null,null,deleted.BILLED_TO_INVOICE_NUMBER,inserted.BILLED_TO_INVOICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BILLED_TO_INVOICE_DATE),'''') <> ISNULL(STRING(inserted.BILLED_TO_INVOICE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,13,inserted.id,null,null,deleted.BILLED_TO_INVOICE_DATE,inserted.BILLED_TO_INVOICE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_BUYOUT_ITEM_TYPE_CD,'''') <> ISNULL(inserted.REF_BUYOUT_ITEM_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,14,inserted.id,null,null,deleted.REF_BUYOUT_ITEM_TYPE_CD,inserted.REF_BUYOUT_ITEM_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_BUYOUT_ITEM_STATUS_CD,'''') <> ISNULL(inserted.REF_BUYOUT_ITEM_STATUS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,15,inserted.id,null,null,deleted.REF_BUYOUT_ITEM_STATUS_CD,inserted.REF_BUYOUT_ITEM_STATUS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GL_ACCOUNT),'''') <> ISNULL(STRING(inserted.GL_ACCOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,16,inserted.id,null,null,deleted.GL_ACCOUNT,inserted.GL_ACCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BILL_TO_CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.BILL_TO_CUSTOMER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,17,inserted.id,null,null,deleted.BILL_TO_CUSTOMER_ID,inserted.BILL_TO_CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CUSTOMER_ORDER_NUMBER,'''') <> ISNULL(inserted.CUSTOMER_ORDER_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,18,inserted.id,null,null,deleted.CUSTOMER_ORDER_NUMBER,inserted.CUSTOMER_ORDER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CUSTOMER_NAME,'''') <> ISNULL(inserted.CUSTOMER_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,19,inserted.id,null,null,deleted.CUSTOMER_NAME,inserted.CUSTOMER_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CUSTOMER_PHONE_NUMBER,'''') <> ISNULL(inserted.CUSTOMER_PHONE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,20,inserted.id,null,null,deleted.CUSTOMER_PHONE_NUMBER,inserted.CUSTOMER_PHONE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BILLED_UNIT_PRICE),'''') <> ISNULL(STRING(inserted.BILLED_UNIT_PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,21,inserted.id,null,null,deleted.BILLED_UNIT_PRICE,inserted.BILLED_UNIT_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BILLED_UNIT_COST),'''') <> ISNULL(STRING(inserted.BILLED_UNIT_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,22,inserted.id,null,null,deleted.BILLED_UNIT_COST,inserted.BILLED_UNIT_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BILLED_CORE_PRICE),'''') <> ISNULL(STRING(inserted.BILLED_CORE_PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,23,inserted.id,null,null,deleted.BILLED_CORE_PRICE,inserted.BILLED_CORE_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BILLED_CORE_COST),'''') <> ISNULL(STRING(inserted.BILLED_CORE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,24,inserted.id,null,null,deleted.BILLED_CORE_COST,inserted.BILLED_CORE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEPOSIT_INVOICE_NUMBER),'''') <> ISNULL(STRING(inserted.DEPOSIT_INVOICE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,25,inserted.id,null,null,deleted.DEPOSIT_INVOICE_NUMBER,inserted.DEPOSIT_INVOICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NEW_PO_NUMBER,'''') <> ISNULL(inserted.NEW_PO_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,26,inserted.id,null,null,deleted.NEW_PO_NUMBER,inserted.NEW_PO_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTERNAL_PRODUCT_CODE,'''') <> ISNULL(inserted.EXTERNAL_PRODUCT_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,241,27,inserted.id,null,null,deleted.EXTERNAL_PRODUCT_CODE,inserted.EXTERNAL_PRODUCT_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if fn_stripped_part_number(inserted.expanded_part_number) <> inserted.part_number then raiserror 18023 ''tr_bu_buyout_item: expanded_part_number '' || inserted.expanded_part_number || '' does not match part_number '' || inserted.part_number || ''.'' end if end', 'tr_bu_buyout_one_time_vendor','BUYOUT_ONE_TIME_VENDOR','B','U',1,'create trigger tr_bu_buyout_one_time_vendor before update on BUYOUT_ONE_TIME_VENDOR referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.VENDOR_NAME,'''') <> ISNULL(inserted.VENDOR_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,246,1,inserted.BUYOUT_ID,null,null,deleted.VENDOR_NAME,inserted.VENDOR_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS1,'''') <> ISNULL(inserted.ADDRESS1,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,246,2,inserted.BUYOUT_ID,null,null,deleted.ADDRESS1,inserted.ADDRESS1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS2,'''') <> ISNULL(inserted.ADDRESS2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,246,3,inserted.BUYOUT_ID,null,null,deleted.ADDRESS2,inserted.ADDRESS2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS3,'''') <> ISNULL(inserted.ADDRESS3,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,246,4,inserted.BUYOUT_ID,null,null,deleted.ADDRESS3,inserted.ADDRESS3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS4,'''') <> ISNULL(inserted.ADDRESS4,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,246,5,inserted.BUYOUT_ID,null,null,deleted.ADDRESS4,inserted.ADDRESS4,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CITY,'''') <> ISNULL(inserted.CITY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,246,6,inserted.BUYOUT_ID,null,null,deleted.CITY,inserted.CITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,246,7,inserted.BUYOUT_ID,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,246,8,inserted.BUYOUT_ID,null,null,deleted.POSTAL_CODE,inserted.POSTAL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,246,9,inserted.BUYOUT_ID,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PHONE,'''') <> ISNULL(inserted.PHONE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,246,10,inserted.BUYOUT_ID,null,null,deleted.PHONE,inserted.PHONE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_buyout_profile','BUYOUT_PROFILE','B','U',1,'create trigger tr_bu_buyout_profile before update on BUYOUT_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REQUIRE_PO_FOR_PICKUP_ITEMS),'''') <> ISNULL(STRING(inserted.REQUIRE_PO_FOR_PICKUP_ITEMS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,1,null,null,null,deleted.REQUIRE_PO_FOR_PICKUP_ITEMS,inserted.REQUIRE_PO_FOR_PICKUP_ITEMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_PO_ENTRY_FROM_INVOICING),'''') <> ISNULL(STRING(inserted.ALLOW_PO_ENTRY_FROM_INVOICING),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,2,null,null,null,deleted.ALLOW_PO_ENTRY_FROM_INVOICING,inserted.ALLOW_PO_ENTRY_FROM_INVOICING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REQUIRE_BILL_TO_INFO_ON_PO),'''') <> ISNULL(STRING(inserted.REQUIRE_BILL_TO_INFO_ON_PO),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,3,null,null,null,deleted.REQUIRE_BILL_TO_INFO_ON_PO,inserted.REQUIRE_BILL_TO_INFO_ON_PO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REQUIRE_VENDOR_INVOICE_INFO_ON_PO),'''') <> ISNULL(STRING(inserted.REQUIRE_VENDOR_INVOICE_INFO_ON_PO),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,4,null,null,null,deleted.REQUIRE_VENDOR_INVOICE_INFO_ON_PO,inserted.REQUIRE_VENDOR_INVOICE_INFO_ON_PO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_ONLY_ONE_VENDOR_INVOICE_PER_PO),'''') <> ISNULL(STRING(inserted.ALLOW_ONLY_ONE_VENDOR_INVOICE_PER_PO),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,5,null,null,null,deleted.ALLOW_ONLY_ONE_VENDOR_INVOICE_PER_PO,inserted.ALLOW_ONLY_ONE_VENDOR_INVOICE_PER_PO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REQUIRE_GL_INFO_ON_PO),'''') <> ISNULL(STRING(inserted.REQUIRE_GL_INFO_ON_PO),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,6,null,null,null,deleted.REQUIRE_GL_INFO_ON_PO,inserted.REQUIRE_GL_INFO_ON_PO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVENTORY_GL_CODE),'''') <> ISNULL(STRING(inserted.INVENTORY_GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,7,null,null,null,deleted.INVENTORY_GL_CODE,inserted.INVENTORY_GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REQUIRE_RGN_FOR_NEGATIVE_PO),'''') <> ISNULL(STRING(inserted.REQUIRE_RGN_FOR_NEGATIVE_PO),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,8,null,null,null,deleted.REQUIRE_RGN_FOR_NEGATIVE_PO,inserted.REQUIRE_RGN_FOR_NEGATIVE_PO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.POST_BUYOUT_RECEIPTS),'''') <> ISNULL(STRING(inserted.POST_BUYOUT_RECEIPTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,9,null,null,null,deleted.POST_BUYOUT_RECEIPTS,inserted.POST_BUYOUT_RECEIPTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UPDATE_INVENTORY_COSTS),'''') <> ISNULL(STRING(inserted.UPDATE_INVENTORY_COSTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,10,null,null,null,deleted.UPDATE_INVENTORY_COSTS,inserted.UPDATE_INVENTORY_COSTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_TAX_ID_CODE_ON_PO),'''') <> ISNULL(STRING(inserted.PRINT_TAX_ID_CODE_ON_PO),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,11,null,null,null,deleted.PRINT_TAX_ID_CODE_ON_PO,inserted.PRINT_TAX_ID_CODE_ON_PO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_ID_CODE,'''') <> ISNULL(inserted.TAX_ID_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,12,null,null,null,deleted.TAX_ID_CODE,inserted.TAX_ID_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TRANSMIT_DATA_TO_DIVISION),'''') <> ISNULL(STRING(inserted.TRANSMIT_DATA_TO_DIVISION),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,13,null,null,null,deleted.TRANSMIT_DATA_TO_DIVISION,inserted.TRANSMIT_DATA_TO_DIVISION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_APPROVED_CANCELED_PO_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_APPROVED_CANCELED_PO_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,14,null,null,null,deleted.KEEP_APPROVED_CANCELED_PO_MONTHS,inserted.KEEP_APPROVED_CANCELED_PO_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEPOSITS_TAKEN_FOR_SPECIAL_ORDERS),'''') <> ISNULL(STRING(inserted.DEPOSITS_TAKEN_FOR_SPECIAL_ORDERS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,15,null,null,null,deleted.DEPOSITS_TAKEN_FOR_SPECIAL_ORDERS,inserted.DEPOSITS_TAKEN_FOR_SPECIAL_ORDERS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SERVING_DC_VENDOR_ID),'''') <> ISNULL(STRING(inserted.SERVING_DC_VENDOR_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,235,16,null,null,null,deleted.SERVING_DC_VENDOR_ID,inserted.SERVING_DC_VENDOR_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_buyout_vendor_invoice','BUYOUT_VENDOR_INVOICE','B','U',1,'create trigger tr_bu_buyout_vendor_invoice before update on BUYOUT_VENDOR_INVOICE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.BUYOUT_ID),'''') <> ISNULL(STRING(inserted.BUYOUT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,245,1,inserted.id,null,null,deleted.BUYOUT_ID,inserted.BUYOUT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INVOICE_NUMBER,'''') <> ISNULL(inserted.INVOICE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,245,2,inserted.id,null,null,deleted.INVOICE_NUMBER,inserted.INVOICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_DATE),'''') <> ISNULL(STRING(inserted.INVOICE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,245,3,inserted.id,null,null,deleted.INVOICE_DATE,inserted.INVOICE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_AMOUNT),'''') <> ISNULL(STRING(inserted.INVOICE_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,245,4,inserted.id,null,null,deleted.INVOICE_AMOUNT,inserted.INVOICE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CASH_JOURNAL_DATE),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,245,5,inserted.id,null,null,deleted.CASH_JOURNAL_DATE,inserted.CASH_JOURNAL_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_BUYOUT_PAYMENT_TYPE_CD,'''') <> ISNULL(inserted.REF_BUYOUT_PAYMENT_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,245,6,inserted.id,null,null,deleted.REF_BUYOUT_PAYMENT_TYPE_CD,inserted.REF_BUYOUT_PAYMENT_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STORE_PURCHASE_CARD_NUMBER,'''') <> ISNULL(inserted.STORE_PURCHASE_CARD_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,245,7,inserted.id,null,null,deleted.STORE_PURCHASE_CARD_NUMBER,inserted.STORE_PURCHASE_CARD_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_cash_journal','CASH_JOURNAL','B','U',1,'create trigger tr_bu_cash_journal before update on CASH_JOURNAL referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.ACCOUNTING_DATE),'''') <> ISNULL(STRING(inserted.ACCOUNTING_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,1,inserted.ID,null,null,deleted.ACCOUNTING_DATE,inserted.ACCOUNTING_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CALENDAR_DATE),'''') <> ISNULL(STRING(inserted.CALENDAR_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,2,inserted.ID,null,null,deleted.CALENDAR_DATE,inserted.CALENDAR_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BEGINNING_INVOICE_NUMBER),'''') <> ISNULL(STRING(inserted.BEGINNING_INVOICE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,3,inserted.ID,null,null,deleted.BEGINNING_INVOICE_NUMBER,inserted.BEGINNING_INVOICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ENDING_INVOICE_NUMBER),'''') <> ISNULL(STRING(inserted.ENDING_INVOICE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,4,inserted.ID,null,null,deleted.ENDING_INVOICE_NUMBER,inserted.ENDING_INVOICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_COUNT),'''') <> ISNULL(STRING(inserted.INVOICE_COUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,5,inserted.ID,null,null,deleted.INVOICE_COUNT,inserted.INVOICE_COUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FINALIZED,'''') <> ISNULL(inserted.FINALIZED,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,6,inserted.ID,null,null,deleted.FINALIZED,inserted.FINALIZED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FINALIZED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.FINALIZED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,7,inserted.ID,null,null,deleted.FINALIZED_BY_EMPLOYEE_ID,inserted.FINALIZED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FINALIZED_DATE),'''') <> ISNULL(STRING(inserted.FINALIZED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,8,inserted.ID,null,null,deleted.FINALIZED_DATE,inserted.FINALIZED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CASH_INVOICE_AMOUNT_TOTAL),'''') <> ISNULL(STRING(inserted.CASH_INVOICE_AMOUNT_TOTAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,9,inserted.ID,null,null,deleted.CASH_INVOICE_AMOUNT_TOTAL,inserted.CASH_INVOICE_AMOUNT_TOTAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CASH_REFUNDS_TOTAL),'''') <> ISNULL(STRING(inserted.CASH_REFUNDS_TOTAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,10,inserted.ID,null,null,deleted.CASH_REFUNDS_TOTAL,inserted.CASH_REFUNDS_TOTAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ROA_TOTAL),'''') <> ISNULL(STRING(inserted.ROA_TOTAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,11,inserted.ID,null,null,deleted.ROA_TOTAL,inserted.ROA_TOTAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ROA_DISCOUNTS_TOTAL),'''') <> ISNULL(STRING(inserted.ROA_DISCOUNTS_TOTAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,12,inserted.ID,null,null,deleted.ROA_DISCOUNTS_TOTAL,inserted.ROA_DISCOUNTS_TOTAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NET_CHARGE_TRANSACTIONS),'''') <> ISNULL(STRING(inserted.NET_CHARGE_TRANSACTIONS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,13,inserted.ID,null,null,deleted.NET_CHARGE_TRANSACTIONS,inserted.NET_CHARGE_TRANSACTIONS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LAST_ACCOUNTING_DAY_IN_MONTH,'''') <> ISNULL(inserted.LAST_ACCOUNTING_DAY_IN_MONTH,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,640,14,inserted.ID,null,null,deleted.LAST_ACCOUNTING_DAY_IN_MONTH,inserted.LAST_ACCOUNTING_DAY_IN_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_cash_journal_check','CASH_JOURNAL_CHECK','B','U',1,'create trigger tr_bu_cash_journal_check before update on CASH_JOURNAL_CHECK referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CASH_JOURNAL_ID),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_ID),'''') then call sp_log_file_update_activity(inserted.LOC,647,1,inserted.ID,null,null,deleted.CASH_JOURNAL_ID,inserted.CASH_JOURNAL_ID,null,null,null,1) end if;if ISNULL(deleted.CHECK_TYPE,'''') <> ISNULL(inserted.CHECK_TYPE,'''') then call sp_log_file_update_activity(inserted.LOC,647,2,inserted.ID,null,null,deleted.CHECK_TYPE,inserted.CHECK_TYPE,null,null,null,1) end if;if ISNULL(STRING(deleted.CASH_JOURNAL_CURRENCY_DEPOSIT_ID),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_CURRENCY_DEPOSIT_ID),'''') then call sp_log_file_update_activity(inserted.LOC,647,3,inserted.ID,null,null,deleted.CASH_JOURNAL_CURRENCY_DEPOSIT_ID,inserted.CASH_JOURNAL_CURRENCY_DEPOSIT_ID,null,null,null,1) end if;if ISNULL(STRING(deleted.CUSTOMER_NUMBER),'''') <> ISNULL(STRING(inserted.CUSTOMER_NUMBER),'''') then call sp_log_file_update_activity(inserted.LOC,647,4,inserted.ID,null,null,deleted.CUSTOMER_NUMBER,inserted.CUSTOMER_NUMBER,null,null,null,1) end if;if ISNULL(deleted.CHECK_NAME,'''') <> ISNULL(inserted.CHECK_NAME,'''') then call sp_log_file_update_activity(inserted.LOC,647,5,inserted.ID,null,null,deleted.CHECK_NAME,inserted.CHECK_NAME,null,null,null,1) end if;if ISNULL(deleted.CHECK_NUMBER,'''') <> ISNULL(inserted.CHECK_NUMBER,'''') then call sp_log_file_update_activity(inserted.LOC,647,6,inserted.ID,null,null,deleted.CHECK_NUMBER,inserted.CHECK_NUMBER,null,null,null,1) end if;if ISNULL(STRING(deleted.CHECK_AMOUNT),'''') <> ISNULL(STRING(inserted.CHECK_AMOUNT),'''') then call sp_log_file_update_activity(inserted.LOC,647,7,inserted.ID,null,null,deleted.CHECK_AMOUNT,inserted.CHECK_AMOUNT,null,null,null,1) end if;if ISNULL(STRING(deleted.DISCOUNT_AMOUNT),'''') <> ISNULL(STRING(inserted.DISCOUNT_AMOUNT),'''') then call sp_log_file_update_activity(inserted.LOC,647,8,inserted.ID,null,null,deleted.DISCOUNT_AMOUNT,inserted.DISCOUNT_AMOUNT,null,null,null,1) end if end', 'tr_bu_cash_journal_currency_deposit','CASH_JOURNAL_CURRENCY_DEPOSIT','B','U',1,'create trigger tr_bu_cash_journal_currency_deposit before update on CASH_JOURNAL_CURRENCY_DEPOSIT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CASH_JOURNAL_ID),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,1,inserted.ID,null,null,deleted.CASH_JOURNAL_ID,inserted.CASH_JOURNAL_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEPOSIT_DATE),'''') <> ISNULL(STRING(inserted.DEPOSIT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,2,inserted.ID,null,null,deleted.DEPOSIT_DATE,inserted.DEPOSIT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENCY_AMOUNT),'''') <> ISNULL(STRING(inserted.CURRENCY_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,3,inserted.ID,null,null,deleted.CURRENCY_AMOUNT,inserted.CURRENCY_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COINS_AMOUNT),'''') <> ISNULL(STRING(inserted.COINS_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,4,inserted.ID,null,null,deleted.COINS_AMOUNT,inserted.COINS_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CASH_DRAWER_FUND),'''') <> ISNULL(STRING(inserted.CASH_DRAWER_FUND),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,5,inserted.ID,null,null,deleted.CASH_DRAWER_FUND,inserted.CASH_DRAWER_FUND,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CHECKS_GROSS_AMOUNT),'''') <> ISNULL(STRING(inserted.CHECKS_GROSS_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,6,inserted.ID,null,null,deleted.CHECKS_GROSS_AMOUNT,inserted.CHECKS_GROSS_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PENNIES),'''') <> ISNULL(STRING(inserted.PENNIES),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,7,inserted.ID,null,null,deleted.PENNIES,inserted.PENNIES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NICKELS),'''') <> ISNULL(STRING(inserted.NICKELS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,8,inserted.ID,null,null,deleted.NICKELS,inserted.NICKELS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DIMES),'''') <> ISNULL(STRING(inserted.DIMES),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,9,inserted.ID,null,null,deleted.DIMES,inserted.DIMES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUARTERS),'''') <> ISNULL(STRING(inserted.QUARTERS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,10,inserted.ID,null,null,deleted.QUARTERS,inserted.QUARTERS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.HALF_DOLLARS),'''') <> ISNULL(STRING(inserted.HALF_DOLLARS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,11,inserted.ID,null,null,deleted.HALF_DOLLARS,inserted.HALF_DOLLARS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DOLLAR_COINS),'''') <> ISNULL(STRING(inserted.DOLLAR_COINS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,12,inserted.ID,null,null,deleted.DOLLAR_COINS,inserted.DOLLAR_COINS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ONE_DOLLAR_BILLS),'''') <> ISNULL(STRING(inserted.ONE_DOLLAR_BILLS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,13,inserted.ID,null,null,deleted.ONE_DOLLAR_BILLS,inserted.ONE_DOLLAR_BILLS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TWO_DOLLAR_BILLS),'''') <> ISNULL(STRING(inserted.TWO_DOLLAR_BILLS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,14,inserted.ID,null,null,deleted.TWO_DOLLAR_BILLS,inserted.TWO_DOLLAR_BILLS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FIVE_DOLLAR_BILLS),'''') <> ISNULL(STRING(inserted.FIVE_DOLLAR_BILLS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,15,inserted.ID,null,null,deleted.FIVE_DOLLAR_BILLS,inserted.FIVE_DOLLAR_BILLS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TEN_DOLLAR_BILLS),'''') <> ISNULL(STRING(inserted.TEN_DOLLAR_BILLS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,16,inserted.ID,null,null,deleted.TEN_DOLLAR_BILLS,inserted.TEN_DOLLAR_BILLS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TWENTY_DOLLAR_BILLS),'''') <> ISNULL(STRING(inserted.TWENTY_DOLLAR_BILLS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,17,inserted.ID,null,null,deleted.TWENTY_DOLLAR_BILLS,inserted.TWENTY_DOLLAR_BILLS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FIFTY_DOLLAR_BILLS),'''') <> ISNULL(STRING(inserted.FIFTY_DOLLAR_BILLS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,18,inserted.ID,null,null,deleted.FIFTY_DOLLAR_BILLS,inserted.FIFTY_DOLLAR_BILLS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ONE_HUNDRED_DOLLAR_BILLS),'''') <> ISNULL(STRING(inserted.ONE_HUNDRED_DOLLAR_BILLS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,19,inserted.ID,null,null,deleted.ONE_HUNDRED_DOLLAR_BILLS,inserted.ONE_HUNDRED_DOLLAR_BILLS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_DEPOSIT_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_DEPOSIT_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,20,inserted.ID,null,null,deleted.REF_DEPOSIT_TYPE_ID,inserted.REF_DEPOSIT_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DEPOSIT_SLIP_NUMBER,'''') <> ISNULL(inserted.DEPOSIT_SLIP_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,642,21,inserted.ID,null,null,deleted.DEPOSIT_SLIP_NUMBER,inserted.DEPOSIT_SLIP_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_cash_journal_eft_deposit','CASH_JOURNAL_EFT_DEPOSIT','B','U',1,'create trigger tr_bu_cash_journal_eft_deposit before update on CASH_JOURNAL_EFT_DEPOSIT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CASH_JOURNAL_ID),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,643,1,inserted.ID,null,null,deleted.CASH_JOURNAL_ID,inserted.CASH_JOURNAL_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEPOSIT_DATE),'''') <> ISNULL(STRING(inserted.DEPOSIT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,643,2,inserted.ID,null,null,deleted.DEPOSIT_DATE,inserted.DEPOSIT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT),'''') <> ISNULL(STRING(inserted.AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,643,3,inserted.ID,null,null,deleted.AMOUNT,inserted.AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CUSTOMER_NUMBER),'''') <> ISNULL(STRING(inserted.CUSTOMER_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,643,4,inserted.ID,null,null,deleted.CUSTOMER_NUMBER,inserted.CUSTOMER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EFT_IDENTIFIER,'''') <> ISNULL(inserted.EFT_IDENTIFIER,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,643,5,inserted.ID,null,null,deleted.EFT_IDENTIFIER,inserted.EFT_IDENTIFIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_cash_journal_misc_receipt','CASH_JOURNAL_MISC_RECEIPT','B','U',1,'create trigger tr_bu_cash_journal_misc_receipt before update on CASH_JOURNAL_MISC_RECEIPT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CASH_JOURNAL_ID),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,645,1,inserted.ID,null,null,deleted.CASH_JOURNAL_ID,inserted.CASH_JOURNAL_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GL_CODE),'''') <> ISNULL(STRING(inserted.GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,645,2,inserted.ID,null,null,deleted.GL_CODE,inserted.GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT_RECEIVED),'''') <> ISNULL(STRING(inserted.AMOUNT_RECEIVED),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,645,3,inserted.ID,null,null,deleted.AMOUNT_RECEIVED,inserted.AMOUNT_RECEIVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RECEIVED_FROM,'''') <> ISNULL(inserted.RECEIVED_FROM,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,645,4,inserted.ID,null,null,deleted.RECEIVED_FROM,inserted.RECEIVED_FROM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,645,5,inserted.ID,null,null,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DC_CODE,'''') <> ISNULL(inserted.DC_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,645,6,inserted.ID,null,null,deleted.DC_CODE,inserted.DC_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STORE_CODE,'''') <> ISNULL(inserted.STORE_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,645,7,inserted.ID,null,null,deleted.STORE_CODE,inserted.STORE_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_cash_journal_other_deposit','CASH_JOURNAL_OTHER_DEPOSIT','B','U',1,'create trigger tr_bu_cash_journal_other_deposit before update on CASH_JOURNAL_OTHER_DEPOSIT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CASH_JOURNAL_ID),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,641,1,inserted.ID,null,null,deleted.CASH_JOURNAL_ID,inserted.CASH_JOURNAL_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEPOSIT_DATE),'''') <> ISNULL(STRING(inserted.DEPOSIT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,641,2,inserted.ID,null,null,deleted.DEPOSIT_DATE,inserted.DEPOSIT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_TENDER_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_TENDER_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,641,3,inserted.ID,null,null,deleted.REF_TENDER_TYPE_ID,inserted.REF_TENDER_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GROSS_AMOUNT),'''') <> ISNULL(STRING(inserted.GROSS_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,641,4,inserted.ID,null,null,deleted.GROSS_AMOUNT,inserted.GROSS_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_DEPOSIT_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_DEPOSIT_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,641,6,inserted.ID,null,null,deleted.REF_DEPOSIT_TYPE_ID,inserted.REF_DEPOSIT_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_cash_journal_over_short','CASH_JOURNAL_OVER_SHORT','B','U',1,'create trigger tr_bu_cash_journal_over_short before update on CASH_JOURNAL_OVER_SHORT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CASH_JOURNAL_ID),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,644,1,inserted.ID,null,null,deleted.CASH_JOURNAL_ID,inserted.CASH_JOURNAL_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GL_CODE),'''') <> ISNULL(STRING(inserted.GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,644,2,inserted.ID,null,null,deleted.GL_CODE,inserted.GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EMPLOYEE_NUMBER),'''') <> ISNULL(STRING(inserted.EMPLOYEE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,644,3,inserted.ID,null,null,deleted.EMPLOYEE_NUMBER,inserted.EMPLOYEE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CUSTOMER_NUMBER),'''') <> ISNULL(STRING(inserted.CUSTOMER_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,644,4,inserted.ID,null,null,deleted.CUSTOMER_NUMBER,inserted.CUSTOMER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT),'''') <> ISNULL(STRING(inserted.AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,644,5,inserted.ID,null,null,deleted.AMOUNT,inserted.AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,644,6,inserted.ID,null,null,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_cash_journal_paid_out','CASH_JOURNAL_PAID_OUT','B','U',1,'create trigger tr_bu_cash_journal_paid_out before update on CASH_JOURNAL_PAID_OUT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CASH_JOURNAL_ID),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,646,1,inserted.ID,null,null,deleted.CASH_JOURNAL_ID,inserted.CASH_JOURNAL_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GL_CODE),'''') <> ISNULL(STRING(inserted.GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,646,2,inserted.ID,null,null,deleted.GL_CODE,inserted.GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT),'''') <> ISNULL(STRING(inserted.AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,646,3,inserted.ID,null,null,deleted.AMOUNT,inserted.AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PAID_TO,'''') <> ISNULL(inserted.PAID_TO,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,646,4,inserted.ID,null,null,deleted.PAID_TO,inserted.PAID_TO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,646,5,inserted.ID,null,null,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CUSTOMER_NUMBER_OR_LINE_CODE),'''') <> ISNULL(STRING(inserted.CUSTOMER_NUMBER_OR_LINE_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,646,6,inserted.ID,null,null,deleted.CUSTOMER_NUMBER_OR_LINE_CODE,inserted.CUSTOMER_NUMBER_OR_LINE_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DC_CODE,'''') <> ISNULL(inserted.DC_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,646,7,inserted.ID,null,null,deleted.DC_CODE,inserted.DC_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STORE_CODE,'''') <> ISNULL(inserted.STORE_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,646,8,inserted.ID,null,null,deleted.STORE_CODE,inserted.STORE_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_cash_journal_profile','CASH_JOURNAL_PROFILE','B','U',1,'create trigger tr_bu_cash_journal_profile before update on CASH_JOURNAL_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.TRANSMIT_DATA_TO_DIVISION),'''') <> ISNULL(STRING(inserted.TRANSMIT_DATA_TO_DIVISION),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,473,1,null,null,null,deleted.TRANSMIT_DATA_TO_DIVISION,inserted.TRANSMIT_DATA_TO_DIVISION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AR_GL_CODE),'''') <> ISNULL(STRING(inserted.AR_GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,473,2,null,null,null,deleted.AR_GL_CODE,inserted.AR_GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CASH_GL_CODE),'''') <> ISNULL(STRING(inserted.CASH_GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,473,3,null,null,null,deleted.CASH_GL_CODE,inserted.CASH_GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAYMENT_DISCOUNT_GL_CODE),'''') <> ISNULL(STRING(inserted.PAYMENT_DISCOUNT_GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,473,4,null,null,null,deleted.PAYMENT_DISCOUNT_GL_CODE,inserted.PAYMENT_DISCOUNT_GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MERCHANT_FEES_GL_CODE),'''') <> ISNULL(STRING(inserted.MERCHANT_FEES_GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,473,5,null,null,null,deleted.MERCHANT_FEES_GL_CODE,inserted.MERCHANT_FEES_GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AR_TRADE_GL_CODE),'''') <> ISNULL(STRING(inserted.AR_TRADE_GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,473,6,null,null,null,deleted.AR_TRADE_GL_CODE,inserted.AR_TRADE_GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AR_CASH_SALES_GL_CODE),'''') <> ISNULL(STRING(inserted.AR_CASH_SALES_GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,473,7,null,null,null,deleted.AR_CASH_SALES_GL_CODE,inserted.AR_CASH_SALES_GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_CASH_JOURNAL_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_CASH_JOURNAL_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,473,8,null,null,null,deleted.KEEP_CASH_JOURNAL_MONTHS,inserted.KEEP_CASH_JOURNAL_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_CHECK_DEPOSIT_TRACKING),'''') <> ISNULL(STRING(inserted.USE_CHECK_DEPOSIT_TRACKING),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,473,9,null,null,null,deleted.USE_CHECK_DEPOSIT_TRACKING,inserted.USE_CHECK_DEPOSIT_TRACKING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TO_OFFICE_DEPOSIT),'''') <> ISNULL(STRING(inserted.TO_OFFICE_DEPOSIT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,473,10,null,null,null,deleted.TO_OFFICE_DEPOSIT,inserted.TO_OFFICE_DEPOSIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_cash_journal_roa','CASH_JOURNAL_ROA','B','U',1,'create trigger tr_bu_cash_journal_roa before update on CASH_JOURNAL_ROA referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_TENDER_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_TENDER_TYPE_ID),'''') then call sp_log_file_update_activity(inserted.LOC,648,1,inserted.ID,null,null,deleted.REF_TENDER_TYPE_ID,inserted.REF_TENDER_TYPE_ID,null,null,null,1) end if;if ISNULL(STRING(deleted.CASH_JOURNAL_ID),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_ID),'''') then call sp_log_file_update_activity(inserted.LOC,648,2,inserted.ID,null,null,deleted.CASH_JOURNAL_ID,inserted.CASH_JOURNAL_ID,null,null,null,1) end if;if ISNULL(STRING(deleted.CUSTOMER_NUMBER),'''') <> ISNULL(STRING(inserted.CUSTOMER_NUMBER),'''') then call sp_log_file_update_activity(inserted.LOC,648,3,inserted.ID,null,null,deleted.CUSTOMER_NUMBER,inserted.CUSTOMER_NUMBER,null,null,null,1) end if;if ISNULL(STRING(deleted.PAYMENT_REFERENCE),'''') <> ISNULL(STRING(inserted.PAYMENT_REFERENCE),'''') then call sp_log_file_update_activity(inserted.LOC,648,4,inserted.ID,null,null,deleted.PAYMENT_REFERENCE,inserted.PAYMENT_REFERENCE,null,null,null,1) end if;if ISNULL(STRING(deleted.PAYMENT_IDENTIFIER),'''') <> ISNULL(STRING(inserted.PAYMENT_IDENTIFIER),'''') then call sp_log_file_update_activity(inserted.LOC,648,5,inserted.ID,null,null,deleted.PAYMENT_IDENTIFIER,inserted.PAYMENT_IDENTIFIER,null,null,null,1) end if;if ISNULL(STRING(deleted.PAYMENT_AMOUNT),'''') <> ISNULL(STRING(inserted.PAYMENT_AMOUNT),'''') then call sp_log_file_update_activity(inserted.LOC,648,6,inserted.ID,null,null,deleted.PAYMENT_AMOUNT,inserted.PAYMENT_AMOUNT,null,null,null,1) end if;if ISNULL(STRING(deleted.DISCOUNT_AMOUNT),'''') <> ISNULL(STRING(inserted.DISCOUNT_AMOUNT),'''') then call sp_log_file_update_activity(inserted.LOC,648,7,inserted.ID,null,null,deleted.DISCOUNT_AMOUNT,inserted.DISCOUNT_AMOUNT,null,null,null,1) end if;if ISNULL(deleted.CHECK_NUMBER,'''') <> ISNULL(inserted.CHECK_NUMBER,'''') then call sp_log_file_update_activity(inserted.LOC,648,8,inserted.ID,null,null,deleted.CHECK_NUMBER,inserted.CHECK_NUMBER,null,null,null,1) end if end', 'tr_bu_cash_journal_roa_application','CASH_JOURNAL_ROA_APPLICATION','B','U',1,'create trigger tr_bu_cash_journal_roa_application before update on CASH_JOURNAL_ROA_APPLICATION referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CASH_JOURNAL_ROA_ID),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_ROA_ID),'''') then call sp_log_file_update_activity(inserted.LOC,649,1,inserted.ID,null,null,deleted.CASH_JOURNAL_ROA_ID,inserted.CASH_JOURNAL_ROA_ID,null,null,null,1) end if;if ISNULL(STRING(deleted.INVOICE_NUMBER),'''') <> ISNULL(STRING(inserted.INVOICE_NUMBER),'''') then call sp_log_file_update_activity(inserted.LOC,649,2,inserted.ID,null,null,deleted.INVOICE_NUMBER,inserted.INVOICE_NUMBER,null,null,null,1) end if;if ISNULL(STRING(deleted.AMOUNT_APPLIED),'''') <> ISNULL(STRING(inserted.AMOUNT_APPLIED),'''') then call sp_log_file_update_activity(inserted.LOC,649,3,inserted.ID,null,null,deleted.AMOUNT_APPLIED,inserted.AMOUNT_APPLIED,null,null,null,1) end if;if ISNULL(STRING(deleted.DISCOUNT_APPLIED),'''') <> ISNULL(STRING(inserted.DISCOUNT_APPLIED),'''') then call sp_log_file_update_activity(inserted.LOC,649,4,inserted.ID,null,null,deleted.DISCOUNT_APPLIED,inserted.DISCOUNT_APPLIED,null,null,null,1) end if end', 'tr_bu_certification_part','CERTIFICATION_PART','B','U',1,'create trigger tr_bu_certification_part before update on CERTIFICATION_PART referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CERTIFICATION_PART_GROUP_ID),'''') <> ISNULL(STRING(inserted.CERTIFICATION_PART_GROUP_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,676,1,inserted.inventory_id,inserted.certification_part_group_id,null,deleted.CERTIFICATION_PART_GROUP_ID,inserted.CERTIFICATION_PART_GROUP_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BEGIN_DATE),'''') <> ISNULL(STRING(inserted.BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,676,2,inserted.inventory_id,inserted.certification_part_group_id,null,deleted.BEGIN_DATE,inserted.BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_DATE),'''') <> ISNULL(STRING(inserted.END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,676,3,inserted.inventory_id,inserted.certification_part_group_id,null,deleted.END_DATE,inserted.END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAPA_RESERVED,'''') <> ISNULL(inserted.NAPA_RESERVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,676,4,inserted.inventory_id,inserted.certification_part_group_id,null,deleted.NAPA_RESERVED,inserted.NAPA_RESERVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_certification_part_group','CERTIFICATION_PART_GROUP','B','U',1,'create trigger tr_bu_certification_part_group before update on CERTIFICATION_PART_GROUP referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.CERTIFICATION_CATEGORY,'''') <> ISNULL(inserted.CERTIFICATION_CATEGORY,'''') then i_return_status=call sp_log_file_update_activity(1,674,1,inserted.id,null,null,deleted.CERTIFICATION_CATEGORY,inserted.CERTIFICATION_CATEGORY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CERTIFICATION_GROUP),'''') <> ISNULL(STRING(inserted.CERTIFICATION_GROUP),'''') then i_return_status=call sp_log_file_update_activity(1,674,2,inserted.id,null,null,deleted.CERTIFICATION_GROUP,inserted.CERTIFICATION_GROUP,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(1,674,3,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_classification_order','CLASSIFICATION_ORDER','B','U',1,'create trigger tr_bu_classification_order before update on CLASSIFICATION_ORDER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CLASSIFICATION_SESSION_ID),'''') <> ISNULL(STRING(inserted.CLASSIFICATION_SESSION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,537,1,inserted.id,null,null,deleted.CLASSIFICATION_SESSION_ID,inserted.CLASSIFICATION_SESSION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DATE_CREATED),'''') <> ISNULL(STRING(inserted.DATE_CREATED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,537,2,inserted.id,null,null,deleted.DATE_CREATED,inserted.DATE_CREATED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PO_NUMBER,'''') <> ISNULL(inserted.PO_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,537,4,inserted.id,null,null,deleted.PO_NUMBER,inserted.PO_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_classification_profile','CLASSIFICATION_PROFILE','B','U',1,'create trigger tr_bu_classification_profile before update on CLASSIFICATION_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.NUM_OF_SESSIONS_TO_KEEP_WITH_DETAIL),'''') <> ISNULL(STRING(inserted.NUM_OF_SESSIONS_TO_KEEP_WITH_DETAIL),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,536,1,null,null,null,deleted.NUM_OF_SESSIONS_TO_KEEP_WITH_DETAIL,inserted.NUM_OF_SESSIONS_TO_KEEP_WITH_DETAIL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_CLASS_SUMMARY_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_CLASS_SUMMARY_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,536,2,null,null,null,deleted.KEEP_CLASS_SUMMARY_MONTHS,inserted.KEEP_CLASS_SUMMARY_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PASSWORD,'''') <> ISNULL(inserted.PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,536,3,null,null,null,deleted.PASSWORD,inserted.PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PASSWORD_EFF_UNTIL_DATE),'''') <> ISNULL(STRING(inserted.PASSWORD_EFF_UNTIL_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,536,4,null,null,null,deleted.PASSWORD_EFF_UNTIL_DATE,inserted.PASSWORD_EFF_UNTIL_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AUTO_PROCESS_PLANOGRAM_UPDATES,'''') <> ISNULL(inserted.AUTO_PROCESS_PLANOGRAM_UPDATES,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,536,5,null,null,null,deleted.AUTO_PROCESS_PLANOGRAM_UPDATES,inserted.AUTO_PROCESS_PLANOGRAM_UPDATES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PREVENT_ON_HAND_CHANGE),'''') <> ISNULL(STRING(inserted.PREVENT_ON_HAND_CHANGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,536,6,null,null,null,deleted.PREVENT_ON_HAND_CHANGE,inserted.PREVENT_ON_HAND_CHANGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_classification_return','CLASSIFICATION_RETURN','B','U',1,'create trigger tr_bu_classification_return before update on CLASSIFICATION_RETURN referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CLASSIFICATION_SESSION_ID),'''') <> ISNULL(STRING(inserted.CLASSIFICATION_SESSION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,548,1,inserted.id,null,null,deleted.CLASSIFICATION_SESSION_ID,inserted.CLASSIFICATION_SESSION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DATE_CREATED),'''') <> ISNULL(STRING(inserted.DATE_CREATED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,548,2,inserted.id,null,null,deleted.DATE_CREATED,inserted.DATE_CREATED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_NUMBER),'''') <> ISNULL(STRING(inserted.RGN_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,548,4,inserted.id,null,null,deleted.RGN_NUMBER,inserted.RGN_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_classification_session','CLASSIFICATION_SESSION','B','U',1,'create trigger tr_bu_classification_session before update on CLASSIFICATION_SESSION referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.SESSION_CREATED_DATE),'''') <> ISNULL(STRING(inserted.SESSION_CREATED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,1,inserted.id,null,null,deleted.SESSION_CREATED_DATE,inserted.SESSION_CREATED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,2,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_ID,inserted.CREATED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,3,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_CLASS_METHOD_ID),'''') <> ISNULL(STRING(inserted.REF_CLASS_METHOD_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,4,inserted.id,null,null,deleted.REF_CLASS_METHOD_ID,inserted.REF_CLASS_METHOD_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_CLASS_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_CLASS_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,5,inserted.id,null,null,deleted.REF_CLASS_TYPE_ID,inserted.REF_CLASS_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRIMARY_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.PRIMARY_STOCKING_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,7,inserted.id,null,null,deleted.PRIMARY_STOCKING_REF_CLASS_CD,inserted.PRIMARY_STOCKING_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TRACTOR_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.TRACTOR_STOCKING_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,8,inserted.id,null,null,deleted.TRACTOR_STOCKING_REF_CLASS_CD,inserted.TRACTOR_STOCKING_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.HIGH_PERFORMANCE_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.HIGH_PERFORMANCE_STOCKING_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,9,inserted.id,null,null,deleted.HIGH_PERFORMANCE_STOCKING_REF_CLASS_CD,inserted.HIGH_PERFORMANCE_STOCKING_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.OPTIONAL_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.OPTIONAL_STOCKING_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,10,inserted.id,null,null,deleted.OPTIONAL_STOCKING_REF_CLASS_CD,inserted.OPTIONAL_STOCKING_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MACHINE_SHOP_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.MACHINE_SHOP_STOCKING_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,11,inserted.id,null,null,deleted.MACHINE_SHOP_STOCKING_REF_CLASS_CD,inserted.MACHINE_SHOP_STOCKING_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PROCESS_DISKETTES,'''') <> ISNULL(inserted.PROCESS_DISKETTES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,12,inserted.id,null,null,deleted.PROCESS_DISKETTES,inserted.PROCESS_DISKETTES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_LISTING_PRINTED,'''') <> ISNULL(inserted.LINE_LISTING_PRINTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,13,inserted.id,null,null,deleted.LINE_LISTING_PRINTED,inserted.LINE_LISTING_PRINTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CREATE_RETURN,'''') <> ISNULL(inserted.CREATE_RETURN,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,14,inserted.id,null,null,deleted.CREATE_RETURN,inserted.CREATE_RETURN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CREATE_ORDER_RETURN_AT_EOD,'''') <> ISNULL(inserted.CREATE_ORDER_RETURN_AT_EOD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,15,inserted.id,null,null,deleted.CREATE_ORDER_RETURN_AT_EOD,inserted.CREATE_ORDER_RETURN_AT_EOD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.IMPROVEMENT_ITEMS_VALUE),'''') <> ISNULL(STRING(inserted.IMPROVEMENT_ITEMS_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,16,inserted.id,null,null,deleted.IMPROVEMENT_ITEMS_VALUE,inserted.IMPROVEMENT_ITEMS_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SESSION_FINALIZED_DATE),'''') <> ISNULL(STRING(inserted.SESSION_FINALIZED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,17,inserted.id,null,null,deleted.SESSION_FINALIZED_DATE,inserted.SESSION_FINALIZED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DC_MESSAGE,'''') <> ISNULL(inserted.DC_MESSAGE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,18,inserted.id,null,null,deleted.DC_MESSAGE,inserted.DC_MESSAGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FINALIZE_STARTED,'''') <> ISNULL(inserted.FINALIZE_STARTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,20,inserted.id,null,null,deleted.FINALIZE_STARTED,inserted.FINALIZE_STARTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORDER_POSTED,'''') <> ISNULL(inserted.ORDER_POSTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,21,inserted.id,null,null,deleted.ORDER_POSTED,inserted.ORDER_POSTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RETURN_POSTED,'''') <> ISNULL(inserted.RETURN_POSTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,22,inserted.id,null,null,deleted.RETURN_POSTED,inserted.RETURN_POSTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORDER_REPORT_PRINTED,'''') <> ISNULL(inserted.ORDER_REPORT_PRINTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,23,inserted.id,null,null,deleted.ORDER_REPORT_PRINTED,inserted.ORDER_REPORT_PRINTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RETURN_PACKING_SLIP_PRINTED,'''') <> ISNULL(inserted.RETURN_PACKING_SLIP_PRINTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,24,inserted.id,null,null,deleted.RETURN_PACKING_SLIP_PRINTED,inserted.RETURN_PACKING_SLIP_PRINTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MIN_MAX_CHANGE_REPORT_PRINTED,'''') <> ISNULL(inserted.MIN_MAX_CHANGE_REPORT_PRINTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,25,inserted.id,null,null,deleted.MIN_MAX_CHANGE_REPORT_PRINTED,inserted.MIN_MAX_CHANGE_REPORT_PRINTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AUDIT_REPORT_PRINTED,'''') <> ISNULL(inserted.AUDIT_REPORT_PRINTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,26,inserted.id,null,null,deleted.AUDIT_REPORT_PRINTED,inserted.AUDIT_REPORT_PRINTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POSTING_ERRORS_REPORT_PRINTED,'''') <> ISNULL(inserted.POSTING_ERRORS_REPORT_PRINTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,27,inserted.id,null,null,deleted.POSTING_ERRORS_REPORT_PRINTED,inserted.POSTING_ERRORS_REPORT_PRINTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORDER_RETURN_RECAP_PRINTED,'''') <> ISNULL(inserted.ORDER_RETURN_RECAP_PRINTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,28,inserted.id,null,null,deleted.ORDER_RETURN_RECAP_PRINTED,inserted.ORDER_RETURN_RECAP_PRINTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TRANSMIT_FILE_CREATED,'''') <> ISNULL(inserted.TRANSMIT_FILE_CREATED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,29,inserted.id,null,null,deleted.TRANSMIT_FILE_CREATED,inserted.TRANSMIT_FILE_CREATED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MIC_ORDER_RETURN_NUMBER),'''') <> ISNULL(STRING(inserted.MIC_ORDER_RETURN_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,30,inserted.id,null,null,deleted.MIC_ORDER_RETURN_NUMBER,inserted.MIC_ORDER_RETURN_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.POSTED_ORDER_VALUE),'''') <> ISNULL(STRING(inserted.POSTED_ORDER_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,31,inserted.id,null,null,deleted.POSTED_ORDER_VALUE,inserted.POSTED_ORDER_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.POSTED_RETURN_VALUE),'''') <> ISNULL(STRING(inserted.POSTED_RETURN_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,32,inserted.id,null,null,deleted.POSTED_RETURN_VALUE,inserted.POSTED_RETURN_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.WMS_TRANSACTION_STATUS),'''') <> ISNULL(STRING(inserted.WMS_TRANSACTION_STATUS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,540,33,inserted.id,null,null,deleted.WMS_TRANSACTION_STATUS,inserted.WMS_TRANSACTION_STATUS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_communication_access_number','COMMUNICATION_ACCESS_NUMBER','B','U',1,'create trigger tr_bu_communication_access_number before update on COMMUNICATION_ACCESS_NUMBER referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from communication_directory where id=deleted.communication_directory_id and loc=deleted.loc;if ISNULL(STRING(deleted.COMMUNICATION_DIRECTORY_ID),'''') <> ISNULL(STRING(inserted.COMMUNICATION_DIRECTORY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,469,1,inserted.id,null,null,deleted.COMMUNICATION_DIRECTORY_ID,inserted.COMMUNICATION_DIRECTORY_ID,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(STRING(deleted.SEQUENCE),'''') <> ISNULL(STRING(inserted.SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,469,2,inserted.id,null,null,deleted.SEQUENCE,inserted.SEQUENCE,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.PHONE_NUMBER,'''') <> ISNULL(inserted.PHONE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,469,3,inserted.id,null,null,deleted.PHONE_NUMBER,inserted.PHONE_NUMBER,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.IP_ADDRESS_OR_ALIAS,'''') <> ISNULL(inserted.IP_ADDRESS_OR_ALIAS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,469,4,inserted.id,null,null,deleted.IP_ADDRESS_OR_ALIAS,inserted.IP_ADDRESS_OR_ALIAS,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.FTP_PROGRAM_NAME,'''') <> ISNULL(inserted.FTP_PROGRAM_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,469,5,inserted.id,null,null,deleted.FTP_PROGRAM_NAME,inserted.FTP_PROGRAM_NAME,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if i_return_status=-1 then update communication_directory set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.communication_directory_id and loc=inserted.loc end if end', 'tr_bu_communication_directory','COMMUNICATION_DIRECTORY','B','U',1,'create trigger tr_bu_communication_directory before update on COMMUNICATION_DIRECTORY referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare i_customer_domain integer;declare v_ctext varchar(100);set i_customer_domain=0;set v_ctext=inserted.id;if ISNULL(STRING(deleted.REF_COMMUNICATION_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_COMMUNICATION_TYPE_ID),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,462,1,inserted.id,null,null,deleted.REF_COMMUNICATION_TYPE_ID,inserted.REF_COMMUNICATION_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,462,2,inserted.id,null,null,deleted.NAME,inserted.NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PASSWORD,'''') <> ISNULL(inserted.PASSWORD,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,462,3,inserted.id,null,null,deleted.PASSWORD,inserted.PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TIMEOUT_MINUTES),'''') <> ISNULL(STRING(inserted.TIMEOUT_MINUTES),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,462,5,inserted.id,null,null,deleted.TIMEOUT_MINUTES,inserted.TIMEOUT_MINUTES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_REMOTE_SYSTEM_TYPE_CD,'''') <> ISNULL(inserted.REF_REMOTE_SYSTEM_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,462,6,inserted.id,null,null,deleted.REF_REMOTE_SYSTEM_TYPE_CD,inserted.REF_REMOTE_SYSTEM_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISPLAY_ON_HAND_DETAILS,'''') <> ISNULL(inserted.DISPLAY_ON_HAND_DETAILS,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,462,7,inserted.id,null,null,deleted.DISPLAY_ON_HAND_DETAILS,inserted.DISPLAY_ON_HAND_DETAILS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_TO_CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.INVOICE_TO_CUSTOMER_ID),'''') then set i_customer_domain=1;set v_ctext=''|'' || deleted.INVOICE_TO_CUSTOMER_ID;i_return_status=call sp_log_file_update_activity(inserted.loc,462,8,inserted.id,null,null,deleted.INVOICE_TO_CUSTOMER_ID,inserted.INVOICE_TO_CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BELONGS_TO_AR_COMM_GROUP,'''') <> ISNULL(inserted.BELONGS_TO_AR_COMM_GROUP,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,462,9,inserted.id,null,null,deleted.BELONGS_TO_AR_COMM_GROUP,inserted.BELONGS_TO_AR_COMM_GROUP,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BELONGS_TO_INVENTORY_COMM_GROUP,'''') <> ISNULL(inserted.BELONGS_TO_INVENTORY_COMM_GROUP,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,462,10,inserted.id,null,null,deleted.BELONGS_TO_INVENTORY_COMM_GROUP,inserted.BELONGS_TO_INVENTORY_COMM_GROUP,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CALL_SEQUENCE),'''') <> ISNULL(STRING(inserted.CALL_SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,462,11,inserted.id,null,null,deleted.CALL_SEQUENCE,inserted.CALL_SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STORE_USING_TAMSII,'''') <> ISNULL(inserted.STORE_USING_TAMSII,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,462,12,inserted.id,null,null,deleted.STORE_USING_TAMSII,inserted.STORE_USING_TAMSII,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_CATALOG_DATA_VERSION_ID),'''') <> ISNULL(STRING(inserted.REF_CATALOG_DATA_VERSION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,462,13,inserted.id,null,null,deleted.REF_CATALOG_DATA_VERSION_ID,inserted.REF_CATALOG_DATA_VERSION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_DC_STOCK_CHECK,'''') <> ISNULL(inserted.ALLOW_DC_STOCK_CHECK,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,462,14,inserted.id,null,null,deleted.ALLOW_DC_STOCK_CHECK,inserted.ALLOW_DC_STOCK_CHECK,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PROLINK_ACCOUNT_NUMBER),'''') <> ISNULL(STRING(inserted.PROLINK_ACCOUNT_NUMBER),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,462,15,inserted.id,null,null,deleted.PROLINK_ACCOUNT_NUMBER,inserted.PROLINK_ACCOUNT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STORE_ON_VPN,'''') <> ISNULL(inserted.STORE_ON_VPN,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,462,16,inserted.id,null,null,deleted.STORE_ON_VPN,inserted.STORE_ON_VPN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.GENERATE_RECEIPTS_FOR_INVOICES,'''') <> ISNULL(inserted.GENERATE_RECEIPTS_FOR_INVOICES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,462,17,inserted.id,null,null,deleted.GENERATE_RECEIPTS_FOR_INVOICES,inserted.GENERATE_RECEIPTS_FOR_INVOICES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STORE_NUMBER,'''') <> ISNULL(inserted.STORE_NUMBER,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,462,18,inserted.id,null,null,deleted.STORE_NUMBER,inserted.STORE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ISSC_SEARCH_SEQUENCE),'''') <> ISNULL(STRING(inserted.ISSC_SEARCH_SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,462,19,inserted.id,null,null,deleted.ISSC_SEARCH_SEQUENCE,inserted.ISSC_SEARCH_SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if(MOD((select use_site_relationship_feed from store_profile where loc=inserted.loc),10)=1) and inserted.ref_communication_type_id=2 then if ISNULL(deleted.name,''!'') <> ISNULL(inserted.name,''!'') or ISNULL(deleted.password,''!'') <> ISNULL(inserted.Password,''!'') or ISNULL(deleted.Invoice_TO_Customer_id,0) <> ISNULL(inserted.Invoice_TO_Customer_id,0) or ISNULL(deleted.Call_Sequence,0) <> ISNULL(inserted.Call_Sequence,0) then insert into communication_directory_change_queue(id,communication_directory_id,loc,action) values(null,inserted.id,inserted.loc,''U'') end if end if;if ISNULL(deleted.INVOICE_TO_CUSTOMER_ID,'''') <> ISNULL(inserted.INVOICE_TO_CUSTOMER_ID,'''') then set i_customer_domain=1 end if;if(select send_customer_domain from store_profile)=''Y'' and i_customer_domain=1 and ISNULL(inserted.INVOICE_TO_CUSTOMER_ID,0) > 0 then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(inserted.INVOICE_TO_CUSTOMER_ID,deleted.loc,''U'',''COMMUNICATION_DIRECTORY'',v_ctext) end if;if(inserted.store_on_vpn is not null and inserted.ref_communication_type_id <> 2) then raiserror 18025 ''18025: tr_bu_communication_directory: communication_directory.store_on_vpn can not be set for non-interstore.'' end if;if(inserted.store_on_vpn is null and inserted.ref_communication_type_id=2) then raiserror 18025 ''18025: tr_bu_communication_directory: communication_directory.store_on_vpn must be either Y or N for interstore.'' end if;if(inserted.store_number is not null and inserted.ref_communication_type_id <> 2) then raiserror 18096 ''18096: tr_bu_communication_directory: communication_directory.store_number can not be set for non-interstore.'' end if;if(inserted.issc_search_sequence is not null and inserted.ref_communication_type_id <> 2) then raiserror 18097 ''18097: tr_bu_communication_directory: communication_directory.issc_search_sequence can not be set for non-interstore.'' end if end', 'tr_bu_company','COMPANY','B','U',1,'create trigger tr_bu_company before update on COMPANY referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.MODIFIED_BY_EMPLOYEE_LOC,8,1,inserted.ID,null,null,deleted.NAME,inserted.NAME,inserted.DATE_MODIFIED,inserted.MODIFIED_BY_EMPLOYEE_ID,deleted.DATE_MODIFIED,1) end if;if i_return_status=-1 then set inserted.MODIFIED_BY_EMPLOYEE_ID=null;set inserted.DATE_MODIFIED=current timestamp end if end', 'tr_bu_core_bank_maintenance','CORE_BANK_MAINTENANCE','B','U',1,'create trigger tr_bu_core_bank_maintenance before update on CORE_BANK_MAINTENANCE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.PURCHASE_INVOICE_ID),'''') <> ISNULL(STRING(inserted.PURCHASE_INVOICE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,1,inserted.ID,null,null,deleted.PURCHASE_INVOICE_ID,inserted.PURCHASE_INVOICE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PURCHASE_INVOICE_NUMBER),'''') <> ISNULL(STRING(inserted.PURCHASE_INVOICE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,2,inserted.ID,null,null,deleted.PURCHASE_INVOICE_NUMBER,inserted.PURCHASE_INVOICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PURCHASE_INVOICE_DATE),'''') <> ISNULL(STRING(inserted.PURCHASE_INVOICE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,3,inserted.ID,null,null,deleted.PURCHASE_INVOICE_DATE,inserted.PURCHASE_INVOICE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QTY_TO_BE_RETURNED),'''') <> ISNULL(STRING(inserted.QTY_TO_BE_RETURNED),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,4,inserted.ID,null,null,deleted.QTY_TO_BE_RETURNED,inserted.QTY_TO_BE_RETURNED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,5,inserted.ID,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,6,inserted.ID,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_CORE_STATUS_ID),'''') <> ISNULL(STRING(inserted.REF_CORE_STATUS_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,7,inserted.ID,null,null,deleted.REF_CORE_STATUS_ID,inserted.REF_CORE_STATUS_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CORE_PRICE),'''') <> ISNULL(STRING(inserted.CORE_PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,8,inserted.ID,null,null,deleted.CORE_PRICE,inserted.CORE_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REASON,'''') <> ISNULL(inserted.REASON,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,10,inserted.ID,null,null,deleted.REASON,inserted.REASON,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PAYMENT_OR_CREDIT_APPLIED,'''') <> ISNULL(inserted.PAYMENT_OR_CREDIT_APPLIED,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,11,inserted.ID,null,null,deleted.PAYMENT_OR_CREDIT_APPLIED,inserted.PAYMENT_OR_CREDIT_APPLIED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_LINE_ITEM_SEQUENCE),'''') <> ISNULL(STRING(inserted.INVOICE_LINE_ITEM_SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,663,12,inserted.ID,null,null,deleted.INVOICE_LINE_ITEM_SEQUENCE,inserted.INVOICE_LINE_ITEM_SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_core_bank_profile','CORE_BANK_PROFILE','B','U',1,'create trigger tr_bu_core_bank_profile before update on CORE_BANK_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.LAST_WRITEOFF_DATE),'''') <> ISNULL(STRING(inserted.LAST_WRITEOFF_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,664,1,null,null,null,deleted.LAST_WRITEOFF_DATE,inserted.LAST_WRITEOFF_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer','CUSTOMER','B','U',1,'create trigger tr_bu_customer before update on CUSTOMER referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare i_customer_domain integer;declare v_ctext varchar(100);set i_customer_domain=0;if ISNULL(deleted.REF_CUSTOMER_TYPE_CD,'''') <> ISNULL(inserted.REF_CUSTOMER_TYPE_CD,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,1,inserted.id,null,null,deleted.REF_CUSTOMER_TYPE_CD,inserted.REF_CUSTOMER_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CUSTOMER_NUM),'''') <> ISNULL(STRING(inserted.CUSTOMER_NUM),'''') then set i_customer_domain=1;set v_ctext=deleted.CUSTOMER_NUM;i_return_status=call sp_log_file_update_activity(inserted.loc,68,2,inserted.id,null,null,deleted.CUSTOMER_NUM,inserted.CUSTOMER_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALPHA_KEY,'''') <> ISNULL(inserted.ALPHA_KEY,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,3,inserted.id,null,null,deleted.ALPHA_KEY,inserted.ALPHA_KEY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,4,inserted.id,null,null,deleted.NAME,inserted.NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS1,'''') <> ISNULL(inserted.ADDRESS1,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,5,inserted.id,null,null,deleted.ADDRESS1,inserted.ADDRESS1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS2,'''') <> ISNULL(inserted.ADDRESS2,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,6,inserted.id,null,null,deleted.ADDRESS2,inserted.ADDRESS2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS3,'''') <> ISNULL(inserted.ADDRESS3,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,7,inserted.id,null,null,deleted.ADDRESS3,inserted.ADDRESS3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS4,'''') <> ISNULL(inserted.ADDRESS4,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,8,inserted.id,null,null,deleted.ADDRESS4,inserted.ADDRESS4,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CITY,'''') <> ISNULL(inserted.CITY,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,9,inserted.id,null,null,deleted.CITY,inserted.CITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,10,inserted.id,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,11,inserted.id,null,null,deleted.POSTAL_CODE,inserted.POSTAL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,12,inserted.id,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PHONE,'''') <> ISNULL(inserted.PHONE,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,13,inserted.id,null,null,deleted.PHONE,inserted.PHONE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTENSION,'''') <> ISNULL(inserted.EXTENSION,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,14,inserted.id,null,null,deleted.EXTENSION,inserted.EXTENSION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SPEED_DIAL,'''') <> ISNULL(inserted.SPEED_DIAL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,15,inserted.id,null,null,deleted.SPEED_DIAL,inserted.SPEED_DIAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FAX_NUMBER,'''') <> ISNULL(inserted.FAX_NUMBER,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,16,inserted.id,null,null,deleted.FAX_NUMBER,inserted.FAX_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EMAIL,'''') <> ISNULL(inserted.EMAIL,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,17,inserted.id,null,null,deleted.EMAIL,inserted.EMAIL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.WEB_ADDRESS,'''') <> ISNULL(inserted.WEB_ADDRESS,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,18,inserted.id,null,null,deleted.WEB_ADDRESS,inserted.WEB_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_NAPA_CUSTOMER_CATEGORY_ID),'''') <> ISNULL(STRING(inserted.REF_NAPA_CUSTOMER_CATEGORY_ID),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,19,inserted.id,null,null,deleted.REF_NAPA_CUSTOMER_CATEGORY_ID,inserted.REF_NAPA_CUSTOMER_CATEGORY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STORE_CATEGORY_ID),'''') <> ISNULL(STRING(inserted.STORE_CATEGORY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,20,inserted.id,null,null,deleted.STORE_CATEGORY_ID,inserted.STORE_CATEGORY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CUSTOMER_NOTE_ID),'''') <> ISNULL(STRING(inserted.CUSTOMER_NOTE_ID),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,21,inserted.id,null,null,deleted.CUSTOMER_NOTE_ID,inserted.CUSTOMER_NOTE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCOUNT_ESTABLISH_DATE),'''') <> ISNULL(STRING(inserted.ACCOUNT_ESTABLISH_DATE),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,22,inserted.id,null,null,deleted.ACCOUNT_ESTABLISH_DATE,inserted.ACCOUNT_ESTABLISH_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_LANGUAGE_CD,'''') <> ISNULL(inserted.REF_LANGUAGE_CD,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,23,inserted.id,null,null,deleted.REF_LANGUAGE_CD,inserted.REF_LANGUAGE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_BILLING_TYPE_CD,'''') <> ISNULL(inserted.REF_BILLING_TYPE_CD,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,24,inserted.id,null,null,deleted.REF_BILLING_TYPE_CD,inserted.REF_BILLING_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALESMAN_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.SALESMAN_EMPLOYEE_ID),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,25,inserted.id,null,null,deleted.SALESMAN_EMPLOYEE_ID,inserted.SALESMAN_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TRANSMIT_JSA_SALES,'''') <> ISNULL(inserted.TRANSMIT_JSA_SALES,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,26,inserted.id,null,null,deleted.TRANSMIT_JSA_SALES,inserted.TRANSMIT_JSA_SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TRANSMIT_NATIONAL_SALES,'''') <> ISNULL(inserted.TRANSMIT_NATIONAL_SALES,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,27,inserted.id,null,null,deleted.TRANSMIT_NATIONAL_SALES,inserted.TRANSMIT_NATIONAL_SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USUAL_REF_PRICE_SHEET_CD,'''') <> ISNULL(inserted.USUAL_REF_PRICE_SHEET_CD,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,28,inserted.id,null,null,deleted.USUAL_REF_PRICE_SHEET_CD,inserted.USUAL_REF_PRICE_SHEET_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USUAL_PRICE_MARKUP_PERCENT),'''') <> ISNULL(STRING(inserted.USUAL_PRICE_MARKUP_PERCENT),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,29,inserted.id,null,null,deleted.USUAL_PRICE_MARKUP_PERCENT,inserted.USUAL_PRICE_MARKUP_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USUAL_PRICE_REF_CURRENCY_ROUNDING_CD,'''') <> ISNULL(inserted.USUAL_PRICE_REF_CURRENCY_ROUNDING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,30,inserted.id,null,null,deleted.USUAL_PRICE_REF_CURRENCY_ROUNDING_CD,inserted.USUAL_PRICE_REF_CURRENCY_ROUNDING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_SALE_DATE),'''') <> ISNULL(STRING(inserted.LAST_SALE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,31,inserted.id,null,null,deleted.LAST_SALE_DATE,inserted.LAST_SALE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_EMPLOYEE_ERASE_CORE,'''') <> ISNULL(inserted.ALLOW_EMPLOYEE_ERASE_CORE,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,59,inserted.id,null,null,deleted.ALLOW_EMPLOYEE_ERASE_CORE,inserted.ALLOW_EMPLOYEE_ERASE_CORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_MSDS_FOR_CUSTOMER,'''') <> ISNULL(inserted.PRINT_MSDS_FOR_CUSTOMER,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,33,inserted.id,null,null,deleted.PRINT_MSDS_FOR_CUSTOMER,inserted.PRINT_MSDS_FOR_CUSTOMER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_CATALOG_NOTES_ON_INVOICE,'''') <> ISNULL(inserted.PRINT_CATALOG_NOTES_ON_INVOICE,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,34,inserted.id,null,null,deleted.PRINT_CATALOG_NOTES_ON_INVOICE,inserted.PRINT_CATALOG_NOTES_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AUTHORIZED_BUYERS_ONLY,'''') <> ISNULL(inserted.AUTHORIZED_BUYERS_ONLY,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,35,inserted.id,null,null,deleted.AUTHORIZED_BUYERS_ONLY,inserted.AUTHORIZED_BUYERS_ONLY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_BACKORDERS,'''') <> ISNULL(inserted.ALLOW_BACKORDERS,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,36,inserted.id,null,null,deleted.ALLOW_BACKORDERS,inserted.ALLOW_BACKORDERS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CUSTOMER_VEHICLE_LIST_QUANTITY),'''') <> ISNULL(STRING(inserted.CUSTOMER_VEHICLE_LIST_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,60,inserted.id,null,null,deleted.CUSTOMER_VEHICLE_LIST_QUANTITY,inserted.CUSTOMER_VEHICLE_LIST_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_BALANCE_ON_INV,'''') <> ISNULL(inserted.PRINT_BALANCE_ON_INV,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,37,inserted.id,null,null,deleted.PRINT_BALANCE_ON_INV,inserted.PRINT_BALANCE_ON_INV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_SPECIAL_ORDERS,'''') <> ISNULL(inserted.ALLOW_SPECIAL_ORDERS,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,38,inserted.id,null,null,deleted.ALLOW_SPECIAL_ORDERS,inserted.ALLOW_SPECIAL_ORDERS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MISC_INV_DISCOUNT_REF_OPTION_CD,'''') <> ISNULL(inserted.MISC_INV_DISCOUNT_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,39,inserted.id,null,null,deleted.MISC_INV_DISCOUNT_REF_OPTION_CD,inserted.MISC_INV_DISCOUNT_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MISC_INV_DISC_PERCENT),'''') <> ISNULL(STRING(inserted.MISC_INV_DISC_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,40,inserted.id,null,null,deleted.MISC_INV_DISC_PERCENT,inserted.MISC_INV_DISC_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SURCHARGE_REF_OPTION_CD,'''') <> ISNULL(inserted.SURCHARGE_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,41,inserted.id,null,null,deleted.SURCHARGE_REF_OPTION_CD,inserted.SURCHARGE_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_SURCHARGE_TYPE_CD,'''') <> ISNULL(inserted.REF_SURCHARGE_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,42,inserted.id,null,null,deleted.REF_SURCHARGE_TYPE_CD,inserted.REF_SURCHARGE_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SURCHARGE_AMOUNT),'''') <> ISNULL(STRING(inserted.SURCHARGE_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,43,inserted.id,null,null,deleted.SURCHARGE_AMOUNT,inserted.SURCHARGE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXTRA_INV_COPIES),'''') <> ISNULL(STRING(inserted.EXTRA_INV_COPIES),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,44,inserted.id,null,null,deleted.EXTRA_INV_COPIES,inserted.EXTRA_INV_COPIES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALTERNATE_CORE_CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.ALTERNATE_CORE_CUSTOMER_ID),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,45,inserted.id,null,null,deleted.ALTERNATE_CORE_CUSTOMER_ID,inserted.ALTERNATE_CORE_CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,46,inserted.id,null,null,deleted.TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,47,inserted.id,null,null,deleted.TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_EXEMPT_NUM_PRIMARY,'''') <> ISNULL(inserted.TAX_EXEMPT_NUM_PRIMARY,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,48,inserted.id,null,null,deleted.TAX_EXEMPT_NUM_PRIMARY,inserted.TAX_EXEMPT_NUM_PRIMARY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TAX_EXEMPT_PRIMARY_EXP_DATE),'''') <> ISNULL(STRING(inserted.TAX_EXEMPT_PRIMARY_EXP_DATE),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,49,inserted.id,null,null,deleted.TAX_EXEMPT_PRIMARY_EXP_DATE,inserted.TAX_EXEMPT_PRIMARY_EXP_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_EXEMPT_NUM_SECONDARY,'''') <> ISNULL(inserted.TAX_EXEMPT_NUM_SECONDARY,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,50,inserted.id,null,null,deleted.TAX_EXEMPT_NUM_SECONDARY,inserted.TAX_EXEMPT_NUM_SECONDARY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TAX_EXEMPT_SECONDARY_EXP_DATE),'''') <> ISNULL(STRING(inserted.TAX_EXEMPT_SECONDARY_EXP_DATE),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,51,inserted.id,null,null,deleted.TAX_EXEMPT_SECONDARY_EXP_DATE,inserted.TAX_EXEMPT_SECONDARY_EXP_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DELIVERED_TAX_TABLE_ID),'''') <> ISNULL(STRING(inserted.DELIVERED_TAX_TABLE_ID),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,52,inserted.id,null,null,deleted.DELIVERED_TAX_TABLE_ID,inserted.DELIVERED_TAX_TABLE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEFAULT_TAX_TABLE_ID),'''') <> ISNULL(STRING(inserted.DEFAULT_TAX_TABLE_ID),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,53,inserted.id,null,null,deleted.DEFAULT_TAX_TABLE_ID,inserted.DEFAULT_TAX_TABLE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MIN_AMT_FOR_PO),'''') <> ISNULL(STRING(inserted.MIN_AMT_FOR_PO),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,54,inserted.id,null,null,deleted.MIN_AMT_FOR_PO,inserted.MIN_AMT_FOR_PO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MONTHLY_SALES_POTENTIAL),'''') <> ISNULL(STRING(inserted.MONTHLY_SALES_POTENTIAL),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,55,inserted.id,null,null,deleted.MONTHLY_SALES_POTENTIAL,inserted.MONTHLY_SALES_POTENTIAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SALES_ID_NUM,'''') <> ISNULL(inserted.SALES_ID_NUM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,56,inserted.id,null,null,deleted.SALES_ID_NUM,inserted.SALES_ID_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CHECK_FOR_MISC_CHG_EXEMPTIONS,'''') <> ISNULL(inserted.CHECK_FOR_MISC_CHG_EXEMPTIONS,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,57,inserted.id,null,null,deleted.CHECK_FOR_MISC_CHG_EXEMPTIONS,inserted.CHECK_FOR_MISC_CHG_EXEMPTIONS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ACTIVE_ACCOUNT,'''') <> ISNULL(inserted.ACTIVE_ACCOUNT,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,58,inserted.id,null,null,deleted.ACTIVE_ACCOUNT,inserted.ACTIVE_ACCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CUSTOMER_TYPICALLY_PRESENT_DURING_INVOICING,'''') <> ISNULL(inserted.CUSTOMER_TYPICALLY_PRESENT_DURING_INVOICING,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,61,inserted.id,null,null,deleted.CUSTOMER_TYPICALLY_PRESENT_DURING_INVOICING,inserted.CUSTOMER_TYPICALLY_PRESENT_DURING_INVOICING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRIORITY_PLUS),'''') <> ISNULL(STRING(inserted.PRIORITY_PLUS),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,62,inserted.id,null,null,deleted.PRIORITY_PLUS,inserted.PRIORITY_PLUS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRIMARY_TAX_IDENTIFIER,'''') <> ISNULL(inserted.PRIMARY_TAX_IDENTIFIER,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,63,inserted.id,null,null,deleted.PRIMARY_TAX_IDENTIFIER,inserted.PRIMARY_TAX_IDENTIFIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SECONDARY_TAX_IDENTIFIER,'''') <> ISNULL(inserted.SECONDARY_TAX_IDENTIFIER,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,64,inserted.id,null,null,deleted.SECONDARY_TAX_IDENTIFIER,inserted.SECONDARY_TAX_IDENTIFIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IBS_ACCOUNT,'''') <> ISNULL(inserted.IBS_ACCOUNT,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,65,inserted.id,null,null,deleted.IBS_ACCOUNT,inserted.IBS_ACCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DIRECT_SHIPMENT_ELIGIBLE,'''') <> ISNULL(inserted.DIRECT_SHIPMENT_ELIGIBLE,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,66,inserted.id,null,null,deleted.DIRECT_SHIPMENT_ELIGIBLE,inserted.DIRECT_SHIPMENT_ELIGIBLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DNS_CUSTOMER),'''') <> ISNULL(STRING(inserted.DNS_CUSTOMER),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,67,inserted.id,null,null,deleted.DNS_CUSTOMER,inserted.DNS_CUSTOMER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DEFAULT_REF_ELECTRONIC_INVOICE_TYPE_CD,'''') <> ISNULL(inserted.DEFAULT_REF_ELECTRONIC_INVOICE_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,68,inserted.id,null,null,deleted.DEFAULT_REF_ELECTRONIC_INVOICE_TYPE_CD,inserted.DEFAULT_REF_ELECTRONIC_INVOICE_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_ONLY_CORE_SALES,'''') <> ISNULL(inserted.ALLOW_ONLY_CORE_SALES,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,69,inserted.id,null,null,deleted.ALLOW_ONLY_CORE_SALES,inserted.ALLOW_ONLY_CORE_SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CFDI_NAME,'''') <> ISNULL(inserted.CFDI_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,70,inserted.id,null,null,deleted.CFDI_NAME,inserted.CFDI_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INVOICE_EMAIL_ADDRESS,'''') <> ISNULL(inserted.INVOICE_EMAIL_ADDRESS,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,71,inserted.id,null,null,deleted.INVOICE_EMAIL_ADDRESS,inserted.INVOICE_EMAIL_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CEPDI_CORPORATION_TYPE,'''') <> ISNULL(inserted.CEPDI_CORPORATION_TYPE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,72,inserted.id,null,null,deleted.CEPDI_CORPORATION_TYPE,inserted.CEPDI_CORPORATION_TYPE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAX_DISCOUNT_PCT),'''') <> ISNULL(STRING(inserted.MAX_DISCOUNT_PCT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,73,inserted.id,null,null,deleted.MAX_DISCOUNT_PCT,inserted.MAX_DISCOUNT_PCT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRICE_LOCKED),'''') <> ISNULL(STRING(inserted.PRICE_LOCKED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,74,inserted.id,null,null,deleted.PRICE_LOCKED,inserted.PRICE_LOCKED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_EMAIL_INVOICE_DELIVERY_OPTIONS_ID),'''') <> ISNULL(STRING(inserted.REF_EMAIL_INVOICE_DELIVERY_OPTIONS_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,75,inserted.id,null,null,deleted.REF_EMAIL_INVOICE_DELIVERY_OPTIONS_ID,inserted.REF_EMAIL_INVOICE_DELIVERY_OPTIONS_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EMAIL_INVOICE_TENDER_VIA,'''') <> ISNULL(inserted.EMAIL_INVOICE_TENDER_VIA,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,76,inserted.id,null,null,deleted.EMAIL_INVOICE_TENDER_VIA,inserted.EMAIL_INVOICE_TENDER_VIA,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DO_NOT_EMAIL_ROA_INVOICE,'''') <> ISNULL(inserted.DO_NOT_EMAIL_ROA_INVOICE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,77,inserted.id,null,null,deleted.DO_NOT_EMAIL_ROA_INVOICE,inserted.DO_NOT_EMAIL_ROA_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SEND_INVOICE_EMAIL_AFTER_DELIVERY,'''') <> ISNULL(inserted.SEND_INVOICE_EMAIL_AFTER_DELIVERY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,78,inserted.id,null,null,deleted.SEND_INVOICE_EMAIL_AFTER_DELIVERY,inserted.SEND_INVOICE_EMAIL_AFTER_DELIVERY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_AND_EMAIL_CUSTOMER_STATEMENTS,'''') <> ISNULL(inserted.PRINT_AND_EMAIL_CUSTOMER_STATEMENTS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,79,inserted.id,null,null,deleted.PRINT_AND_EMAIL_CUSTOMER_STATEMENTS,inserted.PRINT_AND_EMAIL_CUSTOMER_STATEMENTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CPP_FLAG),'''') <> ISNULL(STRING(inserted.CPP_FLAG),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,80,inserted.id,null,null,deleted.CPP_FLAG,inserted.CPP_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.GLOBAL_CUSTOMER_ID,'''') <> ISNULL(inserted.GLOBAL_CUSTOMER_ID,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,68,81,inserted.id,null,null,deleted.GLOBAL_CUSTOMER_ID,inserted.GLOBAL_CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_TRANSMITTED_DATE),'''') <> ISNULL(STRING(inserted.LAST_TRANSMITTED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,82,inserted.id,null,null,deleted.LAST_TRANSMITTED_DATE,inserted.LAST_TRANSMITTED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AAA_CUSTOMER,'''') <> ISNULL(inserted.AAA_CUSTOMER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,83,inserted.id,null,null,deleted.AAA_CUSTOMER,inserted.AAA_CUSTOMER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SEND_OPEN_INVOICES_WITH_STATEMENT,'''') <> ISNULL(inserted.SEND_OPEN_INVOICES_WITH_STATEMENT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,84,inserted.id,null,null,deleted.SEND_OPEN_INVOICES_WITH_STATEMENT,inserted.SEND_OPEN_INVOICES_WITH_STATEMENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CAPTURE_ESIGNATURE_ON_INVOICE,'''') <> ISNULL(inserted.CAPTURE_ESIGNATURE_ON_INVOICE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,68,85,inserted.id,null,null,deleted.CAPTURE_ESIGNATURE_ON_INVOICE,inserted.CAPTURE_ESIGNATURE_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if((select send_customer_domain from store_profile)=''Y'') and i_customer_domain=1 then insert into customer_change_queue(customer_id,loc,action,trigger_source,deleted_value) values(deleted.id,deleted.loc,''U'',''CUSTOMER'',v_ctext) end if end', 'tr_bu_customer_ar','CUSTOMER_AR','B','U',1,'create trigger tr_bu_customer_ar before update on CUSTOMER_AR referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare i_customer_domain integer;declare v_ctext varchar(1000);set i_customer_domain=0;if ISNULL(STRING(deleted.REF_STATEMENT_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_STATEMENT_TYPE_ID),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,1,inserted.customer_id,null,null,deleted.REF_STATEMENT_TYPE_ID,inserted.REF_STATEMENT_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STATEMENT_CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.STATEMENT_CUSTOMER_ID),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,2,inserted.customer_id,null,null,deleted.STATEMENT_CUSTOMER_ID,inserted.STATEMENT_CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXTRA_STATEMENT_COPIES),'''') <> ISNULL(STRING(inserted.EXTRA_STATEMENT_COPIES),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,3,inserted.customer_id,null,null,deleted.EXTRA_STATEMENT_COPIES,inserted.EXTRA_STATEMENT_COPIES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AR_TERMS_ID),'''') <> ISNULL(STRING(inserted.AR_TERMS_ID),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,4,inserted.customer_id,null,null,deleted.AR_TERMS_ID,inserted.AR_TERMS_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.COMBINED_STATEMENT,'''') <> ISNULL(inserted.COMBINED_STATEMENT,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,5,inserted.customer_id,null,null,deleted.COMBINED_STATEMENT,inserted.COMBINED_STATEMENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREDIT_LIMIT),'''') <> ISNULL(STRING(inserted.CREDIT_LIMIT),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,6,inserted.customer_id,null,null,deleted.CREDIT_LIMIT,inserted.CREDIT_LIMIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STORE_RESPONSIBILITY),'''') <> ISNULL(STRING(inserted.STORE_RESPONSIBILITY),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,7,inserted.customer_id,null,null,deleted.STORE_RESPONSIBILITY,inserted.STORE_RESPONSIBILITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AGE_CUSTOMER,'''') <> ISNULL(inserted.AGE_CUSTOMER,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,8,inserted.customer_id,null,null,deleted.AGE_CUSTOMER,inserted.AGE_CUSTOMER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BAD_DEBT_ACCT,'''') <> ISNULL(inserted.BAD_DEBT_ACCT,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,9,inserted.customer_id,null,null,deleted.BAD_DEBT_ACCT,inserted.BAD_DEBT_ACCT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCT_SUMMARY_DAYS),'''') <> ISNULL(STRING(inserted.ACCT_SUMMARY_DAYS),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,10,inserted.customer_id,null,null,deleted.ACCT_SUMMARY_DAYS,inserted.ACCT_SUMMARY_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_COPY_DAYS),'''') <> ISNULL(STRING(inserted.INVOICE_COPY_DAYS),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,11,inserted.customer_id,null,null,deleted.INVOICE_COPY_DAYS,inserted.INVOICE_COPY_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_PAYMENT_AMOUNT),'''') <> ISNULL(STRING(inserted.LAST_PAYMENT_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,12,inserted.customer_id,null,null,deleted.LAST_PAYMENT_AMOUNT,inserted.LAST_PAYMENT_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_PAYMENT_DATE),'''') <> ISNULL(STRING(inserted.LAST_PAYMENT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,13,inserted.customer_id,null,null,deleted.LAST_PAYMENT_DATE,inserted.LAST_PAYMENT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.HIGHEST_AMOUNT_OWED),'''') <> ISNULL(STRING(inserted.HIGHEST_AMOUNT_OWED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,14,inserted.customer_id,null,null,deleted.HIGHEST_AMOUNT_OWED,inserted.HIGHEST_AMOUNT_OWED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.HIGHEST_AMOUNT_DATE),'''') <> ISNULL(STRING(inserted.HIGHEST_AMOUNT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,15,inserted.customer_id,null,null,deleted.HIGHEST_AMOUNT_DATE,inserted.HIGHEST_AMOUNT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAST_DUE_HIGHEST_DAYS),'''') <> ISNULL(STRING(inserted.PAST_DUE_HIGHEST_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,16,inserted.customer_id,null,null,deleted.PAST_DUE_HIGHEST_DAYS,inserted.PAST_DUE_HIGHEST_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_COD_DATE),'''') <> ISNULL(STRING(inserted.LAST_COD_DATE),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,17,inserted.customer_id,null,null,deleted.LAST_COD_DATE,inserted.LAST_COD_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUM_OF_TIMES_COD),'''') <> ISNULL(STRING(inserted.NUM_OF_TIMES_COD),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,18,inserted.customer_id,null,null,deleted.NUM_OF_TIMES_COD,inserted.NUM_OF_TIMES_COD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURNED_CHECK_COUNT),'''') <> ISNULL(STRING(inserted.RETURNED_CHECK_COUNT),'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,30,inserted.customer_id,null,null,deleted.RETURNED_CHECK_COUNT,inserted.RETURNED_CHECK_COUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ACCEPT_CHECK_IF_PRIOR_BAD_CHECK,'''') <> ISNULL(inserted.ACCEPT_CHECK_IF_PRIOR_BAD_CHECK,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,31,inserted.customer_id,null,null,deleted.ACCEPT_CHECK_IF_PRIOR_BAD_CHECK,inserted.ACCEPT_CHECK_IF_PRIOR_BAD_CHECK,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_TOT_DUE),'''') <> ISNULL(STRING(inserted.LAST_STMT_TOT_DUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,19,inserted.customer_id,null,null,deleted.LAST_STMT_TOT_DUE,inserted.LAST_STMT_TOT_DUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_CURRENT_BAL),'''') <> ISNULL(STRING(inserted.LAST_STMT_CURRENT_BAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,20,inserted.customer_id,null,null,deleted.LAST_STMT_CURRENT_BAL,inserted.LAST_STMT_CURRENT_BAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_PERIOD1_BAL),'''') <> ISNULL(STRING(inserted.LAST_STMT_PERIOD1_BAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,21,inserted.customer_id,null,null,deleted.LAST_STMT_PERIOD1_BAL,inserted.LAST_STMT_PERIOD1_BAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_PERIOD2_BAL),'''') <> ISNULL(STRING(inserted.LAST_STMT_PERIOD2_BAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,22,inserted.customer_id,null,null,deleted.LAST_STMT_PERIOD2_BAL,inserted.LAST_STMT_PERIOD2_BAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_PERIOD3_BAL),'''') <> ISNULL(STRING(inserted.LAST_STMT_PERIOD3_BAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,23,inserted.customer_id,null,null,deleted.LAST_STMT_PERIOD3_BAL,inserted.LAST_STMT_PERIOD3_BAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_SVC_CHG),'''') <> ISNULL(STRING(inserted.LAST_STMT_SVC_CHG),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,24,inserted.customer_id,null,null,deleted.LAST_STMT_SVC_CHG,inserted.LAST_STMT_SVC_CHG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_FUTURE_DUE),'''') <> ISNULL(STRING(inserted.LAST_STMT_FUTURE_DUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,25,inserted.customer_id,null,null,deleted.LAST_STMT_FUTURE_DUE,inserted.LAST_STMT_FUTURE_DUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_TOTAL_OWED),'''') <> ISNULL(STRING(inserted.LAST_STMT_TOTAL_OWED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,26,inserted.customer_id,null,null,deleted.LAST_STMT_TOTAL_OWED,inserted.LAST_STMT_TOTAL_OWED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_STMT_DATE),'''') <> ISNULL(STRING(inserted.LAST_STMT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,27,inserted.customer_id,null,null,deleted.LAST_STMT_DATE,inserted.LAST_STMT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NEXT_STMT_DATE),'''') <> ISNULL(STRING(inserted.NEXT_STMT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,28,inserted.customer_id,null,null,deleted.NEXT_STMT_DATE,inserted.NEXT_STMT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENT_BAL),'''') <> ISNULL(STRING(inserted.CURRENT_BAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,71,29,inserted.customer_id,null,null,deleted.CURRENT_BAL,inserted.CURRENT_BAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STATEMENT_EMAIL_ADDRESS,'''') <> ISNULL(inserted.STATEMENT_EMAIL_ADDRESS,'''') then set i_customer_domain=1;i_return_status=call sp_log_file_update_activity(inserted.loc,71,32,inserted.customer_id,null,null,deleted.STATEMENT_EMAIL_ADDRESS,inserted.STATEMENT_EMAIL_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_STATEMENT_FORMAT_ID,'''') <> ISNULL(inserted.REF_STATEMENT_FORMAT_ID,'''') then set i_customer_domain=1 end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if ISNULL(STRING(deleted.STATEMENT_CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.STATEMENT_CUSTOMER_ID),'''') and inserted.statement_customer_id is not null and inserted.statement_customer_id <> inserted.customer_id then if exists(select customer_id from customer_ar where customer_id=inserted.statement_customer_id and statement_customer_id is not null and statement_customer_id <> customer_id) then raiserror 18500 ''18500: tr_bu_customer_ar: STATEMENT_CUSTOMER_ID cannot reference a customer already assigned to another customer''''s statement.'' end if;if exists(select customer_id from customer_ar where statement_customer_id=inserted.customer_id and customer_id <> inserted.customer_id) then raiserror 18501 ''18501: tr_bu_customer_ar: STATEMENT_CUSTOMER_ID cannot be set when customer is referenced by other customers.'' end if end if;if((select send_customer_domain from store_profile)=''Y'') and i_customer_domain=1 then insert into customer_change_queue(customer_id,loc,action,trigger_source) values(deleted.customer_id,deleted.loc,''U'',''CUSTOMER_AR'') end if end', 'tr_bu_customer_blanket_po','CUSTOMER_BLANKET_PO','B','U',1,'create trigger tr_bu_customer_blanket_po before update on CUSTOMER_BLANKET_PO referencing old as deleted new as inserted for each row begin declare i_return_status integer;if deleted.CUSTOMER_ID <> inserted.CUSTOMER_ID or deleted.BLANKET_PO_NUM <> inserted.BLANKET_PO_NUM or ISNULL(deleted.BEGIN_DATE,''1799-01-01'') <> ISNULL(inserted.BEGIN_DATE,''1799-01-01'') then if exists(select*from CUSTOMER_BLANKET_PO where CUSTOMER_ID=inserted.CUSTOMER_ID and BLANKET_PO_NUM=inserted.BLANKET_PO_NUM and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bu_customer_blanket_po: Duplicate value for UNIQUE index XAK1CUSTOMER_BLANKET_PO.'' end if end if;if ISNULL(deleted.BLANKET_PO_NUM,'''') <> ISNULL(inserted.BLANKET_PO_NUM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,108,1,inserted.id,null,null,deleted.BLANKET_PO_NUM,inserted.BLANKET_PO_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BEGIN_DATE),'''') <> ISNULL(STRING(inserted.BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,108,2,inserted.id,null,null,deleted.BEGIN_DATE,inserted.BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_DATE),'''') <> ISNULL(STRING(inserted.END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,108,3,inserted.id,null,null,deleted.END_DATE,inserted.END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_AMOUNT_ALLOWED),'''') <> ISNULL(STRING(inserted.MAXIMUM_AMOUNT_ALLOWED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,108,4,inserted.id,null,null,deleted.MAXIMUM_AMOUNT_ALLOWED,inserted.MAXIMUM_AMOUNT_ALLOWED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_card_on_file','CUSTOMER_CARD_ON_FILE','B','U',1,'create trigger tr_bu_customer_card_on_file before update on CUSTOMER_CARD_ON_FILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.CUSTOMER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,81,1,inserted.id,null,null,deleted.CUSTOMER_ID,inserted.CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CARD_NUMBER,'''') <> ISNULL(inserted.CARD_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,81,2,inserted.id,null,null,deleted.CARD_NUMBER,inserted.CARD_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,81,4,inserted.id,null,null,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TOKEN,'''') <> ISNULL(inserted.TOKEN,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,81,5,inserted.id,null,null,deleted.TOKEN,inserted.TOKEN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_TENDER_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_TENDER_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,81,6,inserted.id,null,null,deleted.REF_TENDER_TYPE_ID,inserted.REF_TENDER_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_certification','CUSTOMER_CERTIFICATION','B','U',1,'create trigger tr_bu_customer_certification before update on CUSTOMER_CERTIFICATION referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.TECHNICIAN_NAME,'''') <> ISNULL(inserted.TECHNICIAN_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,677,1,inserted.id,inserted.customer_id,null,deleted.TECHNICIAN_NAME,inserted.TECHNICIAN_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CERTIFICATE_NUMBER,'''') <> ISNULL(inserted.CERTIFICATE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,677,2,inserted.id,inserted.customer_id,null,deleted.CERTIFICATE_NUMBER,inserted.CERTIFICATE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BEGIN_DATE),'''') <> ISNULL(STRING(inserted.BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,677,3,inserted.id,inserted.customer_id,null,deleted.BEGIN_DATE,inserted.BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_DATE),'''') <> ISNULL(STRING(inserted.END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,677,4,inserted.id,inserted.customer_id,null,deleted.END_DATE,inserted.END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAPA_RESERVED,'''') <> ISNULL(inserted.NAPA_RESERVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,677,5,inserted.id,inserted.customer_id,null,deleted.NAPA_RESERVED,inserted.NAPA_RESERVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_comment','CUSTOMER_COMMENT','B','U',1,'create trigger tr_bu_customer_comment before update on CUSTOMER_COMMENT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.TEXT,'''') <> ISNULL(inserted.TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,112,1,inserted.id,null,null,deleted.TEXT,inserted.TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FOLLOW_UP_DATE),'''') <> ISNULL(STRING(inserted.FOLLOW_UP_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,112,2,inserted.id,null,null,deleted.FOLLOW_UP_DATE,inserted.FOLLOW_UP_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FOLLOW_UP_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.FOLLOW_UP_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,112,3,inserted.id,null,null,deleted.FOLLOW_UP_BY_EMPLOYEE_ID,inserted.FOLLOW_UP_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FOLLOW_UP_COMPLETE),'''') <> ISNULL(STRING(inserted.FOLLOW_UP_COMPLETE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,112,4,inserted.id,null,null,deleted.FOLLOW_UP_COMPLETE,inserted.FOLLOW_UP_COMPLETE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_contact','CUSTOMER_CONTACT','B','U',1,'create trigger tr_bu_customer_contact before update on CUSTOMER_CONTACT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,1,inserted.id,null,null,deleted.NAME,inserted.NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TITLE,'''') <> ISNULL(inserted.TITLE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,2,inserted.id,null,null,deleted.TITLE,inserted.TITLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS1,'''') <> ISNULL(inserted.ADDRESS1,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,3,inserted.id,null,null,deleted.ADDRESS1,inserted.ADDRESS1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS2,'''') <> ISNULL(inserted.ADDRESS2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,4,inserted.id,null,null,deleted.ADDRESS2,inserted.ADDRESS2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS3,'''') <> ISNULL(inserted.ADDRESS3,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,5,inserted.id,null,null,deleted.ADDRESS3,inserted.ADDRESS3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS4,'''') <> ISNULL(inserted.ADDRESS4,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,6,inserted.id,null,null,deleted.ADDRESS4,inserted.ADDRESS4,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CITY,'''') <> ISNULL(inserted.CITY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,7,inserted.id,null,null,deleted.CITY,inserted.CITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,8,inserted.id,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,9,inserted.id,null,null,deleted.POSTAL_CODE,inserted.POSTAL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,10,inserted.id,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PHONE,'''') <> ISNULL(inserted.PHONE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,11,inserted.id,null,null,deleted.PHONE,inserted.PHONE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTENSION,'''') <> ISNULL(inserted.EXTENSION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,12,inserted.id,null,null,deleted.EXTENSION,inserted.EXTENSION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CELL_PHONE,'''') <> ISNULL(inserted.CELL_PHONE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,13,inserted.id,null,null,deleted.CELL_PHONE,inserted.CELL_PHONE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PAGER,'''') <> ISNULL(inserted.PAGER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,14,inserted.id,null,null,deleted.PAGER,inserted.PAGER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.HOME_PHONE,'''') <> ISNULL(inserted.HOME_PHONE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,15,inserted.id,null,null,deleted.HOME_PHONE,inserted.HOME_PHONE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FAX_NUMBER,'''') <> ISNULL(inserted.FAX_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,16,inserted.id,null,null,deleted.FAX_NUMBER,inserted.FAX_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EMAIL,'''') <> ISNULL(inserted.EMAIL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,17,inserted.id,null,null,deleted.EMAIL,inserted.EMAIL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AUTHORIZED_BUYER,'''') <> ISNULL(inserted.AUTHORIZED_BUYER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,18,inserted.id,null,null,deleted.AUTHORIZED_BUYER,inserted.AUTHORIZED_BUYER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,124,19,inserted.id,null,null,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_custom_pricing','CUSTOMER_CUSTOM_PRICING','B','U',1,'create trigger tr_bu_customer_custom_pricing before update on CUSTOMER_CUSTOM_PRICING referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.STORE_GROUP_ID),'''') <> ISNULL(STRING(inserted.STORE_GROUP_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,1,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.STORE_GROUP_ID,inserted.STORE_GROUP_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEPARTMENT_ID),'''') <> ISNULL(STRING(inserted.DEPARTMENT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,2,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.DEPARTMENT_ID,inserted.DEPARTMENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SUB_DEPARTMENT_ID),'''') <> ISNULL(STRING(inserted.SUB_DEPARTMENT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,3,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.SUB_DEPARTMENT_ID,inserted.SUB_DEPARTMENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,4,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GROUP_CODE),'''') <> ISNULL(STRING(inserted.GROUP_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,5,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.GROUP_CODE,inserted.GROUP_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_PREFIX,'''') <> ISNULL(inserted.PART_PREFIX,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,6,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.PART_PREFIX,inserted.PART_PREFIX,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_CLASS_CD,'''') <> ISNULL(inserted.REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,7,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.REF_CLASS_CD,inserted.REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STORE_DEPARTMENT_ID),'''') <> ISNULL(STRING(inserted.STORE_DEPARTMENT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,8,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.STORE_DEPARTMENT_ID,inserted.STORE_DEPARTMENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BEGIN_DATE),'''') <> ISNULL(STRING(inserted.BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,11,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.BEGIN_DATE,inserted.BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_DATE),'''') <> ISNULL(STRING(inserted.END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,12,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.END_DATE,inserted.END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REPORTABLE,'''') <> ISNULL(inserted.REPORTABLE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,9,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.REPORTABLE,inserted.REPORTABLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_PRICE_SHEET_CD,'''') <> ISNULL(inserted.REF_PRICE_SHEET_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,10,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.REF_PRICE_SHEET_CD,inserted.REF_PRICE_SHEET_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MARKUP_PERCENT),'''') <> ISNULL(STRING(inserted.MARKUP_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,13,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.MARKUP_PERCENT,inserted.MARKUP_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_CURRENCY_ROUNDING_CD,'''') <> ISNULL(inserted.REF_CURRENCY_ROUNDING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,14,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.REF_CURRENCY_ROUNDING_CD,inserted.REF_CURRENCY_ROUNDING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,170,16,inserted.id,inserted.customer_id,inserted.ref_pricing_type_cd,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if deleted.CUSTOMER_ID <> inserted.CUSTOMER_ID or deleted.REF_PRICING_TYPE_CD <> inserted.REF_PRICING_TYPE_CD or ISNULL(deleted.STORE_GROUP_ID,-1) <> ISNULL(inserted.STORE_GROUP_ID,-1) or ISNULL(deleted.DEPARTMENT_ID,-1) <> ISNULL(inserted.DEPARTMENT_ID,-1) or ISNULL(deleted.SUB_DEPARTMENT_ID,-1) <> ISNULL(inserted.SUB_DEPARTMENT_ID,-1) or ISNULL(deleted.LINE_ABBREV,REPLICATE(''Z'',30)) <> ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) or ISNULL(deleted.GROUP_CODE,-1) <> ISNULL(inserted.GROUP_CODE,-1) or ISNULL(deleted.PART_PREFIX,REPLICATE(''Z'',30)) <> ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) or ISNULL(deleted.REF_CLASS_CD,REPLICATE(''Z'',30)) <> ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) or ISNULL(deleted.STORE_DEPARTMENT_ID,-1) <> ISNULL(inserted.STORE_DEPARTMENT_ID,-1) or ISNULL(deleted.BEGIN_DATE,''1799-01-01'') <> ISNULL(inserted.BEGIN_DATE,''1799-01-01'') or ISNULL(deleted.END_DATE,''1799-01-01'') <> ISNULL(inserted.END_DATE,''1799-01-01'') then if inserted.LINE_ABBREV is not null then if exists(select*from CUSTOMER_CUSTOM_PRICING where CUSTOMER_ID=inserted.CUSTOMER_ID and REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and LINE_ABBREV=inserted.LINE_ABBREV and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bu_customer_custom_pricing: Duplicate value for UNIQUE index XAK1CUSTOMER_CUSTOM_PRICING.'' end if else if exists(select*from CUSTOMER_CUSTOM_PRICING where CUSTOMER_ID=inserted.CUSTOMER_ID and REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bu_customer_custom_pricing: Duplicate value for UNIQUE index XAK1CUSTOMER_CUSTOM_PRICING.'' end if end if end if;if inserted.ref_price_sheet_cd is null then raiserror 18001 ''tr_bu_customer_custom_pricing: REF_PRICE_SHEET_CD cannot be NULL.'' end if;if inserted.markup_percent is null then raiserror 18001 ''tr_bu_customer_custom_pricing: MARKUP_PERCENT cannot be NULL.'' end if;if inserted.ref_currency_rounding_cd is null then raiserror 18001 ''tr_bu_customer_custom_pricing: REF_CURRENCY_ROUNDING_CD cannot be NULL.'' end if;if inserted.ref_pricing_type_cd=''R'' and inserted.reportable is null then raiserror 18001 ''tr_bu_customer_custom_pricing: REPORTABLE cannot be NULL.'' end if;if inserted.department_id is null and inserted.sub_department_id is not null then raiserror 18001 ''tr_bu_customer_custom_pricing: SUB_DEPARTMENT cannot exist without DEPARTMENT.'' end if end', 'tr_bu_customer_delivery','CUSTOMER_DELIVERY','B','U',1,'create trigger tr_bu_customer_delivery before update on CUSTOMER_DELIVERY referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DELIVERY_REF_OPTION_CD,'''') <> ISNULL(inserted.DELIVERY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,79,1,inserted.customer_id,null,null,deleted.DELIVERY_REF_OPTION_CD,inserted.DELIVERY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DELIVERY_ROUTE_CD,'''') <> ISNULL(inserted.DELIVERY_ROUTE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,79,2,inserted.customer_id,null,null,deleted.DELIVERY_ROUTE_CD,inserted.DELIVERY_ROUTE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DELIVERY_PRIORITY_ID),'''') <> ISNULL(STRING(inserted.DELIVERY_PRIORITY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,79,3,inserted.customer_id,null,null,deleted.DELIVERY_PRIORITY_ID,inserted.DELIVERY_PRIORITY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TRAVEL_TIME_CUSTOMER),'''') <> ISNULL(STRING(inserted.TRAVEL_TIME_CUSTOMER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,79,4,inserted.customer_id,null,null,deleted.TRAVEL_TIME_CUSTOMER,inserted.TRAVEL_TIME_CUSTOMER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISTANCE_TO_CUSTOMER),'''') <> ISNULL(STRING(inserted.DISTANCE_TO_CUSTOMER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,79,5,inserted.customer_id,null,null,deleted.DISTANCE_TO_CUSTOMER,inserted.DISTANCE_TO_CUSTOMER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DIRECTIONS,'''') <> ISNULL(inserted.DIRECTIONS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,79,8,inserted.customer_id,null,null,deleted.DIRECTIONS,inserted.DIRECTIONS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MIN_AMT_FREE_DELIVERY),'''') <> ISNULL(STRING(inserted.MIN_AMT_FREE_DELIVERY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,79,6,inserted.customer_id,null,null,deleted.MIN_AMT_FREE_DELIVERY,inserted.MIN_AMT_FREE_DELIVERY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DELIVERY_CHARGE),'''') <> ISNULL(STRING(inserted.DELIVERY_CHARGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,79,7,inserted.customer_id,null,null,deleted.DELIVERY_CHARGE,inserted.DELIVERY_CHARGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_fixed_pricing','CUSTOMER_FIXED_PRICING','B','U',1,'create trigger tr_bu_customer_fixed_pricing before update on CUSTOMER_FIXED_PRICING referencing old as deleted new as inserted for each row begin declare i_return_status integer;if deleted.CUSTOMER_ID <> inserted.CUSTOMER_ID or deleted.LINE_ABBREV <> inserted.LINE_ABBREV or deleted.PART_NUMBER <> inserted.PART_NUMBER or ISNULL(deleted.BEGIN_DATE,''1799-01-01'') <> ISNULL(inserted.BEGIN_DATE,''1799-01-01'') or ISNULL(deleted.END_DATE,''1799-01-01'') <> ISNULL(inserted.END_DATE,''1799-01-01'') then if exists(select*from CUSTOMER_FIXED_PRICING where CUSTOMER_ID=inserted.CUSTOMER_ID and LINE_ABBREV=inserted.LINE_ABBREV and PART_NUMBER=inserted.PART_NUMBER and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bu_customer_fixed_pricing: Duplicate value for UNIQUE index XAK1CUSTOMER_FIXED_PRICING.'' end if end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,680,1,inserted.id,inserted.customer_id,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,680,2,inserted.id,inserted.customer_id,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BEGIN_DATE),'''') <> ISNULL(STRING(inserted.BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,680,3,inserted.id,inserted.customer_id,null,deleted.BEGIN_DATE,inserted.BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_DATE),'''') <> ISNULL(STRING(inserted.END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,680,4,inserted.id,inserted.customer_id,null,deleted.END_DATE,inserted.END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REPORTABLE,'''') <> ISNULL(inserted.REPORTABLE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,680,5,inserted.id,inserted.customer_id,null,deleted.REPORTABLE,inserted.REPORTABLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PART_PRICE),'''') <> ISNULL(STRING(inserted.PART_PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,680,6,inserted.id,inserted.customer_id,null,deleted.PART_PRICE,inserted.PART_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,680,7,inserted.id,inserted.customer_id,null,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_note','CUSTOMER_NOTE','B','U',1,'create trigger tr_bu_customer_note before update on CUSTOMER_NOTE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.TEXT,'''') <> ISNULL(inserted.TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,73,1,inserted.id,null,null,deleted.TEXT,inserted.TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_NOTE_HANDLING_ID),'''') <> ISNULL(STRING(inserted.REF_NOTE_HANDLING_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,73,2,inserted.id,null,null,deleted.REF_NOTE_HANDLING_ID,inserted.REF_NOTE_HANDLING_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_pricing_profile','CUSTOMER_PRICING_PROFILE','B','U',1,'create trigger tr_bu_customer_pricing_profile before update on CUSTOMER_PRICING_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.PRICING_PROFILE_ID),'''') <> ISNULL(STRING(inserted.PRICING_PROFILE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,169,1,inserted.customer_id,inserted.pricing_profile_id,inserted.ref_customer_pricing_profile_type_cd,deleted.PRICING_PROFILE_ID,inserted.PRICING_PROFILE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRIORITY),'''') <> ISNULL(STRING(inserted.PRIORITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,169,2,inserted.customer_id,inserted.pricing_profile_id,inserted.ref_customer_pricing_profile_type_cd,deleted.PRIORITY,inserted.PRIORITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_pu_gp','CUSTOMER_PU_GP','B','U',1,'create trigger tr_bu_customer_pu_gp before update on CUSTOMER_PU_GP referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.AMOUNT_BEGIN),'''') <> ISNULL(STRING(inserted.AMOUNT_BEGIN),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,110,1,inserted.id,null,null,deleted.AMOUNT_BEGIN,inserted.AMOUNT_BEGIN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT_END),'''') <> ISNULL(STRING(inserted.AMOUNT_END),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,110,2,inserted.id,null,null,deleted.AMOUNT_END,inserted.AMOUNT_END,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PERCENT),'''') <> ISNULL(STRING(inserted.PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,110,3,inserted.id,null,null,deleted.PERCENT,inserted.PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_CURRENCY_ROUNDING_CD,'''') <> ISNULL(inserted.REF_CURRENCY_ROUNDING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,110,4,inserted.id,null,null,deleted.REF_CURRENCY_ROUNDING_CD,inserted.REF_CURRENCY_ROUNDING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_sales','CUSTOMER_SALES','B','U',1,'create trigger tr_bu_customer_sales before update on CUSTOMER_SALES referencing old as deleted new as inserted for each row begin if deleted.CUSTOMER_ID <> inserted.CUSTOMER_ID or deleted.YEAR_MONTH <> inserted.YEAR_MONTH or deleted.REF_CUSTOMER_SALES_TYPE_CD <> inserted.REF_CUSTOMER_SALES_TYPE_CD or ISNULL(deleted.LINE_ABBREV,REPLICATE(''Z'',30)) <> ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) or ISNULL(deleted.STORE_GROUP_ID,-1) <> ISNULL(inserted.STORE_GROUP_ID,-1) or ISNULL(deleted.DEPARTMENT_ID,-1) <> ISNULL(inserted.DEPARTMENT_ID,-1) or ISNULL(deleted.SUB_DEPARTMENT_ID,-1) <> ISNULL(inserted.SUB_DEPARTMENT_ID,-1) then if exists(select*from CUSTOMER_SALES where CUSTOMER_ID=inserted.CUSTOMER_ID and YEAR_MONTH=inserted.YEAR_MONTH and REF_CUSTOMER_SALES_TYPE_CD=inserted.REF_CUSTOMER_SALES_TYPE_CD and ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ID <> inserted.ID) then raiserror 18147 ''tr_bu_customer_sales: Duplicate value for UNIQUE index XAK1CUSTOMER_SALES.'' end if end if end', 'tr_bu_customer_statement_address','CUSTOMER_STATEMENT_ADDRESS','B','U',1,'create trigger tr_bu_customer_statement_address before update on CUSTOMER_STATEMENT_ADDRESS referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,70,1,inserted.customer_id,null,null,deleted.NAME,inserted.NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS1,'''') <> ISNULL(inserted.ADDRESS1,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,70,2,inserted.customer_id,null,null,deleted.ADDRESS1,inserted.ADDRESS1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS2,'''') <> ISNULL(inserted.ADDRESS2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,70,3,inserted.customer_id,null,null,deleted.ADDRESS2,inserted.ADDRESS2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS3,'''') <> ISNULL(inserted.ADDRESS3,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,70,4,inserted.customer_id,null,null,deleted.ADDRESS3,inserted.ADDRESS3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS4,'''') <> ISNULL(inserted.ADDRESS4,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,70,5,inserted.customer_id,null,null,deleted.ADDRESS4,inserted.ADDRESS4,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CITY,'''') <> ISNULL(inserted.CITY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,70,6,inserted.customer_id,null,null,deleted.CITY,inserted.CITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,70,7,inserted.customer_id,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,70,8,inserted.customer_id,null,null,deleted.POSTAL_CODE,inserted.POSTAL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,70,9,inserted.customer_id,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_to_customer_segment','CUSTOMER_TO_CUSTOMER_SEGMENT','B','U',1,'create trigger tr_bu_customer_to_customer_segment before update on CUSTOMER_TO_CUSTOMER_SEGMENT referencing old as deleted new as inserted for each row begin if inserted.effective_from_date > inserted.effective_to_date then raiserror 18255 ''tr_bu_customer_to_customer_segment: EFFECTIVE_TO_DATE cannot be earlier than EFFECTIVE_FROM_DATE.'' end if;if exists(select*from CUSTOMER_TO_CUSTOMER_SEGMENT where customer_number=inserted.customer_number and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and id <> inserted.id) then raiserror 18260 ''tr_bu_customer_to_customer_segment: Record with conflicting criteria already exists.'' end if end', 'tr_bu_customer_to_item_pricing','CUSTOMER_TO_ITEM_PRICING','B','U',1,'create trigger tr_bu_customer_to_item_pricing before update on CUSTOMER_TO_ITEM_PRICING referencing old as deleted new as inserted for each row begin if(case when inserted.price_level is null then 0 else 1 end+case when inserted.ref_price_sheet_cd is null then 0 else 1 end+case when inserted.exact_price is null then 0 else 1 end) <> 1 then raiserror 18253 ''tr_bu_customer_to_item_pricing: Must have a value for exactly one of PRICE_LEVEL,REF_PRICE_SHEET_CD,and EXACT_PRICE(the others must be NULL).'' end if;if(case when inserted.ref_price_sheet_cd is null then 0 else 1 end+case when inserted.markup_percent is null then 0 else 1 end)=1 then raiserror 18254 ''tr_bu_customer_to_item_pricing: Either REF_PRICE_SHEET_CD and MARKUP_PERCENT both must have a value or neither must have a value.'' end if;if inserted.effective_from_date > inserted.effective_to_date then raiserror 18255 ''tr_bu_customer_to_item_pricing: EFFECTIVE_TO_DATE cannot be earlier than EFFECTIVE_FROM_DATE.'' end if;if exists(select*from CUSTOMER_TO_ITEM_PRICING where customer_number=inserted.customer_number and line_abbrev=inserted.line_abbrev and part_number=inserted.part_number and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and id <> inserted.id) then raiserror 18260 ''tr_bu_customer_to_item_pricing: Record with conflicting criteria already exists.'' end if end', 'tr_bu_customer_to_product_segment_pricing','CUSTOMER_TO_PRODUCT_SEGMENT_PRICING','B','U',1,'create trigger tr_bu_customer_to_product_segment_pricing before update on CUSTOMER_TO_PRODUCT_SEGMENT_PRICING referencing old as deleted new as inserted for each row begin if(case when inserted.line_abbrev is null then 0 else 1 end+case when inserted.product_category is null then 0 else 1 end) <> 1 then raiserror 18251 ''tr_bu_customer_to_product_segment_pricing: Must have a value for only one of LINE_ABBREV and PRODUCT_CATEGORY(the other must be NULL).'' end if;if inserted.line_abbrev is null and inserted.group_code is not null then raiserror 18252 ''tr_bu_customer_to_product_segment_pricing: Cannot have value for GROUP_CODE without a value for LINE_ABBREV.'' end if;if(case when inserted.price_level is null then 0 else 1 end+case when inserted.ref_price_sheet_cd is null then 0 else 1 end+case when inserted.exact_price is null then 0 else 1 end) <> 1 then raiserror 18253 ''tr_bu_customer_to_product_segment_pricing: Must have a value for exactly one of PRICE_LEVEL,REF_PRICE_SHEET_CD,and EXACT_PRICE(the others must be NULL).'' end if;if(case when inserted.ref_price_sheet_cd is null then 0 else 1 end+case when inserted.markup_percent is null then 0 else 1 end)=1 then raiserror 18254 ''tr_bu_customer_to_product_segment_pricing: Either REF_PRICE_SHEET_CD and MARKUP_PERCENT both must have a value or neither must have a value.'' end if;if inserted.effective_from_date > inserted.effective_to_date then raiserror 18255 ''tr_bu_customer_to_product_segment_pricing: EFFECTIVE_TO_DATE cannot be earlier than EFFECTIVE_FROM_DATE.'' end if;if inserted.line_abbrev is not null then if exists(select*from CUSTOMER_TO_PRODUCT_SEGMENT_PRICING where customer_number=inserted.customer_number and product_category is null and line_abbrev=inserted.line_abbrev and ISNULL(group_code,-1)=ISNULL(inserted.group_code,-1) and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and id <> inserted.id) then raiserror 18260 ''tr_bu_customer_to_product_segment_pricing: Record with conflicting criteria already exists.'' end if else if exists(select*from CUSTOMER_TO_PRODUCT_SEGMENT_PRICING where customer_number=inserted.customer_number and product_category=inserted.product_category and line_abbrev is null and group_code is null and(effective_from_date between inserted.effective_from_date and inserted.effective_to_date or effective_to_date between inserted.effective_from_date and inserted.effective_to_date or inserted.effective_from_date between effective_from_date and effective_to_date) and id <> inserted.id) then raiserror 18260 ''tr_bu_customer_to_product_segment_pricing: Record with conflicting criteria already exists.'' end if end if end', 'tr_bu_customer_tracking_code','CUSTOMER_TRACKING_CODE','B','U',1,'create trigger tr_bu_customer_tracking_code before update on CUSTOMER_TRACKING_CODE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_customer_user_defined_field','CUSTOMER_USER_DEFINED_FIELD','B','U',1,'create trigger tr_bu_customer_user_defined_field before update on CUSTOMER_USER_DEFINED_FIELD referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.TEXT,'''') <> ISNULL(inserted.TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,227,1,inserted.customer_id,inserted.user_defined_field_name_id,null,deleted.TEXT,inserted.TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_daily_returns_audit','DAILY_RETURNS_AUDIT','B','U',1,'create trigger tr_bu_daily_returns_audit before update on DAILY_RETURNS_AUDIT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_RGN_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_RGN_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,622,1,inserted.INVOICE_LINE_ITEM_INVOICE_ID,inserted.INVOICE_LINE_ITEM_SEQUENCE,null,deleted.REF_RGN_TYPE_ID,inserted.REF_RGN_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UNIQUE_BARCODE,'''') <> ISNULL(inserted.UNIQUE_BARCODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,622,2,inserted.INVOICE_LINE_ITEM_INVOICE_ID,inserted.INVOICE_LINE_ITEM_SEQUENCE,null,deleted.UNIQUE_BARCODE,inserted.UNIQUE_BARCODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_INVOLVED,'''') <> ISNULL(inserted.PART_INVOLVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,622,3,inserted.INVOICE_LINE_ITEM_INVOICE_ID,inserted.INVOICE_LINE_ITEM_SEQUENCE,null,deleted.PART_INVOLVED,inserted.PART_INVOLVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_QUANTITY),'''') <> ISNULL(STRING(inserted.RETURN_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,622,4,inserted.INVOICE_LINE_ITEM_INVOICE_ID,inserted.INVOICE_LINE_ITEM_SEQUENCE,null,deleted.RETURN_QUANTITY,inserted.RETURN_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COUNT_QUANTITY),'''') <> ISNULL(STRING(inserted.COUNT_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,622,5,inserted.INVOICE_LINE_ITEM_INVOICE_ID,inserted.INVOICE_LINE_ITEM_SEQUENCE,null,deleted.COUNT_QUANTITY,inserted.COUNT_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DELINQUENT_REASON,'''') <> ISNULL(inserted.DELINQUENT_REASON,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,622,7,inserted.INVOICE_LINE_ITEM_INVOICE_ID,inserted.INVOICE_LINE_ITEM_SEQUENCE,null,deleted.DELINQUENT_REASON,inserted.DELINQUENT_REASON,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_data_review_report','DATA_REVIEW_REPORT','B','U',1,'create trigger tr_bu_data_review_report before update on DATA_REVIEW_REPORT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.REPORT_TITLE,'''') <> ISNULL(inserted.REPORT_TITLE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,615,1,inserted.id,null,null,deleted.REPORT_TITLE,inserted.REPORT_TITLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_dc_address','DC_ADDRESS','B','U',1,'create trigger tr_bu_dc_address before update on DC_ADDRESS referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DC_ADDRESS1,'''') <> ISNULL(inserted.DC_ADDRESS1,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,639,1,inserted.NAPA_ACCT_DC_CODE,null,null,deleted.DC_ADDRESS1,inserted.DC_ADDRESS1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DC_ADDRESS2,'''') <> ISNULL(inserted.DC_ADDRESS2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,639,2,inserted.NAPA_ACCT_DC_CODE,null,null,deleted.DC_ADDRESS2,inserted.DC_ADDRESS2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DC_ADDRESS3,'''') <> ISNULL(inserted.DC_ADDRESS3,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,639,3,inserted.NAPA_ACCT_DC_CODE,null,null,deleted.DC_ADDRESS3,inserted.DC_ADDRESS3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DC_ADDRESS4,'''') <> ISNULL(inserted.DC_ADDRESS4,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,639,4,inserted.NAPA_ACCT_DC_CODE,null,null,deleted.DC_ADDRESS4,inserted.DC_ADDRESS4,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DC_CITY,'''') <> ISNULL(inserted.DC_CITY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,639,5,inserted.NAPA_ACCT_DC_CODE,null,null,deleted.DC_CITY,inserted.DC_CITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,639,6,inserted.NAPA_ACCT_DC_CODE,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,639,7,inserted.NAPA_ACCT_DC_CODE,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DC_PHONE_NUMBER,'''') <> ISNULL(inserted.DC_PHONE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,639,8,inserted.NAPA_ACCT_DC_CODE,null,null,deleted.DC_PHONE_NUMBER,inserted.DC_PHONE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,639,9,inserted.NAPA_ACCT_DC_CODE,null,null,deleted.POSTAL_CODE,inserted.POSTAL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_delivery_priority','DELIVERY_PRIORITY','B','U',1,'create trigger tr_bu_delivery_priority before update on DELIVERY_PRIORITY referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.NUM_MINUTES_FOR_DELIVERY),'''') <> ISNULL(STRING(inserted.NUM_MINUTES_FOR_DELIVERY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,77,1,inserted.id,null,null,deleted.NUM_MINUTES_FOR_DELIVERY,inserted.NUM_MINUTES_FOR_DELIVERY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_delivery_route','DELIVERY_ROUTE','B','U',1,'create trigger tr_bu_delivery_route before update on DELIVERY_ROUTE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,82,1,null,null,inserted.cd,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_department','DEPARTMENT','B','U',1,'create trigger tr_bu_department before update on DEPARTMENT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,213,1,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_disbursements_profile','DISBURSEMENTS_PROFILE','B','U',1,'create trigger tr_bu_disbursements_profile before update on DISBURSEMENTS_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CASH_GL_CODE),'''') <> ISNULL(STRING(inserted.CASH_GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,1,null,null,null,deleted.CASH_GL_CODE,inserted.CASH_GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_GL_CODE),'''') <> ISNULL(STRING(inserted.DISCOUNT_GL_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,2,null,null,null,deleted.DISCOUNT_GL_CODE,inserted.DISCOUNT_GL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENT_AP_MONTH),'''') <> ISNULL(STRING(inserted.CURRENT_AP_MONTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,3,null,null,null,deleted.CURRENT_AP_MONTH,inserted.CURRENT_AP_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENT_CD_MONTH),'''') <> ISNULL(STRING(inserted.CURRENT_CD_MONTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,4,null,null,null,deleted.CURRENT_CD_MONTH,inserted.CURRENT_CD_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_AP_FINALIZE_DATE),'''') <> ISNULL(STRING(inserted.LAST_AP_FINALIZE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,5,null,null,null,deleted.LAST_AP_FINALIZE_DATE,inserted.LAST_AP_FINALIZE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_CD_FINALIZE_DATE),'''') <> ISNULL(STRING(inserted.LAST_CD_FINALIZE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,6,null,null,null,deleted.LAST_CD_FINALIZE_DATE,inserted.LAST_CD_FINALIZE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PREVIOUS_AP_FINALIZE_DATE),'''') <> ISNULL(STRING(inserted.PREVIOUS_AP_FINALIZE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,7,null,null,null,deleted.PREVIOUS_AP_FINALIZE_DATE,inserted.PREVIOUS_AP_FINALIZE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PREVIOUS_CD_FINALIZE_DATE),'''') <> ISNULL(STRING(inserted.PREVIOUS_CD_FINALIZE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,8,null,null,null,deleted.PREVIOUS_CD_FINALIZE_DATE,inserted.PREVIOUS_CD_FINALIZE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_AP_CHECK_NUMBER_FINALIZED),'''') <> ISNULL(STRING(inserted.LAST_AP_CHECK_NUMBER_FINALIZED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,9,null,null,null,deleted.LAST_AP_CHECK_NUMBER_FINALIZED,inserted.LAST_AP_CHECK_NUMBER_FINALIZED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_CD_CHECK_NUMBER_FINALIZED),'''') <> ISNULL(STRING(inserted.LAST_CD_CHECK_NUMBER_FINALIZED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,10,null,null,null,deleted.LAST_CD_CHECK_NUMBER_FINALIZED,inserted.LAST_CD_CHECK_NUMBER_FINALIZED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_CHECK_NUMBER_PRINTED),'''') <> ISNULL(STRING(inserted.LAST_CHECK_NUMBER_PRINTED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,11,null,null,null,deleted.LAST_CHECK_NUMBER_PRINTED,inserted.LAST_CHECK_NUMBER_PRINTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PREVIOUS_LAST_CHECK_NUMBER_PRINTED),'''') <> ISNULL(STRING(inserted.PREVIOUS_LAST_CHECK_NUMBER_PRINTED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,12,null,null,null,deleted.PREVIOUS_LAST_CHECK_NUMBER_PRINTED,inserted.PREVIOUS_LAST_CHECK_NUMBER_PRINTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CHECK_TYPE),'''') <> ISNULL(STRING(inserted.CHECK_TYPE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,13,null,null,null,deleted.CHECK_TYPE,inserted.CHECK_TYPE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_DISB_CHECKS_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_DISB_CHECKS_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,14,null,null,null,deleted.KEEP_DISB_CHECKS_MONTHS,inserted.KEEP_DISB_CHECKS_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_INACTIVE_VENDOR_DAYS),'''') <> ISNULL(STRING(inserted.KEEP_INACTIVE_VENDOR_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,103,15,null,null,null,deleted.KEEP_INACTIVE_VENDOR_DAYS,inserted.KEEP_INACTIVE_VENDOR_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_dollar_rounding','DOLLAR_ROUNDING','B','U',1,'create trigger tr_bu_dollar_rounding before update on DOLLAR_ROUNDING referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.BEGIN_RANGE),'''') <> ISNULL(STRING(inserted.BEGIN_RANGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,307,1,inserted.id,null,null,deleted.BEGIN_RANGE,inserted.BEGIN_RANGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_RANGE),'''') <> ISNULL(STRING(inserted.END_RANGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,307,2,inserted.id,null,null,deleted.END_RANGE,inserted.END_RANGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT),'''') <> ISNULL(STRING(inserted.AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,307,3,inserted.id,null,null,deleted.AMOUNT,inserted.AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_electronic_invoicng_profile','ELECTRONIC_INVOICING_PROFILE','B','U',1,'create trigger tr_bu_electronic_invoicng_profile before update on ELECTRONIC_INVOICING_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_ELECTRONIC_INVOICE_VENDOR_ID),'''') <> ISNULL(STRING(inserted.REF_ELECTRONIC_INVOICE_VENDOR_ID),'''') then i_return_status=call sp_log_file_update_activity(1,687,1,null,null,null,deleted.REF_ELECTRONIC_INVOICE_VENDOR_ID,inserted.REF_ELECTRONIC_INVOICE_VENDOR_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then i_return_status=call sp_log_file_update_activity(1,687,2,null,null,null,deleted.NAME,inserted.NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USER_PASSWORD,'''') <> ISNULL(inserted.USER_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(1,687,3,null,null,null,deleted.USER_PASSWORD,inserted.USER_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EMAIL,'''') <> ISNULL(inserted.EMAIL,'''') then i_return_status=call sp_log_file_update_activity(1,687,4,null,null,null,deleted.EMAIL,inserted.EMAIL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.START_DATE),'''') <> ISNULL(STRING(inserted.START_DATE),'''') then i_return_status=call sp_log_file_update_activity(1,687,5,null,null,null,deleted.START_DATE,inserted.START_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.GENERIC_RFC,'''') <> ISNULL(inserted.GENERIC_RFC,'''') then i_return_status=call sp_log_file_update_activity(1,687,6,null,null,null,deleted.GENERIC_RFC,inserted.GENERIC_RFC,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.GENERIC_PRODUCT_CODE,'''') <> ISNULL(inserted.GENERIC_PRODUCT_CODE,'''') then i_return_status=call sp_log_file_update_activity(1,687,7,null,null,null,deleted.GENERIC_PRODUCT_CODE,inserted.GENERIC_PRODUCT_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.GENERIC_DELIVERY_CODE,'''') <> ISNULL(inserted.GENERIC_DELIVERY_CODE,'''') then i_return_status=call sp_log_file_update_activity(1,687,8,null,null,null,deleted.GENERIC_DELIVERY_CODE,inserted.GENERIC_DELIVERY_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_ELECTRONIC_INVOICE_COMPANY_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_ELECTRONIC_INVOICE_COMPANY_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(1,687,9,null,null,null,deleted.REF_ELECTRONIC_INVOICE_COMPANY_TYPE_ID,inserted.REF_ELECTRONIC_INVOICE_COMPANY_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LEGAL_COMPANY_NAME,'''') <> ISNULL(inserted.LEGAL_COMPANY_NAME,'''') then i_return_status=call sp_log_file_update_activity(1,687,10,null,null,null,deleted.LEGAL_COMPANY_NAME,inserted.LEGAL_COMPANY_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_MODIFIED_DATE),'''') <> ISNULL(STRING(inserted.LAST_MODIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(1,687,11,null,null,null,deleted.LAST_MODIFIED_DATE,inserted.LAST_MODIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MODIFIED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.MODIFIED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(1,687,12,null,null,null,deleted.MODIFIED_BY_EMPLOYEE_ID,inserted.MODIFIED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_employee','EMPLOYEE','B','U',1,'create trigger tr_bu_employee before update on EMPLOYEE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.LAST_NAME,'''') <> ISNULL(inserted.LAST_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,1,inserted.id,null,null,deleted.LAST_NAME,inserted.LAST_NAME,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.FIRST_NAME,'''') <> ISNULL(inserted.FIRST_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,2,inserted.id,null,null,deleted.FIRST_NAME,inserted.FIRST_NAME,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.MIDDLE_INITIAL,'''') <> ISNULL(inserted.MIDDLE_INITIAL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,3,inserted.id,null,null,deleted.MIDDLE_INITIAL,inserted.MIDDLE_INITIAL,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.ADDRESS1,'''') <> ISNULL(inserted.ADDRESS1,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,4,inserted.id,null,null,deleted.ADDRESS1,inserted.ADDRESS1,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.ADDRESS2,'''') <> ISNULL(inserted.ADDRESS2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,5,inserted.id,null,null,deleted.ADDRESS2,inserted.ADDRESS2,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.CITY,'''') <> ISNULL(inserted.CITY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,6,inserted.id,null,null,deleted.CITY,inserted.CITY,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,7,inserted.id,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,8,inserted.id,null,null,deleted.POSTAL_CODE,inserted.POSTAL_CODE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,9,inserted.id,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.TELEPHONE_NUM,'''') <> ISNULL(inserted.TELEPHONE_NUM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,11,inserted.id,null,null,deleted.TELEPHONE_NUM,inserted.TELEPHONE_NUM,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.BIRTH_DATE),'''') <> ISNULL(STRING(inserted.BIRTH_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,13,inserted.id,null,null,deleted.BIRTH_DATE,inserted.BIRTH_DATE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.EMPLOYMENT_DATE),'''') <> ISNULL(STRING(inserted.EMPLOYMENT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,14,inserted.id,null,null,deleted.EMPLOYMENT_DATE,inserted.EMPLOYMENT_DATE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.REF_EMPLOYEE_JOB_CODE_ID),'''') <> ISNULL(STRING(inserted.REF_EMPLOYEE_JOB_CODE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,15,inserted.id,null,null,deleted.REF_EMPLOYEE_JOB_CODE_ID,inserted.REF_EMPLOYEE_JOB_CODE_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.CLOCKED_IN,'''') <> ISNULL(inserted.CLOCKED_IN,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,16,inserted.id,null,null,deleted.CLOCKED_IN,inserted.CLOCKED_IN,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.INVOICING_ALLOWED,'''') <> ISNULL(inserted.INVOICING_ALLOWED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,17,inserted.id,null,null,deleted.INVOICING_ALLOWED,inserted.INVOICING_ALLOWED,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.TERMINATION_DATE),'''') <> ISNULL(STRING(inserted.TERMINATION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,18,inserted.id,null,null,deleted.TERMINATION_DATE,inserted.TERMINATION_DATE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.RATE_OF_PAY),'''') <> ISNULL(STRING(inserted.RATE_OF_PAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,19,inserted.id,null,null,deleted.RATE_OF_PAY,inserted.RATE_OF_PAY,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.PASSWORD,'''') <> ISNULL(inserted.PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,20,inserted.id,null,null,deleted.PASSWORD,inserted.PASSWORD,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.PAY_PERIOD_PROFILE_ID),'''') <> ISNULL(STRING(inserted.PAY_PERIOD_PROFILE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,21,inserted.id,null,null,deleted.PAY_PERIOD_PROFILE_ID,inserted.PAY_PERIOD_PROFILE_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.PASSWORD_EXP_DATE),'''') <> ISNULL(STRING(inserted.PASSWORD_EXP_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,22,inserted.id,null,null,deleted.PASSWORD_EXP_DATE,inserted.PASSWORD_EXP_DATE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.EMAIL,'''') <> ISNULL(inserted.EMAIL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,23,inserted.id,null,null,deleted.EMAIL,inserted.EMAIL,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.REF_STORE_DEPT_ID),'''') <> ISNULL(STRING(inserted.REF_STORE_DEPT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,24,inserted.id,null,null,deleted.REF_STORE_DEPT_ID,inserted.REF_STORE_DEPT_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.CUSTOMER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,25,inserted.id,null,null,deleted.CUSTOMER_ID,inserted.CUSTOMER_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.FW_USER_ID),'''') <> ISNULL(STRING(inserted.FW_USER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,26,inserted.id,null,null,deleted.FW_USER_ID,inserted.FW_USER_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.PAY_PERIOD_NOTE,'''') <> ISNULL(inserted.PAY_PERIOD_NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,27,inserted.id,null,null,deleted.PAY_PERIOD_NOTE,inserted.PAY_PERIOD_NOTE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.REF_PAY_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_PAY_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,28,inserted.id,null,null,deleted.REF_PAY_TYPE_ID,inserted.REF_PAY_TYPE_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.SERVICE_DATE),'''') <> ISNULL(STRING(inserted.SERVICE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,29,inserted.id,null,null,deleted.SERVICE_DATE,inserted.SERVICE_DATE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.REF_LANGUAGE_CD,'''') <> ISNULL(inserted.REF_LANGUAGE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,30,inserted.id,null,null,deleted.REF_LANGUAGE_CD,inserted.REF_LANGUAGE_CD,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.REF_CATALOG_PREFERENCE_ID),'''') <> ISNULL(STRING(inserted.REF_CATALOG_PREFERENCE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,34,inserted.id,null,null,deleted.REF_CATALOG_PREFERENCE_ID,inserted.REF_CATALOG_PREFERENCE_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.TIMEOUT_SECONDS),'''') <> ISNULL(STRING(inserted.TIMEOUT_SECONDS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,31,inserted.id,null,null,deleted.TIMEOUT_SECONDS,inserted.TIMEOUT_SECONDS,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.PRIMARY_LOCATION),'''') <> ISNULL(STRING(inserted.PRIMARY_LOCATION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,32,inserted.id,null,null,deleted.PRIMARY_LOCATION,inserted.PRIMARY_LOCATION,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.DISPLAY_GROSS_PROFIT_AND_COST,'''') <> ISNULL(inserted.DISPLAY_GROSS_PROFIT_AND_COST,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,33,inserted.id,null,null,deleted.DISPLAY_GROSS_PROFIT_AND_COST,inserted.DISPLAY_GROSS_PROFIT_AND_COST,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.REF_PASSWORD_STATUS_ID),'''') <> ISNULL(STRING(inserted.REF_PASSWORD_STATUS_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,35,inserted.id,null,null,deleted.REF_PASSWORD_STATUS_ID,inserted.REF_PASSWORD_STATUS_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.ACCOUNT_LOCKED_BEGIN_DATE),'''') <> ISNULL(STRING(inserted.ACCOUNT_LOCKED_BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,36,inserted.id,null,null,deleted.ACCOUNT_LOCKED_BEGIN_DATE,inserted.ACCOUNT_LOCKED_BEGIN_DATE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.ALLOW_CHANGE_CATALOG_PREFERENCE,'''') <> ISNULL(inserted.ALLOW_CHANGE_CATALOG_PREFERENCE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,38,inserted.id,null,null,deleted.ALLOW_CHANGE_CATALOG_PREFERENCE,inserted.ALLOW_CHANGE_CATALOG_PREFERENCE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.LDAP_EXTERNAL_IDENTIFIER,'''') <> ISNULL(inserted.LDAP_EXTERNAL_IDENTIFIER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,19,39,inserted.id,null,null,deleted.LDAP_EXTERNAL_IDENTIFIER,inserted.LDAP_EXTERNAL_IDENTIFIER,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.date_modified=current timestamp end if;if ISNULL(inserted.last_name,'''') <> ISNULL(deleted.last_name,'''') or ISNULL(inserted.first_name,'''') <> ISNULL(deleted.first_name,'''') or ISNULL(inserted.employee_num,'''') <> ISNULL(deleted.employee_num,'''') then update fw_user set name=inserted.employee_num || '' '' || inserted.last_name || '','' || inserted.first_name where id=deleted.fw_user_id end if end', 'tr_bu_employee_clock','EMPLOYEE_CLOCK','B','U',1,'create trigger tr_bu_employee_clock before update on EMPLOYEE_CLOCK referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CLOCK_IN_DATE),'''') <> ISNULL(STRING(inserted.CLOCK_IN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,6,1,inserted.id,null,null,deleted.CLOCK_IN_DATE,inserted.CLOCK_IN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CLOCK_OUT_DATE),'''') <> ISNULL(STRING(inserted.CLOCK_OUT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,6,2,inserted.id,null,null,deleted.CLOCK_OUT_DATE,inserted.CLOCK_OUT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_employee_comments','EMPLOYEE_COMMENTS','B','U',1,'create trigger tr_bu_employee_comments before update on EMPLOYEE_COMMENTS referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.TEXT,'''') <> ISNULL(inserted.TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,113,1,inserted.id,null,null,deleted.TEXT,inserted.TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FOLLOW_UP_DATE),'''') <> ISNULL(STRING(inserted.FOLLOW_UP_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,113,2,inserted.id,null,null,deleted.FOLLOW_UP_DATE,inserted.FOLLOW_UP_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_employee_non_worked_hours','EMPLOYEE_NON_WORKED_HOURS','B','U',1,'create trigger tr_bu_employee_non_worked_hours before update on EMPLOYEE_NON_WORKED_HOURS referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.ACTIVITY_DATE),'''') <> ISNULL(STRING(inserted.ACTIVITY_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,26,1,inserted.id,null,null,deleted.ACTIVITY_DATE,inserted.ACTIVITY_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_ACTIVITY_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_ACTIVITY_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,26,2,inserted.id,null,null,deleted.REF_ACTIVITY_TYPE_ID,inserted.REF_ACTIVITY_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MINUTES),'''') <> ISNULL(STRING(inserted.MINUTES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,26,3,inserted.id,null,null,deleted.MINUTES,inserted.MINUTES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_employee_security_answer','EMPLOYEE_SECURITY_ANSWER','B','U',1,'create trigger tr_bu_employee_security_answer before update on EMPLOYEE_SECURITY_ANSWER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,671,1,inserted.id,null,null,deleted.EMPLOYEE_ID,inserted.EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SEQUENCE),'''') <> ISNULL(STRING(inserted.SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,671,2,inserted.id,null,null,deleted.SEQUENCE,inserted.SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_EMPLOYEE_SECURITY_QUESTION_ID),'''') <> ISNULL(STRING(inserted.REF_EMPLOYEE_SECURITY_QUESTION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,671,3,inserted.id,null,null,deleted.REF_EMPLOYEE_SECURITY_QUESTION_ID,inserted.REF_EMPLOYEE_SECURITY_QUESTION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EMPLOYEE_SECURITY_ANSWER,'''') <> ISNULL(inserted.EMPLOYEE_SECURITY_ANSWER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,671,4,inserted.id,null,null,deleted.EMPLOYEE_SECURITY_ANSWER,inserted.EMPLOYEE_SECURITY_ANSWER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_employee_training','EMPLOYEE_TRAINING','B','U',1,'create trigger tr_bu_employee_training before update on EMPLOYEE_TRAINING referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.TRAINING_COURSE,'''') <> ISNULL(inserted.TRAINING_COURSE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,5,1,inserted.id,null,null,deleted.TRAINING_COURSE,inserted.TRAINING_COURSE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COMPLETION_DATE),'''') <> ISNULL(STRING(inserted.COMPLETION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,5,2,inserted.id,null,null,deleted.COMPLETION_DATE,inserted.COMPLETION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_end_of_day_monitor','END_OF_DAY_MONITOR','B','U',1,'create trigger tr_bu_end_of_day_monitor before update on END_OF_DAY_MONITOR referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_REPORT_PAPER_SIZE_ID),'''') <> ISNULL(STRING(inserted.REF_REPORT_PAPER_SIZE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,1,null,null,null,deleted.REF_REPORT_PAPER_SIZE_ID,inserted.REF_REPORT_PAPER_SIZE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MAINTENANCE_IN_PROGRESS,'''') <> ISNULL(inserted.MAINTENANCE_IN_PROGRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,2,null,null,null,deleted.MAINTENANCE_IN_PROGRESS,inserted.MAINTENANCE_IN_PROGRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NEW_DAY_STARTED_DATE),'''') <> ISNULL(STRING(inserted.NEW_DAY_STARTED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,3,null,null,null,deleted.NEW_DAY_STARTED_DATE,inserted.NEW_DAY_STARTED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EOD_STARTED_DATE),'''') <> ISNULL(STRING(inserted.EOD_STARTED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,4,null,null,null,deleted.EOD_STARTED_DATE,inserted.EOD_STARTED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REPORT_PRINTER_ID),'''') <> ISNULL(STRING(inserted.REPORT_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,5,null,null,null,deleted.REPORT_PRINTER_ID,inserted.REPORT_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REPORT_PRINT_ORIENTATION,'''') <> ISNULL(inserted.REPORT_PRINT_ORIENTATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,6,null,null,null,deleted.REPORT_PRINT_ORIENTATION,inserted.REPORT_PRINT_ORIENTATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REPORT_PRINTER_USE_DUPLEX,'''') <> ISNULL(inserted.REPORT_PRINTER_USE_DUPLEX,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,7,null,null,null,deleted.REPORT_PRINTER_USE_DUPLEX,inserted.REPORT_PRINTER_USE_DUPLEX,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STARTED_BY_IP_ADDRESS,'''') <> ISNULL(inserted.STARTED_BY_IP_ADDRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,8,null,null,null,deleted.STARTED_BY_IP_ADDRESS,inserted.STARTED_BY_IP_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STARTED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.STARTED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,9,null,null,null,deleted.STARTED_BY_EMPLOYEE_ID,inserted.STARTED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCT_DAY),'''') <> ISNULL(STRING(inserted.ACCT_DAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,10,null,null,null,deleted.ACCT_DAY,inserted.ACCT_DAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES_YEAR_MONTH),'''') <> ISNULL(STRING(inserted.SALES_YEAR_MONTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,11,null,null,null,deleted.SALES_YEAR_MONTH,inserted.SALES_YEAR_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES_QUARTER),'''') <> ISNULL(STRING(inserted.SALES_QUARTER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,12,null,null,null,deleted.SALES_QUARTER,inserted.SALES_QUARTER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_PRINTED_REF_REPORT_ID),'''') <> ISNULL(STRING(inserted.LAST_PRINTED_REF_REPORT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,13,null,null,null,deleted.LAST_PRINTED_REF_REPORT_ID,inserted.LAST_PRINTED_REF_REPORT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_COMPLETED_REF_EOD_TASK_ID),'''') <> ISNULL(STRING(inserted.LAST_COMPLETED_REF_EOD_TASK_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,14,null,null,null,deleted.LAST_COMPLETED_REF_EOD_TASK_ID,inserted.LAST_COMPLETED_REF_EOD_TASK_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_TASK_COMPLETED_DATE),'''') <> ISNULL(STRING(inserted.LAST_TASK_COMPLETED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,15,null,null,null,deleted.LAST_TASK_COMPLETED_DATE,inserted.LAST_TASK_COMPLETED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENT_REF_EOD_TASK_ID),'''') <> ISNULL(STRING(inserted.CURRENT_REF_EOD_TASK_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,16,null,null,null,deleted.CURRENT_REF_EOD_TASK_ID,inserted.CURRENT_REF_EOD_TASK_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENT_TASK_START_DATE),'''') <> ISNULL(STRING(inserted.CURRENT_TASK_START_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,17,null,null,null,deleted.CURRENT_TASK_START_DATE,inserted.CURRENT_TASK_START_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_BIN_LABEL_PRINT,'''') <> ISNULL(inserted.SKIP_BIN_LABEL_PRINT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,18,null,null,null,deleted.SKIP_BIN_LABEL_PRINT,inserted.SKIP_BIN_LABEL_PRINT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_BRANCH_STORE_INVOICE_POSTING,'''') <> ISNULL(inserted.SKIP_BRANCH_STORE_INVOICE_POSTING,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,19,null,null,null,deleted.SKIP_BRANCH_STORE_INVOICE_POSTING,inserted.SKIP_BRANCH_STORE_INVOICE_POSTING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_BRANCH_STORE_INVOICE_PROCESSING,'''') <> ISNULL(inserted.SKIP_BRANCH_STORE_INVOICE_PROCESSING,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,20,null,null,null,deleted.SKIP_BRANCH_STORE_INVOICE_PROCESSING,inserted.SKIP_BRANCH_STORE_INVOICE_PROCESSING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_REPORT_SELECTION_REVIEW,'''') <> ISNULL(inserted.SKIP_REPORT_SELECTION_REVIEW,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,21,null,null,null,deleted.SKIP_REPORT_SELECTION_REVIEW,inserted.SKIP_REPORT_SELECTION_REVIEW,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_MAJOR_ACCT_PRICING_CORRECTIONS,'''') <> ISNULL(inserted.SKIP_MAJOR_ACCT_PRICING_CORRECTIONS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,22,null,null,null,deleted.SKIP_MAJOR_ACCT_PRICING_CORRECTIONS,inserted.SKIP_MAJOR_ACCT_PRICING_CORRECTIONS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_EMPLOYEE_TIME_REVIEW,'''') <> ISNULL(inserted.SKIP_EMPLOYEE_TIME_REVIEW,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,23,null,null,null,deleted.SKIP_EMPLOYEE_TIME_REVIEW,inserted.SKIP_EMPLOYEE_TIME_REVIEW,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_BRANCH_STORE_TRANSMISSION_FILES,'''') <> ISNULL(inserted.SKIP_BRANCH_STORE_TRANSMISSION_FILES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,24,null,null,null,deleted.SKIP_BRANCH_STORE_TRANSMISSION_FILES,inserted.SKIP_BRANCH_STORE_TRANSMISSION_FILES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_JOEI_ORDER_TRANSMISSION,'''') <> ISNULL(inserted.SKIP_JOEI_ORDER_TRANSMISSION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,25,null,null,null,deleted.SKIP_JOEI_ORDER_TRANSMISSION,inserted.SKIP_JOEI_ORDER_TRANSMISSION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_NAPA_ORDER_CREATION,'''') <> ISNULL(inserted.SKIP_NAPA_ORDER_CREATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,26,null,null,null,deleted.SKIP_NAPA_ORDER_CREATION,inserted.SKIP_NAPA_ORDER_CREATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_FINALIZING_ORDERS,'''') <> ISNULL(inserted.SKIP_FINALIZING_ORDERS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,27,null,null,null,deleted.SKIP_FINALIZING_ORDERS,inserted.SKIP_FINALIZING_ORDERS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PROCESS_DVD_UPDATE,'''') <> ISNULL(inserted.PROCESS_DVD_UPDATE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,28,null,null,null,deleted.PROCESS_DVD_UPDATE,inserted.PROCESS_DVD_UPDATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SEND_MONTHLY_SALES_TRACKING,'''') <> ISNULL(inserted.SEND_MONTHLY_SALES_TRACKING,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,29,null,null,null,deleted.SEND_MONTHLY_SALES_TRACKING,inserted.SEND_MONTHLY_SALES_TRACKING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SEND_MONTHLY_MCGLADREY_REPORTS_FILE,'''') <> ISNULL(inserted.SEND_MONTHLY_MCGLADREY_REPORTS_FILE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,30,null,null,null,deleted.SEND_MONTHLY_MCGLADREY_REPORTS_FILE,inserted.SEND_MONTHLY_MCGLADREY_REPORTS_FILE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EOD_MONITOR_COMM_READY,'''') <> ISNULL(inserted.EOD_MONITOR_COMM_READY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,31,null,null,null,deleted.EOD_MONITOR_COMM_READY,inserted.EOD_MONITOR_COMM_READY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.COMM_IN_PROGRESS,'''') <> ISNULL(inserted.COMM_IN_PROGRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,32,null,null,null,deleted.COMM_IN_PROGRESS,inserted.COMM_IN_PROGRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SEND_BRANCH_STORE_TRANSMISSION,'''') <> ISNULL(inserted.SEND_BRANCH_STORE_TRANSMISSION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,33,null,null,null,deleted.SEND_BRANCH_STORE_TRANSMISSION,inserted.SEND_BRANCH_STORE_TRANSMISSION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_SENT_CUSTOMER_FILE_ACTIVITY_ID),'''') <> ISNULL(STRING(inserted.LAST_SENT_CUSTOMER_FILE_ACTIVITY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,34,null,null,null,deleted.LAST_SENT_CUSTOMER_FILE_ACTIVITY_ID,inserted.LAST_SENT_CUSTOMER_FILE_ACTIVITY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_EXPORT_TO_DATA_WAREHOUSE_DATE),'''') <> ISNULL(STRING(inserted.LAST_EXPORT_TO_DATA_WAREHOUSE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,35,null,null,null,deleted.LAST_EXPORT_TO_DATA_WAREHOUSE_DATE,inserted.LAST_EXPORT_TO_DATA_WAREHOUSE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SEND_BEGINNING_BALANCES_TO_SCORE,'''') <> ISNULL(inserted.SEND_BEGINNING_BALANCES_TO_SCORE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,36,null,null,null,deleted.SEND_BEGINNING_BALANCES_TO_SCORE,inserted.SEND_BEGINNING_BALANCES_TO_SCORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UNATTENDED_BACKUP,'''') <> ISNULL(inserted.UNATTENDED_BACKUP,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,37,null,null,null,deleted.UNATTENDED_BACKUP,inserted.UNATTENDED_BACKUP,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.END_OF_MONTH,'''') <> ISNULL(inserted.END_OF_MONTH,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,38,null,null,null,deleted.END_OF_MONTH,inserted.END_OF_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.END_OF_QUARTER,'''') <> ISNULL(inserted.END_OF_QUARTER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,39,null,null,null,deleted.END_OF_QUARTER,inserted.END_OF_QUARTER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CALENDAR_YEAR_END,'''') <> ISNULL(inserted.CALENDAR_YEAR_END,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,40,null,null,null,deleted.CALENDAR_YEAR_END,inserted.CALENDAR_YEAR_END,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FISCAL_YEAR_END,'''') <> ISNULL(inserted.FISCAL_YEAR_END,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,41,null,null,null,deleted.FISCAL_YEAR_END,inserted.FISCAL_YEAR_END,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EOD_BACKUP_FAILED,'''') <> ISNULL(inserted.EOD_BACKUP_FAILED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,42,null,null,null,deleted.EOD_BACKUP_FAILED,inserted.EOD_BACKUP_FAILED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_SENT_SCORE_FILE_ACTIVITY_ID),'''') <> ISNULL(STRING(inserted.LAST_SENT_SCORE_FILE_ACTIVITY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,43,null,null,null,deleted.LAST_SENT_SCORE_FILE_ACTIVITY_ID,inserted.LAST_SENT_SCORE_FILE_ACTIVITY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.COMM_RECEIVED,'''') <> ISNULL(inserted.COMM_RECEIVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,44,null,null,null,deleted.COMM_RECEIVED,inserted.COMM_RECEIVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PWD_OF_DAY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.PWD_OF_DAY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,45,null,null,null,deleted.PWD_OF_DAY_EMPLOYEE_ID,inserted.PWD_OF_DAY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LOAD_CATALOG_DVD,'''') <> ISNULL(inserted.LOAD_CATALOG_DVD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,46,null,null,null,deleted.LOAD_CATALOG_DVD,inserted.LOAD_CATALOG_DVD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EOD_TSU_FAILED,'''') <> ISNULL(inserted.EOD_TSU_FAILED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,47,null,null,null,deleted.EOD_TSU_FAILED,inserted.EOD_TSU_FAILED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_CDVD_PROCESSING,'''') <> ISNULL(inserted.SKIP_CDVD_PROCESSING,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,48,null,null,null,deleted.SKIP_CDVD_PROCESSING,inserted.SKIP_CDVD_PROCESSING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.START_BACKUP_NOW,'''') <> ISNULL(inserted.START_BACKUP_NOW,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,49,null,null,null,deleted.START_BACKUP_NOW,inserted.START_BACKUP_NOW,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PREVIOUS_EOD_STARTED_DATE),'''') <> ISNULL(STRING(inserted.PREVIOUS_EOD_STARTED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,50,null,null,null,deleted.PREVIOUS_EOD_STARTED_DATE,inserted.PREVIOUS_EOD_STARTED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BIN_LABEL_IN_PROGRESS,'''') <> ISNULL(inserted.BIN_LABEL_IN_PROGRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,51,null,null,null,deleted.BIN_LABEL_IN_PROGRESS,inserted.BIN_LABEL_IN_PROGRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BIN_LABEL_PRINTER_ID),'''') <> ISNULL(STRING(inserted.BIN_LABEL_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,52,null,null,null,deleted.BIN_LABEL_PRINTER_ID,inserted.BIN_LABEL_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SKIP_REVIEW_CHANGE_TRANSACTION,'''') <> ISNULL(inserted.SKIP_REVIEW_CHANGE_TRANSACTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,669,53,null,null,null,deleted.SKIP_REVIEW_CHANGE_TRANSACTION,inserted.SKIP_REVIEW_CHANGE_TRANSACTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_end_of_day_profile','END_OF_DAY_PROFILE','B','U',1,'create trigger tr_bu_end_of_day_profile before update on END_OF_DAY_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.SEND_LOCAL_DETAIL),'''') <> ISNULL(STRING(inserted.SEND_LOCAL_DETAIL),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,1,null,null,null,deleted.SEND_LOCAL_DETAIL,inserted.SEND_LOCAL_DETAIL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NON_STOCK_PURGE),'''') <> ISNULL(STRING(inserted.NON_STOCK_PURGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,2,null,null,null,deleted.NON_STOCK_PURGE,inserted.NON_STOCK_PURGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.HISTORY_PURGE_PROCESS_DAY),'''') <> ISNULL(STRING(inserted.HISTORY_PURGE_PROCESS_DAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,3,null,null,null,deleted.HISTORY_PURGE_PROCESS_DAY,inserted.HISTORY_PURGE_PROCESS_DAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SEND_EOM_REPORTABLE_SALES),'''') <> ISNULL(STRING(inserted.SEND_EOM_REPORTABLE_SALES),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,4,null,null,null,deleted.SEND_EOM_REPORTABLE_SALES,inserted.SEND_EOM_REPORTABLE_SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REPORTED_SALES_SUMMARY_COUNTER),'''') <> ISNULL(STRING(inserted.REPORTED_SALES_SUMMARY_COUNTER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,5,null,null,null,deleted.REPORTED_SALES_SUMMARY_COUNTER,inserted.REPORTED_SALES_SUMMARY_COUNTER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_REBATE_CLAIM_NUMBER),'''') <> ISNULL(STRING(inserted.LAST_REBATE_CLAIM_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,6,null,null,null,deleted.LAST_REBATE_CLAIM_NUMBER,inserted.LAST_REBATE_CLAIM_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_BIN_LABEL_GENERATED_DATE),'''') <> ISNULL(STRING(inserted.LAST_BIN_LABEL_GENERATED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,7,null,null,null,deleted.LAST_BIN_LABEL_GENERATED_DATE,inserted.LAST_BIN_LABEL_GENERATED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PHONE_SWITCH_REMINDER),'''') <> ISNULL(STRING(inserted.PHONE_SWITCH_REMINDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,8,null,null,null,deleted.PHONE_SWITCH_REMINDER,inserted.PHONE_SWITCH_REMINDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CLEAR_AVG_COST_AT_ECY),'''') <> ISNULL(STRING(inserted.CLEAR_AVG_COST_AT_ECY),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,9,null,null,null,deleted.CLEAR_AVG_COST_AT_ECY,inserted.CLEAR_AVG_COST_AT_ECY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TSU_RECEIVED,'''') <> ISNULL(inserted.TSU_RECEIVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,20,null,null,null,deleted.TSU_RECEIVED,inserted.TSU_RECEIVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXPORT_TO_DATA_WAREHOUSE),'''') <> ISNULL(STRING(inserted.EXPORT_TO_DATA_WAREHOUSE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,10,null,null,null,deleted.EXPORT_TO_DATA_WAREHOUSE,inserted.EXPORT_TO_DATA_WAREHOUSE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_AUTOSTART_EOD),'''') <> ISNULL(STRING(inserted.USE_AUTOSTART_EOD),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,11,null,null,null,deleted.USE_AUTOSTART_EOD,inserted.USE_AUTOSTART_EOD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AUTOSTART_TIME),'''') <> ISNULL(STRING(inserted.AUTOSTART_TIME),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,12,null,null,null,deleted.AUTOSTART_TIME,inserted.AUTOSTART_TIME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AUTOSTART_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.AUTOSTART_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,13,null,null,null,deleted.AUTOSTART_EMPLOYEE_ID,inserted.AUTOSTART_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AUTOSTART_REPORT_PRINTER_ID),'''') <> ISNULL(STRING(inserted.AUTOSTART_REPORT_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,14,null,null,null,deleted.AUTOSTART_REPORT_PRINTER_ID,inserted.AUTOSTART_REPORT_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AUTOSTART_REPORT_PRINT_ORIENTATION,'''') <> ISNULL(inserted.AUTOSTART_REPORT_PRINT_ORIENTATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,15,null,null,null,deleted.AUTOSTART_REPORT_PRINT_ORIENTATION,inserted.AUTOSTART_REPORT_PRINT_ORIENTATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AUTOSTART_REPORT_PRINTER_USE_DUPLEX,'''') <> ISNULL(inserted.AUTOSTART_REPORT_PRINTER_USE_DUPLEX,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,16,null,null,null,deleted.AUTOSTART_REPORT_PRINTER_USE_DUPLEX,inserted.AUTOSTART_REPORT_PRINTER_USE_DUPLEX,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BACKUP_FAILURE_MSG_TO_EMAIL,'''') <> ISNULL(inserted.BACKUP_FAILURE_MSG_TO_EMAIL,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,17,null,null,null,deleted.BACKUP_FAILURE_MSG_TO_EMAIL,inserted.BACKUP_FAILURE_MSG_TO_EMAIL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BACKUP_FAILURE_MSG_TO_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.BACKUP_FAILURE_MSG_TO_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,18,null,null,null,deleted.BACKUP_FAILURE_MSG_TO_EMPLOYEE_ID,inserted.BACKUP_FAILURE_MSG_TO_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AUTO_INVOICE_COSTING_GP_PERCENT),'''') <> ISNULL(STRING(inserted.AUTO_INVOICE_COSTING_GP_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,19,null,null,null,deleted.AUTO_INVOICE_COSTING_GP_PERCENT,inserted.AUTO_INVOICE_COSTING_GP_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_SENT_NAPA_ORDER_ACCT_DAY),'''') <> ISNULL(STRING(inserted.LAST_SENT_NAPA_ORDER_ACCT_DAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,21,null,null,null,deleted.LAST_SENT_NAPA_ORDER_ACCT_DAY,inserted.LAST_SENT_NAPA_ORDER_ACCT_DAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AUTOMATIC_CATALOG_UPDATE_DAY),'''') <> ISNULL(STRING(inserted.AUTOMATIC_CATALOG_UPDATE_DAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,22,null,null,null,deleted.AUTOMATIC_CATALOG_UPDATE_DAY,inserted.AUTOMATIC_CATALOG_UPDATE_DAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_LABEL_QTY_FOR_GENERATION),'''') <> ISNULL(STRING(inserted.USE_LABEL_QTY_FOR_GENERATION),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,23,null,null,null,deleted.USE_LABEL_QTY_FOR_GENERATION,inserted.USE_LABEL_QTY_FOR_GENERATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AUTO_CATALOG_UPDATE_DAY_OF_WEEK),'''') <> ISNULL(STRING(inserted.AUTO_CATALOG_UPDATE_DAY_OF_WEEK),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,24,null,null,null,deleted.AUTO_CATALOG_UPDATE_DAY_OF_WEEK,inserted.AUTO_CATALOG_UPDATE_DAY_OF_WEEK,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_NEW_EDW_COLUMN_DELIMITER),'''') <> ISNULL(STRING(inserted.USE_NEW_EDW_COLUMN_DELIMITER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,25,null,null,null,deleted.USE_NEW_EDW_COLUMN_DELIMITER,inserted.USE_NEW_EDW_COLUMN_DELIMITER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_WEEKEND_CATALOG_SETTINGS),'''') <> ISNULL(STRING(inserted.USE_WEEKEND_CATALOG_SETTINGS),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,26,null,null,null,deleted.USE_WEEKEND_CATALOG_SETTINGS,inserted.USE_WEEKEND_CATALOG_SETTINGS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EOD_TRIGGERED_SOURCE,'''') <> ISNULL(inserted.EOD_TRIGGERED_SOURCE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,27,null,null,null,deleted.EOD_TRIGGERED_SOURCE,inserted.EOD_TRIGGERED_SOURCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REGULATION_RUN_FREQUENCY),'''') <> ISNULL(STRING(inserted.REGULATION_RUN_FREQUENCY),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,96,28,null,null,null,deleted.REGULATION_RUN_FREQUENCY,inserted.REGULATION_RUN_FREQUENCY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.export_to_data_warehouse <> 1 then set inserted.export_to_data_warehouse=1 end if end', 'tr_bu_end_of_month_profile','END_OF_MONTH_PROFILE','B','U',1,'create trigger tr_bu_end_of_month_profile before update on END_OF_MONTH_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.SALES_MONTH_END_DATE),'''') <> ISNULL(STRING(inserted.SALES_MONTH_END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,474,1,inserted.REF_MONTH_OF_YEAR_ID,null,null,deleted.SALES_MONTH_END_DATE,inserted.SALES_MONTH_END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_eod_task_details','EOD_TASK_DETAILS','B','U',1,'create trigger tr_bu_eod_task_details before update on EOD_TASK_DETAILS referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.ACTIVE,'''') <> ISNULL(inserted.ACTIVE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,614,1,inserted.ref_eod_task_id,null,null,deleted.ACTIVE,inserted.ACTIVE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_factory_order_table','FACTORY_ORDER_TABLE','B','U',1,'create trigger tr_bu_factory_order_table before update on FACTORY_ORDER_TABLE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.IDENTIFIER,'''') <> ISNULL(inserted.IDENTIFIER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,1,inserted.id,null,null,deleted.IDENTIFIER,inserted.IDENTIFIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MANUFACTURER_NAME,'''') <> ISNULL(inserted.MANUFACTURER_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,2,inserted.id,null,null,deleted.MANUFACTURER_NAME,inserted.MANUFACTURER_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PROGRAM_NAME,'''') <> ISNULL(inserted.PROGRAM_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,3,inserted.id,null,null,deleted.PROGRAM_NAME,inserted.PROGRAM_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAPA_RESERVED,'''') <> ISNULL(inserted.NAPA_RESERVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,4,inserted.id,null,null,deleted.NAPA_RESERVED,inserted.NAPA_RESERVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EFFECTIVE_START_DATE),'''') <> ISNULL(STRING(inserted.EFFECTIVE_START_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,5,inserted.id,null,null,deleted.EFFECTIVE_START_DATE,inserted.EFFECTIVE_START_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EFFECTIVE_END_DATE),'''') <> ISNULL(STRING(inserted.EFFECTIVE_END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,6,inserted.id,null,null,deleted.EFFECTIVE_END_DATE,inserted.EFFECTIVE_END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_CORE_VALUE,'''') <> ISNULL(inserted.INCLUDE_CORE_VALUE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,7,inserted.id,null,null,deleted.INCLUDE_CORE_VALUE,inserted.INCLUDE_CORE_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_FACTORY_CRITERIA_CD_FOR_DISCOUNT,'''') <> ISNULL(inserted.REF_FACTORY_CRITERIA_CD_FOR_DISCOUNT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,8,inserted.id,null,null,deleted.REF_FACTORY_CRITERIA_CD_FOR_DISCOUNT,inserted.REF_FACTORY_CRITERIA_CD_FOR_DISCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MINIMUM_DOLLAR_VALUE),'''') <> ISNULL(STRING(inserted.MINIMUM_DOLLAR_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,9,inserted.id,null,null,deleted.MINIMUM_DOLLAR_VALUE,inserted.MINIMUM_DOLLAR_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MINIMUM_QUANTITY),'''') <> ISNULL(STRING(inserted.MINIMUM_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,10,inserted.id,null,null,deleted.MINIMUM_QUANTITY,inserted.MINIMUM_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_SPECIAL_ORDERS,'''') <> ISNULL(inserted.ALLOW_SPECIAL_ORDERS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,11,inserted.id,null,null,deleted.ALLOW_SPECIAL_ORDERS,inserted.ALLOW_SPECIAL_ORDERS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_WOG_ORDERS,'''') <> ISNULL(inserted.ALLOW_WOG_ORDERS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,12,inserted.id,null,null,deleted.ALLOW_WOG_ORDERS,inserted.ALLOW_WOG_ORDERS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CLASSIFICATION_UPGRADES,'''') <> ISNULL(inserted.CLASSIFICATION_UPGRADES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,13,inserted.id,null,null,deleted.CLASSIFICATION_UPGRADES,inserted.CLASSIFICATION_UPGRADES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_FACTORY_BACKORDER_HANDLING_CD,'''') <> ISNULL(inserted.REF_FACTORY_BACKORDER_HANDLING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,14,inserted.id,null,null,deleted.REF_FACTORY_BACKORDER_HANDLING_CD,inserted.REF_FACTORY_BACKORDER_HANDLING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_LINES_FOR_EXTRA_DISCOUNT),'''') <> ISNULL(STRING(inserted.MAXIMUM_LINES_FOR_EXTRA_DISCOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,15,inserted.id,null,null,deleted.MAXIMUM_LINES_FOR_EXTRA_DISCOUNT,inserted.MAXIMUM_LINES_FOR_EXTRA_DISCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_FACTORY_ORDER_QUANTITY_INCREMENTS,'''') <> ISNULL(inserted.USE_FACTORY_ORDER_QUANTITY_INCREMENTS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,16,inserted.id,null,null,deleted.USE_FACTORY_ORDER_QUANTITY_INCREMENTS,inserted.USE_FACTORY_ORDER_QUANTITY_INCREMENTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PROMO_CD,'''') <> ISNULL(inserted.PROMO_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,205,17,inserted.id,null,null,deleted.PROMO_CD,inserted.PROMO_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_factory_order_table_part','FACTORY_ORDER_TABLE_PART','B','U',1,'create trigger tr_bu_factory_order_table_part before update on FACTORY_ORDER_TABLE_PART referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,208,1,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,208,2,inserted.id,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_PERCENT),'''') <> ISNULL(STRING(inserted.DISCOUNT_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,208,3,inserted.id,null,null,deleted.DISCOUNT_PERCENT,inserted.DISCOUNT_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUANTITY_FOR_MULTIPLE_DISCOUNTS),'''') <> ISNULL(STRING(inserted.QUANTITY_FOR_MULTIPLE_DISCOUNTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,208,4,inserted.id,null,null,deleted.QUANTITY_FOR_MULTIPLE_DISCOUNTS,inserted.QUANTITY_FOR_MULTIPLE_DISCOUNTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_UNIT_TYPE,'''') <> ISNULL(inserted.DISCOUNT_UNIT_TYPE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,208,5,inserted.id,null,null,deleted.DISCOUNT_UNIT_TYPE,inserted.DISCOUNT_UNIT_TYPE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUANTITY_DISCOUNT_PERCENT),'''') <> ISNULL(STRING(inserted.QUANTITY_DISCOUNT_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,208,6,inserted.id,null,null,deleted.QUANTITY_DISCOUNT_PERCENT,inserted.QUANTITY_DISCOUNT_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTRA_DISCOUNT_FLAG,'''') <> ISNULL(inserted.EXTRA_DISCOUNT_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,208,7,inserted.id,null,null,deleted.EXTRA_DISCOUNT_FLAG,inserted.EXTRA_DISCOUNT_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXTRA_DISCOUNT_PERCENT),'''') <> ISNULL(STRING(inserted.EXTRA_DISCOUNT_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,208,8,inserted.id,null,null,deleted.EXTRA_DISCOUNT_PERCENT,inserted.EXTRA_DISCOUNT_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_OR_EXCLUDE,'''') <> ISNULL(inserted.INCLUDE_OR_EXCLUDE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,208,9,inserted.id,null,null,deleted.INCLUDE_OR_EXCLUDE,inserted.INCLUDE_OR_EXCLUDE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CASE_FACTOR),'''') <> ISNULL(STRING(inserted.CASE_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,208,10,inserted.id,null,null,deleted.CASE_FACTOR,inserted.CASE_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_factory_order_table_prefix','FACTORY_ORDER_TABLE_PREFIX','B','U',1,'create trigger tr_bu_factory_order_table_prefix before update on FACTORY_ORDER_TABLE_PREFIX referencing old as deleted new as inserted for each row begin declare i_return_status integer;if deleted.FACTORY_ORDER_TABLE_ID <> inserted.FACTORY_ORDER_TABLE_ID or deleted.LINE_ABBREV <> inserted.LINE_ABBREV or ISNULL(deleted.GROUP_CODE,-1) <> ISNULL(inserted.GROUP_CODE,-1) or ISNULL(deleted.PART_PREFIX,REPLICATE(''Z'',30)) <> ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) then if exists(select*from FACTORY_ORDER_TABLE_PREFIX where FACTORY_ORDER_TABLE_ID=inserted.FACTORY_ORDER_TABLE_ID and LINE_ABBREV=inserted.LINE_ABBREV and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ID <> inserted.ID) then raiserror 18147 ''tr_bu_factory_order_table_prefix: Duplicate value for UNIQUE index XAK1FACTORY_ORDER_TABLE_PREFIX.'' end if end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,1,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GROUP_CODE),'''') <> ISNULL(STRING(inserted.GROUP_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,2,inserted.id,null,null,deleted.GROUP_CODE,inserted.GROUP_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_PREFIX,'''') <> ISNULL(inserted.PART_PREFIX,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,3,inserted.id,null,null,deleted.PART_PREFIX,inserted.PART_PREFIX,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_PERCENT),'''') <> ISNULL(STRING(inserted.DISCOUNT_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,4,inserted.id,null,null,deleted.DISCOUNT_PERCENT,inserted.DISCOUNT_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUANTITY_FOR_MULTIPLE_DISCOUNTS),'''') <> ISNULL(STRING(inserted.QUANTITY_FOR_MULTIPLE_DISCOUNTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,5,inserted.id,null,null,deleted.QUANTITY_FOR_MULTIPLE_DISCOUNTS,inserted.QUANTITY_FOR_MULTIPLE_DISCOUNTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISCOUNT_UNIT_TYPE,'''') <> ISNULL(inserted.DISCOUNT_UNIT_TYPE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,6,inserted.id,null,null,deleted.DISCOUNT_UNIT_TYPE,inserted.DISCOUNT_UNIT_TYPE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUANTITY_DISCOUNT_PERCENT),'''') <> ISNULL(STRING(inserted.QUANTITY_DISCOUNT_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,7,inserted.id,null,null,deleted.QUANTITY_DISCOUNT_PERCENT,inserted.QUANTITY_DISCOUNT_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTRA_DISCOUNT_FLAG,'''') <> ISNULL(inserted.EXTRA_DISCOUNT_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,8,inserted.id,null,null,deleted.EXTRA_DISCOUNT_FLAG,inserted.EXTRA_DISCOUNT_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXTRA_DISCOUNT_PERCENT),'''') <> ISNULL(STRING(inserted.EXTRA_DISCOUNT_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,9,inserted.id,null,null,deleted.EXTRA_DISCOUNT_PERCENT,inserted.EXTRA_DISCOUNT_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_OR_EXCLUDE,'''') <> ISNULL(inserted.INCLUDE_OR_EXCLUDE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,10,inserted.id,null,null,deleted.INCLUDE_OR_EXCLUDE,inserted.INCLUDE_OR_EXCLUDE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CASE_FACTOR),'''') <> ISNULL(STRING(inserted.CASE_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,206,11,inserted.id,null,null,deleted.CASE_FACTOR,inserted.CASE_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_fulfillment','FULFILLMENT','B','U',1,'create trigger tr_bu_fulfillment before update on FULFILLMENT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.SALES_ORDER_ID),'''') <> ISNULL(STRING(inserted.SALES_ORDER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,682,1,inserted.id,null,null,deleted.SALES_ORDER_ID,inserted.SALES_ORDER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PURCHASE_ORDER_NUMBER,'''') <> ISNULL(inserted.PURCHASE_ORDER_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,682,2,inserted.id,null,null,deleted.PURCHASE_ORDER_NUMBER,inserted.PURCHASE_ORDER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SHIPPING_OPTION,'''') <> ISNULL(inserted.SHIPPING_OPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,682,3,inserted.id,null,null,deleted.SHIPPING_OPTION,inserted.SHIPPING_OPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_SHIPPING_OPTION_ID),'''') <> ISNULL(STRING(inserted.REF_SHIPPING_OPTION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,682,4,inserted.id,null,null,deleted.REF_SHIPPING_OPTION_ID,inserted.REF_SHIPPING_OPTION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SHIPPING_CARRIER,'''') <> ISNULL(inserted.SHIPPING_CARRIER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,682,5,inserted.id,null,null,deleted.SHIPPING_CARRIER,inserted.SHIPPING_CARRIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SHIPPING_CODE_CD,'''') <> ISNULL(inserted.SHIPPING_CODE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,682,6,inserted.id,null,null,deleted.SHIPPING_CODE_CD,inserted.SHIPPING_CODE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SHIPPING_COST),'''') <> ISNULL(STRING(inserted.SHIPPING_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,682,7,inserted.id,null,null,deleted.SHIPPING_COST,inserted.SHIPPING_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_MODIFIED_DATE),'''') <> ISNULL(STRING(inserted.LAST_MODIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,682,8,inserted.id,null,null,deleted.LAST_MODIFIED_DATE,inserted.LAST_MODIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MODIFIED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.MODIFIED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,682,9,inserted.id,null,null,deleted.MODIFIED_BY_EMPLOYEE_ID,inserted.MODIFIED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_fulfillment_identifier','FULFILLMENT_IDENTIFIER','B','U',1,'create trigger tr_bu_fulfillment_identifier before update on FULFILLMENT_IDENTIFIER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.FULFILLMENT_IDENTIFIER,'''') <> ISNULL(inserted.FULFILLMENT_IDENTIFIER,'''') then i_return_status=call sp_log_file_update_activity(1,683,1,inserted.fulfillment_id,inserted.ref_fulfillment_identifier_type_id,null,deleted.FULFILLMENT_IDENTIFIER,inserted.FULFILLMENT_IDENTIFIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_MODIFIED_DATE),'''') <> ISNULL(STRING(inserted.LAST_MODIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(1,683,2,inserted.fulfillment_id,inserted.ref_fulfillment_identifier_type_id,null,deleted.LAST_MODIFIED_DATE,inserted.LAST_MODIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MODIFIED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.MODIFIED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(1,683,3,inserted.fulfillment_id,inserted.ref_fulfillment_identifier_type_id,null,deleted.MODIFIED_BY_EMPLOYEE_ID,inserted.MODIFIED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_fulfillment_item','FULFILLMENT_ITEM','B','U',1,'create trigger tr_bu_fulfillment_item before update on FULFILLMENT_ITEM referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.SEQUENCE),'''') <> ISNULL(STRING(inserted.SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(1,684,1,inserted.id,null,null,deleted.SEQUENCE,inserted.SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(1,684,2,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(1,684,3,inserted.id,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUANTITY),'''') <> ISNULL(STRING(inserted.QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(1,684,4,inserted.id,null,null,deleted.QUANTITY,inserted.QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ANTICIPATED_SHIP_DATE),'''') <> ISNULL(STRING(inserted.ANTICIPATED_SHIP_DATE),'''') then i_return_status=call sp_log_file_update_activity(1,684,5,inserted.id,null,null,deleted.ANTICIPATED_SHIP_DATE,inserted.ANTICIPATED_SHIP_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ANTICIPATED_DELIVERY_DATE),'''') <> ISNULL(STRING(inserted.ANTICIPATED_DELIVERY_DATE),'''') then i_return_status=call sp_log_file_update_activity(1,684,6,inserted.id,null,null,deleted.ANTICIPATED_DELIVERY_DATE,inserted.ANTICIPATED_DELIVERY_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DATE_CREATED),'''') <> ISNULL(STRING(inserted.DATE_CREATED),'''') then i_return_status=call sp_log_file_update_activity(1,684,7,inserted.id,null,null,deleted.DATE_CREATED,inserted.DATE_CREATED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_MODIFIED_DATE),'''') <> ISNULL(STRING(inserted.LAST_MODIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(1,684,8,inserted.id,null,null,deleted.LAST_MODIFIED_DATE,inserted.LAST_MODIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MODIFIED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.MODIFIED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(1,684,9,inserted.id,null,null,deleted.MODIFIED_BY_EMPLOYEE_ID,inserted.MODIFIED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_PRICE),'''') <> ISNULL(STRING(inserted.UNIT_PRICE),'''') then i_return_status=call sp_log_file_update_activity(1,684,10,inserted.id,null,null,deleted.UNIT_PRICE,inserted.UNIT_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_CORE_PRICE),'''') <> ISNULL(STRING(inserted.UNIT_CORE_PRICE),'''') then i_return_status=call sp_log_file_update_activity(1,684,11,inserted.id,null,null,deleted.UNIT_CORE_PRICE,inserted.UNIT_CORE_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_SELLING_PRICE),'''') <> ISNULL(STRING(inserted.UNIT_SELLING_PRICE),'''') then i_return_status=call sp_log_file_update_activity(1,684,12,inserted.id,null,null,deleted.UNIT_SELLING_PRICE,inserted.UNIT_SELLING_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_SELLING_CORE_PRICE),'''') <> ISNULL(STRING(inserted.UNIT_SELLING_CORE_PRICE),'''') then i_return_status=call sp_log_file_update_activity(1,684,13,inserted.id,null,null,deleted.UNIT_SELLING_CORE_PRICE,inserted.UNIT_SELLING_CORE_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UNIT_OF_MEASURE,'''') <> ISNULL(inserted.UNIT_OF_MEASURE,'''') then i_return_status=call sp_log_file_update_activity(1,684,14,inserted.id,null,null,deleted.UNIT_OF_MEASURE,inserted.UNIT_OF_MEASURE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_DISCOUNT),'''') <> ISNULL(STRING(inserted.UNIT_DISCOUNT),'''') then i_return_status=call sp_log_file_update_activity(1,684,15,inserted.id,null,null,deleted.UNIT_DISCOUNT,inserted.UNIT_DISCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GENERATED_BY_SEQUENCE),'''') <> ISNULL(STRING(inserted.GENERATED_BY_SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(1,684,16,inserted.id,null,null,deleted.GENERATED_BY_SEQUENCE,inserted.GENERATED_BY_SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_fulfillment_note','FULFILLMENT_NOTE','B','U',1,'create trigger tr_bu_fulfillment_note before update on FULFILLMENT_NOTE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.SEQUENCE),'''') <> ISNULL(STRING(inserted.SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(1,685,1,inserted.id,null,null,deleted.SEQUENCE,inserted.SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TEXT,'''') <> ISNULL(inserted.TEXT,'''') then i_return_status=call sp_log_file_update_activity(1,685,2,inserted.id,null,null,deleted.TEXT,inserted.TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_MODIFIED_DATE),'''') <> ISNULL(STRING(inserted.LAST_MODIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(1,685,3,inserted.id,null,null,deleted.LAST_MODIFIED_DATE,inserted.LAST_MODIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MODIFIED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.MODIFIED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(1,685,4,inserted.id,null,null,deleted.MODIFIED_BY_EMPLOYEE_ID,inserted.MODIFIED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_gl_code','GL_CODE','B','U',1,'create trigger tr_bu_gl_code before update on GL_CODE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.GL_CODE_NUMBER),'''') <> ISNULL(STRING(inserted.GL_CODE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,442,1,inserted.id,null,null,deleted.GL_CODE_NUMBER,inserted.GL_CODE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,442,2,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.VALID_FOR_DISBURSEMENTS,'''') <> ISNULL(inserted.VALID_FOR_DISBURSEMENTS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,442,3,inserted.id,null,null,deleted.VALID_FOR_DISBURSEMENTS,inserted.VALID_FOR_DISBURSEMENTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.VALID_FOR_CASH_JOURNAL,'''') <> ISNULL(inserted.VALID_FOR_CASH_JOURNAL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,442,4,inserted.id,null,null,deleted.VALID_FOR_CASH_JOURNAL,inserted.VALID_FOR_CASH_JOURNAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.VALID_FOR_BUYOUTS,'''') <> ISNULL(inserted.VALID_FOR_BUYOUTS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,442,5,inserted.id,null,null,deleted.VALID_FOR_BUYOUTS,inserted.VALID_FOR_BUYOUTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.HELP_INFO_TEXT,'''') <> ISNULL(inserted.HELP_INFO_TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,442,6,inserted.id,null,null,deleted.HELP_INFO_TEXT,inserted.HELP_INFO_TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_gl_code_ap_check','DISB_CHECK_GL_CODE','B','U',1,'create trigger tr_bu_gl_code_ap_check before update on DISB_CHECK_GL_CODE referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from disb_check where id=deleted.disb_check_id and loc=deleted.loc;if ISNULL(STRING(deleted.DISB_CHECK_ID),'''') <> ISNULL(STRING(inserted.DISB_CHECK_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,456,1,inserted.id,null,null,deleted.DISB_CHECK_ID,inserted.DISB_CHECK_ID,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(STRING(deleted.AMOUNT),'''') <> ISNULL(STRING(inserted.AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,456,3,inserted.id,null,null,deleted.AMOUNT,inserted.AMOUNT,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.DC_IDENTIFIER,'''') <> ISNULL(inserted.DC_IDENTIFIER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,456,4,inserted.id,null,null,deleted.DC_IDENTIFIER,inserted.DC_IDENTIFIER,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(STRING(deleted.STORE_NUMBER),'''') <> ISNULL(STRING(inserted.STORE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,456,5,inserted.id,null,null,deleted.STORE_NUMBER,inserted.STORE_NUMBER,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if i_return_status=-1 then update disb_check set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.disb_check_id and loc=inserted.loc end if end', 'tr_bu_hazardous_materials','HAZARDOUS_MATERIALS','B','U',1,'create trigger tr_bu_hazardous_materials before update on HAZARDOUS_MATERIALS referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.SHIPPING_NAME,'''') <> ISNULL(inserted.SHIPPING_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,224,1,inserted.id,null,null,deleted.SHIPPING_NAME,inserted.SHIPPING_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ENVIRONMENTAL_CLASS,'''') <> ISNULL(inserted.ENVIRONMENTAL_CLASS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,224,2,inserted.id,null,null,deleted.ENVIRONMENTAL_CLASS,inserted.ENVIRONMENTAL_CLASS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DOT_ID_NUMBER,'''') <> ISNULL(inserted.DOT_ID_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,224,3,inserted.id,null,null,deleted.DOT_ID_NUMBER,inserted.DOT_ID_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.HARMONIZED_CODE,'''') <> ISNULL(inserted.HARMONIZED_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,224,4,inserted.id,null,null,deleted.HARMONIZED_CODE,inserted.HARMONIZED_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MOST_HAZARDOUS_MATERIAL,'''') <> ISNULL(inserted.MOST_HAZARDOUS_MATERIAL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,224,5,inserted.id,null,null,deleted.MOST_HAZARDOUS_MATERIAL,inserted.MOST_HAZARDOUS_MATERIAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SECOND_MOST_HAZARDOUS_MATERIAL,'''') <> ISNULL(inserted.SECOND_MOST_HAZARDOUS_MATERIAL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,224,6,inserted.id,null,null,deleted.SECOND_MOST_HAZARDOUS_MATERIAL,inserted.SECOND_MOST_HAZARDOUS_MATERIAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RESERVED,'''') <> ISNULL(inserted.RESERVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,224,7,inserted.id,null,null,deleted.RESERVED,inserted.RESERVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_inventory','INVENTORY','B','U',1,'create trigger tr_bu_inventory before update on INVENTORY referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.EXPANDED_PART_NUMBER,'''') <> ISNULL(inserted.EXPANDED_PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,1,inserted.id,null,null,deleted.EXPANDED_PART_NUMBER,inserted.EXPANDED_PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,2,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STORE_GROUP_ID),'''') <> ISNULL(STRING(inserted.STORE_GROUP_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,3,inserted.id,null,null,deleted.STORE_GROUP_ID,inserted.STORE_GROUP_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEPARTMENT_ID),'''') <> ISNULL(STRING(inserted.DEPARTMENT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,4,inserted.id,null,null,deleted.DEPARTMENT_ID,inserted.DEPARTMENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SUB_DEPARTMENT_ID),'''') <> ISNULL(STRING(inserted.SUB_DEPARTMENT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,5,inserted.id,null,null,deleted.SUB_DEPARTMENT_ID,inserted.SUB_DEPARTMENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CURRENT_YEAR_REF_CLASS_CD,'''') <> ISNULL(inserted.CURRENT_YEAR_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,6,inserted.id,null,null,deleted.CURRENT_YEAR_REF_CLASS_CD,inserted.CURRENT_YEAR_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LAST_YEAR_REF_CLASS_CD,'''') <> ISNULL(inserted.LAST_YEAR_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,7,inserted.id,null,null,deleted.LAST_YEAR_REF_CLASS_CD,inserted.LAST_YEAR_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GROUP_CODE),'''') <> ISNULL(STRING(inserted.GROUP_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,8,inserted.id,null,null,deleted.GROUP_CODE,inserted.GROUP_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_UNIT_DESIGNATOR_CD,'''') <> ISNULL(inserted.REF_UNIT_DESIGNATOR_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,9,inserted.id,null,null,deleted.REF_UNIT_DESIGNATOR_CD,inserted.REF_UNIT_DESIGNATOR_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.HAZARDOUS_MATERIALS_ID),'''') <> ISNULL(STRING(inserted.HAZARDOUS_MATERIALS_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,10,inserted.id,null,null,deleted.HAZARDOUS_MATERIALS_ID,inserted.HAZARDOUS_MATERIALS_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PER_CAR_QTY),'''') <> ISNULL(STRING(inserted.PER_CAR_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,11,inserted.id,null,null,deleted.PER_CAR_QTY,inserted.PER_CAR_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SUPPLIER_ID),'''') <> ISNULL(STRING(inserted.SUPPLIER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,12,inserted.id,null,null,deleted.SUPPLIER_ID,inserted.SUPPLIER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STANDARD_PKG),'''') <> ISNULL(STRING(inserted.STANDARD_PKG),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,13,inserted.id,null,null,deleted.STANDARD_PKG,inserted.STANDARD_PKG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FACTORY_STD_PKG),'''') <> ISNULL(STRING(inserted.FACTORY_STD_PKG),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,14,inserted.id,null,null,deleted.FACTORY_STD_PKG,inserted.FACTORY_STD_PKG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SORT_NUMBER),'''') <> ISNULL(STRING(inserted.SORT_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,15,inserted.id,null,null,deleted.SORT_NUMBER,inserted.SORT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CASE_QTY),'''') <> ISNULL(STRING(inserted.CASE_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,16,inserted.id,null,null,deleted.CASE_QTY,inserted.CASE_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_SEASONAL_FLAG_CD,'''') <> ISNULL(inserted.REF_SEASONAL_FLAG_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,17,inserted.id,null,null,deleted.REF_SEASONAL_FLAG_CD,inserted.REF_SEASONAL_FLAG_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_PRICE_CHANGE_DATE),'''') <> ISNULL(STRING(inserted.LAST_PRICE_CHANGE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,18,inserted.id,null,null,deleted.LAST_PRICE_CHANGE_DATE,inserted.LAST_PRICE_CHANGE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LOCK_RESALE_PRICES,'''') <> ISNULL(inserted.LOCK_RESALE_PRICES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,19,inserted.id,null,null,deleted.LOCK_RESALE_PRICES,inserted.LOCK_RESALE_PRICES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LOCK_COST_CORE_COST,'''') <> ISNULL(inserted.LOCK_COST_CORE_COST,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,20,inserted.id,null,null,deleted.LOCK_COST_CORE_COST,inserted.LOCK_COST_CORE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REPORTABLE,'''') <> ISNULL(inserted.REPORTABLE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,21,inserted.id,null,null,deleted.REPORTABLE,inserted.REPORTABLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,22,inserted.id,null,null,deleted.TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,23,inserted.id,null,null,deleted.TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CORE_SALES_TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') <> ISNULL(inserted.CORE_SALES_TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,24,inserted.id,null,null,deleted.CORE_SALES_TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.CORE_SALES_TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CORE_SALES_TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') <> ISNULL(inserted.CORE_SALES_TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,25,inserted.id,null,null,deleted.CORE_SALES_TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.CORE_SALES_TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CORE_RETURNS_TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') <> ISNULL(inserted.CORE_RETURNS_TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,26,inserted.id,null,null,deleted.CORE_RETURNS_TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.CORE_RETURNS_TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CORE_RETURNS_TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') <> ISNULL(inserted.CORE_RETURNS_TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,27,inserted.id,null,null,deleted.CORE_RETURNS_TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.CORE_RETURNS_TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LIST),'''') <> ISNULL(STRING(inserted.LIST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,28,inserted.id,null,null,deleted.LIST,inserted.LIST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RED),'''') <> ISNULL(STRING(inserted.RED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,29,inserted.id,null,null,deleted.RED,inserted.RED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.YELLOW),'''') <> ISNULL(STRING(inserted.YELLOW),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,30,inserted.id,null,null,deleted.YELLOW,inserted.YELLOW,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GREEN),'''') <> ISNULL(STRING(inserted.GREEN),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,31,inserted.id,null,null,deleted.GREEN,inserted.GREEN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PINK),'''') <> ISNULL(STRING(inserted.PINK),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,32,inserted.id,null,null,deleted.PINK,inserted.PINK,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MASTER_INSTALLER),'''') <> ISNULL(STRING(inserted.MASTER_INSTALLER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,33,inserted.id,null,null,deleted.MASTER_INSTALLER,inserted.MASTER_INSTALLER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BLUE),'''') <> ISNULL(STRING(inserted.BLUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,34,inserted.id,null,null,deleted.BLUE,inserted.BLUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CORE_PRICE),'''') <> ISNULL(STRING(inserted.CORE_PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,35,inserted.id,null,null,deleted.CORE_PRICE,inserted.CORE_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COST),'''') <> ISNULL(STRING(inserted.COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,36,inserted.id,null,null,deleted.COST,inserted.COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DVD_COST),'''') <> ISNULL(STRING(inserted.DVD_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,54,inserted.id,null,null,deleted.DVD_COST,inserted.DVD_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.JOBBER_STOCKED_COST),'''') <> ISNULL(STRING(inserted.JOBBER_STOCKED_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,37,inserted.id,null,null,deleted.JOBBER_STOCKED_COST,inserted.JOBBER_STOCKED_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.JOBBER_NON_STOCKED_COST),'''') <> ISNULL(STRING(inserted.JOBBER_NON_STOCKED_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,38,inserted.id,null,null,deleted.JOBBER_NON_STOCKED_COST,inserted.JOBBER_NON_STOCKED_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CORE_COST),'''') <> ISNULL(STRING(inserted.CORE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,39,inserted.id,null,null,deleted.CORE_COST,inserted.CORE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.JOBBER_CORE_COST),'''') <> ISNULL(STRING(inserted.JOBBER_CORE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,53,inserted.id,null,null,deleted.JOBBER_CORE_COST,inserted.JOBBER_CORE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STORE_RETAIL_PRICE1),'''') <> ISNULL(STRING(inserted.STORE_RETAIL_PRICE1),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,40,inserted.id,null,null,deleted.STORE_RETAIL_PRICE1,inserted.STORE_RETAIL_PRICE1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STORE_RETAIL_PRICE2),'''') <> ISNULL(STRING(inserted.STORE_RETAIL_PRICE2),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,41,inserted.id,null,null,deleted.STORE_RETAIL_PRICE2,inserted.STORE_RETAIL_PRICE2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STORE_RETAIL_PRICE3),'''') <> ISNULL(STRING(inserted.STORE_RETAIL_PRICE3),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,42,inserted.id,null,null,deleted.STORE_RETAIL_PRICE3,inserted.STORE_RETAIL_PRICE3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AVERAGE_COST),'''') <> ISNULL(STRING(inserted.AVERAGE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,43,inserted.id,null,null,deleted.AVERAGE_COST,inserted.AVERAGE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ECONOMIC_ORDER_QTY),'''') <> ISNULL(STRING(inserted.ECONOMIC_ORDER_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,44,inserted.id,null,null,deleted.ECONOMIC_ORDER_QTY,inserted.ECONOMIC_ORDER_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ECONOMIC_ORDER_QTY_DISCOUNT_PERCENT),'''') <> ISNULL(STRING(inserted.ECONOMIC_ORDER_QTY_DISCOUNT_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,45,inserted.id,null,null,deleted.ECONOMIC_ORDER_QTY_DISCOUNT_PERCENT,inserted.ECONOMIC_ORDER_QTY_DISCOUNT_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_YR_COST),'''') <> ISNULL(STRING(inserted.LAST_YR_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,46,inserted.id,null,null,deleted.LAST_YR_COST,inserted.LAST_YR_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_YR_CORE_COST),'''') <> ISNULL(STRING(inserted.LAST_YR_CORE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,47,inserted.id,null,null,deleted.LAST_YR_CORE_COST,inserted.LAST_YR_CORE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_QTY_MIN_FOR_DISCOUNT),'''') <> ISNULL(STRING(inserted.INVOICE_QTY_MIN_FOR_DISCOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,48,inserted.id,null,null,deleted.INVOICE_QTY_MIN_FOR_DISCOUNT,inserted.INVOICE_QTY_MIN_FOR_DISCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_FOR_LARGE_INVOICES),'''') <> ISNULL(STRING(inserted.DISCOUNT_FOR_LARGE_INVOICES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,49,inserted.id,null,null,deleted.DISCOUNT_FOR_LARGE_INVOICES,inserted.DISCOUNT_FOR_LARGE_INVOICES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.WEIGHT_IN_KILOS),'''') <> ISNULL(STRING(inserted.WEIGHT_IN_KILOS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,50,inserted.id,null,null,deleted.WEIGHT_IN_KILOS,inserted.WEIGHT_IN_KILOS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.COUNTRY_OF_ORIGIN,'''') <> ISNULL(inserted.COUNTRY_OF_ORIGIN,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,51,inserted.id,null,null,deleted.COUNTRY_OF_ORIGIN,inserted.COUNTRY_OF_ORIGIN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTERNAL_PRODUCT_CODE,'''') <> ISNULL(inserted.EXTERNAL_PRODUCT_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,55,inserted.id,null,null,deleted.EXTERNAL_PRODUCT_CODE,inserted.EXTERNAL_PRODUCT_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DC_ONLY,'''') <> ISNULL(inserted.DC_ONLY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,133,56,inserted.id,null,null,deleted.DC_ONLY,inserted.DC_ONLY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.department_id is null and inserted.sub_department_id is not null then raiserror 18023 ''tr_bu_inventory: SUB_DEPARTMENT cannot exist without DEPARTMENT.'' end if;if not exists(select id from product_line where product_line.loc=inserted.loc and product_line.line_abbrev=inserted.line_abbrev and not inserted.line_abbrev=any(select ref_reserved_line_cd from ref_reserved_line_country where ref_country_cd=(select ref_country_cd from store_profile where loc=inserted.loc))) then raiserror 18023 ''tr_bu_inventory: line_abbrev '' || inserted.line_abbrev || ''is reserved or does not exist.'' end if;if fn_stripped_part_number(inserted.expanded_part_number) <> inserted.part_number then raiserror 18023 ''tr_bu_inventory: expanded_part_number '' || inserted.expanded_part_number || '' does not match part_number '' || inserted.part_number || ''.'' end if end', 'tr_bu_inventory_adjustment_document','INVENTORY_ADJUSTMENT_DOCUMENT','B','U',1,'create trigger tr_bu_inventory_adjustment_document before update on INVENTORY_ADJUSTMENT_DOCUMENT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DOCUMENT_NUMBER,'''') <> ISNULL(inserted.DOCUMENT_NUMBER,'''') then call sp_log_file_update_activity(inserted.LOC,650,1,inserted.ID,null,null,deleted.DOCUMENT_NUMBER,inserted.DOCUMENT_NUMBER,null,null,null,1) end if end', 'tr_bu_inventory_adjustment_log','INVENTORY_ADJUSTMENT_LOG','B','U',1,'create trigger tr_bu_inventory_adjustment_log before update on INVENTORY_ADJUSTMENT_LOG referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.INVENTORY_ADJUSTMENT_DOCUMENT_ID),'''') <> ISNULL(STRING(inserted.INVENTORY_ADJUSTMENT_DOCUMENT_ID),'''') then call sp_log_file_update_activity(inserted.LOC,651,1,inserted.ID,null,null,deleted.INVENTORY_ADJUSTMENT_DOCUMENT_ID,inserted.INVENTORY_ADJUSTMENT_DOCUMENT_ID,null,null,null,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then call sp_log_file_update_activity(inserted.LOC,651,2,inserted.ID,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,null,null,null,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then call sp_log_file_update_activity(inserted.LOC,651,3,inserted.ID,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,null,null,null,1) end if;if ISNULL(STRING(deleted.ON_HAND_QTY_ADJUSTMENT),'''') <> ISNULL(STRING(inserted.ON_HAND_QTY_ADJUSTMENT),'''') then call sp_log_file_update_activity(inserted.LOC,651,4,inserted.ID,null,null,deleted.ON_HAND_QTY_ADJUSTMENT,inserted.ON_HAND_QTY_ADJUSTMENT,null,null,null,1) end if;if ISNULL(STRING(deleted.ON_ORDER_QTY_ADJUSTMENT),'''') <> ISNULL(STRING(inserted.ON_ORDER_QTY_ADJUSTMENT),'''') then call sp_log_file_update_activity(inserted.LOC,651,5,inserted.ID,null,null,deleted.ON_ORDER_QTY_ADJUSTMENT,inserted.ON_ORDER_QTY_ADJUSTMENT,null,null,null,1) end if;if ISNULL(STRING(deleted.ON_BACKORDER_QTY_ADJUSTMENT),'''') <> ISNULL(STRING(inserted.ON_BACKORDER_QTY_ADJUSTMENT),'''') then call sp_log_file_update_activity(inserted.LOC,651,6,inserted.ID,null,null,deleted.ON_BACKORDER_QTY_ADJUSTMENT,inserted.ON_BACKORDER_QTY_ADJUSTMENT,null,null,null,1) end if;if ISNULL(STRING(deleted.COST),'''') <> ISNULL(STRING(inserted.COST),'''') then call sp_log_file_update_activity(inserted.LOC,651,7,inserted.ID,null,null,deleted.COST,inserted.COST,null,null,null,1) end if;if ISNULL(STRING(deleted.CORE_COST),'''') <> ISNULL(STRING(inserted.CORE_COST),'''') then call sp_log_file_update_activity(inserted.LOC,651,8,inserted.ID,null,null,deleted.CORE_COST,inserted.CORE_COST,null,null,null,1) end if;if ISNULL(deleted.COSTS_UPDATED,'''') <> ISNULL(inserted.COSTS_UPDATED,'''') then call sp_log_file_update_activity(inserted.LOC,651,9,inserted.ID,null,null,deleted.COSTS_UPDATED,inserted.COSTS_UPDATED,null,null,null,1) end if;if ISNULL(STRING(deleted.ADJUSTMENT_DATE),'''') <> ISNULL(STRING(inserted.ADJUSTMENT_DATE),'''') then call sp_log_file_update_activity(inserted.LOC,651,10,inserted.ID,null,null,deleted.ADJUSTMENT_DATE,inserted.ADJUSTMENT_DATE,null,null,null,1) end if;if ISNULL(STRING(deleted.ENTERED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.ENTERED_BY_EMPLOYEE_ID),'''') then call sp_log_file_update_activity(inserted.LOC,651,11,inserted.ID,null,null,deleted.ENTERED_BY_EMPLOYEE_ID,inserted.ENTERED_BY_EMPLOYEE_ID,null,null,null,1) end if end', 'tr_bu_inventory_note','INVENTORY_NOTE','B','U',1,'create trigger tr_bu_inventory_note before update on INVENTORY_NOTE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.TEXT,'''') <> ISNULL(inserted.TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,134,1,inserted.id,null,null,deleted.TEXT,inserted.TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_NOTE_HANDLING_ID),'''') <> ISNULL(STRING(inserted.REF_NOTE_HANDLING_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,134,2,inserted.id,null,null,deleted.REF_NOTE_HANDLING_ID,inserted.REF_NOTE_HANDLING_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXPIRATION_DATE),'''') <> ISNULL(STRING(inserted.EXPIRATION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,134,3,inserted.id,null,null,deleted.EXPIRATION_DATE,inserted.EXPIRATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IS_CORE_CHARGE_ONLY_NOTE,'''') <> ISNULL(inserted.IS_CORE_CHARGE_ONLY_NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,134,4,inserted.id,null,null,deleted.IS_CORE_CHARGE_ONLY_NOTE,inserted.IS_CORE_CHARGE_ONLY_NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_inventory_profile','INVENTORY_PROFILE','B','U',1,'create trigger tr_bu_inventory_profile before update on INVENTORY_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.AUTO_POST_NAPA_ORDER_RECEIPTS),'''') <> ISNULL(STRING(inserted.AUTO_POST_NAPA_ORDER_RECEIPTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,1,null,null,null,deleted.AUTO_POST_NAPA_ORDER_RECEIPTS,inserted.AUTO_POST_NAPA_ORDER_RECEIPTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MAIN_INVENTORY_STORE_NUMBER,'''') <> ISNULL(inserted.MAIN_INVENTORY_STORE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,3,null,null,null,deleted.MAIN_INVENTORY_STORE_NUMBER,inserted.MAIN_INVENTORY_STORE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_TRANSMIT_OF_ORDERS_TO_MAIN_STORE),'''') <> ISNULL(STRING(inserted.ALLOW_TRANSMIT_OF_ORDERS_TO_MAIN_STORE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,4,null,null,null,deleted.ALLOW_TRANSMIT_OF_ORDERS_TO_MAIN_STORE,inserted.ALLOW_TRANSMIT_OF_ORDERS_TO_MAIN_STORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BASE_REF_CLASS_CD,'''') <> ISNULL(inserted.BASE_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,5,null,null,null,deleted.BASE_REF_CLASS_CD,inserted.BASE_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEFAULT_REF_BIN_LABEL_TYPE_ID),'''') <> ISNULL(STRING(inserted.DEFAULT_REF_BIN_LABEL_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,7,null,null,null,deleted.DEFAULT_REF_BIN_LABEL_TYPE_ID,inserted.DEFAULT_REF_BIN_LABEL_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UPDATE_PARTS_WITH_CATALOG_DESCRIPTIONS),'''') <> ISNULL(STRING(inserted.UPDATE_PARTS_WITH_CATALOG_DESCRIPTIONS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,8,null,null,null,deleted.UPDATE_PARTS_WITH_CATALOG_DESCRIPTIONS,inserted.UPDATE_PARTS_WITH_CATALOG_DESCRIPTIONS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LOCK_MISCELLANEOUS_CHARGES),'''') <> ISNULL(STRING(inserted.LOCK_MISCELLANEOUS_CHARGES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,9,null,null,null,deleted.LOCK_MISCELLANEOUS_CHARGES,inserted.LOCK_MISCELLANEOUS_CHARGES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_PURCHASE_ORDER_NUMBER),'''') <> ISNULL(STRING(inserted.LAST_PURCHASE_ORDER_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,10,null,null,null,deleted.LAST_PURCHASE_ORDER_NUMBER,inserted.LAST_PURCHASE_ORDER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_SHIPMENT_NUMBER),'''') <> ISNULL(STRING(inserted.LAST_SHIPMENT_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,11,null,null,null,deleted.LAST_SHIPMENT_NUMBER,inserted.LAST_SHIPMENT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_INVENTORY_ADJUSTMENTS_DAYS),'''') <> ISNULL(STRING(inserted.KEEP_INVENTORY_ADJUSTMENTS_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,12,null,null,null,deleted.KEEP_INVENTORY_ADJUSTMENTS_DAYS,inserted.KEEP_INVENTORY_ADJUSTMENTS_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_INVENTORY_SALES_HISTORY_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_INVENTORY_SALES_HISTORY_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,21,null,null,null,deleted.KEEP_INVENTORY_SALES_HISTORY_MONTHS,inserted.KEEP_INVENTORY_SALES_HISTORY_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_PURCHASE_ORDERS_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_PURCHASE_ORDERS_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,22,null,null,null,deleted.KEEP_PURCHASE_ORDERS_MONTHS,inserted.KEEP_PURCHASE_ORDERS_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_MISC_INVENTORY_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_MISC_INVENTORY_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,23,null,null,null,deleted.KEEP_MISC_INVENTORY_MONTHS,inserted.KEEP_MISC_INVENTORY_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_SCORE_FOR_ORDERING),'''') <> ISNULL(STRING(inserted.USE_SCORE_FOR_ORDERING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,13,null,null,null,deleted.USE_SCORE_FOR_ORDERING,inserted.USE_SCORE_FOR_ORDERING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LOAD_BEGINNING_BALANCES_TO_SCORE,'''') <> ISNULL(inserted.LOAD_BEGINNING_BALANCES_TO_SCORE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,14,null,null,null,deleted.LOAD_BEGINNING_BALANCES_TO_SCORE,inserted.LOAD_BEGINNING_BALANCES_TO_SCORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INV_REVIEW_INCLUDE_PARTS_FROM_DVD),'''') <> ISNULL(STRING(inserted.INV_REVIEW_INCLUDE_PARTS_FROM_DVD),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,28,null,null,null,deleted.INV_REVIEW_INCLUDE_PARTS_FROM_DVD,inserted.INV_REVIEW_INCLUDE_PARTS_FROM_DVD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_DAYS_ON_ORDER),'''') <> ISNULL(STRING(inserted.MAXIMUM_DAYS_ON_ORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,24,null,null,null,deleted.MAXIMUM_DAYS_ON_ORDER,inserted.MAXIMUM_DAYS_ON_ORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_DAYS_ON_BACKORDER),'''') <> ISNULL(STRING(inserted.MAXIMUM_DAYS_ON_BACKORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,25,null,null,null,deleted.MAXIMUM_DAYS_ON_BACKORDER,inserted.MAXIMUM_DAYS_ON_BACKORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_DAYS_ON_FACTORY_ORDER),'''') <> ISNULL(STRING(inserted.MAXIMUM_DAYS_ON_FACTORY_ORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,26,null,null,null,deleted.MAXIMUM_DAYS_ON_FACTORY_ORDER,inserted.MAXIMUM_DAYS_ON_FACTORY_ORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PHYS_INV_ALLOW_NEW_PART_ENTRY),'''') <> ISNULL(STRING(inserted.PHYS_INV_ALLOW_NEW_PART_ENTRY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,15,null,null,null,deleted.PHYS_INV_ALLOW_NEW_PART_ENTRY,inserted.PHYS_INV_ALLOW_NEW_PART_ENTRY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PHYS_INV_EDIT_BY_LOCATION),'''') <> ISNULL(STRING(inserted.PHYS_INV_EDIT_BY_LOCATION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,16,null,null,null,deleted.PHYS_INV_EDIT_BY_LOCATION,inserted.PHYS_INV_EDIT_BY_LOCATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PHYS_INV_UPDATE_LOCATIONS),'''') <> ISNULL(STRING(inserted.PHYS_INV_UPDATE_LOCATIONS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,17,null,null,null,deleted.PHYS_INV_UPDATE_LOCATIONS,inserted.PHYS_INV_UPDATE_LOCATIONS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PHYS_INV_DISPLAY_RETAIL_PRICE),'''') <> ISNULL(STRING(inserted.PHYS_INV_DISPLAY_RETAIL_PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,18,null,null,null,deleted.PHYS_INV_DISPLAY_RETAIL_PRICE,inserted.PHYS_INV_DISPLAY_RETAIL_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_PHYS_INV_SUMMARY_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_PHYS_INV_SUMMARY_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,19,null,null,null,deleted.KEEP_PHYS_INV_SUMMARY_MONTHS,inserted.KEEP_PHYS_INV_SUMMARY_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_PHYS_INV_SESSION_DAYS),'''') <> ISNULL(STRING(inserted.KEEP_PHYS_INV_SESSION_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,20,null,null,null,deleted.KEEP_PHYS_INV_SESSION_DAYS,inserted.KEEP_PHYS_INV_SESSION_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NAPA_CLASSIFICATION_DC_CODE),'''') <> ISNULL(STRING(inserted.NAPA_CLASSIFICATION_DC_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,27,null,null,null,deleted.NAPA_CLASSIFICATION_DC_CODE,inserted.NAPA_CLASSIFICATION_DC_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISABLE_IN_CLASS_24_AND_OUT_POLICY),'''') <> ISNULL(STRING(inserted.DISABLE_IN_CLASS_24_AND_OUT_POLICY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,29,null,null,null,deleted.DISABLE_IN_CLASS_24_AND_OUT_POLICY,inserted.DISABLE_IN_CLASS_24_AND_OUT_POLICY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_USE_SUPERSEDED_PARTS_IN_ORDER_CALCULATION_CD,'''') <> ISNULL(inserted.REF_USE_SUPERSEDED_PARTS_IN_ORDER_CALCULATION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,30,null,null,null,deleted.REF_USE_SUPERSEDED_PARTS_IN_ORDER_CALCULATION_CD,inserted.REF_USE_SUPERSEDED_PARTS_IN_ORDER_CALCULATION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_BIN_LABELS_AT_EOD),'''') <> ISNULL(STRING(inserted.PRINT_BIN_LABELS_AT_EOD),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,31,null,null,null,deleted.PRINT_BIN_LABELS_AT_EOD,inserted.PRINT_BIN_LABELS_AT_EOD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.GENERATE_PRINT_BIN_LABELS_FOR_SALE_PRICES,'''') <> ISNULL(inserted.GENERATE_PRINT_BIN_LABELS_FOR_SALE_PRICES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,32,null,null,null,deleted.GENERATE_PRINT_BIN_LABELS_FOR_SALE_PRICES,inserted.GENERATE_PRINT_BIN_LABELS_FOR_SALE_PRICES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_SORT_OPTION_ID),'''') <> ISNULL(STRING(inserted.REF_SORT_OPTION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,33,null,null,null,deleted.REF_SORT_OPTION_ID,inserted.REF_SORT_OPTION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_PAGE_BREAK_OPTION_ID),'''') <> ISNULL(STRING(inserted.REF_PAGE_BREAK_OPTION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,34,null,null,null,deleted.REF_PAGE_BREAK_OPTION_ID,inserted.REF_PAGE_BREAK_OPTION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UPDATE_WIP_FOR_BRANCH_ORDER),'''') <> ISNULL(STRING(inserted.UPDATE_WIP_FOR_BRANCH_ORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,35,null,null,null,deleted.UPDATE_WIP_FOR_BRANCH_ORDER,inserted.UPDATE_WIP_FOR_BRANCH_ORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PURGE_EXPIRED_ORDER_SELECTION_GROUPS),'''') <> ISNULL(STRING(inserted.PURGE_EXPIRED_ORDER_SELECTION_GROUPS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,36,null,null,null,deleted.PURGE_EXPIRED_ORDER_SELECTION_GROUPS,inserted.PURGE_EXPIRED_ORDER_SELECTION_GROUPS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PART_NUMBER_LENGTH),'''') <> ISNULL(STRING(inserted.PART_NUMBER_LENGTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,37,null,null,null,deleted.PART_NUMBER_LENGTH,inserted.PART_NUMBER_LENGTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RECEIPTS_STYLE_REF_REPORT_ID),'''') <> ISNULL(STRING(inserted.RECEIPTS_STYLE_REF_REPORT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,38,null,null,null,deleted.RECEIPTS_STYLE_REF_REPORT_ID,inserted.RECEIPTS_STYLE_REF_REPORT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INTERSTORE_RECEIPTS_TO_UPDATE_COST),'''') <> ISNULL(STRING(inserted.INTERSTORE_RECEIPTS_TO_UPDATE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,39,null,null,null,deleted.INTERSTORE_RECEIPTS_TO_UPDATE_COST,inserted.INTERSTORE_RECEIPTS_TO_UPDATE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_SPECIAL_SALE_COST),'''') <> ISNULL(STRING(inserted.USE_SPECIAL_SALE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,40,null,null,null,deleted.USE_SPECIAL_SALE_COST,inserted.USE_SPECIAL_SALE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_INTERSTORE_ORDER_FORWARDING),'''') <> ISNULL(STRING(inserted.USE_INTERSTORE_ORDER_FORWARDING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,41,null,null,null,deleted.USE_INTERSTORE_ORDER_FORWARDING,inserted.USE_INTERSTORE_ORDER_FORWARDING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_INVENTORY_FEED),'''') <> ISNULL(STRING(inserted.USE_INVENTORY_FEED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,42,null,null,null,deleted.USE_INVENTORY_FEED,inserted.USE_INVENTORY_FEED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.JOEI_ORDERS_AFFECT_ON_ORDER_QUANTITY),'''') <> ISNULL(STRING(inserted.JOEI_ORDERS_AFFECT_ON_ORDER_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,43,null,null,null,deleted.JOEI_ORDERS_AFFECT_ON_ORDER_QUANTITY,inserted.JOEI_ORDERS_AFFECT_ON_ORDER_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_INVENTORY_LOCATION_DETAILS),'''') <> ISNULL(STRING(inserted.KEEP_INVENTORY_LOCATION_DETAILS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,44,null,null,null,deleted.KEEP_INVENTORY_LOCATION_DETAILS,inserted.KEEP_INVENTORY_LOCATION_DETAILS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INCLUDE_INTERSTORE_RECEIPTS_WITH_DC_SHIPMENT),'''') <> ISNULL(STRING(inserted.INCLUDE_INTERSTORE_RECEIPTS_WITH_DC_SHIPMENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,45,null,null,null,deleted.INCLUDE_INTERSTORE_RECEIPTS_WITH_DC_SHIPMENT,inserted.INCLUDE_INTERSTORE_RECEIPTS_WITH_DC_SHIPMENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISABLE_RECEIVE_ALL),'''') <> ISNULL(STRING(inserted.DISABLE_RECEIVE_ALL),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,46,null,null,null,deleted.DISABLE_RECEIVE_ALL,inserted.DISABLE_RECEIVE_ALL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UPDATE_NON_NAPA_PARTS),'''') <> ISNULL(STRING(inserted.UPDATE_NON_NAPA_PARTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,47,null,null,null,deleted.UPDATE_NON_NAPA_PARTS,inserted.UPDATE_NON_NAPA_PARTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_KEEP_FLAG),'''') <> ISNULL(STRING(inserted.USE_KEEP_FLAG),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,48,null,null,null,deleted.USE_KEEP_FLAG,inserted.USE_KEEP_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SOURCE_NON_NAPA_PARTS_LOCALLY),'''') <> ISNULL(STRING(inserted.SOURCE_NON_NAPA_PARTS_LOCALLY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,49,null,null,null,deleted.SOURCE_NON_NAPA_PARTS_LOCALLY,inserted.SOURCE_NON_NAPA_PARTS_LOCALLY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORDER_RESTRICTION,'''') <> ISNULL(inserted.ORDER_RESTRICTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,225,50,null,null,null,deleted.ORDER_RESTRICTION,inserted.ORDER_RESTRICTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_inventory_promo','INVENTORY_PROMO','B','U',1,'create trigger tr_bu_inventory_promo before update on INVENTORY_PROMO referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.BEGIN_DATE),'''') <> ISNULL(STRING(inserted.BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,132,1,inserted.id,null,null,deleted.BEGIN_DATE,inserted.BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_DATE),'''') <> ISNULL(STRING(inserted.END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,132,2,inserted.id,null,null,deleted.END_DATE,inserted.END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TEXT1,'''') <> ISNULL(inserted.TEXT1,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,132,3,inserted.id,null,null,deleted.TEXT1,inserted.TEXT1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_inventory_sales','INVENTORY_SALES','B','U',1,'create trigger tr_bu_inventory_sales before update on INVENTORY_SALES referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.INVENTORY_ID),'''') <> ISNULL(STRING(inserted.INVENTORY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,1,inserted.id,null,null,deleted.INVENTORY_ID,inserted.INVENTORY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.YEAR_MONTH),'''') <> ISNULL(STRING(inserted.YEAR_MONTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,2,inserted.id,null,null,deleted.YEAR_MONTH,inserted.YEAR_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES),'''') <> ISNULL(STRING(inserted.SALES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,3,inserted.id,null,null,deleted.SALES,inserted.SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COST),'''') <> ISNULL(STRING(inserted.COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,4,inserted.id,null,null,deleted.COST,inserted.COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES_QTY),'''') <> ISNULL(STRING(inserted.SALES_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,5,inserted.id,null,null,deleted.SALES_QTY,inserted.SALES_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES_FREQUENCY),'''') <> ISNULL(STRING(inserted.SALES_FREQUENCY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,6,inserted.id,null,null,deleted.SALES_FREQUENCY,inserted.SALES_FREQUENCY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_SALES),'''') <> ISNULL(STRING(inserted.RETURN_SALES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,7,inserted.id,null,null,deleted.RETURN_SALES,inserted.RETURN_SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_COST),'''') <> ISNULL(STRING(inserted.RETURN_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,8,inserted.id,null,null,deleted.RETURN_COST,inserted.RETURN_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_QTY),'''') <> ISNULL(STRING(inserted.RETURN_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,9,inserted.id,null,null,deleted.RETURN_QTY,inserted.RETURN_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_FREQUENCY),'''') <> ISNULL(STRING(inserted.RETURN_FREQUENCY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,10,inserted.id,null,null,deleted.RETURN_FREQUENCY,inserted.RETURN_FREQUENCY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LOST_SALES_QTY),'''') <> ISNULL(STRING(inserted.LOST_SALES_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,11,inserted.id,null,null,deleted.LOST_SALES_QTY,inserted.LOST_SALES_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LOST_SALES_FREQUENCY),'''') <> ISNULL(STRING(inserted.LOST_SALES_FREQUENCY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,12,inserted.id,null,null,deleted.LOST_SALES_FREQUENCY,inserted.LOST_SALES_FREQUENCY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NET_TRANSFER_SALES),'''') <> ISNULL(STRING(inserted.NET_TRANSFER_SALES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,13,inserted.id,null,null,deleted.NET_TRANSFER_SALES,inserted.NET_TRANSFER_SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NET_TRANSFER_QTY),'''') <> ISNULL(STRING(inserted.NET_TRANSFER_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,178,15,inserted.id,null,null,deleted.NET_TRANSFER_QTY,inserted.NET_TRANSFER_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_inventory_special_sale','INVENTORY_SPECIAL_SALE','B','U',1,'create trigger tr_bu_inventory_special_sale before update on INVENTORY_SPECIAL_SALE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.CODE,'''') <> ISNULL(inserted.CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,162,1,inserted.id,null,null,deleted.CODE,inserted.CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRICE),'''') <> ISNULL(STRING(inserted.PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,162,2,inserted.id,null,null,deleted.PRICE,inserted.PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COST),'''') <> ISNULL(STRING(inserted.COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,162,3,inserted.id,null,null,deleted.COST,inserted.COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ON_HAND_QTY),'''') <> ISNULL(STRING(inserted.ON_HAND_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,162,4,inserted.id,null,null,deleted.ON_HAND_QTY,inserted.ON_HAND_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.HISTORY),'''') <> ISNULL(STRING(inserted.HISTORY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,162,5,inserted.id,null,null,deleted.HISTORY,inserted.HISTORY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BEGIN_DATE),'''') <> ISNULL(STRING(inserted.BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,162,6,inserted.id,null,null,deleted.BEGIN_DATE,inserted.BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_DATE),'''') <> ISNULL(STRING(inserted.END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,162,7,inserted.id,null,null,deleted.END_DATE,inserted.END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ON_SALE_LABEL_GENERATED,'''') <> ISNULL(inserted.ON_SALE_LABEL_GENERATED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,162,8,inserted.id,null,null,deleted.ON_SALE_LABEL_GENERATED,inserted.ON_SALE_LABEL_GENERATED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.OFF_SALE_LABEL_GENERATED,'''') <> ISNULL(inserted.OFF_SALE_LABEL_GENERATED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,162,9,inserted.id,null,null,deleted.OFF_SALE_LABEL_GENERATED,inserted.OFF_SALE_LABEL_GENERATED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.WHOLESALE_PRICE),'''') <> ISNULL(STRING(inserted.WHOLESALE_PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,162,10,inserted.id,null,null,deleted.WHOLESALE_PRICE,inserted.WHOLESALE_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_inventory_stock','INVENTORY_STOCK','B','U',1,'create trigger tr_bu_inventory_stock before update on INVENTORY_STOCK referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.STORE_DEPARTMENT_ID),'''') <> ISNULL(STRING(inserted.STORE_DEPARTMENT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,1,inserted.inventory_id,null,null,deleted.STORE_DEPARTMENT_ID,inserted.STORE_DEPARTMENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVENTORY_NOTE_ID),'''') <> ISNULL(STRING(inserted.INVENTORY_NOTE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,2,inserted.inventory_id,null,null,deleted.INVENTORY_NOTE_ID,inserted.INVENTORY_NOTE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_MIN_MAX_STATUS_CD,'''') <> ISNULL(inserted.REF_MIN_MAX_STATUS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,3,inserted.inventory_id,null,null,deleted.REF_MIN_MAX_STATUS_CD,inserted.REF_MIN_MAX_STATUS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_ECONOMIC_ORDER_QTY,'''') <> ISNULL(inserted.USE_ECONOMIC_ORDER_QTY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,4,inserted.inventory_id,null,null,deleted.USE_ECONOMIC_ORDER_QTY,inserted.USE_ECONOMIC_ORDER_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INITIAL_STOCKING_DATE),'''') <> ISNULL(STRING(inserted.INITIAL_STOCKING_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,5,inserted.inventory_id,null,null,deleted.INITIAL_STOCKING_DATE,inserted.INITIAL_STOCKING_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_INITIAL_STOCKING_REASON_CD,'''') <> ISNULL(inserted.REF_INITIAL_STOCKING_REASON_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,6,inserted.inventory_id,null,null,deleted.REF_INITIAL_STOCKING_REASON_CD,inserted.REF_INITIAL_STOCKING_REASON_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_SALE_DATE),'''') <> ISNULL(STRING(inserted.LAST_SALE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,7,inserted.inventory_id,null,null,deleted.LAST_SALE_DATE,inserted.LAST_SALE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_LOST_SALE_DATE),'''') <> ISNULL(STRING(inserted.LAST_LOST_SALE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,8,inserted.inventory_id,null,null,deleted.LAST_LOST_SALE_DATE,inserted.LAST_LOST_SALE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PREVIOUS_LOST_SALE_DATE),'''') <> ISNULL(STRING(inserted.PREVIOUS_LOST_SALE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,9,inserted.inventory_id,null,null,deleted.PREVIOUS_LOST_SALE_DATE,inserted.PREVIOUS_LOST_SALE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_RECEIPT_DATE),'''') <> ISNULL(STRING(inserted.LAST_RECEIPT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,11,inserted.inventory_id,null,null,deleted.LAST_RECEIPT_DATE,inserted.LAST_RECEIPT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MINIMUM_STOCK_QTY),'''') <> ISNULL(STRING(inserted.MINIMUM_STOCK_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,12,inserted.inventory_id,null,null,deleted.MINIMUM_STOCK_QTY,inserted.MINIMUM_STOCK_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_STOCK_QTY),'''') <> ISNULL(STRING(inserted.MAXIMUM_STOCK_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,13,inserted.inventory_id,null,null,deleted.MAXIMUM_STOCK_QTY,inserted.MAXIMUM_STOCK_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MINIMUM_SALE_QTY),'''') <> ISNULL(STRING(inserted.MINIMUM_SALE_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,15,inserted.inventory_id,null,null,deleted.MINIMUM_SALE_QTY,inserted.MINIMUM_SALE_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ON_HAND),'''') <> ISNULL(STRING(inserted.ON_HAND),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,16,inserted.inventory_id,null,null,deleted.ON_HAND,inserted.ON_HAND,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURNED_CORES_ON_HAND),'''') <> ISNULL(STRING(inserted.RETURNED_CORES_ON_HAND),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,17,inserted.inventory_id,null,null,deleted.RETURNED_CORES_ON_HAND,inserted.RETURNED_CORES_ON_HAND,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURNED_DEFECTIVES_ON_HAND),'''') <> ISNULL(STRING(inserted.RETURNED_DEFECTIVES_ON_HAND),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,18,inserted.inventory_id,null,null,deleted.RETURNED_DEFECTIVES_ON_HAND,inserted.RETURNED_DEFECTIVES_ON_HAND,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.WORK_IN_PROGRESS),'''') <> ISNULL(STRING(inserted.WORK_IN_PROGRESS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,19,inserted.inventory_id,null,null,deleted.WORK_IN_PROGRESS,inserted.WORK_IN_PROGRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DAYS_ALLOCATED_TO_WIP),'''') <> ISNULL(STRING(inserted.DAYS_ALLOCATED_TO_WIP),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,20,inserted.inventory_id,null,null,deleted.DAYS_ALLOCATED_TO_WIP,inserted.DAYS_ALLOCATED_TO_WIP,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ON_ORDER),'''') <> ISNULL(STRING(inserted.ON_ORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,21,inserted.inventory_id,null,null,deleted.ON_ORDER,inserted.ON_ORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DAYS_ON_ORDER),'''') <> ISNULL(STRING(inserted.DAYS_ON_ORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,22,inserted.inventory_id,null,null,deleted.DAYS_ON_ORDER,inserted.DAYS_ON_ORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ON_BACKORDER),'''') <> ISNULL(STRING(inserted.ON_BACKORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,23,inserted.inventory_id,null,null,deleted.ON_BACKORDER,inserted.ON_BACKORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DAYS_ON_BACKORDER),'''') <> ISNULL(STRING(inserted.DAYS_ON_BACKORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,24,inserted.inventory_id,null,null,deleted.DAYS_ON_BACKORDER,inserted.DAYS_ON_BACKORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ON_FACTORY_ORDER),'''') <> ISNULL(STRING(inserted.ON_FACTORY_ORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,25,inserted.inventory_id,null,null,deleted.ON_FACTORY_ORDER,inserted.ON_FACTORY_ORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DAYS_ON_FACTORY_ORDER),'''') <> ISNULL(STRING(inserted.DAYS_ON_FACTORY_ORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,26,inserted.inventory_id,null,null,deleted.DAYS_ON_FACTORY_ORDER,inserted.DAYS_ON_FACTORY_ORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FACTORY_ORDER_FLAG,'''') <> ISNULL(inserted.FACTORY_ORDER_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,27,inserted.inventory_id,null,null,deleted.FACTORY_ORDER_FLAG,inserted.FACTORY_ORDER_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_ORDER_SUSPENSE_CD,'''') <> ISNULL(inserted.REF_ORDER_SUSPENSE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,28,inserted.inventory_id,null,null,deleted.REF_ORDER_SUSPENSE_CD,inserted.REF_ORDER_SUSPENSE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PHYSICAL_INVENTORY_DATE),'''') <> ISNULL(STRING(inserted.PHYSICAL_INVENTORY_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,29,inserted.inventory_id,null,null,deleted.PHYSICAL_INVENTORY_DATE,inserted.PHYSICAL_INVENTORY_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FAIM_CODE,'''') <> ISNULL(inserted.FAIM_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,127,30,inserted.inventory_id,null,null,deleted.FAIM_CODE,inserted.FAIM_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if deleted.minimum_stock_qty=0 and inserted.minimum_stock_qty > 0 then set inserted.initial_stocking_date=current date end if end', 'tr_bu_inventory_stock_location','INVENTORY_STOCK_LOCATION','B','U',1,'create trigger tr_bu_inventory_stock_location before update on INVENTORY_STOCK_LOCATION referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.STOCK_LOCATION,'''') <> ISNULL(inserted.STOCK_LOCATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,177,1,inserted.id,null,null,deleted.STOCK_LOCATION,inserted.STOCK_LOCATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PLANOGRAM_REFERENCE,'''') <> ISNULL(inserted.PLANOGRAM_REFERENCE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,177,2,inserted.id,null,null,deleted.PLANOGRAM_REFERENCE,inserted.PLANOGRAM_REFERENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_BIN_LABEL_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_BIN_LABEL_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,177,3,inserted.id,null,null,deleted.REF_BIN_LABEL_TYPE_ID,inserted.REF_BIN_LABEL_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LABEL_REQUIRED,'''') <> ISNULL(inserted.LABEL_REQUIRED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,177,4,inserted.id,null,null,deleted.LABEL_REQUIRED,inserted.LABEL_REQUIRED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUMBER_OF_FACINGS),'''') <> ISNULL(STRING(inserted.NUMBER_OF_FACINGS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,177,5,inserted.id,null,null,deleted.NUMBER_OF_FACINGS,inserted.NUMBER_OF_FACINGS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPLAY_QTY),'''') <> ISNULL(STRING(inserted.DISPLAY_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,177,6,inserted.id,null,null,deleted.DISPLAY_QTY,inserted.DISPLAY_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_inventory_user_defined_field','INVENTORY_USER_DEFINED_FIELD','B','U',1,'create trigger tr_bu_inventory_user_defined_field before update on INVENTORY_USER_DEFINED_FIELD referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.TEXT,'''') <> ISNULL(inserted.TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,228,1,inserted.inventory_id,inserted.user_defined_field_name_id,null,deleted.TEXT,inserted.TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_invoice','INVOICE','B','U',1,'create trigger tr_bu_invoice before update on INVOICE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_TRANSACTION_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_TRANSACTION_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,232,5,inserted.ID,null,null,deleted.REF_TRANSACTION_TYPE_ID,inserted.REF_TRANSACTION_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.VOIDED,'''') <> ISNULL(inserted.VOIDED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,232,1,inserted.ID,null,null,deleted.VOIDED,inserted.VOIDED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PO_NUMBER,'''') <> ISNULL(inserted.PO_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,232,6,inserted.ID,null,null,deleted.PO_NUMBER,inserted.PO_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DELIVERY_FLAG,'''') <> ISNULL(inserted.DELIVERY_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,232,7,inserted.ID,null,null,deleted.DELIVERY_FLAG,inserted.DELIVERY_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORIGINAL_INVOICE_ID),'''') <> ISNULL(STRING(inserted.ORIGINAL_INVOICE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,232,8,inserted.ID,null,null,deleted.ORIGINAL_INVOICE_ID,inserted.ORIGINAL_INVOICE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_CREDIT_DEBIT_REBILL_CD,'''') <> ISNULL(inserted.REF_CREDIT_DEBIT_REBILL_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,232,9,inserted.ID,null,null,deleted.REF_CREDIT_DEBIT_REBILL_CD,inserted.REF_CREDIT_DEBIT_REBILL_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_COST),'''') <> ISNULL(STRING(inserted.INVOICE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,232,2,inserted.ID,null,null,deleted.INVOICE_COST,inserted.INVOICE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_TOTAL),'''') <> ISNULL(STRING(inserted.INVOICE_TOTAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,232,3,inserted.ID,null,null,deleted.INVOICE_TOTAL,inserted.INVOICE_TOTAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_REBATE),'''') <> ISNULL(STRING(inserted.INVOICE_REBATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,232,4,inserted.ID,null,null,deleted.INVOICE_REBATE,inserted.INVOICE_REBATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TENDER_TYPE_CHANGED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.TENDER_TYPE_CHANGED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,232,10,inserted.ID,null,null,deleted.TENDER_TYPE_CHANGED_BY_EMPLOYEE_ID,inserted.TENDER_TYPE_CHANGED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_invoice_delivery','INVOICE_DELIVERY','B','U',1,'create trigger tr_bu_invoice_delivery before update on INVOICE_DELIVERY referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DELIVERY_ROUTE_CD,'''') <> ISNULL(inserted.DELIVERY_ROUTE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,1,inserted.invoice_id,null,null,deleted.DELIVERY_ROUTE_CD,inserted.DELIVERY_ROUTE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DELIVERY_PRIORITY_ID),'''') <> ISNULL(STRING(inserted.DELIVERY_PRIORITY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,2,inserted.invoice_id,null,null,deleted.DELIVERY_PRIORITY_ID,inserted.DELIVERY_PRIORITY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TRAVEL_MINUTES),'''') <> ISNULL(STRING(inserted.TRAVEL_MINUTES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,3,inserted.invoice_id,null,null,deleted.TRAVEL_MINUTES,inserted.TRAVEL_MINUTES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DELIVERY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.DELIVERY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,4,inserted.invoice_id,null,null,deleted.DELIVERY_EMPLOYEE_ID,inserted.DELIVERY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DELIVERY_DESCRIPTION,'''') <> ISNULL(inserted.DELIVERY_DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,5,inserted.invoice_id,null,null,deleted.DELIVERY_DESCRIPTION,inserted.DELIVERY_DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPATCH_DATE),'''') <> ISNULL(STRING(inserted.DISPATCH_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,6,inserted.invoice_id,null,null,deleted.DISPATCH_DATE,inserted.DISPATCH_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DELIVERY_DATE),'''') <> ISNULL(STRING(inserted.DELIVERY_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,7,inserted.invoice_id,null,null,deleted.DELIVERY_DATE,inserted.DELIVERY_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DRIVER_CHECKIN),'''') <> ISNULL(STRING(inserted.DRIVER_CHECKIN),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,8,inserted.invoice_id,null,null,deleted.DRIVER_CHECKIN,inserted.DRIVER_CHECKIN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PICKUP_FLAG,'''') <> ISNULL(inserted.PICKUP_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,9,inserted.invoice_id,null,null,deleted.PICKUP_FLAG,inserted.PICKUP_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REQUESTED_DELIVERY_DATE),'''') <> ISNULL(STRING(inserted.REQUESTED_DELIVERY_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,10,inserted.invoice_id,null,null,deleted.REQUESTED_DELIVERY_DATE,inserted.REQUESTED_DELIVERY_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SIGNATURE_FILE,'''') <> ISNULL(inserted.SIGNATURE_FILE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,11,inserted.invoice_id,null,null,deleted.SIGNATURE_FILE,inserted.SIGNATURE_FILE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CANCELLED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.CANCELLED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,12,inserted.invoice_id,null,null,deleted.CANCELLED_BY_EMPLOYEE_ID,inserted.CANCELLED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CANCELLED_DATE),'''') <> ISNULL(STRING(inserted.CANCELLED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,284,13,inserted.invoice_id,null,null,deleted.CANCELLED_DATE,inserted.CANCELLED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_invoice_delivery_exception','INVOICE_DELIVERY_EXCEPTION','B','U',1,'create trigger tr_bu_invoice_delivery_exception before update on INVOICE_DELIVERY_EXCEPTION referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=deleted.INVOICE_id and LOC=deleted.LOC;if ISNULL(STRING(deleted.INVOICE_ID),'''') <> ISNULL(STRING(inserted.INVOICE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,653,1,inserted.INVOICE_ID,null,null,deleted.INVOICE_ID,inserted.INVOICE_ID,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if i_return_status=-1 then update INVOICE set MODIFIED_BY_EMPLOYEE_ID=null,LAST_MODIFIED_DATE=current timestamp where id=inserted.INVOICE_id and LOC=inserted.LOC end if end', 'tr_bu_invoice_line_item','INVOICE_LINE_ITEM','B','U',1,'create trigger tr_bu_invoice_line_item before update on INVOICE_LINE_ITEM referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.REBATE_ITEM,'''') <> ISNULL(inserted.REBATE_ITEM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,236,4,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.REBATE_ITEM,inserted.REBATE_ITEM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.COST_OVERRIDE,'''') <> ISNULL(inserted.COST_OVERRIDE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,236,5,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.COST_OVERRIDE,inserted.COST_OVERRIDE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CHANGED_OR_ADDED_IN_REBATE_AUDIT,'''') <> ISNULL(inserted.CHANGED_OR_ADDED_IN_REBATE_AUDIT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,236,6,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.CHANGED_OR_ADDED_IN_REBATE_AUDIT,inserted.CHANGED_OR_ADDED_IN_REBATE_AUDIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRICE_CORRECTION_REJECTED,'''') <> ISNULL(inserted.PRICE_CORRECTION_REJECTED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,236,8,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.PRICE_CORRECTION_REJECTED,inserted.PRICE_CORRECTION_REJECTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INVALID_REBATE_CALCULATED,'''') <> ISNULL(inserted.INVALID_REBATE_CALCULATED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,236,3,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.INVALID_REBATE_CALCULATED,inserted.INVALID_REBATE_CALCULATED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_COST),'''') <> ISNULL(STRING(inserted.UNIT_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,236,2,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.UNIT_COST,inserted.UNIT_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_REBATE),'''') <> ISNULL(STRING(inserted.UNIT_REBATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,236,1,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.UNIT_REBATE,inserted.UNIT_REBATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TABLE_ID_USED_FOR_REBATE,'''') <> ISNULL(inserted.TABLE_ID_USED_FOR_REBATE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,236,7,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.TABLE_ID_USED_FOR_REBATE,inserted.TABLE_ID_USED_FOR_REBATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_invoice_line_item_deposit','INVOICE_LINE_ITEM_DEPOSIT','B','U',1,'create trigger tr_bu_invoice_line_item_deposit before update on INVOICE_LINE_ITEM_DEPOSIT referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=deleted.INVOICE_id and LOC=deleted.LOC;if ISNULL(STRING(deleted.DEPOSIT_AMOUNT),'''') <> ISNULL(STRING(inserted.DEPOSIT_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,654,1,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.DEPOSIT_AMOUNT,inserted.DEPOSIT_AMOUNT,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(deleted.SHIPPING_METHOD,'''') <> ISNULL(inserted.SHIPPING_METHOD,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,654,2,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.SHIPPING_METHOD,inserted.SHIPPING_METHOD,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(STRING(deleted.SHIPPING_CHARGE),'''') <> ISNULL(STRING(inserted.SHIPPING_CHARGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,654,3,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.SHIPPING_CHARGE,inserted.SHIPPING_CHARGE,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(STRING(deleted.PROMISE_DATE),'''') <> ISNULL(STRING(inserted.PROMISE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,654,4,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.PROMISE_DATE,inserted.PROMISE_DATE,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(deleted.DELIVERY_REQUIRED,'''') <> ISNULL(inserted.DELIVERY_REQUIRED,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,654,5,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.DELIVERY_REQUIRED,inserted.DELIVERY_REQUIRED,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if i_return_status=-1 then update INVOICE set MODIFIED_BY_EMPLOYEE_ID=null,LAST_MODIFIED_DATE=current timestamp where id=inserted.INVOICE_id and LOC=inserted.LOC end if end', 'tr_bu_invoice_line_item_return','INVOICE_LINE_ITEM_RETURN','B','U',1,'create trigger tr_bu_invoice_line_item_return before update on INVOICE_LINE_ITEM_RETURN referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.INVOICE_ID),'''') <> ISNULL(STRING(inserted.INVOICE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,1,inserted.id,null,null,deleted.INVOICE_ID,inserted.INVOICE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SEQUENCE),'''') <> ISNULL(STRING(inserted.SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,2,inserted.id,null,null,deleted.SEQUENCE,inserted.SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_RETURN_REASON_ID),'''') <> ISNULL(STRING(inserted.REF_RETURN_REASON_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,3,inserted.id,null,null,deleted.REF_RETURN_REASON_ID,inserted.REF_RETURN_REASON_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORIGINAL_LOC),'''') <> ISNULL(STRING(inserted.ORIGINAL_LOC),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,4,inserted.id,null,null,deleted.ORIGINAL_LOC,inserted.ORIGINAL_LOC,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.APPROVED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.APPROVED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,5,inserted.id,null,null,deleted.APPROVED_BY_EMPLOYEE_ID,inserted.APPROVED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORIGINAL_INVOICE_NUMBER),'''') <> ISNULL(STRING(inserted.ORIGINAL_INVOICE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,6,inserted.id,null,null,deleted.ORIGINAL_INVOICE_NUMBER,inserted.ORIGINAL_INVOICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORIGINAL_INVOICE_DATE),'''') <> ISNULL(STRING(inserted.ORIGINAL_INVOICE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,7,inserted.id,null,null,deleted.ORIGINAL_INVOICE_DATE,inserted.ORIGINAL_INVOICE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORIGINAL_INVOICE_AMOUNT),'''') <> ISNULL(STRING(inserted.ORIGINAL_INVOICE_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,8,inserted.id,null,null,deleted.ORIGINAL_INVOICE_AMOUNT,inserted.ORIGINAL_INVOICE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORIGINAL_STORE_NUMBER,'''') <> ISNULL(inserted.ORIGINAL_STORE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,9,inserted.id,null,null,deleted.ORIGINAL_STORE_NUMBER,inserted.ORIGINAL_STORE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RECEIPT_PRESENT,'''') <> ISNULL(inserted.RECEIPT_PRESENT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,10,inserted.id,null,null,deleted.RECEIPT_PRESENT,inserted.RECEIPT_PRESENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QTY_RETURNED),'''') <> ISNULL(STRING(inserted.QTY_RETURNED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,11,inserted.id,null,null,deleted.QTY_RETURNED,inserted.QTY_RETURNED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORIGINAL_INVOICE_LINE_ITEM_SEQUENCE),'''') <> ISNULL(STRING(inserted.ORIGINAL_INVOICE_LINE_ITEM_SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,655,12,inserted.id,null,null,deleted.ORIGINAL_INVOICE_LINE_ITEM_SEQUENCE,inserted.ORIGINAL_INVOICE_LINE_ITEM_SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_invoice_message_profile','INVOICE_MESSAGE_PROFILE','B','U',1,'create trigger tr_bu_invoice_message_profile before update on INVOICE_MESSAGE_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.LINE_1,'''') <> ISNULL(inserted.LINE_1,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,98,2,inserted.ID,null,null,deleted.LINE_1,inserted.LINE_1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_2,'''') <> ISNULL(inserted.LINE_2,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,98,3,inserted.ID,null,null,deleted.LINE_2,inserted.LINE_2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_3,'''') <> ISNULL(inserted.LINE_3,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,98,4,inserted.ID,null,null,deleted.LINE_3,inserted.LINE_3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_invoice_note','INVOICE_NOTE','B','U',1,'create trigger tr_bu_invoice_note before update on INVOICE_NOTE referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=deleted.INVOICE_id and LOC=deleted.LOC;if ISNULL(STRING(deleted.REF_INVOICE_NOTE_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_INVOICE_NOTE_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,656,1,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.REF_INVOICE_NOTE_TYPE_ID,inserted.REF_INVOICE_NOTE_TYPE_ID,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(deleted.TEXT,'''') <> ISNULL(inserted.TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,656,2,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.TEXT,inserted.TEXT,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(STRING(deleted.GENERATED_BY_SEQUENCE),'''') <> ISNULL(STRING(inserted.GENERATED_BY_SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,656,3,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.GENERATED_BY_SEQUENCE,inserted.GENERATED_BY_SEQUENCE,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(STRING(deleted.MODIFIED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.MODIFIED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,656,5,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.MODIFIED_BY_EMPLOYEE_ID,inserted.MODIFIED_BY_EMPLOYEE_ID,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(STRING(deleted.LAST_MODIFIED_DATE),'''') <> ISNULL(STRING(inserted.LAST_MODIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,656,4,inserted.INVOICE_ID,inserted.SEQUENCE,null,deleted.LAST_MODIFIED_DATE,inserted.LAST_MODIFIED_DATE,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if i_return_status=-1 then update INVOICE set MODIFIED_BY_EMPLOYEE_ID=null,LAST_MODIFIED_DATE=current timestamp where id=inserted.INVOICE_id and LOC=inserted.LOC end if end', 'tr_bu_invoice_payment','INVOICE_PAYMENT','B','U',1,'create trigger tr_bu_invoice_payment before update on INVOICE_PAYMENT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_TENDER_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_TENDER_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,10,inserted.invoice_id,inserted.sequence,null,deleted.REF_TENDER_TYPE_ID,inserted.REF_TENDER_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT_TENDERED),'''') <> ISNULL(STRING(inserted.AMOUNT_TENDERED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,11,inserted.invoice_id,inserted.sequence,null,deleted.AMOUNT_TENDERED,inserted.AMOUNT_TENDERED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT_APPLIED),'''') <> ISNULL(STRING(inserted.AMOUNT_APPLIED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,12,inserted.invoice_id,inserted.sequence,null,deleted.AMOUNT_APPLIED,inserted.AMOUNT_APPLIED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CREDIT_CARD_OR_CHECK_NUMBER,'''') <> ISNULL(inserted.CREDIT_CARD_OR_CHECK_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,1,inserted.invoice_id,inserted.sequence,null,deleted.CREDIT_CARD_OR_CHECK_NUMBER,inserted.CREDIT_CARD_OR_CHECK_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CHECK_ABA_NUMBER,'''') <> ISNULL(inserted.CHECK_ABA_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,2,inserted.invoice_id,inserted.sequence,null,deleted.CHECK_ABA_NUMBER,inserted.CHECK_ABA_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CHECK_BANK_ACCOUNT_NUMBER,'''') <> ISNULL(inserted.CHECK_BANK_ACCOUNT_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,3,inserted.invoice_id,inserted.sequence,null,deleted.CHECK_BANK_ACCOUNT_NUMBER,inserted.CHECK_BANK_ACCOUNT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXPIRATION_DATE,'''') <> ISNULL(inserted.EXPIRATION_DATE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,13,inserted.invoice_id,inserted.sequence,null,deleted.EXPIRATION_DATE,inserted.EXPIRATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AUTHORIZATION_NUMBER,'''') <> ISNULL(inserted.AUTHORIZATION_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,4,inserted.invoice_id,inserted.sequence,null,deleted.AUTHORIZATION_NUMBER,inserted.AUTHORIZATION_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REFERENCE_NUMBER),'''') <> ISNULL(STRING(inserted.REFERENCE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,5,inserted.invoice_id,inserted.sequence,null,deleted.REFERENCE_NUMBER,inserted.REFERENCE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAME_ON_CHECK,'''') <> ISNULL(inserted.NAME_ON_CHECK,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,6,inserted.invoice_id,inserted.sequence,null,deleted.NAME_ON_CHECK,inserted.NAME_ON_CHECK,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRIOR_SETTLEMENT_FLAG,'''') <> ISNULL(inserted.PRIOR_SETTLEMENT_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,7,inserted.invoice_id,inserted.sequence,null,deleted.PRIOR_SETTLEMENT_FLAG,inserted.PRIOR_SETTLEMENT_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRIOR_AUTHORIZATION_FLAG,'''') <> ISNULL(inserted.PRIOR_AUTHORIZATION_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,8,inserted.invoice_id,inserted.sequence,null,deleted.PRIOR_AUTHORIZATION_FLAG,inserted.PRIOR_AUTHORIZATION_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SIGNATURE_FILE,'''') <> ISNULL(inserted.SIGNATURE_FILE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,9,inserted.invoice_id,inserted.sequence,null,deleted.SIGNATURE_FILE,inserted.SIGNATURE_FILE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INTEGRATED_PAYMENT_TYPE),'''') <> ISNULL(STRING(inserted.INTEGRATED_PAYMENT_TYPE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,14,inserted.invoice_id,inserted.sequence,null,deleted.INTEGRATED_PAYMENT_TYPE,inserted.INTEGRATED_PAYMENT_TYPE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INTEGRATED_REFERENCE_NUMBER,'''') <> ISNULL(inserted.INTEGRATED_REFERENCE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,15,inserted.invoice_id,inserted.sequence,null,deleted.INTEGRATED_REFERENCE_NUMBER,inserted.INTEGRATED_REFERENCE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IPC_JOURNAL_KEY,'''') <> ISNULL(inserted.IPC_JOURNAL_KEY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,16,inserted.invoice_id,inserted.sequence,null,deleted.IPC_JOURNAL_KEY,inserted.IPC_JOURNAL_KEY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CARD_BALANCE_AMOUNT),'''') <> ISNULL(STRING(inserted.CARD_BALANCE_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,274,17,inserted.invoice_id,inserted.sequence,null,deleted.CARD_BALANCE_AMOUNT,inserted.CARD_BALANCE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_invoice_return','INVOICE_RETURN','B','U',1,'create trigger tr_bu_invoice_return before update on INVOICE_RETURN referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,657,1,inserted.invoice_id,null,null,deleted.NAME,inserted.NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS1,'''') <> ISNULL(inserted.ADDRESS1,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,657,2,inserted.invoice_id,null,null,deleted.ADDRESS1,inserted.ADDRESS1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS2,'''') <> ISNULL(inserted.ADDRESS2,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,657,3,inserted.invoice_id,null,null,deleted.ADDRESS2,inserted.ADDRESS2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS3,'''') <> ISNULL(inserted.ADDRESS3,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,657,4,inserted.invoice_id,null,null,deleted.ADDRESS3,inserted.ADDRESS3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS4,'''') <> ISNULL(inserted.ADDRESS4,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,657,5,inserted.invoice_id,null,null,deleted.ADDRESS4,inserted.ADDRESS4,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CITY,'''') <> ISNULL(inserted.CITY,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,657,6,inserted.invoice_id,null,null,deleted.CITY,inserted.CITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,657,7,inserted.invoice_id,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,657,8,inserted.invoice_id,null,null,deleted.POSTAL_CODE,inserted.POSTAL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,657,9,inserted.invoice_id,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PHONE,'''') <> ISNULL(inserted.PHONE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,657,10,inserted.invoice_id,null,null,deleted.PHONE,inserted.PHONE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_invoice_roa','INVOICE_ROA','B','U',1,'create trigger tr_bu_invoice_roa before update on INVOICE_ROA referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_LAST_MODIFIED_DATE timestamp;declare v_MODIFIED_BY_EMPLOYEE_ID integer;select LAST_MODIFIED_DATE,MODIFIED_BY_EMPLOYEE_ID into v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID from INVOICE where id=deleted.INVOICE_id and LOC=deleted.LOC;if ISNULL(STRING(deleted.INVOICE_ID),'''') <> ISNULL(STRING(inserted.INVOICE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,658,1,inserted.ID,null,null,deleted.INVOICE_ID,inserted.INVOICE_ID,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(STRING(deleted.INVOICE_NUMBER_PAID),'''') <> ISNULL(STRING(inserted.INVOICE_NUMBER_PAID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,658,2,inserted.ID,null,null,deleted.INVOICE_NUMBER_PAID,inserted.INVOICE_NUMBER_PAID,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(STRING(deleted.AMOUNT_APPLIED),'''') <> ISNULL(STRING(inserted.AMOUNT_APPLIED),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,658,3,inserted.ID,null,null,deleted.AMOUNT_APPLIED,inserted.AMOUNT_APPLIED,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if ISNULL(STRING(deleted.DISCOUNT_APPLIED),'''') <> ISNULL(STRING(inserted.DISCOUNT_APPLIED),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,658,4,inserted.ID,null,null,deleted.DISCOUNT_APPLIED,inserted.DISCOUNT_APPLIED,v_LAST_MODIFIED_DATE,v_MODIFIED_BY_EMPLOYEE_ID,null,1) end if;if i_return_status=-1 then update INVOICE set MODIFIED_BY_EMPLOYEE_ID=null,LAST_MODIFIED_DATE=current timestamp where id=inserted.INVOICE_id and LOC=inserted.LOC end if end', 'tr_bu_invoicing_profile','INVOICING_PROFILE','B','U',1,'create trigger tr_bu_invoicing_profile before update on INVOICING_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.DEFAULT_TAX_TABLE_ID),'''') <> ISNULL(STRING(inserted.DEFAULT_TAX_TABLE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,1,null,null,null,deleted.DEFAULT_TAX_TABLE_ID,inserted.DEFAULT_TAX_TABLE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_INVOICE_NUMBER_USED),'''') <> ISNULL(STRING(inserted.LAST_INVOICE_NUMBER_USED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,2,null,null,null,deleted.LAST_INVOICE_NUMBER_USED,inserted.LAST_INVOICE_NUMBER_USED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GROSS_PROFIT_PERCENT),'''') <> ISNULL(STRING(inserted.GROSS_PROFIT_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,3,null,null,null,deleted.GROSS_PROFIT_PERCENT,inserted.GROSS_PROFIT_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LABOR_COST_PERCENT),'''') <> ISNULL(STRING(inserted.LABOR_COST_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,4,null,null,null,deleted.LABOR_COST_PERCENT,inserted.LABOR_COST_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LOW_COST_VERIFY_PERCENT),'''') <> ISNULL(STRING(inserted.LOW_COST_VERIFY_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,5,null,null,null,deleted.LOW_COST_VERIFY_PERCENT,inserted.LOW_COST_VERIFY_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.HIGH_COST_VERIFY_PERCENT),'''') <> ISNULL(STRING(inserted.HIGH_COST_VERIFY_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,6,null,null,null,deleted.HIGH_COST_VERIFY_PERCENT,inserted.HIGH_COST_VERIFY_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COST_LABOR_ITEMS),'''') <> ISNULL(STRING(inserted.COST_LABOR_ITEMS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,7,null,null,null,deleted.COST_LABOR_ITEMS,inserted.COST_LABOR_ITEMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COST_ONLY_ZERO_COST_ITEMS),'''') <> ISNULL(STRING(inserted.COST_ONLY_ZERO_COST_ITEMS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,8,null,null,null,deleted.COST_ONLY_ZERO_COST_ITEMS,inserted.COST_ONLY_ZERO_COST_ITEMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPLAY_GP_IN_COSTING),'''') <> ISNULL(STRING(inserted.DISPLAY_GP_IN_COSTING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,9,null,null,null,deleted.DISPLAY_GP_IN_COSTING,inserted.DISPLAY_GP_IN_COSTING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_INVOICE_ERASE),'''') <> ISNULL(STRING(inserted.ALLOW_INVOICE_ERASE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,11,null,null,null,deleted.ALLOW_INVOICE_ERASE,inserted.ALLOW_INVOICE_ERASE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_CHANGE_SALESMAN),'''') <> ISNULL(STRING(inserted.ALLOW_CHANGE_SALESMAN),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,14,null,null,null,deleted.ALLOW_CHANGE_SALESMAN,inserted.ALLOW_CHANGE_SALESMAN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_CTRMAN_OVERRIDE_PRICE),'''') <> ISNULL(STRING(inserted.ALLOW_CTRMAN_OVERRIDE_PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,15,null,null,null,deleted.ALLOW_CTRMAN_OVERRIDE_PRICE,inserted.ALLOW_CTRMAN_OVERRIDE_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_DEFAULT_QTY_OF_1),'''') <> ISNULL(STRING(inserted.USE_DEFAULT_QTY_OF_1),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,16,null,null,null,deleted.USE_DEFAULT_QTY_OF_1,inserted.USE_DEFAULT_QTY_OF_1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPLAY_FRACTIONAL_QTY_WARNING),'''') <> ISNULL(STRING(inserted.DISPLAY_FRACTIONAL_QTY_WARNING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,57,null,null,null,deleted.DISPLAY_FRACTIONAL_QTY_WARNING,inserted.DISPLAY_FRACTIONAL_QTY_WARNING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPLAY_NON_STANDARD_PKG_WARNING),'''') <> ISNULL(STRING(inserted.DISPLAY_NON_STANDARD_PKG_WARNING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,58,null,null,null,deleted.DISPLAY_NON_STANDARD_PKG_WARNING,inserted.DISPLAY_NON_STANDARD_PKG_WARNING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPLAY_INSUFFICIENT_ON_HAND_WARNING),'''') <> ISNULL(STRING(inserted.DISPLAY_INSUFFICIENT_ON_HAND_WARNING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,59,null,null,null,deleted.DISPLAY_INSUFFICIENT_ON_HAND_WARNING,inserted.DISPLAY_INSUFFICIENT_ON_HAND_WARNING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_CTRMAN_SPECIAL_ORDER),'''') <> ISNULL(STRING(inserted.ALLOW_CTRMAN_SPECIAL_ORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,17,null,null,null,deleted.ALLOW_CTRMAN_SPECIAL_ORDER,inserted.ALLOW_CTRMAN_SPECIAL_ORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_CTRMAN_BACKORDER),'''') <> ISNULL(STRING(inserted.ALLOW_CTRMAN_BACKORDER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,18,null,null,null,deleted.ALLOW_CTRMAN_BACKORDER,inserted.ALLOW_CTRMAN_BACKORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_TENDER_TYPES),'''') <> ISNULL(STRING(inserted.USE_TENDER_TYPES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,19,null,null,null,deleted.USE_TENDER_TYPES,inserted.USE_TENDER_TYPES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_MULTIPLE_TENDER_TYPES),'''') <> ISNULL(STRING(inserted.ALLOW_MULTIPLE_TENDER_TYPES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,20,null,null,null,deleted.ALLOW_MULTIPLE_TENDER_TYPES,inserted.ALLOW_MULTIPLE_TENDER_TYPES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_CASH_BACK),'''') <> ISNULL(STRING(inserted.MAXIMUM_CASH_BACK),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,21,null,null,null,deleted.MAXIMUM_CASH_BACK,inserted.MAXIMUM_CASH_BACK,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.OLD_CATALOG_AVAILABLE),'''') <> ISNULL(STRING(inserted.OLD_CATALOG_AVAILABLE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,60,null,null,null,deleted.OLD_CATALOG_AVAILABLE,inserted.OLD_CATALOG_AVAILABLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NEW_CATALOG_AVAILABLE),'''') <> ISNULL(STRING(inserted.NEW_CATALOG_AVAILABLE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,61,null,null,null,deleted.NEW_CATALOG_AVAILABLE,inserted.NEW_CATALOG_AVAILABLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_CATALOG_NOTES_ON_INVOICE),'''') <> ISNULL(STRING(inserted.PRINT_CATALOG_NOTES_ON_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,22,null,null,null,deleted.PRINT_CATALOG_NOTES_ON_INVOICE,inserted.PRINT_CATALOG_NOTES_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_CREDIT_CARD_INFO_ON_INVOICE),'''') <> ISNULL(STRING(inserted.PRINT_CREDIT_CARD_INFO_ON_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,23,null,null,null,deleted.PRINT_CREDIT_CARD_INFO_ON_INVOICE,inserted.PRINT_CREDIT_CARD_INFO_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ASK_FOR_CREDIT_CARD_INFO),'''') <> ISNULL(STRING(inserted.ASK_FOR_CREDIT_CARD_INFO),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,24,null,null,null,deleted.ASK_FOR_CREDIT_CARD_INFO,inserted.ASK_FOR_CREDIT_CARD_INFO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ASK_FOR_CHECK_INFO),'''') <> ISNULL(STRING(inserted.ASK_FOR_CHECK_INFO),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,25,null,null,null,deleted.ASK_FOR_CHECK_INFO,inserted.ASK_FOR_CHECK_INFO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPLAY_COD_WARNING),'''') <> ISNULL(STRING(inserted.DISPLAY_COD_WARNING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,26,null,null,null,deleted.DISPLAY_COD_WARNING,inserted.DISPLAY_COD_WARNING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_CASHIER_FUNCTION),'''') <> ISNULL(STRING(inserted.USE_CASHIER_FUNCTION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,27,null,null,null,deleted.USE_CASHIER_FUNCTION,inserted.USE_CASHIER_FUNCTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.WLC_COST_FACTOR),'''') <> ISNULL(STRING(inserted.WLC_COST_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,29,null,null,null,deleted.WLC_COST_FACTOR,inserted.WLC_COST_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_EMPLOYEE_CLOCKEDOUT_INVOICE),'''') <> ISNULL(STRING(inserted.ALLOW_EMPLOYEE_CLOCKEDOUT_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,30,null,null,null,deleted.ALLOW_EMPLOYEE_CLOCKEDOUT_INVOICE,inserted.ALLOW_EMPLOYEE_CLOCKEDOUT_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_EMPLOYEE_SELF_INVOICE),'''') <> ISNULL(STRING(inserted.ALLOW_EMPLOYEE_SELF_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,31,null,null,null,deleted.ALLOW_EMPLOYEE_SELF_INVOICE,inserted.ALLOW_EMPLOYEE_SELF_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_RADS),'''') <> ISNULL(STRING(inserted.USE_RADS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,32,null,null,null,deleted.USE_RADS,inserted.USE_RADS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RADS_REFRESH_SECONDS),'''') <> ISNULL(STRING(inserted.RADS_REFRESH_SECONDS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,34,null,null,null,deleted.RADS_REFRESH_SECONDS,inserted.RADS_REFRESH_SECONDS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RADS_ALERT_MINUTES),'''') <> ISNULL(STRING(inserted.RADS_ALERT_MINUTES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,35,null,null,null,deleted.RADS_ALERT_MINUTES,inserted.RADS_ALERT_MINUTES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_HAZMAT_CODES),'''') <> ISNULL(STRING(inserted.PRINT_HAZMAT_CODES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,36,null,null,null,deleted.PRINT_HAZMAT_CODES,inserted.PRINT_HAZMAT_CODES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_TAX_EXEMPT_NUM),'''') <> ISNULL(STRING(inserted.PRINT_TAX_EXEMPT_NUM),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,37,null,null,null,deleted.PRINT_TAX_EXEMPT_NUM,inserted.PRINT_TAX_EXEMPT_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_SAVE_INVOICE),'''') <> ISNULL(STRING(inserted.USE_SAVE_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,38,null,null,null,deleted.USE_SAVE_INVOICE,inserted.USE_SAVE_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPLAY_SAVED_INVOICES_ALERT),'''') <> ISNULL(STRING(inserted.DISPLAY_SAVED_INVOICES_ALERT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,39,null,null,null,deleted.DISPLAY_SAVED_INVOICES_ALERT,inserted.DISPLAY_SAVED_INVOICES_ALERT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_PRINTING_SAVED_INVOICES),'''') <> ISNULL(STRING(inserted.ALLOW_PRINTING_SAVED_INVOICES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,40,null,null,null,deleted.ALLOW_PRINTING_SAVED_INVOICES,inserted.ALLOW_PRINTING_SAVED_INVOICES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_INVOICE_HISTORY_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_INVOICE_HISTORY_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,41,null,null,null,deleted.KEEP_INVOICE_HISTORY_MONTHS,inserted.KEEP_INVOICE_HISTORY_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_MESSAGE_DAYS),'''') <> ISNULL(STRING(inserted.KEEP_MESSAGE_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,62,null,null,null,deleted.KEEP_MESSAGE_DAYS,inserted.KEEP_MESSAGE_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_SAVED_INVOICES_DAYS),'''') <> ISNULL(STRING(inserted.KEEP_SAVED_INVOICES_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,42,null,null,null,deleted.KEEP_SAVED_INVOICES_DAYS,inserted.KEEP_SAVED_INVOICES_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UPDATE_WIP_WITH_SAVED_INVOICES),'''') <> ISNULL(STRING(inserted.UPDATE_WIP_WITH_SAVED_INVOICES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,43,null,null,null,deleted.UPDATE_WIP_WITH_SAVED_INVOICES,inserted.UPDATE_WIP_WITH_SAVED_INVOICES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_STORE_GST_NUM),'''') <> ISNULL(STRING(inserted.PRINT_STORE_GST_NUM),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,44,null,null,null,deleted.PRINT_STORE_GST_NUM,inserted.PRINT_STORE_GST_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_DELIVERY_SYSTEM_MODE_ID),'''') <> ISNULL(STRING(inserted.REF_DELIVERY_SYSTEM_MODE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,46,null,null,null,deleted.REF_DELIVERY_SYSTEM_MODE_ID,inserted.REF_DELIVERY_SYSTEM_MODE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GENERATE_SAVED_INV_FROM_JOEI),'''') <> ISNULL(STRING(inserted.GENERATE_SAVED_INV_FROM_JOEI),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,47,null,null,null,deleted.GENERATE_SAVED_INV_FROM_JOEI,inserted.GENERATE_SAVED_INV_FROM_JOEI,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.WARRANTY_LABOR_CLAIM_PASSWORD,'''') <> ISNULL(inserted.WARRANTY_LABOR_CLAIM_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,48,null,null,null,deleted.WARRANTY_LABOR_CLAIM_PASSWORD,inserted.WARRANTY_LABOR_CLAIM_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.OVER_CREDIT_LIMIT_PASSWORD,'''') <> ISNULL(inserted.OVER_CREDIT_LIMIT_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,49,null,null,null,deleted.OVER_CREDIT_LIMIT_PASSWORD,inserted.OVER_CREDIT_LIMIT_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POLICY_ADJUSTMENT_PASSWORD,'''') <> ISNULL(inserted.POLICY_ADJUSTMENT_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,50,null,null,null,deleted.POLICY_ADJUSTMENT_PASSWORD,inserted.POLICY_ADJUSTMENT_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SALES_LOGIN_PASSWORD,'''') <> ISNULL(inserted.SALES_LOGIN_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,51,null,null,null,deleted.SALES_LOGIN_PASSWORD,inserted.SALES_LOGIN_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_AUTH_REFERENCE_NUMBER_USED),'''') <> ISNULL(STRING(inserted.LAST_AUTH_REFERENCE_NUMBER_USED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,52,null,null,null,deleted.LAST_AUTH_REFERENCE_NUMBER_USED,inserted.LAST_AUTH_REFERENCE_NUMBER_USED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_CUSTOMER_VEHICLE_LIST_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_CUSTOMER_VEHICLE_LIST_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,53,null,null,null,deleted.KEEP_CUSTOMER_VEHICLE_LIST_MONTHS,inserted.KEEP_CUSTOMER_VEHICLE_LIST_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEFAULT_CUSTOMER_VEHICLE_LIST_QUANTITY),'''') <> ISNULL(STRING(inserted.DEFAULT_CUSTOMER_VEHICLE_LIST_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,54,null,null,null,deleted.DEFAULT_CUSTOMER_VEHICLE_LIST_QUANTITY,inserted.DEFAULT_CUSTOMER_VEHICLE_LIST_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ASK_FOR_ITEM_RETURN_INFO),'''') <> ISNULL(STRING(inserted.ASK_FOR_ITEM_RETURN_INFO),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,55,null,null,null,deleted.ASK_FOR_ITEM_RETURN_INFO,inserted.ASK_FOR_ITEM_RETURN_INFO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ITEM_RETURN_REQUIRES_MGR_APPROVAL),'''') <> ISNULL(STRING(inserted.ITEM_RETURN_REQUIRES_MGR_APPROVAL),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,56,null,null,null,deleted.ITEM_RETURN_REQUIRES_MGR_APPROVAL,inserted.ITEM_RETURN_REQUIRES_MGR_APPROVAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ASK_FOR_ITEM_RETURN_CUSTOMER_INFO),'''') <> ISNULL(STRING(inserted.ASK_FOR_ITEM_RETURN_CUSTOMER_INFO),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,63,null,null,null,deleted.ASK_FOR_ITEM_RETURN_CUSTOMER_INFO,inserted.ASK_FOR_ITEM_RETURN_CUSTOMER_INFO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRICE_OVERRIDE_PASSWORD,'''') <> ISNULL(inserted.PRICE_OVERRIDE_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,64,null,null,null,deleted.PRICE_OVERRIDE_PASSWORD,inserted.PRICE_OVERRIDE_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REQUIRE_EMPLOYEE_PASSWORD_IN_INVOICING),'''') <> ISNULL(STRING(inserted.REQUIRE_EMPLOYEE_PASSWORD_IN_INVOICING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,65,null,null,null,deleted.REQUIRE_EMPLOYEE_PASSWORD_IN_INVOICING,inserted.REQUIRE_EMPLOYEE_PASSWORD_IN_INVOICING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DISPLAY_POS_PRICING_TO_CUSTOMER,'''') <> ISNULL(inserted.DISPLAY_POS_PRICING_TO_CUSTOMER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,66,null,null,null,deleted.DISPLAY_POS_PRICING_TO_CUSTOMER,inserted.DISPLAY_POS_PRICING_TO_CUSTOMER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.COST_PASSWORD,'''') <> ISNULL(inserted.COST_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,67,null,null,null,deleted.COST_PASSWORD,inserted.COST_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPLAY_LOW_SUGGESTED_PRICE),'''') <> ISNULL(STRING(inserted.DISPLAY_LOW_SUGGESTED_PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,68,null,null,null,deleted.DISPLAY_LOW_SUGGESTED_PRICE,inserted.DISPLAY_LOW_SUGGESTED_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPLAY_CUSTOM_PRICING),'''') <> ISNULL(STRING(inserted.DISPLAY_CUSTOM_PRICING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,69,null,null,null,deleted.DISPLAY_CUSTOM_PRICING,inserted.DISPLAY_CUSTOM_PRICING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_POLICY_ADJUSTMENT),'''') <> ISNULL(STRING(inserted.ALLOW_POLICY_ADJUSTMENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,70,null,null,null,deleted.ALLOW_POLICY_ADJUSTMENT,inserted.ALLOW_POLICY_ADJUSTMENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_MISCELLANEOUS_ADJUSTMENT),'''') <> ISNULL(STRING(inserted.ALLOW_MISCELLANEOUS_ADJUSTMENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,71,null,null,null,deleted.ALLOW_MISCELLANEOUS_ADJUSTMENT,inserted.ALLOW_MISCELLANEOUS_ADJUSTMENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_MIS_FUNCTION),'''') <> ISNULL(STRING(inserted.ALLOW_MIS_FUNCTION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,72,null,null,null,deleted.ALLOW_MIS_FUNCTION,inserted.ALLOW_MIS_FUNCTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_CATALOG_PREFERENCE_ID),'''') <> ISNULL(STRING(inserted.REF_CATALOG_PREFERENCE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,76,null,null,null,deleted.REF_CATALOG_PREFERENCE_ID,inserted.REF_CATALOG_PREFERENCE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_CORE_BANK_MAINTENANCE),'''') <> ISNULL(STRING(inserted.USE_CORE_BANK_MAINTENANCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,73,null,null,null,deleted.USE_CORE_BANK_MAINTENANCE,inserted.USE_CORE_BANK_MAINTENANCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TRANSMIT_CORE_DATA_TO_ADP),'''') <> ISNULL(STRING(inserted.TRANSMIT_CORE_DATA_TO_ADP),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,74,null,null,null,deleted.TRANSMIT_CORE_DATA_TO_ADP,inserted.TRANSMIT_CORE_DATA_TO_ADP,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_CORES_PENDING_REPORT_ON_INVOICE),'''') <> ISNULL(STRING(inserted.PRINT_CORES_PENDING_REPORT_ON_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,75,null,null,null,deleted.PRINT_CORES_PENDING_REPORT_ON_INVOICE,inserted.PRINT_CORES_PENDING_REPORT_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_CHANGE_COST_FOR_NAPA_PARTS),'''') <> ISNULL(STRING(inserted.ALLOW_CHANGE_COST_FOR_NAPA_PARTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,80,null,null,null,deleted.ALLOW_CHANGE_COST_FOR_NAPA_PARTS,inserted.ALLOW_CHANGE_COST_FOR_NAPA_PARTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_TOKENIZATION),'''') <> ISNULL(STRING(inserted.USE_TOKENIZATION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,77,null,null,null,deleted.USE_TOKENIZATION,inserted.USE_TOKENIZATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TOKENIZATION_DEVICE_KEY,'''') <> ISNULL(inserted.TOKENIZATION_DEVICE_KEY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,78,null,null,null,deleted.TOKENIZATION_DEVICE_KEY,inserted.TOKENIZATION_DEVICE_KEY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TOKENIZATION_CLIENT_ID,'''') <> ISNULL(inserted.TOKENIZATION_CLIENT_ID,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,79,null,null,null,deleted.TOKENIZATION_CLIENT_ID,inserted.TOKENIZATION_CLIENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_CHECKOUT_VERSION),'''') <> ISNULL(STRING(inserted.INVOICE_CHECKOUT_VERSION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,83,null,null,null,deleted.INVOICE_CHECKOUT_VERSION,inserted.INVOICE_CHECKOUT_VERSION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EJOEI_PASSWORD,'''') <> ISNULL(inserted.EJOEI_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,81,null,null,null,deleted.EJOEI_PASSWORD,inserted.EJOEI_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_CORE_ERASURE),'''') <> ISNULL(STRING(inserted.ALLOW_CORE_ERASURE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,82,null,null,null,deleted.ALLOW_CORE_ERASURE,inserted.ALLOW_CORE_ERASURE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_INTEGRATED_PAYMENTS),'''') <> ISNULL(STRING(inserted.USE_INTEGRATED_PAYMENTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,84,null,null,null,deleted.USE_INTEGRATED_PAYMENTS,inserted.USE_INTEGRATED_PAYMENTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_DEBIT_REFUND_AS_CASH),'''') <> ISNULL(STRING(inserted.MAXIMUM_DEBIT_REFUND_AS_CASH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,85,null,null,null,deleted.MAXIMUM_DEBIT_REFUND_AS_CASH,inserted.MAXIMUM_DEBIT_REFUND_AS_CASH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IPA_PRIMARY_IP_ADDRESS,'''') <> ISNULL(inserted.IPA_PRIMARY_IP_ADDRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,86,null,null,null,deleted.IPA_PRIMARY_IP_ADDRESS,inserted.IPA_PRIMARY_IP_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.IPA_PRIMARY_PORT_NUMBER),'''') <> ISNULL(STRING(inserted.IPA_PRIMARY_PORT_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,87,null,null,null,deleted.IPA_PRIMARY_PORT_NUMBER,inserted.IPA_PRIMARY_PORT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IPA_SECONDARY_IP_ADDRESS,'''') <> ISNULL(inserted.IPA_SECONDARY_IP_ADDRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,88,null,null,null,deleted.IPA_SECONDARY_IP_ADDRESS,inserted.IPA_SECONDARY_IP_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.IPA_SECONDARY_PORT_NUMBER),'''') <> ISNULL(STRING(inserted.IPA_SECONDARY_PORT_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,89,null,null,null,deleted.IPA_SECONDARY_PORT_NUMBER,inserted.IPA_SECONDARY_PORT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IPA_TERTIARY_IP_ADDRESS,'''') <> ISNULL(inserted.IPA_TERTIARY_IP_ADDRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,90,null,null,null,deleted.IPA_TERTIARY_IP_ADDRESS,inserted.IPA_TERTIARY_IP_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.IPA_TERTIARY_PORT_NUMBER),'''') <> ISNULL(STRING(inserted.IPA_TERTIARY_PORT_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,91,null,null,null,deleted.IPA_TERTIARY_PORT_NUMBER,inserted.IPA_TERTIARY_PORT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ITK_TIMEOUT_SECONDS),'''') <> ISNULL(STRING(inserted.ITK_TIMEOUT_SECONDS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,92,null,null,null,deleted.ITK_TIMEOUT_SECONDS,inserted.ITK_TIMEOUT_SECONDS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.IPC_STORE_FORWARD_LIMIT),'''') <> ISNULL(STRING(inserted.IPC_STORE_FORWARD_LIMIT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,93,null,null,null,deleted.IPC_STORE_FORWARD_LIMIT,inserted.IPC_STORE_FORWARD_LIMIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.IPC_SIGNATURE_CAPTURE_LIMIT),'''') <> ISNULL(STRING(inserted.IPC_SIGNATURE_CAPTURE_LIMIT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,94,null,null,null,deleted.IPC_SIGNATURE_CAPTURE_LIMIT,inserted.IPC_SIGNATURE_CAPTURE_LIMIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_CHANGE_IPC_STORE_FORWARD_LIMIT,'''') <> ISNULL(inserted.ALLOW_CHANGE_IPC_STORE_FORWARD_LIMIT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,95,null,null,null,deleted.ALLOW_CHANGE_IPC_STORE_FORWARD_LIMIT,inserted.ALLOW_CHANGE_IPC_STORE_FORWARD_LIMIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_CHANGE_IPC_SIGNATURE_CAPTURE_LIMIT,'''') <> ISNULL(inserted.ALLOW_CHANGE_IPC_SIGNATURE_CAPTURE_LIMIT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,96,null,null,null,deleted.ALLOW_CHANGE_IPC_SIGNATURE_CAPTURE_LIMIT,inserted.ALLOW_CHANGE_IPC_SIGNATURE_CAPTURE_LIMIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_AUTO_ACKNOWLEDGE_ECOMMERCE_MESSAGE),'''') <> ISNULL(STRING(inserted.ALLOW_AUTO_ACKNOWLEDGE_ECOMMERCE_MESSAGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,97,null,null,null,deleted.ALLOW_AUTO_ACKNOWLEDGE_ECOMMERCE_MESSAGE,inserted.ALLOW_AUTO_ACKNOWLEDGE_ECOMMERCE_MESSAGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_AUTO_ACKNOWLEDGE_INTERSTORE_MESSAGE),'''') <> ISNULL(STRING(inserted.ALLOW_AUTO_ACKNOWLEDGE_INTERSTORE_MESSAGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,98,null,null,null,deleted.ALLOW_AUTO_ACKNOWLEDGE_INTERSTORE_MESSAGE,inserted.ALLOW_AUTO_ACKNOWLEDGE_INTERSTORE_MESSAGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_ECOMMERCE_PULL_LIST),'''') <> ISNULL(STRING(inserted.USE_ECOMMERCE_PULL_LIST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,99,null,null,null,deleted.USE_ECOMMERCE_PULL_LIST,inserted.USE_ECOMMERCE_PULL_LIST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_INTERSTORE_PULL_LIST),'''') <> ISNULL(STRING(inserted.USE_INTERSTORE_PULL_LIST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,100,null,null,null,deleted.USE_INTERSTORE_PULL_LIST,inserted.USE_INTERSTORE_PULL_LIST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ECOMMERCE_PULL_LIST_PRINTER_ID),'''') <> ISNULL(STRING(inserted.ECOMMERCE_PULL_LIST_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,101,null,null,null,deleted.ECOMMERCE_PULL_LIST_PRINTER_ID,inserted.ECOMMERCE_PULL_LIST_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INTERSTORE_PULL_LIST_PRINTER_ID),'''') <> ISNULL(STRING(inserted.INTERSTORE_PULL_LIST_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,102,null,null,null,deleted.INTERSTORE_PULL_LIST_PRINTER_ID,inserted.INTERSTORE_PULL_LIST_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_CUSTOMER_MESSAGE_ON_INVOICE),'''') <> ISNULL(STRING(inserted.PRINT_CUSTOMER_MESSAGE_ON_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,103,null,null,null,deleted.PRINT_CUSTOMER_MESSAGE_ON_INVOICE,inserted.PRINT_CUSTOMER_MESSAGE_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ECOMMERCE_REF_INVOICE_TYPE_ID),'''') <> ISNULL(STRING(inserted.ECOMMERCE_REF_INVOICE_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,104,null,null,null,deleted.ECOMMERCE_REF_INVOICE_TYPE_ID,inserted.ECOMMERCE_REF_INVOICE_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INTERSTORE_REF_INVOICE_TYPE_ID),'''') <> ISNULL(STRING(inserted.INTERSTORE_REF_INVOICE_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,105,null,null,null,deleted.INTERSTORE_REF_INVOICE_TYPE_ID,inserted.INTERSTORE_REF_INVOICE_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ECOMMERCE_INVOICE_PRINTER_ID),'''') <> ISNULL(STRING(inserted.ECOMMERCE_INVOICE_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,106,null,null,null,deleted.ECOMMERCE_INVOICE_PRINTER_ID,inserted.ECOMMERCE_INVOICE_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INTERSTORE_INVOICE_PRINTER_ID),'''') <> ISNULL(STRING(inserted.INTERSTORE_INVOICE_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,107,null,null,null,deleted.INTERSTORE_INVOICE_PRINTER_ID,inserted.INTERSTORE_INVOICE_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ECOMMERCE_INVOICE_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.ECOMMERCE_INVOICE_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,108,null,null,null,deleted.ECOMMERCE_INVOICE_EMPLOYEE_ID,inserted.ECOMMERCE_INVOICE_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INTERSTORE_INVOICE_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.INTERSTORE_INVOICE_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,109,null,null,null,deleted.INTERSTORE_INVOICE_EMPLOYEE_ID,inserted.INTERSTORE_INVOICE_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_DC_BALANCE_IN_PROLINK),'''') <> ISNULL(STRING(inserted.USE_DC_BALANCE_IN_PROLINK),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,110,null,null,null,deleted.USE_DC_BALANCE_IN_PROLINK,inserted.USE_DC_BALANCE_IN_PROLINK,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ATTENTION_ENTRY_REQUIRED),'''') <> ISNULL(STRING(inserted.ATTENTION_ENTRY_REQUIRED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,111,null,null,null,deleted.ATTENTION_ENTRY_REQUIRED,inserted.ATTENTION_ENTRY_REQUIRED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_CHANGE_CATALOG_PREFERENCE,'''') <> ISNULL(inserted.ALLOW_CHANGE_CATALOG_PREFERENCE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,113,null,null,null,deleted.ALLOW_CHANGE_CATALOG_PREFERENCE,inserted.ALLOW_CHANGE_CATALOG_PREFERENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_CHANGE_COST_PASSWORD,'''') <> ISNULL(inserted.ALLOW_CHANGE_COST_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,114,null,null,null,deleted.ALLOW_CHANGE_COST_PASSWORD,inserted.ALLOW_CHANGE_COST_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_LOYALTY_PROGRAM),'''') <> ISNULL(STRING(inserted.USE_LOYALTY_PROGRAM),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,115,null,null,null,deleted.USE_LOYALTY_PROGRAM,inserted.USE_LOYALTY_PROGRAM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REQUIRE_CUSTOMER_CERTIFICATIONS),'''') <> ISNULL(STRING(inserted.REQUIRE_CUSTOMER_CERTIFICATIONS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,116,null,null,null,deleted.REQUIRE_CUSTOMER_CERTIFICATIONS,inserted.REQUIRE_CUSTOMER_CERTIFICATIONS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TRANSACTIONS_SUMMARY_NOTIFICATION_EMAIL,'''') <> ISNULL(inserted.TRANSACTIONS_SUMMARY_NOTIFICATION_EMAIL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,117,null,null,null,deleted.TRANSACTIONS_SUMMARY_NOTIFICATION_EMAIL,inserted.TRANSACTIONS_SUMMARY_NOTIFICATION_EMAIL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REQUIRE_TAX_IDENTIFIER_FOR_TAX_REFUND_ON_CORE),'''') <> ISNULL(STRING(inserted.REQUIRE_TAX_IDENTIFIER_FOR_TAX_REFUND_ON_CORE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,118,null,null,null,deleted.REQUIRE_TAX_IDENTIFIER_FOR_TAX_REFUND_ON_CORE,inserted.REQUIRE_TAX_IDENTIFIER_FOR_TAX_REFUND_ON_CORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_AUTHORIZED_BUYER_ON_INVOICE),'''') <> ISNULL(STRING(inserted.PRINT_AUTHORIZED_BUYER_ON_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,119,null,null,null,deleted.PRINT_AUTHORIZED_BUYER_ON_INVOICE,inserted.PRINT_AUTHORIZED_BUYER_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_ELECTRONIC_INVOICE_VENDOR_ID),'''') <> ISNULL(STRING(inserted.REF_ELECTRONIC_INVOICE_VENDOR_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,120,null,null,null,deleted.REF_ELECTRONIC_INVOICE_VENDOR_ID,inserted.REF_ELECTRONIC_INVOICE_VENDOR_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ELECTRONIC_INVOICE_VENDOR_LOCKED,'''') <> ISNULL(inserted.ELECTRONIC_INVOICE_VENDOR_LOCKED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,121,null,null,null,deleted.ELECTRONIC_INVOICE_VENDOR_LOCKED,inserted.ELECTRONIC_INVOICE_VENDOR_LOCKED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRICES_USE_STANDARD_ROUNDING),'''') <> ISNULL(STRING(inserted.PRICES_USE_STANDARD_ROUNDING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,122,null,null,null,deleted.PRICES_USE_STANDARD_ROUNDING,inserted.PRICES_USE_STANDARD_ROUNDING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PULL_LIST_REF_SORT_OPTION_ID),'''') <> ISNULL(STRING(inserted.PULL_LIST_REF_SORT_OPTION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,123,null,null,null,deleted.PULL_LIST_REF_SORT_OPTION_ID,inserted.PULL_LIST_REF_SORT_OPTION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_SALES_ORDER_NUMBER_USED),'''') <> ISNULL(STRING(inserted.LAST_SALES_ORDER_NUMBER_USED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,124,null,null,null,deleted.LAST_SALES_ORDER_NUMBER_USED,inserted.LAST_SALES_ORDER_NUMBER_USED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_CHOOSE_STORE_DIALOG),'''') <> ISNULL(STRING(inserted.USE_CHOOSE_STORE_DIALOG),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,125,null,null,null,deleted.USE_CHOOSE_STORE_DIALOG,inserted.USE_CHOOSE_STORE_DIALOG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_INVOICE_FEED),'''') <> ISNULL(STRING(inserted.USE_INVOICE_FEED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,126,null,null,null,deleted.USE_INVOICE_FEED,inserted.USE_INVOICE_FEED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_FULFILLMENT_ON_INVOICE),'''') <> ISNULL(STRING(inserted.PRINT_FULFILLMENT_ON_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,127,null,null,null,deleted.PRINT_FULFILLMENT_ON_INVOICE,inserted.PRINT_FULFILLMENT_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEFAULT_WIP_ANSWER),'''') <> ISNULL(STRING(inserted.DEFAULT_WIP_ANSWER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,128,null,null,null,deleted.DEFAULT_WIP_ANSWER,inserted.DEFAULT_WIP_ANSWER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_CHANGE_MAXIMUM_INVOICE_AMOUNT,'''') <> ISNULL(inserted.ALLOW_CHANGE_MAXIMUM_INVOICE_AMOUNT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,130,null,null,null,deleted.ALLOW_CHANGE_MAXIMUM_INVOICE_AMOUNT,inserted.ALLOW_CHANGE_MAXIMUM_INVOICE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_INVOICE_AMOUNT),'''') <> ISNULL(STRING(inserted.MAXIMUM_INVOICE_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,129,null,null,null,deleted.MAXIMUM_INVOICE_AMOUNT,inserted.MAXIMUM_INVOICE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_CHANGE_MINIMUM_RETURN_AMOUNT,'''') <> ISNULL(inserted.ALLOW_CHANGE_MINIMUM_RETURN_AMOUNT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,132,null,null,null,deleted.ALLOW_CHANGE_MINIMUM_RETURN_AMOUNT,inserted.ALLOW_CHANGE_MINIMUM_RETURN_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MINIMUM_RETURN_AMOUNT),'''') <> ISNULL(STRING(inserted.MINIMUM_RETURN_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,131,null,null,null,deleted.MINIMUM_RETURN_AMOUNT,inserted.MINIMUM_RETURN_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_DESCRIPTION),'''') <> ISNULL(STRING(inserted.PRINT_DESCRIPTION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,133,null,null,null,deleted.PRINT_DESCRIPTION,inserted.PRINT_DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DNS_INVOICE),'''') <> ISNULL(STRING(inserted.DNS_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,134,null,null,null,deleted.DNS_INVOICE,inserted.DNS_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AVOID_ITEM_WARRANTY_RETURNS),'''') <> ISNULL(STRING(inserted.AVOID_ITEM_WARRANTY_RETURNS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,135,null,null,null,deleted.AVOID_ITEM_WARRANTY_RETURNS,inserted.AVOID_ITEM_WARRANTY_RETURNS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ITEM_PRICE_VALUE_REQUIRED),'''') <> ISNULL(STRING(inserted.ITEM_PRICE_VALUE_REQUIRED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,136,null,null,null,deleted.ITEM_PRICE_VALUE_REQUIRED,inserted.ITEM_PRICE_VALUE_REQUIRED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXCLUDE_BOPIS_SAVED_INVOICE_FROM_PURGE_PROCESS),'''') <> ISNULL(STRING(inserted.EXCLUDE_BOPIS_SAVED_INVOICE_FROM_PURGE_PROCESS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,137,null,null,null,deleted.EXCLUDE_BOPIS_SAVED_INVOICE_FROM_PURGE_PROCESS,inserted.EXCLUDE_BOPIS_SAVED_INVOICE_FROM_PURGE_PROCESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_AUTO_INVOICE_JMO_PICKED_ITEMS),'''') <> ISNULL(STRING(inserted.ALLOW_AUTO_INVOICE_JMO_PICKED_ITEMS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,138,null,null,null,deleted.ALLOW_AUTO_INVOICE_JMO_PICKED_ITEMS,inserted.ALLOW_AUTO_INVOICE_JMO_PICKED_ITEMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAPA_REWARDS_PROGRAM_PROMPT,'''') <> ISNULL(inserted.NAPA_REWARDS_PROGRAM_PROMPT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,139,null,null,null,deleted.NAPA_REWARDS_PROGRAM_PROMPT,inserted.NAPA_REWARDS_PROGRAM_PROMPT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAPA_REWARDS_PROGRAM_PROMPT_LOCKED,'''') <> ISNULL(inserted.NAPA_REWARDS_PROGRAM_PROMPT_LOCKED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,140,null,null,null,deleted.NAPA_REWARDS_PROGRAM_PROMPT_LOCKED,inserted.NAPA_REWARDS_PROGRAM_PROMPT_LOCKED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_KIT_SOURCING_OPTIMIZATION),'''') <> ISNULL(STRING(inserted.ALLOW_KIT_SOURCING_OPTIMIZATION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,141,null,null,null,deleted.ALLOW_KIT_SOURCING_OPTIMIZATION,inserted.ALLOW_KIT_SOURCING_OPTIMIZATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SEND_STOCK_LOCATIONS_TO_NDT),'''') <> ISNULL(STRING(inserted.SEND_STOCK_LOCATIONS_TO_NDT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,142,null,null,null,deleted.SEND_STOCK_LOCATIONS_TO_NDT,inserted.SEND_STOCK_LOCATIONS_TO_NDT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISABLE_VOID_INVOICE),'''') <> ISNULL(STRING(inserted.DISABLE_VOID_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,143,null,null,null,deleted.DISABLE_VOID_INVOICE,inserted.DISABLE_VOID_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISABLE_MANAGER_OVERRIDE),'''') <> ISNULL(STRING(inserted.DISABLE_MANAGER_OVERRIDE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,144,null,null,null,deleted.DISABLE_MANAGER_OVERRIDE,inserted.DISABLE_MANAGER_OVERRIDE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_LEGACY_DC_EJOEI,'''') <> ISNULL(inserted.USE_LEGACY_DC_EJOEI,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,145,null,null,null,deleted.USE_LEGACY_DC_EJOEI,inserted.USE_LEGACY_DC_EJOEI,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_LEGACY_INTERSTORE,'''') <> ISNULL(inserted.USE_LEGACY_INTERSTORE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,146,null,null,null,deleted.USE_LEGACY_INTERSTORE,inserted.USE_LEGACY_INTERSTORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_LEGACY_SUPPLIER_EJOEI,'''') <> ISNULL(inserted.USE_LEGACY_SUPPLIER_EJOEI,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,147,null,null,null,deleted.USE_LEGACY_SUPPLIER_EJOEI,inserted.USE_LEGACY_SUPPLIER_EJOEI,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ONLINE_INVOICE_FTP_URL,'''') <> ISNULL(inserted.ONLINE_INVOICE_FTP_URL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,148,null,null,null,deleted.ONLINE_INVOICE_FTP_URL,inserted.ONLINE_INVOICE_FTP_URL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ONLINE_INVOICE_FTP_USER_NAME,'''') <> ISNULL(inserted.ONLINE_INVOICE_FTP_USER_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,149,null,null,null,deleted.ONLINE_INVOICE_FTP_USER_NAME,inserted.ONLINE_INVOICE_FTP_USER_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ONLINE_INVOICE_FTP_PASSWORD,'''') <> ISNULL(inserted.ONLINE_INVOICE_FTP_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,150,null,null,null,deleted.ONLINE_INVOICE_FTP_PASSWORD,inserted.ONLINE_INVOICE_FTP_PASSWORD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_INVOICE_DOMAIN_FEED_SERVICE,'''') <> ISNULL(inserted.USE_INVOICE_DOMAIN_FEED_SERVICE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,151,null,null,null,deleted.USE_INVOICE_DOMAIN_FEED_SERVICE,inserted.USE_INVOICE_DOMAIN_FEED_SERVICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_CEPDI_V2,'''') <> ISNULL(inserted.USE_CEPDI_V2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,152,null,null,null,deleted.USE_CEPDI_V2,inserted.USE_CEPDI_V2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_SIGPLUS,'''') <> ISNULL(inserted.USE_SIGPLUS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,153,null,null,null,deleted.USE_SIGPLUS,inserted.USE_SIGPLUS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BYPASS_RETURN_INFO,'''') <> ISNULL(inserted.BYPASS_RETURN_INFO,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,154,null,null,null,deleted.BYPASS_RETURN_INFO,inserted.BYPASS_RETURN_INFO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ALLOW_MULTIPLE_USERS_FOR_MESSAGES),'''') <> ISNULL(STRING(inserted.ALLOW_MULTIPLE_USERS_FOR_MESSAGES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,155,null,null,null,deleted.ALLOW_MULTIPLE_USERS_FOR_MESSAGES,inserted.ALLOW_MULTIPLE_USERS_FOR_MESSAGES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EMAIL_INVOICE_FORMAT,'''') <> ISNULL(inserted.EMAIL_INVOICE_FORMAT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,156,null,null,null,deleted.EMAIL_INVOICE_FORMAT,inserted.EMAIL_INVOICE_FORMAT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AUTO_EMAIL_INVOICE),'''') <> ISNULL(STRING(inserted.AUTO_EMAIL_INVOICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,157,null,null,null,deleted.AUTO_EMAIL_INVOICE,inserted.AUTO_EMAIL_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUOTE_PRINTER_ID),'''') <> ISNULL(STRING(inserted.QUOTE_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,158,null,null,null,deleted.QUOTE_PRINTER_ID,inserted.QUOTE_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETAIL_DELIVERY_FEE_AMOUNT),'''') <> ISNULL(STRING(inserted.RETAIL_DELIVERY_FEE_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,159,null,null,null,deleted.RETAIL_DELIVERY_FEE_AMOUNT,inserted.RETAIL_DELIVERY_FEE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_NAPA_PAYMENTS_IPC,'''') <> ISNULL(inserted.USE_NAPA_PAYMENTS_IPC,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,107,160,null,null,null,deleted.USE_NAPA_PAYMENTS_IPC,inserted.USE_NAPA_PAYMENTS_IPC,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if ISNULL(STRING(deleted.use_tender_types),'''') <> ISNULL(STRING(inserted.use_tender_types),'''') and inserted.use_tender_types <> 11 then if exists(select use_protobase from store_profile where loc=deleted.loc and MOD(use_protobase,10)=1) then raiserror 18014 ''18014: tr_bu_invoicing_profile: USE_TENDER_TYPES can not be set when STORE_PROFILE.USE_PROTOBASE is set to 1 or 11.'' end if end if;if ISNULL(STRING(deleted.print_credit_card_info_on_invoice),'''') <> ISNULL(STRING(inserted.print_credit_card_info_on_invoice),'''') and inserted.print_credit_card_info_on_invoice <> 11 then if exists(select use_protobase from store_profile where loc=deleted.loc and MOD(use_protobase,10)=1) then raiserror 18015 ''18015: tr_bu_invoicing_profile: PRINT_CREDIT_CARD_INFO_ON_INVOICE can not be set when STORE_PROFILE.USE_PROTOBASE is set to 1 or 11.'' end if end if;if inserted.use_invoice_feed <> 1 then set inserted.use_invoice_feed=1 end if end', 'tr_bu_joei_preload','JOEI_PRELOAD','B','U',1,'create trigger tr_bu_joei_preload before update on JOEI_PRELOAD referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.REF_JOEI_OPTION_FOR_DC_CD,'''') <> ISNULL(inserted.REF_JOEI_OPTION_FOR_DC_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,460,1,inserted.id,null,null,deleted.REF_JOEI_OPTION_FOR_DC_CD,inserted.REF_JOEI_OPTION_FOR_DC_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_JOEI_ORIGIN_CD,'''') <> ISNULL(inserted.REF_JOEI_ORIGIN_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,460,2,inserted.id,null,null,deleted.REF_JOEI_ORIGIN_CD,inserted.REF_JOEI_ORIGIN_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,460,3,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,460,4,inserted.id,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUANTITY),'''') <> ISNULL(STRING(inserted.QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,460,5,inserted.id,null,null,deleted.QUANTITY,inserted.QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.CUSTOMER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,460,6,inserted.id,null,null,deleted.CUSTOMER_ID,inserted.CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SHIPPING_CODE_CD,'''') <> ISNULL(inserted.SHIPPING_CODE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,460,7,inserted.id,null,null,deleted.SHIPPING_CODE_CD,inserted.SHIPPING_CODE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE_FOR_STORE,'''') <> ISNULL(inserted.NOTE_FOR_STORE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,460,8,inserted.id,null,null,deleted.NOTE_FOR_STORE,inserted.NOTE_FOR_STORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MESSAGE_TO_DC,'''') <> ISNULL(inserted.MESSAGE_TO_DC,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,460,9,inserted.id,null,null,deleted.MESSAGE_TO_DC,inserted.MESSAGE_TO_DC,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_min_max_profile','MIN_MAX_PROFILE','B','U',1,'create trigger tr_bu_min_max_profile before update on MIN_MAX_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.DEFAULT_REF_MIN_MAX_FORMULA_ID),'''') <> ISNULL(STRING(inserted.DEFAULT_REF_MIN_MAX_FORMULA_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,1,null,null,null,deleted.DEFAULT_REF_MIN_MAX_FORMULA_ID,inserted.DEFAULT_REF_MIN_MAX_FORMULA_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_MIN_MAX_RUN_FREQUENCY_ID),'''') <> ISNULL(STRING(inserted.REF_MIN_MAX_RUN_FREQUENCY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,2,null,null,null,deleted.REF_MIN_MAX_RUN_FREQUENCY_ID,inserted.REF_MIN_MAX_RUN_FREQUENCY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SLS_HST_MONTHS_TO_USE),'''') <> ISNULL(STRING(inserted.SLS_HST_MONTHS_TO_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,3,null,null,null,deleted.SLS_HST_MONTHS_TO_USE,inserted.SLS_HST_MONTHS_TO_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEFAULT_POISSON_SAFETY_PERCENT),'''') <> ISNULL(STRING(inserted.DEFAULT_POISSON_SAFETY_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,8,null,null,null,deleted.DEFAULT_POISSON_SAFETY_PERCENT,inserted.DEFAULT_POISSON_SAFETY_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_RUN_DATE),'''') <> ISNULL(STRING(inserted.LAST_RUN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,4,null,null,null,deleted.LAST_RUN_DATE,inserted.LAST_RUN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NEXT_RUN_DATE),'''') <> ISNULL(STRING(inserted.NEXT_RUN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,5,null,null,null,deleted.NEXT_RUN_DATE,inserted.NEXT_RUN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INCLUDE_DISPLAY_ITEMS_IN_MIN_MAX_REVIEW),'''') <> ISNULL(STRING(inserted.INCLUDE_DISPLAY_ITEMS_IN_MIN_MAX_REVIEW),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,7,null,null,null,deleted.INCLUDE_DISPLAY_ITEMS_IN_MIN_MAX_REVIEW,inserted.INCLUDE_DISPLAY_ITEMS_IN_MIN_MAX_REVIEW,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INCLUDE_NON_STOCKING_PARTS),'''') <> ISNULL(STRING(inserted.INCLUDE_NON_STOCKING_PARTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,10,null,null,null,deleted.INCLUDE_NON_STOCKING_PARTS,inserted.INCLUDE_NON_STOCKING_PARTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_SORT_OPTION_ID),'''') <> ISNULL(STRING(inserted.REF_SORT_OPTION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,11,null,null,null,deleted.REF_SORT_OPTION_ID,inserted.REF_SORT_OPTION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INCLUDE_IN_CLASS_LOST_SALES),'''') <> ISNULL(STRING(inserted.INCLUDE_IN_CLASS_LOST_SALES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,9,null,null,null,deleted.INCLUDE_IN_CLASS_LOST_SALES,inserted.INCLUDE_IN_CLASS_LOST_SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISPLAY_MAX_ROWS),'''') <> ISNULL(STRING(inserted.DISPLAY_MAX_ROWS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,355,12,null,null,null,deleted.DISPLAY_MAX_ROWS,inserted.DISPLAY_MAX_ROWS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_min_max_session','MIN_MAX_SESSION','B','U',1,'create trigger tr_bu_min_max_session before update on MIN_MAX_SESSION referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,1,1,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXPIRATION_DATE),'''') <> ISNULL(STRING(inserted.EXPIRATION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,1,2,inserted.id,null,null,deleted.EXPIRATION_DATE,inserted.EXPIRATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_NON_STOCKING_PARTS,'''') <> ISNULL(inserted.INCLUDE_NON_STOCKING_PARTS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,1,3,inserted.id,null,null,deleted.INCLUDE_NON_STOCKING_PARTS,inserted.INCLUDE_NON_STOCKING_PARTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_DISPLAY_ITEMS,'''') <> ISNULL(inserted.INCLUDE_DISPLAY_ITEMS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,1,4,inserted.id,null,null,deleted.INCLUDE_DISPLAY_ITEMS,inserted.INCLUDE_DISPLAY_ITEMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ONLY_REVIEW_AFFECTED_ITEMS,'''') <> ISNULL(inserted.ONLY_REVIEW_AFFECTED_ITEMS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,1,5,inserted.id,null,null,deleted.ONLY_REVIEW_AFFECTED_ITEMS,inserted.ONLY_REVIEW_AFFECTED_ITEMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_SORT_OPTION_ID),'''') <> ISNULL(STRING(inserted.REF_SORT_OPTION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,1,6,inserted.id,null,null,deleted.REF_SORT_OPTION_ID,inserted.REF_SORT_OPTION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AUTO_APPLY_CHANGES,'''') <> ISNULL(inserted.AUTO_APPLY_CHANGES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,1,7,inserted.id,null,null,deleted.AUTO_APPLY_CHANGES,inserted.AUTO_APPLY_CHANGES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_IN_CLASS_LOST_SALES,'''') <> ISNULL(inserted.INCLUDE_IN_CLASS_LOST_SALES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,1,8,inserted.id,null,null,deleted.INCLUDE_IN_CLASS_LOST_SALES,inserted.INCLUDE_IN_CLASS_LOST_SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_CLASS_CD,'''') <> ISNULL(inserted.REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,1,9,inserted.id,null,null,deleted.REF_CLASS_CD,inserted.REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_misc_chg','MISC_CHG','B','U',1,'create trigger tr_bu_misc_chg before update on MISC_CHG referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.CODE,'''') <> ISNULL(inserted.CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,160,2,inserted.id,null,null,deleted.CODE,inserted.CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,160,3,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MISC_CHG_GROUP_CODE_ID),'''') <> ISNULL(STRING(inserted.MISC_CHG_GROUP_CODE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,160,4,inserted.id,null,null,deleted.MISC_CHG_GROUP_CODE_ID,inserted.MISC_CHG_GROUP_CODE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_misc_chg_group_code','MISC_CHG_GROUP_CODE','B','U',1,'create trigger tr_bu_misc_chg_group_code before update on MISC_CHG_GROUP_CODE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,252,1,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_misc_chg_state_detail','MISC_CHG_STATE_DETAIL','B','U',1,'create trigger tr_bu_misc_chg_state_detail before update on MISC_CHG_STATE_DETAIL referencing old as deleted new as inserted for each row begin declare i_return_status integer;if deleted.MISC_CHG_ID <> inserted.MISC_CHG_ID or ISNULL(deleted.REF_STATE_CD,REPLICATE(''Z'',30)) <> ISNULL(inserted.REF_STATE_CD,REPLICATE(''Z'',30)) or ISNULL(deleted.REF_COUNTRY_CD,REPLICATE(''Z'',30)) <> ISNULL(inserted.REF_COUNTRY_CD,REPLICATE(''Z'',30)) then if exists(select*from MISC_CHG_STATE_DETAIL where MISC_CHG_ID=inserted.MISC_CHG_ID and ISNULL(REF_STATE_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_STATE_CD,REPLICATE(''Z'',30)) and ISNULL(REF_COUNTRY_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_COUNTRY_CD,REPLICATE(''Z'',30)) and ID <> inserted.ID) then raiserror 18147 ''tr_bu_misc_chg_state_detail: Duplicate value for UNIQUE index XAK1MISC_CHG_STATE_DETAIL.'' end if end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,254,1,inserted.id,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,254,2,inserted.id,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_MISC_CHG_FLAG_ID),'''') <> ISNULL(STRING(inserted.REF_MISC_CHG_FLAG_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,254,3,inserted.id,null,null,deleted.REF_MISC_CHG_FLAG_ID,inserted.REF_MISC_CHG_FLAG_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_MISC_CHG_TYPE_CD,'''') <> ISNULL(inserted.REF_MISC_CHG_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,254,4,inserted.id,null,null,deleted.REF_MISC_CHG_TYPE_CD,inserted.REF_MISC_CHG_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CHARGE_AMOUNT),'''') <> ISNULL(STRING(inserted.CHARGE_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,254,5,inserted.id,null,null,deleted.CHARGE_AMOUNT,inserted.CHARGE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,254,6,inserted.id,null,null,deleted.TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,254,7,inserted.id,null,null,deleted.TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.APPLIES_TO_PRO_RATA_WARRANTY_RETURNS,'''') <> ISNULL(inserted.APPLIES_TO_PRO_RATA_WARRANTY_RETURNS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,254,8,inserted.id,null,null,deleted.APPLIES_TO_PRO_RATA_WARRANTY_RETURNS,inserted.APPLIES_TO_PRO_RATA_WARRANTY_RETURNS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_modem','MODEM','B','U',1,'create trigger tr_bu_modem before update on MODEM referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_MODEM_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_MODEM_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,317,1,inserted.id,null,null,deleted.REF_MODEM_TYPE_ID,inserted.REF_MODEM_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_DEVICE_CONNECTION_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_DEVICE_CONNECTION_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,317,2,inserted.id,null,null,deleted.REF_DEVICE_CONNECTION_TYPE_ID,inserted.REF_DEVICE_CONNECTION_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PORT_NUMBER),'''') <> ISNULL(STRING(inserted.PORT_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,317,3,inserted.id,null,null,deleted.PORT_NUMBER,inserted.PORT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BOX_NUMBER),'''') <> ISNULL(STRING(inserted.BOX_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,317,4,inserted.id,null,null,deleted.BOX_NUMBER,inserted.BOX_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,317,5,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IN_USE,'''') <> ISNULL(inserted.IN_USE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,317,6,inserted.id,null,null,deleted.IN_USE,inserted.IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_OUTGOING_CALLS,'''') <> ISNULL(inserted.ALLOW_OUTGOING_CALLS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,317,8,inserted.id,null,null,deleted.ALLOW_OUTGOING_CALLS,inserted.ALLOW_OUTGOING_CALLS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IS_CREDIT_CARD_MODEM,'''') <> ISNULL(inserted.IS_CREDIT_CARD_MODEM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,317,9,inserted.id,null,null,deleted.IS_CREDIT_CARD_MODEM,inserted.IS_CREDIT_CARD_MODEM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UBL_JOB_NUMBER),'''') <> ISNULL(STRING(inserted.UBL_JOB_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,317,10,inserted.id,null,null,deleted.UBL_JOB_NUMBER,inserted.UBL_JOB_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if ISNULL(deleted.box_number,'''') <> ISNULL(inserted.box_number,'''') or ISNULL(deleted.port_number,'''') <> ISNULL(inserted.port_number,'''') then if(inserted.box_number is null and inserted.port_number is not null) or(inserted.box_number is not null and inserted.port_number is null) then raiserror 18050 ''tr_bu_modem: box_number and port_number must both have values or both be NULL.'' else if inserted.box_number is not null and inserted.port_number is not null then if exists(select*from printer where box_number=inserted.box_number and port_number=inserted.port_number union select*from modem where box_number=inserted.box_number and port_number=inserted.port_number) then raiserror 18050 ''tr_bu_modem: box_number/port_number is not unique.'' end if end if end if end if end', 'tr_bu_multistore_profile','MULTI_STORE_PROFILE','B','U',1,'create trigger tr_bu_multistore_profile before update on MULTI_STORE_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.COMPANY_ID),'''') <> ISNULL(STRING(inserted.COMPANY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,1,null,null,null,deleted.COMPANY_ID,inserted.COMPANY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LOC_AT_MAIN),'''') <> ISNULL(STRING(inserted.LOC_AT_MAIN),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,2,null,null,null,deleted.LOC_AT_MAIN,inserted.LOC_AT_MAIN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MAIN_STORE_NETWORK_NAME,'''') <> ISNULL(inserted.MAIN_STORE_NETWORK_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,3,null,null,null,deleted.MAIN_STORE_NETWORK_NAME,inserted.MAIN_STORE_NETWORK_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_MULTISTORE_AR),'''') <> ISNULL(STRING(inserted.USE_MULTISTORE_AR),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,4,null,null,null,deleted.USE_MULTISTORE_AR,inserted.USE_MULTISTORE_AR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEFAULT_STORE),'''') <> ISNULL(STRING(inserted.DEFAULT_STORE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,5,null,null,null,deleted.DEFAULT_STORE,inserted.DEFAULT_STORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SERVER_CO_ID_NUMBER),'''') <> ISNULL(STRING(inserted.SERVER_CO_ID_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,6,null,null,null,deleted.SERVER_CO_ID_NUMBER,inserted.SERVER_CO_ID_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SERVER_ST_ID_NUMBER),'''') <> ISNULL(STRING(inserted.SERVER_ST_ID_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,7,null,null,null,deleted.SERVER_ST_ID_NUMBER,inserted.SERVER_ST_ID_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.HISTORY_UPDATE_ACTIVE,'''') <> ISNULL(inserted.HISTORY_UPDATE_ACTIVE,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,8,null,null,null,deleted.HISTORY_UPDATE_ACTIVE,inserted.HISTORY_UPDATE_ACTIVE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DATABASE_SERVER_NAME,'''') <> ISNULL(inserted.DATABASE_SERVER_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,9,null,null,null,deleted.DATABASE_SERVER_NAME,inserted.DATABASE_SERVER_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DATABASE_NAME,'''') <> ISNULL(inserted.DATABASE_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,10,null,null,null,deleted.DATABASE_NAME,inserted.DATABASE_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DATABASE_PORT_NUMBER),'''') <> ISNULL(STRING(inserted.DATABASE_PORT_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,11,null,null,null,deleted.DATABASE_PORT_NUMBER,inserted.DATABASE_PORT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REPLICATING_TO_SERVER_FARM,'''') <> ISNULL(inserted.REPLICATING_TO_SERVER_FARM,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,12,null,null,null,deleted.REPLICATING_TO_SERVER_FARM,inserted.REPLICATING_TO_SERVER_FARM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_BRANCH_AR_DATA_INQUIRY,'''') <> ISNULL(inserted.ALLOW_BRANCH_AR_DATA_INQUIRY,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,13,null,null,null,deleted.ALLOW_BRANCH_AR_DATA_INQUIRY,inserted.ALLOW_BRANCH_AR_DATA_INQUIRY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_FLEET_MANAGEMENT_INTEGRATION,'''') <> ISNULL(inserted.USE_FLEET_MANAGEMENT_INTEGRATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,251,14,null,null,null,deleted.USE_FLEET_MANAGEMENT_INTEGRATION,inserted.USE_FLEET_MANAGEMENT_INTEGRATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_non_pool_rgn_class_returns','NON_POOL_RGN_CLASS_RETURNS','B','U',1,'create trigger tr_bu_non_pool_rgn_class_returns before update on NON_POOL_RGN_CLASS_RETURNS referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_HEADER_ID),'''') <> ISNULL(STRING(inserted.RGN_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,627,1,inserted.id,null,null,deleted.RGN_HEADER_ID,inserted.RGN_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CLASSIFICATION_RETURN_ITEM_ID),'''') <> ISNULL(STRING(inserted.CLASSIFICATION_RETURN_ITEM_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,627,2,inserted.id,null,null,deleted.CLASSIFICATION_RETURN_ITEM_ID,inserted.CLASSIFICATION_RETURN_ITEM_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,627,3,inserted.id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_NUMBER),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,627,4,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_NUMBER,inserted.CREATED_BY_EMPLOYEE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_non_pool_rgn_competitive_stocking_line_changeover','NON_POOL_RGN_COMPETITIVE_STOCKING_LINE_CHANGEOVER','B','U',1,'create trigger tr_bu_non_pool_rgn_competitive_stocking_line_changeover before update on NON_POOL_RGN_COMPETITIVE_STOCKING_LINE_CHANGEOVER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_HEADER_ID),'''') <> ISNULL(STRING(inserted.RGN_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,630,1,inserted.id,null,null,deleted.RGN_HEADER_ID,inserted.RGN_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVENTORY_ID),'''') <> ISNULL(STRING(inserted.INVENTORY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,630,2,inserted.id,null,null,deleted.INVENTORY_ID,inserted.INVENTORY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,630,3,inserted.id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_QUANTITY),'''') <> ISNULL(STRING(inserted.RETURN_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,630,4,inserted.id,null,null,deleted.RETURN_QUANTITY,inserted.RETURN_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COUNT_QUANTITY),'''') <> ISNULL(STRING(inserted.COUNT_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,630,5,inserted.id,null,null,deleted.COUNT_QUANTITY,inserted.COUNT_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VERIFIED_DATE),'''') <> ISNULL(STRING(inserted.VERIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,630,6,inserted.id,null,null,deleted.VERIFIED_DATE,inserted.VERIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DELINQUENT_REASON,'''') <> ISNULL(inserted.DELINQUENT_REASON,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,630,7,inserted.id,null,null,deleted.DELINQUENT_REASON,inserted.DELINQUENT_REASON,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMARKS,'''') <> ISNULL(inserted.REMARKS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,630,8,inserted.id,null,null,deleted.REMARKS,inserted.REMARKS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_NUMBER),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,630,9,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_NUMBER,inserted.CREATED_BY_EMPLOYEE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_non_pool_rgn_dealer_customer_changeover','NON_POOL_RGN_DEALER_CUSTOMER_CHANGEOVER','B','U',1,'create trigger tr_bu_non_pool_rgn_dealer_customer_changeover before update on NON_POOL_RGN_DEALER_CUSTOMER_CHANGEOVER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_HEADER_ID),'''') <> ISNULL(STRING(inserted.RGN_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,628,1,inserted.id,null,null,deleted.RGN_HEADER_ID,inserted.RGN_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,628,2,inserted.id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COST_OF_CREDIT),'''') <> ISNULL(STRING(inserted.COST_OF_CREDIT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,628,3,inserted.id,null,null,deleted.COST_OF_CREDIT,inserted.COST_OF_CREDIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXPECTED_CREDIT),'''') <> ISNULL(STRING(inserted.EXPECTED_CREDIT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,628,4,inserted.id,null,null,deleted.EXPECTED_CREDIT,inserted.EXPECTED_CREDIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FACTORY_REP_NAME,'''') <> ISNULL(inserted.FACTORY_REP_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,628,5,inserted.id,null,null,deleted.FACTORY_REP_NAME,inserted.FACTORY_REP_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREDIT_ISSUED_TO_CUSTOMER),'''') <> ISNULL(STRING(inserted.CREDIT_ISSUED_TO_CUSTOMER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,628,6,inserted.id,null,null,deleted.CREDIT_ISSUED_TO_CUSTOMER,inserted.CREDIT_ISSUED_TO_CUSTOMER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMARKS,'''') <> ISNULL(inserted.REMARKS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,628,7,inserted.id,null,null,deleted.REMARKS,inserted.REMARKS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_NUMBER),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,628,8,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_NUMBER,inserted.CREATED_BY_EMPLOYEE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_non_pool_rgn_miscellaneous_return','NON_POOL_RGN_MISCELLANEOUS_RETURN','B','U',1,'create trigger tr_bu_non_pool_rgn_miscellaneous_return before update on NON_POOL_RGN_MISCELLANEOUS_RETURN referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_HEADER_ID),'''') <> ISNULL(STRING(inserted.RGN_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,629,1,inserted.id,null,null,deleted.RGN_HEADER_ID,inserted.RGN_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,629,2,inserted.id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_QUANTITY),'''') <> ISNULL(STRING(inserted.RETURN_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,629,3,inserted.id,null,null,deleted.RETURN_QUANTITY,inserted.RETURN_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXPECTED_CREDIT),'''') <> ISNULL(STRING(inserted.EXPECTED_CREDIT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,629,4,inserted.id,null,null,deleted.EXPECTED_CREDIT,inserted.EXPECTED_CREDIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMARKS,'''') <> ISNULL(inserted.REMARKS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,629,5,inserted.id,null,null,deleted.REMARKS,inserted.REMARKS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_NUMBER),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,629,6,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_NUMBER,inserted.CREATED_BY_EMPLOYEE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_non_pool_rgn_new_merchandise','NON_POOL_RGN_NEW_MERCHANDISE','B','U',1,'create trigger tr_bu_non_pool_rgn_new_merchandise before update on NON_POOL_RGN_NEW_MERCHANDISE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_HEADER_ID),'''') <> ISNULL(STRING(inserted.RGN_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,633,1,inserted.id,null,null,deleted.RGN_HEADER_ID,inserted.RGN_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVENTORY_ID),'''') <> ISNULL(STRING(inserted.INVENTORY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,633,2,inserted.id,null,null,deleted.INVENTORY_ID,inserted.INVENTORY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,633,3,inserted.id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_QUANTITY),'''') <> ISNULL(STRING(inserted.RETURN_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,633,4,inserted.id,null,null,deleted.RETURN_QUANTITY,inserted.RETURN_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COUNT_QUANTITY),'''') <> ISNULL(STRING(inserted.COUNT_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,633,5,inserted.id,null,null,deleted.COUNT_QUANTITY,inserted.COUNT_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VERIFIED_DATE),'''') <> ISNULL(STRING(inserted.VERIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,633,6,inserted.id,null,null,deleted.VERIFIED_DATE,inserted.VERIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DELINQUENT_REASON,'''') <> ISNULL(inserted.DELINQUENT_REASON,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,633,7,inserted.id,null,null,deleted.DELINQUENT_REASON,inserted.DELINQUENT_REASON,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMARKS,'''') <> ISNULL(inserted.REMARKS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,633,8,inserted.id,null,null,deleted.REMARKS,inserted.REMARKS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_NUMBER),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,633,9,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_NUMBER,inserted.CREATED_BY_EMPLOYEE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_non_pool_rgn_osd','NON_POOL_RGN_OSD','B','U',1,'create trigger tr_bu_non_pool_rgn_osd before update on NON_POOL_RGN_OSD referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_HEADER_ID),'''') <> ISNULL(STRING(inserted.RGN_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,1,inserted.id,null,null,deleted.RGN_HEADER_ID,inserted.RGN_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_OSD_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_OSD_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,2,inserted.id,null,null,deleted.REF_OSD_TYPE_ID,inserted.REF_OSD_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_OSD_CD,'''') <> ISNULL(inserted.REF_OSD_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,3,inserted.id,null,null,deleted.REF_OSD_CD,inserted.REF_OSD_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVENTORY_ID),'''') <> ISNULL(STRING(inserted.INVENTORY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,4,inserted.id,null,null,deleted.INVENTORY_ID,inserted.INVENTORY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,5,inserted.id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UNIQUE_BARCODE,'''') <> ISNULL(inserted.UNIQUE_BARCODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,6,inserted.id,null,null,deleted.UNIQUE_BARCODE,inserted.UNIQUE_BARCODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUANTITY_BILLED),'''') <> ISNULL(STRING(inserted.QUANTITY_BILLED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,7,inserted.id,null,null,deleted.QUANTITY_BILLED,inserted.QUANTITY_BILLED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUANTITY_RECEIVED),'''') <> ISNULL(STRING(inserted.QUANTITY_RECEIVED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,8,inserted.id,null,null,deleted.QUANTITY_RECEIVED,inserted.QUANTITY_RECEIVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.QUANTITY_DAMAGED),'''') <> ISNULL(STRING(inserted.QUANTITY_DAMAGED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,9,inserted.id,null,null,deleted.QUANTITY_DAMAGED,inserted.QUANTITY_DAMAGED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RECEIVED_DATE),'''') <> ISNULL(STRING(inserted.RECEIVED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,10,inserted.id,null,null,deleted.RECEIVED_DATE,inserted.RECEIVED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PACKING_SLIP_NUMBER,'''') <> ISNULL(inserted.PACKING_SLIP_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,11,inserted.id,null,null,deleted.PACKING_SLIP_NUMBER,inserted.PACKING_SLIP_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PURCHASE_ORDER_NUMBER,'''') <> ISNULL(inserted.PURCHASE_ORDER_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,12,inserted.id,null,null,deleted.PURCHASE_ORDER_NUMBER,inserted.PURCHASE_ORDER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COUNT_QUANTITY),'''') <> ISNULL(STRING(inserted.COUNT_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,13,inserted.id,null,null,deleted.COUNT_QUANTITY,inserted.COUNT_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VERIFIED_DATE),'''') <> ISNULL(STRING(inserted.VERIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,14,inserted.id,null,null,deleted.VERIFIED_DATE,inserted.VERIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COST),'''') <> ISNULL(STRING(inserted.COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,15,inserted.id,null,null,deleted.COST,inserted.COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CORE_COST),'''') <> ISNULL(STRING(inserted.CORE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,16,inserted.id,null,null,deleted.CORE_COST,inserted.CORE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_NUMBER),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,17,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_NUMBER,inserted.CREATED_BY_EMPLOYEE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DELINQUENT_REASON,'''') <> ISNULL(inserted.DELINQUENT_REASON,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,18,inserted.id,null,null,deleted.DELINQUENT_REASON,inserted.DELINQUENT_REASON,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMARKS,'''') <> ISNULL(inserted.REMARKS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,632,19,inserted.id,null,null,deleted.REMARKS,inserted.REMARKS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_non_pool_rgn_repair_return','NON_POOL_RGN_REPAIR_RETURN','B','U',1,'create trigger tr_bu_non_pool_rgn_repair_return before update on NON_POOL_RGN_REPAIR_RETURN referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_HEADER_ID),'''') <> ISNULL(STRING(inserted.RGN_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,631,1,inserted.id,null,null,deleted.RGN_HEADER_ID,inserted.RGN_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,631,2,inserted.id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVENTORY_ID),'''') <> ISNULL(STRING(inserted.INVENTORY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,631,3,inserted.id,null,null,deleted.INVENTORY_ID,inserted.INVENTORY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_QUANTITY),'''') <> ISNULL(STRING(inserted.RETURN_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,631,4,inserted.id,null,null,deleted.RETURN_QUANTITY,inserted.RETURN_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VENDOR_ID),'''') <> ISNULL(STRING(inserted.VENDOR_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,631,5,inserted.id,null,null,deleted.VENDOR_ID,inserted.VENDOR_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UNIQUE_BARCODE,'''') <> ISNULL(inserted.UNIQUE_BARCODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,631,6,inserted.id,null,null,deleted.UNIQUE_BARCODE,inserted.UNIQUE_BARCODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SHIPPING_CHARGE),'''') <> ISNULL(STRING(inserted.SHIPPING_CHARGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,631,7,inserted.id,null,null,deleted.SHIPPING_CHARGE,inserted.SHIPPING_CHARGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CUSTOMER_RECEIVED_PART,'''') <> ISNULL(inserted.CUSTOMER_RECEIVED_PART,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,631,8,inserted.id,null,null,deleted.CUSTOMER_RECEIVED_PART,inserted.CUSTOMER_RECEIVED_PART,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMARKS,'''') <> ISNULL(inserted.REMARKS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,631,9,inserted.id,null,null,deleted.REMARKS,inserted.REMARKS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_NUMBER),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,631,10,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_NUMBER,inserted.CREATED_BY_EMPLOYEE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_non_pool_rgn_reportable_sales','NON_POOL_RGN_REPORTABLE_SALES','B','U',1,'create trigger tr_bu_non_pool_rgn_reportable_sales before update on NON_POOL_RGN_REPORTABLE_SALES referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_HEADER_ID),'''') <> ISNULL(STRING(inserted.RGN_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,626,1,inserted.id,null,null,deleted.RGN_HEADER_ID,inserted.RGN_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,626,2,inserted.id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SALES_YEAR_MONTH,'''') <> ISNULL(inserted.SALES_YEAR_MONTH,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,626,3,inserted.id,null,null,deleted.SALES_YEAR_MONTH,inserted.SALES_YEAR_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REBATE_CODE,'''') <> ISNULL(inserted.REBATE_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,626,4,inserted.id,null,null,deleted.REBATE_CODE,inserted.REBATE_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,626,5,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REPORTABLE_SALES_CONTROL_SERIAL_NUMBER),'''') <> ISNULL(STRING(inserted.REPORTABLE_SALES_CONTROL_SERIAL_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,626,6,inserted.id,null,null,deleted.REPORTABLE_SALES_CONTROL_SERIAL_NUMBER,inserted.REPORTABLE_SALES_CONTROL_SERIAL_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ENTRY_REBATE_AMOUNT),'''') <> ISNULL(STRING(inserted.ENTRY_REBATE_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,626,7,inserted.id,null,null,deleted.ENTRY_REBATE_AMOUNT,inserted.ENTRY_REBATE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_NUMBER),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,626,8,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_NUMBER,inserted.CREATED_BY_EMPLOYEE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_order_criteria_class','ORDER_CRITERIA_CLASS','B','U',1,'create trigger tr_bu_order_criteria_class before update on ORDER_CRITERIA_CLASS referencing old as deleted new as inserted for each row begin if ISNULL(deleted.REF_CLASS_CD,REPLICATE(''Z'',30)) <> ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) or deleted.ORDER_HEADER_ID <> inserted.ORDER_HEADER_ID then if exists(select*from ORDER_CRITERIA_CLASS where ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ORDER_HEADER_ID=inserted.ORDER_HEADER_ID and ID <> inserted.ID) then raiserror 18147 ''tr_bu_order_criteria_class: Duplicate value for UNIQUE index XAK1ORDER_CRITERIA_CLASS.'' end if end if end', 'tr_bu_order_group','ORDER_GROUP','B','U',1,'create trigger tr_bu_order_group before update on ORDER_GROUP referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.REF_ORDER_TYPE_CD,'''') <> ISNULL(inserted.REF_ORDER_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,1,inserted.id,null,null,deleted.REF_ORDER_TYPE_CD,inserted.REF_ORDER_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUMBER),'''') <> ISNULL(STRING(inserted.NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,2,inserted.id,null,null,deleted.NUMBER,inserted.NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALIAS,'''') <> ISNULL(inserted.ALIAS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,3,inserted.id,null,null,deleted.ALIAS,inserted.ALIAS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VENDOR_ID),'''') <> ISNULL(STRING(inserted.VENDOR_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,4,inserted.id,null,null,deleted.VENDOR_ID,inserted.VENDOR_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TERMS,'''') <> ISNULL(inserted.TERMS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,5,inserted.id,null,null,deleted.TERMS,inserted.TERMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,6,inserted.id,null,null,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_FACTORY_INCLUSION_ID),'''') <> ISNULL(STRING(inserted.REF_FACTORY_INCLUSION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,7,inserted.id,null,null,deleted.REF_FACTORY_INCLUSION_ID,inserted.REF_FACTORY_INCLUSION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUMBER_OF_SALES_OCCURRENCES),'''') <> ISNULL(STRING(inserted.NUMBER_OF_SALES_OCCURRENCES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,8,inserted.id,null,null,deleted.NUMBER_OF_SALES_OCCURRENCES,inserted.NUMBER_OF_SALES_OCCURRENCES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MONTHS_FOR_SALES_OCCURRENCES),'''') <> ISNULL(STRING(inserted.MONTHS_FOR_SALES_OCCURRENCES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,9,inserted.id,null,null,deleted.MONTHS_FOR_SALES_OCCURRENCES,inserted.MONTHS_FOR_SALES_OCCURRENCES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_ENVIRONMENTAL_ITEMS,'''') <> ISNULL(inserted.INCLUDE_ENVIRONMENTAL_ITEMS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,10,inserted.id,null,null,deleted.INCLUDE_ENVIRONMENTAL_ITEMS,inserted.INCLUDE_ENVIRONMENTAL_ITEMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_DISPLAY_ITEMS,'''') <> ISNULL(inserted.INCLUDE_DISPLAY_ITEMS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,11,inserted.id,null,null,deleted.INCLUDE_DISPLAY_ITEMS,inserted.INCLUDE_DISPLAY_ITEMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORDER_TO_MAX_REGARDLESS_OF_MIN,'''') <> ISNULL(inserted.ORDER_TO_MAX_REGARDLESS_OF_MIN,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,12,inserted.id,null,null,deleted.ORDER_TO_MAX_REGARDLESS_OF_MIN,inserted.ORDER_TO_MAX_REGARDLESS_OF_MIN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_SUPPLIER_ZERO,'''') <> ISNULL(inserted.INCLUDE_SUPPLIER_ZERO,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,13,inserted.id,null,null,deleted.INCLUDE_SUPPLIER_ZERO,inserted.INCLUDE_SUPPLIER_ZERO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UPDATE_ON_ORDER_QTYS,'''') <> ISNULL(inserted.UPDATE_ON_ORDER_QTYS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,14,inserted.id,null,null,deleted.UPDATE_ON_ORDER_QTYS,inserted.UPDATE_ON_ORDER_QTYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_CONSOLIDATED_ORDER_CD,'''') <> ISNULL(inserted.REF_CONSOLIDATED_ORDER_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,15,inserted.id,null,null,deleted.REF_CONSOLIDATED_ORDER_CD,inserted.REF_CONSOLIDATED_ORDER_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FACTORY_STANDARD_PKG_PERCENT),'''') <> ISNULL(STRING(inserted.FACTORY_STANDARD_PKG_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,16,inserted.id,null,null,deleted.FACTORY_STANDARD_PKG_PERCENT,inserted.FACTORY_STANDARD_PKG_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_ORDER_BASIS_CD,'''') <> ISNULL(inserted.REF_ORDER_BASIS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,17,inserted.id,null,null,deleted.REF_ORDER_BASIS_CD,inserted.REF_ORDER_BASIS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MINIMUM_DEMAND_BEFORE_ORDERING),'''') <> ISNULL(STRING(inserted.MINIMUM_DEMAND_BEFORE_ORDERING),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,18,inserted.id,null,null,deleted.MINIMUM_DEMAND_BEFORE_ORDERING,inserted.MINIMUM_DEMAND_BEFORE_ORDERING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_ZERO_MIN_ITEMS,'''') <> ISNULL(inserted.INCLUDE_ZERO_MIN_ITEMS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,19,inserted.id,null,null,deleted.INCLUDE_ZERO_MIN_ITEMS,inserted.INCLUDE_ZERO_MIN_ITEMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_BELOW_MIN_ITEMS,'''') <> ISNULL(inserted.INCLUDE_BELOW_MIN_ITEMS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,20,inserted.id,null,null,deleted.INCLUDE_BELOW_MIN_ITEMS,inserted.INCLUDE_BELOW_MIN_ITEMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SLS_HST_NUMBER_OF_MONTHS),'''') <> ISNULL(STRING(inserted.SLS_HST_NUMBER_OF_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,21,inserted.id,null,null,deleted.SLS_HST_NUMBER_OF_MONTHS,inserted.SLS_HST_NUMBER_OF_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SLS_HST_SEASONAL_ORDER,'''') <> ISNULL(inserted.SLS_HST_SEASONAL_ORDER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,22,inserted.id,null,null,deleted.SLS_HST_SEASONAL_ORDER,inserted.SLS_HST_SEASONAL_ORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SLS_HST_SEASONAL_MONTHS,'''') <> ISNULL(inserted.SLS_HST_SEASONAL_MONTHS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,23,inserted.id,null,null,deleted.SLS_HST_SEASONAL_MONTHS,inserted.SLS_HST_SEASONAL_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SLS_HST_SEASONAL_NUMBER_OF_YEARS),'''') <> ISNULL(STRING(inserted.SLS_HST_SEASONAL_NUMBER_OF_YEARS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,24,inserted.id,null,null,deleted.SLS_HST_SEASONAL_NUMBER_OF_YEARS,inserted.SLS_HST_SEASONAL_NUMBER_OF_YEARS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SLS_HST_INCLUDE_YTD_LOST_SALES,'''') <> ISNULL(inserted.SLS_HST_INCLUDE_YTD_LOST_SALES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,25,inserted.id,null,null,deleted.SLS_HST_INCLUDE_YTD_LOST_SALES,inserted.SLS_HST_INCLUDE_YTD_LOST_SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SLS_HST_INCLUDE_LYR_LOST_SALES,'''') <> ISNULL(inserted.SLS_HST_INCLUDE_LYR_LOST_SALES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,26,inserted.id,null,null,deleted.SLS_HST_INCLUDE_LYR_LOST_SALES,inserted.SLS_HST_INCLUDE_LYR_LOST_SALES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUMBER_OF_DAYS_TO_DELAY),'''') <> ISNULL(STRING(inserted.NUMBER_OF_DAYS_TO_DELAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,27,inserted.id,null,null,deleted.NUMBER_OF_DAYS_TO_DELAY,inserted.NUMBER_OF_DAYS_TO_DELAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUMBER_OF_MONTHS_FOR_DELAY),'''') <> ISNULL(STRING(inserted.NUMBER_OF_MONTHS_FOR_DELAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,28,inserted.id,null,null,deleted.NUMBER_OF_MONTHS_FOR_DELAY,inserted.NUMBER_OF_MONTHS_FOR_DELAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUMBER_OF_SALES_FOR_NO_DELAY),'''') <> ISNULL(STRING(inserted.NUMBER_OF_SALES_FOR_NO_DELAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,29,inserted.id,null,null,deleted.NUMBER_OF_SALES_FOR_NO_DELAY,inserted.NUMBER_OF_SALES_FOR_NO_DELAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORDER_IF_BELOW_MIN_OR_PERCAR,'''') <> ISNULL(inserted.ORDER_IF_BELOW_MIN_OR_PERCAR,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,30,inserted.id,null,null,deleted.ORDER_IF_BELOW_MIN_OR_PERCAR,inserted.ORDER_IF_BELOW_MIN_OR_PERCAR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AUTO_FINALIZE_MINIMUM_ORDER_VALUE),'''') <> ISNULL(STRING(inserted.AUTO_FINALIZE_MINIMUM_ORDER_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,31,inserted.id,null,null,deleted.AUTO_FINALIZE_MINIMUM_ORDER_VALUE,inserted.AUTO_FINALIZE_MINIMUM_ORDER_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AUTO_FINALIZE_MAXIMUM_ORDER_VALUE),'''') <> ISNULL(STRING(inserted.AUTO_FINALIZE_MAXIMUM_ORDER_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,32,inserted.id,null,null,deleted.AUTO_FINALIZE_MAXIMUM_ORDER_VALUE,inserted.AUTO_FINALIZE_MAXIMUM_ORDER_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FACTORY_ORDER_TABLE_ID),'''') <> ISNULL(STRING(inserted.FACTORY_ORDER_TABLE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,33,inserted.id,null,null,deleted.FACTORY_ORDER_TABLE_ID,inserted.FACTORY_ORDER_TABLE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SHIPPING_CODE_CD,'''') <> ISNULL(inserted.SHIPPING_CODE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,34,inserted.id,null,null,deleted.SHIPPING_CODE_CD,inserted.SHIPPING_CODE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORDER_HANDLING_CD,'''') <> ISNULL(inserted.ORDER_HANDLING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,35,inserted.id,null,null,deleted.ORDER_HANDLING_CD,inserted.ORDER_HANDLING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATION_DATE),'''') <> ISNULL(STRING(inserted.CREATION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,37,inserted.id,null,null,deleted.CREATION_DATE,inserted.CREATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_PO_DATE),'''') <> ISNULL(STRING(inserted.LAST_PO_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,38,inserted.id,null,null,deleted.LAST_PO_DATE,inserted.LAST_PO_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LAST_PO_NUMBER_GENERATED,'''') <> ISNULL(inserted.LAST_PO_NUMBER_GENERATED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,144,39,inserted.id,null,null,deleted.LAST_PO_NUMBER_GENERATED,inserted.LAST_PO_NUMBER_GENERATED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_order_group_class','ORDER_GROUP_CLASS','B','U',1,'create trigger tr_bu_order_group_class before update on ORDER_GROUP_CLASS referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=deleted.order_group_id and loc=deleted.loc;if ISNULL(deleted.REF_CLASS_CD,'''') <> ISNULL(inserted.REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,145,1,inserted.id,null,null,deleted.REF_CLASS_CD,inserted.REF_CLASS_CD,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if i_return_status=-1 then update order_group set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.order_group_id and loc=inserted.loc end if end', 'tr_bu_order_group_part','ORDER_GROUP_PART','B','U',1,'create trigger tr_bu_order_group_part before update on ORDER_GROUP_PART referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=deleted.order_group_id and loc=deleted.loc;if ISNULL(deleted.INCLUDE_OR_EXCLUDE,'''') <> ISNULL(inserted.INCLUDE_OR_EXCLUDE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,148,2,inserted.id,null,null,deleted.INCLUDE_OR_EXCLUDE,inserted.INCLUDE_OR_EXCLUDE,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,148,3,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,148,4,inserted.id,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if i_return_status=-1 then update order_group set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.order_group_id and loc=inserted.loc end if end', 'tr_bu_order_group_prefix','ORDER_GROUP_PREFIX','B','U',1,'create trigger tr_bu_order_group_prefix before update on ORDER_GROUP_PREFIX referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=deleted.order_group_id and loc=deleted.loc;if ISNULL(deleted.PART_NUMBER_PREFIX,REPLICATE(''Z'',30)) <> ISNULL(inserted.PART_NUMBER_PREFIX,REPLICATE(''Z'',30)) or ISNULL(deleted.GROUP_CODE,-1) <> ISNULL(inserted.GROUP_CODE,-1) or ISNULL(deleted.LINE_ABBREV,REPLICATE(''Z'',30)) <> ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) or deleted.ORDER_GROUP_ID <> inserted.ORDER_GROUP_ID then if exists(select*from ORDER_GROUP_PREFIX where ISNULL(PART_NUMBER_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_NUMBER_PREFIX,REPLICATE(''Z'',30)) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ORDER_GROUP_ID=inserted.ORDER_GROUP_ID and ID <> inserted.ID) then raiserror 18147 ''tr_bu_order_group_prefix: Duplicate value for UNIQUE index XAK1ORDER_GROUP_PREFIX.'' end if end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,147,1,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(STRING(deleted.GROUP_CODE),'''') <> ISNULL(STRING(inserted.GROUP_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,147,2,inserted.id,null,null,deleted.GROUP_CODE,inserted.GROUP_CODE,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.PART_NUMBER_PREFIX,'''') <> ISNULL(inserted.PART_NUMBER_PREFIX,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,147,3,inserted.id,null,null,deleted.PART_NUMBER_PREFIX,inserted.PART_NUMBER_PREFIX,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.INCLUDE_OR_EXCLUDE,'''') <> ISNULL(inserted.INCLUDE_OR_EXCLUDE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,147,4,inserted.id,null,null,deleted.INCLUDE_OR_EXCLUDE,inserted.INCLUDE_OR_EXCLUDE,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if i_return_status=-1 then update order_group set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.order_group_id and loc=inserted.loc end if end', 'tr_bu_order_group_store','ORDER_GROUP_STORE','B','U',1,'create trigger tr_bu_order_group_store before update on ORDER_GROUP_STORE referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=deleted.order_group_id and loc=deleted.loc;if ISNULL(STRING(deleted.PRIORITY),'''') <> ISNULL(STRING(inserted.PRIORITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,229,1,inserted.id,null,null,deleted.PRIORITY,inserted.PRIORITY,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(STRING(deleted.ORDER_FROM_LOC),'''') <> ISNULL(STRING(inserted.ORDER_FROM_LOC),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,229,2,inserted.id,null,null,deleted.ORDER_FROM_LOC,inserted.ORDER_FROM_LOC,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.USE_FACTORY_STANDARD_PACKAGE,'''') <> ISNULL(inserted.USE_FACTORY_STANDARD_PACKAGE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,229,3,inserted.id,null,null,deleted.USE_FACTORY_STANDARD_PACKAGE,inserted.USE_FACTORY_STANDARD_PACKAGE,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(STRING(deleted.REF_OVERSTOCK_CALCULATION_ID),'''') <> ISNULL(STRING(inserted.REF_OVERSTOCK_CALCULATION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,229,4,inserted.id,null,null,deleted.REF_OVERSTOCK_CALCULATION_ID,inserted.REF_OVERSTOCK_CALCULATION_ID,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if i_return_status=-1 then update order_group set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.order_group_id and loc=inserted.loc end if end', 'tr_bu_order_group_supplier','ORDER_GROUP_SUPPLIER','B','U',1,'create trigger tr_bu_order_group_supplier before update on ORDER_GROUP_SUPPLIER referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from order_group where id=deleted.order_group_id and loc=deleted.loc;if ISNULL(STRING(deleted.SUPPLIER_ID),'''') <> ISNULL(STRING(inserted.SUPPLIER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,146,1,inserted.id,null,null,deleted.SUPPLIER_ID,inserted.SUPPLIER_ID,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if i_return_status=-1 then update order_group set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.order_group_id and loc=inserted.loc end if end', 'tr_bu_order_handling','ORDER_HANDLING','B','U',1,'create trigger tr_bu_order_handling before update on ORDER_HANDLING referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,164,1,null,null,inserted.CD,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAPA_RESERVED,'''') <> ISNULL(inserted.NAPA_RESERVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,164,2,null,null,inserted.CD,deleted.NAPA_RESERVED,inserted.NAPA_RESERVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_order_header','ORDER_HEADER','B','U',1,'create trigger tr_bu_order_header before update on ORDER_HEADER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.REF_ORDER_TYPE_CD,'''') <> ISNULL(inserted.REF_ORDER_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,1,inserted.id,null,null,deleted.REF_ORDER_TYPE_CD,inserted.REF_ORDER_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PURCHASE_ORDER_NUMBER,'''') <> ISNULL(inserted.PURCHASE_ORDER_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,2,inserted.id,null,null,deleted.PURCHASE_ORDER_NUMBER,inserted.PURCHASE_ORDER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FACTORY_ORDER_TABLE_ID),'''') <> ISNULL(STRING(inserted.FACTORY_ORDER_TABLE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,3,inserted.id,null,null,deleted.FACTORY_ORDER_TABLE_ID,inserted.FACTORY_ORDER_TABLE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VENDOR_ID),'''') <> ISNULL(STRING(inserted.VENDOR_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,4,inserted.id,null,null,deleted.VENDOR_ID,inserted.VENDOR_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TERMS,'''') <> ISNULL(inserted.TERMS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,5,inserted.id,null,null,deleted.TERMS,inserted.TERMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,6,inserted.id,null,null,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORDER_VALUE),'''') <> ISNULL(STRING(inserted.ORDER_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,7,inserted.id,null,null,deleted.ORDER_VALUE,inserted.ORDER_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISCOUNT_EARNED),'''') <> ISNULL(STRING(inserted.DISCOUNT_EARNED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,8,inserted.id,null,null,deleted.DISCOUNT_EARNED,inserted.DISCOUNT_EARNED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VALUE_OF_CORES_ORDERED),'''') <> ISNULL(STRING(inserted.VALUE_OF_CORES_ORDERED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,9,inserted.id,null,null,deleted.VALUE_OF_CORES_ORDERED,inserted.VALUE_OF_CORES_ORDERED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_ORDER_QTY),'''') <> ISNULL(STRING(inserted.TOTAL_ORDER_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,10,inserted.id,null,null,deleted.TOTAL_ORDER_QTY,inserted.TOTAL_ORDER_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UPDATE_ON_ORDER_QTYS,'''') <> ISNULL(inserted.UPDATE_ON_ORDER_QTYS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,11,inserted.id,null,null,deleted.UPDATE_ON_ORDER_QTYS,inserted.UPDATE_ON_ORDER_QTYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORDER_GROUP_ID),'''') <> ISNULL(STRING(inserted.ORDER_GROUP_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,12,inserted.id,null,null,deleted.ORDER_GROUP_ID,inserted.ORDER_GROUP_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STORE_NUMBER),'''') <> ISNULL(STRING(inserted.STORE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,13,inserted.id,null,null,deleted.STORE_NUMBER,inserted.STORE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATION_DATE),'''') <> ISNULL(STRING(inserted.CREATION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,14,inserted.id,null,null,deleted.CREATION_DATE,inserted.CREATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,153,15,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_ID,inserted.CREATED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_pay_period_profile','PAY_PERIOD_PROFILE','B','U',1,'create trigger tr_bu_pay_period_profile before update on PAY_PERIOD_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.PROFILE_NAME,'''') <> ISNULL(inserted.PROFILE_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,1,inserted.id,null,null,deleted.PROFILE_NAME,inserted.PROFILE_NAME,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.REF_PAY_FREQUENCY_ID),'''') <> ISNULL(STRING(inserted.REF_PAY_FREQUENCY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,2,inserted.id,null,null,deleted.REF_PAY_FREQUENCY_ID,inserted.REF_PAY_FREQUENCY_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.DAILY_HOURS_FOR_OVERTIME),'''') <> ISNULL(STRING(inserted.DAILY_HOURS_FOR_OVERTIME),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,3,inserted.id,null,null,deleted.DAILY_HOURS_FOR_OVERTIME,inserted.DAILY_HOURS_FOR_OVERTIME,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.DAILY_HOURS_FOR_DOUBLE_TIME),'''') <> ISNULL(STRING(inserted.DAILY_HOURS_FOR_DOUBLE_TIME),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,4,inserted.id,null,null,deleted.DAILY_HOURS_FOR_DOUBLE_TIME,inserted.DAILY_HOURS_FOR_DOUBLE_TIME,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.WEEKLY_HOURS_FOR_OVERTIME),'''') <> ISNULL(STRING(inserted.WEEKLY_HOURS_FOR_OVERTIME),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,5,inserted.id,null,null,deleted.WEEKLY_HOURS_FOR_OVERTIME,inserted.WEEKLY_HOURS_FOR_OVERTIME,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.WEEKLY_HOURS_FOR_DOUBLE_TIME),'''') <> ISNULL(STRING(inserted.WEEKLY_HOURS_FOR_DOUBLE_TIME),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,6,inserted.id,null,null,deleted.WEEKLY_HOURS_FOR_DOUBLE_TIME,inserted.WEEKLY_HOURS_FOR_DOUBLE_TIME,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.REF_ROUNDING_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_ROUNDING_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,7,inserted.id,null,null,deleted.REF_ROUNDING_TYPE_ID,inserted.REF_ROUNDING_TYPE_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.ROUND_DAYS_TO_MINUTES),'''') <> ISNULL(STRING(inserted.ROUND_DAYS_TO_MINUTES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,8,inserted.id,null,null,deleted.ROUND_DAYS_TO_MINUTES,inserted.ROUND_DAYS_TO_MINUTES,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.ROUND_PUNCHES_TO_MINUTES),'''') <> ISNULL(STRING(inserted.ROUND_PUNCHES_TO_MINUTES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,9,inserted.id,null,null,deleted.ROUND_PUNCHES_TO_MINUTES,inserted.ROUND_PUNCHES_TO_MINUTES,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.CURRENT_PAY_PERIOD_BEGIN_DATE),'''') <> ISNULL(STRING(inserted.CURRENT_PAY_PERIOD_BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,10,inserted.id,null,null,deleted.CURRENT_PAY_PERIOD_BEGIN_DATE,inserted.CURRENT_PAY_PERIOD_BEGIN_DATE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.CURRENT_PAY_PERIOD_END_DATE),'''') <> ISNULL(STRING(inserted.CURRENT_PAY_PERIOD_END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,11,inserted.id,null,null,deleted.CURRENT_PAY_PERIOD_END_DATE,inserted.CURRENT_PAY_PERIOD_END_DATE,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.SPECIAL_CONDITIONS),'''') <> ISNULL(STRING(inserted.SPECIAL_CONDITIONS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,12,inserted.id,null,null,deleted.SPECIAL_CONDITIONS,inserted.SPECIAL_CONDITIONS,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.LUNCH_CALCULATION_FLAG,'''') <> ISNULL(inserted.LUNCH_CALCULATION_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,41,13,inserted.id,null,null,deleted.LUNCH_CALCULATION_FLAG,inserted.LUNCH_CALCULATION_FLAG,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.date_modified=current timestamp end if end', 'tr_bu_penny_rounding','PENNY_ROUNDING','B','U',1,'create trigger tr_bu_penny_rounding before update on PENNY_ROUNDING referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.BEGIN_RANGE),'''') <> ISNULL(STRING(inserted.BEGIN_RANGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,100,1,inserted.id,null,null,deleted.BEGIN_RANGE,inserted.BEGIN_RANGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_RANGE),'''') <> ISNULL(STRING(inserted.END_RANGE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,100,2,inserted.id,null,null,deleted.END_RANGE,inserted.END_RANGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT),'''') <> ISNULL(STRING(inserted.AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,100,3,inserted.id,null,null,deleted.AMOUNT,inserted.AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_phone_room_group','PHONE_ROOM_GROUP','B','U',1,'create trigger tr_bu_phone_room_group before update on PHONE_ROOM_GROUP referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,666,1,inserted.id,null,null,deleted.NAME,inserted.NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_phone_room_profile','PHONE_ROOM_PROFILE','B','U',1,'create trigger tr_bu_phone_room_profile before update on PHONE_ROOM_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.USE_PHONE_ROOM_CHECKOUT),'''') <> ISNULL(STRING(inserted.USE_PHONE_ROOM_CHECKOUT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,688,1,null,null,null,deleted.USE_PHONE_ROOM_CHECKOUT,inserted.USE_PHONE_ROOM_CHECKOUT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATE_INVOICE_PER_STORE),'''') <> ISNULL(STRING(inserted.CREATE_INVOICE_PER_STORE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,688,2,null,null,null,deleted.CREATE_INVOICE_PER_STORE,inserted.CREATE_INVOICE_PER_STORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SOURCE_LOCAL_FOR_NXP),'''') <> ISNULL(STRING(inserted.SOURCE_LOCAL_FOR_NXP),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,688,3,null,null,null,deleted.SOURCE_LOCAL_FOR_NXP,inserted.SOURCE_LOCAL_FOR_NXP,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCESS_REMOTE_STORE_MESSAGES),'''') <> ISNULL(STRING(inserted.ACCESS_REMOTE_STORE_MESSAGES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,688,4,null,null,null,deleted.ACCESS_REMOTE_STORE_MESSAGES,inserted.ACCESS_REMOTE_STORE_MESSAGES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_phone_room_store','PHONE_ROOM_STORE','B','U',1,'create trigger tr_bu_phone_room_store before update on PHONE_ROOM_STORE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if deleted.PHONE_ROOM_GROUP_ID <> inserted.PHONE_ROOM_GROUP_ID or ISNULL(deleted.COMMUNICATION_DIRECTORY_ID,-1) <> ISNULL(inserted.COMMUNICATION_DIRECTORY_ID,-1) then if exists(select*from PHONE_ROOM_STORE where PHONE_ROOM_GROUP_ID=inserted.PHONE_ROOM_GROUP_ID and ISNULL(COMMUNICATION_DIRECTORY_ID,-1)=ISNULL(inserted.COMMUNICATION_DIRECTORY_ID,-1) and ID <> inserted.ID) then raiserror 18147 ''tr_bu_phone_room_store: Duplicate value for UNIQUE index XAK1PHONE_ROOM_STORE.'' end if end if;if ISNULL(STRING(deleted.PHONE_ROOM_GROUP_ID),'''') <> ISNULL(STRING(inserted.PHONE_ROOM_GROUP_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,1,inserted.id,null,null,deleted.PHONE_ROOM_GROUP_ID,inserted.PHONE_ROOM_GROUP_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COMMUNICATION_DIRECTORY_ID),'''') <> ISNULL(STRING(inserted.COMMUNICATION_DIRECTORY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,2,inserted.id,null,null,deleted.COMMUNICATION_DIRECTORY_ID,inserted.COMMUNICATION_DIRECTORY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SEQUENCE),'''') <> ISNULL(STRING(inserted.SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,3,inserted.id,null,null,deleted.SEQUENCE,inserted.SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_SETTING_REF_PHONE_ROOM_INVOICE_SETTING_ID),'''') <> ISNULL(STRING(inserted.INVOICE_SETTING_REF_PHONE_ROOM_INVOICE_SETTING_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,4,inserted.id,null,null,deleted.INVOICE_SETTING_REF_PHONE_ROOM_INVOICE_SETTING_ID,inserted.INVOICE_SETTING_REF_PHONE_ROOM_INVOICE_SETTING_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_PRINTER_ID),'''') <> ISNULL(STRING(inserted.INVOICE_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,5,inserted.id,null,null,deleted.INVOICE_PRINTER_ID,inserted.INVOICE_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INVOICE_PRINTER_NAME,'''') <> ISNULL(inserted.INVOICE_PRINTER_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,6,inserted.id,null,null,deleted.INVOICE_PRINTER_NAME,inserted.INVOICE_PRINTER_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SERVING_DC,'''') <> ISNULL(inserted.SERVING_DC,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,7,inserted.id,null,null,deleted.SERVING_DC,inserted.SERVING_DC,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DEFAULT_SERVING,'''') <> ISNULL(inserted.DEFAULT_SERVING,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,8,inserted.id,null,null,deleted.DEFAULT_SERVING,inserted.DEFAULT_SERVING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INTERSTORE_TRANSFER_REF_PHONE_ROOM_INVOICE_SETTING_ID),'''') <> ISNULL(STRING(inserted.INTERSTORE_TRANSFER_REF_PHONE_ROOM_INVOICE_SETTING_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,9,inserted.id,null,null,deleted.INTERSTORE_TRANSFER_REF_PHONE_ROOM_INVOICE_SETTING_ID,inserted.INTERSTORE_TRANSFER_REF_PHONE_ROOM_INVOICE_SETTING_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INTERSTORE_PRINTER_ID),'''') <> ISNULL(STRING(inserted.INTERSTORE_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,10,inserted.id,null,null,deleted.INTERSTORE_PRINTER_ID,inserted.INTERSTORE_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INTERSTORE_PRINTER_NAME,'''') <> ISNULL(inserted.INTERSTORE_PRINTER_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,11,inserted.id,null,null,deleted.INTERSTORE_PRINTER_NAME,inserted.INTERSTORE_PRINTER_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IP_ADDRESS,'''') <> ISNULL(inserted.IP_ADDRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,667,12,inserted.id,null,null,deleted.IP_ADDRESS,inserted.IP_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_physical_inventory_excluded_product_line','PHYSICAL_INVENTORY_EXCLUDED_PRODUCT_LINE','B','U',1,'create trigger tr_bu_physical_inventory_excluded_product_line before update on PHYSICAL_INVENTORY_EXCLUDED_PRODUCT_LINE referencing old as deleted new as inserted for each row begin if not exists(select id from product_line where product_line.loc=inserted.loc and product_line.group_code=0 and product_line.line_abbrev=(select line_abbrev from product_line where product_line.loc=inserted.loc and product_line.id=inserted.product_line_id)) then raiserror 18023 ''tr_bu_physical_inventory_excluded_product_line: product_line_id '' || inserted.product_line_id || '' does not contain group code 0.'' end if end', 'tr_bu_physical_inventory_location','PHYSICAL_INVENTORY_LOCATION','B','U',1,'create trigger tr_bu_physical_inventory_location before update on PHYSICAL_INVENTORY_LOCATION referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.PHYSICAL_INVENTORY_PART_ID),'''') <> ISNULL(STRING(inserted.PHYSICAL_INVENTORY_PART_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,315,1,inserted.id,null,null,deleted.PHYSICAL_INVENTORY_PART_ID,inserted.PHYSICAL_INVENTORY_PART_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STOCK_LOCATION,'''') <> ISNULL(inserted.STOCK_LOCATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,315,2,inserted.id,null,null,deleted.STOCK_LOCATION,inserted.STOCK_LOCATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COUNT),'''') <> ISNULL(STRING(inserted.COUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,315,3,inserted.id,null,null,deleted.COUNT,inserted.COUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ENTRY_METHOD),'''') <> ISNULL(STRING(inserted.ENTRY_METHOD),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,315,4,inserted.id,null,null,deleted.ENTRY_METHOD,inserted.ENTRY_METHOD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_po_check_in','PO_CHECK_IN','B','U',1,'create trigger tr_bu_po_check_in before update on PO_CHECK_IN referencing old as deleted new as inserted for each row begin if deleted.PO_HEADER_ID <> inserted.PO_HEADER_ID or ISNULL(deleted.SHIPMENT_NUMBER,-1) <> ISNULL(inserted.SHIPMENT_NUMBER,-1) then if exists(select*from PO_CHECK_IN where PO_HEADER_ID=inserted.PO_HEADER_ID and ISNULL(SHIPMENT_NUMBER,-1)=ISNULL(inserted.SHIPMENT_NUMBER,-1) and ID <> inserted.ID) then raiserror 18147 ''tr_bu_po_check_in: Duplicate value for UNIQUE index XAK1PO_CHECK_IN.'' end if end if end', 'tr_bu_po_header','PO_HEADER','B','U',1,'create trigger tr_bu_po_header before update on PO_HEADER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.REF_ORDER_TYPE_CD,'''') <> ISNULL(inserted.REF_ORDER_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,1,inserted.id,null,null,deleted.REF_ORDER_TYPE_CD,inserted.REF_ORDER_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PURCHASE_ORDER_NUMBER,'''') <> ISNULL(inserted.PURCHASE_ORDER_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,2,inserted.id,null,null,deleted.PURCHASE_ORDER_NUMBER,inserted.PURCHASE_ORDER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VENDOR_ID),'''') <> ISNULL(STRING(inserted.VENDOR_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,3,inserted.id,null,null,deleted.VENDOR_ID,inserted.VENDOR_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORDER_GROUP_ID),'''') <> ISNULL(STRING(inserted.ORDER_GROUP_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,4,inserted.id,null,null,deleted.ORDER_GROUP_ID,inserted.ORDER_GROUP_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FACTORY_ORDER_TABLE_ID),'''') <> ISNULL(STRING(inserted.FACTORY_ORDER_TABLE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,5,inserted.id,null,null,deleted.FACTORY_ORDER_TABLE_ID,inserted.FACTORY_ORDER_TABLE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TERMS,'''') <> ISNULL(inserted.TERMS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,6,inserted.id,null,null,deleted.TERMS,inserted.TERMS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SHIPPING_INSTRUCTIONS,'''') <> ISNULL(inserted.SHIPPING_INSTRUCTIONS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,7,inserted.id,null,null,deleted.SHIPPING_INSTRUCTIONS,inserted.SHIPPING_INSTRUCTIONS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UPDATE_ON_ORDER_QTYS,'''') <> ISNULL(inserted.UPDATE_ON_ORDER_QTYS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,8,inserted.id,null,null,deleted.UPDATE_ON_ORDER_QTYS,inserted.UPDATE_ON_ORDER_QTYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATION_DATE),'''') <> ISNULL(STRING(inserted.CREATION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,9,inserted.id,null,null,deleted.CREATION_DATE,inserted.CREATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.CREATED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,10,inserted.id,null,null,deleted.CREATED_BY_EMPLOYEE_ID,inserted.CREATED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CREATED_BY_MULTI_STORE,'''') <> ISNULL(inserted.CREATED_BY_MULTI_STORE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,11,inserted.id,null,null,deleted.CREATED_BY_MULTI_STORE,inserted.CREATED_BY_MULTI_STORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORDER_FROM_LOC),'''') <> ISNULL(STRING(inserted.ORDER_FROM_LOC),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,12,inserted.id,null,null,deleted.ORDER_FROM_LOC,inserted.ORDER_FROM_LOC,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_ORDER_VALUE),'''') <> ISNULL(STRING(inserted.TOTAL_ORDER_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,13,inserted.id,null,null,deleted.TOTAL_ORDER_VALUE,inserted.TOTAL_ORDER_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_DISCOUNT_VALUE),'''') <> ISNULL(STRING(inserted.TOTAL_DISCOUNT_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,14,inserted.id,null,null,deleted.TOTAL_DISCOUNT_VALUE,inserted.TOTAL_DISCOUNT_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LINE_ITEMS_ORDERED),'''') <> ISNULL(STRING(inserted.LINE_ITEMS_ORDERED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,15,inserted.id,null,null,deleted.LINE_ITEMS_ORDERED,inserted.LINE_ITEMS_ORDERED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LINE_ITEMS_RECEIVED),'''') <> ISNULL(STRING(inserted.LINE_ITEMS_RECEIVED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,16,inserted.id,null,null,deleted.LINE_ITEMS_RECEIVED,inserted.LINE_ITEMS_RECEIVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_RECEIPT_VALUE),'''') <> ISNULL(STRING(inserted.TOTAL_RECEIPT_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,17,inserted.id,null,null,deleted.TOTAL_RECEIPT_VALUE,inserted.TOTAL_RECEIPT_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_RECEIPT_DATE),'''') <> ISNULL(STRING(inserted.LAST_RECEIPT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,18,inserted.id,null,null,deleted.LAST_RECEIPT_DATE,inserted.LAST_RECEIPT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.POSTING_COMPLETE_DATE),'''') <> ISNULL(STRING(inserted.POSTING_COMPLETE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,19,inserted.id,null,null,deleted.POSTING_COMPLETE_DATE,inserted.POSTING_COMPLETE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_FACTORY_BACKORDER_HANDLING_CD,'''') <> ISNULL(inserted.REF_FACTORY_BACKORDER_HANDLING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,20,inserted.id,null,null,deleted.REF_FACTORY_BACKORDER_HANDLING_CD,inserted.REF_FACTORY_BACKORDER_HANDLING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RECEIVED_BY_VENDOR_DATE),'''') <> ISNULL(STRING(inserted.RECEIVED_BY_VENDOR_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,21,inserted.id,null,null,deleted.RECEIVED_BY_VENDOR_DATE,inserted.RECEIVED_BY_VENDOR_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ANTICIPATED_SHIP_DATE),'''') <> ISNULL(STRING(inserted.ANTICIPATED_SHIP_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,22,inserted.id,null,null,deleted.ANTICIPATED_SHIP_DATE,inserted.ANTICIPATED_SHIP_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACKNOWLEDGED_TOTAL_ORDER_VALUE),'''') <> ISNULL(STRING(inserted.ACKNOWLEDGED_TOTAL_ORDER_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,23,inserted.id,null,null,deleted.ACKNOWLEDGED_TOTAL_ORDER_VALUE,inserted.ACKNOWLEDGED_TOTAL_ORDER_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACKNOWLEDGED_LINE_ITEMS_ORDERED),'''') <> ISNULL(STRING(inserted.ACKNOWLEDGED_LINE_ITEMS_ORDERED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,24,inserted.id,null,null,deleted.ACKNOWLEDGED_LINE_ITEMS_ORDERED,inserted.ACKNOWLEDGED_LINE_ITEMS_ORDERED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_ORDER_QTY),'''') <> ISNULL(STRING(inserted.TOTAL_ORDER_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,25,inserted.id,null,null,deleted.TOTAL_ORDER_QTY,inserted.TOTAL_ORDER_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_RECEIVED_QTY),'''') <> ISNULL(STRING(inserted.TOTAL_RECEIVED_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,26,inserted.id,null,null,deleted.TOTAL_RECEIVED_QTY,inserted.TOTAL_RECEIVED_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RADS_PO,'''') <> ISNULL(inserted.RADS_PO,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,27,inserted.id,null,null,deleted.RADS_PO,inserted.RADS_PO,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DIRECT_SHIPMENT_ORDER,'''') <> ISNULL(inserted.DIRECT_SHIPMENT_ORDER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,152,28,inserted.id,null,null,deleted.DIRECT_SHIPMENT_ORDER,inserted.DIRECT_SHIPMENT_ORDER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_po_item','PO_ITEM','B','U',1,'create trigger tr_bu_po_item before update on PO_ITEM referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.PO_HEADER_ID),'''') <> ISNULL(STRING(inserted.PO_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,1,inserted.id,null,null,deleted.PO_HEADER_ID,inserted.PO_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,2,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,3,inserted.id,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_RECEIPT_TYPE_CD,'''') <> ISNULL(inserted.REF_RECEIPT_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,4,inserted.id,null,null,deleted.REF_RECEIPT_TYPE_CD,inserted.REF_RECEIPT_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DAMAGED_QTY),'''') <> ISNULL(STRING(inserted.DAMAGED_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,5,inserted.id,null,null,deleted.DAMAGED_QTY,inserted.DAMAGED_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORDER_QTY),'''') <> ISNULL(STRING(inserted.ORDER_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,6,inserted.id,null,null,deleted.ORDER_QTY,inserted.ORDER_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SHIPPED_QTY),'''') <> ISNULL(STRING(inserted.SHIPPED_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,7,inserted.id,null,null,deleted.SHIPPED_QTY,inserted.SHIPPED_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BACKORDERED_QTY),'''') <> ISNULL(STRING(inserted.BACKORDERED_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,8,inserted.id,null,null,deleted.BACKORDERED_QTY,inserted.BACKORDERED_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RECEIVED_QTY),'''') <> ISNULL(STRING(inserted.RECEIVED_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,9,inserted.id,null,null,deleted.RECEIVED_QTY,inserted.RECEIVED_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_COST),'''') <> ISNULL(STRING(inserted.UNIT_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,10,inserted.id,null,null,deleted.UNIT_COST,inserted.UNIT_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_DISCOUNT),'''') <> ISNULL(STRING(inserted.UNIT_DISCOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,11,inserted.id,null,null,deleted.UNIT_DISCOUNT,inserted.UNIT_DISCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNIT_CORE_COST),'''') <> ISNULL(STRING(inserted.UNIT_CORE_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,12,inserted.id,null,null,deleted.UNIT_CORE_COST,inserted.UNIT_CORE_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SHIPPING_CODE_CD,'''') <> ISNULL(inserted.SHIPPING_CODE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,13,inserted.id,null,null,deleted.SHIPPING_CODE_CD,inserted.SHIPPING_CODE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORDER_HANDLING_CD,'''') <> ISNULL(inserted.ORDER_HANDLING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,14,inserted.id,null,null,deleted.ORDER_HANDLING_CD,inserted.ORDER_HANDLING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PO_ITEM_STATUS,'''') <> ISNULL(inserted.PO_ITEM_STATUS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,15,inserted.id,null,null,deleted.PO_ITEM_STATUS,inserted.PO_ITEM_STATUS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PARTIAL_SHIP_FLAG,'''') <> ISNULL(inserted.PARTIAL_SHIP_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,17,inserted.id,null,null,deleted.PARTIAL_SHIP_FLAG,inserted.PARTIAL_SHIP_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BACKORDER_EDIT_FLAG,'''') <> ISNULL(inserted.BACKORDER_EDIT_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,18,inserted.id,null,null,deleted.BACKORDER_EDIT_FLAG,inserted.BACKORDER_EDIT_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTRA_DISCOUNT_FLAG,'''') <> ISNULL(inserted.EXTRA_DISCOUNT_FLAG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,19,inserted.id,null,null,deleted.EXTRA_DISCOUNT_FLAG,inserted.EXTRA_DISCOUNT_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PROMO_CD,'''') <> ISNULL(inserted.PROMO_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,151,20,inserted.id,null,null,deleted.PROMO_CD,inserted.PROMO_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_po_item_store','PO_ITEM_STORE','B','U',1,'create trigger tr_bu_po_item_store before update on PO_ITEM_STORE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if deleted.PO_ITEM_ID <> inserted.PO_ITEM_ID or deleted.ORDER_FOR_STORE_NUMBER <> inserted.ORDER_FOR_STORE_NUMBER or ISNULL(deleted.PURCHASE_ORDER_NUMBER,REPLICATE(''Z'',30)) <> ISNULL(inserted.PURCHASE_ORDER_NUMBER,REPLICATE(''Z'',30)) then if exists(select*from PO_ITEM_STORE where PO_ITEM_ID=inserted.PO_ITEM_ID and ORDER_FOR_STORE_NUMBER=inserted.ORDER_FOR_STORE_NUMBER and ISNULL(PURCHASE_ORDER_NUMBER,REPLICATE(''Z'',30))=ISNULL(inserted.PURCHASE_ORDER_NUMBER,REPLICATE(''Z'',30)) and ID <> inserted.ID) then raiserror 18147 ''tr_bu_po_item_store: Duplicate value for UNIQUE index XAK1PO_ITEM_STORE.'' end if end if;if ISNULL(STRING(deleted.PO_ITEM_ID),'''') <> ISNULL(STRING(inserted.PO_ITEM_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,230,1,inserted.id,null,null,deleted.PO_ITEM_ID,inserted.PO_ITEM_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORDER_QTY),'''') <> ISNULL(STRING(inserted.ORDER_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,230,3,inserted.id,null,null,deleted.ORDER_QTY,inserted.ORDER_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DISTRIBUTED_QTY),'''') <> ISNULL(STRING(inserted.DISTRIBUTED_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,230,4,inserted.id,null,null,deleted.DISTRIBUTED_QTY,inserted.DISTRIBUTED_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORDER_FOR_STORE_NUMBER,'''') <> ISNULL(inserted.ORDER_FOR_STORE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,230,5,inserted.id,null,null,deleted.ORDER_FOR_STORE_NUMBER,inserted.ORDER_FOR_STORE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RECEIVED_QTY),'''') <> ISNULL(STRING(inserted.RECEIVED_QTY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,230,6,inserted.id,null,null,deleted.RECEIVED_QTY,inserted.RECEIVED_QTY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PURCHASE_ORDER_NUMBER,'''') <> ISNULL(inserted.PURCHASE_ORDER_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,230,7,inserted.id,null,null,deleted.PURCHASE_ORDER_NUMBER,inserted.PURCHASE_ORDER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_po_note','PO_NOTE','B','U',1,'create trigger tr_bu_po_note before update on PO_NOTE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.PO_HEADER_ID),'''') <> ISNULL(STRING(inserted.PO_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,686,1,inserted.id,null,null,deleted.PO_HEADER_ID,inserted.PO_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TEXT,'''') <> ISNULL(inserted.TEXT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,686,2,inserted.id,null,null,deleted.TEXT,inserted.TEXT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_MODIFIED_DATE),'''') <> ISNULL(STRING(inserted.LAST_MODIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,686,3,inserted.id,null,null,deleted.LAST_MODIFIED_DATE,inserted.LAST_MODIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MODIFIED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.MODIFIED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,686,4,inserted.id,null,null,deleted.MODIFIED_BY_EMPLOYEE_ID,inserted.MODIFIED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_price_factor','PRICE_FACTOR','B','U',1,'create trigger tr_bu_price_factor before update on PRICE_FACTOR referencing old as deleted new as inserted for each row begin if ISNULL(deleted.LINE_ABBREV,REPLICATE(''Z'',30)) <> ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) or ISNULL(deleted.GROUP_CODE,-1) <> ISNULL(inserted.GROUP_CODE,-1) or ISNULL(deleted.PART_NUMBER_OR_PREFIX,REPLICATE(''Z'',30)) <> ISNULL(inserted.PART_NUMBER_OR_PREFIX,REPLICATE(''Z'',30)) or deleted.PART_OR_PREFIX_FLAG <> inserted.PART_OR_PREFIX_FLAG or deleted.SHEET_CODE <> inserted.SHEET_CODE then if exists(select*from PRICE_FACTOR where ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_NUMBER_OR_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_NUMBER_OR_PREFIX,REPLICATE(''Z'',30)) and PART_OR_PREFIX_FLAG=inserted.PART_OR_PREFIX_FLAG and SHEET_CODE=inserted.SHEET_CODE) then raiserror 18147 ''tr_bu_price_factor: Duplicate value for UNIQUE index XAK1PRICE_FACTOR.'' end if end if end', 'tr_bu_pricing_profile','PRICING_PROFILE','B','U',1,'create trigger tr_bu_pricing_profile before update on PRICING_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,168,1,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USUAL_REF_PRICE_SHEET_CD,'''') <> ISNULL(inserted.USUAL_REF_PRICE_SHEET_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,168,2,inserted.id,null,null,deleted.USUAL_REF_PRICE_SHEET_CD,inserted.USUAL_REF_PRICE_SHEET_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USUAL_PRICE_MARKUP_PERCENT),'''') <> ISNULL(STRING(inserted.USUAL_PRICE_MARKUP_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,168,3,inserted.id,null,null,deleted.USUAL_PRICE_MARKUP_PERCENT,inserted.USUAL_PRICE_MARKUP_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USUAL_PRICE_REF_CURRENCY_ROUNDING_CD,'''') <> ISNULL(inserted.USUAL_PRICE_REF_CURRENCY_ROUNDING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,168,4,inserted.id,null,null,deleted.USUAL_PRICE_REF_CURRENCY_ROUNDING_CD,inserted.USUAL_PRICE_REF_CURRENCY_ROUNDING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_pricing_profile_detail','PRICING_PROFILE_DETAIL','B','U',1,'create trigger tr_bu_pricing_profile_detail before update on PRICING_PROFILE_DETAIL referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.STORE_GROUP_ID),'''') <> ISNULL(STRING(inserted.STORE_GROUP_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,1,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.STORE_GROUP_ID,inserted.STORE_GROUP_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEPARTMENT_ID),'''') <> ISNULL(STRING(inserted.DEPARTMENT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,2,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.DEPARTMENT_ID,inserted.DEPARTMENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SUB_DEPARTMENT_ID),'''') <> ISNULL(STRING(inserted.SUB_DEPARTMENT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,3,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.SUB_DEPARTMENT_ID,inserted.SUB_DEPARTMENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,4,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GROUP_CODE),'''') <> ISNULL(STRING(inserted.GROUP_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,5,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.GROUP_CODE,inserted.GROUP_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_PREFIX,'''') <> ISNULL(inserted.PART_PREFIX,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,6,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.PART_PREFIX,inserted.PART_PREFIX,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_CLASS_CD,'''') <> ISNULL(inserted.REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,7,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.REF_CLASS_CD,inserted.REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STORE_DEPARTMENT_ID),'''') <> ISNULL(STRING(inserted.STORE_DEPARTMENT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,8,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.STORE_DEPARTMENT_ID,inserted.STORE_DEPARTMENT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BEGIN_DATE),'''') <> ISNULL(STRING(inserted.BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,10,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.BEGIN_DATE,inserted.BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_DATE),'''') <> ISNULL(STRING(inserted.END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,11,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.END_DATE,inserted.END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REPORTABLE,'''') <> ISNULL(inserted.REPORTABLE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,9,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.REPORTABLE,inserted.REPORTABLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_PRICE_SHEET_CD,'''') <> ISNULL(inserted.REF_PRICE_SHEET_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,12,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.REF_PRICE_SHEET_CD,inserted.REF_PRICE_SHEET_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MARKUP_PERCENT),'''') <> ISNULL(STRING(inserted.MARKUP_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,13,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.MARKUP_PERCENT,inserted.MARKUP_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_CURRENCY_ROUNDING_CD,'''') <> ISNULL(inserted.REF_CURRENCY_ROUNDING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,14,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.REF_CURRENCY_ROUNDING_CD,inserted.REF_CURRENCY_ROUNDING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,92,16,inserted.id,inserted.pricing_profile_id,inserted.ref_pricing_type_cd,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if deleted.PRICING_PROFILE_ID <> inserted.PRICING_PROFILE_ID or deleted.REF_PRICING_TYPE_CD <> inserted.REF_PRICING_TYPE_CD or ISNULL(deleted.STORE_GROUP_ID,-1) <> ISNULL(inserted.STORE_GROUP_ID,-1) or ISNULL(deleted.DEPARTMENT_ID,-1) <> ISNULL(inserted.DEPARTMENT_ID,-1) or ISNULL(deleted.SUB_DEPARTMENT_ID,-1) <> ISNULL(inserted.SUB_DEPARTMENT_ID,-1) or ISNULL(deleted.LINE_ABBREV,REPLICATE(''Z'',30)) <> ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) or ISNULL(deleted.GROUP_CODE,-1) <> ISNULL(inserted.GROUP_CODE,-1) or ISNULL(deleted.PART_PREFIX,REPLICATE(''Z'',30)) <> ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) or ISNULL(deleted.REF_CLASS_CD,REPLICATE(''Z'',30)) <> ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) or ISNULL(deleted.STORE_DEPARTMENT_ID,-1) <> ISNULL(inserted.STORE_DEPARTMENT_ID,-1) or ISNULL(deleted.BEGIN_DATE,''1799-01-01'') <> ISNULL(inserted.BEGIN_DATE,''1799-01-01'') or ISNULL(deleted.END_DATE,''1799-01-01'') <> ISNULL(inserted.END_DATE,''1799-01-01'') then if inserted.LINE_ABBREV is not null then if exists(select*from PRICING_PROFILE_DETAIL where PRICING_PROFILE_ID=inserted.PRICING_PROFILE_ID and REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and LINE_ABBREV=inserted.LINE_ABBREV and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bu_pricing_profile_detail: Duplicate value for UNIQUE index XAK1PRICING_PROFILE_DETAIL.'' end if else if exists(select*from PRICING_PROFILE_DETAIL where PRICING_PROFILE_ID=inserted.PRICING_PROFILE_ID and REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bu_pricing_profile_detail: Duplicate value for UNIQUE index XAK1PRICING_PROFILE_DETAIL.'' end if end if end if;if inserted.ref_price_sheet_cd is null then raiserror 18001 ''tr_bu_pricing_profile_detail: REF_PRICE_SHEET_CD cannot be NULL.'' end if;if inserted.markup_percent is null then raiserror 18001 ''tr_bu_pricing_profile_detail: MARKUP_PERCENT cannot be NULL.'' end if;if inserted.ref_currency_rounding_cd is null then raiserror 18001 ''tr_bu_pricing_profile_detail: REF_CURRENCY_ROUNDING_CD cannot be NULL.'' end if;if inserted.ref_pricing_type_cd=''R'' and inserted.reportable is null then raiserror 18001 ''tr_bu_pricing_profile_detail: REPORTABLE cannot be NULL.'' end if;if inserted.department_id is null and inserted.sub_department_id is not null then raiserror 18001 ''tr_bu_pricing_profile_detail: SUB_DEPARTMENT cannot exist without DEPARTMENT.'' end if end', 'tr_bu_pricing_profile_fixed_detail','PRICING_PROFILE_FIXED_DETAIL','B','U',1,'create trigger tr_bu_pricing_profile_fixed_detail before update on PRICING_PROFILE_FIXED_DETAIL referencing old as deleted new as inserted for each row begin declare i_return_status integer;if deleted.PRICING_PROFILE_ID <> inserted.PRICING_PROFILE_ID or deleted.LINE_ABBREV <> inserted.LINE_ABBREV or deleted.PART_NUMBER <> inserted.PART_NUMBER or ISNULL(deleted.BEGIN_DATE,''1799-01-01'') <> ISNULL(inserted.BEGIN_DATE,''1799-01-01'') or ISNULL(deleted.END_DATE,''1799-01-01'') <> ISNULL(inserted.END_DATE,''1799-01-01'') then if exists(select*from PRICING_PROFILE_FIXED_DETAIL where PRICING_PROFILE_ID=inserted.PRICING_PROFILE_ID and LINE_ABBREV=inserted.LINE_ABBREV and PART_NUMBER=inserted.PART_NUMBER and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bu_pricing_profile_fixed_detail: Duplicate value for UNIQUE index XAK1PRICING_PROFILE_FIXED_DETAIL.'' end if end if;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,679,1,inserted.id,inserted.pricing_profile_id,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,679,2,inserted.id,inserted.pricing_profile_id,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BEGIN_DATE),'''') <> ISNULL(STRING(inserted.BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,679,3,inserted.id,inserted.pricing_profile_id,null,deleted.BEGIN_DATE,inserted.BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.END_DATE),'''') <> ISNULL(STRING(inserted.END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,679,4,inserted.id,inserted.pricing_profile_id,null,deleted.END_DATE,inserted.END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REPORTABLE,'''') <> ISNULL(inserted.REPORTABLE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,679,5,inserted.id,inserted.pricing_profile_id,null,deleted.REPORTABLE,inserted.REPORTABLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PART_PRICE),'''') <> ISNULL(STRING(inserted.PART_PRICE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,679,6,inserted.id,inserted.pricing_profile_id,null,deleted.PART_PRICE,inserted.PART_PRICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOTE,'''') <> ISNULL(inserted.NOTE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,679,7,inserted.id,inserted.pricing_profile_id,null,deleted.NOTE,inserted.NOTE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_pricing_tracker','PRICING_TRACKER','B','U',1,'create trigger tr_bu_pricing_tracker before update on PRICING_TRACKER referencing old as deleted new as inserted for each row begin set SELF_RECURSION off;if fn_pricing_tracker_in_use(inserted.loc)=''Y'' then if exists(select id from pricing_tracker_communication where pricing_tracker_id=inserted.id and loc=inserted.loc) then update pricing_tracker set update_flag=''Y'' where id=inserted.id and loc=inserted.loc else update pricing_tracker set update_flag=''N'' where id=inserted.id and loc=inserted.loc end if end if end', 'tr_bu_printer','PRINTER','B','U',1,'create trigger tr_bu_printer before update on PRINTER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.PRINTER_NUMBER),'''') <> ISNULL(STRING(inserted.PRINTER_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,1,inserted.id,null,null,deleted.PRINTER_NUMBER,inserted.PRINTER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_PRINTER_MODEL_ID),'''') <> ISNULL(STRING(inserted.REF_PRINTER_MODEL_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,2,inserted.id,null,null,deleted.REF_PRINTER_MODEL_ID,inserted.REF_PRINTER_MODEL_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_DEVICE_CONNECTION_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_DEVICE_CONNECTION_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,3,inserted.id,null,null,deleted.REF_DEVICE_CONNECTION_TYPE_ID,inserted.REF_DEVICE_CONNECTION_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IP_ADDRESS,'''') <> ISNULL(inserted.IP_ADDRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,4,inserted.id,null,null,deleted.IP_ADDRESS,inserted.IP_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PORT_NUMBER),'''') <> ISNULL(STRING(inserted.PORT_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,5,inserted.id,null,null,deleted.PORT_NUMBER,inserted.PORT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BOX_NUMBER),'''') <> ISNULL(STRING(inserted.BOX_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,6,inserted.id,null,null,deleted.BOX_NUMBER,inserted.BOX_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,7,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINTER_INFORMATION,'''') <> ISNULL(inserted.PRINTER_INFORMATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,8,inserted.id,null,null,deleted.PRINTER_INFORMATION,inserted.PRINTER_INFORMATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_INVOICE_FORM_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_INVOICE_FORM_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,9,inserted.id,null,null,deleted.REF_INVOICE_FORM_TYPE_ID,inserted.REF_INVOICE_FORM_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_BARCODE_ON_INVOICE,'''') <> ISNULL(inserted.PRINT_BARCODE_ON_INVOICE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,10,inserted.id,null,null,deleted.PRINT_BARCODE_ON_INVOICE,inserted.PRINT_BARCODE_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_OCR_ON_INVOICE,'''') <> ISNULL(inserted.PRINT_OCR_ON_INVOICE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,11,inserted.id,null,null,deleted.PRINT_OCR_ON_INVOICE,inserted.PRINT_OCR_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DEFAULT_PRINT_ORIENTATION,'''') <> ISNULL(inserted.DEFAULT_PRINT_ORIENTATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,12,inserted.id,null,null,deleted.DEFAULT_PRINT_ORIENTATION,inserted.DEFAULT_PRINT_ORIENTATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DUPLEX_AVAILABLE,'''') <> ISNULL(inserted.DUPLEX_AVAILABLE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,13,inserted.id,null,null,deleted.DUPLEX_AVAILABLE,inserted.DUPLEX_AVAILABLE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DEFAULT_SIMPLEX_OR_DUPLEX,'''') <> ISNULL(inserted.DEFAULT_SIMPLEX_OR_DUPLEX,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,14,inserted.id,null,null,deleted.DEFAULT_SIMPLEX_OR_DUPLEX,inserted.DEFAULT_SIMPLEX_OR_DUPLEX,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINTER_IN_USE_BY,'''') <> ISNULL(inserted.PRINTER_IN_USE_BY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,15,inserted.id,null,null,deleted.PRINTER_IN_USE_BY,inserted.PRINTER_IN_USE_BY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_REPORT_PAPER_SIZE_ID),'''') <> ISNULL(STRING(inserted.REF_REPORT_PAPER_SIZE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,16,inserted.id,null,null,deleted.REF_REPORT_PAPER_SIZE_ID,inserted.REF_REPORT_PAPER_SIZE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEFAULT_REF_REPORT_PAPER_SIZE_ID),'''') <> ISNULL(STRING(inserted.DEFAULT_REF_REPORT_PAPER_SIZE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,17,inserted.id,null,null,deleted.DEFAULT_REF_REPORT_PAPER_SIZE_ID,inserted.DEFAULT_REF_REPORT_PAPER_SIZE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_REPORTS,'''') <> ISNULL(inserted.PRINT_REPORTS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,18,inserted.id,null,null,deleted.PRINT_REPORTS,inserted.PRINT_REPORTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_INVOICES,'''') <> ISNULL(inserted.PRINT_INVOICES,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,19,inserted.id,null,null,deleted.PRINT_INVOICES,inserted.PRINT_INVOICES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_CHECKS,'''') <> ISNULL(inserted.PRINT_CHECKS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,20,inserted.id,null,null,deleted.PRINT_CHECKS,inserted.PRINT_CHECKS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_STATEMENTS,'''') <> ISNULL(inserted.PRINT_STATEMENTS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,21,inserted.id,null,null,deleted.PRINT_STATEMENTS,inserted.PRINT_STATEMENTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_LABELS,'''') <> ISNULL(inserted.PRINT_LABELS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,23,inserted.id,null,null,deleted.PRINT_LABELS,inserted.PRINT_LABELS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_ADDRESS_ON_INVOICE,'''') <> ISNULL(inserted.PRINT_ADDRESS_ON_INVOICE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,24,inserted.id,null,null,deleted.PRINT_ADDRESS_ON_INVOICE,inserted.PRINT_ADDRESS_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_TONER_SAVER,'''') <> ISNULL(inserted.USE_TONER_SAVER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,25,inserted.id,null,null,deleted.USE_TONER_SAVER,inserted.USE_TONER_SAVER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_PRINT_FROM_WINDOWS,'''') <> ISNULL(inserted.ALLOW_PRINT_FROM_WINDOWS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,26,inserted.id,null,null,deleted.ALLOW_PRINT_FROM_WINDOWS,inserted.ALLOW_PRINT_FROM_WINDOWS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_PART_LOCATIONS_ON_INVOICE,'''') <> ISNULL(inserted.PRINT_PART_LOCATIONS_ON_INVOICE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,31,inserted.id,null,null,deleted.PRINT_PART_LOCATIONS_ON_INVOICE,inserted.PRINT_PART_LOCATIONS_ON_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRINT_STORE_COPY_OF_INVOICE,'''') <> ISNULL(inserted.PRINT_STORE_COPY_OF_INVOICE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,318,32,inserted.id,null,null,deleted.PRINT_STORE_COPY_OF_INVOICE,inserted.PRINT_STORE_COPY_OF_INVOICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if ISNULL(deleted.box_number,'''') <> ISNULL(inserted.box_number,'''') or ISNULL(deleted.port_number,'''') <> ISNULL(inserted.port_number,'''') then if(inserted.box_number is null and inserted.port_number is not null) or(inserted.box_number is not null and inserted.port_number is null) then raiserror 18049 ''tr_bu_printer: box_number and port_number must both have values or both be NULL.'' else if inserted.box_number is not null and inserted.port_number is not null then if exists(select*from printer where box_number=inserted.box_number and port_number=inserted.port_number union select*from modem where box_number=inserted.box_number and port_number=inserted.port_number) then raiserror 18049 ''tr_bu_printer: box_number/port_number is not unique.'' end if end if end if end if end', 'tr_bu_pro_rata_warranty','PRO_RATA_WARRANTY','B','U',1,'create trigger tr_bu_pro_rata_warranty before update on PRO_RATA_WARRANTY referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,672,1,inserted.ID,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,672,2,inserted.ID,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PURCHASE_BEGIN_DATE),'''') <> ISNULL(STRING(inserted.PURCHASE_BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,672,3,inserted.ID,null,null,deleted.PURCHASE_BEGIN_DATE,inserted.PURCHASE_BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PURCHASE_END_DATE),'''') <> ISNULL(STRING(inserted.PURCHASE_END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,672,4,inserted.ID,null,null,deleted.PURCHASE_END_DATE,inserted.PURCHASE_END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FREE_REPLACEMENT_MONTHS),'''') <> ISNULL(STRING(inserted.FREE_REPLACEMENT_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,672,5,inserted.ID,null,null,deleted.FREE_REPLACEMENT_MONTHS,inserted.FREE_REPLACEMENT_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAPA_RESERVED,'''') <> ISNULL(inserted.NAPA_RESERVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,672,6,inserted.ID,null,null,deleted.NAPA_RESERVED,inserted.NAPA_RESERVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_product_line','PRODUCT_LINE','B','U',1,'create trigger tr_bu_product_line before update on PRODUCT_LINE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.GROUP_CODE),'''') <> ISNULL(STRING(inserted.GROUP_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,1,inserted.id,null,null,deleted.GROUP_CODE,inserted.GROUP_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,2,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.HQ_LINE_ABBREV,'''') <> ISNULL(inserted.HQ_LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,3,inserted.id,null,null,deleted.HQ_LINE_ABBREV,inserted.HQ_LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PRIMARY_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.PRIMARY_STOCKING_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,4,inserted.id,null,null,deleted.PRIMARY_STOCKING_REF_CLASS_CD,inserted.PRIMARY_STOCKING_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TRACTOR_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.TRACTOR_STOCKING_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,5,inserted.id,null,null,deleted.TRACTOR_STOCKING_REF_CLASS_CD,inserted.TRACTOR_STOCKING_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.HIGH_PERFORMANCE_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.HIGH_PERFORMANCE_STOCKING_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,6,inserted.id,null,null,deleted.HIGH_PERFORMANCE_STOCKING_REF_CLASS_CD,inserted.HIGH_PERFORMANCE_STOCKING_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.OPTIONAL_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.OPTIONAL_STOCKING_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,7,inserted.id,null,null,deleted.OPTIONAL_STOCKING_REF_CLASS_CD,inserted.OPTIONAL_STOCKING_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.MACHINE_SHOP_STOCKING_REF_CLASS_CD,'''') <> ISNULL(inserted.MACHINE_SHOP_STOCKING_REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,8,inserted.id,null,null,deleted.MACHINE_SHOP_STOCKING_REF_CLASS_CD,inserted.MACHINE_SHOP_STOCKING_REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.STOCKING_DEPTH_DAYS),'''') <> ISNULL(STRING(inserted.STOCKING_DEPTH_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,9,inserted.id,null,null,deleted.STOCKING_DEPTH_DAYS,inserted.STOCKING_DEPTH_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REORDER_PERIOD_DAYS),'''') <> ISNULL(STRING(inserted.REORDER_PERIOD_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,10,inserted.id,null,null,deleted.REORDER_PERIOD_DAYS,inserted.REORDER_PERIOD_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.POISSON_SAFETY_PERCENT),'''') <> ISNULL(STRING(inserted.POISSON_SAFETY_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,44,inserted.id,null,null,deleted.POISSON_SAFETY_PERCENT,inserted.POISSON_SAFETY_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RETURN_IN_STD_PKG,'''') <> ISNULL(inserted.RETURN_IN_STD_PKG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,11,inserted.id,null,null,deleted.RETURN_IN_STD_PKG,inserted.RETURN_IN_STD_PKG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CLASS_IN_PROGRESS,'''') <> ISNULL(inserted.CLASS_IN_PROGRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,12,inserted.id,null,null,deleted.CLASS_IN_PROGRESS,inserted.CLASS_IN_PROGRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,13,inserted.id,null,null,deleted.TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,14,inserted.id,null,null,deleted.TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CORE_SALES_TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') <> ISNULL(inserted.CORE_SALES_TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,15,inserted.id,null,null,deleted.CORE_SALES_TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.CORE_SALES_TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CORE_SALES_TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') <> ISNULL(inserted.CORE_SALES_TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,16,inserted.id,null,null,deleted.CORE_SALES_TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.CORE_SALES_TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CORE_RETURNS_TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') <> ISNULL(inserted.CORE_RETURNS_TAX_STATUS_PRIMARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,17,inserted.id,null,null,deleted.CORE_RETURNS_TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.CORE_RETURNS_TAX_STATUS_PRIMARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CORE_RETURNS_TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') <> ISNULL(inserted.CORE_RETURNS_TAX_STATUS_SECONDARY_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,18,inserted.id,null,null,deleted.CORE_RETURNS_TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.CORE_RETURNS_TAX_STATUS_SECONDARY_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ADDITIONAL_STOCKING_MONTHS),'''') <> ISNULL(STRING(inserted.ADDITIONAL_STOCKING_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,19,inserted.id,null,null,deleted.ADDITIONAL_STOCKING_MONTHS,inserted.ADDITIONAL_STOCKING_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_GROUP_STOCKED,'''') <> ISNULL(inserted.LINE_GROUP_STOCKED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,20,inserted.id,null,null,deleted.LINE_GROUP_STOCKED,inserted.LINE_GROUP_STOCKED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_MIN_MAX_FORMULA_ID),'''') <> ISNULL(STRING(inserted.REF_MIN_MAX_FORMULA_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,21,inserted.id,null,null,deleted.REF_MIN_MAX_FORMULA_ID,inserted.REF_MIN_MAX_FORMULA_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.LINE_ADDED_VIA_LNUPDT,'''') <> ISNULL(inserted.LINE_ADDED_VIA_LNUPDT,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,22,inserted.id,null,null,deleted.LINE_ADDED_VIA_LNUPDT,inserted.LINE_ADDED_VIA_LNUPDT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FISCAL_YR_BEGINNING_INVNT),'''') <> ISNULL(STRING(inserted.FISCAL_YR_BEGINNING_INVNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,23,inserted.id,null,null,deleted.FISCAL_YR_BEGINNING_INVNT,inserted.FISCAL_YR_BEGINNING_INVNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.YTD_INVENTORY_INVESTMENT),'''') <> ISNULL(STRING(inserted.YTD_INVENTORY_INVESTMENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,24,inserted.id,null,null,deleted.YTD_INVENTORY_INVESTMENT,inserted.YTD_INVENTORY_INVESTMENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCRUAL_COUNTER),'''') <> ISNULL(STRING(inserted.ACCRUAL_COUNTER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,25,inserted.id,null,null,deleted.ACCRUAL_COUNTER,inserted.ACCRUAL_COUNTER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_PHYSICAL_INVNT_DATE),'''') <> ISNULL(STRING(inserted.LAST_PHYSICAL_INVNT_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,27,inserted.id,null,null,deleted.LAST_PHYSICAL_INVNT_DATE,inserted.LAST_PHYSICAL_INVNT_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_CLASSIFICATION_DATE),'''') <> ISNULL(STRING(inserted.LAST_CLASSIFICATION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,28,inserted.id,null,null,deleted.LAST_CLASSIFICATION_DATE,inserted.LAST_CLASSIFICATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_PRICE_CHANGE_DATE),'''') <> ISNULL(STRING(inserted.LAST_PRICE_CHANGE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,29,inserted.id,null,null,deleted.LAST_PRICE_CHANGE_DATE,inserted.LAST_PRICE_CHANGE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NEXT_PRICE_CHANGE_DATE),'''') <> ISNULL(STRING(inserted.NEXT_PRICE_CHANGE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,30,inserted.id,null,null,deleted.NEXT_PRICE_CHANGE_DATE,inserted.NEXT_PRICE_CHANGE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MINIMUM_GROSS_PROFIT_ALLOWED),'''') <> ISNULL(STRING(inserted.MINIMUM_GROSS_PROFIT_ALLOWED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,31,inserted.id,null,null,deleted.MINIMUM_GROSS_PROFIT_ALLOWED,inserted.MINIMUM_GROSS_PROFIT_ALLOWED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUM_OF_MO_SALES_DEMAND),'''') <> ISNULL(STRING(inserted.NUM_OF_MO_SALES_DEMAND),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,32,inserted.id,null,null,deleted.NUM_OF_MO_SALES_DEMAND,inserted.NUM_OF_MO_SALES_DEMAND,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_LOST_SALES_IN_DEMAND,'''') <> ISNULL(inserted.INCLUDE_LOST_SALES_IN_DEMAND,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,33,inserted.id,null,null,deleted.INCLUDE_LOST_SALES_IN_DEMAND,inserted.INCLUDE_LOST_SALES_IN_DEMAND,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUM_OF_DEMS_REQ_B4_RECOMMEND),'''') <> ISNULL(STRING(inserted.NUM_OF_DEMS_REQ_B4_RECOMMEND),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,34,inserted.id,null,null,deleted.NUM_OF_DEMS_REQ_B4_RECOMMEND,inserted.NUM_OF_DEMS_REQ_B4_RECOMMEND,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COMMISSION_BRACKET_CODE),'''') <> ISNULL(STRING(inserted.COMMISSION_BRACKET_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,35,inserted.id,null,null,deleted.COMMISSION_BRACKET_CODE,inserted.COMMISSION_BRACKET_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_STRICT_PER_CAR_STOCKING,'''') <> ISNULL(inserted.USE_STRICT_PER_CAR_STOCKING,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,36,inserted.id,null,null,deleted.USE_STRICT_PER_CAR_STOCKING,inserted.USE_STRICT_PER_CAR_STOCKING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LANDED_RESALE_PRICE_FACTOR),'''') <> ISNULL(STRING(inserted.LANDED_RESALE_PRICE_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,37,inserted.id,null,null,deleted.LANDED_RESALE_PRICE_FACTOR,inserted.LANDED_RESALE_PRICE_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LANDED_COST_FACTOR),'''') <> ISNULL(STRING(inserted.LANDED_COST_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,38,inserted.id,null,null,deleted.LANDED_COST_FACTOR,inserted.LANDED_COST_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LANDED_CORE_PRICE_FACTOR),'''') <> ISNULL(STRING(inserted.LANDED_CORE_PRICE_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,39,inserted.id,null,null,deleted.LANDED_CORE_PRICE_FACTOR,inserted.LANDED_CORE_PRICE_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LANDED_CORE_COST_FACTOR),'''') <> ISNULL(STRING(inserted.LANDED_CORE_COST_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,40,inserted.id,null,null,deleted.LANDED_CORE_COST_FACTOR,inserted.LANDED_CORE_COST_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.WLC_COST_FACTOR),'''') <> ISNULL(STRING(inserted.WLC_COST_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,41,inserted.id,null,null,deleted.WLC_COST_FACTOR,inserted.WLC_COST_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LOW_COST_VERIFY_PERCENT),'''') <> ISNULL(STRING(inserted.LOW_COST_VERIFY_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,42,inserted.id,null,null,deleted.LOW_COST_VERIFY_PERCENT,inserted.LOW_COST_VERIFY_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.HIGH_COST_VERIFY_PERCENT),'''') <> ISNULL(STRING(inserted.HIGH_COST_VERIFY_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,43,inserted.id,null,null,deleted.HIGH_COST_VERIFY_PERCENT,inserted.HIGH_COST_VERIFY_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AUTO_INVOICE_COSTING_GP_PERCENT),'''') <> ISNULL(STRING(inserted.AUTO_INVOICE_COSTING_GP_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,128,45,inserted.id,null,null,deleted.AUTO_INVOICE_COSTING_GP_PERCENT,inserted.AUTO_INVOICE_COSTING_GP_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_product_line_out_of_class','PRODUCT_LINE_OUT_OF_CLASS','B','U',1,'create trigger tr_bu_product_line_out_of_class before update on PRODUCT_LINE_OUT_OF_CLASS referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.REF_CLASS_CD,'''') <> ISNULL(inserted.REF_CLASS_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,136,1,inserted.ID,null,null,deleted.REF_CLASS_CD,inserted.REF_CLASS_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUM_OF_MO_SALES_DEMAND),'''') <> ISNULL(STRING(inserted.NUM_OF_MO_SALES_DEMAND),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,136,2,inserted.ID,null,null,deleted.NUM_OF_MO_SALES_DEMAND,inserted.NUM_OF_MO_SALES_DEMAND,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.INCLUDE_LOST_SALES_IN_DEMAND,'''') <> ISNULL(inserted.INCLUDE_LOST_SALES_IN_DEMAND,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,136,3,inserted.ID,null,null,deleted.INCLUDE_LOST_SALES_IN_DEMAND,inserted.INCLUDE_LOST_SALES_IN_DEMAND,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUM_OF_DEMS_REQ_B4_RECOMMEND),'''') <> ISNULL(STRING(inserted.NUM_OF_DEMS_REQ_B4_RECOMMEND),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,136,4,inserted.ID,null,null,deleted.NUM_OF_DEMS_REQ_B4_RECOMMEND,inserted.NUM_OF_DEMS_REQ_B4_RECOMMEND,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_product_line_rebate','PRODUCT_LINE_REBATE','B','U',1,'create trigger tr_bu_product_line_rebate before update on PRODUCT_LINE_REBATE referencing old as deleted new as inserted for each row begin if(inserted.rebate_entry_1 is null and inserted.max_gp_entry_1 is not null) or(inserted.rebate_entry_2 is null and inserted.max_gp_entry_2 is not null) or(inserted.rebate_entry_3 is null and inserted.max_gp_entry_3 is not null) then raiserror 18017 ''18017: tr_bu_product_line_rebate: max_gp_entry can not be set when matching rebate_entry is NULL'' end if end', 'tr_bu_product_line_sales','PRODUCT_LINE_SALES','B','U',1,'create trigger tr_bu_product_line_sales before update on PRODUCT_LINE_SALES referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.SALES_DOLLARS),'''') <> ISNULL(STRING(inserted.SALES_DOLLARS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,174,1,inserted.id,null,null,deleted.SALES_DOLLARS,inserted.SALES_DOLLARS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES_COST),'''') <> ISNULL(STRING(inserted.SALES_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,174,2,inserted.id,null,null,deleted.SALES_COST,inserted.SALES_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PURCHASES),'''') <> ISNULL(STRING(inserted.PURCHASES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,174,3,inserted.id,null,null,deleted.PURCHASES,inserted.PURCHASES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PURCHASES_DISCOUNTS),'''') <> ISNULL(STRING(inserted.PURCHASES_DISCOUNTS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,174,4,inserted.id,null,null,deleted.PURCHASES_DISCOUNTS,inserted.PURCHASES_DISCOUNTS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRICE_CHANGE_AMOUNT),'''') <> ISNULL(STRING(inserted.PRICE_CHANGE_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,174,5,inserted.id,null,null,deleted.PRICE_CHANGE_AMOUNT,inserted.PRICE_CHANGE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVENTORY_ADJUSTMENT),'''') <> ISNULL(STRING(inserted.INVENTORY_ADJUSTMENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,174,6,inserted.id,null,null,deleted.INVENTORY_ADJUSTMENT,inserted.INVENTORY_ADJUSTMENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TRANSFERS),'''') <> ISNULL(STRING(inserted.TRANSFERS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,174,7,inserted.id,null,null,deleted.TRANSFERS,inserted.TRANSFERS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ENDING_INVENTORY_BALANCE),'''') <> ISNULL(STRING(inserted.ENDING_INVENTORY_BALANCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,174,8,inserted.id,null,null,deleted.ENDING_INVENTORY_BALANCE,inserted.ENDING_INVENTORY_BALANCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_protobase_prior_authorizations','PROTOBASE_PRIOR_AUTHORIZATION','B','U',1,'create trigger tr_bu_protobase_prior_authorizations before update on PROTOBASE_PRIOR_AUTHORIZATION referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.CARD_NUMBER,'''') <> ISNULL(inserted.CARD_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,613,1,inserted.id,null,null,deleted.CARD_NUMBER,inserted.CARD_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXPIRATION_DATE,'''') <> ISNULL(inserted.EXPIRATION_DATE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,613,2,inserted.id,null,null,deleted.EXPIRATION_DATE,inserted.EXPIRATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AUTHORIZATION_NUMBER,'''') <> ISNULL(inserted.AUTHORIZATION_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,613,3,inserted.id,null,null,deleted.AUTHORIZATION_NUMBER,inserted.AUTHORIZATION_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_NUMBER),'''') <> ISNULL(STRING(inserted.INVOICE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,613,4,inserted.id,null,null,deleted.INVOICE_NUMBER,inserted.INVOICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT),'''') <> ISNULL(STRING(inserted.AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,613,5,inserted.id,null,null,deleted.AMOUNT,inserted.AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STATUS,'''') <> ISNULL(inserted.STATUS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,613,6,inserted.id,null,null,deleted.STATUS,inserted.STATUS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_purchase_card','STORE_PURCHASE_CARD','B','U',1,'create trigger tr_bu_purchase_card before update on STORE_PURCHASE_CARD referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.PURCHASE_CARD_NUMBER,'''') <> ISNULL(inserted.PURCHASE_CARD_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,450,1,inserted.id,null,null,deleted.PURCHASE_CARD_NUMBER,inserted.PURCHASE_CARD_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CARD_EXPIRATION_DATE),'''') <> ISNULL(STRING(inserted.CARD_EXPIRATION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,450,2,inserted.id,null,null,deleted.CARD_EXPIRATION_DATE,inserted.CARD_EXPIRATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CARDHOLDER_NAME,'''') <> ISNULL(inserted.CARDHOLDER_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,450,3,inserted.id,null,null,deleted.CARDHOLDER_NAME,inserted.CARDHOLDER_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ADDED_DATE),'''') <> ISNULL(STRING(inserted.ADDED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,450,4,inserted.id,null,null,deleted.ADDED_DATE,inserted.ADDED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_USED_DATE),'''') <> ISNULL(STRING(inserted.LAST_USED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,450,5,inserted.id,null,null,deleted.LAST_USED_DATE,inserted.LAST_USED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_purge_type_profile','PURGE_TYPE_PROFILE','B','U',1,'create trigger tr_bu_purge_type_profile before update on PURGE_TYPE_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.PURGE_DATA),'''') <> ISNULL(STRING(inserted.PURGE_DATA),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,662,1,inserted.REF_PURGE_TYPE_ID,null,null,deleted.PURGE_DATA,inserted.PURGE_DATA,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_DATA_DURATION),'''') <> ISNULL(STRING(inserted.KEEP_DATA_DURATION),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,662,2,inserted.REF_PURGE_TYPE_ID,null,null,deleted.KEEP_DATA_DURATION,inserted.KEEP_DATA_DURATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_rads_profile','RADS_PROFILE','B','U',1,'create trigger tr_bu_rads_profile before update on RADS_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.RADS_IP_ADDRESS,'''') <> ISNULL(inserted.RADS_IP_ADDRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,670,1,inserted.id,null,null,deleted.RADS_IP_ADDRESS,inserted.RADS_IP_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RADS_PORT_NUMBER),'''') <> ISNULL(STRING(inserted.RADS_PORT_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,670,2,inserted.id,null,null,deleted.RADS_PORT_NUMBER,inserted.RADS_PORT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_ref_file_activity_purge_profile','REF_FILE_ACTIVITY_PURGE_PROFILE','B','U',1,'create trigger tr_bu_ref_file_activity_purge_profile before update on REF_FILE_ACTIVITY_PURGE_PROFILE referencing old as deleted new as inserted for each row begin if ISNULL(deleted.REF_FILE_ACTIVITY_ACTION_CD,REPLICATE(''Z'',30)) <> ISNULL(inserted.REF_FILE_ACTIVITY_ACTION_CD,REPLICATE(''Z'',30)) or ISNULL(deleted.REF_FILE_ACTIVITY_TABLE_NAME_ID,-1) <> ISNULL(inserted.REF_FILE_ACTIVITY_TABLE_NAME_ID,-1) or ISNULL(deleted.REF_FILE_ACTIVITY_COLUMN_NAME_ID,-1) <> ISNULL(inserted.REF_FILE_ACTIVITY_COLUMN_NAME_ID,-1) then if exists(select*from REF_FILE_ACTIVITY_PURGE_PROFILE where ISNULL(REF_FILE_ACTIVITY_ACTION_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_FILE_ACTIVITY_ACTION_CD,REPLICATE(''Z'',30)) and ISNULL(REF_FILE_ACTIVITY_TABLE_NAME_ID,-1)=ISNULL(inserted.REF_FILE_ACTIVITY_TABLE_NAME_ID,-1) and ISNULL(REF_FILE_ACTIVITY_COLUMN_NAME_ID,-1)=ISNULL(inserted.REF_FILE_ACTIVITY_COLUMN_NAME_ID,-1) and ID <> inserted.ID) then raiserror 18147 ''tr_bu_ref_file_activity_purge_profile: Duplicate value for UNIQUE index XAK1REF_FILE_ACTIVITY_PURGE_PROFILE.'' end if end if end', 'tr_bu_ref_store_configuration','REF_STORE_CONFIGURATION','B','U',1,'create trigger tr_bu_ref_store_configuration before update on REF_STORE_CONFIGURATION referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.CONFIG_DESC,'''') <> ISNULL(inserted.CONFIG_DESC,'''') then call sp_log_file_update_activity(1,689,1,inserted.id,null,null,deleted.CONFIG_DESC,inserted.CONFIG_DESC,null,null,null,1) end if;if ISNULL(deleted.CONFIG_TYPE,'''') <> ISNULL(inserted.CONFIG_TYPE,'''') then call sp_log_file_update_activity(1,689,2,inserted.id,null,null,deleted.CONFIG_TYPE,inserted.CONFIG_TYPE,null,null,null,1) end if;if ISNULL(deleted.CONFIG_VALUE,'''') <> ISNULL(inserted.CONFIG_VALUE,'''') then call sp_log_file_update_activity(1,689,3,inserted.id,null,null,deleted.CONFIG_VALUE,inserted.CONFIG_VALUE,null,null,null,1) end if;if ISNULL(STRING(deleted.ACTIVE_FLAG),'''') <> ISNULL(STRING(inserted.ACTIVE_FLAG),'''') then call sp_log_file_update_activity(1,689,4,inserted.id,null,null,deleted.ACTIVE_FLAG,inserted.ACTIVE_FLAG,null,null,null,1) end if;if ISNULL(STRING(deleted.ID),'''') <> ISNULL(STRING(inserted.ID),'''') then call sp_log_file_update_activity(1,689,5,inserted.id,null,null,deleted.ID,inserted.ID,null,null,null,1) end if end', 'tr_bu_remote_system_profile','REMOTE_SYSTEM_PROFILE','B','U',1,'create trigger tr_bu_remote_system_profile before update on REMOTE_SYSTEM_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.LOG_ACTIVITY_AS_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.LOG_ACTIVITY_AS_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(1,678,1,inserted.REF_REMOTE_SYSTEM_ID,null,null,deleted.LOG_ACTIVITY_AS_EMPLOYEE_ID,inserted.LOG_ACTIVITY_AS_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_report_answer','REPORT_ANSWER','B','U',1,'create trigger tr_bu_report_answer before update on REPORT_ANSWER referencing old as deleted new as inserted for each row begin if inserted.answer is null then if inserted.answer_type <> ''S'' then raiserror 18087 ''tr_bu_report_answer: NULL answers must be Single answer_type.'' end if;if inserted.data_type=''B'' then raiserror 18087 ''tr_bu_report_answer: NULL not allowed for Boolean data_type.'' end if end if;if inserted.answer is not null then if inserted.data_type=''N'' and PATINDEX(''%[^0-9.|-]%'',inserted.answer) <> 0 then raiserror 18087 ''tr_bu_report_answer: non-numeric character in numeric answer: '' || inserted.answer end if;if inserted.data_type=''B'' and inserted.answer not in(''Y'',''N'') then raiserror 18087 ''tr_bu_report_answer: Boolean data_type must by Y/N : '' || inserted.answer end if;if inserted.answer_type=''R'' then if CHARINDEX(''|'',inserted.answer)=0 or PATINDEX(''%|%|%'',inserted.answer) <> 0 then raiserror 18087 ''tr_bu_report_answer: Range answer_type must have exactly two elements: '' || inserted.answer end if end if end if end', 'tr_bu_report_criteria','REPORT_CRITERIA','B','U',1,'create trigger tr_bu_report_criteria before update on REPORT_CRITERIA referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.EMPLOYEE_ID,-1) <> ISNULL(inserted.EMPLOYEE_ID,-1) or deleted.REF_REPORT_TIMEFRAME_ID <> inserted.REF_REPORT_TIMEFRAME_ID or deleted.REF_REPORT_ID <> inserted.REF_REPORT_ID then if exists(select*from REPORT_CRITERIA where ISNULL(EMPLOYEE_ID,-1)=ISNULL(inserted.EMPLOYEE_ID,-1) and REF_REPORT_TIMEFRAME_ID=inserted.REF_REPORT_TIMEFRAME_ID and REF_REPORT_ID=inserted.REF_REPORT_ID and ID <> inserted.ID) then raiserror 18147 ''tr_bu_report_criteria: Duplicate value for UNIQUE index XAK1REPORT_CRITERIA.'' end if end if;if ISNULL(STRING(deleted.REF_REPORT_ID),'''') <> ISNULL(STRING(inserted.REF_REPORT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,419,1,inserted.id,null,null,deleted.REF_REPORT_ID,inserted.REF_REPORT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_REPORT_TIMEFRAME_ID),'''') <> ISNULL(STRING(inserted.REF_REPORT_TIMEFRAME_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,419,2,inserted.id,null,null,deleted.REF_REPORT_TIMEFRAME_ID,inserted.REF_REPORT_TIMEFRAME_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,419,3,inserted.id,null,null,deleted.EMPLOYEE_ID,inserted.EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_report_schedule','REPORT_SCHEDULE','B','U',1,'create trigger tr_bu_report_schedule before update on REPORT_SCHEDULE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_REPORT_PAPER_SIZE_ID),'''') <> ISNULL(STRING(inserted.REF_REPORT_PAPER_SIZE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,1,inserted.id,null,null,deleted.REF_REPORT_PAPER_SIZE_ID,inserted.REF_REPORT_PAPER_SIZE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_REPORT_ID),'''') <> ISNULL(STRING(inserted.REF_REPORT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,2,inserted.id,null,null,deleted.REF_REPORT_ID,inserted.REF_REPORT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SCHEDULED_RUN_DATE),'''') <> ISNULL(STRING(inserted.SCHEDULED_RUN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,3,inserted.id,null,null,deleted.SCHEDULED_RUN_DATE,inserted.SCHEDULED_RUN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_REPORT_TIMEFRAME_ID),'''') <> ISNULL(STRING(inserted.REF_REPORT_TIMEFRAME_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,4,inserted.id,null,null,deleted.REF_REPORT_TIMEFRAME_ID,inserted.REF_REPORT_TIMEFRAME_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_DAY_OF_WEEK_ID),'''') <> ISNULL(STRING(inserted.REF_DAY_OF_WEEK_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,12,inserted.id,null,null,deleted.REF_DAY_OF_WEEK_ID,inserted.REF_DAY_OF_WEEK_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,5,inserted.id,null,null,deleted.EMPLOYEE_ID,inserted.EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COPIES),'''') <> ISNULL(STRING(inserted.COPIES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,6,inserted.id,null,null,deleted.COPIES,inserted.COPIES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CREATE_ARCHIVE,'''') <> ISNULL(inserted.CREATE_ARCHIVE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,7,inserted.id,null,null,deleted.CREATE_ARCHIVE,inserted.CREATE_ARCHIVE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RECURRING,'''') <> ISNULL(inserted.RECURRING,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,8,inserted.id,null,null,deleted.RECURRING,inserted.RECURRING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINTER_ID),'''') <> ISNULL(STRING(inserted.PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,9,inserted.id,null,null,deleted.PRINTER_ID,inserted.PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ORIENTATION,'''') <> ISNULL(inserted.ORIENTATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,10,inserted.id,null,null,deleted.ORIENTATION,inserted.ORIENTATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DUPLEX,'''') <> ISNULL(inserted.DUPLEX,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,415,11,inserted.id,null,null,deleted.DUPLEX,inserted.DUPLEX,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_resource_monitor','RESOURCE_MONITOR','B','U',1,'create trigger tr_bu_resource_monitor before update on RESOURCE_MONITOR referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.FINISH_DATE),'''') <> ISNULL(STRING(inserted.FINISH_DATE),'''') then call sp_log_file_update_activity(inserted.LOC,661,7,inserted.ID,null,null,deleted.FINISH_DATE,inserted.FINISH_DATE,null,null,null,1) end if;if inserted.ref_file_activity_program_source_id is null and inserted.description is null then raiserror 18027 ''tr_bu_resource_monitor: must supply a value for either ref_file_activity_program_source_id or description.'' end if;if inserted.ref_file_activity_program_source_id is not null and inserted.description is not null then raiserror 18027 ''tr_bu_resource_monitor: cannot have values for both ref_file_activity_program_source_id and description.'' end if end', 'tr_bu_returned_check','RETURNED_CHECK','B','U',1,'create trigger tr_bu_returned_check before update on RETURNED_CHECK referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.NAME_ON_CHECK,'''') <> ISNULL(inserted.NAME_ON_CHECK,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,367,1,inserted.id,null,null,deleted.NAME_ON_CHECK,inserted.NAME_ON_CHECK,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CHECK_NUMBER,'''') <> ISNULL(inserted.CHECK_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,367,2,inserted.id,null,null,deleted.CHECK_NUMBER,inserted.CHECK_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CHECK_DATE),'''') <> ISNULL(STRING(inserted.CHECK_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,367,3,inserted.id,null,null,deleted.CHECK_DATE,inserted.CHECK_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT),'''') <> ISNULL(STRING(inserted.AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,367,4,inserted.id,null,null,deleted.AMOUNT,inserted.AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CUSTOMER_NUMBER),'''') <> ISNULL(STRING(inserted.CUSTOMER_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,367,5,inserted.id,null,null,deleted.CUSTOMER_NUMBER,inserted.CUSTOMER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_rgn_credit','RGN_CREDIT','B','U',1,'create trigger tr_bu_rgn_credit before update on RGN_CREDIT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.CREDIT_RECEIVED),'''') <> ISNULL(STRING(inserted.CREDIT_RECEIVED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,635,1,inserted.id,null,null,deleted.CREDIT_RECEIVED,inserted.CREDIT_RECEIVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EXPENSE_AMOUNT),'''') <> ISNULL(STRING(inserted.EXPENSE_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,635,2,inserted.id,null,null,deleted.EXPENSE_AMOUNT,inserted.EXPENSE_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CHARGE_BACK),'''') <> ISNULL(STRING(inserted.CHARGE_BACK),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,635,3,inserted.id,null,null,deleted.CHARGE_BACK,inserted.CHARGE_BACK,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_rgn_credit_audit','RGN_CREDIT_AUDIT','B','U',1,'create trigger tr_bu_rgn_credit_audit before update on RGN_CREDIT_AUDIT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,636,1,inserted.id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_CREDIT_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_CREDIT_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,636,2,inserted.id,null,null,deleted.REF_CREDIT_TYPE_ID,inserted.REF_CREDIT_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT_APPLIED),'''') <> ISNULL(STRING(inserted.AMOUNT_APPLIED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,636,3,inserted.id,null,null,deleted.AMOUNT_APPLIED,inserted.AMOUNT_APPLIED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMARKS,'''') <> ISNULL(inserted.REMARKS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,636,4,inserted.id,null,null,deleted.REMARKS,inserted.REMARKS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_rgn_header','RGN_HEADER','B','U',1,'create trigger tr_bu_rgn_header before update on RGN_HEADER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_NUMBER),'''') <> ISNULL(STRING(inserted.RGN_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,624,1,inserted.id,null,null,deleted.RGN_NUMBER,inserted.RGN_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_RGN_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_RGN_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,624,2,inserted.id,null,null,deleted.REF_RGN_TYPE_ID,inserted.REF_RGN_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_RGN_STATUS_ID),'''') <> ISNULL(STRING(inserted.REF_RGN_STATUS_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,624,3,inserted.id,null,null,deleted.REF_RGN_STATUS_ID,inserted.REF_RGN_STATUS_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,624,4,inserted.id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CLASSIFICATION_SESSION_ID),'''') <> ISNULL(STRING(inserted.CLASSIFICATION_SESSION_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,624,5,inserted.id,null,null,deleted.CLASSIFICATION_SESSION_ID,inserted.CLASSIFICATION_SESSION_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_RGN_AMOUNT),'''') <> ISNULL(STRING(inserted.TOTAL_RGN_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,624,6,inserted.id,null,null,deleted.TOTAL_RGN_AMOUNT,inserted.TOTAL_RGN_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CREATION_DATE),'''') <> ISNULL(STRING(inserted.CREATION_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,624,7,inserted.id,null,null,deleted.CREATION_DATE,inserted.CREATION_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CANCELLED_DATE),'''') <> ISNULL(STRING(inserted.CANCELLED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,624,8,inserted.id,null,null,deleted.CANCELLED_DATE,inserted.CANCELLED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CLOSED_DATE),'''') <> ISNULL(STRING(inserted.CLOSED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,624,9,inserted.id,null,null,deleted.CLOSED_DATE,inserted.CLOSED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_rgn_item_from_pool','RGN_ITEM_FROM_POOL','B','U',1,'create trigger tr_bu_rgn_item_from_pool before update on RGN_ITEM_FROM_POOL referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.RGN_HEADER_ID),'''') <> ISNULL(STRING(inserted.RGN_HEADER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,625,1,inserted.rgn_pool_id,null,null,deleted.RGN_HEADER_ID,inserted.RGN_HEADER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_CREDIT_ID),'''') <> ISNULL(STRING(inserted.RGN_CREDIT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,625,2,inserted.rgn_pool_id,null,null,deleted.RGN_CREDIT_ID,inserted.RGN_CREDIT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_QUANTITY),'''') <> ISNULL(STRING(inserted.RETURN_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,625,3,inserted.rgn_pool_id,null,null,deleted.RETURN_QUANTITY,inserted.RETURN_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COUNT_QUANTITY),'''') <> ISNULL(STRING(inserted.COUNT_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,625,4,inserted.rgn_pool_id,null,null,deleted.COUNT_QUANTITY,inserted.COUNT_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VERIFIED_DATE),'''') <> ISNULL(STRING(inserted.VERIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,625,5,inserted.rgn_pool_id,null,null,deleted.VERIFIED_DATE,inserted.VERIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DELINQUENT_REASON,'''') <> ISNULL(inserted.DELINQUENT_REASON,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,625,6,inserted.rgn_pool_id,null,null,deleted.DELINQUENT_REASON,inserted.DELINQUENT_REASON,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_rgn_pool','RGN_POOL','B','U',1,'create trigger tr_bu_rgn_pool before update on RGN_POOL referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_RGN_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_RGN_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,1,inserted.id,null,null,deleted.REF_RGN_TYPE_ID,inserted.REF_RGN_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_LINE_ITEM_INVOICE_ID),'''') <> ISNULL(STRING(inserted.INVOICE_LINE_ITEM_INVOICE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,2,inserted.id,null,null,deleted.INVOICE_LINE_ITEM_INVOICE_ID,inserted.INVOICE_LINE_ITEM_INVOICE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVOICE_LINE_ITEM_SEQUENCE),'''') <> ISNULL(STRING(inserted.INVOICE_LINE_ITEM_SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,3,inserted.id,null,null,deleted.INVOICE_LINE_ITEM_SEQUENCE,inserted.INVOICE_LINE_ITEM_SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SEQUENCE),'''') <> ISNULL(STRING(inserted.SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,4,inserted.id,null,null,deleted.SEQUENCE,inserted.SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INVENTORY_ID),'''') <> ISNULL(STRING(inserted.INVENTORY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,5,inserted.id,null,null,deleted.INVENTORY_ID,inserted.INVENTORY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.CUSTOMER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,6,inserted.id,null,null,deleted.CUSTOMER_ID,inserted.CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.UNIQUE_BARCODE,'''') <> ISNULL(inserted.UNIQUE_BARCODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,7,inserted.id,null,null,deleted.UNIQUE_BARCODE,inserted.UNIQUE_BARCODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORIGINAL_INVOICE_NUMBER),'''') <> ISNULL(STRING(inserted.ORIGINAL_INVOICE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,8,inserted.id,null,null,deleted.ORIGINAL_INVOICE_NUMBER,inserted.ORIGINAL_INVOICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORIGINAL_INVOICE_DATE),'''') <> ISNULL(STRING(inserted.ORIGINAL_INVOICE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,9,inserted.id,null,null,deleted.ORIGINAL_INVOICE_DATE,inserted.ORIGINAL_INVOICE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RETURN_QUANTITY),'''') <> ISNULL(STRING(inserted.RETURN_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,10,inserted.id,null,null,deleted.RETURN_QUANTITY,inserted.RETURN_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COUNT_QUANTITY),'''') <> ISNULL(STRING(inserted.COUNT_QUANTITY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,11,inserted.id,null,null,deleted.COUNT_QUANTITY,inserted.COUNT_QUANTITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VERIFIED_DATE),'''') <> ISNULL(STRING(inserted.VERIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,12,inserted.id,null,null,deleted.VERIFIED_DATE,inserted.VERIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COUNTER_PERSON_NUMBER),'''') <> ISNULL(STRING(inserted.COUNTER_PERSON_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,13,inserted.id,null,null,deleted.COUNTER_PERSON_NUMBER,inserted.COUNTER_PERSON_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_INVOLVED,'''') <> ISNULL(inserted.PART_INVOLVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,14,inserted.id,null,null,deleted.PART_INVOLVED,inserted.PART_INVOLVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.WLC_AUTHORIZATION_NUMBER,'''') <> ISNULL(inserted.WLC_AUTHORIZATION_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,15,inserted.id,null,null,deleted.WLC_AUTHORIZATION_NUMBER,inserted.WLC_AUTHORIZATION_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CLAIM_FORM_NUMBER),'''') <> ISNULL(STRING(inserted.CLAIM_FORM_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,16,inserted.id,null,null,deleted.CLAIM_FORM_NUMBER,inserted.CLAIM_FORM_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LABOR_CLAIM_AMOUNT),'''') <> ISNULL(STRING(inserted.LABOR_CLAIM_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,17,inserted.id,null,null,deleted.LABOR_CLAIM_AMOUNT,inserted.LABOR_CLAIM_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CUSTOMER_RECEIVED_CREDIT_FOR_LABOR,'''') <> ISNULL(inserted.CUSTOMER_RECEIVED_CREDIT_FOR_LABOR,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,18,inserted.id,null,null,deleted.CUSTOMER_RECEIVED_CREDIT_FOR_LABOR,inserted.CUSTOMER_RECEIVED_CREDIT_FOR_LABOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DELINQUENT_REASON,'''') <> ISNULL(inserted.DELINQUENT_REASON,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,19,inserted.id,null,null,deleted.DELINQUENT_REASON,inserted.DELINQUENT_REASON,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REMARKS,'''') <> ISNULL(inserted.REMARKS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,623,20,inserted.id,null,null,deleted.REMARKS,inserted.REMARKS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_rgn_profile','RGN_PROFILE','B','U',1,'create trigger tr_bu_rgn_profile before update on RGN_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.LAST_RGN_NUMBER_USED),'''') <> ISNULL(STRING(inserted.LAST_RGN_NUMBER_USED),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,341,1,null,null,null,deleted.LAST_RGN_NUMBER_USED,inserted.LAST_RGN_NUMBER_USED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRINT_RGN_PART_LABELS_DURING_INVOICING),'''') <> ISNULL(STRING(inserted.PRINT_RGN_PART_LABELS_DURING_INVOICING),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,341,2,null,null,null,deleted.PRINT_RGN_PART_LABELS_DURING_INVOICING,inserted.PRINT_RGN_PART_LABELS_DURING_INVOICING,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_DAILY_RETURNS_AUDIT),'''') <> ISNULL(STRING(inserted.USE_DAILY_RETURNS_AUDIT),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,341,3,null,null,null,deleted.USE_DAILY_RETURNS_AUDIT,inserted.USE_DAILY_RETURNS_AUDIT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VERIFICATION_OF_RGN_POOL_REQUIRED),'''') <> ISNULL(STRING(inserted.VERIFICATION_OF_RGN_POOL_REQUIRED),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,341,4,null,null,null,deleted.VERIFICATION_OF_RGN_POOL_REQUIRED,inserted.VERIFICATION_OF_RGN_POOL_REQUIRED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VERIFICATION_OF_CLASS_RETURN_REQUIRED),'''') <> ISNULL(STRING(inserted.VERIFICATION_OF_CLASS_RETURN_REQUIRED),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,341,5,null,null,null,deleted.VERIFICATION_OF_CLASS_RETURN_REQUIRED,inserted.VERIFICATION_OF_CLASS_RETURN_REQUIRED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_sales_order','SALES_ORDER','B','U',1,'create trigger tr_bu_sales_order before update on SALES_ORDER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.STORE_NUM,'''') <> ISNULL(inserted.STORE_NUM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,1,inserted.id,null,null,deleted.STORE_NUM,inserted.STORE_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORDER_NUMBER),'''') <> ISNULL(STRING(inserted.ORDER_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,2,inserted.id,null,null,deleted.ORDER_NUMBER,inserted.ORDER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTERNAL_ORDER_NUMBER,'''') <> ISNULL(inserted.EXTERNAL_ORDER_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,3,inserted.id,null,null,deleted.EXTERNAL_ORDER_NUMBER,inserted.EXTERNAL_ORDER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CUSTOMER_ID),'''') <> ISNULL(STRING(inserted.CUSTOMER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,4,inserted.id,null,null,deleted.CUSTOMER_ID,inserted.CUSTOMER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_MODIFIED_DATE),'''') <> ISNULL(STRING(inserted.LAST_MODIFIED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,5,inserted.id,null,null,deleted.LAST_MODIFIED_DATE,inserted.LAST_MODIFIED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ORDER_DATE),'''') <> ISNULL(STRING(inserted.ORDER_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,6,inserted.id,null,null,deleted.ORDER_DATE,inserted.ORDER_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTERNAL_CART_IDENTIFIER,'''') <> ISNULL(inserted.EXTERNAL_CART_IDENTIFIER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,7,inserted.id,null,null,deleted.EXTERNAL_CART_IDENTIFIER,inserted.EXTERNAL_CART_IDENTIFIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTERNAL_TRANSACTION_IDENTIFIER,'''') <> ISNULL(inserted.EXTERNAL_TRANSACTION_IDENTIFIER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,8,inserted.id,null,null,deleted.EXTERNAL_TRANSACTION_IDENTIFIER,inserted.EXTERNAL_TRANSACTION_IDENTIFIER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MODIFIED_BY_EMPLOYEE_ID),'''') <> ISNULL(STRING(inserted.MODIFIED_BY_EMPLOYEE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,9,inserted.id,null,null,deleted.MODIFIED_BY_EMPLOYEE_ID,inserted.MODIFIED_BY_EMPLOYEE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_ORDER_SUB_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_ORDER_SUB_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,10,inserted.id,null,null,deleted.REF_ORDER_SUB_TYPE_ID,inserted.REF_ORDER_SUB_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_ORDER_STATUS_ID),'''') <> ISNULL(STRING(inserted.REF_ORDER_STATUS_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,11,inserted.id,null,null,deleted.REF_ORDER_STATUS_ID,inserted.REF_ORDER_STATUS_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CUSTOMER_REWARDS_PHONE_NUMBER,'''') <> ISNULL(inserted.CUSTOMER_REWARDS_PHONE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,12,inserted.id,null,null,deleted.CUSTOMER_REWARDS_PHONE_NUMBER,inserted.CUSTOMER_REWARDS_PHONE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REWARD_DISCOUNT),'''') <> ISNULL(STRING(inserted.REWARD_DISCOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,13,inserted.id,null,null,deleted.REWARD_DISCOUNT,inserted.REWARD_DISCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_TAX),'''') <> ISNULL(STRING(inserted.TOTAL_TAX),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,14,inserted.id,null,null,deleted.TOTAL_TAX,inserted.TOTAL_TAX,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TOTAL_DISCOUNT),'''') <> ISNULL(STRING(inserted.TOTAL_DISCOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,15,inserted.id,null,null,deleted.TOTAL_DISCOUNT,inserted.TOTAL_DISCOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NOL_ORDER_NUMBER,'''') <> ISNULL(inserted.NOL_ORDER_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,16,inserted.id,null,null,deleted.NOL_ORDER_NUMBER,inserted.NOL_ORDER_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ANTICIPATED_DELIVERY_DATE,'''') <> ISNULL(inserted.ANTICIPATED_DELIVERY_DATE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,681,17,inserted.id,null,null,deleted.ANTICIPATED_DELIVERY_DATE,inserted.ANTICIPATED_DELIVERY_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_scanner','SCANNER','B','U',1,'create trigger tr_bu_scanner before update on SCANNER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_SCANNER_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_SCANNER_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,319,1,inserted.id,null,null,deleted.REF_SCANNER_TYPE_ID,inserted.REF_SCANNER_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_DEVICE_CONNECTION_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_DEVICE_CONNECTION_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,319,2,inserted.id,null,null,deleted.REF_DEVICE_CONNECTION_TYPE_ID,inserted.REF_DEVICE_CONNECTION_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IP_ADDRESS,'''') <> ISNULL(inserted.IP_ADDRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,319,3,inserted.id,null,null,deleted.IP_ADDRESS,inserted.IP_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,319,4,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IN_USE,'''') <> ISNULL(inserted.IN_USE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,319,5,inserted.id,null,null,deleted.IN_USE,inserted.IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_shipping_code','SHIPPING_CODE','B','U',1,'create trigger tr_bu_shipping_code before update on SHIPPING_CODE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,163,1,null,null,inserted.CD,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.JOEI_SHIPPING_CD,'''') <> ISNULL(inserted.JOEI_SHIPPING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,163,2,null,null,inserted.CD,deleted.JOEI_SHIPPING_CD,inserted.JOEI_SHIPPING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.NAPA_RESERVED,'''') <> ISNULL(inserted.NAPA_RESERVED,'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,163,3,null,null,inserted.CD,deleted.NAPA_RESERVED,inserted.NAPA_RESERVED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_store_category','STORE_CATEGORY','B','U',1,'create trigger tr_bu_store_category before update on STORE_CATEGORY referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,85,1,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_store_department','STORE_DEPARTMENT','B','U',1,'create trigger tr_bu_store_department before update on STORE_DEPARTMENT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,215,1,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_store_group','STORE_GROUP','B','U',1,'create trigger tr_bu_store_group before update on STORE_GROUP referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.STORE_GROUP_NUM),'''') <> ISNULL(STRING(inserted.STORE_GROUP_NUM),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,185,1,inserted.id,null,null,deleted.STORE_GROUP_NUM,inserted.STORE_GROUP_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,185,2,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_store_profile','STORE_PROFILE','B','U',1,'create trigger tr_bu_store_profile before update on STORE_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.COMPANY_ID),'''') <> ISNULL(STRING(inserted.COMPANY_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,1,inserted.ID,null,null,deleted.COMPANY_ID,inserted.COMPANY_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STORE_NUM,'''') <> ISNULL(inserted.STORE_NUM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,2,inserted.ID,null,null,deleted.STORE_NUM,inserted.STORE_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STORE_NAME,'''') <> ISNULL(inserted.STORE_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,3,inserted.ID,null,null,deleted.STORE_NAME,inserted.STORE_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS1,'''') <> ISNULL(inserted.ADDRESS1,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,4,inserted.ID,null,null,deleted.ADDRESS1,inserted.ADDRESS1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS2,'''') <> ISNULL(inserted.ADDRESS2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,5,inserted.ID,null,null,deleted.ADDRESS2,inserted.ADDRESS2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS3,'''') <> ISNULL(inserted.ADDRESS3,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,6,inserted.ID,null,null,deleted.ADDRESS3,inserted.ADDRESS3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS4,'''') <> ISNULL(inserted.ADDRESS4,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,7,inserted.ID,null,null,deleted.ADDRESS4,inserted.ADDRESS4,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CITY,'''') <> ISNULL(inserted.CITY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,8,inserted.ID,null,null,deleted.CITY,inserted.CITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,9,inserted.ID,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,10,inserted.ID,null,null,deleted.POSTAL_CODE,inserted.POSTAL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.COUNTY_CODE,'''') <> ISNULL(inserted.COUNTY_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,11,inserted.ID,null,null,deleted.COUNTY_CODE,inserted.COUNTY_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,12,inserted.ID,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TELEPHONE_NUM,'''') <> ISNULL(inserted.TELEPHONE_NUM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,13,inserted.ID,null,null,deleted.TELEPHONE_NUM,inserted.TELEPHONE_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FAX_NUM,'''') <> ISNULL(inserted.FAX_NUM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,14,inserted.ID,null,null,deleted.FAX_NUM,inserted.FAX_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STORE_ALIAS,'''') <> ISNULL(inserted.STORE_ALIAS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,15,inserted.ID,null,null,deleted.STORE_ALIAS,inserted.STORE_ALIAS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.STORE_TYPE,'''') <> ISNULL(inserted.STORE_TYPE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,16,inserted.ID,null,null,deleted.STORE_TYPE,inserted.STORE_TYPE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.GPC_OWNED),'''') <> ISNULL(STRING(inserted.GPC_OWNED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,17,inserted.ID,null,null,deleted.GPC_OWNED,inserted.GPC_OWNED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TSU_INSTALL_DATE),'''') <> ISNULL(STRING(inserted.TSU_INSTALL_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,20,inserted.ID,null,null,deleted.TSU_INSTALL_DATE,inserted.TSU_INSTALL_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.UNATTENDED_BACKUP),'''') <> ISNULL(STRING(inserted.UNATTENDED_BACKUP),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,21,inserted.ID,null,null,deleted.UNATTENDED_BACKUP,inserted.UNATTENDED_BACKUP,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUM_BUSINESS_DAYS),'''') <> ISNULL(STRING(inserted.NUM_BUSINESS_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,22,inserted.ID,null,null,deleted.NUM_BUSINESS_DAYS,inserted.NUM_BUSINESS_DAYS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CDINV_FLAG),'''') <> ISNULL(STRING(inserted.CDINV_FLAG),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,23,inserted.ID,null,null,deleted.CDINV_FLAG,inserted.CDINV_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_AVG_COST),'''') <> ISNULL(STRING(inserted.USE_AVG_COST),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,24,inserted.ID,null,null,deleted.USE_AVG_COST,inserted.USE_AVG_COST,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_PROTOBASE),'''') <> ISNULL(STRING(inserted.USE_PROTOBASE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,25,inserted.ID,null,null,deleted.USE_PROTOBASE,inserted.USE_PROTOBASE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURR_ACCT_DAY),'''') <> ISNULL(STRING(inserted.CURR_ACCT_DAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,26,inserted.ID,null,null,deleted.CURR_ACCT_DAY,inserted.CURR_ACCT_DAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENT_SALES_YEAR_MONTH),'''') <> ISNULL(STRING(inserted.CURRENT_SALES_YEAR_MONTH),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,27,inserted.ID,null,null,deleted.CURRENT_SALES_YEAR_MONTH,inserted.CURRENT_SALES_YEAR_MONTH,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENT_QTR),'''') <> ISNULL(STRING(inserted.CURRENT_QTR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,28,inserted.ID,null,null,deleted.CURRENT_QTR,inserted.CURRENT_QTR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ACCT_MTHEND_DAY),'''') <> ISNULL(STRING(inserted.ACCT_MTHEND_DAY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,29,inserted.ID,null,null,deleted.ACCT_MTHEND_DAY,inserted.ACCT_MTHEND_DAY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_MTH_FISCAL_YR),'''') <> ISNULL(STRING(inserted.LAST_MTH_FISCAL_YR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,30,inserted.ID,null,null,deleted.LAST_MTH_FISCAL_YR,inserted.LAST_MTH_FISCAL_YR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NAPA_ACCT_DC_CODE),'''') <> ISNULL(STRING(inserted.NAPA_ACCT_DC_CODE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,31,inserted.ID,null,null,deleted.NAPA_ACCT_DC_CODE,inserted.NAPA_ACCT_DC_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AS400_NETWORK_FLAG),'''') <> ISNULL(STRING(inserted.AS400_NETWORK_FLAG),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,32,inserted.ID,null,null,deleted.AS400_NETWORK_FLAG,inserted.AS400_NETWORK_FLAG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.AS400_HOST_NAME,'''') <> ISNULL(inserted.AS400_HOST_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,33,inserted.ID,null,null,deleted.AS400_HOST_NAME,inserted.AS400_HOST_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.JOBBER_ACCT_IN_USE),'''') <> ISNULL(STRING(inserted.JOBBER_ACCT_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,34,inserted.ID,null,null,deleted.JOBBER_ACCT_IN_USE,inserted.JOBBER_ACCT_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_LANGUAGE_CD,'''') <> ISNULL(inserted.REF_LANGUAGE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,35,inserted.ID,null,null,deleted.REF_LANGUAGE_CD,inserted.REF_LANGUAGE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CATALOG_REVISION_NUM),'''') <> ISNULL(STRING(inserted.CATALOG_REVISION_NUM),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,36,inserted.ID,null,null,deleted.CATALOG_REVISION_NUM,inserted.CATALOG_REVISION_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_MODEM_ERROR_CONTROL_ID),'''') <> ISNULL(STRING(inserted.REF_MODEM_ERROR_CONTROL_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,37,inserted.ID,null,null,deleted.REF_MODEM_ERROR_CONTROL_ID,inserted.REF_MODEM_ERROR_CONTROL_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CATALOG_CD_LOAD_DATE),'''') <> ISNULL(STRING(inserted.CATALOG_CD_LOAD_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,38,inserted.ID,null,null,deleted.CATALOG_CD_LOAD_DATE,inserted.CATALOG_CD_LOAD_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CASH_JOURNAL_IN_USE),'''') <> ISNULL(STRING(inserted.CASH_JOURNAL_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,39,inserted.ID,null,null,deleted.CASH_JOURNAL_IN_USE,inserted.CASH_JOURNAL_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_MILITARY_TIME),'''') <> ISNULL(STRING(inserted.USE_MILITARY_TIME),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,40,inserted.ID,null,null,deleted.USE_MILITARY_TIME,inserted.USE_MILITARY_TIME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DC_STORE),'''') <> ISNULL(STRING(inserted.DC_STORE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,41,inserted.ID,null,null,deleted.DC_STORE,inserted.DC_STORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DC_STORE_HAS_INVENTORY),'''') <> ISNULL(STRING(inserted.DC_STORE_HAS_INVENTORY),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,42,inserted.ID,null,null,deleted.DC_STORE_HAS_INVENTORY,inserted.DC_STORE_HAS_INVENTORY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.NUM_MONTHS_TO_KRONOS),'''') <> ISNULL(STRING(inserted.NUM_MONTHS_TO_KRONOS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,43,inserted.ID,null,null,deleted.NUM_MONTHS_TO_KRONOS,inserted.NUM_MONTHS_TO_KRONOS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.GST_EXEMPT_NUM,'''') <> ISNULL(inserted.GST_EXEMPT_NUM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,44,inserted.ID,null,null,deleted.GST_EXEMPT_NUM,inserted.GST_EXEMPT_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ENVIRONMENTAL_DEROG_NUM,'''') <> ISNULL(inserted.ENVIRONMENTAL_DEROG_NUM,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,45,inserted.ID,null,null,deleted.ENVIRONMENTAL_DEROG_NUM,inserted.ENVIRONMENTAL_DEROG_NUM,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REF_DATE_FORMAT_ID),'''') <> ISNULL(STRING(inserted.REF_DATE_FORMAT_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,46,inserted.ID,null,null,deleted.REF_DATE_FORMAT_ID,inserted.REF_DATE_FORMAT_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DEFAULT_TIMEOUT_MINUTES),'''') <> ISNULL(STRING(inserted.DEFAULT_TIMEOUT_MINUTES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,47,inserted.ID,null,null,deleted.DEFAULT_TIMEOUT_MINUTES,inserted.DEFAULT_TIMEOUT_MINUTES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES_LOGIN_ALLOWED),'''') <> ISNULL(STRING(inserted.SALES_LOGIN_ALLOWED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,48,inserted.ID,null,null,deleted.SALES_LOGIN_ALLOWED,inserted.SALES_LOGIN_ALLOWED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LANDED_RESALE_PRICE_FACTOR),'''') <> ISNULL(STRING(inserted.LANDED_RESALE_PRICE_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,49,inserted.ID,null,null,deleted.LANDED_RESALE_PRICE_FACTOR,inserted.LANDED_RESALE_PRICE_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LANDED_COST_FACTOR),'''') <> ISNULL(STRING(inserted.LANDED_COST_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,50,inserted.ID,null,null,deleted.LANDED_COST_FACTOR,inserted.LANDED_COST_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LANDED_CORE_PRICE_FACTOR),'''') <> ISNULL(STRING(inserted.LANDED_CORE_PRICE_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,51,inserted.ID,null,null,deleted.LANDED_CORE_PRICE_FACTOR,inserted.LANDED_CORE_PRICE_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LANDED_CORE_COST_FACTOR),'''') <> ISNULL(STRING(inserted.LANDED_CORE_COST_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,52,inserted.ID,null,null,deleted.LANDED_CORE_COST_FACTOR,inserted.LANDED_CORE_COST_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENCY_CONVERSION_FACTOR),'''') <> ISNULL(STRING(inserted.CURRENCY_CONVERSION_FACTOR),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,53,inserted.ID,null,null,deleted.CURRENCY_CONVERSION_FACTOR,inserted.CURRENCY_CONVERSION_FACTOR,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CURRENCY_SYMBOL,'''') <> ISNULL(inserted.CURRENCY_SYMBOL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,54,inserted.ID,null,null,deleted.CURRENCY_SYMBOL,inserted.CURRENCY_SYMBOL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CURRENCY_DECIMALS),'''') <> ISNULL(STRING(inserted.CURRENCY_DECIMALS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,55,inserted.ID,null,null,deleted.CURRENCY_DECIMALS,inserted.CURRENCY_DECIMALS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_STORE_SALES_HISTORY_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_STORE_SALES_HISTORY_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,56,inserted.ID,null,null,deleted.KEEP_STORE_SALES_HISTORY_MONTHS,inserted.KEEP_STORE_SALES_HISTORY_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_EMPLOYEE_SALES_HISTORY_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_EMPLOYEE_SALES_HISTORY_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,57,inserted.ID,null,null,deleted.KEEP_EMPLOYEE_SALES_HISTORY_MONTHS,inserted.KEEP_EMPLOYEE_SALES_HISTORY_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_REPORTS_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_REPORTS_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,58,inserted.ID,null,null,deleted.KEEP_REPORTS_MONTHS,inserted.KEEP_REPORTS_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_ALERT_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_ALERT_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,67,inserted.ID,null,null,deleted.KEEP_ALERT_MONTHS,inserted.KEEP_ALERT_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TIME_TRACKING_IN_USE),'''') <> ISNULL(STRING(inserted.TIME_TRACKING_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,60,inserted.ID,null,null,deleted.TIME_TRACKING_IN_USE,inserted.TIME_TRACKING_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BUYOUT_PICKUP_PO_IN_USE),'''') <> ISNULL(STRING(inserted.BUYOUT_PICKUP_PO_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,61,inserted.ID,null,null,deleted.BUYOUT_PICKUP_PO_IN_USE,inserted.BUYOUT_PICKUP_PO_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RGN_IN_USE),'''') <> ISNULL(STRING(inserted.RGN_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,62,inserted.ID,null,null,deleted.RGN_IN_USE,inserted.RGN_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MULTI_STORE_IN_USE),'''') <> ISNULL(STRING(inserted.MULTI_STORE_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,63,inserted.ID,null,null,deleted.MULTI_STORE_IN_USE,inserted.MULTI_STORE_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BACKUP_MEDIA_CODE,'''') <> ISNULL(inserted.BACKUP_MEDIA_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,64,inserted.ID,null,null,deleted.BACKUP_MEDIA_CODE,inserted.BACKUP_MEDIA_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.COPY_CATALOG_INFO_TO_HARDDRIVE),'''') <> ISNULL(STRING(inserted.COPY_CATALOG_INFO_TO_HARDDRIVE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,65,inserted.ID,null,null,deleted.COPY_CATALOG_INFO_TO_HARDDRIVE,inserted.COPY_CATALOG_INFO_TO_HARDDRIVE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.JDE_ADDRESS_BOOK_NUMBER),'''') <> ISNULL(STRING(inserted.JDE_ADDRESS_BOOK_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,66,inserted.ID,null,null,deleted.JDE_ADDRESS_BOOK_NUMBER,inserted.JDE_ADDRESS_BOOK_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SERVING_DC_ON_JDE),'''') <> ISNULL(STRING(inserted.SERVING_DC_ON_JDE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,68,inserted.ID,null,null,deleted.SERVING_DC_ON_JDE,inserted.SERVING_DC_ON_JDE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EJOEI_IN_USE),'''') <> ISNULL(STRING(inserted.EJOEI_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,69,inserted.ID,null,null,deleted.EJOEI_IN_USE,inserted.EJOEI_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.KEEP_RESOURCE_MONITOR_MONTHS),'''') <> ISNULL(STRING(inserted.KEEP_RESOURCE_MONITOR_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,70,inserted.ID,null,null,deleted.KEEP_RESOURCE_MONITOR_MONTHS,inserted.KEEP_RESOURCE_MONITOR_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EMPLOYEE_ACCESS_VALIDATION),'''') <> ISNULL(STRING(inserted.EMPLOYEE_ACCESS_VALIDATION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,71,inserted.ID,null,null,deleted.EMPLOYEE_ACCESS_VALIDATION,inserted.EMPLOYEE_ACCESS_VALIDATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PRICING_TRACKER_IN_USE),'''') <> ISNULL(STRING(inserted.PRICING_TRACKER_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,72,inserted.ID,null,null,deleted.PRICING_TRACKER_IN_USE,inserted.PRICING_TRACKER_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SUPPORT_EMAIL,'''') <> ISNULL(inserted.SUPPORT_EMAIL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,73,inserted.ID,null,null,deleted.SUPPORT_EMAIL,inserted.SUPPORT_EMAIL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PHONE_ROOM_IN_USE),'''') <> ISNULL(STRING(inserted.PHONE_ROOM_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,74,inserted.ID,null,null,deleted.PHONE_ROOM_IN_USE,inserted.PHONE_ROOM_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INDAGO_IN_USE),'''') <> ISNULL(STRING(inserted.INDAGO_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,75,inserted.ID,null,null,deleted.INDAGO_IN_USE,inserted.INDAGO_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.IPC_STORE_NUMBER),'''') <> ISNULL(STRING(inserted.IPC_STORE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,76,inserted.ID,null,null,deleted.IPC_STORE_NUMBER,inserted.IPC_STORE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FEDERAL_TAX_ID,'''') <> ISNULL(inserted.FEDERAL_TAX_ID,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,77,inserted.ID,null,null,deleted.FEDERAL_TAX_ID,inserted.FEDERAL_TAX_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_MULTISTORE_BALANCE,'''') <> ISNULL(inserted.USE_MULTISTORE_BALANCE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,78,inserted.ID,null,null,deleted.USE_MULTISTORE_BALANCE,inserted.USE_MULTISTORE_BALANCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IBS_LOCATION,'''') <> ISNULL(inserted.IBS_LOCATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,79,inserted.ID,null,null,deleted.IBS_LOCATION,inserted.IBS_LOCATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.IBS_PORTAL_IN_USE),'''') <> ISNULL(STRING(inserted.IBS_PORTAL_IN_USE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,80,inserted.ID,null,null,deleted.IBS_PORTAL_IN_USE,inserted.IBS_PORTAL_IN_USE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ITEM_PRICE_INCLUDES_TAX),'''') <> ISNULL(STRING(inserted.ITEM_PRICE_INCLUDES_TAX),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,81,inserted.ID,null,null,deleted.ITEM_PRICE_INCLUDES_TAX,inserted.ITEM_PRICE_INCLUDES_TAX,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ITEM_PRICE_INCLUDES_ENV_CHARGES),'''') <> ISNULL(STRING(inserted.ITEM_PRICE_INCLUDES_ENV_CHARGES),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,82,inserted.ID,null,null,deleted.ITEM_PRICE_INCLUDES_ENV_CHARGES,inserted.ITEM_PRICE_INCLUDES_ENV_CHARGES,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_NAPA_XPRESS),'''') <> ISNULL(STRING(inserted.USE_NAPA_XPRESS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,83,inserted.ID,null,null,deleted.USE_NAPA_XPRESS,inserted.USE_NAPA_XPRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.USE_SITE_RELATIONSHIP_FEED),'''') <> ISNULL(STRING(inserted.USE_SITE_RELATIONSHIP_FEED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,84,inserted.ID,null,null,deleted.USE_SITE_RELATIONSHIP_FEED,inserted.USE_SITE_RELATIONSHIP_FEED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_EMAIL_CUSTOMER,'''') <> ISNULL(inserted.USE_EMAIL_CUSTOMER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,85,inserted.ID,null,null,deleted.USE_EMAIL_CUSTOMER,inserted.USE_EMAIL_CUSTOMER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_BUSINESS_RULES_ENGINE,'''') <> ISNULL(inserted.USE_BUSINESS_RULES_ENGINE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,86,inserted.ID,null,null,deleted.USE_BUSINESS_RULES_ENGINE,inserted.USE_BUSINESS_RULES_ENGINE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.RETAIL_DELIVERY_FEE,'''') <> ISNULL(inserted.RETAIL_DELIVERY_FEE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,87,inserted.ID,null,null,deleted.RETAIL_DELIVERY_FEE,inserted.RETAIL_DELIVERY_FEE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EMAIL_METHOD,'''') <> ISNULL(inserted.EMAIL_METHOD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,88,inserted.ID,null,null,deleted.EMAIL_METHOD,inserted.EMAIL_METHOD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_GIFT_CARD_V2,'''') <> ISNULL(inserted.USE_GIFT_CARD_V2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,89,inserted.ID,null,null,deleted.USE_GIFT_CARD_V2,inserted.USE_GIFT_CARD_V2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.TRANSIN_VALIDATION),'''') <> ISNULL(STRING(inserted.TRANSIN_VALIDATION),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,90,inserted.ID,null,null,deleted.TRANSIN_VALIDATION,inserted.TRANSIN_VALIDATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_BOPIS_LOG,'''') <> ISNULL(inserted.USE_BOPIS_LOG,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,91,inserted.ID,null,null,deleted.USE_BOPIS_LOG,inserted.USE_BOPIS_LOG,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.USE_AZURE_MONITOR_FEED_SERVICE,'''') <> ISNULL(inserted.USE_AZURE_MONITOR_FEED_SERVICE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,92,inserted.ID,null,null,deleted.USE_AZURE_MONITOR_FEED_SERVICE,inserted.USE_AZURE_MONITOR_FEED_SERVICE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SUPPORT_LINK_ENABLED,'''') <> ISNULL(inserted.SUPPORT_LINK_ENABLED,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,93,inserted.ID,null,null,deleted.SUPPORT_LINK_ENABLED,inserted.SUPPORT_LINK_ENABLED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALTROM_LOCATION,'''') <> ISNULL(inserted.ALTROM_LOCATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,94,inserted.ID,null,null,deleted.ALTROM_LOCATION,inserted.ALTROM_LOCATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_LEGACY_GIFT_CARDS_SALE_RELOAD,'''') <> ISNULL(inserted.ALLOW_LEGACY_GIFT_CARDS_SALE_RELOAD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,95,inserted.ID,null,null,deleted.ALLOW_LEGACY_GIFT_CARDS_SALE_RELOAD,inserted.ALLOW_LEGACY_GIFT_CARDS_SALE_RELOAD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.VALIDATE_AAA_CARD_NUMBER,'''') <> ISNULL(inserted.VALIDATE_AAA_CARD_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,96,inserted.ID,null,null,deleted.VALIDATE_AAA_CARD_NUMBER,inserted.VALIDATE_AAA_CARD_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.COUNTY_NAME,'''') <> ISNULL(inserted.COUNTY_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,97,inserted.ID,null,null,deleted.COUNTY_NAME,inserted.COUNTY_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MANAGE_GP_AT_POS),'''') <> ISNULL(STRING(inserted.MANAGE_GP_AT_POS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,98,inserted.ID,null,null,deleted.MANAGE_GP_AT_POS,inserted.MANAGE_GP_AT_POS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SEND_CUSTOMER_DOMAIN,'''') <> ISNULL(inserted.SEND_CUSTOMER_DOMAIN,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,7,99,inserted.ID,null,null,deleted.SEND_CUSTOMER_DOMAIN,inserted.SEND_CUSTOMER_DOMAIN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if MOD((inserted.use_site_relationship_feed),10)=1 then insert into communication_directory_change_queue(id,communication_directory_id,loc,action) values(null,null,inserted.loc,''U'') end if;if ISNULL(STRING(deleted.use_protobase),'''') <> ISNULL(STRING(inserted.use_protobase),'''') and MOD(inserted.use_protobase,10)=1 then if exists(select use_tender_types from invoicing_profile where loc=deleted.loc and use_tender_types <> 11) then raiserror 18012 ''18012: tr_bu_store_profile: USE_PROTOBASE cannot be set when INVOICING_PROFILE.USE_TENDER_TYPES is not set to 11.'' end if;if exists(select print_credit_card_info_on_invoice from invoicing_profile where loc=deleted.loc and print_credit_card_info_on_invoice <> 11) then raiserror 18013 ''18013: tr_bu_store_profile: USE_PROTOBASE cannot be set when INVOICING_PROFILE.PRINT_CREDIT_CARD_INFO_ON_INVOICE is not set to 11.'' end if end if end', 'tr_bu_store_pu_gp','STORE_PU_GP','B','U',1,'create trigger tr_bu_store_pu_gp before update on STORE_PU_GP referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.AMOUNT_BEGIN),'''') <> ISNULL(STRING(inserted.AMOUNT_BEGIN),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,125,1,inserted.id,null,null,deleted.AMOUNT_BEGIN,inserted.AMOUNT_BEGIN,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.AMOUNT_END),'''') <> ISNULL(STRING(inserted.AMOUNT_END),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,125,2,inserted.id,null,null,deleted.AMOUNT_END,inserted.AMOUNT_END,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PERCENT),'''') <> ISNULL(STRING(inserted.PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,125,3,inserted.id,null,null,deleted.PERCENT,inserted.PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_CURRENCY_ROUNDING_CD,'''') <> ISNULL(inserted.REF_CURRENCY_ROUNDING_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,125,4,inserted.id,null,null,deleted.REF_CURRENCY_ROUNDING_CD,inserted.REF_CURRENCY_ROUNDING_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_sub_department','SUB_DEPARTMENT','B','U',1,'create trigger tr_bu_sub_department before update on SUB_DEPARTMENT referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,214,1,inserted.department_id,inserted.id,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_supersede_part','SUPERSEDE_PART','B','U',1,'create trigger tr_bu_supersede_part before update on SUPERSEDE_PART referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_SUPERSEDE_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_SUPERSEDE_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,200,1,inserted.id,inserted.supersede_id,null,deleted.REF_SUPERSEDE_TYPE_ID,inserted.REF_SUPERSEDE_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SUPERSEDING_LINE_ABBREV,'''') <> ISNULL(inserted.SUPERSEDING_LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,200,2,inserted.id,inserted.supersede_id,null,deleted.SUPERSEDING_LINE_ABBREV,inserted.SUPERSEDING_LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SUPERSEDING_PART_NUMBER,'''') <> ISNULL(inserted.SUPERSEDING_PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,200,3,inserted.id,inserted.supersede_id,null,deleted.SUPERSEDING_PART_NUMBER,inserted.SUPERSEDING_PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EFFECTIVE_START_DATE),'''') <> ISNULL(STRING(inserted.EFFECTIVE_START_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,200,4,inserted.id,inserted.supersede_id,null,deleted.EFFECTIVE_START_DATE,inserted.EFFECTIVE_START_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.EFFECTIVE_UNTIL_DATE),'''') <> ISNULL(STRING(inserted.EFFECTIVE_UNTIL_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,200,5,inserted.id,inserted.supersede_id,null,deleted.EFFECTIVE_UNTIL_DATE,inserted.EFFECTIVE_UNTIL_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_supplier','SUPPLIER','B','U',1,'create trigger tr_bu_supplier before update on SUPPLIER referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,281,1,inserted.id,null,null,deleted.NAME,inserted.NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.VENDOR_ID),'''') <> ISNULL(STRING(inserted.VENDOR_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,281,2,inserted.id,null,null,deleted.VENDOR_ID,inserted.VENDOR_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_tax_table','TAX_TABLE','B','U',1,'create trigger tr_bu_tax_table before update on TAX_TABLE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.SECONDARY_TAX_TABLE_ID),'''') <> ISNULL(STRING(inserted.SECONDARY_TAX_TABLE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,1,inserted.id,null,null,deleted.SECONDARY_TAX_TABLE_ID,inserted.SECONDARY_TAX_TABLE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,2,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_TAX_METHOD_CD,'''') <> ISNULL(inserted.REF_TAX_METHOD_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,3,inserted.id,null,null,deleted.REF_TAX_METHOD_CD,inserted.REF_TAX_METHOD_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SALES_TAX_PERCENT),'''') <> ISNULL(STRING(inserted.SALES_TAX_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,4,inserted.id,null,null,deleted.SALES_TAX_PERCENT,inserted.SALES_TAX_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_TAX_AMT_CHARGED),'''') <> ISNULL(STRING(inserted.MAXIMUM_TAX_AMT_CHARGED),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,26,inserted.id,null,null,deleted.MAXIMUM_TAX_AMT_CHARGED,inserted.MAXIMUM_TAX_AMT_CHARGED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_LAB_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_LAB_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,27,inserted.id,null,null,deleted.TAX_LAB_REF_OPTION_CD,inserted.TAX_LAB_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_TEL_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_TEL_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,28,inserted.id,null,null,deleted.TAX_TEL_REF_OPTION_CD,inserted.TAX_TEL_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_FRT_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_FRT_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,29,inserted.id,null,null,deleted.TAX_FRT_REF_OPTION_CD,inserted.TAX_FRT_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_COR_SALES_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_COR_SALES_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,30,inserted.id,null,null,deleted.TAX_COR_SALES_REF_OPTION_CD,inserted.TAX_COR_SALES_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_COR_RETURNS_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_COR_RETURNS_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,31,inserted.id,null,null,deleted.TAX_COR_RETURNS_REF_OPTION_CD,inserted.TAX_COR_RETURNS_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_ENV_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_ENV_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,32,inserted.id,null,null,deleted.TAX_ENV_REF_OPTION_CD,inserted.TAX_ENV_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_OTH_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_OTH_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,33,inserted.id,null,null,deleted.TAX_OTH_REF_OPTION_CD,inserted.TAX_OTH_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_MIS_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_MIS_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,34,inserted.id,null,null,deleted.TAX_MIS_REF_OPTION_CD,inserted.TAX_MIS_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_SERVICE_CHARGES_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_SERVICE_CHARGES_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,35,inserted.id,null,null,deleted.TAX_SERVICE_CHARGES_REF_OPTION_CD,inserted.TAX_SERVICE_CHARGES_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_FEDERAL_EXC_CHG_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_FEDERAL_EXC_CHG_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,36,inserted.id,null,null,deleted.TAX_FEDERAL_EXC_CHG_REF_OPTION_CD,inserted.TAX_FEDERAL_EXC_CHG_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_DEL_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_DEL_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,37,inserted.id,null,null,deleted.TAX_DEL_REF_OPTION_CD,inserted.TAX_DEL_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_WLC_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_WLC_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,38,inserted.id,null,null,deleted.TAX_WLC_REF_OPTION_CD,inserted.TAX_WLC_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_BAG_REF_OPTION_CD,'''') <> ISNULL(inserted.TAX_BAG_REF_OPTION_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,42,inserted.id,null,null,deleted.TAX_BAG_REF_OPTION_CD,inserted.TAX_BAG_REF_OPTION_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MAXIMUM_TAX_BRACKET),'''') <> ISNULL(STRING(inserted.MAXIMUM_TAX_BRACKET),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,39,inserted.id,null,null,deleted.MAXIMUM_TAX_BRACKET,inserted.MAXIMUM_TAX_BRACKET,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TAX_LOYALTY_REDEMPTIONS,'''') <> ISNULL(inserted.TAX_LOYALTY_REDEMPTIONS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,40,inserted.id,null,null,deleted.TAX_LOYALTY_REDEMPTIONS,inserted.TAX_LOYALTY_REDEMPTIONS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REQUIRE_TAX_IDENTIFIER_FOR_TAX_REFUND_ON_CORE,'''') <> ISNULL(inserted.REQUIRE_TAX_IDENTIFIER_FOR_TAX_REFUND_ON_CORE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,89,41,inserted.id,null,null,deleted.REQUIRE_TAX_IDENTIFIER_FOR_TAX_REFUND_ON_CORE,inserted.REQUIRE_TAX_IDENTIFIER_FOR_TAX_REFUND_ON_CORE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if ISNULL(STRING(deleted.MAXIMUM_TAX_BRACKET),'''') <> ISNULL(STRING(inserted.MAXIMUM_TAX_BRACKET),'''') then set inserted.MAXIMUM_TAX_BRACKET=ROUND((select MAX(TAXABLE_SALE_AMOUNT) from TAX_TABLE_BRACKET where TAX_TABLE_ID=deleted.ID and LOC=deleted.LOC),0) end if;if inserted.secondary_tax_table_id is not null then if inserted.secondary_tax_table_id=inserted.id then raiserror 18009 ''SECONDARY_TAX_TABLE_ID cannot point to itself.'' end if;if(select secondary_tax_table_id from tax_table where id=inserted.secondary_tax_table_id and loc=inserted.loc) is not null then raiserror 18009 ''SECONDARY_TAX_TABLE_ID cannot point to a primary tax table.'' end if end if end', 'tr_bu_temp_customer_pricing','TEMP_CUSTOMER_PRICING','B','U',1,'create trigger tr_bu_temp_customer_pricing before update on TEMP_CUSTOMER_PRICING referencing old as deleted new as inserted for each row begin declare i_return_status integer;if deleted.REF_PRICING_TYPE_CD <> inserted.REF_PRICING_TYPE_CD or ISNULL(deleted.STORE_GROUP_ID,-1) <> ISNULL(inserted.STORE_GROUP_ID,-1) or ISNULL(deleted.DEPARTMENT_ID,-1) <> ISNULL(inserted.DEPARTMENT_ID,-1) or ISNULL(deleted.SUB_DEPARTMENT_ID,-1) <> ISNULL(inserted.SUB_DEPARTMENT_ID,-1) or ISNULL(deleted.LINE_ABBREV,REPLICATE(''Z'',30)) <> ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) or ISNULL(deleted.GROUP_CODE,-1) <> ISNULL(inserted.GROUP_CODE,-1) or ISNULL(deleted.PART_PREFIX,REPLICATE(''Z'',30)) <> ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) or ISNULL(deleted.REF_CLASS_CD,REPLICATE(''Z'',30)) <> ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) or ISNULL(deleted.STORE_DEPARTMENT_ID,-1) <> ISNULL(inserted.STORE_DEPARTMENT_ID,-1) or ISNULL(deleted.BEGIN_DATE,''1799-01-01'') <> ISNULL(inserted.BEGIN_DATE,''1799-01-01'') or ISNULL(deleted.END_DATE,''1799-01-01'') <> ISNULL(inserted.END_DATE,''1799-01-01'') then if inserted.REF_PRICING_TYPE_CD=''F'' then if exists(select*from TEMP_CUSTOMER_PRICING where REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and LINE_ABBREV=inserted.LINE_ABBREV and PART_PREFIX=inserted.PART_PREFIX and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bu_temp_customer_pricing: Duplicate value for UNIQUE index XAK1TEMP_CUSTOMER_PRICING.'' end if else if inserted.LINE_ABBREV is not null then if exists(select*from TEMP_CUSTOMER_PRICING where REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and LINE_ABBREV=inserted.LINE_ABBREV and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bu_temp_customer_pricing: Duplicate value for UNIQUE index XAK1TEMP_CUSTOMER_PRICING.'' end if else if exists(select*from TEMP_CUSTOMER_PRICING where REF_PRICING_TYPE_CD=inserted.REF_PRICING_TYPE_CD and ISNULL(STORE_GROUP_ID,-1)=ISNULL(inserted.STORE_GROUP_ID,-1) and ISNULL(DEPARTMENT_ID,-1)=ISNULL(inserted.DEPARTMENT_ID,-1) and ISNULL(SUB_DEPARTMENT_ID,-1)=ISNULL(inserted.SUB_DEPARTMENT_ID,-1) and ISNULL(LINE_ABBREV,REPLICATE(''Z'',30))=ISNULL(inserted.LINE_ABBREV,REPLICATE(''Z'',30)) and ISNULL(GROUP_CODE,-1)=ISNULL(inserted.GROUP_CODE,-1) and ISNULL(PART_PREFIX,REPLICATE(''Z'',30))=ISNULL(inserted.PART_PREFIX,REPLICATE(''Z'',30)) and ISNULL(REF_CLASS_CD,REPLICATE(''Z'',30))=ISNULL(inserted.REF_CLASS_CD,REPLICATE(''Z'',30)) and ISNULL(STORE_DEPARTMENT_ID,-1)=ISNULL(inserted.STORE_DEPARTMENT_ID,-1) and ISNULL(BEGIN_DATE,''1799-01-01'')=ISNULL(inserted.BEGIN_DATE,''1799-01-01'') and ISNULL(END_DATE,''1799-01-01'')=ISNULL(inserted.END_DATE,''1799-01-01'') and ID <> inserted.ID) then raiserror 18147 ''tr_bu_temp_customer_pricing: Duplicate value for UNIQUE index XAK1TEMP_CUSTOMER_PRICING.'' end if end if end if end if;if inserted.ref_pricing_type_cd=''F'' then if inserted.line_abbrev is null then raiserror 18001 ''tr_bu_temp_customer_pricing: Fixed pricing: LINE_ABBREV cannot be NULL.'' end if;if inserted.part_prefix is null then raiserror 18001 ''tr_bu_temp_customer_pricing: Fixed pricing: PART_PREFIX cannot be NULL.'' end if;if inserted.reportable is null then raiserror 18001 ''tr_bu_temp_customer_pricing: Fixed pricing: REPORTABLE cannot be NULL.'' end if;if inserted.part_price is null then raiserror 18001 ''tr_bu_temp_customer_pricing: Fixed pricing: PART_PRICE cannot be NULL.'' end if else if inserted.ref_price_sheet_cd is null then raiserror 18001 ''tr_bu_temp_customer_pricing: REF_PRICE_SHEET_CD cannot be NULL.'' end if;if inserted.markup_percent is null then raiserror 18001 ''tr_bu_temp_customer_pricing: MARKUP_PERCENT cannot be NULL.'' end if;if inserted.ref_currency_rounding_cd is null then raiserror 18001 ''tr_bu_temp_customer_pricing: REF_CURRENCY_ROUNDING_CD cannot be NULL.'' end if;if inserted.ref_pricing_type_cd=''R'' and inserted.reportable is null then raiserror 18001 ''tr_bu_temp_customer_pricing: REPORTABLE cannot be NULL.'' end if end if;if inserted.department_id is null and inserted.sub_department_id is not null then raiserror 18001 ''tr_bu_temp_customer_pricing: SUB_DEPARTMENT cannot exist without DEPARTMENT.'' end if end', 'tr_bu_tender_type_profile','TENDER_TYPE_PROFILE','B','U',1,'create trigger tr_bu_tender_type_profile before update on TENDER_TYPE_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.TENDER_TYPE_ACCEPTED),'''') <> ISNULL(STRING(inserted.TENDER_TYPE_ACCEPTED),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,276,1,inserted.REF_TENDER_TYPE_ID,null,null,deleted.TENDER_TYPE_ACCEPTED,inserted.TENDER_TYPE_ACCEPTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SELL_MIN_VALUE),'''') <> ISNULL(STRING(inserted.SELL_MIN_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,276,3,inserted.REF_TENDER_TYPE_ID,null,null,deleted.SELL_MIN_VALUE,inserted.SELL_MIN_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SELL_MAX_VALUE),'''') <> ISNULL(STRING(inserted.SELL_MAX_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,276,4,inserted.REF_TENDER_TYPE_ID,null,null,deleted.SELL_MAX_VALUE,inserted.SELL_MAX_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RELOAD_MIN_VALUE),'''') <> ISNULL(STRING(inserted.RELOAD_MIN_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,276,5,inserted.REF_TENDER_TYPE_ID,null,null,deleted.RELOAD_MIN_VALUE,inserted.RELOAD_MIN_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.RELOAD_MAX_VALUE),'''') <> ISNULL(STRING(inserted.RELOAD_MAX_VALUE),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,276,6,inserted.REF_TENDER_TYPE_ID,null,null,deleted.RELOAD_MAX_VALUE,inserted.RELOAD_MAX_VALUE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ROA_TENDER_TYPE_ACCEPTED),'''') <> ISNULL(STRING(inserted.ROA_TENDER_TYPE_ACCEPTED),'''') then i_return_status=call sp_log_file_update_activity(inserted.LOC,276,7,inserted.REF_TENDER_TYPE_ID,null,null,deleted.ROA_TENDER_TYPE_ACCEPTED,inserted.ROA_TENDER_TYPE_ACCEPTED,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if;if inserted.ref_tender_type_id <> 2 and inserted.tender_type_accepted not in(0,1,10,11) then raiserror 19003 ''tr_bu_tender_type_profile: tender_type_accepted: '' || inserted.tender_type_accepted || '' value is only allowed for tender_type 2(Check).'' end if end', 'tr_bu_terminal','TERMINAL','B','U',1,'create trigger tr_bu_terminal before update on TERMINAL referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.REF_DEVICE_CONNECTION_TYPE_ID),'''') <> ISNULL(STRING(inserted.REF_DEVICE_CONNECTION_TYPE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,1,inserted.id,null,null,deleted.REF_DEVICE_CONNECTION_TYPE_ID,inserted.REF_DEVICE_CONNECTION_TYPE_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.IP_ADDRESS,'''') <> ISNULL(inserted.IP_ADDRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,2,inserted.id,null,null,deleted.IP_ADDRESS,inserted.IP_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.BOX_NUMBER),'''') <> ISNULL(STRING(inserted.BOX_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,3,inserted.id,null,null,deleted.BOX_NUMBER,inserted.BOX_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PORT_NUMBER),'''') <> ISNULL(STRING(inserted.PORT_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,4,inserted.id,null,null,deleted.PORT_NUMBER,inserted.PORT_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,5,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.TERMINAL_INFORMATION,'''') <> ISNULL(inserted.TERMINAL_INFORMATION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,6,inserted.id,null,null,deleted.TERMINAL_INFORMATION,inserted.TERMINAL_INFORMATION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CASH_INVOICE_PRINTER_ID),'''') <> ISNULL(STRING(inserted.CASH_INVOICE_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,7,inserted.id,null,null,deleted.CASH_INVOICE_PRINTER_ID,inserted.CASH_INVOICE_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REPORT_PRINTER_ID),'''') <> ISNULL(STRING(inserted.REPORT_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,9,inserted.id,null,null,deleted.REPORT_PRINTER_ID,inserted.REPORT_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.WINDOWS_PRINTER_ID),'''') <> ISNULL(STRING(inserted.WINDOWS_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,10,inserted.id,null,null,deleted.WINDOWS_PRINTER_ID,inserted.WINDOWS_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BARCODE_SCANNER,'''') <> ISNULL(inserted.BARCODE_SCANNER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,11,inserted.id,null,null,deleted.BARCODE_SCANNER,inserted.BARCODE_SCANNER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CASH_DRAWER,'''') <> ISNULL(inserted.CASH_DRAWER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,12,inserted.id,null,null,deleted.CASH_DRAWER,inserted.CASH_DRAWER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BEEP_ON_ACCESS_MESSAGE,'''') <> ISNULL(inserted.BEEP_ON_ACCESS_MESSAGE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,13,inserted.id,null,null,deleted.BEEP_ON_ACCESS_MESSAGE,inserted.BEEP_ON_ACCESS_MESSAGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BEEP_ON_INTERSTORE_MESSAGE,'''') <> ISNULL(inserted.BEEP_ON_INTERSTORE_MESSAGE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,14,inserted.id,null,null,deleted.BEEP_ON_INTERSTORE_MESSAGE,inserted.BEEP_ON_INTERSTORE_MESSAGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BEEP_ON_DIV_DC_MESSAGE,'''') <> ISNULL(inserted.BEEP_ON_DIV_DC_MESSAGE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,15,inserted.id,null,null,deleted.BEEP_ON_DIV_DC_MESSAGE,inserted.BEEP_ON_DIV_DC_MESSAGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ALLOW_INTERNET_ACCESS,'''') <> ISNULL(inserted.ALLOW_INTERNET_ACCESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,16,inserted.id,null,null,deleted.ALLOW_INTERNET_ACCESS,inserted.ALLOW_INTERNET_ACCESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ROA_PRINTER_ID),'''') <> ISNULL(STRING(inserted.ROA_PRINTER_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,17,inserted.id,null,null,deleted.ROA_PRINTER_ID,inserted.ROA_PRINTER_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PAYMENT_DEVICE_NUMBER),'''') <> ISNULL(STRING(inserted.PAYMENT_DEVICE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,18,inserted.id,null,null,deleted.PAYMENT_DEVICE_NUMBER,inserted.PAYMENT_DEVICE_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.BEEP_ON_NOL,'''') <> ISNULL(inserted.BEEP_ON_NOL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,19,inserted.id,null,null,deleted.BEEP_ON_NOL,inserted.BEEP_ON_NOL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ENABLE_MANUAL_CREDIT_CARD_ENTRY,'''') <> ISNULL(inserted.ENABLE_MANUAL_CREDIT_CARD_ENTRY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,303,20,inserted.id,null,null,deleted.ENABLE_MANUAL_CREDIT_CARD_ENTRY,inserted.ENABLE_MANUAL_CREDIT_CARD_ENTRY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_time_tracking_profile','TIME_TRACKING_PROFILE','B','U',1,'create trigger tr_bu_time_tracking_profile before update on TIME_TRACKING_PROFILE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.TRANSMIT_TIME_CARD,'''') <> ISNULL(inserted.TRANSMIT_TIME_CARD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,37,1,inserted.id,null,null,deleted.TRANSMIT_TIME_CARD,inserted.TRANSMIT_TIME_CARD,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.AUTO_TIMECLOCK,'''') <> ISNULL(inserted.AUTO_TIMECLOCK,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,37,2,inserted.id,null,null,deleted.AUTO_TIMECLOCK,inserted.AUTO_TIMECLOCK,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.WEEKLY_PAY_PERIOD_PROFILE_ID),'''') <> ISNULL(STRING(inserted.WEEKLY_PAY_PERIOD_PROFILE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,37,3,inserted.id,null,null,deleted.WEEKLY_PAY_PERIOD_PROFILE_ID,inserted.WEEKLY_PAY_PERIOD_PROFILE_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.BIWEEKLY_PAY_PERIOD_PROFILE_ID),'''') <> ISNULL(STRING(inserted.BIWEEKLY_PAY_PERIOD_PROFILE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,37,4,inserted.id,null,null,deleted.BIWEEKLY_PAY_PERIOD_PROFILE_ID,inserted.BIWEEKLY_PAY_PERIOD_PROFILE_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.NUM_YEARS_HISTORY_TO_KEEP),'''') <> ISNULL(STRING(inserted.NUM_YEARS_HISTORY_TO_KEEP),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,37,5,inserted.id,null,null,deleted.NUM_YEARS_HISTORY_TO_KEEP,inserted.NUM_YEARS_HISTORY_TO_KEEP,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(deleted.TIMECLOCK_OVERRIDE_PASSWORD,'''') <> ISNULL(inserted.TIMECLOCK_OVERRIDE_PASSWORD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,37,6,inserted.id,null,null,deleted.TIMECLOCK_OVERRIDE_PASSWORD,inserted.TIMECLOCK_OVERRIDE_PASSWORD,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.STORE_PROFILE_ID),'''') <> ISNULL(STRING(inserted.STORE_PROFILE_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,37,7,inserted.id,null,null,deleted.STORE_PROFILE_ID,inserted.STORE_PROFILE_ID,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.PASSWORD_EXPIRE_DAYS),'''') <> ISNULL(STRING(inserted.PASSWORD_EXPIRE_DAYS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,37,8,inserted.id,null,null,deleted.PASSWORD_EXPIRE_DAYS,inserted.PASSWORD_EXPIRE_DAYS,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if ISNULL(STRING(deleted.CLOCK_MARGIN),'''') <> ISNULL(STRING(inserted.CLOCK_MARGIN),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,37,9,inserted.id,null,null,deleted.CLOCK_MARGIN,inserted.CLOCK_MARGIN,inserted.date_modified,inserted.modified_by_employee_id,deleted.date_modified,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.date_modified=current timestamp end if end', 'tr_bu_tmp_transin_receipts','TMP_TRANSIN_RECEIPTS','B','U',1,'create trigger tr_bu_tmp_transin_receipts before update on TMP_TRANSIN_RECEIPTS referencing old as deleted new as inserted for each row begin if inserted.part_number is not null and inserted.expanded_part_number is not null then if fn_stripped_part_number(inserted.expanded_part_number) <> inserted.part_number then raiserror 18023 ''18023: tr_bu_tmp_transin_receipts: expanded_part_number '' || inserted.expanded_part_number || '' does not match part_number '' || inserted.part_number || ''.'' end if end if end', 'tr_bu_tracking_code','TRACKING_CODE','B','U',1,'create trigger tr_bu_tracking_code before update on TRACKING_CODE referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.REF_TRACKING_TYPE_CD,'''') <> ISNULL(inserted.REF_TRACKING_TYPE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,184,1,inserted.id,null,null,deleted.REF_TRACKING_TYPE_CD,inserted.REF_TRACKING_TYPE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CODE,'''') <> ISNULL(inserted.CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,184,2,inserted.id,null,null,deleted.CODE,inserted.CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.DESCRIPTION,'''') <> ISNULL(inserted.DESCRIPTION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,184,3,inserted.id,null,null,deleted.DESCRIPTION,inserted.DESCRIPTION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_user_defined_field_name','USER_DEFINED_FIELD_NAME','B','U',1,'create trigger tr_bu_user_defined_field_name before update on USER_DEFINED_FIELD_NAME referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.APPLIES_TO_TABLE_CODE,'''') <> ISNULL(inserted.APPLIES_TO_TABLE_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,226,1,inserted.id,null,null,deleted.APPLIES_TO_TABLE_CODE,inserted.APPLIES_TO_TABLE_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.SEQUENCE),'''') <> ISNULL(STRING(inserted.SEQUENCE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,226,2,inserted.id,null,null,deleted.SEQUENCE,inserted.SEQUENCE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FIELD_NAME,'''') <> ISNULL(inserted.FIELD_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,226,3,inserted.id,null,null,deleted.FIELD_NAME,inserted.FIELD_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_vendor','VENDOR','B','U',1,'create trigger tr_bu_vendor before update on VENDOR referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,1,inserted.id,null,null,deleted.NAME,inserted.NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS1,'''') <> ISNULL(inserted.ADDRESS1,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,2,inserted.id,null,null,deleted.ADDRESS1,inserted.ADDRESS1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS2,'''') <> ISNULL(inserted.ADDRESS2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,3,inserted.id,null,null,deleted.ADDRESS2,inserted.ADDRESS2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS3,'''') <> ISNULL(inserted.ADDRESS3,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,4,inserted.id,null,null,deleted.ADDRESS3,inserted.ADDRESS3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS4,'''') <> ISNULL(inserted.ADDRESS4,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,5,inserted.id,null,null,deleted.ADDRESS4,inserted.ADDRESS4,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CITY,'''') <> ISNULL(inserted.CITY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,6,inserted.id,null,null,deleted.CITY,inserted.CITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,7,inserted.id,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,8,inserted.id,null,null,deleted.POSTAL_CODE,inserted.POSTAL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,9,inserted.id,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PHONE,'''') <> ISNULL(inserted.PHONE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,10,inserted.id,null,null,deleted.PHONE,inserted.PHONE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EXTENSION,'''') <> ISNULL(inserted.EXTENSION,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,11,inserted.id,null,null,deleted.EXTENSION,inserted.EXTENSION,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.SPEED_DIAL,'''') <> ISNULL(inserted.SPEED_DIAL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,20,inserted.id,null,null,deleted.SPEED_DIAL,inserted.SPEED_DIAL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FAX_NUMBER,'''') <> ISNULL(inserted.FAX_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,12,inserted.id,null,null,deleted.FAX_NUMBER,inserted.FAX_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.EMAIL,'''') <> ISNULL(inserted.EMAIL,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,13,inserted.id,null,null,deleted.EMAIL,inserted.EMAIL,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.WEB_ADDRESS,'''') <> ISNULL(inserted.WEB_ADDRESS,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,21,inserted.id,null,null,deleted.WEB_ADDRESS,inserted.WEB_ADDRESS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CONTACT_NAME,'''') <> ISNULL(inserted.CONTACT_NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,22,inserted.id,null,null,deleted.CONTACT_NAME,inserted.CONTACT_NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.FEDERAL_ID,'''') <> ISNULL(inserted.FEDERAL_ID,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,23,inserted.id,null,null,deleted.FEDERAL_ID,inserted.FEDERAL_ID,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PO_MESSAGE,'''') <> ISNULL(inserted.PO_MESSAGE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,18,inserted.id,null,null,deleted.PO_MESSAGE,inserted.PO_MESSAGE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.DC_VENDOR_NUMBER),'''') <> ISNULL(STRING(inserted.DC_VENDOR_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,19,inserted.id,null,null,deleted.DC_VENDOR_NUMBER,inserted.DC_VENDOR_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.LAST_USED_DATE),'''') <> ISNULL(STRING(inserted.LAST_USED_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,24,inserted.id,null,null,deleted.LAST_USED_DATE,inserted.LAST_USED_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.INACTIVE_DATE),'''') <> ISNULL(STRING(inserted.INACTIVE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,143,25,inserted.id,null,null,deleted.INACTIVE_DATE,inserted.INACTIVE_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_vendor_alternate_address','VENDOR_ALTERNATE_ADDRESS','B','U',1,'create trigger tr_bu_vendor_alternate_address before update on VENDOR_ALTERNATE_ADDRESS referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.NAME,'''') <> ISNULL(inserted.NAME,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,266,1,inserted.vendor_id,null,null,deleted.NAME,inserted.NAME,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS1,'''') <> ISNULL(inserted.ADDRESS1,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,266,2,inserted.vendor_id,null,null,deleted.ADDRESS1,inserted.ADDRESS1,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS2,'''') <> ISNULL(inserted.ADDRESS2,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,266,3,inserted.vendor_id,null,null,deleted.ADDRESS2,inserted.ADDRESS2,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS3,'''') <> ISNULL(inserted.ADDRESS3,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,266,4,inserted.vendor_id,null,null,deleted.ADDRESS3,inserted.ADDRESS3,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.ADDRESS4,'''') <> ISNULL(inserted.ADDRESS4,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,266,5,inserted.vendor_id,null,null,deleted.ADDRESS4,inserted.ADDRESS4,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.CITY,'''') <> ISNULL(inserted.CITY,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,266,6,inserted.vendor_id,null,null,deleted.CITY,inserted.CITY,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_STATE_CD,'''') <> ISNULL(inserted.REF_STATE_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,266,7,inserted.vendor_id,null,null,deleted.REF_STATE_CD,inserted.REF_STATE_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.POSTAL_CODE,'''') <> ISNULL(inserted.POSTAL_CODE,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,266,8,inserted.vendor_id,null,null,deleted.POSTAL_CODE,inserted.POSTAL_CODE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.REF_COUNTRY_CD,'''') <> ISNULL(inserted.REF_COUNTRY_CD,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,266,9,inserted.vendor_id,null,null,deleted.REF_COUNTRY_CD,inserted.REF_COUNTRY_CD,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_vendor_invoice','DISB_CHECK_INVOICE','B','U',1,'create trigger tr_bu_vendor_invoice before update on DISB_CHECK_INVOICE referencing old as deleted new as inserted for each row begin declare i_return_status integer;declare v_last_modified_date timestamp;declare v_modified_by_employee_id integer;select last_modified_date,modified_by_employee_id into v_last_modified_date,v_modified_by_employee_id from disb_check where id=deleted.disb_check_id and loc=deleted.loc;if ISNULL(STRING(deleted.DISB_CHECK_ID),'''') <> ISNULL(STRING(inserted.DISB_CHECK_ID),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,457,1,inserted.id,null,null,deleted.DISB_CHECK_ID,inserted.DISB_CHECK_ID,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.INVOICE_NUMBER,'''') <> ISNULL(inserted.INVOICE_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,457,2,inserted.id,null,null,deleted.INVOICE_NUMBER,inserted.INVOICE_NUMBER,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(STRING(deleted.AMOUNT),'''') <> ISNULL(STRING(inserted.AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,457,3,inserted.id,null,null,deleted.AMOUNT,inserted.AMOUNT,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(STRING(deleted.INVOICE_DATE),'''') <> ISNULL(STRING(inserted.INVOICE_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,457,4,inserted.id,null,null,deleted.INVOICE_DATE,inserted.INVOICE_DATE,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.DC_IDENTIFIER,'''') <> ISNULL(inserted.DC_IDENTIFIER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,457,5,inserted.id,null,null,deleted.DC_IDENTIFIER,inserted.DC_IDENTIFIER,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(STRING(deleted.STORE_NUMBER),'''') <> ISNULL(STRING(inserted.STORE_NUMBER),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,457,6,inserted.id,null,null,deleted.STORE_NUMBER,inserted.STORE_NUMBER,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if ISNULL(deleted.PO_NUMBER,'''') <> ISNULL(inserted.PO_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,457,7,inserted.id,null,null,deleted.PO_NUMBER,inserted.PO_NUMBER,v_last_modified_date,v_modified_by_employee_id,null,1) end if;if i_return_status=-1 then update disb_check set modified_by_employee_id=null,last_modified_date=current timestamp where id=inserted.disb_check_id and loc=inserted.loc end if end', 'tr_bu_warranty','WARRANTY','B','U',1,'create trigger tr_bu_warranty before update on WARRANTY referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(deleted.LINE_ABBREV,'''') <> ISNULL(inserted.LINE_ABBREV,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,130,1,inserted.id,null,null,deleted.LINE_ABBREV,inserted.LINE_ABBREV,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(deleted.PART_NUMBER,'''') <> ISNULL(inserted.PART_NUMBER,'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,130,2,inserted.id,null,null,deleted.PART_NUMBER,inserted.PART_NUMBER,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PURCHASE_BEGIN_DATE),'''') <> ISNULL(STRING(inserted.PURCHASE_BEGIN_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,130,3,inserted.id,null,null,deleted.PURCHASE_BEGIN_DATE,inserted.PURCHASE_BEGIN_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PURCHASE_END_DATE),'''') <> ISNULL(STRING(inserted.PURCHASE_END_DATE),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,130,4,inserted.id,null,null,deleted.PURCHASE_END_DATE,inserted.PURCHASE_END_DATE,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.FREE_REPLACEMENT_MONTHS),'''') <> ISNULL(STRING(inserted.FREE_REPLACEMENT_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,130,5,inserted.id,null,null,deleted.FREE_REPLACEMENT_MONTHS,inserted.FREE_REPLACEMENT_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.ADJUSTMENT_MONTHS),'''') <> ISNULL(STRING(inserted.ADJUSTMENT_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,130,6,inserted.id,null,null,deleted.ADJUSTMENT_MONTHS,inserted.ADJUSTMENT_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.CONSUMER_ADJUSTMENT_AMOUNT),'''') <> ISNULL(STRING(inserted.CONSUMER_ADJUSTMENT_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,130,7,inserted.id,null,null,deleted.CONSUMER_ADJUSTMENT_AMOUNT,inserted.CONSUMER_ADJUSTMENT_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.PREFERRED_CONS_ADJ_AMOUNT),'''') <> ISNULL(STRING(inserted.PREFERRED_CONS_ADJ_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,130,8,inserted.id,null,null,deleted.PREFERRED_CONS_ADJ_AMOUNT,inserted.PREFERRED_CONS_ADJ_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.MI_ADJUSTMENT_AMOUNT),'''') <> ISNULL(STRING(inserted.MI_ADJUSTMENT_AMOUNT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,130,9,inserted.id,null,null,deleted.MI_ADJUSTMENT_AMOUNT,inserted.MI_ADJUSTMENT_AMOUNT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end', 'tr_bu_warranty_period','WARRANTY_PERIOD','B','U',1,'create trigger tr_bu_warranty_period before update on WARRANTY_PERIOD referencing old as deleted new as inserted for each row begin declare i_return_status integer;if ISNULL(STRING(deleted.PERIOD_MONTHS),'''') <> ISNULL(STRING(inserted.PERIOD_MONTHS),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,673,1,inserted.pro_rata_warranty_id,null,null,deleted.PERIOD_MONTHS,inserted.PERIOD_MONTHS,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if ISNULL(STRING(deleted.REFUND_PERCENT),'''') <> ISNULL(STRING(inserted.REFUND_PERCENT),'''') then i_return_status=call sp_log_file_update_activity(inserted.loc,673,2,inserted.pro_rata_warranty_id,null,null,deleted.REFUND_PERCENT,inserted.REFUND_PERCENT,inserted.last_modified_date,inserted.modified_by_employee_id,deleted.last_modified_date,1) end if;if i_return_status=-1 then set inserted.modified_by_employee_id=null;set inserted.last_modified_date=current timestamp end if end',