Skip to content

Commit

Permalink
Varianten: SQL-Scripte und ROSE-DB Dateien erstellt
Browse files Browse the repository at this point in the history
  • Loading branch information
z4m1n0 committed Dec 4, 2023
1 parent 9da868a commit 3d433e1
Show file tree
Hide file tree
Showing 31 changed files with 576 additions and 6 deletions.
7 changes: 7 additions & 0 deletions SL/DB/Helper/ALL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ use SL::DB::OrderVersion;
use SL::DB::Part;
use SL::DB::PartClassification;
use SL::DB::PartCustomerPrice;
use SL::DB::PartParentVarientPartVarient;
use SL::DB::PartsGroup;
use SL::DB::PartsPriceHistory;
use SL::DB::PaymentTerm;
Expand Down Expand Up @@ -153,12 +154,18 @@ use SL::DB::TimeRecordingArticle;
use SL::DB::TodoUserConfig;
use SL::DB::TransferType;
use SL::DB::Translation;
use SL::DB::TranslationVarientProperty;
use SL::DB::TranslationVarientPropertyValue;
use SL::DB::TriggerInformation;
use SL::DB::Unit;
use SL::DB::UnitsLanguage;
use SL::DB::UserPreference;
use SL::DB::VC;
use SL::DB::ValidityToken;
use SL::DB::VarientProperty;
use SL::DB::VarientPropertyPart;
use SL::DB::VarientPropertyValue;
use SL::DB::VarientPropertyValuePart;
use SL::DB::Vendor;
use SL::DB::Warehouse;

