Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 59b16044

Von Tamino Steinert vor 3 Monaten hinzugefügt

  • ID 59b16044136f5af4924b3d473d82ac03db2803dd
  • Vorgänger 7b620fdc
  • Nachfolger 90759553

Varianten: SQL-Scripte und ROSE-DB Dateien erstellt

Unterschiede anzeigen:

SL/DB/Helper/ALL.pm
91 91
use SL::DB::Part;
92 92
use SL::DB::PartClassification;
93 93
use SL::DB::PartCustomerPrice;
94
use SL::DB::PartParentVariantPartVariant;
94 95
use SL::DB::PartsGroup;
95 96
use SL::DB::PartsPriceHistory;
96 97
use SL::DB::PaymentTerm;
......
153 154
use SL::DB::TodoUserConfig;
154 155
use SL::DB::TransferType;
155 156
use SL::DB::Translation;
157
use SL::DB::TranslationVariantProperty;
158
use SL::DB::TranslationVariantPropertyValue;
156 159
use SL::DB::TriggerInformation;
157 160
use SL::DB::Unit;
158 161
use SL::DB::UnitsLanguage;
159 162
use SL::DB::UserPreference;
160 163
use SL::DB::VC;
161 164
use SL::DB::ValidityToken;
165
use SL::DB::VariantProperty;
166
use SL::DB::VariantPropertyPart;
167
use SL::DB::VariantPropertyValue;
168
use SL::DB::VariantPropertyValuePart;
162 169
use SL::DB::Vendor;
163 170
use SL::DB::Warehouse;
164 171

  
SL/DB/Helper/Mappings.pm
168 168
  oe                             => 'order',
169 169
  oe_version                     => 'order_version',
170 170
  parts                          => 'part',
171
  parts_parent_variant_id_parts_variant_id => 'PartParentVariantPartVariant',
171 172
  partsgroup                     => 'parts_group',
172 173
  part_classifications           => 'PartClassification',
173 174
  part_customer_prices           => 'PartCustomerPrice',
......
231 232
  todo_user_config               => 'todo_user_config',
232 233
  transfer_type                  => 'transfer_type',
233 234
  translation                    => 'translation',
235
  translation_variant_properties => 'TranslationVariantProperty',
236
  translation_variant_property_values => 'TranslationVariantPropertyValue',
234 237
  trigger_information            => 'trigger_information',
235 238
  units                          => 'unit',
236 239
  units_language                 => 'units_language',
237 240
  user_preferences               => 'user_preference',
238 241
  validity_tokens                => 'ValidityToken',
242
  variant_properties             => 'VariantProperty',
243
  variant_properties_parts       => 'VariantPropertyPart',
244
  variant_property_values        => 'VariantPropertyValue',
245
  variant_property_values_parts  => 'VariantPropertyValuePart',
239 246
  vendor                         => 'vendor',
240 247
  warehouse                      => 'warehouse',
241 248
);
SL/DB/Helper/TransNumberGenerator.pm
47 47
              service                     => { number_column => 'partnumber',     number_range_column => 'servicenumber',                              },
48 48
              assembly                    => { number_column => 'partnumber',     number_range_column => 'assemblynumber',                             },
49 49
              assortment                  => { number_column => 'partnumber',     number_range_column => 'assortmentnumber',                           },
50
              parent_variant              => { number_column => 'partnumber',     number_range_column => 'parent_variant_number',                      },
51
              variant                     => { number_column => 'partnumber',     number_range_column => 'variant_number',                             },
50 52
            );
