From 3eb3d1b144adb92e62de08e67dc6ff3d39bf7483 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 1 Jul 2013 19:00:58 +0200 Subject: [PATCH] =?utf8?q?MetaSetup:=20Spalten-=20und=20Fremdschl=C3=BCsse?= =?utf8?q?lnamen=20alphabetisch=20sortieren?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/MetaSetup/AccTransaction.pm | 24 ++-- SL/DB/MetaSetup/Assembly.pm | 10 +- SL/DB/MetaSetup/AuditTrail.pm | 12 +- SL/DB/MetaSetup/BackgroundJob.pm | 12 +- SL/DB/MetaSetup/BackgroundJobHistory.pm | 8 +- SL/DB/MetaSetup/BankAccount.pm | 8 +- SL/DB/MetaSetup/Bin.pm | 6 +- SL/DB/MetaSetup/Buchungsgruppe.pm | 14 +-- SL/DB/MetaSetup/Business.pm | 8 +- SL/DB/MetaSetup/Chart.pm | 18 ++- SL/DB/MetaSetup/Contact.pm | 36 +++--- SL/DB/MetaSetup/CsvImportProfile.pm | 6 +- SL/DB/MetaSetup/CsvImportProfileSetting.pm | 4 +- SL/DB/MetaSetup/CsvImportReport.pm | 8 +- SL/DB/MetaSetup/CsvImportReportRow.pm | 6 +- SL/DB/MetaSetup/CsvImportReportStatus.pm | 4 +- SL/DB/MetaSetup/Currency.pm | 2 - SL/DB/MetaSetup/CustomVariable.pm | 14 +-- SL/DB/MetaSetup/CustomVariableConfig.pm | 20 ++-- SL/DB/MetaSetup/CustomVariableValidity.pm | 6 +- SL/DB/MetaSetup/Customer.pm | 72 ++++++------ SL/DB/MetaSetup/Datev.pm | 12 +- SL/DB/MetaSetup/Default.pm | 130 ++++++++++----------- SL/DB/MetaSetup/DeliveryOrder.pm | 44 ++++--- SL/DB/MetaSetup/DeliveryOrderItem.pm | 32 +++-- SL/DB/MetaSetup/DeliveryOrderItemsStock.pm | 14 +-- SL/DB/MetaSetup/Department.pm | 4 +- SL/DB/MetaSetup/Draft.pm | 10 +- SL/DB/MetaSetup/Dunning.pm | 14 +-- SL/DB/MetaSetup/DunningConfig.pm | 20 ++-- SL/DB/MetaSetup/Employee.pm | 22 ++-- SL/DB/MetaSetup/Exchangerate.pm | 10 +- SL/DB/MetaSetup/Finanzamt.pm | 30 +++-- SL/DB/MetaSetup/FollowUp.pm | 14 +-- SL/DB/MetaSetup/FollowUpAccess.pm | 10 +- SL/DB/MetaSetup/FollowUpLink.pm | 10 +- SL/DB/MetaSetup/GLTransaction.pm | 22 ++-- SL/DB/MetaSetup/GenericTranslation.pm | 6 +- SL/DB/MetaSetup/History.pm | 10 +- SL/DB/MetaSetup/Inventory.pm | 24 ++-- SL/DB/MetaSetup/Invoice.pm | 74 ++++++------ SL/DB/MetaSetup/InvoiceItem.pm | 44 ++++--- SL/DB/MetaSetup/Language.pm | 10 +- SL/DB/MetaSetup/MakeModel.pm | 12 +- SL/DB/MetaSetup/Note.pm | 10 +- SL/DB/MetaSetup/Order.pm | 54 +++++---- SL/DB/MetaSetup/OrderItem.pm | 50 ++++---- SL/DB/MetaSetup/Part.pm | 58 +++++---- SL/DB/MetaSetup/PartsGroup.pm | 4 +- SL/DB/MetaSetup/PaymentTerm.pm | 10 +- SL/DB/MetaSetup/PeriodicInvoice.pm | 8 +- SL/DB/MetaSetup/PeriodicInvoicesConfig.pm | 14 +-- SL/DB/MetaSetup/Price.pm | 6 +- SL/DB/MetaSetup/PriceFactor.pm | 4 +- SL/DB/MetaSetup/Pricegroup.pm | 2 - SL/DB/MetaSetup/Printer.pm | 4 +- SL/DB/MetaSetup/Project.pm | 10 +- SL/DB/MetaSetup/PurchaseInvoice.pm | 50 ++++---- SL/DB/MetaSetup/RecordLink.pm | 10 +- SL/DB/MetaSetup/SchemaInfo.pm | 6 +- SL/DB/MetaSetup/SepaExport.pm | 6 +- SL/DB/MetaSetup/SepaExportItem.pm | 20 ++-- SL/DB/MetaSetup/Shipto.pm | 28 +++-- SL/DB/MetaSetup/Status.pm | 14 +-- SL/DB/MetaSetup/Tax.pm | 14 +-- SL/DB/MetaSetup/TaxKey.pm | 8 +- SL/DB/MetaSetup/TaxZone.pm | 4 +- SL/DB/MetaSetup/TodoUserConfig.pm | 4 +- SL/DB/MetaSetup/TransferType.pm | 8 +- SL/DB/MetaSetup/Translation.pm | 12 +- SL/DB/MetaSetup/Unit.pm | 8 +- SL/DB/MetaSetup/UnitsLanguage.pm | 6 +- SL/DB/MetaSetup/Vendor.pm | 68 ++++++----- SL/DB/MetaSetup/Warehouse.pm | 6 +- scripts/rose_auto_create_model.pl | 21 +++- 75 files changed, 636 insertions(+), 767 deletions(-) diff --git a/SL/DB/MetaSetup/AccTransaction.pm b/SL/DB/MetaSetup/AccTransaction.pm index 7bc07d08e..ae3f0f65e 100644 --- a/SL/DB/MetaSetup/AccTransaction.pm +++ b/SL/DB/MetaSetup/AccTransaction.pm @@ -10,23 +10,23 @@ __PACKAGE__->meta->table('acc_trans'); __PACKAGE__->meta->columns( acc_trans_id => { type => 'bigint', not_null => 1, 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' }, + cb_transaction => { type => 'boolean', default => 'false', not_null => 1 }, + chart_id => { type => 'integer', not_null => 1 }, + chart_link => { type => 'text', not_null => 1 }, cleared => { type => 'boolean', default => 'false', not_null => 1 }, fx_transaction => { type => 'boolean', default => 'false', not_null => 1 }, - ob_transaction => { type => 'boolean', default => 'false', not_null => 1 }, - cb_transaction => { type => 'boolean', default => 'false', not_null => 1 }, - project_id => { type => 'integer' }, - memo => { type => 'text' }, - taxkey => { type => 'integer' }, + gldate => { type => 'date', default => 'now' }, itime => { type => 'timestamp', default => 'now()' }, + memo => { type => 'text' }, mtime => { type => 'timestamp' }, + ob_transaction => { type => 'boolean', default => 'false', not_null => 1 }, + project_id => { type => 'integer' }, + source => { type => 'text' }, tax_id => { type => 'integer', not_null => 1 }, - chart_link => { type => 'text', not_null => 1 }, + taxkey => { type => 'integer' }, + trans_id => { type => 'integer', not_null => 1 }, + transdate => { type => 'date', default => 'now' }, ); __PACKAGE__->meta->primary_key_columns([ 'acc_trans_id' ]); @@ -50,7 +50,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Assembly.pm b/SL/DB/MetaSetup/Assembly.pm index f74883962..2890e8572 100644 --- a/SL/DB/MetaSetup/Assembly.pm +++ b/SL/DB/MetaSetup/Assembly.pm @@ -9,20 +9,18 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('assembly'); __PACKAGE__->meta->columns( - id => { type => 'integer' }, - parts_id => { type => 'integer' }, - qty => { type => 'float', precision => 4 }, + assembly_id => { type => 'serial', not_null => 1 }, bom => { type => 'boolean' }, + id => { type => 'integer' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, - assembly_id => { type => 'serial', not_null => 1 }, + parts_id => { type => 'integer' }, + qty => { type => 'float', precision => 4 }, ); __PACKAGE__->meta->primary_key_columns([ 'assembly_id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/AuditTrail.pm b/SL/DB/MetaSetup/AuditTrail.pm index d86a43f7f..fd8add028 100644 --- a/SL/DB/MetaSetup/AuditTrail.pm +++ b/SL/DB/MetaSetup/AuditTrail.pm @@ -9,19 +9,17 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('audittrail'); __PACKAGE__->meta->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' }, + formname => { type => 'text' }, id => { type => 'serial', not_null => 1 }, + reference => { type => 'text' }, + tablename => { type => 'text' }, + trans_id => { type => 'integer' }, + transdate => { type => 'timestamp', default => 'now' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/BackgroundJob.pm b/SL/DB/MetaSetup/BackgroundJob.pm index 0716443ab..6b1913109 100644 --- a/SL/DB/MetaSetup/BackgroundJob.pm +++ b/SL/DB/MetaSetup/BackgroundJob.pm @@ -9,19 +9,17 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('background_jobs'); __PACKAGE__->meta->columns( + active => { type => 'boolean' }, + cron_spec => { type => 'varchar', length => 255 }, + data => { type => 'text' }, id => { type => 'serial', not_null => 1 }, - type => { type => 'varchar', length => 255 }, - package_name => { type => 'varchar', length => 255 }, last_run_at => { type => 'timestamp' }, next_run_at => { type => 'timestamp' }, - data => { type => 'text' }, - active => { type => 'boolean' }, - cron_spec => { type => 'varchar', length => 255 }, + package_name => { type => 'varchar', length => 255 }, + type => { type => 'varchar', length => 255 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/BackgroundJobHistory.pm b/SL/DB/MetaSetup/BackgroundJobHistory.pm index 6fb3e2b42..24ce17ff1 100644 --- a/SL/DB/MetaSetup/BackgroundJobHistory.pm +++ b/SL/DB/MetaSetup/BackgroundJobHistory.pm @@ -9,18 +9,16 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('background_job_histories'); __PACKAGE__->meta->columns( + data => { type => 'text' }, + error => { type => 'text', alias => 'error_col' }, id => { type => 'serial', not_null => 1 }, package_name => { type => 'varchar', length => 255 }, + result => { type => 'text' }, run_at => { type => 'timestamp' }, status => { type => 'varchar', length => 255 }, - result => { type => 'text' }, - error => { type => 'text', alias => 'error_col' }, - data => { type => 'text' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/BankAccount.pm b/SL/DB/MetaSetup/BankAccount.pm index 94eec593e..d8be5aacf 100644 --- a/SL/DB/MetaSetup/BankAccount.pm +++ b/SL/DB/MetaSetup/BankAccount.pm @@ -9,13 +9,13 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('bank_accounts'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, account_number => { type => 'varchar', length => 100 }, + bank => { type => 'text' }, bank_code => { type => 'varchar', length => 100 }, - iban => { type => 'varchar', length => 100 }, bic => { type => 'varchar', length => 100 }, - bank => { type => 'text' }, chart_id => { type => 'integer', not_null => 1 }, + iban => { type => 'varchar', length => 100 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -27,7 +27,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Bin.pm b/SL/DB/MetaSetup/Bin.pm index df0510361..223276ed6 100644 --- a/SL/DB/MetaSetup/Bin.pm +++ b/SL/DB/MetaSetup/Bin.pm @@ -9,11 +9,11 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('bin'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - warehouse_id => { type => 'integer', not_null => 1 }, description => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, + warehouse_id => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -27,7 +27,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Buchungsgruppe.pm b/SL/DB/MetaSetup/Buchungsgruppe.pm index 8845dbb81..bda9c78bf 100644 --- a/SL/DB/MetaSetup/Buchungsgruppe.pm +++ b/SL/DB/MetaSetup/Buchungsgruppe.pm @@ -9,23 +9,21 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('buchungsgruppen'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, description => { type => 'text' }, - inventory_accno_id => { type => 'integer' }, - income_accno_id_0 => { type => 'integer' }, expense_accno_id_0 => { type => 'integer' }, - income_accno_id_1 => { type => 'integer' }, expense_accno_id_1 => { type => 'integer' }, - income_accno_id_2 => { type => 'integer' }, expense_accno_id_2 => { type => 'integer' }, - income_accno_id_3 => { type => 'integer' }, expense_accno_id_3 => { type => 'integer' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, + income_accno_id_0 => { type => 'integer' }, + income_accno_id_1 => { type => 'integer' }, + income_accno_id_2 => { type => 'integer' }, + income_accno_id_3 => { type => 'integer' }, + inventory_accno_id => { type => 'integer' }, sortkey => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Business.pm b/SL/DB/MetaSetup/Business.pm index d04b2bc05..b522f7c87 100644 --- a/SL/DB/MetaSetup/Business.pm +++ b/SL/DB/MetaSetup/Business.pm @@ -9,20 +9,18 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('business'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, + customernumberinit => { type => 'text' }, description => { type => 'text' }, discount => { type => 'float', precision => 4 }, - customernumberinit => { type => 'text' }, - salesman => { type => 'boolean', default => 'false' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, + salesman => { type => 'boolean', default => 'false' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Chart.pm b/SL/DB/MetaSetup/Chart.pm index 980b2bd5d..5d041276c 100644 --- a/SL/DB/MetaSetup/Chart.pm +++ b/SL/DB/MetaSetup/Chart.pm @@ -9,20 +9,20 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('chart'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, accno => { type => 'text', not_null => 1 }, - description => { type => 'text' }, - charttype => { type => 'character', default => 'A', length => 1 }, category => { type => 'character', length => 1 }, - link => { type => 'text', not_null => 1 }, - taxkey_id => { type => 'integer' }, - pos_bwa => { type => 'integer' }, - pos_bilanz => { type => 'integer' }, - pos_eur => { type => 'integer' }, + charttype => { type => 'character', default => 'A', length => 1 }, datevautomatik => { type => 'boolean', default => 'false' }, + description => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, + link => { type => 'text', not_null => 1 }, mtime => { type => 'timestamp' }, new_chart_id => { type => 'integer' }, + pos_bilanz => { type => 'integer' }, + pos_bwa => { type => 'integer' }, + pos_eur => { type => 'integer' }, + taxkey_id => { type => 'integer' }, valid_from => { type => 'date' }, ); @@ -32,7 +32,5 @@ __PACKAGE__->meta->unique_keys([ 'accno' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Contact.pm b/SL/DB/MetaSetup/Contact.pm index 4287a561d..8a749bb3c 100644 --- a/SL/DB/MetaSetup/Contact.pm +++ b/SL/DB/MetaSetup/Contact.pm @@ -9,38 +9,36 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('contacts'); __PACKAGE__->meta->columns( - cp_id => { type => 'integer', not_null => 1, sequence => 'id' }, + cp_abteilung => { type => 'text' }, + cp_birthday => { type => 'date' }, + cp_city => { type => 'text' }, cp_cv_id => { type => 'integer' }, - cp_title => { type => 'varchar', length => 75 }, - cp_givenname => { type => 'varchar', length => 75 }, - cp_name => { type => 'varchar', length => 75 }, cp_email => { type => 'text' }, - cp_phone1 => { type => 'varchar', length => 75 }, - cp_phone2 => { type => 'varchar', length => 75 }, - itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, cp_fax => { type => 'text' }, + cp_gender => { type => 'character', length => 1 }, + cp_givenname => { type => 'varchar', length => 75 }, + cp_id => { type => 'integer', not_null => 1, sequence => 'id' }, cp_mobile1 => { type => 'text' }, cp_mobile2 => { type => 'text' }, - cp_satphone => { type => 'text' }, - cp_satfax => { type => 'text' }, - cp_project => { type => 'text' }, - cp_privatphone => { type => 'text' }, + cp_name => { type => 'varchar', length => 75 }, + cp_phone1 => { type => 'varchar', length => 75 }, + cp_phone2 => { type => 'varchar', length => 75 }, + cp_position => { type => 'varchar', length => 75 }, cp_privatemail => { type => 'text' }, - cp_abteilung => { type => 'text' }, - cp_gender => { type => 'character', length => 1 }, + cp_privatphone => { type => 'text' }, + cp_project => { type => 'text' }, + cp_satfax => { type => 'text' }, + cp_satphone => { type => 'text' }, cp_street => { type => 'text' }, + cp_title => { type => 'varchar', length => 75 }, cp_zipcode => { type => 'text' }, - cp_city => { type => 'text' }, - cp_birthday => { type => 'date' }, - cp_position => { type => 'varchar', length => 75 }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, ); __PACKAGE__->meta->primary_key_columns([ 'cp_id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/CsvImportProfile.pm b/SL/DB/MetaSetup/CsvImportProfile.pm index a435f8000..7a163b231 100644 --- a/SL/DB/MetaSetup/CsvImportProfile.pm +++ b/SL/DB/MetaSetup/CsvImportProfile.pm @@ -10,15 +10,13 @@ __PACKAGE__->meta->table('csv_import_profiles'); __PACKAGE__->meta->columns( id => { type => 'serial', not_null => 1 }, - name => { type => 'text', not_null => 1 }, - type => { type => 'varchar', length => 20, not_null => 1 }, is_default => { type => 'boolean', default => 'false' }, login => { type => 'text' }, + name => { type => 'text', not_null => 1 }, + type => { type => 'varchar', length => 20, not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/CsvImportProfileSetting.pm b/SL/DB/MetaSetup/CsvImportProfileSetting.pm index 17900bd4e..433153923 100644 --- a/SL/DB/MetaSetup/CsvImportProfileSetting.pm +++ b/SL/DB/MetaSetup/CsvImportProfileSetting.pm @@ -9,8 +9,8 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('csv_import_profile_settings'); __PACKAGE__->meta->columns( - id => { type => 'serial', not_null => 1 }, csv_import_profile_id => { type => 'integer', not_null => 1 }, + id => { type => 'serial', not_null => 1 }, key => { type => 'text', not_null => 1 }, value => { type => 'text' }, ); @@ -26,7 +26,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/CsvImportReport.pm b/SL/DB/MetaSetup/CsvImportReport.pm index 23d411b96..9b2fc3972 100644 --- a/SL/DB/MetaSetup/CsvImportReport.pm +++ b/SL/DB/MetaSetup/CsvImportReport.pm @@ -9,12 +9,12 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('csv_import_reports'); __PACKAGE__->meta->columns( + file => { type => 'text', not_null => 1 }, id => { type => 'serial', not_null => 1 }, - session_id => { type => 'text', not_null => 1 }, + numrows => { type => 'integer', not_null => 1 }, profile_id => { type => 'integer', not_null => 1 }, + session_id => { type => 'text', not_null => 1 }, type => { type => 'text', not_null => 1 }, - file => { type => 'text', not_null => 1 }, - numrows => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -26,7 +26,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/CsvImportReportRow.pm b/SL/DB/MetaSetup/CsvImportReportRow.pm index 9814a64ed..0dea93e91 100644 --- a/SL/DB/MetaSetup/CsvImportReportRow.pm +++ b/SL/DB/MetaSetup/CsvImportReportRow.pm @@ -9,9 +9,9 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('csv_import_report_rows'); __PACKAGE__->meta->columns( - id => { type => 'serial', not_null => 1 }, - csv_import_report_id => { type => 'integer', not_null => 1 }, col => { type => 'integer', not_null => 1 }, + csv_import_report_id => { type => 'integer', not_null => 1 }, + id => { type => 'serial', not_null => 1 }, row => { type => 'integer', not_null => 1 }, value => { type => 'text' }, ); @@ -25,7 +25,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/CsvImportReportStatus.pm b/SL/DB/MetaSetup/CsvImportReportStatus.pm index 89f02a417..f816079bf 100644 --- a/SL/DB/MetaSetup/CsvImportReportStatus.pm +++ b/SL/DB/MetaSetup/CsvImportReportStatus.pm @@ -9,8 +9,8 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('csv_import_report_status'); __PACKAGE__->meta->columns( - id => { type => 'serial', not_null => 1 }, csv_import_report_id => { type => 'integer', not_null => 1 }, + id => { type => 'serial', not_null => 1 }, row => { type => 'integer', not_null => 1 }, type => { type => 'text', not_null => 1 }, value => { type => 'text' }, @@ -25,7 +25,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Currency.pm b/SL/DB/MetaSetup/Currency.pm index 40bb6ee6e..5d7d6138d 100644 --- a/SL/DB/MetaSetup/Currency.pm +++ b/SL/DB/MetaSetup/Currency.pm @@ -17,7 +17,5 @@ __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->unique_keys([ 'name' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/CustomVariable.pm b/SL/DB/MetaSetup/CustomVariable.pm index 907d78d58..81af026fb 100644 --- a/SL/DB/MetaSetup/CustomVariable.pm +++ b/SL/DB/MetaSetup/CustomVariable.pm @@ -9,16 +9,16 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('custom_variables'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'custom_variables_id' }, - config_id => { type => 'integer', not_null => 1 }, - trans_id => { type => 'integer', not_null => 1 }, bool_value => { type => 'boolean' }, - timestamp_value => { type => 'timestamp' }, - text_value => { type => 'text' }, - number_value => { type => 'numeric', precision => 5, scale => 25 }, + config_id => { type => 'integer', not_null => 1 }, + id => { type => 'integer', not_null => 1, sequence => 'custom_variables_id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, + number_value => { type => 'numeric', precision => 5, scale => 25 }, sub_module => { type => 'text', default => '', not_null => 1 }, + text_value => { type => 'text' }, + timestamp_value => { type => 'timestamp' }, + trans_id => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -32,7 +32,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/CustomVariableConfig.pm b/SL/DB/MetaSetup/CustomVariableConfig.pm index 9ebed947e..fb89589b6 100644 --- a/SL/DB/MetaSetup/CustomVariableConfig.pm +++ b/SL/DB/MetaSetup/CustomVariableConfig.pm @@ -9,27 +9,25 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('custom_variable_configs'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'custom_variable_configs_id' }, - name => { type => 'text', not_null => 1 }, - description => { type => 'text', not_null => 1 }, - type => { type => 'text', not_null => 1 }, - module => { type => 'text', not_null => 1 }, default_value => { type => 'text' }, - options => { type => 'text' }, - searchable => { type => 'boolean', not_null => 1 }, + description => { type => 'text', not_null => 1 }, + flags => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'custom_variable_configs_id' }, includeable => { type => 'boolean', not_null => 1 }, included_by_default => { type => 'boolean', not_null => 1 }, - sortkey => { type => 'integer', not_null => 1 }, itime => { type => 'timestamp', default => 'now()' }, + module => { type => 'text', not_null => 1 }, mtime => { type => 'timestamp' }, - flags => { type => 'text' }, + name => { type => 'text', not_null => 1 }, + options => { type => 'text' }, + searchable => { type => 'boolean', not_null => 1 }, + sortkey => { type => 'integer', not_null => 1 }, + type => { type => 'text', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/CustomVariableValidity.pm b/SL/DB/MetaSetup/CustomVariableValidity.pm index 3757ddcc1..a3750b7e1 100644 --- a/SL/DB/MetaSetup/CustomVariableValidity.pm +++ b/SL/DB/MetaSetup/CustomVariableValidity.pm @@ -9,10 +9,10 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('custom_variables_validity'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, config_id => { type => 'integer', not_null => 1 }, - trans_id => { type => 'integer', not_null => 1 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, + trans_id => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -26,7 +26,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Customer.pm b/SL/DB/MetaSetup/Customer.pm index bd54c07e5..1752d2a16 100644 --- a/SL/DB/MetaSetup/Customer.pm +++ b/SL/DB/MetaSetup/Customer.pm @@ -9,51 +9,51 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('customer'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - name => { type => 'text', not_null => 1 }, - department_1 => { type => 'varchar', length => 75 }, - department_2 => { type => 'varchar', length => 75 }, - street => { type => 'varchar', length => 75 }, - zipcode => { type => 'varchar', length => 10 }, + account_number => { type => 'text' }, + bank => { type => 'text' }, + bank_code => { type => 'text' }, + bcc => { type => 'text' }, + bic => { type => 'varchar', length => 100 }, + business_id => { type => 'integer' }, + c_vendor_id => { type => 'text' }, + cc => { type => 'text' }, city => { type => 'varchar', length => 75 }, - country => { type => 'varchar', length => 75 }, contact => { type => 'text' }, - phone => { type => 'text' }, - fax => { type => 'varchar', length => 30 }, - homepage => { type => 'text' }, - email => { type => 'text' }, - notes => { type => 'text' }, - discount => { type => 'float', precision => 4 }, - taxincluded => { type => 'boolean' }, + country => { type => 'varchar', length => 75 }, creditlimit => { type => 'numeric', default => '0', precision => 5, scale => 15 }, - terms => { type => 'integer', default => '0' }, + currency_id => { type => 'integer', not_null => 1 }, customernumber => { type => 'text' }, - cc => { type => 'text' }, - bcc => { type => 'text' }, - business_id => { type => 'integer' }, - taxnumber => { type => 'text' }, - account_number => { type => 'text' }, - bank_code => { type => 'text' }, - bank => { type => 'text' }, - language => { type => 'varchar', length => 5 }, + department_1 => { type => 'varchar', length => 75 }, + department_2 => { type => 'varchar', length => 75 }, + direct_debit => { type => 'boolean', default => 'false' }, + discount => { type => 'float', precision => 4 }, + email => { type => 'text' }, + fax => { type => 'varchar', length => 30 }, + greeting => { type => 'text' }, + homepage => { type => 'text' }, + iban => { type => 'varchar', length => 100 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - obsolete => { type => 'boolean', default => 'false' }, - username => { type => 'varchar', length => 50 }, - user_password => { type => 'text' }, - salesman_id => { type => 'integer' }, - c_vendor_id => { type => 'text' }, klass => { type => 'integer', default => '0' }, + language => { type => 'varchar', length => 5 }, language_id => { type => 'integer' }, + mtime => { type => 'timestamp' }, + name => { type => 'text', not_null => 1 }, + notes => { type => 'text' }, + obsolete => { type => 'boolean', default => 'false' }, payment_id => { type => 'integer' }, + phone => { type => 'text' }, + salesman_id => { type => 'integer' }, + street => { type => 'varchar', length => 75 }, + taxincluded => { type => 'boolean' }, + taxincluded_checked => { type => 'boolean' }, + taxnumber => { type => 'text' }, taxzone_id => { type => 'integer', default => '0', not_null => 1 }, - greeting => { type => 'text' }, + terms => { type => 'integer', default => '0' }, + user_password => { type => 'text' }, + username => { type => 'varchar', length => 50 }, ustid => { type => 'text' }, - direct_debit => { type => 'boolean', default => 'false' }, - iban => { type => 'varchar', length => 100 }, - bic => { type => 'varchar', length => 100 }, - taxincluded_checked => { type => 'boolean' }, - currency_id => { type => 'integer', not_null => 1 }, + zipcode => { type => 'varchar', length => 10 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -82,7 +82,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Datev.pm b/SL/DB/MetaSetup/Datev.pm index c0d7feee9..0b187c508 100644 --- a/SL/DB/MetaSetup/Datev.pm +++ b/SL/DB/MetaSetup/Datev.pm @@ -9,22 +9,20 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('datev'); __PACKAGE__->meta->columns( - beraternr => { type => 'varchar', length => 7 }, + abrechnungsnr => { type => 'varchar', length => 6 }, beratername => { type => 'varchar', length => 9 }, - mandantennr => { type => 'varchar', length => 5 }, - dfvkz => { type => 'varchar', length => 2 }, + beraternr => { type => 'varchar', length => 7 }, datentraegernr => { type => 'varchar', length => 3 }, - abrechnungsnr => { type => 'varchar', length => 6 }, + dfvkz => { type => 'varchar', length => 2 }, + id => { type => 'serial', not_null => 1 }, itime => { type => 'timestamp', default => 'now()' }, + mandantennr => { type => 'varchar', length => 5 }, mtime => { type => 'timestamp' }, - id => { type => 'serial', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index 95ced883d..f6e5ffcb3 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -9,86 +9,86 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('defaults'); __PACKAGE__->meta->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' }, - weightunit => { type => 'varchar', length => 5 }, + accounting_method => { type => 'text' }, + address => { type => 'text' }, + ap_changeable => { type => 'integer', default => 2, not_null => 1 }, + ap_show_mark_as_paid => { type => 'boolean', default => 'true' }, + ar_changeable => { type => 'integer', default => 2, not_null => 1 }, + ar_paid_accno_id => { type => 'integer' }, + ar_show_mark_as_paid => { type => 'boolean', default => 'true' }, + articlenumber => { type => 'text' }, + assemblynumber => { type => 'text' }, + audittrail => { type => 'boolean', default => 'false' }, + bin_id => { type => 'integer' }, + bin_id_ignore_onhand => { type => 'integer' }, businessnumber => { type => 'text' }, - version => { type => 'varchar', length => 8 }, 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' }, - accounting_method => { type => 'text' }, - inventory_system => { type => 'text' }, - profit_determination => { type => 'text' }, + co_ustid => { type => 'text' }, + coa => { type => 'text' }, + company => { type => 'text' }, + currency_id => { type => 'integer', not_null => 1 }, + customernumber => { type => 'text' }, + datev_check_on_ap_transaction => { type => 'boolean', default => 'true' }, + datev_check_on_ar_transaction => { type => 'boolean', default => 'true' }, + datev_check_on_gl_transaction => { type => 'boolean', default => 'true' }, + datev_check_on_purchase_invoice => { type => 'boolean', default => 'true' }, + datev_check_on_sales_invoice => { type => 'boolean', default => 'true' }, + dunning_ar => { type => 'integer' }, dunning_ar_amount_fee => { type => 'integer' }, dunning_ar_amount_interest => { type => 'integer' }, - dunning_ar => { type => 'integer' }, - pdonumber => { type => 'text' }, - sdonumber => { type => 'text' }, - ar_paid_accno_id => { type => 'integer' }, + duns => { type => 'text' }, + expense_accno_id => { type => 'integer' }, + fxgain_accno_id => { type => 'integer' }, + fxloss_accno_id => { type => 'integer' }, + gl_changeable => { type => 'integer', default => 2, not_null => 1 }, id => { type => 'serial', not_null => 1 }, + income_accno_id => { type => 'integer' }, + inventory_accno_id => { type => 'integer' }, + inventory_system => { type => 'text' }, + invnumber => { type => 'text' }, + ir_changeable => { type => 'integer', default => 2, not_null => 1 }, + ir_show_mark_as_paid => { type => 'boolean', default => 'true' }, + is_changeable => { type => 'integer', default => 2, not_null => 1 }, + is_show_mark_as_paid => { type => 'boolean', default => 'true' }, + itime => { type => 'timestamp', default => 'now()' }, language_id => { type => 'integer' }, - datev_check_on_sales_invoice => { type => 'boolean', default => 'true' }, - datev_check_on_purchase_invoice => { type => 'boolean', default => 'true' }, - datev_check_on_ar_transaction => { type => 'boolean', default => 'true' }, - datev_check_on_ap_transaction => { type => 'boolean', default => 'true' }, - datev_check_on_gl_transaction => { type => 'boolean', default => 'true' }, + max_future_booking_interval => { type => 'integer', default => 360 }, + mtime => { type => 'timestamp' }, + parts_image_css => { type => 'text', default => 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;' }, + parts_listing_image => { type => 'boolean', default => 'true' }, + parts_show_image => { type => 'boolean', default => 'true' }, payments_changeable => { type => 'integer', default => '0', not_null => 1 }, - is_changeable => { type => 'integer', default => 2, not_null => 1 }, - ir_changeable => { type => 'integer', default => 2, not_null => 1 }, - ar_changeable => { type => 'integer', default => 2, not_null => 1 }, - ap_changeable => { type => 'integer', default => 2, not_null => 1 }, - gl_changeable => { type => 'integer', default => 2, not_null => 1 }, - show_bestbefore => { type => 'boolean', default => 'false' }, - sales_order_show_delete => { type => 'boolean', default => 'true' }, + pdonumber => { type => 'text' }, + ponumber => { type => 'text' }, + profit_determination => { type => 'text' }, + purchase_delivery_order_show_delete => { type => 'boolean', default => 'true' }, purchase_order_show_delete => { type => 'boolean', default => 'true' }, + revtrans => { type => 'boolean', default => 'false' }, + rfqnumber => { type => 'text' }, + rmanumber => { type => 'text' }, sales_delivery_order_show_delete => { type => 'boolean', default => 'true' }, - purchase_delivery_order_show_delete => { type => 'boolean', default => 'true' }, - is_show_mark_as_paid => { type => 'boolean', default => 'true' }, - ir_show_mark_as_paid => { type => 'boolean', default => 'true' }, - ar_show_mark_as_paid => { type => 'boolean', default => 'true' }, - ap_show_mark_as_paid => { type => 'boolean', default => 'true' }, - warehouse_id => { type => 'integer' }, - bin_id => { type => 'integer' }, - max_future_booking_interval => { type => 'integer', default => 360 }, - assemblynumber => { type => 'text' }, + sales_order_show_delete => { type => 'boolean', default => 'true' }, + sdonumber => { type => 'text' }, + sepa_creditor_id => { type => 'text' }, + servicenumber => { type => 'text' }, + show_bestbefore => { type => 'boolean', default => 'false' }, show_weight => { type => 'boolean', default => 'false', not_null => 1 }, + sonumber => { type => 'text' }, + sqnumber => { type => 'text' }, + taxnumber => { type => 'text' }, + templates => { type => 'text' }, transfer_default => { type => 'boolean', default => 'true' }, - transfer_default_use_master_default_bin => { type => 'boolean', default => 'false' }, transfer_default_ignore_onhand => { type => 'boolean', default => 'false' }, + transfer_default_use_master_default_bin => { type => 'boolean', default => 'false' }, + vendornumber => { type => 'text' }, + version => { type => 'varchar', length => 8 }, + vertreter => { type => 'boolean', default => 'false' }, + warehouse_id => { type => 'integer' }, warehouse_id_ignore_onhand => { type => 'integer' }, - bin_id_ignore_onhand => { type => 'integer' }, - currency_id => { type => 'integer', not_null => 1 }, - company => { type => 'text' }, - address => { type => 'text' }, - taxnumber => { type => 'text' }, - co_ustid => { type => 'text' }, - duns => { type => 'text' }, - sepa_creditor_id => { type => 'text' }, - templates => { type => 'text' }, webdav => { type => 'boolean', default => 'false' }, webdav_documents => { type => 'boolean', default => 'false' }, - vertreter => { type => 'boolean', default => 'false' }, - parts_show_image => { type => 'boolean', default => 'true' }, - parts_listing_image => { type => 'boolean', default => 'true' }, - parts_image_css => { type => 'text', default => 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;' }, + weightunit => { type => 'varchar', length => 5 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -122,7 +122,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/DeliveryOrder.pm b/SL/DB/MetaSetup/DeliveryOrder.pm index f6e1aabfb..92d45ae14 100644 --- a/SL/DB/MetaSetup/DeliveryOrder.pm +++ b/SL/DB/MetaSetup/DeliveryOrder.pm @@ -9,36 +9,36 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('delivery_orders'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - donumber => { type => 'text', not_null => 1 }, - ordnumber => { type => 'text' }, - transdate => { type => 'date', default => 'now()' }, - vendor_id => { type => 'integer' }, - customer_id => { type => 'integer' }, - reqdate => { type => 'date' }, - shippingpoint => { type => 'text' }, - notes => { type => 'text' }, - intnotes => { type => 'text' }, - employee_id => { type => 'integer' }, closed => { type => 'boolean', default => 'false' }, - delivered => { type => 'boolean', default => 'false' }, + cp_id => { type => 'integer' }, + currency_id => { type => 'integer', not_null => 1 }, cusordnumber => { type => 'text' }, - oreqnumber => { type => 'text' }, + customer_id => { type => 'integer' }, + delivered => { type => 'boolean', default => 'false' }, department_id => { type => 'integer' }, - shipvia => { type => 'text' }, - cp_id => { type => 'integer' }, - language_id => { type => 'integer' }, - shipto_id => { type => 'integer' }, + donumber => { type => 'text', not_null => 1 }, + employee_id => { type => 'integer' }, globalproject_id => { type => 'integer' }, - salesman_id => { type => 'integer' }, - transaction_description => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, + intnotes => { type => 'text' }, is_sales => { type => 'boolean' }, itime => { type => 'timestamp', default => 'now()' }, + language_id => { type => 'integer' }, mtime => { type => 'timestamp' }, - taxzone_id => { type => 'integer' }, + notes => { type => 'text' }, + ordnumber => { type => 'text' }, + oreqnumber => { type => 'text' }, + reqdate => { type => 'date' }, + salesman_id => { type => 'integer' }, + shippingpoint => { type => 'text' }, + shipto_id => { type => 'integer' }, + shipvia => { type => 'text' }, taxincluded => { type => 'boolean' }, + taxzone_id => { type => 'integer' }, terms => { type => 'integer' }, - currency_id => { type => 'integer', not_null => 1 }, + transaction_description => { type => 'text' }, + transdate => { type => 'date', default => 'now()' }, + vendor_id => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -97,7 +97,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/DeliveryOrderItem.pm b/SL/DB/MetaSetup/DeliveryOrderItem.pm index 608e3a32e..7735c9ea8 100644 --- a/SL/DB/MetaSetup/DeliveryOrderItem.pm +++ b/SL/DB/MetaSetup/DeliveryOrderItem.pm @@ -9,29 +9,29 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('delivery_order_items'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'delivery_order_items_id' }, + base_qty => { type => 'float', precision => 4 }, + cusordnumber => { type => 'text' }, delivery_order_id => { type => 'integer', not_null => 1 }, - parts_id => { type => 'integer', not_null => 1 }, description => { type => 'text' }, - qty => { type => 'numeric', precision => 5, scale => 25 }, - sellprice => { type => 'numeric', precision => 5, scale => 15 }, discount => { type => 'float', precision => 4 }, + id => { type => 'integer', not_null => 1, sequence => 'delivery_order_items_id' }, + itime => { type => 'timestamp', default => 'now()' }, + lastcost => { type => 'numeric', precision => 5, scale => 15 }, + longdescription => { type => 'text' }, + marge_price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, + mtime => { type => 'timestamp' }, + ordnumber => { type => 'text' }, + parts_id => { type => 'integer', not_null => 1 }, + price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, + price_factor_id => { type => 'integer' }, + pricegroup_id => { type => 'integer' }, project_id => { type => 'integer' }, + qty => { type => 'numeric', precision => 5, scale => 25 }, reqdate => { type => 'date' }, + sellprice => { type => 'numeric', precision => 5, scale => 15 }, serialnumber => { type => 'text' }, - ordnumber => { type => 'text' }, transdate => { type => 'text' }, - cusordnumber => { type => 'text' }, unit => { type => 'varchar', length => 20 }, - base_qty => { type => 'float', precision => 4 }, - longdescription => { type => 'text' }, - lastcost => { type => 'numeric', precision => 5, scale => 15 }, - price_factor_id => { type => 'integer' }, - price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, - marge_price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, - itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - pricegroup_id => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -65,7 +65,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/DeliveryOrderItemsStock.pm b/SL/DB/MetaSetup/DeliveryOrderItemsStock.pm index 52e78e8ec..4263531f6 100644 --- a/SL/DB/MetaSetup/DeliveryOrderItemsStock.pm +++ b/SL/DB/MetaSetup/DeliveryOrderItemsStock.pm @@ -9,16 +9,16 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('delivery_order_items_stock'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - delivery_order_item_id => { type => 'integer', not_null => 1 }, - qty => { type => 'numeric', not_null => 1, precision => 5, scale => 15 }, - unit => { type => 'varchar', length => 20, not_null => 1 }, - warehouse_id => { type => 'integer', not_null => 1 }, + bestbefore => { type => 'date' }, bin_id => { type => 'integer', not_null => 1 }, chargenumber => { type => 'text' }, + delivery_order_item_id => { type => 'integer', not_null => 1 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, - bestbefore => { type => 'date' }, + qty => { type => 'numeric', not_null => 1, precision => 5, scale => 15 }, + unit => { type => 'varchar', length => 20, not_null => 1 }, + warehouse_id => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -42,7 +42,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Department.pm b/SL/DB/MetaSetup/Department.pm index 244bb7989..f3e049857 100644 --- a/SL/DB/MetaSetup/Department.pm +++ b/SL/DB/MetaSetup/Department.pm @@ -9,8 +9,8 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('department'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, description => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, ); @@ -19,7 +19,5 @@ __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Draft.pm b/SL/DB/MetaSetup/Draft.pm index 0a24c4b48..997167f65 100644 --- a/SL/DB/MetaSetup/Draft.pm +++ b/SL/DB/MetaSetup/Draft.pm @@ -9,13 +9,13 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('drafts'); __PACKAGE__->meta->columns( + description => { type => 'text' }, + employee_id => { type => 'integer' }, + form => { type => 'text' }, id => { type => 'varchar', length => 50, not_null => 1 }, + itime => { type => 'timestamp', default => 'now()' }, module => { type => 'varchar', length => 50, not_null => 1 }, submodule => { type => 'varchar', length => 50, not_null => 1 }, - description => { type => 'text' }, - itime => { type => 'timestamp', default => 'now()' }, - form => { type => 'text' }, - employee_id => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -29,7 +29,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Dunning.pm b/SL/DB/MetaSetup/Dunning.pm index 6e1bb6d76..7de6fc8cf 100644 --- a/SL/DB/MetaSetup/Dunning.pm +++ b/SL/DB/MetaSetup/Dunning.pm @@ -9,18 +9,18 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('dunning'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - trans_id => { type => 'integer' }, + duedate => { type => 'date' }, + dunning_config_id => { type => 'integer' }, dunning_id => { type => 'integer' }, dunning_level => { type => 'integer' }, - transdate => { type => 'date' }, - duedate => { type => 'date' }, fee => { type => 'numeric', precision => 5, scale => 15 }, + fee_interest_ar_id => { type => 'integer' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, interest => { type => 'numeric', precision => 5, scale => 15 }, - dunning_config_id => { type => 'integer' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, - fee_interest_ar_id => { type => 'integer' }, + trans_id => { type => 'integer' }, + transdate => { type => 'date' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -39,7 +39,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/DunningConfig.pm b/SL/DB/MetaSetup/DunningConfig.pm index c041917fb..61e2db30f 100644 --- a/SL/DB/MetaSetup/DunningConfig.pm +++ b/SL/DB/MetaSetup/DunningConfig.pm @@ -9,26 +9,24 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('dunning_config'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - dunning_level => { type => 'integer' }, - dunning_description => { type => 'text' }, active => { type => 'boolean' }, auto => { type => 'boolean' }, + create_invoices_for_fees => { type => 'boolean', default => 'true' }, + dunning_description => { type => 'text' }, + dunning_level => { type => 'integer' }, email => { type => 'boolean' }, - terms => { type => 'integer' }, - payment_terms => { type => 'integer' }, - fee => { type => 'numeric', precision => 5, scale => 15 }, - interest_rate => { type => 'numeric', precision => 5, scale => 15 }, + email_attachment => { type => 'boolean' }, email_body => { type => 'text' }, email_subject => { type => 'text' }, - email_attachment => { type => 'boolean' }, + fee => { type => 'numeric', precision => 5, scale => 15 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, + interest_rate => { type => 'numeric', precision => 5, scale => 15 }, + payment_terms => { type => 'integer' }, template => { type => 'text' }, - create_invoices_for_fees => { type => 'boolean', default => 'true' }, + terms => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Employee.pm b/SL/DB/MetaSetup/Employee.pm index 7fabdc79a..b79d078fa 100644 --- a/SL/DB/MetaSetup/Employee.pm +++ b/SL/DB/MetaSetup/Employee.pm @@ -9,22 +9,22 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('employee'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - login => { type => 'text' }, - startdate => { type => 'date', default => 'now' }, - enddate => { type => 'date' }, - notes => { type => 'text' }, - sales => { type => 'boolean', default => 'true' }, - itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - name => { type => 'text' }, addr1 => { type => 'text' }, addr2 => { type => 'text' }, addr3 => { type => 'text' }, addr4 => { type => 'text' }, + deleted => { type => 'boolean', default => 'false' }, + enddate => { type => 'date' }, homephone => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, + itime => { type => 'timestamp', default => 'now()' }, + login => { type => 'text' }, + mtime => { type => 'timestamp' }, + name => { type => 'text' }, + notes => { type => 'text' }, + sales => { type => 'boolean', default => 'true' }, + startdate => { type => 'date', default => 'now' }, workphone => { type => 'text' }, - deleted => { type => 'boolean', default => 'false' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -33,7 +33,5 @@ __PACKAGE__->meta->unique_keys([ 'login' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Exchangerate.pm b/SL/DB/MetaSetup/Exchangerate.pm index 43df5dfd6..4f83da32a 100644 --- a/SL/DB/MetaSetup/Exchangerate.pm +++ b/SL/DB/MetaSetup/Exchangerate.pm @@ -9,13 +9,13 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('exchangerate'); __PACKAGE__->meta->columns( - transdate => { type => 'date' }, buy => { type => 'numeric', precision => 5, scale => 15 }, - sell => { type => 'numeric', precision => 5, scale => 15 }, + currency_id => { type => 'integer', not_null => 1 }, + id => { type => 'serial', not_null => 1 }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, - id => { type => 'serial', not_null => 1 }, - currency_id => { type => 'integer', not_null => 1 }, + sell => { type => 'numeric', precision => 5, scale => 15 }, + transdate => { type => 'date' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -29,7 +29,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Finanzamt.pm b/SL/DB/MetaSetup/Finanzamt.pm index 6eceffabb..cd44abb04 100644 --- a/SL/DB/MetaSetup/Finanzamt.pm +++ b/SL/DB/MetaSetup/Finanzamt.pm @@ -9,32 +9,30 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('finanzamt'); __PACKAGE__->meta->columns( - fa_land_nr => { type => 'text' }, + fa_bankbezeichnung_1 => { type => 'text' }, + fa_bankbezeichnung_2 => { type => 'text' }, + fa_blz_1 => { type => 'text' }, + fa_blz_2 => { type => 'text' }, fa_bufa_nr => { type => 'text' }, + fa_email => { type => 'text' }, + fa_fax => { type => 'text' }, + fa_internet => { type => 'text' }, + fa_kontonummer_1 => { type => 'text' }, + fa_kontonummer_2 => { type => 'text' }, + fa_land_nr => { type => 'text' }, fa_name => { type => 'text' }, - fa_strasse => { type => 'text' }, - fa_plz => { type => 'text' }, + fa_oeffnungszeiten => { type => 'text' }, fa_ort => { type => 'text' }, - fa_telefon => { type => 'text' }, - fa_fax => { type => 'text' }, + fa_plz => { 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' }, + fa_strasse => { type => 'text' }, + fa_telefon => { type => 'text' }, id => { type => 'serial', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/FollowUp.pm b/SL/DB/MetaSetup/FollowUp.pm index 8f83c6c73..fc461512c 100644 --- a/SL/DB/MetaSetup/FollowUp.pm +++ b/SL/DB/MetaSetup/FollowUp.pm @@ -9,14 +9,14 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('follow_ups'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'follow_up_id' }, - follow_up_date => { type => 'date', not_null => 1 }, + created_by => { type => 'integer', not_null => 1 }, created_for_user => { type => 'integer', not_null => 1 }, done => { type => 'boolean', default => 'false' }, - note_id => { type => 'integer', not_null => 1 }, - created_by => { type => 'integer', not_null => 1 }, + follow_up_date => { type => 'date', not_null => 1 }, + id => { type => 'integer', not_null => 1, sequence => 'follow_up_id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, + note_id => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -26,12 +26,12 @@ __PACKAGE__->meta->allow_inline_column_values(1); __PACKAGE__->meta->foreign_keys( employee => { class => 'SL::DB::Employee', - key_columns => { created_for_user => 'id' }, + key_columns => { created_by => 'id' }, }, employee_obj => { class => 'SL::DB::Employee', - key_columns => { created_by => 'id' }, + key_columns => { created_for_user => 'id' }, }, note => { @@ -40,7 +40,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/FollowUpAccess.pm b/SL/DB/MetaSetup/FollowUpAccess.pm index 55c6f5f14..43d538610 100644 --- a/SL/DB/MetaSetup/FollowUpAccess.pm +++ b/SL/DB/MetaSetup/FollowUpAccess.pm @@ -9,9 +9,9 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('follow_up_access'); __PACKAGE__->meta->columns( - who => { type => 'integer', not_null => 1 }, - what => { type => 'integer', not_null => 1 }, id => { type => 'serial', not_null => 1 }, + what => { type => 'integer', not_null => 1 }, + who => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -19,16 +19,14 @@ __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->foreign_keys( employee => { class => 'SL::DB::Employee', - key_columns => { who => 'id' }, + key_columns => { what => 'id' }, }, employee_obj => { class => 'SL::DB::Employee', - key_columns => { what => 'id' }, + key_columns => { who => 'id' }, }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/FollowUpLink.pm b/SL/DB/MetaSetup/FollowUpLink.pm index 820c16b0d..d6946a6ba 100644 --- a/SL/DB/MetaSetup/FollowUpLink.pm +++ b/SL/DB/MetaSetup/FollowUpLink.pm @@ -9,13 +9,13 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('follow_up_links'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'follow_up_link_id' }, follow_up_id => { type => 'integer', not_null => 1 }, - trans_id => { type => 'integer', not_null => 1 }, - trans_type => { type => 'text', not_null => 1 }, - trans_info => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'follow_up_link_id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, + trans_id => { type => 'integer', not_null => 1 }, + trans_info => { type => 'text' }, + trans_type => { type => 'text', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -29,7 +29,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/GLTransaction.pm b/SL/DB/MetaSetup/GLTransaction.pm index 54dca9aac..33f7121fd 100644 --- a/SL/DB/MetaSetup/GLTransaction.pm +++ b/SL/DB/MetaSetup/GLTransaction.pm @@ -9,22 +9,22 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('gl'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'glid' }, - reference => { type => 'text' }, + cb_transaction => { type => 'boolean' }, + department_id => { type => 'integer' }, description => { type => 'text' }, - transdate => { type => 'date', default => 'now' }, - gldate => { type => 'date', default => 'now' }, employee_id => { type => 'integer' }, - notes => { type => 'text' }, - department_id => { type => 'integer' }, - taxincluded => { type => 'boolean' }, + gldate => { type => 'date', default => 'now' }, + id => { type => 'integer', not_null => 1, sequence => 'glid' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, - type => { type => 'text' }, + notes => { type => 'text' }, + ob_transaction => { type => 'boolean' }, + reference => { type => 'text' }, storno => { type => 'boolean', default => 'false' }, storno_id => { type => 'integer' }, - ob_transaction => { type => 'boolean' }, - cb_transaction => { type => 'boolean' }, + taxincluded => { type => 'boolean' }, + transdate => { type => 'date', default => 'now' }, + type => { type => 'text' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -43,7 +43,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/GenericTranslation.pm b/SL/DB/MetaSetup/GenericTranslation.pm index 94556c76c..863cd3fd0 100644 --- a/SL/DB/MetaSetup/GenericTranslation.pm +++ b/SL/DB/MetaSetup/GenericTranslation.pm @@ -11,9 +11,9 @@ __PACKAGE__->meta->table('generic_translations'); __PACKAGE__->meta->columns( id => { type => 'serial', not_null => 1 }, language_id => { type => 'integer' }, - translation_type => { type => 'varchar', length => 100, not_null => 1 }, - translation_id => { type => 'integer' }, translation => { type => 'text' }, + translation_id => { type => 'integer' }, + translation_type => { type => 'varchar', length => 100, not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -25,7 +25,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/History.pm b/SL/DB/MetaSetup/History.pm index 124867936..ed15384b3 100644 --- a/SL/DB/MetaSetup/History.pm +++ b/SL/DB/MetaSetup/History.pm @@ -9,13 +9,13 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('history_erp'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - trans_id => { type => 'integer' }, - employee_id => { type => 'integer' }, addition => { type => 'text' }, - what_done => { type => 'text' }, + employee_id => { type => 'integer' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, snumbers => { type => 'text' }, + trans_id => { type => 'integer' }, + what_done => { type => 'text' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -29,7 +29,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Inventory.pm b/SL/DB/MetaSetup/Inventory.pm index 68c5b3905..a71f7601e 100644 --- a/SL/DB/MetaSetup/Inventory.pm +++ b/SL/DB/MetaSetup/Inventory.pm @@ -9,23 +9,23 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('inventory'); __PACKAGE__->meta->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' }, + bestbefore => { type => 'date' }, + bin_id => { type => 'integer', not_null => 1 }, + chargenumber => { type => 'text', default => '', not_null => 1 }, + comment => { type => 'text' }, employee_id => { type => 'integer', not_null => 1 }, + id => { type => 'serial', not_null => 1 }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, - bin_id => { type => 'integer', not_null => 1 }, + oe_id => { type => 'integer' }, + orderitems_id => { type => 'integer' }, + parts_id => { type => 'integer', not_null => 1 }, + project_id => { type => 'integer' }, qty => { type => 'numeric', precision => 5, scale => 25 }, + shippingdate => { type => 'date' }, trans_id => { type => 'integer', not_null => 1 }, trans_type_id => { type => 'integer', not_null => 1 }, - project_id => { type => 'integer' }, - chargenumber => { type => 'text', default => '', not_null => 1 }, - comment => { type => 'text' }, - bestbefore => { type => 'date' }, - id => { type => 'serial', not_null => 1 }, + warehouse_id => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -64,7 +64,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Invoice.pm b/SL/DB/MetaSetup/Invoice.pm index 8a942fc45..eedecb4ad 100644 --- a/SL/DB/MetaSetup/Invoice.pm +++ b/SL/DB/MetaSetup/Invoice.pm @@ -9,53 +9,53 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('ar'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'glid' }, - invnumber => { type => 'text', not_null => 1 }, - transdate => { type => 'date', default => 'now' }, - gldate => { type => 'date', default => 'now' }, - customer_id => { type => 'integer' }, - taxincluded => { type => 'boolean' }, amount => { type => 'numeric', precision => 5, scale => 15 }, - netamount => { type => 'numeric', precision => 5, scale => 15 }, - paid => { type => 'numeric', precision => 5, scale => 15 }, + cp_id => { type => 'integer' }, + currency_id => { type => 'integer', not_null => 1 }, + cusordnumber => { type => 'text' }, + customer_id => { type => 'integer' }, datepaid => { type => 'date' }, - duedate => { type => 'date' }, + delivery_customer_id => { type => 'integer' }, + delivery_vendor_id => { type => 'integer' }, deliverydate => { type => 'date' }, - invoice => { type => 'boolean', default => 'false' }, - shippingpoint => { type => 'text' }, - terms => { type => 'integer', default => '0' }, - notes => { type => 'text' }, - ordnumber => { type => 'text' }, + department_id => { type => 'integer' }, + direct_debit => { type => 'boolean', default => 'false' }, + donumber => { type => 'text' }, + duedate => { type => 'date' }, + dunning_config_id => { type => 'integer' }, employee_id => { type => 'integer' }, - quonumber => { type => 'text' }, - cusordnumber => { type => 'text' }, + gldate => { type => 'date', default => 'now' }, + globalproject_id => { type => 'integer' }, + id => { type => 'integer', not_null => 1, sequence => 'glid' }, intnotes => { type => 'text' }, - department_id => { type => 'integer' }, - shipvia => { type => 'text' }, + invnumber => { type => 'text', not_null => 1 }, + invnumber_for_credit_note => { type => 'text' }, + invoice => { type => 'boolean', default => 'false' }, itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - cp_id => { type => 'integer' }, language_id => { type => 'integer' }, - payment_id => { type => 'integer' }, - delivery_customer_id => { type => 'integer' }, - delivery_vendor_id => { type => 'integer' }, - storno => { type => 'boolean', default => 'false' }, - taxzone_id => { type => 'integer' }, - shipto_id => { type => 'integer' }, - type => { type => 'text' }, - dunning_config_id => { type => 'integer' }, + marge_percent => { type => 'numeric', precision => 5, scale => 15 }, + marge_total => { type => 'numeric', precision => 5, scale => 15 }, + mtime => { type => 'timestamp' }, + netamount => { type => 'numeric', precision => 5, scale => 15 }, + notes => { type => 'text' }, orddate => { type => 'date' }, + ordnumber => { type => 'text' }, + paid => { type => 'numeric', precision => 5, scale => 15 }, + payment_id => { type => 'integer' }, quodate => { type => 'date' }, - globalproject_id => { type => 'integer' }, + quonumber => { type => 'text' }, salesman_id => { type => 'integer' }, - transaction_description => { type => 'text' }, + shippingpoint => { type => 'text' }, + shipto_id => { type => 'integer' }, + shipvia => { type => 'text' }, + storno => { type => 'boolean', default => 'false' }, storno_id => { type => 'integer' }, - marge_total => { type => 'numeric', precision => 5, scale => 15 }, - marge_percent => { type => 'numeric', precision => 5, scale => 15 }, - donumber => { type => 'text' }, - invnumber_for_credit_note => { type => 'text' }, - direct_debit => { type => 'boolean', default => 'false' }, - currency_id => { type => 'integer', not_null => 1 }, + taxincluded => { type => 'boolean' }, + taxzone_id => { type => 'integer' }, + terms => { type => 'integer', default => '0' }, + transaction_description => { type => 'text' }, + transdate => { type => 'date', default => 'now' }, + type => { type => 'text' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -124,7 +124,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/InvoiceItem.pm b/SL/DB/MetaSetup/InvoiceItem.pm index 1ab85ef95..d527f76f5 100644 --- a/SL/DB/MetaSetup/InvoiceItem.pm +++ b/SL/DB/MetaSetup/InvoiceItem.pm @@ -9,35 +9,35 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('invoice'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'invoiceid' }, - trans_id => { type => 'integer' }, - parts_id => { type => 'integer' }, - description => { type => 'text' }, - qty => { type => 'float', precision => 4 }, allocated => { type => 'float', precision => 4 }, - sellprice => { type => 'numeric', precision => 5, scale => 15 }, - fxsellprice => { type => 'numeric', precision => 5, scale => 15 }, - discount => { type => 'float', precision => 4 }, assemblyitem => { type => 'boolean', default => 'false' }, - project_id => { type => 'integer' }, + base_qty => { type => 'float', precision => 4 }, + cusordnumber => { type => 'text' }, deliverydate => { type => 'date' }, - serialnumber => { type => 'text' }, + description => { type => 'text' }, + discount => { type => 'float', precision => 4 }, + fxsellprice => { type => 'numeric', precision => 5, scale => 15 }, + id => { type => 'integer', not_null => 1, sequence => 'invoiceid' }, itime => { type => 'timestamp', default => 'now()' }, + lastcost => { type => 'numeric', precision => 5, scale => 15 }, + longdescription => { type => 'text' }, + marge_percent => { type => 'numeric', precision => 5, scale => 15 }, + marge_price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, + marge_total => { type => 'numeric', precision => 5, scale => 15 }, mtime => { type => 'timestamp' }, - pricegroup_id => { type => 'integer' }, ordnumber => { type => 'text' }, + parts_id => { type => 'integer' }, + price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, + price_factor_id => { type => 'integer' }, + pricegroup_id => { type => 'integer' }, + project_id => { type => 'integer' }, + qty => { type => 'float', precision => 4 }, + sellprice => { type => 'numeric', precision => 5, scale => 15 }, + serialnumber => { type => 'text' }, + subtotal => { type => 'boolean', default => 'false' }, + trans_id => { type => 'integer' }, transdate => { type => 'text' }, - cusordnumber => { type => 'text' }, unit => { type => 'varchar', length => 20 }, - base_qty => { type => 'float', precision => 4 }, - subtotal => { type => 'boolean', default => 'false' }, - longdescription => { type => 'text' }, - marge_total => { type => 'numeric', precision => 5, scale => 15 }, - marge_percent => { type => 'numeric', precision => 5, scale => 15 }, - lastcost => { type => 'numeric', precision => 5, scale => 15 }, - price_factor_id => { type => 'integer' }, - price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, - marge_price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -66,7 +66,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Language.pm b/SL/DB/MetaSetup/Language.pm index 4fd03076b..ccf4f8353 100644 --- a/SL/DB/MetaSetup/Language.pm +++ b/SL/DB/MetaSetup/Language.pm @@ -9,22 +9,20 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('language'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - description => { type => 'text' }, - template_code => { type => 'text' }, article_code => { type => 'text' }, + description => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, - output_numberformat => { type => 'text' }, output_dateformat => { type => 'text' }, output_longdates => { type => 'boolean' }, + output_numberformat => { type => 'text' }, + template_code => { type => 'text' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/MakeModel.pm b/SL/DB/MetaSetup/MakeModel.pm index 7d724e861..64f4d2a85 100644 --- a/SL/DB/MetaSetup/MakeModel.pm +++ b/SL/DB/MetaSetup/MakeModel.pm @@ -9,14 +9,14 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('makemodel'); __PACKAGE__->meta->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 }, + itime => { type => 'timestamp', default => 'now()' }, lastcost => { type => 'numeric', precision => 5, scale => 15 }, lastupdate => { type => 'date' }, + make => { type => 'integer' }, + model => { type => 'text' }, + mtime => { type => 'timestamp' }, + parts_id => { type => 'integer' }, sortorder => { type => 'integer' }, ); @@ -24,7 +24,5 @@ __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Note.pm b/SL/DB/MetaSetup/Note.pm index 7d2dd593c..1e94da7aa 100644 --- a/SL/DB/MetaSetup/Note.pm +++ b/SL/DB/MetaSetup/Note.pm @@ -9,14 +9,14 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('notes'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'note_id' }, - subject => { type => 'text' }, body => { type => 'text' }, created_by => { type => 'integer', not_null => 1 }, - trans_id => { type => 'integer' }, - trans_module => { type => 'varchar', length => 10 }, + id => { type => 'integer', not_null => 1, sequence => 'note_id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, + subject => { type => 'text' }, + trans_id => { type => 'integer' }, + trans_module => { type => 'varchar', length => 10 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -30,7 +30,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Order.pm b/SL/DB/MetaSetup/Order.pm index 467b5b4e1..249ea62fc 100644 --- a/SL/DB/MetaSetup/Order.pm +++ b/SL/DB/MetaSetup/Order.pm @@ -9,42 +9,42 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('oe'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - ordnumber => { type => 'text', not_null => 1 }, - transdate => { type => 'date', default => 'now' }, - vendor_id => { type => 'integer' }, - customer_id => { type => 'integer' }, amount => { type => 'numeric', precision => 5, scale => 15 }, - netamount => { type => 'numeric', precision => 5, scale => 15 }, - reqdate => { type => 'date' }, - taxincluded => { type => 'boolean' }, - shippingpoint => { type => 'text' }, - notes => { type => 'text' }, - employee_id => { type => 'integer' }, closed => { type => 'boolean', default => 'false' }, - quotation => { type => 'boolean', default => 'false' }, - quonumber => { type => 'text' }, + cp_id => { type => 'integer' }, + currency_id => { type => 'integer', not_null => 1 }, cusordnumber => { type => 'text' }, - intnotes => { type => 'text' }, + customer_id => { type => 'integer' }, + delivered => { type => 'boolean', default => 'false' }, + delivery_customer_id => { type => 'integer' }, + delivery_vendor_id => { type => 'integer' }, department_id => { type => 'integer' }, + employee_id => { type => 'integer' }, + globalproject_id => { type => 'integer' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, + intnotes => { type => 'text' }, itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - shipvia => { type => 'text' }, - cp_id => { type => 'integer' }, language_id => { type => 'integer' }, + marge_percent => { type => 'numeric', precision => 5, scale => 15 }, + marge_total => { type => 'numeric', precision => 5, scale => 15 }, + mtime => { type => 'timestamp' }, + netamount => { type => 'numeric', precision => 5, scale => 15 }, + notes => { type => 'text' }, + ordnumber => { type => 'text', not_null => 1 }, payment_id => { type => 'integer' }, - delivery_customer_id => { type => 'integer' }, - delivery_vendor_id => { type => 'integer' }, - taxzone_id => { type => 'integer' }, proforma => { type => 'boolean', default => 'false' }, - shipto_id => { type => 'integer' }, - delivered => { type => 'boolean', default => 'false' }, - globalproject_id => { type => 'integer' }, + quonumber => { type => 'text' }, + quotation => { type => 'boolean', default => 'false' }, + reqdate => { type => 'date' }, salesman_id => { type => 'integer' }, + shippingpoint => { type => 'text' }, + shipto_id => { type => 'integer' }, + shipvia => { type => 'text' }, + taxincluded => { type => 'boolean' }, + taxzone_id => { type => 'integer' }, transaction_description => { type => 'text' }, - marge_total => { type => 'numeric', precision => 5, scale => 15 }, - marge_percent => { type => 'numeric', precision => 5, scale => 15 }, - currency_id => { type => 'integer', not_null => 1 }, + transdate => { type => 'date', default => 'now' }, + vendor_id => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -118,7 +118,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/OrderItem.pm b/SL/DB/MetaSetup/OrderItem.pm index dd2fde76e..66d2ad261 100644 --- a/SL/DB/MetaSetup/OrderItem.pm +++ b/SL/DB/MetaSetup/OrderItem.pm @@ -9,33 +9,33 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('orderitems'); __PACKAGE__->meta->columns( - trans_id => { type => 'integer' }, - parts_id => { type => 'integer' }, + base_qty => { type => 'float', precision => 4 }, + cusordnumber => { type => 'text' }, description => { type => 'text' }, - 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()' }, + lastcost => { type => 'numeric', precision => 5, scale => 15 }, + longdescription => { type => 'text' }, + marge_percent => { type => 'numeric', precision => 5, scale => 15 }, + marge_price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, + marge_total => { type => 'numeric', precision => 5, scale => 15 }, mtime => { type => 'timestamp' }, - pricegroup_id => { type => 'integer' }, ordnumber => { type => 'text' }, + parts_id => { type => 'integer' }, + price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, + price_factor_id => { type => 'integer' }, + pricegroup_id => { type => 'integer' }, + project_id => { type => 'integer' }, + qty => { type => 'float', precision => 4 }, + reqdate => { type => 'date' }, + sellprice => { type => 'numeric', precision => 5, scale => 15 }, + serialnumber => { type => 'text' }, + ship => { type => 'float', precision => 4 }, + subtotal => { type => 'boolean', default => 'false' }, + trans_id => { type => 'integer' }, transdate => { type => 'text' }, - cusordnumber => { type => 'text' }, unit => { type => 'varchar', length => 20 }, - base_qty => { type => 'float', precision => 4 }, - subtotal => { type => 'boolean', default => 'false' }, - longdescription => { type => 'text' }, - marge_total => { type => 'numeric', precision => 5, scale => 15 }, - marge_percent => { type => 'numeric', precision => 5, scale => 15 }, - lastcost => { type => 'numeric', precision => 5, scale => 15 }, - price_factor_id => { type => 'integer' }, - price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, - marge_price_factor => { type => 'numeric', default => 1, precision => 5, scale => 15 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -43,6 +43,11 @@ __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); __PACKAGE__->meta->foreign_keys( + order => { + class => 'SL::DB::Order', + key_columns => { trans_id => 'id' }, + }, + part => { class => 'SL::DB::Part', key_columns => { parts_id => 'id' }, @@ -62,14 +67,7 @@ __PACKAGE__->meta->foreign_keys( class => 'SL::DB::Project', key_columns => { project_id => 'id' }, }, - - order => { - class => 'SL::DB::Order', - key_columns => { trans_id => 'id' }, - }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Part.pm b/SL/DB/MetaSetup/Part.pm index 3c5eb76b7..b5e25772c 100644 --- a/SL/DB/MetaSetup/Part.pm +++ b/SL/DB/MetaSetup/Part.pm @@ -9,45 +9,45 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('parts'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - partnumber => { type => 'text', not_null => 1 }, - description => { type => 'text' }, - listprice => { type => 'numeric', precision => 5, scale => 15 }, - sellprice => { type => 'numeric', precision => 5, scale => 15 }, - lastcost => { type => 'numeric', precision => 5, scale => 15 }, - priceupdate => { type => 'date', default => 'now' }, - weight => { type => 'float', precision => 4 }, - notes => { type => 'text' }, - makemodel => { type => 'boolean', default => 'false' }, - assembly => { type => 'boolean', default => 'false' }, alternate => { type => 'boolean', default => 'false' }, - rop => { type => 'float', precision => 4 }, - inventory_accno_id => { type => 'integer' }, - income_accno_id => { type => 'integer' }, - expense_accno_id => { type => 'integer' }, - shop => { type => 'boolean', default => 'false' }, - obsolete => { type => 'boolean', default => 'false' }, + assembly => { type => 'boolean', default => 'false' }, + bin_id => { type => 'integer' }, bom => { type => 'boolean', default => 'false' }, - image => { type => 'text' }, + buchungsgruppen_id => { type => 'integer' }, + description => { type => 'text' }, drawing => { type => 'text' }, - microfiche => { type => 'text' }, - partsgroup_id => { type => 'integer' }, - ve => { type => 'integer' }, + ean => { type => 'text' }, + expense_accno_id => { type => 'integer' }, + formel => { type => 'text' }, gv => { type => 'numeric', precision => 5, scale => 15 }, + has_sernumber => { type => 'boolean', default => 'false' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, + image => { type => 'text' }, + income_accno_id => { type => 'integer' }, + inventory_accno_id => { type => 'integer' }, itime => { type => 'timestamp', default => 'now()' }, + lastcost => { type => 'numeric', precision => 5, scale => 15 }, + listprice => { type => 'numeric', precision => 5, scale => 15 }, + makemodel => { type => 'boolean', default => 'false' }, + microfiche => { type => 'text' }, mtime => { type => 'timestamp' }, - unit => { type => 'varchar', length => 20, not_null => 1 }, - formel => { type => 'text' }, not_discountable => { type => 'boolean', default => 'false' }, - buchungsgruppen_id => { type => 'integer' }, + notes => { type => 'text' }, + obsolete => { type => 'boolean', default => 'false' }, + onhand => { type => 'numeric', default => '0', precision => 5, scale => 25 }, + partnumber => { type => 'text', not_null => 1 }, + partsgroup_id => { type => 'integer' }, payment_id => { type => 'integer' }, - ean => { type => 'text' }, price_factor_id => { type => 'integer' }, - onhand => { type => 'numeric', default => '0', precision => 5, scale => 25 }, + priceupdate => { type => 'date', default => 'now' }, + rop => { type => 'float', precision => 4 }, + sellprice => { type => 'numeric', precision => 5, scale => 15 }, + shop => { type => 'boolean', default => 'false' }, stockable => { type => 'boolean', default => 'false' }, - has_sernumber => { type => 'boolean', default => 'false' }, + unit => { type => 'varchar', length => 20, not_null => 1 }, + ve => { type => 'integer' }, warehouse_id => { type => 'integer' }, - bin_id => { type => 'integer' }, + weight => { type => 'float', precision => 4 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -93,7 +93,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/PartsGroup.pm b/SL/DB/MetaSetup/PartsGroup.pm index 9c7f02d24..ec2d60394 100644 --- a/SL/DB/MetaSetup/PartsGroup.pm +++ b/SL/DB/MetaSetup/PartsGroup.pm @@ -10,16 +10,14 @@ __PACKAGE__->meta->table('partsgroup'); __PACKAGE__->meta->columns( id => { type => 'integer', not_null => 1, sequence => 'id' }, - partsgroup => { type => 'text' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, + partsgroup => { type => 'text' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/PaymentTerm.pm b/SL/DB/MetaSetup/PaymentTerm.pm index 83bd6d289..cba2de7d2 100644 --- a/SL/DB/MetaSetup/PaymentTerm.pm +++ b/SL/DB/MetaSetup/PaymentTerm.pm @@ -9,23 +9,21 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('payment_terms'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, description => { type => 'text' }, description_long => { type => 'text' }, - terms_netto => { type => 'integer' }, - terms_skonto => { type => 'integer' }, - percent_skonto => { type => 'float', precision => 4 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, + percent_skonto => { type => 'float', precision => 4 }, ranking => { type => 'integer' }, sortkey => { type => 'integer', not_null => 1 }, + terms_netto => { type => 'integer' }, + terms_skonto => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/PeriodicInvoice.pm b/SL/DB/MetaSetup/PeriodicInvoice.pm index 5346cfdd3..3e6f1eabc 100644 --- a/SL/DB/MetaSetup/PeriodicInvoice.pm +++ b/SL/DB/MetaSetup/PeriodicInvoice.pm @@ -9,11 +9,11 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('periodic_invoices'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - config_id => { type => 'integer', not_null => 1 }, ar_id => { type => 'integer', not_null => 1 }, - period_start_date => { type => 'date', not_null => 1 }, + config_id => { type => 'integer', not_null => 1 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, + period_start_date => { type => 'date', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -32,7 +32,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm b/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm index 13f1814aa..e914a6449 100644 --- a/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm +++ b/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm @@ -9,18 +9,18 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('periodic_invoices_configs'); __PACKAGE__->meta->columns( + active => { type => 'boolean', default => 'true' }, + ar_chart_id => { type => 'integer', not_null => 1 }, + copies => { type => 'integer' }, + end_date => { type => 'date' }, + extend_automatically_by => { type => 'integer' }, id => { type => 'integer', not_null => 1, sequence => 'id' }, oe_id => { type => 'integer', not_null => 1 }, periodicity => { type => 'varchar', length => 10, not_null => 1 }, print => { type => 'boolean', default => 'false' }, printer_id => { type => 'integer' }, - copies => { type => 'integer' }, - active => { type => 'boolean', default => 'true' }, - terminated => { type => 'boolean', default => 'false' }, start_date => { type => 'date' }, - end_date => { type => 'date' }, - ar_chart_id => { type => 'integer', not_null => 1 }, - extend_automatically_by => { type => 'integer' }, + terminated => { type => 'boolean', default => 'false' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -42,7 +42,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Price.pm b/SL/DB/MetaSetup/Price.pm index 2fec15f4e..d1c35dc8b 100644 --- a/SL/DB/MetaSetup/Price.pm +++ b/SL/DB/MetaSetup/Price.pm @@ -9,10 +9,10 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('prices'); __PACKAGE__->meta->columns( + id => { type => 'serial', not_null => 1 }, parts_id => { type => 'integer' }, - pricegroup_id => { type => 'integer' }, price => { type => 'numeric', precision => 5, scale => 15 }, - id => { type => 'serial', not_null => 1 }, + pricegroup_id => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -29,7 +29,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/PriceFactor.pm b/SL/DB/MetaSetup/PriceFactor.pm index 099b6584f..efdb47fa4 100644 --- a/SL/DB/MetaSetup/PriceFactor.pm +++ b/SL/DB/MetaSetup/PriceFactor.pm @@ -9,15 +9,13 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('price_factors'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, description => { type => 'text' }, factor => { type => 'numeric', precision => 5, scale => 15 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, sortkey => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Pricegroup.pm b/SL/DB/MetaSetup/Pricegroup.pm index 5536d1547..176d4267e 100644 --- a/SL/DB/MetaSetup/Pricegroup.pm +++ b/SL/DB/MetaSetup/Pricegroup.pm @@ -15,7 +15,5 @@ __PACKAGE__->meta->columns( __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Printer.pm b/SL/DB/MetaSetup/Printer.pm index f093e5bb5..92bb73f79 100644 --- a/SL/DB/MetaSetup/Printer.pm +++ b/SL/DB/MetaSetup/Printer.pm @@ -10,14 +10,12 @@ __PACKAGE__->meta->table('printers'); __PACKAGE__->meta->columns( id => { type => 'integer', not_null => 1, sequence => 'id' }, - printer_description => { type => 'text', not_null => 1 }, printer_command => { type => 'text' }, + printer_description => { type => 'text', not_null => 1 }, template_code => { type => 'text' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Project.pm b/SL/DB/MetaSetup/Project.pm index c6b2c42c4..4805568ab 100644 --- a/SL/DB/MetaSetup/Project.pm +++ b/SL/DB/MetaSetup/Project.pm @@ -9,13 +9,13 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('project'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - projectnumber => { type => 'text' }, + active => { type => 'boolean', default => 'true' }, + customer_id => { type => 'integer' }, description => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, - active => { type => 'boolean', default => 'true' }, - customer_id => { type => 'integer' }, + projectnumber => { type => 'text' }, type => { type => 'text' }, valid => { type => 'boolean', default => 'true' }, ); @@ -33,7 +33,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/PurchaseInvoice.pm b/SL/DB/MetaSetup/PurchaseInvoice.pm index cddfacf7e..4b89dca76 100644 --- a/SL/DB/MetaSetup/PurchaseInvoice.pm +++ b/SL/DB/MetaSetup/PurchaseInvoice.pm @@ -9,41 +9,41 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('ap'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'glid' }, - invnumber => { type => 'text', not_null => 1 }, - transdate => { type => 'date', default => 'now' }, - gldate => { type => 'date', default => 'now' }, - vendor_id => { type => 'integer' }, - taxincluded => { type => 'boolean', default => 'false' }, amount => { type => 'numeric', precision => 5, scale => 15 }, - netamount => { type => 'numeric', precision => 5, scale => 15 }, - paid => { type => 'numeric', precision => 5, scale => 15 }, + cp_id => { type => 'integer' }, + currency_id => { type => 'integer', not_null => 1 }, datepaid => { type => 'date' }, + deliverydate => { type => 'date' }, + department_id => { type => 'integer' }, + direct_debit => { type => 'boolean', default => 'false' }, duedate => { type => 'date' }, - invoice => { type => 'boolean', default => 'false' }, - ordnumber => { type => 'text' }, - notes => { type => 'text' }, employee_id => { type => 'integer' }, - quonumber => { type => 'text' }, + gldate => { type => 'date', default => 'now' }, + globalproject_id => { type => 'integer' }, + id => { type => 'integer', not_null => 1, sequence => 'glid' }, intnotes => { type => 'text' }, - department_id => { type => 'integer' }, + invnumber => { type => 'text', not_null => 1 }, + invoice => { type => 'boolean', default => 'false' }, itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - shipvia => { type => 'text' }, - cp_id => { type => 'integer' }, language_id => { type => 'integer' }, + mtime => { type => 'timestamp' }, + netamount => { type => 'numeric', precision => 5, scale => 15 }, + notes => { type => 'text' }, + orddate => { type => 'date' }, + ordnumber => { type => 'text' }, + paid => { type => 'numeric', precision => 5, scale => 15 }, payment_id => { type => 'integer' }, + quodate => { type => 'date' }, + quonumber => { type => 'text' }, + shipvia => { type => 'text' }, storno => { type => 'boolean', default => 'false' }, + storno_id => { type => 'integer' }, + taxincluded => { type => 'boolean', default => 'false' }, taxzone_id => { type => 'integer' }, - type => { type => 'text' }, - orddate => { type => 'date' }, - quodate => { type => 'date' }, - globalproject_id => { type => 'integer' }, transaction_description => { type => 'text' }, - storno_id => { type => 'integer' }, - direct_debit => { type => 'boolean', default => 'false' }, - deliverydate => { type => 'date' }, - currency_id => { type => 'integer', not_null => 1 }, + transdate => { type => 'date', default => 'now' }, + type => { type => 'text' }, + vendor_id => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -97,7 +97,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/RecordLink.pm b/SL/DB/MetaSetup/RecordLink.pm index 7bbd67a27..3daa6c483 100644 --- a/SL/DB/MetaSetup/RecordLink.pm +++ b/SL/DB/MetaSetup/RecordLink.pm @@ -9,19 +9,17 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('record_links'); __PACKAGE__->meta->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()' }, + from_table => { type => 'varchar', length => 50, not_null => 1 }, id => { type => 'serial', not_null => 1 }, + itime => { type => 'timestamp', default => 'now()' }, + to_id => { type => 'integer', not_null => 1 }, + to_table => { type => 'varchar', length => 50, not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/SchemaInfo.pm b/SL/DB/MetaSetup/SchemaInfo.pm index 9eddb4bf7..051886774 100644 --- a/SL/DB/MetaSetup/SchemaInfo.pm +++ b/SL/DB/MetaSetup/SchemaInfo.pm @@ -9,16 +9,14 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('schema_info'); __PACKAGE__->meta->columns( - tag => { type => 'text', not_null => 1 }, - login => { type => 'text' }, itime => { type => 'timestamp', default => 'now()' }, + login => { type => 'text' }, + tag => { type => 'text', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'tag' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/SepaExport.pm b/SL/DB/MetaSetup/SepaExport.pm index 768597a8c..bade321c4 100644 --- a/SL/DB/MetaSetup/SepaExport.pm +++ b/SL/DB/MetaSetup/SepaExport.pm @@ -9,10 +9,10 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('sepa_export'); __PACKAGE__->meta->columns( - id => { type => 'serial', not_null => 1 }, + closed => { type => 'boolean', default => 'false' }, employee_id => { type => 'integer', not_null => 1 }, executed => { type => 'boolean', default => 'false' }, - closed => { type => 'boolean', default => 'false' }, + id => { type => 'serial', not_null => 1 }, itime => { type => 'timestamp', default => 'now()' }, vc => { type => 'varchar', length => 10 }, ); @@ -28,7 +28,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/SepaExportItem.pm b/SL/DB/MetaSetup/SepaExportItem.pm index 40a3fc012..08dd06e18 100644 --- a/SL/DB/MetaSetup/SepaExportItem.pm +++ b/SL/DB/MetaSetup/SepaExportItem.pm @@ -9,21 +9,21 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('sepa_export_items'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - sepa_export_id => { type => 'integer', not_null => 1 }, + amount => { type => 'numeric', precision => 5, scale => 25 }, ap_id => { type => 'integer' }, + ar_id => { type => 'integer' }, chart_id => { type => 'integer', not_null => 1 }, - amount => { type => 'numeric', precision => 5, scale => 25 }, - reference => { type => 'varchar', length => 35 }, - requested_execution_date => { type => 'date' }, + end_to_end_id => { type => 'varchar', length => 35 }, executed => { type => 'boolean', default => 'false' }, execution_date => { type => 'date' }, - our_iban => { type => 'varchar', length => 100 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, our_bic => { type => 'varchar', length => 100 }, - vc_iban => { type => 'varchar', length => 100 }, + our_iban => { type => 'varchar', length => 100 }, + reference => { type => 'varchar', length => 35 }, + requested_execution_date => { type => 'date' }, + sepa_export_id => { type => 'integer', not_null => 1 }, vc_bic => { type => 'varchar', length => 100 }, - end_to_end_id => { type => 'varchar', length => 35 }, - ar_id => { type => 'integer' }, + vc_iban => { type => 'varchar', length => 100 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -50,7 +50,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Shipto.pm b/SL/DB/MetaSetup/Shipto.pm index f7b90d825..bb3a9bcd7 100644 --- a/SL/DB/MetaSetup/Shipto.pm +++ b/SL/DB/MetaSetup/Shipto.pm @@ -9,30 +9,28 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('shipto'); __PACKAGE__->meta->columns( - trans_id => { type => 'integer' }, - shiptoname => { type => 'varchar', length => 75 }, - shiptodepartment_1 => { type => 'varchar', length => 75 }, - shiptodepartment_2 => { type => 'varchar', length => 75 }, - shiptostreet => { type => 'varchar', length => 75 }, - shiptozipcode => { type => 'varchar', length => 75 }, - shiptocity => { type => 'varchar', length => 75 }, - shiptocountry => { type => 'varchar', length => 75 }, - shiptocontact => { type => 'varchar', length => 75 }, - shiptophone => { type => 'varchar', length => 30 }, - shiptofax => { type => 'varchar', length => 30 }, - shiptoemail => { type => 'text' }, itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, module => { type => 'text' }, + mtime => { type => 'timestamp' }, shipto_id => { type => 'integer', not_null => 1, sequence => 'id' }, + shiptocity => { type => 'varchar', length => 75 }, + shiptocontact => { type => 'varchar', length => 75 }, + shiptocountry => { type => 'varchar', length => 75 }, shiptocp_gender => { type => 'text' }, + shiptodepartment_1 => { type => 'varchar', length => 75 }, + shiptodepartment_2 => { type => 'varchar', length => 75 }, + shiptoemail => { type => 'text' }, + shiptofax => { type => 'varchar', length => 30 }, + shiptoname => { type => 'varchar', length => 75 }, + shiptophone => { type => 'varchar', length => 30 }, + shiptostreet => { type => 'varchar', length => 75 }, + shiptozipcode => { type => 'varchar', length => 75 }, + trans_id => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'shipto_id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Status.pm b/SL/DB/MetaSetup/Status.pm index ccc826708..6dd6f8793 100644 --- a/SL/DB/MetaSetup/Status.pm +++ b/SL/DB/MetaSetup/Status.pm @@ -9,22 +9,20 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('status'); __PACKAGE__->meta->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' }, + emailed => { type => 'boolean', default => 'false' }, + formname => { type => 'text' }, + id => { type => 'serial', not_null => 1 }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, - id => { type => 'serial', not_null => 1 }, + printed => { type => 'boolean', default => 'false' }, + spoolfile => { type => 'text' }, + trans_id => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Tax.pm b/SL/DB/MetaSetup/Tax.pm index 9903067e3..b0dc314b8 100644 --- a/SL/DB/MetaSetup/Tax.pm +++ b/SL/DB/MetaSetup/Tax.pm @@ -9,15 +9,15 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('tax'); __PACKAGE__->meta->columns( + chart_categories => { type => 'text', not_null => 1 }, chart_id => { type => 'integer' }, - rate => { type => 'numeric', default => '0', not_null => 1, precision => 5, scale => 15 }, - taxnumber => { type => 'text' }, - taxkey => { type => 'integer', not_null => 1 }, - taxdescription => { type => 'text', not_null => 1 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, - id => { type => 'integer', not_null => 1, sequence => 'id' }, - chart_categories => { type => 'text', not_null => 1 }, + rate => { type => 'numeric', default => '0', not_null => 1, precision => 5, scale => 15 }, + taxdescription => { type => 'text', not_null => 1 }, + taxkey => { type => 'integer', not_null => 1 }, + taxnumber => { type => 'text' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -31,7 +31,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/TaxKey.pm b/SL/DB/MetaSetup/TaxKey.pm index 4265037b5..399f63726 100644 --- a/SL/DB/MetaSetup/TaxKey.pm +++ b/SL/DB/MetaSetup/TaxKey.pm @@ -9,12 +9,12 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('taxkeys'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, chart_id => { type => 'integer', not_null => 1 }, - tax_id => { type => 'integer', not_null => 1 }, - taxkey_id => { type => 'integer', not_null => 1 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, pos_ustva => { type => 'integer' }, startdate => { type => 'date', not_null => 1 }, + tax_id => { type => 'integer', not_null => 1 }, + taxkey_id => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -33,7 +33,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/TaxZone.pm b/SL/DB/MetaSetup/TaxZone.pm index 0190c6367..b29453157 100644 --- a/SL/DB/MetaSetup/TaxZone.pm +++ b/SL/DB/MetaSetup/TaxZone.pm @@ -9,13 +9,11 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('tax_zones'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1 }, description => { type => 'text' }, + id => { type => 'integer', not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/TodoUserConfig.pm b/SL/DB/MetaSetup/TodoUserConfig.pm index 3721e0ffe..1f986dd8d 100644 --- a/SL/DB/MetaSetup/TodoUserConfig.pm +++ b/SL/DB/MetaSetup/TodoUserConfig.pm @@ -10,12 +10,12 @@ __PACKAGE__->meta->table('todo_user_config'); __PACKAGE__->meta->columns( employee_id => { type => 'integer', not_null => 1 }, + id => { type => 'serial', 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 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -27,7 +27,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/TransferType.pm b/SL/DB/MetaSetup/TransferType.pm index f48c36462..7facb0485 100644 --- a/SL/DB/MetaSetup/TransferType.pm +++ b/SL/DB/MetaSetup/TransferType.pm @@ -9,19 +9,17 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('transfer_type'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - direction => { type => 'varchar', length => 10, not_null => 1 }, description => { type => 'text' }, - sortkey => { type => 'integer' }, + direction => { type => 'varchar', length => 10, not_null => 1 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, + sortkey => { type => 'integer' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Translation.pm b/SL/DB/MetaSetup/Translation.pm index 39075c894..5f0ee9705 100644 --- a/SL/DB/MetaSetup/Translation.pm +++ b/SL/DB/MetaSetup/Translation.pm @@ -9,13 +9,13 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('translation'); __PACKAGE__->meta->columns( - parts_id => { type => 'integer' }, - language_id => { type => 'integer' }, - translation => { type => 'text' }, + id => { type => 'serial', not_null => 1 }, itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, + language_id => { type => 'integer' }, longdescription => { type => 'text' }, - id => { type => 'serial', not_null => 1 }, + mtime => { type => 'timestamp' }, + parts_id => { type => 'integer' }, + translation => { type => 'text' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -29,7 +29,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Unit.pm b/SL/DB/MetaSetup/Unit.pm index 0849b4eb3..d8d47afac 100644 --- a/SL/DB/MetaSetup/Unit.pm +++ b/SL/DB/MetaSetup/Unit.pm @@ -9,12 +9,12 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('units'); __PACKAGE__->meta->columns( - name => { type => 'varchar', length => 20, not_null => 1 }, base_unit => { type => 'varchar', length => 20 }, factor => { type => 'numeric', precision => 5, scale => 20 }, - type => { type => 'varchar', length => 20 }, - sortkey => { type => 'integer', not_null => 1 }, id => { type => 'serial', not_null => 1 }, + name => { type => 'varchar', length => 20, not_null => 1 }, + sortkey => { type => 'integer', not_null => 1 }, + type => { type => 'varchar', length => 20 }, ); __PACKAGE__->meta->primary_key_columns([ 'name' ]); @@ -28,7 +28,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/UnitsLanguage.pm b/SL/DB/MetaSetup/UnitsLanguage.pm index f3c20f52c..b85e5d43e 100644 --- a/SL/DB/MetaSetup/UnitsLanguage.pm +++ b/SL/DB/MetaSetup/UnitsLanguage.pm @@ -9,11 +9,11 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('units_language'); __PACKAGE__->meta->columns( - unit => { type => 'varchar', length => 20, not_null => 1 }, + id => { type => 'serial', 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 }, + unit => { type => 'varchar', length => 20, not_null => 1 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -30,7 +30,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Vendor.pm b/SL/DB/MetaSetup/Vendor.pm index 6ba58b5b3..1a691ff6d 100644 --- a/SL/DB/MetaSetup/Vendor.pm +++ b/SL/DB/MetaSetup/Vendor.pm @@ -9,49 +9,49 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('vendor'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, - name => { type => 'varchar', length => 75, not_null => 1 }, - department_1 => { type => 'varchar', length => 75 }, - department_2 => { type => 'varchar', length => 75 }, - street => { type => 'varchar', length => 75 }, - zipcode => { type => 'varchar', length => 10 }, + account_number => { type => 'varchar', length => 15 }, + bank => { type => 'text' }, + bank_code => { type => 'varchar', length => 10 }, + bcc => { type => 'text' }, + bic => { type => 'varchar', length => 100 }, + business_id => { type => 'integer' }, + cc => { type => 'text' }, city => { type => 'varchar', length => 75 }, - country => { type => 'varchar', length => 75 }, contact => { type => 'varchar', length => 75 }, - phone => { type => 'text' }, + country => { type => 'varchar', length => 75 }, + creditlimit => { type => 'numeric', precision => 5, scale => 15 }, + currency_id => { type => 'integer', not_null => 1 }, + department_1 => { type => 'varchar', length => 75 }, + department_2 => { type => 'varchar', length => 75 }, + direct_debit => { type => 'boolean', default => 'false' }, + discount => { type => 'float', precision => 4 }, + email => { type => 'text' }, fax => { type => 'varchar', length => 30 }, + greeting => { type => 'text' }, homepage => { type => 'text' }, - email => { type => 'text' }, - notes => { type => 'text' }, - terms => { type => 'integer', default => '0' }, - taxincluded => { type => 'boolean' }, - vendornumber => { type => 'text' }, - cc => { type => 'text' }, - bcc => { type => 'text' }, - business_id => { type => 'integer' }, - taxnumber => { type => 'text' }, - discount => { type => 'float', precision => 4 }, - creditlimit => { type => 'numeric', precision => 5, scale => 15 }, - account_number => { type => 'varchar', length => 15 }, - bank_code => { type => 'varchar', length => 10 }, - bank => { type => 'text' }, - language => { type => 'varchar', length => 5 }, + iban => { type => 'varchar', length => 100 }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, itime => { type => 'timestamp', default => 'now()' }, + language => { type => 'varchar', length => 5 }, + language_id => { type => 'integer' }, mtime => { type => 'timestamp' }, + name => { type => 'varchar', length => 75, not_null => 1 }, + notes => { type => 'text' }, obsolete => { type => 'boolean', default => 'false' }, - username => { type => 'varchar', length => 50 }, - user_password => { type => 'varchar', length => 12 }, - salesman_id => { type => 'integer' }, - v_customer_id => { type => 'text' }, - language_id => { type => 'integer' }, payment_id => { type => 'integer' }, + phone => { type => 'text' }, + salesman_id => { type => 'integer' }, + street => { type => 'varchar', length => 75 }, + taxincluded => { type => 'boolean' }, + taxnumber => { type => 'text' }, taxzone_id => { type => 'integer', default => '0', not_null => 1 }, - greeting => { type => 'text' }, + terms => { type => 'integer', default => '0' }, + user_password => { type => 'varchar', length => 12 }, + username => { type => 'varchar', length => 50 }, ustid => { type => 'varchar', length => 14 }, - direct_debit => { type => 'boolean', default => 'false' }, - iban => { type => 'varchar', length => 100 }, - bic => { type => 'varchar', length => 100 }, - currency_id => { type => 'integer', not_null => 1 }, + v_customer_id => { type => 'text' }, + vendornumber => { type => 'text' }, + zipcode => { type => 'varchar', length => 10 }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); @@ -80,7 +80,5 @@ __PACKAGE__->meta->foreign_keys( }, ); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/SL/DB/MetaSetup/Warehouse.pm b/SL/DB/MetaSetup/Warehouse.pm index c75eb9f79..d06c12992 100644 --- a/SL/DB/MetaSetup/Warehouse.pm +++ b/SL/DB/MetaSetup/Warehouse.pm @@ -9,19 +9,17 @@ use base qw(SL::DB::Object); __PACKAGE__->meta->table('warehouse'); __PACKAGE__->meta->columns( - id => { type => 'integer', not_null => 1, sequence => 'id' }, description => { type => 'text' }, + id => { type => 'integer', not_null => 1, sequence => 'id' }, + invalid => { type => 'boolean' }, itime => { type => 'timestamp', default => 'now()' }, mtime => { type => 'timestamp' }, sortkey => { type => 'integer' }, - invalid => { type => 'boolean' }, ); __PACKAGE__->meta->primary_key_columns([ 'id' ]); __PACKAGE__->meta->allow_inline_column_values(1); -# __PACKAGE__->meta->initialize; - 1; ; diff --git a/scripts/rose_auto_create_model.pl b/scripts/rose_auto_create_model.pl index 3eed8de13..42af25a5b 100755 --- a/scripts/rose_auto_create_model.pl +++ b/scripts/rose_auto_create_model.pl @@ -115,20 +115,37 @@ CODE my %args = (indent => 2, use_setup => 0); my $definition = "SL::DB::AUTO::$package"->meta->perl_class_definition(%args); - $definition =~ s/(__PACKAGE__->meta->initialize;)/# $1/; + $definition =~ s/\n+__PACKAGE__->meta->initialize;\n+/\n\n/; $definition =~ s/::AUTO::/::/g; + + # Sort column definitions alphabetically + if ($definition =~ m/__PACKAGE__->meta->columns\( \n (.+?) \n \);/msx) { + my ($start, $end) = ($-[1], $+[1]); + my $sorted_columns = join "\n", sort split m/\n/, $1; + substr $definition, $start, $end - $start, $sorted_columns; + } + # patch foreign keys my $foreign_key_definition = "SL::DB::AUTO::$package"->meta->perl_foreign_keys_definition(%args); $foreign_key_definition =~ s/::AUTO::/::/g; - if ($definition =~ /\Q$foreign_key_definition\E/) { + if ($foreign_key_definition && ($definition =~ /\Q$foreign_key_definition\E/)) { my ($start, $end) = ($-[0], $+[0]); while (my ($auto_generated_name, $desired_name) = each %{ $foreign_key_name_map{$table} || {} }) { $foreign_key_definition =~ s/^ \s \s ${auto_generated_name} \b/ ${desired_name}/msx; } + # Sort foreign key definitions alphabetically + if ($foreign_key_definition =~ m/\(\n(.+)\n\)/s) { + my ($list_start, $list_end) = ($-[0], $+[0]); + my @foreign_keys = split m/\n\n/m, $1; + my $sorted_foreign_keys = "(\n" . join("\n\n", sort @foreign_keys) . "\n)"; + + substr $foreign_key_definition, $list_start, $list_end - $list_start, $sorted_foreign_keys;; + } + substr($definition, $start, $end - $start) = $foreign_key_definition; } -- 2.20.1