RDBO Support.
[kivitendo-erp.git] / SL / DB / Helpers / Mappings.pm
1 package SL::DB::Helpers::Mappings;
2
3 use strict;
4
5 # threse 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   bank_accounts buchungsgruppen contacts custom_variable_configs
18   custom_variables custom_variables_validity drafts dunning dunning_config
19   employee follow_up_links follow_ups generic_translations history_erp language
20   license notes payment_terms pricegroup rma schema_info sepa_export
21   sepa_export_items tax taxkeys
22 );
23
24 my @lxoffice_blacklist = (@lxoffice_blacklist_permanent, @lxoffice_blacklist_temp);
25
26 # map table names to their models.
27 # unlike rails we have no singular<->plural magic.
28 # remeber: tables should be named as the plural of the model name.
29 my %lxoffice_package_names = (
30   ar                             => 'invoice',
31   ap                             => 'purchase_invoice',
32   delivery_orders                => 'delivery_order',
33   delivery_order_items           => 'delivery_order_item',
34   gl                             => 'GLTransaction',
35   invoice                        => 'invoice_item',
36   orderitems                     => 'order_item',
37   oe                             => 'order',
38   parts                          => 'part',
39   price_factors                  => 'price_factor',
40   printers                       => 'Printer',
41   units                          => 'unit',
42 );
43
44 sub get_blacklist {
45   return LXOFFICE => \@lxoffice_blacklist;
46 }
47
48 sub get_package_names {
49   return LXOFFICE => \%lxoffice_package_names;
50 }
51
52 1;
53
54 __END__
55
56 =head1 NAME
57
58 SL::DB::Helpers::Mappings - Rose Table <-> Model mapping information
59
60 =head1 SYNOPSIS
61
62   use SL::DB::Helpers::Mappings qw(@blacklist %table2model);
63
64 =head1 DESCRIPTION
65
66 This modul stores table <-> model mappings used by the
67 L<scripts/rose_auto_create_model.pl> script.  If you add a new table that has
68 custom mappings, add it here.
69
70 =head1 BUGS
71
72 nothing yet
73
74 =head1 SEE ALSO
75
76 L<scripts/rose_auto_create_model.pl>
77
78 =head1 AUTHOR
79
80 Sven Schöling <s.schoeling@linet-services.de>
81
82 =cut