Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 76a8257b

Von Tamino Steinert vor 5 Tagen hinzugefügt

  • ID 76a8257b82db988df2244af55c7ee2aa869e4139
  • Vorgänger d1b27aa3
  • Nachfolger 092a8193

Varianten: Varianten Ausprägungen bearbeiten

Unterschiede anzeigen:

SL/Controller/Part.pm
247 247
  }
248 248

  
249 249
  my $new_select_tag = select_tag(
250
    "variants[].add_variant_property_value", \@options,
250
    "variants_properties[].add_variant_property_value", \@options,
251
    with_empty => 1,
251 252
    %select_tag_options
252 253
  );
253
  $self->js->replaceWith('[name^="variants[].add_variant_property_value"]', $new_select_tag);
254
  $self->js->replaceWith('[name^="variants_properties[].add_variant_property_value"]', $new_select_tag);
254 255

  
255 256
  my $new_select_tag_multible = select_tag(
256
    "add_variant_property_value_for_selected_variants", \@options,
257
    "add_variant_property_value_for_selected_variants_properties", \@options,
257 258
    %select_tag_options
258 259
  );
259
  $self->js->replaceWith("#add_variant_property_value_for_selected_variants", $new_select_tag_multible);
260
  $self->js->replaceWith("#add_variant_property_value_for_selected_variants_properties", $new_select_tag_multible);
260 261

  
261 262
  $self->js->render();
