Die benutzerdefinierten Variablen für Artikel können konfigurierbar im Tab Basisdaten
angezeigt werden
use SL::Locale::String qw(t8);
use SL::JSON;
use List::Util qw(sum);
+use List::UtilsBy qw(extract_by);
use SL::Helper::Flash;
use Data::Dumper;
use DateTime;
$params{CUSTOM_VARIABLES} = CVar->get_custom_variables(module => 'IC', trans_id => $self->part->id);
- CVar->render_inputs('variables' => $params{CUSTOM_VARIABLES}, show_disabled_message => 1, partsgroup_id => $self->part->partsgroup_id)
- if (scalar @{ $params{CUSTOM_VARIABLES} });
+ if (scalar @{ $params{CUSTOM_VARIABLES} }) {
+ CVar->render_inputs('variables' => $params{CUSTOM_VARIABLES}, show_disabled_message => 1, partsgroup_id => $self->part->partsgroup_id);
+ $params{CUSTOM_VARIABLES_FIRST_TAB} = [];
+ @{ $params{CUSTOM_VARIABLES_FIRST_TAB} } = extract_by { $_->{first_tab} == 1 } @{ $params{CUSTOM_VARIABLES} };
+ }
my %title_hash = ( part => t8('Edit Part'),
assembly => t8('Edit Assembly'),
__PACKAGE__->meta->columns(
default_value => { type => 'text' },
description => { type => 'text', not_null => 1 },
+ first_tab => { type => 'boolean', default => 'false', not_null => 1 },
flags => { type => 'text' },
id => { type => 'integer', not_null => 1, sequence => 'custom_variable_configs_id' },
includeable => { type => 'boolean', not_null => 1 },
Kleinere neue Features und Detailverbesserungen:
+ - Die benutzerdefinierten Variablen für Artikel können konfigurierbar im Tab Basisdaten
+ angezeigt werden (ohne extra Klick auf einen weiteren Tab)
- Der Lagerbestandsbericht wurde um die Anzeige von benutzerdefinierten Variablen
aus dem Bereich Artikel erweitert
- Im Lagerjournal ist standardmäßig die Berichtsanzeige um Dokument angehakt.
--- /dev/null
+-- @tag: custom_variables_add_edit_position
+-- @description: Erweiterung custom_variables
+-- @depends: release_3_5_6_1 custom_variables
+
+ALTER TABLE custom_variable_configs ADD COLUMN first_tab BOOLEAN NOT NULL DEFAULT FALSE;
+
labeldx => LxERP.t8("Partsgroups where variables are shown")) %]
</td>
</tr>
+ <tr data-show-for="IC"[% UNLESS SELF.module == 'IC' %] style="display: none;"[% END %]>
+ <td align="right">[% 'Display in basic data tab' | $T8 %]</td>
+ <td>
+ [% L.radio_button_tag('config.first_tab', value='1', id='config.first_tab', label=LxERP.t8('Yes'), checked=(SELF.config.first_tab ? 1 : '')) %]
+ [% L.radio_button_tag('config.first_tab', value='0', id='config.first_tab', label=LxERP.t8('No'), checked=(SELF.config.first_tab ? '' : 1)) %]
+ </td>
+ </tr>
+
</table>
</p>
<textarea id="part.formel" name="part.formel" rows="[% HTML.escape(notes_rows) %]" cols="30" wrap="soft" class="tooltipster-html" title="[% 'The formula needs the following syntax:<br>For regular article:<br>Variablename= Variable Unit;<br>Variablename2= Variable2 Unit2;<br>...<br>###<br>Variable + ( Variable2 / Variable )<br><b>Please be beware of the spaces in the formula</b><br>' | $T8 %]">[% HTML.escape(SELF.part.formel) %]</textarea>
</td>
</tr>
+ [% IF CUSTOM_VARIABLES_FIRST_TAB %]
+ <tr><td>[% 'Unchecked custom variables will not appear in orders and invoices.' | $T8 %]</td></tr>
+ [%- FOREACH var = CUSTOM_VARIABLES_FIRST_TAB %]
+ <tr>
+ <td align="left" valign="top">[% var.VALID_BOX %]
+ [%- IF !var.partsgroup_filtered %]
+ [% HTML.escape(var.description) %]
+ [%- END %]
+ </tr>
+ <tr><td>[% var.HTML_CODE %]</td></tr>
+ [%- END %]
+ [% END %]
</table>
</td>
</tr>