51 53

  
52 54
sub get_next_trans_number {
SL/DB/Manager/PartParentVariantPartVariant.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::Manager::PartParentVariantPartVariant;
5

  
6
use strict;
7

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

  
10
sub object_class { 'SL::DB::PartParentVariantPartVariant' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/Manager/TranslationVariantProperty.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::Manager::TranslationVariantProperty;
5

  
6
use strict;
7

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

  
10
sub object_class { 'SL::DB::TranslationVariantProperty' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/Manager/TranslationVariantPropertyValue.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::Manager::TranslationVariantPropertyValue;
5

  
6
use strict;
7

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

  
10
sub object_class { 'SL::DB::TranslationVariantPropertyValue' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/Manager/VariantProperty.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::Manager::VariantProperty;
5

  
6
use strict;
7

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

  
10
sub object_class { 'SL::DB::VariantProperty' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/Manager/VariantPropertyPart.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::Manager::VariantPropertyPart;
5

  
6
use strict;
7

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

  
10
sub object_class { 'SL::DB::VariantPropertyPart' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/Manager/VariantPropertyValue.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::Manager::VariantPropertyValue;
5

  
6
use strict;
7

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

  
10
sub object_class { 'SL::DB::VariantPropertyValue' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/Manager/VariantPropertyValuePart.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::Manager::VariantPropertyValuePart;
5

  
6
use strict;
7

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

  
10
sub object_class { 'SL::DB::VariantPropertyValuePart' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/MetaSetup/Default.pm
145 145
  order_warn_no_cusordnumber                => { type => 'boolean', default => 'false' },
146 146
  order_warn_no_deliverydate                => { type => 'boolean', default => 'true' },
147 147
  p_reclamation_record_number               => { type => 'text', default => '0', not_null => 1 },
148
  parent_variant_number                     => { type => 'text' },
148 149
  parts_image_css                           => { type => 'text', default => 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;' },
149 150
  parts_listing_image                       => { type => 'boolean', default => 'true' },
150 151
  parts_show_image                          => { type => 'boolean', default => 'true' },
......
221 222
  transit_items_chart_id                    => { type => 'integer' },
222 223
  transport_cost_reminder_article_number_id => { type => 'integer' },
223 224
  undo_transfer_interval                    => { type => 'integer', default => 7 },
225
  variant_number                            => { type => 'text' },
224 226
  vc_greetings_use_textfield                => { type => 'boolean' },
225 227
  vendor_ustid_taxnummer_unique             => { type => 'boolean', default => 'false' },
226 228
  vendornumber                              => { type => 'text' },
SL/DB/MetaSetup/Part.pm
33 33
  onhand             => { type => 'numeric', default => '0', precision => 25, scale => 5 },
34 34
  order_locked       => { type => 'boolean', default => 'false' },
35 35
  order_qty          => { type => 'numeric', default => '0', not_null => 1, precision => 15, scale => 5 },
36
  part_type          => { type => 'enum', check_in => [ 'part', 'service', 'assembly', 'assortment' ], db_type => 'part_type_enum', not_null => 1 },
36
  part_type          => { type => 'enum', check_in => [ 'part', 'service', 'assembly', 'assortment', 'parent_variant', 'variant' ], db_type => 'part_type_enum', not_null => 1 },
37 37
  partnumber         => { type => 'text', not_null => 1 },
38 38
  partsgroup_id      => { type => 'integer' },
39 39
  payment_id         => { type => 'integer' },
SL/DB/MetaSetup/PartParentVariantPartVariant.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::PartParentVariantPartVariant;
4

  
5
use strict;
6

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

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

  
11
__PACKAGE__->meta->columns(
12
  parent_variant_id => { type => 'integer', not_null => 1 },
13
  variant_id        => { type => 'integer', not_null => 1 },
14
);
15

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

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

  
20
__PACKAGE__->meta->foreign_keys(
21
  parent_variant => {
22
    class       => 'SL::DB::Part',
23
    key_columns => { parent_variant_id => 'id' },
24
  },
25

  
26
  variant => {
27
    class       => 'SL::DB::Part',
28
    key_columns => { variant_id => 'id' },
29
    rel_type    => 'one to one',
30
  },
31
);
32

  
33
1;
34
;
SL/DB/MetaSetup/TranslationVariantProperty.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::TranslationVariantProperty;
4

  
5
use strict;
6

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

  
9
__PACKAGE__->meta->table('translation_variant_properties');
10

  
11
__PACKAGE__->meta->columns(
12
  itime               => { type => 'timestamp', default => 'now()' },
13
  language_id         => { type => 'integer', not_null => 1 },
14
  mtime               => { type => 'timestamp' },
15
  name                => { type => 'text', not_null => 1 },
16
  variant_property_id => { type => 'integer', not_null => 1 },
17
);
18

  
19
__PACKAGE__->meta->primary_key_columns([ 'variant_property_id', 'language_id' ]);
20

  
21
__PACKAGE__->meta->allow_inline_column_values(1);
22

  
23
__PACKAGE__->meta->foreign_keys(
24
  language => {
25
    class       => 'SL::DB::Language',
26
    key_columns => { language_id => 'id' },
27
  },
28

  
29
  variant_property => {
30
    class       => 'SL::DB::VariantProperty',
31
    key_columns => { variant_property_id => 'id' },
32
  },
33
);
34

  
35
1;
36
;
SL/DB/MetaSetup/TranslationVariantPropertyValue.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::TranslationVariantPropertyValue;
4

  
5
use strict;
6

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

  
9
__PACKAGE__->meta->table('translation_variant_property_values');
10

  
11
__PACKAGE__->meta->columns(
12
  itime                     => { type => 'timestamp', default => 'now()' },
13
  language_id               => { type => 'integer', not_null => 1 },
14
  mtime                     => { type => 'timestamp' },
15
  value                     => { type => 'text', not_null => 1 },
16
  variant_property_value_id => { type => 'integer', not_null => 1 },
17
);
18

  
19
__PACKAGE__->meta->primary_key_columns([ 'variant_property_value_id', 'language_id' ]);
20

  
21
__PACKAGE__->meta->allow_inline_column_values(1);
22

  
23
__PACKAGE__->meta->foreign_keys(
24
  language => {
25
    class       => 'SL::DB::Language',
26
    key_columns => { language_id => 'id' },
27
  },
28

  
29
  variant_property_value => {
30
    class       => 'SL::DB::VariantPropertyValue',
31
    key_columns => { variant_property_value_id => 'id' },
32
  },
33
);
34

  
35
1;
36
;
SL/DB/MetaSetup/VariantProperty.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::VariantProperty;
4

  
5
use strict;
6

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

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

  
11
__PACKAGE__->meta->columns(
12
  abbreviation => { type => 'varchar', length => 4, not_null => 1 },
13
  id           => { type => 'serial', not_null => 1 },
14
  itime        => { type => 'timestamp', default => 'now()' },
15
  mtime        => { type => 'timestamp' },
16
  name         => { type => 'text', not_null => 1 },
17
  unique_name  => { type => 'text', not_null => 1 },
18
);
19

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

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

  
24
__PACKAGE__->meta->allow_inline_column_values(1);
25

  
26
1;
27
;
SL/DB/MetaSetup/VariantPropertyPart.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::VariantPropertyPart;
4

  
5
use strict;
6

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

  
9
__PACKAGE__->meta->table('variant_properties_parts');
10

  
11
__PACKAGE__->meta->columns(
12
  part_id             => { type => 'integer', not_null => 1 },
13
  variant_property_id => { type => 'integer', not_null => 1 },
14
);
15

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

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

  
20
__PACKAGE__->meta->foreign_keys(
21
  part => {
22
    class       => 'SL::DB::Part',
23
    key_columns => { part_id => 'id' },
24
  },
25

  
26
  variant_property => {
27
    class       => 'SL::DB::VariantProperty',
28
    key_columns => { variant_property_id => 'id' },
29
  },
30
);
31

  
32
1;
33
;
SL/DB/MetaSetup/VariantPropertyValue.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::VariantPropertyValue;
4

  
5
use strict;
6

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

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

  
11
__PACKAGE__->meta->columns(
12
  abbreviation        => { type => 'varchar', length => 4, not_null => 1 },
13
  id                  => { type => 'serial', not_null => 1 },
14
  itime               => { type => 'timestamp', default => 'now()' },
15
  mtime               => { type => 'timestamp' },
16
  sortkey             => { type => 'integer', not_null => 1 },
17
  value               => { type => 'text', not_null => 1 },
18
  variant_property_id => { type => 'integer', not_null => 1 },
19
);
20

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

  
23
__PACKAGE__->meta->allow_inline_column_values(1);
24

  
25
__PACKAGE__->meta->foreign_keys(
26
  variant_property => {
27
    class       => 'SL::DB::VariantProperty',
28
    key_columns => { variant_property_id => 'id' },
29
  },
30
);
31

  
32
1;
33
;
SL/DB/MetaSetup/VariantPropertyValuePart.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::VariantPropertyValuePart;
4

  
5
use strict;
6

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

  
9
__PACKAGE__->meta->table('variant_property_values_parts');
10

  
11
__PACKAGE__->meta->columns(
12
  part_id                   => { type => 'integer', not_null => 1 },
13
  variant_property_value_id => { type => 'integer', not_null => 1 },
14
);
15

  
16
__PACKAGE__->meta->primary_key_columns([ 'part_id', 'variant_property_value_id' ]);
17

  
18
__PACKAGE__->meta->unique_keys([ 'variant_property_value_id', 'part_id' ]);
19

  
20
__PACKAGE__->meta->foreign_keys(
21
  part => {
22
    class       => 'SL::DB::Part',
23
    key_columns => { part_id => 'id' },
24
  },
25

  
26
  variant_property_value => {
27
    class       => 'SL::DB::VariantPropertyValue',
28
    key_columns => { variant_property_value_id => 'id' },
29
  },
30
);
31

  
32
1;
33
;
SL/DB/Part.pm
92 92
    class        => 'SL::DB::PurchaseBasketItem',
93 93
    column_map   => { id => 'part_id' },
94 94
  },
95
  variant_properties => {
96
    map_class => 'SL::DB::VariantPropertyPart',
97
    map_from  => 'part',
98
    map_to    => 'variant_property',
99
    type      => 'many to many',
100
  },
101
  variant_porperty_values => {
102
    map_class => 'SL::DB::VariantPropertyValuePart',
103
    map_from  => 'part',
104
    map_to    => 'variant_property_value',
105
    type      => 'many to many',
106
  },
107
  parent_variant => {
108
    map_class => 'SL::DB::PartParentVariantPartVariant',
109
    map_from  => 'variant',
110
    map_to    => 'parent_variant',
111
    type      => 'many to many', #should be 'many to one' but has no map_class
112
  },
113
  variants => {
114
    map_class => 'SL::DB::PartParentVariantPartVariant',
115
    map_from  => 'parent_variant',
116
    map_to    => 'variant',
117
    type      => 'many to many', #should be 'one to many' but has no map_class
118
  }
95 119
);
96 120

  
97 121
__PACKAGE__->meta->initialize;
......
179 203
sub is_type {
180 204
  my $self = shift;
181 205
  my $type  = lc(shift || '');
182
  die 'invalid type' unless $type =~ /^(?:part|service|assembly|assortment)$/;
206
  die 'invalid type' unless $type =~ /^(?:part|service|assembly|assortment|parent_variant|variant)$/;
183 207

  
184 208
  return $self->type eq $type ? 1 : 0;
185 209
}
186 210

  
187
sub is_part       { $_[0]->part_type eq 'part'       }
188
sub is_assembly   { $_[0]->part_type eq 'assembly'   }
189
sub is_service    { $_[0]->part_type eq 'service'    }
190
sub is_assortment { $_[0]->part_type eq 'assortment' }
191

  
192
sub type {
193
  return $_[0]->part_type;
194
  # my ($self, $type) = @_;
195
  # if (@_ > 1) {
196
  #   die 'invalid type' unless $type =~ /^(?:part|service|assembly)$/;
197
  #   $self->assembly(          $type eq 'assembly' ? 1 : 0);
198
  #   $self->inventory_accno_id($type ne 'service'  ? 1 : undef);
199
  # }
211
sub is_part           { $_[0]->part_type eq 'part'       }
212
sub is_assembly       { $_[0]->part_type eq 'assembly'   }
213
sub is_service        { $_[0]->part_type eq 'service'    }
214
sub is_assortment     { $_[0]->part_type eq 'assortment' }
215
sub is_parent_varient { $_[0]->part_type eq 'parent_variant' }
216
sub is_varient        { $_[0]->part_type eq 'variant' }
200 217

  
201
  # return 'assembly' if $self->assembly;
202
  # return 'part'     if $self->inventory_accno_id;
203
  # return 'service';
204
}
218
sub type { return $_[0]->part_type; }
205 219

  
206 220
sub new_part {
207 221
  my ($class, %params) = @_;
......
223 237
  $class->new(%params, part_type => 'assortment');
224 238
}
225 239

  
240
sub new_parent_variant {
241
  my ($class, %params) = @_;
242
  $class->new(%params, part_type => 'parent_variant');
243
}
244

  
245
sub new_variant {
246
  my ($class, %params) = @_;
247
  $class->new(%params, part_type => 'variant');
248
}
249

  
226 250
sub last_modification {
227 251
  my ($self) = @_;
228 252
  return $self->mtime // $self->itime;
SL/DB/PartParentVariantPartVariant.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::PartParentVariantPartVariant;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::PartParentVariantPartVariant;
9
use SL::DB::Manager::PartParentVariantPartVariant;
10

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
SL/DB/TranslationVariantProperty.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::TranslationVariantProperty;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::TranslationVariantProperty;
9
use SL::DB::Manager::TranslationVariantProperty;
10

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
SL/DB/TranslationVariantPropertyValue.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::TranslationVariantPropertyValue;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::TranslationVariantPropertyValue;
9
use SL::DB::Manager::TranslationVariantPropertyValue;
10

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
SL/DB/VariantProperty.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::VariantProperty;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::VariantProperty;
9
use SL::DB::Manager::VariantProperty;
10

  
11
__PACKAGE__->meta->add_relationships(
12
  parent_variants => {
13
    map_class => 'SL::DB::VariantPropertyPart',
14
    map_from  => 'variant_property',
15
    map_to    => 'part',
16
    type      => 'many to many',
17
  },
18
);
19

  
20
__PACKAGE__->meta->initialize;
21

  
22
1;
SL/DB/VariantPropertyPart.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::VariantPropertyPart;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::VariantPropertyPart;
9
use SL::DB::Manager::VariantPropertyPart;
10

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
SL/DB/VariantPropertyValue.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::VariantPropertyValue;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::VariantPropertyValue;
9
use SL::DB::Manager::VariantPropertyValue;
10

  
11
__PACKAGE__->meta->add_relationships(
12
  parent_variants => {
13
    map_class => 'SL::DB::VariantPropertyValuePart',
14
    map_from  => 'variant_property_value',
15
    map_to    => 'part',
16
    type      => 'many to many',
17
  },
18
);
19

  
20
__PACKAGE__->meta->initialize;
21

  
22
1;
SL/DB/VariantPropertyValuePart.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::VariantPropertyValuePart;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::VariantPropertyValuePart;
9
use SL::DB::Manager::VariantPropertyValuePart;
10

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
SL/TransNumber.pm
92 92
    $filters{table}         = "oe";
93 93
    $filters{where}         = 'COALESCE(quotation, FALSE) AND (vendor_id IS NOT NULL)';
94 94

  
95
  } elsif ($type =~ /^(part|service|assembly|assortment)$/) {
95
  } elsif ($type =~ /^(part|service|assembly|assortment|parent_variant|variant)$/) {
96 96
    $filters{trans_number}  = "partnumber";
97
    my %numberfield_hash = ( service    => 'servicenumber',
98
                             assembly   => 'assemblynumber',
99
                             assortment => 'assortmentnumber',
100
                             part       => 'articlenumber'
97
    my %numberfield_hash = ( service        => 'servicenumber',
98
                             assembly       => 'assemblynumber',
99
                             assortment     => 'assortmentnumber',
100
                             parent_variant => 'parent_variant_number',
101
                             variant        => 'variant_number',
102
                             part           => 'articlenumber'
101 103
                           );
102 104
    $filters{numberfield}   = $numberfield_hash{$type};
103 105
    $filters{table}         = "parts";
sql/Pg-upgrade2/add_variants.sql
1
-- @tag: add_variants
2
-- @description: Neue Tabllen für Variantenartikel
3
-- @depends: release_3_8_0
4
-- @ignore: 0
5

  
6
ALTER TYPE part_type_enum ADD VALUE 'parent_variant';
7
ALTER TYPE part_type_enum ADD VALUE 'variant';
8

  
9
ALTER TABLE defaults ADD parent_variant_number TEXT;
10
ALTER TABLE defaults ADD variant_number TEXT;
11

  
12
CREATE TABLE parts_parent_variant_id_parts_variant_id (
13
  parent_variant_id INTEGER NOT NULL        REFERENCES parts(id),
14
  variant_id        INTEGER NOT NULL UNIQUE REFERENCES parts(id),
15
  PRIMARY KEY (parent_variant_id, variant_id)
16
);
17

  
18
CREATE TABLE variant_properties (
19
  id           SERIAL PRIMARY KEY,
20
  name         TEXT       NOT NULL,
21
  unique_name  TEXT       NOT NULL UNIQUE,
22
  abbreviation VARCHAR(4) NOT NULL,
23
  itime        TIMESTAMP DEFAULT now(),
24
  mtime        TIMESTAMP
25
);
26
CREATE TRIGGER mtime_variant_properties
27
  BEFORE UPDATE ON variant_properties
28
  FOR EACH ROW EXECUTE PROCEDURE set_mtime();
29

  
30
CREATE TABLE variant_properties_parts (
31
  variant_property_id INTEGER NOT NULL REFERENCES variant_properties(id),
32
  part_id             INTEGER NOT NULL REFERENCES parts(id),
33
  PRIMARY KEY (part_id, variant_property_id)
34
);
35

  
36
CREATE TABLE translation_variant_properties (
37
  variant_property_id INTEGER NOT NULL REFERENCES variant_properties(id),
38
  language_id         INTEGER NOT NULL REFERENCES language(id),
39
  name                TEXT    NOT NULL,
40
  itime               TIMESTAMP DEFAULT now(),
41
  mtime               TIMESTAMP,
42
  PRIMARY KEY (variant_property_id, language_id)
43
);
44
CREATE TRIGGER mtime_translation_variant_properties
45
  BEFORE UPDATE ON translation_variant_properties
46
  FOR EACH ROW EXECUTE PROCEDURE set_mtime();
47

  
48
CREATE TABLE variant_property_values (
49
  id                  SERIAL PRIMARY KEY,
50
  variant_property_id INTEGER NOT NULL REFERENCES variant_properties(id),
51
  value               TEXT    NOT NULL,
52
  abbreviation        VARCHAR(4) NOT NULL,
53
  sortkey             INTEGER NOT NULL,
54
  itime               TIMESTAMP DEFAULT now(),
55
  mtime               TIMESTAMP
56
);
57
CREATE TRIGGER mtime_variant_property_values
58
  BEFORE UPDATE ON variant_property_values
59
  FOR EACH ROW EXECUTE PROCEDURE set_mtime();
60

  
61
CREATE TABLE variant_property_values_parts (
62
  variant_property_value_id INTEGER NOT NULL REFERENCES variant_property_values(id),
63
  part_id                   INTEGER NOT NULL REFERENCES parts(id),
64
  PRIMARY KEY (part_id, variant_property_value_id)
65
);
66

  
67
CREATE TABLE translation_variant_property_values (
68
  variant_property_value_id INTEGER NOT NULL REFERENCES variant_property_values(id),
69
  language_id               INTEGER NOT NULL REFERENCES language(id),
70
  value                     TEXT    NOT NULL,
71
  itime                     TIMESTAMP DEFAULT now(),
72
  mtime                     TIMESTAMP,
73
  PRIMARY KEY (variant_property_value_id, language_id)
74
);
75
CREATE TRIGGER mtime_translation_variant_property_values
76
  BEFORE UPDATE ON translation_variant_property_values
77
  FOR EACH ROW EXECUTE PROCEDURE set_mtime();
t/006spellcheck.t
61 61
sytle
62 62
unkown
63 63
varsion
64
varient
64 65
wether
65 66
);
66 67

  
templates/design40_webpages/client_config/_ranges_of_numbers.html
104 104
      <td>[% L.input_tag("defaults.assortmentnumber", SELF.defaults.assortmentnumber, size="15", class="wi-normal") %]</td>
105 105
      [% END %]
106 106
    </tr>
107
    <tr>
108
      <th>[% LxERP.t8('Parent Variant') %]</th>
109
      <td>[% L.input_tag("defaults.parent_variant_number", SELF.defaults.parent_variant_number, size="15", class="wi-normal") %]</td>
110
    </tr>
111
    <tr>
112
      <th>[% LxERP.t8('Variant') %]</th>
113
      <td>[% L.input_tag("defaults.variant_number", SELF.defaults.variant_number, size="15", class="wi-normal") %]</td>
114
    </tr>
107 115
  </tbody>
108 116
</table>
109 117

  
templates/webpages/client_config/_ranges_of_numbers.html
72 72
  <tr>
73 73
   <td align="right" nowrap>[% LxERP.t8('Last Purchase Delivery Order Number') %]</td>
74 74
   <td>[% L.input_tag("defaults.pdonumber", SELF.defaults.pdonumber, size="15") %]</td>
75
   <td align="right" nowrap>[% LxERP.t8('Last Parent Variant Number') %]</td>
76
   <td>[% L.input_tag("defaults.parent_variant_number", SELF.defaults.parent_variant_number, size="15") %]</td>
75 77
  </tr>
76 78

  
77 79
  <tr>
78 80
   <td align="right" nowrap>[% LxERP.t8('Last Supplier Delivery Order Number') %]</td>
79 81
   <td>[% L.input_tag("defaults.sudonumber", SELF.defaults.sudonumber, size="15") %]</td>
82
   <td align="right" nowrap>[% LxERP.t8('Last Variant Number') %]</td>
83
   <td>[% L.input_tag("defaults.variant_number", SELF.defaults.variant_number, size="15") %]</td>
80 84
  </tr>
81 85

  
82 86
  <tr>

Auch abrufbar als: Unified diff