|
package SL::DB::Helper::Mappings;
|
|
|
|
use utf8;
|
|
use strict;
|
|
|
|
use SL::Util qw(camelify);
|
|
|
|
require Exporter;
|
|
our @ISA = qw(Exporter);
|
|
our @EXPORT_OK = qw(get_table_for_package get_package_for_table get_package_names);
|
|
|
|
# these will not be managed as Rose::DB models, because they are not normalized,
|
|
# significant changes are needed to get them done, or they were done by CRM.
|
|
my @kivitendo_blacklist_permanent = qw(
|
|
leads
|
|
);
|
|
|
|
# these are not managed _yet_, but will hopefully at some point.
|
|
# if you are confident that one of these works, remove it here.
|
|
my @kivitendo_blacklist_temp = qw(
|
|
);
|
|
|
|
# tables created by crm module
|
|
my @crm_blacklist = qw(
|
|
blz_data
|
|
bundesland
|
|
contmasch
|
|
contract
|
|
crm
|
|
crmdefaults
|
|
crmemployee
|
|
custmsg
|
|
docfelder
|
|
documents
|
|
documenttotc
|
|
docvorlage
|
|
extra_felder
|
|
geodb_changelog
|
|
geodb_coordinates
|
|
geodb_floatdata
|
|
geodb_hierarchies
|
|
geodb_intdata
|
|
geodb_locations
|
|
geodb_textdata
|
|
geodb_type_names
|
|
grpusr
|
|
gruppenname
|
|
history
|
|
labels
|
|
labeltxt
|
|
mailvorlage
|
|
maschine
|
|
maschmat
|
|
opport_status
|
|
opportunity
|
|
postit
|
|
repauftrag
|
|
telcall
|
|
telcallhistory
|
|
telnr
|
|
tempcsvdata
|
|
termdate
|
|
termincat
|
|
termine
|
|
terminmember
|
|
timetrack
|
|
tt_event
|
|
tt_parts
|
|
wiedervorlage
|
|
wissencategorie
|
|
wissencontent
|
|
);
|
|
|
|
# tables created by cash register
|
|
my @cash_register_blacklist = qw(
|
|
ekartikel ekbon ekkunde ektext erptasten
|
|
);
|
|
|
|
my @kivitendo_blacklist = (@kivitendo_blacklist_permanent, @kivitendo_blacklist_temp, @crm_blacklist, @cash_register_blacklist);
|
|
|
|
# map table names to their models.
|
|
# unlike rails we have no singular<->plural magic.
|
|
# remeber: tables should be named as the plural of the model name.
|
|
my %kivitendo_package_names = (
|
|
# TABLE # MODEL (given in C style)
|
|
acc_trans => 'acc_transaction',
|
|
additional_billing_addresses => 'additional_billing_address',
|
|
'auth.clients' => 'auth_client',
|
|
'auth.clients_users' => 'auth_client_user',
|
|
'auth.clients_groups' => 'auth_client_group',
|
|
'auth.group' => 'auth_group',
|
|
'auth.group_rights' => 'auth_group_right',
|
|
'auth.master_rights' => 'auth_master_right',
|
|
'auth.schema_info' => 'auth_schema_info',
|
|
'auth.session' => 'auth_session',
|
|
'auth.session_content' => 'auth_session_content',
|
|
'auth.user' => 'auth_user',
|
|
'auth.user_config' => 'auth_user_config',
|
|
'auth.user_group' => 'auth_user_group',
|
|
ar => 'invoice',
|
|
ap => 'purchase_invoice',
|
|
ap_gl => 'ap_gl',
|
|
assembly => 'assembly',
|
|
assortment_items => 'assortment_item',
|
|
background_jobs => 'background_job',
|
|
background_job_histories => 'background_job_history',
|
|
ap => 'purchase_invoice',
|
|
bank_accounts => 'bank_account',
|
|
bank_transactions => 'bank_transaction',
|
|
bank_transaction_acc_trans => 'bank_transaction_acc_trans',
|
|
buchungsgruppen => 'buchungsgruppe',
|
|
bin => 'bin',
|
|
business => 'business',
|
|
chart => 'chart',
|
|
contact_departments => 'contact_department',
|
|
contact_titles => 'contact_title',
|
|
contacts => 'contact',
|
|
customer => 'customer',
|
|
csv_import_profiles => 'csv_import_profile',
|
|
csv_import_profile_settings => 'csv_import_profile_setting',
|
|
csv_import_reports => 'csv_import_report',
|
|
csv_import_report_rows => 'csv_import_report_row',
|
|
csv_import_report_status => 'csv_import_report_status',
|
|
currencies => 'currency',
|
|
custom_data_export_queries => 'CustomDataExportQuery',
|
|
custom_data_export_query_parameters => 'CustomDataExportQueryParameter',
|
|
custom_variable_config_partsgroups => 'custom_variable_config_partsgroup',
|
|
custom_variable_configs => 'custom_variable_config',
|
|
custom_variables => 'custom_variable',
|
|
custom_variables_validity => 'custom_variable_validity',
|
|
datev => 'datev',
|
|
defaults => 'default',
|
|
delivery_orders => 'delivery_order',
|
|
delivery_order_items => 'delivery_order_item',
|
|
delivery_order_items_stock => 'delivery_order_items_stock',
|
|
delivery_terms => 'delivery_term',
|
|
department => 'department',
|
|
drafts => 'draft',
|
|
dunning => 'dunning',
|
|
dunning_config => 'dunning_config',
|
|
email_journal => 'EmailJournal',
|
|
email_journal_attachments => 'EmailJournalAttachment',
|
|
employee => 'employee',
|
|
employee_project_invoices => 'EmployeeProjectInvoices',
|
|
exchangerate => 'exchangerate',
|
|
files => 'file',
|
|
finanzamt => 'finanzamt',
|
|
follow_up_access |