Entsprechend die letzten Rudimente in der Form.pm entfernt und das Datenmodell für Rose angepasst, sowie natürlich die Tabelle
sub action_new {
my ($self) = @_;
- $self->{department} = SL::DB::Department->new(role => 'P');
$self->render('department/form', title => $::locale->text('Create a new department'));
}
$self->render('department/form', title => $is_new ? $::locale->text('Create a new department') : $::locale->text('Edit department'));
return;
}
-
$self->{department}->save;
flash_later('info', $is_new ? $::locale->text('The department has been created.') : $::locale->text('The department has been saved.'));
columns => [
id => { type => 'integer', not_null => 1, sequence => 'id' },
description => { type => 'text' },
- role => { type => 'character', default => 'P', length => 1 },
itime => { type => 'timestamp', default => 'now()' },
mtime => { type => 'timestamp' },
],
primary_key_columns => [ 'id' ],
-
- allow_inline_column_values => 1,
);
1;
@{ $self->{all_employees} } =
sort { $a->{name} cmp $b->{name} } @{ $self->{all_employees} };
- if ($module eq 'AR') {
# prepare query for departments
$query = qq|SELECT id, description
FROM department
- WHERE role = 'P'
ORDER BY description|;
- } else {
- $query = qq|SELECT id, description
- FROM department
- ORDER BY description|;
- }
-
$self->{all_departments} = selectall_hashref_query($self, $dbh, $query);
# get languages
my ($self, $myconfig, $table) = @_;
my $dbh = $self->get_standard_dbh($myconfig);
- my $where;
-
- if ($table eq 'customer') {
- $where = "WHERE role = 'P' ";
- }
my $query = qq|SELECT id, description
FROM department
- $where
ORDER BY description|;
$self->{all_departments} = selectall_hashref_query($self, $dbh, $query);
--- /dev/null
+-- @tag: department_drop_role
+-- @description: Kosten- und Erfolgstellen zu unterscheiden, macht(e) mittlerweile keinen Sinn mehr, da man ja entsprechend Kosten als Erfolg auf eine Kostenstelle buchen möchte. Ferner wird auch die Auswahlliste schon länger nicht mehr unterschieden
+-- @depends: release_2_6_3
+-- @charset: utf-8
+-- @ignore: 0
+
+
+ALTER TABLE department DROP COLUMN role;
<td>[%- 'Description' | $T8 %]</td>
<td>[% L.input_tag("department.description", SELF.department.description) %]</td>
</tr>
-
- <tr>
- <td valign="top">[%- 'Type' | $T8 %]</td>
- <td valign="top">
- [%- IF is_used %]
- [% L.hidden_tag("role", SELF.department.role) %]
- [%- IF SELF.department.role == "C" %][%- LxERP.t8('Cost Center') %][%- ELSE %][%- LxERP.t8('Profit Center') %][%- END %]
- [%- ELSE %]
- [% L.radio_button_tag("department.role", "value", "C", "label", LxERP.t8("Cost Center"), "checked", SELF.department.role == "C") %]
- <br>
- [% L.radio_button_tag("department.role", "value", "P", "label", LxERP.t8("Profit Center"), "checked", SELF.department.role == "P") %]
- [%- END %]
- </td>
- </tr>
</table>
<p>
<thead>
<tr class="listheading">
<th width="100%">[%- 'Description' | $T8 %]</th>
- <th>[%- 'Cost Center' | $T8 %]</th>
- <th>[%- 'Profit Center' | $T8 %]</th>
</tr>
</thead>
[%- HTML.escape(department.description) %]
</a>
</td>
- <td align="center">[%- IF department.role == 'C' %]X[%- END %]</td>
- <td align="center">[%- IF department.role == 'P' %]X[%- END %]</td>
</tr>
[%- END %]
</tbody>