SchamInfo -> Rose Model
[kivitendo-erp.git] / SL / DB / Helpers / Mappings.pm
1 package SL::DB::Helpers::Mappings;
2
3 use strict;
4
5 # these will not be managed as Rose::DB models, because they are not normalized
6 # significant changes are needed to get them done.
7 my @lxoffice_blacklist_permanent = qw(
8   acc_trans audittrail customertax datev defaults department dpt_trans
9   exchangerate finanzamt follow_up_access gifi inventory leads licenseinvoice
10   makemodel partsgroup partstax prices record_links rmaitems status tax_zones
11   todo_user_config translation translation_payment_terms units_language
12   vendortax);
13
14 # these are not managed _yet_, but will hopefully at some point.
15 # if you are confident that one of these works, remove it here.
16 my @lxoffice_blacklist_temp = qw(
17 );
18
19 my @lxoffice_blacklist = (@lxoffice_blacklist_permanent, @lxoffice_blacklist_temp);
20
21 # map table names to their models.
22 # unlike rails we have no singular<->plural magic.
23 # remeber: tables should be named as the plural of the model name.
24 my %lxoffice_package_names = (
25   ar                             => 'invoice',
26   ap                             => 'purchase_invoice',
27   bank_accounts                  => 'bank_account',
28   buchungsgruppen                => 'buchungsgruppe',
29   contacts                       => 'contact',
30   custom_variable_configs        => 'custom_variable_config',
31   custom_variables               => 'custom_variable',
32   custom_variables_validity      => 'custom_variable_validity',
33   delivery_orders                => 'delivery_order',
34   delivery_order_items           => 'delivery_order_item',
35   drafts                         => 'draft',
36   dunning                        => 'dunning',
37   dunning_config                 => 'dunning_config',
38   employee                       => 'employee',
39   follow_up_links                => 'follow_up_link',
40   follow_ups                     => 'follow_up',
41   generic_translations           => 'generic_translation',
42   gl                             => 'GLTransaction',
43   history_erp                    => 'history',
44   invoice                        => 'invoice_item',
45   language                       => 'language',
46   license                        => 'licemse',
47   notes                          => 'note',
48   orderitems                     => 'order_item',
49   oe                             => 'order',
50   parts                          => 'part',
51   payment_terms                  => 'payment_term',
52   price_factors                  => 'price_factor',
53   pricegroup                     => 'pricegroup',
54   printers                       => 'Printer',
55   rma                            => 'RMA',
56   sepa_export                    => 'sepa_export',
57   sepa_export_items              => 'sepa_export_item',
58   schema_info                    => 'schema_info',
59   tax                            => 'tax',
60   taxkeys                        => 'taxkey',
61   units                          => 'unit',
62 );
63
64 sub get_blacklist {
65   return LXOFFICE => \@lxoffice_blacklist;
66 }
67
68 sub get_package_names {
69   return LXOFFICE => \%lxoffice_package_names;
70 }
71
72 1;
73
74 __END__
75
76 =head1 NAME
77
78 SL::DB::Helpers::Mappings - Rose Table <-> Model mapping information
79
80 =head1 SYNOPSIS
81
82   use SL::DB::Helpers::Mappings qw(@blacklist %table2model);
83
84 =head1 DESCRIPTION
85
86 This modul stores table <-> model mappings used by the
87 L<scripts/rose_auto_create_model.pl> script.  If you add a new table that has
88 custom mappings, add it here.
89
90 =head1 BUGS
91
92 nothing yet
93
94 =head1 SEE ALSO
95
96 L<scripts/rose_auto_create_model.pl>
97
98 =head1 AUTHOR
99
100 Sven Schöling <s.schoeling@linet-services.de>
101
102 =cut