262 263
}
263 264

  
264
sub action_update_variants {
265
sub action_update_variants_values {
265 266
  my ($self) = @_;
266 267

  
267
  my %variant_id_to_values = map {$_->{id} => $_} @{$::form->{variants}};
268
  my %variant_id_to_values = map {$_->{id} => $_} @{$::form->{variants_values}};
268 269

  
269
  my $variant_property_id = $::form->{add_variant_property};
270
  SL::DB->client->with_transaction(sub {
271
    my $new_variant_property;
272
    foreach my $variant (@{$self->part->variants}) {
273
      my $variant_attributes = $variant_id_to_values{$variant->id};
274
      delete $variant_attributes->{$_} for qw(id position);
275
      $variant->update_attributes(%$variant_attributes);
276
    }
277
    1;
278
  }) or do {
279
    return $self->js->error(t8('Error while updating values of variants: #1', SL::DB->client->error))->render();
280
  };
281

  
282
  $self->redirect_to(
283
    controller => 'Part',
284
    action     => 'edit',
285
    'part.id'  => $self->part->id
286
  );
287
}
288

  
289
sub action_update_variants_properties {
290
  my ($self) = @_;
291

  
292
  my %variant_id_to_values = map {$_->{id} => $_} @{$::form->{variants_properties}};
293

  
294
  my $variant_property_id = delete $::form->{add_variant_property};
270 295
  if ($variant_property_id) {
271 296
    foreach my $variant (@{$self->part->variants}) {
272
      die t8("Please select a new variant property value for all variants")
273
        unless $variant_id_to_values{$variant->id}->{"add_variant_property_value"};
297
      my $variant_values = $variant_id_to_values{$variant->id};
298
      $variant_values->{"variant_property_$variant_property_id"} =
299
        delete $variant_values->{"add_variant_property_value"}
300
        or die t8("Please select a new variant property value for all variants");
274 301
    }
275 302
  }
276 303

  
277
  SL::DB->client->with_transaction(sub {
278
    my $new_variant_property;
279
    if ($variant_property_id) {
280
      $new_variant_property = SL::DB::VariantPropertyPart->new(
281
        part_id             => $self->part->id,
282
        variant_property_id => $variant_property_id,
283
      )->save;
304
  my ($one_variant_id) = keys %variant_id_to_values;
305
  my %variant_property_ids =
306
    map { $_ => 1 }
307
    grep {$_ =~ m/^variant_property_/}
308
    keys %{$variant_id_to_values{$one_variant_id}};
309
  my $variant_property_id_string = join " ", sort keys %variant_property_ids;
310

  
311
  my %variant_property_values_to_variant;
312
  foreach my $variant (@{$self->part->variants}) {
313
    my %variant_values = %{$variant_id_to_values{$variant->id}};
314

  
315
    my $current_variant_property_id_string =
316
      join " ",
317
      sort
318
      grep {$_ =~ m/^variant_property_/}
319
      keys %variant_values;
320

  
321
    die "property ids doesn't match"
322
      . $current_variant_property_id_string . ";" .$variant_property_id_string
323
      if $current_variant_property_id_string ne $variant_property_id_string;
324

  
325
    my $variant_property_values =
326
      join " ",
327
      sort
328
      map {$variant_values{$_}}
329
      keys %variant_property_ids;
330

  
331
    if (defined $variant_property_values_to_variant{$variant_property_values}) {
332
      my $matching_variant = $variant_property_values_to_variant{$variant_property_values};
333
      die t8("The variants '#1' and '#2' would have the same variant property values.",
334
        $variant->displayable_name, $matching_variant->displayable_name
335
      );
336
    } else {
337
      $variant_property_values_to_variant{$variant_property_values} = $variant;
284 338
    }
339
  }
340

  
341
  SL::DB->client->with_transaction(sub {
342

  
343
    my @variant_properties =
344
      map {SL::DB::Manager::VariantProperty->find_by(id => $_)}
345
      map {$_ =~ s/^variant_property_//; $_}
346
      keys %variant_property_ids;
347

  
348
    $self->part->variant_properties(\@variant_properties);
349
    $self->part->save;
350

  
285 351
    foreach my $variant (@{$self->part->variants}) {
286
      my $variant_attributes = $variant_id_to_values{$variant->id};
287
      my $variant_property_value_id = delete $variant_attributes->{add_variant_property_value};
288
      delete $variant_attributes->{$_} for qw(id position);
289
      $variant->update_attributes(%$variant_attributes);
290
      if ($new_variant_property) {
291
        SL::DB::VariantPropertyValuePart->new(
292
          part_id                   => $variant->id,
293
          variant_property_value_id => $variant_property_value_id,
294
        )->save;
295
      }
352
      my %variant_values = %{$variant_id_to_values{$variant->id}};
353

  
354
      my @variant_property_values =
355
        map {
356
          SL::DB::Manager::VariantPropertyValue->find_by(
357
            id => $variant_values{"variant_property_" . $_->id}
358
          );
359
        }
360
        @variant_properties;
361

  
362
      $variant->variant_property_values(\@variant_property_values);
363
      $variant->save;
296 364
    }
297 365
    1;
298 366
  }) or do {
299
    return $self->js->error(t8('Error while adding variant property: #1', SL::DB->client->error))->render();
367
    return $self->js->error(t8('Error while updating variant properties: #1', SL::DB->client->error))->render();
300 368
  };
301 369

  
302 370
  $self->redirect_to(
......
939 1007
  $self->js->run('kivi.Part.redisplay_items', \@to_sort)->render;
940 1008
}
941 1009

  
942
sub action_reorder_variants {
1010
sub action_reorder_variants_values {
943 1011
  my ($self) = @_;
944 1012

  
945 1013
  my $part= $self->part;
......
968 1036

  
969 1037
  my %variant_id_to_position =
970 1038
    map {$_->{id} => $_->{position}}
971
    @{$::form->{variants}};
1039
    @{$::form->{variants_values}};
972 1040

  
973 1041
  my @to_sort = map { { old_pos => $variant_id_to_position{$_->id}, order_by => $method->($_) } } @items;
974 1042
  if ($::form->{order_by} =~ /^(listprice|sellprice|lastcost|onhand|rop)$/ ||
......
986 1054
    }
987 1055
  };
988 1056

  
989
  $self->js->run('kivi.Part.redisplay_variants', \@to_sort)->render;
1057
  $self->js->run('kivi.Part.redisplay_variants_values', \@to_sort)->render;
1058
}
1059

  
1060
sub action_reorder_variants_properties {
1061
  my ($self) = @_;
1062

  
1063
  my $part= $self->part;
1064

  
1065
  my %sort_keys = (
1066
    partnumber       => sub { $_[0]->partnumber },
1067
    description      => sub { $_[0]->description },
1068
    ean              => sub { $_[0]->ean },
1069
    variant_values   => sub { $_[0]->variant_values },
1070
  );
1071
  foreach my $variant_property (@{$part->variant_properties}) {
1072
    my $key = 'variant_property_' . $variant_property->id;
1073
    $sort_keys{$key} = sub {
1074
      $_[0]->get_variant_property_value_by_unique_name($variant_property->unique_name)->sortkey;
1075
    }
1076
  }
1077

  
1078
  my $method = $sort_keys{$::form->{order_by}};
1079

  
1080
  my @items = $part->variants;
1081

  
1082
  my %variant_id_to_position =
1083
    map {$_->{id} => $_->{position}}
1084
    @{$::form->{variants_properties}};
1085

  
1086
  my @to_sort = map { { old_pos => $variant_id_to_position{$_->id}, order_by => $method->($_) } } @items;
1087
  if ($::form->{order_by} =~ /^variant_property_/) {
1088
    if ($::form->{sort_dir}) {
1089
      @to_sort = sort { $a->{order_by} <=> $b->{order_by} } @to_sort;
1090
    } else {
1091
      @to_sort = sort { $b->{order_by} <=> $a->{order_by} } @to_sort;
1092
    }
1093
  } else {
1094
    if ($::form->{sort_dir}) {
1095
      @to_sort = sort { $a->{order_by} cmp $b->{order_by} } @to_sort;
1096
    } else {
1097
      @to_sort = sort { $b->{order_by} cmp $a->{order_by} } @to_sort;
1098
    }
1099
  };
1100

  
1101
  $self->js->run('kivi.Part.redisplay_variants_properties', \@to_sort)->render;
990 1102
}
991 1103

  
992 1104
sub action_warehouse_changed {
js/kivi.Part.js
103 103
    ns.renumber_positions();
104 104
  };
105 105

  
106
  ns.reorder_variants = function(order_by) {
107
    var dir = $('#variant_' + order_by + '_header_id a img').attr("data-sort-dir");
108
    $('#parent_variant_table thead a img').remove();
106
  ns.reorder_variants_values = function(order_by) {
107
    var dir = $('#variant_value_' + order_by + '_header_id a img').attr("data-sort-dir");
108
    $('#variant_value_table thead a img').remove();
109 109

  
110 110
    var src;
111 111
    if (dir == "1") {
......
116 116
      src = "image/down.png";
117 117
    }
118 118

  
119
    $('#variant_' + order_by + '_header_id a').append('<img border=0 data-sort-dir=' + dir + ' src=' + src + ' alt="' + kivi.t8('sort items') + '">');
119
    $('#variant_value_' + order_by + '_header_id a').append('<img border=0 data-sort-dir=' + dir + ' src=' + src + ' alt="' + kivi.t8('sort items') + '">');
120 120

  
121 121
    var data = $('#ic').serializeArray();
122
    data.push({ name: 'action',   value: 'Part/reorder_variants' },
122
    data.push({ name: 'action',   value: 'Part/reorder_variants_values' },
123 123
              { name: 'order_by', value: order_by              },
124 124
              { name: 'sort_dir', value: dir                   });
125 125

  
126 126
    $.post("controller.pl", data, kivi.eval_json_result);
127 127
  };
128 128

  
129
  ns.redisplay_variants = function(data) {
130
    var old_rows = $('.variant_row_entry').detach();
129
  ns.redisplay_variants_values = function(data) {
130
    console.log("data", data);
131
    var old_rows = $('.variant_value_row_entry').detach();
131 132
    var new_rows = [];
132 133
    $(data).each(function(idx, elt) {
133 134
      let new_row = old_rows[elt.old_pos - 1];
134
      $(new_row).find('[name="variants[].position"]').val( idx+1);
135
      $(new_row).find('[name="variants_values[].position"]').val( idx+1);
135 136
      new_rows.push(new_row);
136 137
    });
137
    $(new_rows).appendTo($('#parent_variant_table'));
138
    $(new_rows).appendTo($('#variant_value_table'));
138 139
  };
139 140

  
140
  ns.get_selected_variants = function() {
141
  ns.get_selected_variants_values = function() {
141 142
    let selected_rows = [];
142 143
    $('[name^="variant_multi_id_"]').each( function() {
143 144
      if (this.checked) {
......
147 148
    return selected_rows;
148 149
  }
149 150

  
150
  ns.variant_rows_toggle_selected = function() {
151
  ns.variant_value_rows_toggle_selected = function() {
151 152
    $('[name^="variant_multi_id_"]').each( function() {
152 153
      this.checked = !this.checked;
153 154
    });
154 155
  }
155 156

  
156 157
  ns.set_selected_variants_to_value = function(value_name) {
157
    let value = $('[name="' + value_name + '_for_selected_variants"]').val();
158
    let selected_rows = ns.get_selected_variants();
158
    let value = $('[name="' + value_name + '_for_selected_variants_values"]').val();
159
    let selected_rows = ns.get_selected_variants_values();
159 160
    selected_rows.forEach(function(row) {
160 161
      $(row).find(
161
        '[name="variants[].' + value_name  + '"]'
162
        '[name="variants_values[].' + value_name  + '"]'
162 163
      ).val(
163 164
        value
164 165
      );
165 166
    });
166 167
  };
167 168

  
169
  ns.reorder_variants_properties = function(order_by) {
170
    var dir = $('#variant_property_' + order_by + '_header_id a img').attr("data-sort-dir");
171
    $('#variant_property_table thead a img').remove();
172

  
173
    var src;
174
    if (dir == "1") {
175
      dir = "0";
176
      src = "image/up.png";
177
    } else {
178
      dir = "1";
179
      src = "image/down.png";
180
    }
181

  
182
    $('#variant_property_' + order_by + '_header_id a').append('<img border=0 data-sort-dir=' + dir + ' src=' + src + ' alt="' + kivi.t8('sort items') + '">');
183

  
184
    var data = $('#ic').serializeArray();
185
    data.push({ name: 'action',   value: 'Part/reorder_variants_properties' },
186
              { name: 'order_by', value: order_by              },
187
              { name: 'sort_dir', value: dir                   });
188

  
189
    $.post("controller.pl", data, kivi.eval_json_result);
190
  };
191

  
192
  ns.redisplay_variants_properties = function(data) {
193
    var old_rows = $('.variant_property_row_entry').detach();
194
    var new_rows = [];
195
    $(data).each(function(idx, elt) {
196
      let new_row = old_rows[elt.old_pos - 1];
197
      $(new_row).find('[name="variants_properties[].position"]').val( idx+1);
198
      new_rows.push(new_row);
199
    });
200
    $(new_rows).appendTo($('#variant_property_table'));
201
  };
202

  
203

  
204
  ns.get_selected_variants_properties = function() {
205
    let selected_rows = [];
206
    $('[name^="variant_property_multi_id_"]').each( function() {
207
      if (this.checked) {
208
        selected_rows.push($(this).parents("tr").first());
209
      }
210
    });
211
    return selected_rows;
212
  }
213

  
214
  ns.variant_property_rows_toggle_selected = function() {
215
    $('[name^="variant_property_multi_id_"]').each( function() {
216
      this.checked = !this.checked;
217
    });
218
  }
219

  
220
  ns.set_selected_variants_to_property = function(value_name) {
221
    let value = $('[name="' + value_name + '_for_selected_variants_properties"]').val();
222
    let selected_rows = ns.get_selected_variants_properties();
223
    selected_rows.forEach(function(row) {
224
      $(row).find(
225
        '[name="variants_properties[].' + value_name  + '"]'
226
      ).val(
227
        value
228
      );
229
    });
230
  };
231

  
232
  ns.remove_variant_property = function(button) {
233
    if (!confirm(kivi.t8("Do you really want to delete the property?"))) return;
234
    let column_head_th = $(button).parents("th").first()[0];
235
    let index = column_head_th.cellIndex;
236
    let table = $('#variant_property_table')[0];
237
    for(const row of table.rows) {
238
      row.deleteCell(index);
239
    };
240
  };
241

  
168 242
  ns.assortment_recalc = function() {
169 243
    var data = $('#assortment :input').serializeArray();
170 244
    data.push(
......
411 485
    $.post("controller.pl", data, kivi.eval_json_result);
412 486
  };
413 487

  
414
  ns.update_variants = function() {
488
  ns.update_variants_values = function() {
489
    var data = $('#ic').serializeArray();
490
    data.push({ name: 'action', value: 'Part/update_variants_values' });
491
    $.post("controller.pl", data, kivi.eval_json_result);
492
  };
493

  
494
  ns.update_variants_properties = function() {
415 495
    var data = $('#ic').serializeArray();
416
    data.push({ name: 'action', value: 'Part/update_variants' });
496
    data.push({ name: 'action', value: 'Part/update_variants_properties' });
417 497
    $.post("controller.pl", data, kivi.eval_json_result);
418 498
  };
419 499

  
......
1075 1155

  
1076 1156
    $('#part_warehouse_id').change(kivi.Part.reload_bin_selection);
1077 1157

  
1078
    $('#variant_select_all').click( function() {
1158
    $('#variant_value_select_all').click( function() {
1159
      var checked = this.checked;
1160
      $('[name^="variant_value_multi_id_"]').each(function() {
1161
        this.checked =  checked;
1162
      });
1163
    });
1164

  
1165
    $('#variant_property_select_all').click( function() {
1079 1166
      var checked = this.checked;
1080
      $('[name^="variant_multi_id_"]').each(function() {
1167
      $('[name^="variant_property_multi_id_"]').each(function() {
1081 1168
        this.checked =  checked;
1082 1169
      });
1083 1170
    });
js/locale/de.js
51 51
"Details of article number \"#1\"":"Details von Artikel \"#1\"",
52 52
"Do you really want to cancel?":"Möchten Sie wirklich abbrechen?",
53 53
"Do you really want to continue?":"Möchten Sie wirklich fortfahren?",
54
"Do you really want to delete the property?":"Möchten Sie wirklich die Eigenschaft entfernen?",
54 55
"Do you really want to delete the selected documents?":"Möchten Sie wirklich diese Dateien löschen?",
55 56
"Do you really want to delete this draft?":"Möchten Sie diesen Entwurf wirklich löschen?",
56 57
"Do you really want to delete this record template?":"Möchten Sie diese Belegvorlage wirklich löschen?",
js/locale/en.js
51 51
"Details of article number \"#1\"":"",
52 52
"Do you really want to cancel?":"",
53 53
"Do you really want to continue?":"",
54
"Do you really want to delete the property?":"",
54 55
"Do you really want to delete the selected documents?":"",
55 56
"Do you really want to delete this draft?":"",
56 57
"Do you really want to delete this record template?":"",
locale/de/all
1193 1193
  'Delete Dataset'              => 'Datenbank löschen',
1194 1194
  'Delete Documents'            => 'Dokumente löschen',
1195 1195
  'Delete Images'               => 'Bilder löschen',
1196
  'Delete Property'             => 'Eigenschaft entfernen',
1196 1197
  'Delete Shipto'               => 'Lieferadresse löschen',
1197 1198
  'Delete address'              => 'Adresse löschen',
1198 1199
  'Delete all'                  => 'Alle Löschen',
......
1313 1314
  'Do you really want to delete AP transaction #1?' => 'Möchten Sie wirklich die Kreditorenbuchung #1 löschen?',
1314 1315
  'Do you really want to delete AR transaction #1?' => 'Möchten Sie wirklich die Debitorenbuchung #1 löschen?',
1315 1316
  'Do you really want to delete GL transaction #1?' => 'Möchten Sie wirklich die Dialogbuchung #1 löschen?',
1317
  'Do you really want to delete the property?' => 'Möchten Sie wirklich die Eigenschaft entfernen?',
1316 1318
  'Do you really want to delete the selected documents?' => 'Möchten Sie wirklich diese Dateien löschen?',
1317 1319
  'Do you really want to delete the selected links?' => 'Möchten Sie wirklich die ausgewählten Verknüpfungen löschen?',
1318 1320
  'Do you really want to delete the selected objects?' => 'Möchten Sie die ausgewählten Objekte wirklich löschen?',
......
1446 1448
  'Edit Preferences for #1'     => 'Einstellungen von #1 bearbeiten',
1447 1449
  'Edit Price Factor'           => 'Preisfaktor bearbeiten',
1448 1450
  'Edit Printer'                => 'Drucker bearbeiten',
1451
  'Edit Properties'             => 'Eigenschaften bearbeiten',
1449 1452
  'Edit Purchase Credit Note'   => 'Einkaufsgutschrift bearbeiten',
1450 1453
  'Edit Purchase Delivery Order' => 'Lieferschein (Einkauf) bearbeiten',
1451 1454
  'Edit Purchase Invoice'       => 'Einkaufsrechnung bearbeiten',
......
1602 1605
  'Error message from the database: #1' => 'Fehlermeldung der Datenbank: #1',
1603 1606
  'Error message from the webshop api:' => 'Fehlermeldung der Webshop Api',
1604 1607
  'Error when saving: #1'       => 'Fehler beim Speichern: #1',
1605
  'Error while adding variant property: #1' => 'Fehler beim Hinzufügen der Varianteneigenschaft: #1',
1606 1608
  'Error while applying year-end bookings!' => 'Fehler beim Durchführen der Abschlußbuchungen!',
1607 1609
  'Error while converting part to variant: ' => 'Fehler beim Umwandeln des Artikel zur Variante: ',
1608 1610
  'Error while creating project with project number of new order number, project number #1 already exists!' => 'Fehler beim Erstellen eines Projekts mit der Projektnummer der neuen Auftragsnummer, Projektnummer #1 existiert bereits!',
1609 1611
  'Error while creating variants: ' => 'Fehler beim Erstellen von Varianten: ',
1610 1612
  'Error while processing email journal (\'#1\') attachments with \'#2\': ' => 'Fehler beim Verarbeiten der E-Mail-Journals (\'#1\') Anhänge mit \'#2\': ',
1611 1613
  'Error while saving shop order #1. DB Error #2. Generic exception #3.' => 'Fehler beim Speichern der Shop-Bestellung #1. DB Fehler #2. Genereller Fehler #3.',
1614
  'Error while updating values of variants: #1' => 'Fehler beim Updaten der Werte der Varianten: #1',
1615
  'Error while updating variant properties: #1' => 'Fehler beim Updaten der Ausprägungen: #1',
1612 1616
  'Error with default taxzone'  => 'Ungültige Standardsteuerzone',
1613 1617
  'Error!'                      => 'Fehler!',
1614 1618
  'Error: #1'                   => 'Fehler: #1',
......
1953 1957
  'Hide Attachment'             => 'Anhang verbergen',
1954 1958
  'Hide Convert Part to Variant' => 'Artikel in Variante umwandeln verbergen',
1955 1959
  'Hide Create new Variants'    => 'Neue Varianten erstellen verbergen',
1960
  'Hide Edit Properties'        => 'Eigenschaften bearbeiten verbergen',
1956 1961
  'Hide Filter'                 => 'Filter verbergen',
1957 1962
  'Hide Records'                => 'Belege verbergen',
1958 1963
  'Hide all details'            => 'Alle Details verbergen',
......
3725 3730
  'Show Convert Part to Variant' => 'Artikel in Variante umwandeln zeigen',
3726 3731
  'Show Create new Variants'    => 'Neue Varianten erstellen zeigen',
3727 3732
  'Show E-Mails'                => 'E-Mails anzeigen',
3733
  'Show Edit Properties'        => 'Eigenschaften bearbeiten zeigen',
3728 3734
  'Show Filter'                 => 'Filter zeigen',
3729 3735
  'Show Records'                => 'Belege anzeigen',
3730 3736
  'Show Salesman'               => 'Verkäufer anzeigen',
......
4408 4414
  'The value \'#1\' is not a valid IBAN.' => 'Der Wert \'#1\' ist keine gültige IBAN.',
4409 4415
  'The value \'our routing id at customer\' must be set in the customer\'s master data for profile #1.' => 'Der Wert »unsere Leitweg-ID beim Kunden« muss in den Kundenstammdaten gesetzt sein für Profil #1.',
4410 4416
  'The variable name must only consist of letters, numbers and underscores. It must begin with a letter. Example: send_christmas_present' => 'Der Variablenname darf nur aus Zeichen (keine Umlaute), Ziffern und Unterstrichen bestehen. Er muss mit einem Buchstaben beginnen. Beispiel: weihnachtsgruss_verschicken',
4417
  'The variants \'#1\' and \'#2\' would have the same variant property values.' => 'Die Varianten \'#1\' und \'#2\' würden die gleichen Ausprägunen bekommen.',
4411 4418
  'The vendor could not be found. Please register the vendor with the exact name from the QR bill as shown below.' => 'Der Lieferant konnte nicht gefunden werden. Bitte registrieren Sie den Lieferanten mit dem exakten Namen aus der QR-Rechnung wie unten angezeigt.',
4412 4419
  'The vendor name is missing.' => 'Der Liefeantenname fehlt.',
4413 4420
  'The version number is missing.' => 'Die Versionsnummer fehlt.',
locale/en/all
1193 1193
  'Delete Dataset'              => '',
1194 1194
  'Delete Documents'            => '',
1195 1195
  'Delete Images'               => '',
1196
  'Delete Property'             => '',
1196 1197
  'Delete Shipto'               => '',
1197 1198
  'Delete address'              => '',
1198 1199
  'Delete all'                  => '',
......
1313 1314
  'Do you really want to delete AP transaction #1?' => '',
1314 1315
  'Do you really want to delete AR transaction #1?' => '',
1315 1316
  'Do you really want to delete GL transaction #1?' => '',
1317
  'Do you really want to delete the property?' => '',
1316 1318
  'Do you really want to delete the selected documents?' => '',
1317 1319
  'Do you really want to delete the selected links?' => '',
1318 1320
  'Do you really want to delete the selected objects?' => '',
......
1446 1448
  'Edit Preferences for #1'     => '',
1447 1449
  'Edit Price Factor'           => '',
1448 1450
  'Edit Printer'                => '',
1451
  'Edit Properties'             => '',
1449 1452
  'Edit Purchase Credit Note'   => '',
1450 1453
  'Edit Purchase Delivery Order' => '',
1451 1454
  'Edit Purchase Invoice'       => '',
......
1602 1605
  'Error message from the database: #1' => '',
1603 1606
  'Error message from the webshop api:' => '',
1604 1607
  'Error when saving: #1'       => '',
1605
  'Error while adding variant property: #1' => '',
1606 1608
  'Error while applying year-end bookings!' => '',
1607 1609
  'Error while converting part to variant: ' => '',
1608 1610
  'Error while creating project with project number of new order number, project number #1 already exists!' => '',
1609 1611
  'Error while creating variants: ' => '',
1610 1612
  'Error while processing email journal (\'#1\') attachments with \'#2\': ' => '',
1611 1613
  'Error while saving shop order #1. DB Error #2. Generic exception #3.' => '',
1614
  'Error while updating values of variants: #1' => '',
1615
  'Error while updating variant properties: #1' => '',
1612 1616
  'Error with default taxzone'  => '',
1613 1617
  'Error!'                      => '',
1614 1618
  'Error: #1'                   => '',
......
1952 1956
  'Hide Attachment'             => '',
1953 1957
  'Hide Convert Part to Variant' => '',
1954 1958
  'Hide Create new Variants'    => '',
1959
  'Hide Edit Properties'        => '',
1955 1960
  'Hide Filter'                 => '',
1956 1961
  'Hide Records'                => '',
1957 1962
  'Hide all details'            => '',
......
3724 3729
  'Show Convert Part to Variant' => '',
3725 3730
  'Show Create new Variants'    => '',
3726 3731
  'Show E-Mails'                => '',
3732
  'Show Edit Properties'        => '',
3727 3733
  'Show Filter'                 => '',
3728 3734
  'Show Records'                => '',
3729 3735
  'Show Salesman'               => '',
......
4406 4412
  'The value \'#1\' is not a valid IBAN.' => '',
4407 4413
  'The value \'our routing id at customer\' must be set in the customer\'s master data for profile #1.' => '',
4408 4414
  'The variable name must only consist of letters, numbers and underscores. It must begin with a letter. Example: send_christmas_present' => '',
4415
  'The variants \'#1\' and \'#2\' would have the same variant property values.' => '',
4409 4416
  'The vendor could not be found. Please register the vendor with the exact name from the QR bill as shown below.' => '',
4410 4417
  'The vendor name is missing.' => '',
4411 4418
  'The version number is missing.' => '',
templates/design40_webpages/part/_parent_variant.html
6 6

  
7 7
<div id="parent_variant" class="wrapper">
8 8
  <div class="input-panel">
9
    <h3> [% LxERP.t8("Variant Properties") %] </h3>
10
    <table id="parent_variant_table" class="tbl-list">
9
    <table id="variant_value_table" class="tbl-list">
11 10
      <caption>
12 11
        [% LxERP.t8("Variants") %]
13 12
      </caption>
14 13
      <thead>
15 14
      <tr>
16 15
        <th>
17
          [% L.checkbox_tag("varaint_select_all_multi_id",
18
              checked=0, id='variant_select_all'
16
          [% L.checkbox_tag("varaint_value_select_all_multi_id",
17
              checked=0, id='variant_value_select_all'
19 18
              alt=LxERP.t8('Select/Deselect all'), title=LxERP.t8('Select/Deselect all'),
20 19
            ) %]
21 20
        </th>
22
        <th id="variant_partnumber_header_id">
23
          <a href='#' onClick='javascript:kivi.Part.reorder_variants("partnumber")'>
21
        <th id="variant_value_partnumber_header_id">
22
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_values("partnumber")'>
24 23
            [% 'Partnumber' | $T8 %]
25 24
          </a>
26 25
        </th>
27
        <th id="variant_ean_header_id">
28
          <a href='#' onClick='javascript:kivi.Part.reorder_variants("ean")'>
26
        <th id="variant_value_ean_header_id">
27
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_values("ean")'>
29 28
            [% "EAN" | $T8 %]
30 29
          </a>
31 30
        </th>
32
        <th id="variant_description_header_id">
33
          <a href='#' onClick='javascript:kivi.Part.reorder_variants("description")'>
31
        <th id="variant_value_description_header_id">
32
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_values("description")'>
34 33
            [% "Description" | $T8 %]
35 34
          </a>
36 35
        </th>
37
        <th id="variant_variant_values_header_id">
38
          <a href='#' onClick='javascript:kivi.Part.reorder_variants("variant_values")'>
36
        <th id="variant_value_variant_values_header_id">
37
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_values("variant_values")'>
39 38
            [% "Property Values (Abbreviation)" | $T8 %]
40 39
          </a>
41 40
        </th>
42 41
        [% FOREACH variant_property = SELF.part.variant_properties %]
43
        <th id="variant_variant_property_[% variant_property.id %]_header_id">
44
          <a href='#' onClick='javascript:kivi.Part.reorder_variants("variant_property_[% variant_property.id %]")'>
42
        <th id="variant_value_variant_property_[% variant_property.id %]_header_id">
43
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_values("variant_property_[% variant_property.id %]")'>
45 44
            [% variant_property.displayable_name %]
46 45
          </a>
47 46
        </th>
48 47
        [% END %]
49
        <th id="variant_listprice_header_id">
50
          <a href='#' onClick='javascript:kivi.Part.reorder_variants("listprice")'>
48
        <th id="variant_value_listprice_header_id">
49
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_values("listprice")'>
51 50
            [% "List Price" | $T8 %]
52 51
          </a>
53 52
        </th>
54
        <th id="variant_sellprice_header_id">
55
          <a href='#' onClick='javascript:kivi.Part.reorder_variants("sellprice")'>
53
        <th id="variant_value_sellprice_header_id">
54
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_values("sellprice")'>
56 55
            [% "Sell Price" | $T8 %]
57 56
          </a>
58 57
        </th>
59
        <th id="variant_lastcost_header_id">
60
          <a href='#' onClick='javascript:kivi.Part.reorder_variants("lastcost")'>
58
        <th id="variant_value_lastcost_header_id">
59
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_values("lastcost")'>
61 60
            [% "Last Cost" | $T8 %]
62 61
          </a>
63 62
        </th>
64
        <th id="variant_onhand_header_id">
65
          <a href='#' onClick='javascript:kivi.Part.reorder_variants("onhand")'>
63
        <th id="variant_value_onhand_header_id">
64
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_values("onhand")'>
66 65
            [% "On Hand" | $T8 %]
67 66
          </a>
68 67
        </th>
69
        <th id="variant_rop_header_id">
70
          <a href='#' onClick='javascript:kivi.Part.reorder_variants("rop")'>
68
        <th id="variant_value_rop_header_id">
69
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_values("rop")'>
71 70
            [% "ROP" | $T8 %]
72 71
          </a>
73 72
        </th>
74
        <th>
75
          [% L.select_tag("add_variant_property", AVAILABLE_VARIANT_PROPERIES
76
            title_key='displayable_name', value_key='id',
77
            with_empty=1, empty_title=LxERP.t8("Add Variant Property"),
78
            onchange='kivi.Part.update_variant_property_value_options();',
79
          )%]
80
        </th>
81 73
      </tr>
82 74
      <tr>
83 75
        <th>
......
89 81
        <th><!-- partnumber --></th>
90 82
        <th><!-- ean --></th>
91 83
        <th>
92
          [% L.input_tag("description_for_selected_variants", SELF.part.description,
84
          [% L.input_tag("description_for_selected_variants_values", SELF.part.description,
93 85
                          class="wi-medium",
94 86
                          ) %]
95 87
          [%- L.button_tag(
......
105 97
        [% END %]
106 98
        <th>
107 99
          [% L.input_tag(
108
                "listprice_as_number_for_selected_variants",
100
                "listprice_as_number_for_selected_variants_values",
109 101
                SELF.part.listprice_as_number,
110 102
                class="reformat_number numeric wi-small",
111 103
          ) %]
......
118 110
        </th>
119 111
        <th>
120 112
          [% L.input_tag(
121
                "sellprice_as_number_for_selected_variants",
113
                "sellprice_as_number_for_selected_variants_values",
122 114
                SELF.part.sellprice_as_number,
123 115
                class="reformat_number numeric wi-small",
124 116
          ) %]
......
131 123
        </th>
132 124
        <th>
133 125
          [% L.input_tag(
134
                "lastcost_as_number_for_selected_variants",
126
                "lastcost_as_number_for_selected_variants_values",
135 127
                SELF.part.lastcost_as_number,
136 128
                class="reformat_number numeric wi-small",
137 129
          ) %]
......
145 137
        <th><!-- onhand --></th>
146 138
        <th>
147 139
          [% L.input_tag(
148
                "rop_as_number_for_selected_variants",
140
                "rop_as_number_for_selected_variants_values",
149 141
                SELF.part.rop_as_number,
150 142
                class="reformat_number numeric wi-small",
151 143
          ) %]
......
156 148
                title=LxERP.t8('Apply to selected rows'),
157 149
          ) %]
158 150
        </th>
159
        <th>
160
          [% L.select_tag("add_variant_property_value_for_selected_variants", []
161
                title_key='displayable_name', value_key='id',
162
                with_empty=1, empty_title=LxERP.t8("Select Variant Property First"),
163
              ) %]
164
          [%- L.button_tag(
165
                'kivi.Part.set_selected_variants_to_value("add_variant_property_value")',
166
                "↓",
167
                alt=LxERP.t8('Apply to selected rows'),
168
                title=LxERP.t8('Apply to selected rows'),
169
          ) %]
170
        </th>
171 151
      </tr>
172 152
      </thead>
173 153
      <tbody class="listrow">
174 154
        [% FOREACH variant = SELF.part.variants %]
175
          <tr class="variant_row_entry">
176
            [% L.hidden_tag("variants[+].id", variant.id, id='variant_' _ variant.id) %]
177
            [% L.hidden_tag("variants[].position", loop.count) %]
155
          <tr class="variant_value_row_entry">
156
            [% L.hidden_tag("variants_values[+].id", variant.id, id='variant_' _ variant.id) %]
157
            [% L.hidden_tag("variants_values[].position", loop.count) %]
178 158
            <td>
179
              [% L.checkbox_tag('variant_multi_id_' _ loop.count, value=variant.id, checked=0) %]
159
              [% L.checkbox_tag('variant_value_multi_id_' _ loop.count, value=variant.id, checked=0) %]
180 160
            </td>
181 161
            <td>[% variant.presenter.part %]</td>
182 162
            <td>
183
              [% L.input_tag("variants[].ean", variant.ean, class="wi-medium") %]
163
              [% L.input_tag("variants_values[].ean", variant.ean, class="wi-medium") %]
184 164
            </td>
185 165
            <td>
186
              [% L.input_tag("variants[].description", variant.description, class="wi-medium") %]
166
              [% L.input_tag("variants_values[].description", variant.description, class="wi-medium") %]
187 167
            </td>
188 168
            <td>[% variant.variant_values | html %]</td>
189 169
            [% FOREACH variant_property = SELF.part.variant_properties %]
......
191 171
            [% END %]
192 172
            <td>
193 173
              [% L.input_tag(
194
                    "variants[].listprice_as_number",
174
                    "variants_values[].listprice_as_number",
195 175
                    variant.listprice_as_number,
196 176
                    class='reformat_number numeric wi-small',
197 177
              ) %]
198 178
            </td>
199 179
            <td>
200 180
              [% L.input_tag(
201
                    "variants[].sellprice_as_number",
181
                    "variants_values[].sellprice_as_number",
202 182
                    variant.sellprice_as_number,
203 183
                    class='reformat_number numeric wi-small',
204 184
              ) %]
205 185
            </td>
206 186
            <td>
207 187
              [% L.input_tag(
208
                    "variants[].lastcost_as_number",
188
                    "variants_values[].lastcost_as_number",
209 189
                    variant.lastcost_as_number,
210 190
                    class='reformat_number numeric wi-small',
211 191
              ) %]
......
217 197
            </td>
218 198
            <td>
219 199
              [% L.input_tag(
220
                    "variants[].rop_as_number",
200
                    "variants_values[].rop_as_number",
221 201
                    variant.rop_as_number,
222 202
                    class='reformat_number numeric wi-small',
223 203
              ) %]
224 204
            </td>
225
            <td>
226
              [% L.select_tag("variants[].add_variant_property_value", []
227
                title_key='displayable_name', value_key='id',
228
                with_empty=1, empty_title=LxERP.t8("Select Variant Property First"),
229
              ) %]
230
            </td>
231 205
          </tr>
232 206
        [% END %]
233 207
      </tbody>
234 208
    </table>
235
    [% L.button_tag('kivi.Part.update_variants();', LxERP.t8("Update Variants")) %]
209
    [% L.button_tag('kivi.Part.update_variants_values();', LxERP.t8("Update Variants")) %]
236 210
  </div>
237 211

  
238 212
  [% BLOCK panel_1 %]
......
318 292
  %]
319 293
  </div>
320 294

  
295
  <div class="wrapper">
296
  [%
297
    INCLUDE 'common/toggle_panel.html'
298
    block_name='panel_3'
299
    toggle_class='panel_3'
300
    display_status='open'
301
    button_closed=LxERP.t8('Show Edit Properties')
302
    button_open=LxERP.t8('Hide Edit Properties')
303
  %]
304
  </div>
305

  
306
  [% BLOCK panel_3 %]
307
    <h3> [% LxERP.t8("Edit Properties") %] </h3>
308
    <table id="variant_property_table" class="tbl-list">
309
      <caption>
310
        [% LxERP.t8("Variants") %]
311
      </caption>
312
      <thead>
313
      <tr>
314
        <th>
315
          [% L.checkbox_tag("varaint_property_select_all_multi_id",
316
              checked=0, id='variant_property_select_all'
317
              alt=LxERP.t8('Select/Deselect all'), title=LxERP.t8('Select/Deselect all'),
318
            ) %]
319
        </th>
320
        <th id="variant_property_partnumber_header_id">
321
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_properties("partnumber")'>
322
            [% 'Partnumber' | $T8 %]
323
          </a>
324
        </th>
325
        <th id="variant_property_ean_header_id">
326
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_properties("ean")'>
327
            [% "EAN" | $T8 %]
328
          </a>
329
        </th>
330
        <th id="variant_property_description_header_id">
331
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_properties("description")'>
332
            [% "Description" | $T8 %]
333
          </a>
334
        </th>
335
        <th id="variant_property_variant_values_header_id">
336
          <a href='#' onClick='javascript:kivi.Part.reorder_variants_properties("variant_values")'>
337
            [% "Property Values (Abbreviation)" | $T8 %]
338
          </a>
339
        </th>
340
        [% FOREACH variant_property = SELF.part.variant_properties %]
341
        <th id="variant_property_variant_property_[% variant_property.id %]_header_id">
342
          <span>
343
          <a style="color:#e0e0d6"
344
            href='#' onClick='javascript:kivi.Part.reorder_variants_properties("variant_property_[% variant_property.id %]")'>
345
            [% variant_property.displayable_name | html %]
346
          </a>
347
          [% L.button_tag('kivi.Part.remove_variant_property(this)', 'X'
348
            title=LxERP.t8('Delete Property'),
349
            alt=LxERP.t8('Delete Property'),
350
          )%]
351
          </span>
352
        </th>
353
        [% END %]
354
        <th>
355
          [% L.select_tag("add_variant_property", AVAILABLE_VARIANT_PROPERIES
356
            title_key='displayable_name', value_key='id',
357
            with_empty=1, empty_title=LxERP.t8("Add Variant Property"),
358
            onchange='kivi.Part.update_variant_property_value_options();',
359
          )%]
360
        </th>
361
      </tr>
362
      <tr>
363
        <th>
364
          [%- L.button_tag('kivi.Part.variant_property_rows_toggle_selected();', "🔄",
365
                           title=LxERP.t8("Toggle selection"),
366
                           alt=LxERP.t8("Toggle selection"),
367
                           ) %]
368
        </th>
369
        <th><!-- partnumber --></th>
370
        <th><!-- ean --></th>
371
        <th><!-- description --></th>
372
        <th><!-- variant_values --></th>
373
        [% FOREACH variant_property = SELF.part.variant_properties %]
374
        <th>
375
          [% L.select_tag("variant_property_" _ variant_property.id _ "_for_selected_variants_properties",
376
                variant_property.property_values_sorted
377
                title_key='displayable_name', value_key='id'
378
              ) %]
379
          [%- L.button_tag(
380
                'kivi.Part.set_selected_variants_to_property("variant_property_' _ variant_property.id _ '")',
381
                "↓",
382
                alt=LxERP.t8('Apply to selected rows'),
383
                title=LxERP.t8('Apply to selected rows'),
384
          ) %]
385
        </th>
386
        [% END %]
387
        <th>
388
          [% L.select_tag("add_variant_property_value_for_selected_variants_properties", []
389
                title_key='displayable_name', value_key='id',
390
                with_empty=1, empty_title=LxERP.t8("Select Variant Property First"),
391
              ) %]
392
          [%- L.button_tag(
393
                'kivi.Part.set_selected_variants_to_property("add_variant_property_value")',
394
                "↓",
395
                alt=LxERP.t8('Apply to selected rows'),
396
                title=LxERP.t8('Apply to selected rows'),
397
          ) %]
398
        </th>
399
      </tr>
400
      </thead>
401
      <tbody class="listrow">
402
        [% FOREACH variant = SELF.part.variants %]
403
          <tr class="variant_property_row_entry">
404
            [% L.hidden_tag("variants_properties[+].id", variant.id, id='variant_' _ variant.id) %]
405
            [% L.hidden_tag("variants_properties[].position", loop.count) %]
406
            <td>
407
              [% L.checkbox_tag('variant_property_multi_id_' _ loop.count, value=variant.id, checked=0) %]
408
            </td>
409
            <td>[% variant.presenter.part %]</td>
410
            <td><span class="data wi-medium">
411
              [% variant.ean | html %]
412
            </span></td>
413
            <td><span class="data wi-normal">
414
              [% variant.description | html %]
415
            </span></td>
416
            <td>[% variant.variant_values | html %]</td>
417
            [% FOREACH variant_property = SELF.part.variant_properties %]
418
            <td>
419
              [% L.select_tag("variants_properties[].variant_property_" _ variant_property.id,
420
                variant_property.property_values_sorted
421
                title_key='displayable_name', value_key='id',
422
                default=variant.variant_value(variant_property).id
423
              ) %]
424
            </td>
425
            [% END %]
426
            <td>
427
              [% L.select_tag("variants_properties[].add_variant_property_value", []
428
                title_key='displayable_name', value_key='id',
429
                with_empty=1, empty_title=LxERP.t8("Select Variant Property First"),
430
              ) %]
431
            </td>
432
          </tr>
433
        [% END %]
434
      </tbody>
435
    </table>
436
    [% L.button_tag('kivi.Part.update_variants_properties();', LxERP.t8("Update Variants")) %]
437
  [% END %]
438

  
321 439
</div>
322 440

  
323 441

  

Auch abrufbar als: Unified diff