-our %foreign_key_name_map = (
- oe => { payment => 'payment_terms', },
- ar => { payment => 'payment_terms', },
- ap => { payment => 'payment_terms', },
-
- orderitems => { parts => 'part', trans => 'order', },
- delivery_order_items => { parts => 'part' },
- invoice => { parts => 'part' },
- follow_ups => { 'employee_obj' => 'created_for' },
-
- periodic_invoices_configs => { oe => 'order' },
+# Maps column names in tables to foreign key relationship names. For
+# example:
+#
+# »follow_up_access« contains a column named »who«. Rose normally
+# names the resulting relationship after the class the target table
+# uses. In this case the target table is »employee« and the
+# corresponding class SL::DB::Employee. The resulting relationship
+# would be named »employee«.
+#
+# In order to rename this relationship we have to map »who« to
+# e.g. »granted_by«:
+# follow_up_access => { who => 'granted_by' },
+
+our %foreign_key_name_map = (
+ KIVITENDO => {
+ oe => { payment_id => 'payment_terms', },
+ ar => { payment_id => 'payment_terms', },
+ ap => { payment_id => 'payment_terms', },
+
+ orderitems => { parts_id => 'part', trans_id => 'order', },
+ delivery_order_items => { parts_id => 'part' },
+ invoice => { parts_id => 'part' },
+ follow_ups => { created_for_user => 'created_for', created_by => 'created_by', },
+ follow_up_access => { who => 'with_access', what => 'to_follow_ups_by', },
+
+ periodic_invoices_configs => { oe_id => 'order' },
+ },