From f97b07787db5cacc0f90338fdb3c1237262917cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 14 Sep 2010 16:48:46 +0200 Subject: [PATCH] RDBO Normalisierung Part 2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Alle Tables mit id Spalte versehen. Taxkey und Licemse naming gefixt. Ausserdem eine Funktion db eingefügt, die in package main sitzt und die passenden Datenbankmodels zurückgibt, siehe Helpers::Mappings --- SL/DB/AccTrans.pm | 13 +++++ SL/DB/AccTransaction.pm | 13 +++++ SL/DB/AuditTrail.pm | 13 +++++ SL/DB/CustomerTax.pm | 13 +++++ SL/DB/{Taxkey.pm => Datev.pm} | 4 +- SL/DB/{Licemse.pm => Default.pm} | 4 +- SL/DB/Department.pm | 13 +++++ SL/DB/DptTrans.pm | 13 +++++ SL/DB/Exchangerate.pm | 13 +++++ SL/DB/Finanzamt.pm | 13 +++++ SL/DB/FollowUpAccess.pm | 13 +++++ SL/DB/Gifi.pm | 13 +++++ SL/DB/Helpers/ALL.pm | 36 ++++++++++-- SL/DB/Helpers/Mappings.pm | 41 +++++++++---- SL/DB/Inventory.pm | 13 +++++ SL/DB/Lead.pm | 13 +++++ SL/DB/License.pm | 13 +++++ SL/DB/LicenseInvoice.pm | 13 +++++ SL/DB/MakeModel.pm | 13 +++++ SL/DB/MetaSetup/AccTrans.pm | 50 ++++++++++++++++ SL/DB/MetaSetup/AccTransaction.pm | 50 ++++++++++++++++ SL/DB/MetaSetup/AuditTrail.pm | 27 +++++++++ SL/DB/MetaSetup/CustomerTax.pm | 26 +++++++++ SL/DB/MetaSetup/Datev.pm | 30 ++++++++++ SL/DB/MetaSetup/Default.pm | 54 +++++++++++++++++ SL/DB/MetaSetup/Department.pm | 26 +++++++++ SL/DB/MetaSetup/DptTrans.pm | 26 +++++++++ SL/DB/MetaSetup/Exchangerate.pm | 28 +++++++++ SL/DB/MetaSetup/Finanzamt.pm | 40 +++++++++++++ SL/DB/MetaSetup/FollowUpAccess.pm | 34 +++++++++++ SL/DB/MetaSetup/Gifi.pm | 24 ++++++++ SL/DB/MetaSetup/Inventory.pm | 70 +++++++++++++++++++++++ SL/DB/MetaSetup/Lead.pm | 21 +++++++ SL/DB/MetaSetup/License.pm | 27 +++++++++ SL/DB/MetaSetup/LicenseInvoice.pm | 22 +++++++ SL/DB/MetaSetup/MakeModel.pm | 27 +++++++++ SL/DB/MetaSetup/PartsGroup.pm | 25 ++++++++ SL/DB/MetaSetup/PartsTax.pm | 26 +++++++++ SL/DB/MetaSetup/Prices.pm | 35 ++++++++++++ SL/DB/MetaSetup/RMAItem.pm | 47 +++++++++++++++ SL/DB/MetaSetup/RecordLink.pm | 27 +++++++++ SL/DB/MetaSetup/Status.pm | 30 ++++++++++ SL/DB/MetaSetup/TaxKey.pm | 32 +++++++++++ SL/DB/MetaSetup/TaxZone.pm | 21 +++++++ SL/DB/MetaSetup/TodoUserConfig.pm | 33 +++++++++++ SL/DB/MetaSetup/Translation.pm | 28 +++++++++ SL/DB/MetaSetup/TranslationPaymentTerm.pm | 35 ++++++++++++ SL/DB/MetaSetup/UnitsLanguage.pm | 36 ++++++++++++ SL/DB/MetaSetup/VendorTax.pm | 26 +++++++++ SL/DB/PartsGroup.pm | 13 +++++ SL/DB/PartsTax.pm | 13 +++++ SL/DB/Prices.pm | 13 +++++ SL/DB/RMAItem.pm | 13 +++++ SL/DB/RecordLink.pm | 13 +++++ SL/DB/Status.pm | 13 +++++ SL/DB/TaxKey.pm | 13 +++++ SL/DB/TaxZone.pm | 13 +++++ SL/DB/TodoUserConfig.pm | 13 +++++ SL/DB/Translation.pm | 13 +++++ SL/DB/TranslationPaymentTerm.pm | 13 +++++ SL/DB/UnitsLanguage.pm | 13 +++++ SL/DB/VendorTax.pm | 13 +++++ bin/mozilla/common.pl | 9 +++ config/lx-erp.conf | 17 +++++- sql/Pg-upgrade2/schema_nomalization_2.sql | 30 ++++++++++ 65 files changed, 1465 insertions(+), 23 deletions(-) create mode 100644 SL/DB/AccTrans.pm create mode 100644 SL/DB/AccTransaction.pm create mode 100644 SL/DB/AuditTrail.pm create mode 100644 SL/DB/CustomerTax.pm rename SL/DB/{Taxkey.pm => Datev.pm} (83%) rename SL/DB/{Licemse.pm => Default.pm} (83%) create mode 100644 SL/DB/Department.pm create mode 100644 SL/DB/DptTrans.pm create mode 100644 SL/DB/Exchangerate.pm create mode 100644 SL/DB/Finanzamt.pm create mode 100644 SL/DB/FollowUpAccess.pm create mode 100644 SL/DB/Gifi.pm create mode 100644 SL/DB/Inventory.pm create mode 100644 SL/DB/Lead.pm create mode 100644 SL/DB/License.pm create mode 100644 SL/DB/LicenseInvoice.pm create mode 100644 SL/DB/MakeModel.pm create mode 100644 SL/DB/MetaSetup/AccTrans.pm create mode 100644 SL/DB/MetaSetup/AccTransaction.pm create mode 100644 SL/DB/MetaSetup/AuditTrail.pm create mode 100644 SL/DB/MetaSetup/CustomerTax.pm create mode 100644 SL/DB/MetaSetup/Datev.pm create mode 100644 SL/DB/MetaSetup/Default.pm create mode 100644 SL/DB/MetaSetup/Department.pm create mode 100644 SL/DB/MetaSetup/DptTrans.pm create mode 100644 SL/DB/MetaSetup/Exchangerate.pm create mode 100644 SL/DB/MetaSetup/Finanzamt.pm create mode 100644 SL/DB/MetaSetup/FollowUpAccess.pm create mode 100644 SL/DB/MetaSetup/Gifi.pm create mode 100644 SL/DB/MetaSetup/Inventory.pm create mode 100644 SL/DB/MetaSetup/Lead.pm create mode 100644 SL/DB/MetaSetup/License.pm create mode 100644 SL/DB/MetaSetup/LicenseInvoice.pm create mode 100644 SL/DB/MetaSetup/MakeModel.pm create mode 100644 SL/DB/MetaSetup/PartsGroup.pm create mode 100644 SL/DB/MetaSetup/PartsTax.pm create mode 100644 SL/DB/MetaSetup/Prices.pm create mode 100644 SL/DB/MetaSetup/RMAItem.pm create mode 100644 SL/DB/MetaSetup/RecordLink.pm create mode 100644 SL/DB/MetaSetup/Status.pm create mode 100644 SL/DB/MetaSetup/TaxKey.pm create mode 100644 SL/DB/MetaSetup/TaxZone.pm create mode 100644 SL/DB/MetaSetup/TodoUserConfig.pm create mode 100644 SL/DB/MetaSetup/Translation.pm create mode 100644 SL/DB/MetaSetup/TranslationPaymentTerm.pm create mode 100644 SL/DB/MetaSetup/UnitsLanguage.pm create mode 100644 SL/DB/MetaSetup/VendorTax.pm create mode 100644 SL/DB/PartsGroup.pm create mode 100644 SL/DB/PartsTax.pm create mode 100644 SL/DB/Prices.pm create mode 100644 SL/DB/RMAItem.pm create mode 100644 SL/DB/RecordLink.pm create mode 100644 SL/DB/Status.pm create mode 100644 SL/DB/TaxKey.pm create mode 100644 SL/DB/TaxZone.pm create mode 100644 SL/DB/TodoUserConfig.pm create mode 100644 SL/DB/Translation.pm create mode 100644 SL/DB/TranslationPaymentTerm.pm create mode 100644 SL/DB/UnitsLanguage.pm create mode 100644 SL/DB/VendorTax.pm create mode 100644 sql/Pg-upgrade2/schema_nomalization_2.sql diff --git a/SL/DB/AccTrans.pm b/SL/DB/AccTrans.pm new file mode 100644 index 000000000..e058b8d53 --- /dev/null +++ b/SL/DB/AccTrans.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::AccTrans; + +use strict; + +use SL::DB::MetaSetup::AccTrans; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/AccTransaction.pm b/SL/DB/AccTransaction.pm new file mode 100644 index 000000000..0f7871735 --- /dev/null +++ b/SL/DB/AccTransaction.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::AccTransaction; + +use strict; + +use SL::DB::MetaSetup::AccTransaction; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/AuditTrail.pm b/SL/DB/AuditTrail.pm new file mode 100644 index 000000000..9c2fbc0be --- /dev/null +++ b/SL/DB/AuditTrail.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::AuditTrail; + +use strict; + +use SL::DB::MetaSetup::AuditTrail; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/CustomerTax.pm b/SL/DB/CustomerTax.pm new file mode 100644 index 000000000..2efc60e18 --- /dev/null +++ b/SL/DB/CustomerTax.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::CustomerTax; + +use strict; + +use SL::DB::MetaSetup::CustomerTax; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Taxkey.pm b/SL/DB/Datev.pm similarity index 83% rename from SL/DB/Taxkey.pm rename to SL/DB/Datev.pm index dd442dd9a..4d33d5820 100644 --- a/SL/DB/Taxkey.pm +++ b/SL/DB/Datev.pm @@ -1,11 +1,11 @@ # This file has been auto-generated only because it didn't exist. # Feel free to modify it at will; it will not be overwritten automatically. -package SL::DB::Taxkey; +package SL::DB::Datev; use strict; -use SL::DB::MetaSetup::Taxkey; +use SL::DB::MetaSetup::Datev; # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. __PACKAGE__->meta->make_manager_class; diff --git a/SL/DB/Licemse.pm b/SL/DB/Default.pm similarity index 83% rename from SL/DB/Licemse.pm rename to SL/DB/Default.pm index f43ce2d03..497ce3598 100644 --- a/SL/DB/Licemse.pm +++ b/SL/DB/Default.pm @@ -1,11 +1,11 @@ # This file has been auto-generated only because it didn't exist. # Feel free to modify it at will; it will not be overwritten automatically. -package SL::DB::Licemse; +package SL::DB::Default; use strict; -use SL::DB::MetaSetup::Licemse; +use SL::DB::MetaSetup::Default; # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. __PACKAGE__->meta->make_manager_class; diff --git a/SL/DB/Department.pm b/SL/DB/Department.pm new file mode 100644 index 000000000..ea62791cd --- /dev/null +++ b/SL/DB/Department.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::Department; + +use strict; + +use SL::DB::MetaSetup::Department; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/DptTrans.pm b/SL/DB/DptTrans.pm new file mode 100644 index 000000000..3712903a2 --- /dev/null +++ b/SL/DB/DptTrans.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::DptTrans; + +use strict; + +use SL::DB::MetaSetup::DptTrans; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Exchangerate.pm b/SL/DB/Exchangerate.pm new file mode 100644 index 000000000..cd3eaeefe --- /dev/null +++ b/SL/DB/Exchangerate.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::Exchangerate; + +use strict; + +use SL::DB::MetaSetup::Exchangerate; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Finanzamt.pm b/SL/DB/Finanzamt.pm new file mode 100644 index 000000000..82daba1ef --- /dev/null +++ b/SL/DB/Finanzamt.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::Finanzamt; + +use strict; + +use SL::DB::MetaSetup::Finanzamt; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/FollowUpAccess.pm b/SL/DB/FollowUpAccess.pm new file mode 100644 index 000000000..581a49796 --- /dev/null +++ b/SL/DB/FollowUpAccess.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::FollowUpAccess; + +use strict; + +use SL::DB::MetaSetup::FollowUpAccess; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Gifi.pm b/SL/DB/Gifi.pm new file mode 100644 index 000000000..9a1c7f5ae --- /dev/null +++ b/SL/DB/Gifi.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::Gifi; + +use strict; + +use SL::DB::MetaSetup::Gifi; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Helpers/ALL.pm b/SL/DB/Helpers/ALL.pm index 396b38d1c..4a258efbe 100644 --- a/SL/DB/Helpers/ALL.pm +++ b/SL/DB/Helpers/ALL.pm @@ -2,7 +2,10 @@ package SL::DB::Helpers::ALL; use strict; +use SL::DB::AccTrans; +use SL::DB::AccTransaction; use SL::DB::Assembly; +use SL::DB::AuditTrail; use SL::DB::BankAccount; use SL::DB::Bin; use SL::DB::Buchungsgruppe; @@ -13,46 +16,69 @@ use SL::DB::CustomVariable; use SL::DB::CustomVariableConfig; use SL::DB::CustomVariableValidity; use SL::DB::Customer; +use SL::DB::CustomerTax; +use SL::DB::Datev; +use SL::DB::Default; use SL::DB::DeliveryOrder; use SL::DB::DeliveryOrderItem; use SL::DB::DeliveryOrderItemsStock; +use SL::DB::Department; +use SL::DB::DptTrans; use SL::DB::Draft; use SL::DB::Dunning; use SL::DB::DunningConfig; use SL::DB::Employee; +use SL::DB::Exchangerate; +use SL::DB::Finanzamt; use SL::DB::FollowUp; +use SL::DB::FollowUpAccess; use SL::DB::FollowUpLink; use SL::DB::GLTransaction; use SL::DB::GenericTranslation; +use SL::DB::Gifi; use SL::DB::History; +use SL::DB::Inventory; use SL::DB::Invoice; use SL::DB::InvoiceItem; use SL::DB::Language; -use SL::DB::Licemse; +use SL::DB::Lead; +use SL::DB::License; +use SL::DB::LicenseInvoice; +use SL::DB::MakeModel; use SL::DB::Note; use SL::DB::Order; use SL::DB::OrderItem; use SL::DB::Part; +use SL::DB::PartsGroup; +use SL::DB::PartsTax; use SL::DB::PaymentTerm; use SL::DB::PriceFactor; use SL::DB::Pricegroup; +use SL::DB::Prices; use SL::DB::Printer; use SL::DB::Project; use SL::DB::PurchaseInvoice; use SL::DB::RMA; +use SL::DB::RMAItem; +use SL::DB::RecordLink; +use SL::DB::SchemaInfo; use SL::DB::SepaExport; use SL::DB::SepaExportItem; -use SL::DB::SchemaInfo; use SL::DB::Shipto; +use SL::DB::Status; use SL::DB::Tax; -use SL::DB::Taxkey; +use SL::DB::TaxKey; +use SL::DB::TaxZone; +use SL::DB::TodoUserConfig; use SL::DB::TransferType; +use SL::DB::Translation; +use SL::DB::TranslationPaymentTerm; use SL::DB::Unit; +use SL::DB::UnitsLanguage; use SL::DB::Vendor; +use SL::DB::VendorTax; use SL::DB::Warehouse; - - 1; __END__ diff --git a/SL/DB/Helpers/Mappings.pm b/SL/DB/Helpers/Mappings.pm index 13a798543..7b0c959dd 100644 --- a/SL/DB/Helpers/Mappings.pm +++ b/SL/DB/Helpers/Mappings.pm @@ -2,18 +2,10 @@ package SL::DB::Helpers::Mappings; use strict; -use Exporter qw(import); - -our @EXPORT_OK = qw(db); - # these will not be managed as Rose::DB models, because they are not normalized # significant changes are needed to get them done. my @lxoffice_blacklist_permanent = qw( - acc_trans audittrail customertax datev defaults department dpt_trans - exchangerate finanzamt follow_up_access gifi inventory leads licenseinvoice - makemodel partsgroup partstax prices record_links rmaitems status tax_zones - todo_user_config translation translation_payment_terms units_language - vendortax); +); # these are not managed _yet_, but will hopefully at some point. # if you are confident that one of these works, remove it here. @@ -26,6 +18,8 @@ my @lxoffice_blacklist = (@lxoffice_blacklist_permanent, @lxoffice_blacklist_tem # unlike rails we have no singular<->plural magic. # remeber: tables should be named as the plural of the model name. my %lxoffice_package_names = ( + acc_trans => 'acc_transaction', + audittrail => 'audit_trail', ar => 'invoice', ap => 'purchase_invoice', bank_accounts => 'bank_account', @@ -34,35 +28,60 @@ my %lxoffice_package_names = ( custom_variable_configs => 'custom_variable_config', custom_variables => 'custom_variable', custom_variables_validity => 'custom_variable_validity', + customertax => 'customer_tax', + datev => 'datev', + defaults => 'default', delivery_orders => 'delivery_order', delivery_order_items => 'delivery_order_item', + department => 'department', + dpt_trans => 'dpt_trans', drafts => 'draft', dunning => 'dunning', dunning_config => 'dunning_config', employee => 'employee', + exchangerate => 'exchangerate', + finanzamt => 'finanzamt', + follow_up_access => 'follow_up_access', follow_up_links => 'follow_up_link', follow_ups => 'follow_up', generic_translations => 'generic_translation', + gifi => 'gifi', gl => 'GLTransaction', history_erp => 'history', + inventory => 'inventory', invoice => 'invoice_item', language => 'language', - license => 'licemse', + leads => 'lead', + license => 'license', + licenseinvoice => 'license_invoice', + makemodel => 'make_model', notes => 'note', orderitems => 'order_item', oe => 'order', parts => 'part', + partsgroup => 'parts_group', + partstax => 'parts_tax', payment_terms => 'payment_term', + prices => 'prices', price_factors => 'price_factor', pricegroup => 'pricegroup', printers => 'Printer', + record_links => 'record_link', rma => 'RMA', + rmaitems => 'RMA_item', sepa_export => 'sepa_export', sepa_export_items => 'sepa_export_item', schema_info => 'schema_info', + status => 'status', tax => 'tax', - taxkeys => 'taxkey', + taxkeys => 'tax_key', + tax_zones => 'tax_zone', + todo_user_config => 'todo_user_config', + translation => 'translation', + translation_payment_terms => 'translation_payment_term', units => 'unit', + units_language => 'units_language', + vendortax => 'vendor_tax', ); sub get_blacklist { diff --git a/SL/DB/Inventory.pm b/SL/DB/Inventory.pm new file mode 100644 index 000000000..98d505d70 --- /dev/null +++ b/SL/DB/Inventory.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::Inventory; + +use strict; + +use SL::DB::MetaSetup::Inventory; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Lead.pm b/SL/DB/Lead.pm new file mode 100644 index 000000000..0c12c5c3b --- /dev/null +++ b/SL/DB/Lead.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::Lead; + +use strict; + +use SL::DB::MetaSetup::Lead; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/License.pm b/SL/DB/License.pm new file mode 100644 index 000000000..b75add7fe --- /dev/null +++ b/SL/DB/License.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::License; + +use strict; + +use SL::DB::MetaSetup::License; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/LicenseInvoice.pm b/SL/DB/LicenseInvoice.pm new file mode 100644 index 000000000..9a03e3ab4 --- /dev/null +++ b/SL/DB/LicenseInvoice.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::LicenseInvoice; + +use strict; + +use SL::DB::MetaSetup::LicenseInvoice; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/MakeModel.pm b/SL/DB/MakeModel.pm new file mode 100644 index 000000000..8831a66e6 --- /dev/null +++ b/SL/DB/MakeModel.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::MakeModel; + +use strict; + +use SL::DB::MetaSetup::MakeModel; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/MetaSetup/AccTrans.pm b/SL/DB/MetaSetup/AccTrans.pm new file mode 100644 index 000000000..8fcedbc15 --- /dev/null +++ b/SL/DB/MetaSetup/AccTrans.pm @@ -0,0 +1,50 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::AccTrans; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'acc_trans', + + columns => [ + acc_trans_id => { type => 'bigint', sequence => 'acc_trans_id_seq' }, + trans_id => { type => 'integer', not_null => 1 }, + chart_id => { type => 'integer', not_null => 1 }, + amount => { type => 'numeric', precision => 5, scale => 15 }, + transdate => { type => 'date', default => 'now' }, + gldate => { type => 'date', default => 'now' }, + source => { type => 'text' }, + cleared => { type => 'boolean', default => 'false' }, + fx_transaction => { type => 'boolean', default => 'false' }, + ob_transaction => { type => 'boolean', default => 'false' }, + cb_transaction => { type => 'boolean', default => 'false' }, + project_id => { type => 'integer' }, + memo => { type => 'text' }, + taxkey => { type => 'integer' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + id => { type => 'integer', not_null => 1, sequence => 'acc_trans_id_seq1' }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, + + foreign_keys => [ + chart => { + class => 'SL::DB::Chart', + key_columns => { chart_id => 'id' }, + }, + + project => { + class => 'SL::DB::Project', + key_columns => { project_id => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/AccTransaction.pm b/SL/DB/MetaSetup/AccTransaction.pm new file mode 100644 index 000000000..9f6e6b45e --- /dev/null +++ b/SL/DB/MetaSetup/AccTransaction.pm @@ -0,0 +1,50 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::AccTransaction; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'acc_trans', + + columns => [ + acc_trans_id => { type => 'bigint', sequence => 'acc_trans_id_seq' }, + trans_id => { type => 'integer', not_null => 1 }, + chart_id => { type => 'integer', not_null => 1 }, + amount => { type => 'numeric', precision => 5, scale => 15 }, + transdate => { type => 'date', default => 'now' }, + gldate => { type => 'date', default => 'now' }, + source => { type => 'text' }, + cleared => { type => 'boolean', default => 'false' }, + fx_transaction => { type => 'boolean', default => 'false' }, + ob_transaction => { type => 'boolean', default => 'false' }, + cb_transaction => { type => 'boolean', default => 'false' }, + project_id => { type => 'integer' }, + memo => { type => 'text' }, + taxkey => { type => 'integer' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + id => { type => 'integer', not_null => 1, sequence => 'acc_trans_id_seq1' }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, + + foreign_keys => [ + chart => { + class => 'SL::DB::Chart', + key_columns => { chart_id => 'id' }, + }, + + project => { + class => 'SL::DB::Project', + key_columns => { project_id => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/AuditTrail.pm b/SL/DB/MetaSetup/AuditTrail.pm new file mode 100644 index 000000000..0edc6edd7 --- /dev/null +++ b/SL/DB/MetaSetup/AuditTrail.pm @@ -0,0 +1,27 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::AuditTrail; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'audittrail', + + columns => [ + trans_id => { type => 'integer' }, + tablename => { type => 'text' }, + reference => { type => 'text' }, + formname => { type => 'text' }, + action => { type => 'text' }, + transdate => { type => 'timestamp', default => 'now' }, + employee_id => { type => 'integer' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], +); + +1; +; diff --git a/SL/DB/MetaSetup/CustomerTax.pm b/SL/DB/MetaSetup/CustomerTax.pm new file mode 100644 index 000000000..252299578 --- /dev/null +++ b/SL/DB/MetaSetup/CustomerTax.pm @@ -0,0 +1,26 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::CustomerTax; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'customertax', + + columns => [ + customer_id => { type => 'integer' }, + chart_id => { type => 'integer' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/Datev.pm b/SL/DB/MetaSetup/Datev.pm new file mode 100644 index 000000000..cc03ba3a6 --- /dev/null +++ b/SL/DB/MetaSetup/Datev.pm @@ -0,0 +1,30 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Datev; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'datev', + + columns => [ + beraternr => { type => 'varchar', length => 7 }, + beratername => { type => 'varchar', length => 9 }, + mandantennr => { type => 'varchar', length => 5 }, + dfvkz => { type => 'varchar', length => 2 }, + datentraegernr => { type => 'varchar', length => 3 }, + abrechnungsnr => { type => 'varchar', length => 6 }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm new file mode 100644 index 000000000..4eb5e6644 --- /dev/null +++ b/SL/DB/MetaSetup/Default.pm @@ -0,0 +1,54 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Default; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'defaults', + + columns => [ + inventory_accno_id => { type => 'integer' }, + income_accno_id => { type => 'integer' }, + expense_accno_id => { type => 'integer' }, + fxgain_accno_id => { type => 'integer' }, + fxloss_accno_id => { type => 'integer' }, + invnumber => { type => 'text' }, + sonumber => { type => 'text' }, + yearend => { type => 'varchar', length => 5 }, + weightunit => { type => 'varchar', length => 5 }, + businessnumber => { type => 'text' }, + version => { type => 'varchar', length => 8 }, + curr => { type => 'text' }, + closedto => { type => 'date' }, + revtrans => { type => 'boolean', default => 'false' }, + ponumber => { type => 'text' }, + sqnumber => { type => 'text' }, + rfqnumber => { type => 'text' }, + customernumber => { type => 'text' }, + vendornumber => { type => 'text' }, + audittrail => { type => 'boolean', default => 'false' }, + articlenumber => { type => 'text' }, + servicenumber => { type => 'text' }, + coa => { type => 'text' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + rmanumber => { type => 'text' }, + cnnumber => { type => 'text' }, + dunning_ar_amount_fee => { type => 'integer' }, + dunning_ar_amount_interest => { type => 'integer' }, + dunning_ar => { type => 'integer' }, + pdonumber => { type => 'text' }, + sdonumber => { type => 'text' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/Department.pm b/SL/DB/MetaSetup/Department.pm new file mode 100644 index 000000000..1d1d95709 --- /dev/null +++ b/SL/DB/MetaSetup/Department.pm @@ -0,0 +1,26 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Department; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'department', + + columns => [ + id => { type => 'integer', not_null => 1, sequence => 'id' }, + description => { type => 'text' }, + role => { type => 'character', default => 'P', length => 1 }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/DptTrans.pm b/SL/DB/MetaSetup/DptTrans.pm new file mode 100644 index 000000000..9d30883e0 --- /dev/null +++ b/SL/DB/MetaSetup/DptTrans.pm @@ -0,0 +1,26 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::DptTrans; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'dpt_trans', + + columns => [ + trans_id => { type => 'integer' }, + department_id => { type => 'integer' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/Exchangerate.pm b/SL/DB/MetaSetup/Exchangerate.pm new file mode 100644 index 000000000..95ea23c17 --- /dev/null +++ b/SL/DB/MetaSetup/Exchangerate.pm @@ -0,0 +1,28 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Exchangerate; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'exchangerate', + + columns => [ + curr => { type => 'character', length => 3 }, + transdate => { type => 'date' }, + buy => { type => 'numeric', precision => 5, scale => 15 }, + sell => { type => 'numeric', precision => 5, scale => 15 }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/Finanzamt.pm b/SL/DB/MetaSetup/Finanzamt.pm new file mode 100644 index 000000000..fa2291938 --- /dev/null +++ b/SL/DB/MetaSetup/Finanzamt.pm @@ -0,0 +1,40 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Finanzamt; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'finanzamt', + + columns => [ + fa_land_nr => { type => 'text' }, + fa_bufa_nr => { type => 'text' }, + fa_name => { type => 'text' }, + fa_strasse => { type => 'text' }, + fa_plz => { type => 'text' }, + fa_ort => { type => 'text' }, + fa_telefon => { type => 'text' }, + fa_fax => { type => 'text' }, + fa_plz_grosskunden => { type => 'text' }, + fa_plz_postfach => { type => 'text' }, + fa_postfach => { type => 'text' }, + fa_blz_1 => { type => 'text' }, + fa_kontonummer_1 => { type => 'text' }, + fa_bankbezeichnung_1 => { type => 'text' }, + fa_blz_2 => { type => 'text' }, + fa_kontonummer_2 => { type => 'text' }, + fa_bankbezeichnung_2 => { type => 'text' }, + fa_oeffnungszeiten => { type => 'text' }, + fa_email => { type => 'text' }, + fa_internet => { type => 'text' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], +); + +1; +; diff --git a/SL/DB/MetaSetup/FollowUpAccess.pm b/SL/DB/MetaSetup/FollowUpAccess.pm new file mode 100644 index 000000000..0a26083f8 --- /dev/null +++ b/SL/DB/MetaSetup/FollowUpAccess.pm @@ -0,0 +1,34 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::FollowUpAccess; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'follow_up_access', + + columns => [ + who => { type => 'integer', not_null => 1 }, + what => { type => 'integer', not_null => 1 }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + foreign_keys => [ + employee => { + class => 'SL::DB::Employee', + key_columns => { who => 'id' }, + }, + + employee_obj => { + class => 'SL::DB::Employee', + key_columns => { what => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/Gifi.pm b/SL/DB/MetaSetup/Gifi.pm new file mode 100644 index 000000000..dc9c8b8c4 --- /dev/null +++ b/SL/DB/MetaSetup/Gifi.pm @@ -0,0 +1,24 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Gifi; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'gifi', + + columns => [ + accno => { type => 'text' }, + description => { type => 'text' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + unique_key => [ 'accno' ], +); + +1; +; diff --git a/SL/DB/MetaSetup/Inventory.pm b/SL/DB/MetaSetup/Inventory.pm new file mode 100644 index 000000000..e732f88ce --- /dev/null +++ b/SL/DB/MetaSetup/Inventory.pm @@ -0,0 +1,70 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Inventory; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'inventory', + + columns => [ + warehouse_id => { type => 'integer', not_null => 1 }, + parts_id => { type => 'integer', not_null => 1 }, + oe_id => { type => 'integer' }, + orderitems_id => { type => 'integer' }, + shippingdate => { type => 'date' }, + employee_id => { type => 'integer', not_null => 1 }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + bin_id => { type => 'integer', not_null => 1 }, + qty => { type => 'numeric', precision => 5, scale => 25 }, + trans_id => { type => 'integer', not_null => 1 }, + trans_type_id => { type => 'integer', not_null => 1 }, + project_id => { type => 'integer' }, + chargenumber => { type => 'text' }, + comment => { type => 'text' }, + bestbefore => { type => 'date' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, + + foreign_keys => [ + bin => { + class => 'SL::DB::Bin', + key_columns => { bin_id => 'id' }, + }, + + employee => { + class => 'SL::DB::Employee', + key_columns => { employee_id => 'id' }, + }, + + parts => { + class => 'SL::DB::Part', + key_columns => { parts_id => 'id' }, + }, + + project => { + class => 'SL::DB::Project', + key_columns => { project_id => 'id' }, + }, + + trans_type => { + class => 'SL::DB::TransferType', + key_columns => { trans_type_id => 'id' }, + }, + + warehouse => { + class => 'SL::DB::Warehouse', + key_columns => { warehouse_id => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/Lead.pm b/SL/DB/MetaSetup/Lead.pm new file mode 100644 index 000000000..e12069aac --- /dev/null +++ b/SL/DB/MetaSetup/Lead.pm @@ -0,0 +1,21 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Lead; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'leads', + + columns => [ + id => { type => 'integer', not_null => 1, sequence => 'id' }, + lead => { type => 'varchar', length => 50 }, + ], + + primary_key_columns => [ 'id' ], +); + +1; +; diff --git a/SL/DB/MetaSetup/License.pm b/SL/DB/MetaSetup/License.pm new file mode 100644 index 000000000..6ea5da525 --- /dev/null +++ b/SL/DB/MetaSetup/License.pm @@ -0,0 +1,27 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::License; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'license', + + columns => [ + id => { type => 'integer', not_null => 1, sequence => 'id' }, + parts_id => { type => 'integer' }, + customer_id => { type => 'integer' }, + comment => { type => 'text' }, + validuntil => { type => 'date' }, + issuedate => { type => 'date', default => 'now' }, + quantity => { type => 'integer' }, + licensenumber => { type => 'text' }, + ], + + primary_key_columns => [ 'id' ], +); + +1; +; diff --git a/SL/DB/MetaSetup/LicenseInvoice.pm b/SL/DB/MetaSetup/LicenseInvoice.pm new file mode 100644 index 000000000..b14f2caa8 --- /dev/null +++ b/SL/DB/MetaSetup/LicenseInvoice.pm @@ -0,0 +1,22 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::LicenseInvoice; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'licenseinvoice', + + columns => [ + trans_id => { type => 'integer' }, + license_id => { type => 'integer' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], +); + +1; +; diff --git a/SL/DB/MetaSetup/MakeModel.pm b/SL/DB/MetaSetup/MakeModel.pm new file mode 100644 index 000000000..cc0ae7fcb --- /dev/null +++ b/SL/DB/MetaSetup/MakeModel.pm @@ -0,0 +1,27 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::MakeModel; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'makemodel', + + columns => [ + parts_id => { type => 'integer' }, + model => { type => 'text' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + make => { type => 'integer' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/PartsGroup.pm b/SL/DB/MetaSetup/PartsGroup.pm new file mode 100644 index 000000000..166f2b8db --- /dev/null +++ b/SL/DB/MetaSetup/PartsGroup.pm @@ -0,0 +1,25 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::PartsGroup; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'partsgroup', + + columns => [ + id => { type => 'integer', not_null => 1, sequence => 'id' }, + partsgroup => { type => 'text' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/PartsTax.pm b/SL/DB/MetaSetup/PartsTax.pm new file mode 100644 index 000000000..9bcdb5d4d --- /dev/null +++ b/SL/DB/MetaSetup/PartsTax.pm @@ -0,0 +1,26 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::PartsTax; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'partstax', + + columns => [ + parts_id => { type => 'integer' }, + chart_id => { type => 'integer' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/Prices.pm b/SL/DB/MetaSetup/Prices.pm new file mode 100644 index 000000000..819d14c6f --- /dev/null +++ b/SL/DB/MetaSetup/Prices.pm @@ -0,0 +1,35 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Prices; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'prices', + + columns => [ + parts_id => { type => 'integer' }, + pricegroup_id => { type => 'integer' }, + price => { type => 'numeric', precision => 5, scale => 15 }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + foreign_keys => [ + parts => { + class => 'SL::DB::Part', + key_columns => { parts_id => 'id' }, + }, + + pricegroup => { + class => 'SL::DB::Pricegroup', + key_columns => { pricegroup_id => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/RMAItem.pm b/SL/DB/MetaSetup/RMAItem.pm new file mode 100644 index 000000000..dd3270076 --- /dev/null +++ b/SL/DB/MetaSetup/RMAItem.pm @@ -0,0 +1,47 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::RMAItem; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'rmaitems', + + columns => [ + trans_id => { type => 'integer' }, + parts_id => { type => 'integer' }, + description => { type => 'text' }, + qty => { type => 'float', precision => 4 }, + base_qty => { type => 'float', precision => 4 }, + sellprice => { type => 'numeric', precision => 5, scale => 15 }, + discount => { type => 'float', precision => 4 }, + project_id => { type => 'integer' }, + reqdate => { type => 'date' }, + ship => { type => 'float', precision => 4 }, + serialnumber => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'orderitemsid' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + pricegroup_id => { type => 'integer' }, + rmanumber => { type => 'text' }, + transdate => { type => 'text' }, + cusrmanumber => { type => 'text' }, + unit => { type => 'varchar', length => 20 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, + + foreign_keys => [ + parts => { + class => 'SL::DB::Part', + key_columns => { parts_id => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/RecordLink.pm b/SL/DB/MetaSetup/RecordLink.pm new file mode 100644 index 000000000..4059be814 --- /dev/null +++ b/SL/DB/MetaSetup/RecordLink.pm @@ -0,0 +1,27 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::RecordLink; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'record_links', + + columns => [ + from_table => { type => 'varchar', length => 50, not_null => 1 }, + from_id => { type => 'integer', not_null => 1 }, + to_table => { type => 'varchar', length => 50, not_null => 1 }, + to_id => { type => 'integer', not_null => 1 }, + itime => { type => 'timestamp', default => 'now()' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/Status.pm b/SL/DB/MetaSetup/Status.pm new file mode 100644 index 000000000..c916a7842 --- /dev/null +++ b/SL/DB/MetaSetup/Status.pm @@ -0,0 +1,30 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Status; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'status', + + columns => [ + trans_id => { type => 'integer' }, + formname => { type => 'text' }, + printed => { type => 'boolean', default => 'false' }, + emailed => { type => 'boolean', default => 'false' }, + spoolfile => { type => 'text' }, + chart_id => { type => 'integer' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/TaxKey.pm b/SL/DB/MetaSetup/TaxKey.pm new file mode 100644 index 000000000..087903fa8 --- /dev/null +++ b/SL/DB/MetaSetup/TaxKey.pm @@ -0,0 +1,32 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::TaxKey; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'taxkeys', + + columns => [ + id => { type => 'integer', not_null => 1, sequence => 'id' }, + chart_id => { type => 'integer' }, + tax_id => { type => 'integer' }, + taxkey_id => { type => 'integer' }, + pos_ustva => { type => 'integer' }, + startdate => { type => 'date' }, + ], + + primary_key_columns => [ 'id' ], + + foreign_keys => [ + tax => { + class => 'SL::DB::Tax', + key_columns => { tax_id => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/TaxZone.pm b/SL/DB/MetaSetup/TaxZone.pm new file mode 100644 index 000000000..5823d6833 --- /dev/null +++ b/SL/DB/MetaSetup/TaxZone.pm @@ -0,0 +1,21 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::TaxZone; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'tax_zones', + + columns => [ + id => { type => 'integer', not_null => 1 }, + description => { type => 'text' }, + ], + + primary_key_columns => [ 'id' ], +); + +1; +; diff --git a/SL/DB/MetaSetup/TodoUserConfig.pm b/SL/DB/MetaSetup/TodoUserConfig.pm new file mode 100644 index 000000000..2be46cd10 --- /dev/null +++ b/SL/DB/MetaSetup/TodoUserConfig.pm @@ -0,0 +1,33 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::TodoUserConfig; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'todo_user_config', + + columns => [ + employee_id => { type => 'integer', not_null => 1 }, + show_after_login => { type => 'boolean', default => 'true' }, + show_follow_ups => { type => 'boolean', default => 'true' }, + show_follow_ups_login => { type => 'boolean', default => 'true' }, + show_overdue_sales_quotations => { type => 'boolean', default => 'true' }, + show_overdue_sales_quotations_login => { type => 'boolean', default => 'true' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + foreign_keys => [ + employee => { + class => 'SL::DB::Employee', + key_columns => { employee_id => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/Translation.pm b/SL/DB/MetaSetup/Translation.pm new file mode 100644 index 000000000..acd9606ac --- /dev/null +++ b/SL/DB/MetaSetup/Translation.pm @@ -0,0 +1,28 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::Translation; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'translation', + + columns => [ + parts_id => { type => 'integer' }, + language_id => { type => 'integer' }, + translation => { type => 'text' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + longdescription => { type => 'text' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/MetaSetup/TranslationPaymentTerm.pm b/SL/DB/MetaSetup/TranslationPaymentTerm.pm new file mode 100644 index 000000000..9f1fa1ced --- /dev/null +++ b/SL/DB/MetaSetup/TranslationPaymentTerm.pm @@ -0,0 +1,35 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::TranslationPaymentTerm; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'translation_payment_terms', + + columns => [ + payment_terms_id => { type => 'integer', not_null => 1 }, + language_id => { type => 'integer', not_null => 1 }, + description_long => { type => 'text' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + foreign_keys => [ + language => { + class => 'SL::DB::Language', + key_columns => { language_id => 'id' }, + }, + + payment_terms => { + class => 'SL::DB::PaymentTerm', + key_columns => { payment_terms_id => 'id' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/UnitsLanguage.pm b/SL/DB/MetaSetup/UnitsLanguage.pm new file mode 100644 index 000000000..cd00dc869 --- /dev/null +++ b/SL/DB/MetaSetup/UnitsLanguage.pm @@ -0,0 +1,36 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::UnitsLanguage; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'units_language', + + columns => [ + unit => { type => 'varchar', length => 20, not_null => 1 }, + language_id => { type => 'integer', not_null => 1 }, + localized => { type => 'varchar', length => 20 }, + localized_plural => { type => 'varchar', length => 20 }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + foreign_keys => [ + language => { + class => 'SL::DB::Language', + key_columns => { language_id => 'id' }, + }, + + unit_obj => { + class => 'SL::DB::Unit', + key_columns => { unit => 'name' }, + }, + ], +); + +1; +; diff --git a/SL/DB/MetaSetup/VendorTax.pm b/SL/DB/MetaSetup/VendorTax.pm new file mode 100644 index 000000000..bbd3988f1 --- /dev/null +++ b/SL/DB/MetaSetup/VendorTax.pm @@ -0,0 +1,26 @@ +# This file has been auto-generated. Do not modify it; it will be overwritten +# by rose_auto_create_model.pl automatically. +package SL::DB::VendorTax; + +use strict; + +use base qw(SL::DB::Object); + +__PACKAGE__->meta->setup( + table => 'vendortax', + + columns => [ + vendor_id => { type => 'integer' }, + chart_id => { type => 'integer' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + id => { type => 'serial', not_null => 1 }, + ], + + primary_key_columns => [ 'id' ], + + allow_inline_column_values => 1, +); + +1; +; diff --git a/SL/DB/PartsGroup.pm b/SL/DB/PartsGroup.pm new file mode 100644 index 000000000..88ab22fd7 --- /dev/null +++ b/SL/DB/PartsGroup.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::PartsGroup; + +use strict; + +use SL::DB::MetaSetup::PartsGroup; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/PartsTax.pm b/SL/DB/PartsTax.pm new file mode 100644 index 000000000..3bea19be4 --- /dev/null +++ b/SL/DB/PartsTax.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::PartsTax; + +use strict; + +use SL::DB::MetaSetup::PartsTax; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Prices.pm b/SL/DB/Prices.pm new file mode 100644 index 000000000..45d54a0b2 --- /dev/null +++ b/SL/DB/Prices.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::Prices; + +use strict; + +use SL::DB::MetaSetup::Prices; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/RMAItem.pm b/SL/DB/RMAItem.pm new file mode 100644 index 000000000..c62e80765 --- /dev/null +++ b/SL/DB/RMAItem.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::RMAItem; + +use strict; + +use SL::DB::MetaSetup::RMAItem; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/RecordLink.pm b/SL/DB/RecordLink.pm new file mode 100644 index 000000000..7aed15a77 --- /dev/null +++ b/SL/DB/RecordLink.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::RecordLink; + +use strict; + +use SL::DB::MetaSetup::RecordLink; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Status.pm b/SL/DB/Status.pm new file mode 100644 index 000000000..38d230e29 --- /dev/null +++ b/SL/DB/Status.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::Status; + +use strict; + +use SL::DB::MetaSetup::Status; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/TaxKey.pm b/SL/DB/TaxKey.pm new file mode 100644 index 000000000..bd27ccf56 --- /dev/null +++ b/SL/DB/TaxKey.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::TaxKey; + +use strict; + +use SL::DB::MetaSetup::TaxKey; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/TaxZone.pm b/SL/DB/TaxZone.pm new file mode 100644 index 000000000..7e0f2e725 --- /dev/null +++ b/SL/DB/TaxZone.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::TaxZone; + +use strict; + +use SL::DB::MetaSetup::TaxZone; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/TodoUserConfig.pm b/SL/DB/TodoUserConfig.pm new file mode 100644 index 000000000..fd12020bd --- /dev/null +++ b/SL/DB/TodoUserConfig.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::TodoUserConfig; + +use strict; + +use SL::DB::MetaSetup::TodoUserConfig; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/Translation.pm b/SL/DB/Translation.pm new file mode 100644 index 000000000..841a3a86a --- /dev/null +++ b/SL/DB/Translation.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::Translation; + +use strict; + +use SL::DB::MetaSetup::Translation; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/TranslationPaymentTerm.pm b/SL/DB/TranslationPaymentTerm.pm new file mode 100644 index 000000000..92cf84a5e --- /dev/null +++ b/SL/DB/TranslationPaymentTerm.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::TranslationPaymentTerm; + +use strict; + +use SL::DB::MetaSetup::TranslationPaymentTerm; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/UnitsLanguage.pm b/SL/DB/UnitsLanguage.pm new file mode 100644 index 000000000..256da5fd9 --- /dev/null +++ b/SL/DB/UnitsLanguage.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::UnitsLanguage; + +use strict; + +use SL::DB::MetaSetup::UnitsLanguage; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/SL/DB/VendorTax.pm b/SL/DB/VendorTax.pm new file mode 100644 index 000000000..a4c6fc914 --- /dev/null +++ b/SL/DB/VendorTax.pm @@ -0,0 +1,13 @@ +# This file has been auto-generated only because it didn't exist. +# Feel free to modify it at will; it will not be overwritten automatically. + +package SL::DB::VendorTax; + +use strict; + +use SL::DB::MetaSetup::VendorTax; + +# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. +__PACKAGE__->meta->make_manager_class; + +1; diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index b86ce78a1..2f0ee8175 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -727,4 +727,13 @@ sub gl_transaction { $main::lxdebug->leave_sub(); } +if ($::use_rdbo) { + eval { + require SL::DB::Helpers::Mappings; + sub db { + goto &SL::DB::Helpers::Mappings::db; + } + } or die $@; +} + 1; diff --git a/config/lx-erp.conf b/config/lx-erp.conf index e388b8511..225098ab5 100644 --- a/config/lx-erp.conf +++ b/config/lx-erp.conf @@ -1,8 +1,12 @@ use Cwd; -use vars qw($dbcharset $eur $ghostscript_bin $html2ps_bin $language $latex_bin $latex_templates $lizenzen $memberfile - $opendocument_templates $openofficeorg_daemon $openofficeorg_daemon_port $openofficeorg_writer_bin - $pg_dump_exe $pg_restore_exe $sendmail $show_best_before $sid $spool $templates $userspath $vertreter $webdav $xvfb_bin); +use vars qw( +$dbcharset $eur $ghostscript_bin $html2ps_bin $language $latex_bin +$latex_templates $lizenzen $memberfile $opendocument_templates +$openofficeorg_daemon $openofficeorg_daemon_port $openofficeorg_writer_bin +$pg_dump_exe $pg_restore_exe $sendmail $show_best_before $sid $spool $templates +$use_rdbo $userspath $vertreter $webdav $xvfb_bin +); # path to user configuration files $userspath = "users"; @@ -92,6 +96,13 @@ $latex_bin = 'pdflatex'; $pg_dump_exe = "pg_dump"; $pg_restore_exe = "pg_restore"; +# Rose::DB::Object Environment laden. +# Die RDBO Klassen bieten für Addon Schreiber sehr einfache Interfaces zu den +# bestehenden Klassen, haben aber den Nachteil, dass der Start des Programms +# etwa 2s mehr dauert. Damit fällt die Möglichkeit Lx-Office über CGI zu +# betreiben weg. +$use_rdbo = 1; + # Globale Debug-Ausgaben (de-)aktivieren? Moegliche Werte sind # LXDebug::NONE - keine Debugausgaben # LXDebug::INFO diff --git a/sql/Pg-upgrade2/schema_nomalization_2.sql b/sql/Pg-upgrade2/schema_nomalization_2.sql new file mode 100644 index 000000000..61143bb41 --- /dev/null +++ b/sql/Pg-upgrade2/schema_nomalization_2.sql @@ -0,0 +1,30 @@ +-- @tag: schema_normalization_2 +-- @description: Datenbankschema Normalisierungen Teil 2 +-- @depends: schema_normalization_1 + +ALTER TABLE acc_trans ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE audittrail ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE customertax ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE datev ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE defaults ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE department ADD PRIMARY KEY (id); +ALTER TABLE dpt_trans ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE exchangerate ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE finanzamt ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE follow_up_access ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE gifi ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE inventory ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE licenseinvoice ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE leads ADD PRIMARY KEY (id); +ALTER TABLE partsgroup ADD PRIMARY KEY (id); +ALTER TABLE partstax ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE prices ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE record_links ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE rmaitems ADD PRIMARY KEY (id); +ALTER TABLE status ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE tax_zones ADD PRIMARY KEY (id); +ALTER TABLE todo_user_config ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE translation ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE translation_payment_terms ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE units_language ADD COLUMN id SERIAL PRIMARY KEY; +ALTER TABLE vendortax ADD COLUMN id SERIAL PRIMARY KEY; -- 2.20.1