From: Jan Büren Date: Wed, 12 Oct 2011 12:42:49 +0000 (+0200) Subject: Kosten- und Erfolgstellen zu unterscheiden macht(e) mittlerweile keinen Sinn mehr... X-Git-Tag: release-2.7.0beta1~230^2~5 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=eb9291da8005a57ecff6f3c2a93a2bf9b6079d37;p=kivitendo-erp.git 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. Entsprechend die letzten Rudimente in der Form.pm entfernt und das Datenmodell für Rose angepasst, sowie natürlich die Tabelle --- diff --git a/SL/Controller/Department.pm b/SL/Controller/Department.pm index d1ba94239..03d3fb676 100644 --- a/SL/Controller/Department.pm +++ b/SL/Controller/Department.pm @@ -30,7 +30,6 @@ sub action_list { sub action_new { my ($self) = @_; - $self->{department} = SL::DB::Department->new(role => 'P'); $self->render('department/form', title => $::locale->text('Create a new department')); } @@ -89,7 +88,6 @@ sub create_or_update { $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.')); diff --git a/SL/DB/MetaSetup/Department.pm b/SL/DB/MetaSetup/Department.pm index 1d1d95709..93aa92cdc 100644 --- a/SL/DB/MetaSetup/Department.pm +++ b/SL/DB/MetaSetup/Department.pm @@ -12,14 +12,11 @@ __PACKAGE__->meta->setup( 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; diff --git a/SL/Form.pm b/SL/Form.pm index b21f94c71..85ba6f0e0 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2757,20 +2757,12 @@ sub all_vc { @{ $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 @@ -2840,15 +2832,9 @@ sub all_departments { 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); diff --git a/sql/Pg-upgrade2/department_drop_role.sql b/sql/Pg-upgrade2/department_drop_role.sql new file mode 100644 index 000000000..5a0ceb530 --- /dev/null +++ b/sql/Pg-upgrade2/department_drop_role.sql @@ -0,0 +1,8 @@ +-- @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; diff --git a/templates/webpages/department/form.html b/templates/webpages/department/form.html index 2dc0dd9d8..d009ea0c3 100644 --- a/templates/webpages/department/form.html +++ b/templates/webpages/department/form.html @@ -12,20 +12,6 @@ [%- 'Description' | $T8 %] [% L.input_tag("department.description", SELF.department.description) %] - - - [%- 'Type' | $T8 %] - - [%- 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") %] -
- [% L.radio_button_tag("department.role", "value", "P", "label", LxERP.t8("Profit Center"), "checked", SELF.department.role == "P") %] - [%- END %] - -

diff --git a/templates/webpages/department/list.html b/templates/webpages/department/list.html index 059aa33b0..7433aa95a 100644 --- a/templates/webpages/department/list.html +++ b/templates/webpages/department/list.html @@ -16,8 +16,6 @@ [%- 'Description' | $T8 %] - [%- 'Cost Center' | $T8 %] - [%- 'Profit Center' | $T8 %] @@ -29,8 +27,6 @@ [%- HTML.escape(department.description) %] - [%- IF department.role == 'C' %]X[%- END %] - [%- IF department.role == 'P' %]X[%- END %] [%- END %]