Expand Down
7 changes: 7 additions & 0 deletions SL/DB/Helper/Mappings.pm
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ my %kivitendo_package_names = (
oe => 'order',
oe_version => 'order_version',
parts => 'part',
parts_parent_variant_id_parts_variant_id => 'PartParentVarientPartVarient',
partsgroup => 'parts_group',
part_classifications => 'PartClassification',
part_customer_prices => 'PartCustomerPrice',
Expand Down Expand Up @@ -231,11 +232,17 @@ my %kivitendo_package_names = (
todo_user_config => 'todo_user_config',
transfer_type => 'transfer_type',
translation => 'translation',
translation_varient_properties => 'TranslationVarientProperty',
translation_varient_property_values => 'TranslationVarientPropertyValue',
trigger_information => 'trigger_information',
units => 'unit',
units_language => 'units_language',
user_preferences => 'user_preference',
validity_tokens => 'ValidityToken',
variant_properties => 'VarientProperty',
varient_properties_parts => 'VarientPropertyPart',
variant_property_values => 'VarientPropertyValue',
varient_property_values_parts => 'VarientPropertyValuePart',
vendor => 'vendor',
warehouse => 'warehouse',
);
Expand Down
2 changes: 2 additions & 0 deletions SL/DB/Helper/TransNumberGenerator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ my %specs = ( ar => { number_column => 'invnumber',
service => { number_column => 'partnumber', number_range_column => 'servicenumber', },
assembly => { number_column => 'partnumber', number_range_column => 'assemblynumber', },
assortment => { number_column => 'partnumber', number_range_column => 'assortmentnumber', },
parent_variant => { number_column => 'partnumber', number_range_column => 'parent_variant_number', },
variant => { number_column => 'partnumber', number_range_column => 'variant_number', },
);

sub get_next_trans_number {
Expand Down
14 changes: 14 additions & 0 deletions SL/DB/Manager/PartParentVarientPartVarient.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file has been auto-generated only because it didn't exist.
# Feel free to modify it at will; it will not be overwritten automatically.

package SL::DB::Manager::PartParentVarientPartVarient;

use strict;

use parent qw(SL::DB::Helper::Manager);

sub object_class { 'SL::DB::PartParentVarientPartVarient' }

__PACKAGE__->make_manager_methods;

1;
14 changes: 14 additions & 0 deletions SL/DB/Manager/TranslationVarientProperty.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file has been auto-generated only because it didn't exist.
# Feel free to modify it at will; it will not be overwritten automatically.

package SL::DB::Manager::TranslationVarientProperty;

use strict;

use parent qw(SL::DB::Helper::Manager);

sub object_class { 'SL::DB::TranslationVarientProperty' }

__PACKAGE__->make_manager_methods;

1;
14 changes: 14 additions & 0 deletions SL/DB/Manager/TranslationVarientPropertyValue.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file has been auto-generated only because it didn't exist.
# Feel free to modify it at will; it will not be overwritten automatically.

package SL::DB::Manager::TranslationVarientPropertyValue;

use strict;

use parent qw(SL::DB::Helper::Manager);

sub object_class { 'SL::DB::TranslationVarientPropertyValue' }

__PACKAGE__->make_manager_methods;

1;
14 changes: 14 additions & 0 deletions SL/DB/Manager/VarientProperty.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file has been auto-generated only because it didn't exist.
# Feel free to modify it at will; it will not be overwritten automatically.

package SL::DB::Manager::VarientProperty;

use strict;

use parent qw(SL::DB::Helper::Manager);

sub object_class { 'SL::DB::VarientProperty' }

__PACKAGE__->make_manager_methods;

1;
14 changes: 14 additions & 0 deletions SL/DB/Manager/VarientPropertyPart.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file has been auto-generated only because it didn't exist.
# Feel free to modify it at will; it will not be overwritten automatically.

package SL::DB::Manager::VarientPropertyPart;

use strict;

use parent qw(SL::DB::Helper::Manager);

sub object_class { 'SL::DB::VarientPropertyPart' }

__PACKAGE__->make_manager_methods;

1;
14 changes: 14 additions & 0 deletions SL/DB/Manager/VarientPropertyValue.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file has been auto-generated only because it didn't exist.
# Feel free to modify it at will; it will not be overwritten automatically.

package SL::DB::Manager::VarientPropertyValue;

use strict;

use parent qw(SL::DB::Helper::Manager);

sub object_class { 'SL::DB::VarientPropertyValue' }

__PACKAGE__->make_manager_methods;

1;
14 changes: 14 additions & 0 deletions SL/DB/Manager/VarientPropertyValuePart.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This file has been auto-generated only because it didn't exist.
# Feel free to modify it at will; it will not be overwritten automatically.

package SL::DB::Manager::VarientPropertyValuePart;

use strict;

use parent qw(SL::DB::Helper::Manager);

sub object_class { 'SL::DB::VarientPropertyValuePart' }

__PACKAGE__->make_manager_methods;

1;
2 changes: 2 additions & 0 deletions SL/DB/MetaSetup/Default.pm
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ __PACKAGE__->meta->columns(
order_warn_no_cusordnumber => { type => 'boolean', default => 'false' },
order_warn_no_deliverydate => { type => 'boolean', default => 'true' },
p_reclamation_record_number => { type => 'text', default => '0', not_null => 1 },
parent_variant_number => { type => 'text' },
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' },
Expand Down Expand Up @@ -221,6 +222,7 @@ __PACKAGE__->meta->columns(
transit_items_chart_id => { type => 'integer' },
transport_cost_reminder_article_number_id => { type => 'integer' },
undo_transfer_interval => { type => 'integer', default => 7 },
variant_number => { type => 'text' },
vc_greetings_use_textfield => { type => 'boolean' },
vendor_ustid_taxnummer_unique => { type => 'boolean', default => 'false' },
vendornumber => { type => 'text' },
Expand Down
2 changes: 1 addition & 1 deletion SL/DB/MetaSetup/Part.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ __PACKAGE__->meta->columns(
obsolete => { type => 'boolean', default => 'false', not_null => 1 },
onhand => { type => 'numeric', default => '0', precision => 25, scale => 5 },
order_qty => { type => 'numeric', default => '0', not_null => 1, precision => 15, scale => 5 },
part_type => { type => 'enum', check_in => [ 'part', 'service', 'assembly', 'assortment' ], db_type => 'part_type_enum', not_null => 1 },
part_type => { type => 'enum', check_in => [ 'part', 'service', 'assembly', 'assortment', 'parent_variant', 'variant' ], db_type => 'part_type_enum', not_null => 1 },
partnumber => { type => 'text', not_null => 1 },
partsgroup_id => { type => 'integer' },
payment_id => { type => 'integer' },
Expand Down
34 changes: 34 additions & 0 deletions SL/DB/MetaSetup/PartParentVarientPartVarient.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This file has been auto-generated. Do not modify it; it will be overwritten
# by rose_auto_create_model.pl automatically.
package SL::DB::PartParentVarientPartVarient;

use strict;

use parent qw(SL::DB::Object);

__PACKAGE__->meta->table('parts_parent_variant_id_parts_variant_id');

__PACKAGE__->meta->columns(
parent_variant_id => { type => 'integer', not_null => 1 },
variant_id => { type => 'integer', not_null => 1 },
);

__PACKAGE__->meta->primary_key_columns([ 'parent_variant_id', 'variant_id' ]);

__PACKAGE__->meta->unique_keys([ 'variant_id' ]);

__PACKAGE__->meta->foreign_keys(
parent_variant => {
class => 'SL::DB::Part',
key_columns => { parent_variant_id => 'id' },
},

variant => {
class => 'SL::DB::Part',
key_columns => { variant_id => 'id' },
rel_type => 'one to one',
},
);

1;
;
36 changes: 36 additions & 0 deletions SL/DB/MetaSetup/TranslationVarientProperty.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file has been auto-generated. Do not modify it; it will be overwritten
# by rose_auto_create_model.pl automatically.
package SL::DB::TranslationVarientProperty;

use strict;

use parent qw(SL::DB::Object);

__PACKAGE__->meta->table('translation_varient_properties');

__PACKAGE__->meta->columns(
itime => { type => 'timestamp', default => 'now()' },
language_id => { type => 'integer', not_null => 1 },
mtime => { type => 'timestamp' },
name => { type => 'text', not_null => 1 },
varient_property_id => { type => 'integer', not_null => 1 },
);

__PACKAGE__->meta->primary_key_columns([ 'varient_property_id', 'language_id' ]);

__PACKAGE__->meta->allow_inline_column_values(1);

__PACKAGE__->meta->foreign_keys(
language => {
class => 'SL::DB::Language',
key_columns => { language_id => 'id' },
},

varient_property => {
class => 'SL::DB::VarientProperty',
key_columns => { varient_property_id => 'id' },
},
);

1;
;
36 changes: 36 additions & 0 deletions SL/DB/MetaSetup/TranslationVarientPropertyValue.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This file has been auto-generated. Do not modify it; it will be overwritten
# by rose_auto_create_model.pl automatically.
package SL::DB::TranslationVarientPropertyValue;

use strict;

use parent qw(SL::DB::Object);

__PACKAGE__->meta->table('translation_varient_property_values');

__PACKAGE__->meta->columns(
itime => { type => 'timestamp', default => 'now()' },
language_id => { type => 'integer', not_null => 1 },
mtime => { type => 'timestamp' },
value => { type => 'text', not_null => 1 },
varient_property_value_id => { type => 'integer', not_null => 1 },
);

__PACKAGE__->meta->primary_key_columns([ 'varient_property_value_id', 'language_id' ]);

__PACKAGE__->meta->allow_inline_column_values(1);

__PACKAGE__->meta->foreign_keys(
language => {
class => 'SL::DB::Language',
key_columns => { language_id => 'id' },
},

varient_property_value => {
class => 'SL::DB::VarientPropertyValue',
key_columns => { varient_property_value_id => 'id' },
},
);

1;
;
27 changes: 27 additions & 0 deletions SL/DB/MetaSetup/VarientProperty.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file has been auto-generated. Do not modify it; it will be overwritten
# by rose_auto_create_model.pl automatically.
package SL::DB::VarientProperty;

use strict;

use parent qw(SL::DB::Object);

__PACKAGE__->meta->table('variant_properties');

__PACKAGE__->meta->columns(
abbreviation => { type => 'varchar', length => 4, not_null => 1 },
id => { type => 'serial', not_null => 1 },
itime => { type => 'timestamp', default => 'now()' },
mtime => { type => 'timestamp' },
name => { type => 'text', not_null => 1 },
unique_name => { type => 'text', not_null => 1 },
);

__PACKAGE__->meta->primary_key_columns([ 'id' ]);

__PACKAGE__->meta->unique_keys([ 'unique_name' ]);

__PACKAGE__->meta->allow_inline_column_values(1);

1;
;
33 changes: 33 additions & 0 deletions SL/DB/MetaSetup/VarientPropertyPart.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file has been auto-generated. Do not modify it; it will be overwritten
# by rose_auto_create_model.pl automatically.
package SL::DB::VarientPropertyPart;

use strict;

use parent qw(SL::DB::Object);

__PACKAGE__->meta->table('varient_properties_parts');

__PACKAGE__->meta->columns(
part_id => { type => 'integer', not_null => 1 },
variant_property_id => { type => 'integer', not_null => 1 },
);

__PACKAGE__->meta->primary_key_columns([ 'part_id', 'variant_property_id' ]);

__PACKAGE__->meta->unique_keys([ 'variant_property_id', 'part_id' ]);

__PACKAGE__->meta->foreign_keys(
part => {
class => 'SL::DB::Part',
key_columns => { part_id => 'id' },
},

variant_property => {
class => 'SL::DB::VarientProperty',
key_columns => { variant_property_id => 'id' },
},
);

1;
;
32 changes: 32 additions & 0 deletions SL/DB/MetaSetup/VarientPropertyValue.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This file has been auto-generated. Do not modify it; it will be overwritten
# by rose_auto_create_model.pl automatically.
package SL::DB::VarientPropertyValue;

use strict;

use parent qw(SL::DB::Object);

__PACKAGE__->meta->table('variant_property_values');

__PACKAGE__->meta->columns(
id => { type => 'serial', not_null => 1 },
itime => { type => 'timestamp', default => 'now()' },
mtime => { type => 'timestamp' },
sortkey => { type => 'integer', not_null => 1 },
value => { type => 'text', not_null => 1 },
variant_property_id => { type => 'integer', not_null => 1 },
);

__PACKAGE__->meta->primary_key_columns([ 'id' ]);

__PACKAGE__->meta->allow_inline_column_values(1);

__PACKAGE__->meta->foreign_keys(
variant_property => {
class => 'SL::DB::VarientProperty',
key_columns => { variant_property_id => 'id' },
},
);

1;
;
Loading

0 comments on commit 3d433e1

Please sign in to comment.