From: Bernd Bleßmann Date: Tue, 6 Nov 2012 13:34:31 +0000 (+0100) Subject: "Löschen"-Knopf anzeigen in Mandantenkonfiguration einstellbar X-Git-Tag: release-3.0.0beta1~14^2~9^2~3 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d8b2ca906d06c4a9d7bdaec1ccefe5d201a630cc;p=kivitendo-erp.git "Löschen"-Knopf anzeigen in Mandantenkonfiguration einstellbar für Aufträge und Lieferscheine. --- diff --git a/SL/Controller/ClientConfig.pm b/SL/Controller/ClientConfig.pm index 6f23b96da..aaed72fc5 100644 --- a/SL/Controller/ClientConfig.pm +++ b/SL/Controller/ClientConfig.pm @@ -41,6 +41,8 @@ sub action_edit { #check_on_dunning = 0 #check_on_sepa_import = 0 + map { $self->{$_} = SL::DB::Default->get->$_ } qw(sales_order_show_delete purchase_order_show_delete sales_delivery_order_show_delete purchase_delivery_order_show_delete); + $self->render('client_config/form', title => $::locale->text('Client Configuration')); } @@ -60,6 +62,8 @@ sub action_save { map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(datev_check_on_sales_invoice datev_check_on_purchase_invoice datev_check_on_ar_transaction datev_check_on_ap_transaction datev_check_on_gl_transaction); + map { SL::DB::Default->get->update_attributes($_ => $::form->{$_}); } qw(sales_order_show_delete purchase_order_show_delete sales_delivery_order_show_delete purchase_delivery_order_show_delete); + flash_later('info', $::locale->text('Client Configuration saved!')); $self->redirect_to(action => 'edit'); diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index f66abac98..9365eac9d 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -10,59 +10,63 @@ __PACKAGE__->meta->setup( table => 'defaults', columns => [ - inventory_accno_id => { type => 'integer' }, - income_accno_id => { type => 'integer' }, - expense_accno_id => { type => 'integer' }, - fxgain_accno_id => { type => 'integer' }, - fxloss_accno_id => { type => 'integer' }, - invnumber => { type => 'text' }, - sonumber => { type => 'text' }, - weightunit => { type => 'varchar', length => 5 }, - businessnumber => { type => 'text' }, - version => { type => 'varchar', length => 8 }, - curr => { type => 'text' }, - closedto => { type => 'date' }, - revtrans => { type => 'boolean', default => 'false' }, - ponumber => { type => 'text' }, - sqnumber => { type => 'text' }, - rfqnumber => { type => 'text' }, - customernumber => { type => 'text' }, - vendornumber => { type => 'text' }, - audittrail => { type => 'boolean', default => 'false' }, - articlenumber => { type => 'text' }, - servicenumber => { type => 'text' }, - coa => { type => 'text' }, - itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - rmanumber => { type => 'text' }, - cnnumber => { type => 'text' }, - dunning_ar_amount_fee => { type => 'integer' }, - dunning_ar_amount_interest => { type => 'integer' }, - dunning_ar => { type => 'integer' }, - pdonumber => { type => 'text' }, - sdonumber => { type => 'text' }, - ar_paid_accno_id => { type => 'integer' }, - id => { type => 'serial', not_null => 1 }, - accounting_method => { type => 'text' }, - inventory_system => { type => 'text' }, - profit_determination => { type => 'text' }, - language_id => { type => 'integer' }, - payments_changeable => { type => 'integer', default => '0', not_null => 1 }, - show_bestbefore => { type => 'boolean', default => 'false' }, - datev_check_on_sales_invoice => { type => 'boolean', default => 'true' }, - datev_check_on_purchase_invoice => { type => 'boolean', default => 'true' }, - datev_check_on_ar_transaction => { type => 'boolean', default => 'true' }, - datev_check_on_ap_transaction => { type => 'boolean', default => 'true' }, - datev_check_on_gl_transaction => { type => 'boolean', default => 'true' }, - is_changeable => { type => 'integer', default => 2, not_null => 1 }, - ir_changeable => { type => 'integer', default => 2, not_null => 1 }, - ar_changeable => { type => 'integer', default => 2, not_null => 1 }, - ap_changeable => { type => 'integer', default => 2, not_null => 1 }, - gl_changeable => { type => 'integer', default => 2, not_null => 1 }, - is_show_mark_as_paid => { type => 'boolean', default => 'true' }, - ir_show_mark_as_paid => { type => 'boolean', default => 'true' }, - ar_show_mark_as_paid => { type => 'boolean', default => 'true' }, - ap_show_mark_as_paid => { type => 'boolean', default => 'true' }, + inventory_accno_id => { type => 'integer' }, + income_accno_id => { type => 'integer' }, + expense_accno_id => { type => 'integer' }, + fxgain_accno_id => { type => 'integer' }, + fxloss_accno_id => { type => 'integer' }, + invnumber => { type => 'text' }, + sonumber => { type => 'text' }, + weightunit => { type => 'varchar', length => 5 }, + businessnumber => { type => 'text' }, + version => { type => 'varchar', length => 8 }, + curr => { type => 'text' }, + closedto => { type => 'date' }, + revtrans => { type => 'boolean', default => 'false' }, + ponumber => { type => 'text' }, + sqnumber => { type => 'text' }, + rfqnumber => { type => 'text' }, + customernumber => { type => 'text' }, + vendornumber => { type => 'text' }, + audittrail => { type => 'boolean', default => 'false' }, + articlenumber => { type => 'text' }, + servicenumber => { type => 'text' }, + coa => { type => 'text' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + rmanumber => { type => 'text' }, + cnnumber => { type => 'text' }, + accounting_method => { type => 'text' }, + inventory_system => { type => 'text' }, + profit_determination => { type => 'text' }, + dunning_ar_amount_fee => { type => 'integer' }, + dunning_ar_amount_interest => { type => 'integer' }, + dunning_ar => { type => 'integer' }, + pdonumber => { type => 'text' }, + sdonumber => { type => 'text' }, + ar_paid_accno_id => { type => 'integer' }, + id => { type => 'serial', not_null => 1 }, + language_id => { type => 'integer' }, + payments_changeable => { type => 'integer', default => '0', not_null => 1 }, + show_bestbefore => { type => 'boolean', default => 'false' }, + datev_check_on_sales_invoice => { type => 'boolean', default => 'true' }, + datev_check_on_purchase_invoice => { type => 'boolean', default => 'true' }, + datev_check_on_ar_transaction => { type => 'boolean', default => 'true' }, + datev_check_on_ap_transaction => { type => 'boolean', default => 'true' }, + datev_check_on_gl_transaction => { type => 'boolean', default => 'true' }, + is_changeable => { type => 'integer', default => 2, not_null => 1 }, + ir_changeable => { type => 'integer', default => 2, not_null => 1 }, + ar_changeable => { type => 'integer', default => 2, not_null => 1 }, + ap_changeable => { type => 'integer', default => 2, not_null => 1 }, + gl_changeable => { type => 'integer', default => 2, not_null => 1 }, + is_show_mark_as_paid => { type => 'boolean', default => 'true' }, + ir_show_mark_as_paid => { type => 'boolean', default => 'true' }, + ar_show_mark_as_paid => { type => 'boolean', default => 'true' }, + ap_show_mark_as_paid => { type => 'boolean', default => 'true' }, + sales_order_show_delete => { type => 'boolean', default => 'true' }, + purchase_order_show_delete => { type => 'boolean', default => 'true' }, + sales_delivery_order_show_delete => { type => 'boolean', default => 'true' }, + purchase_delivery_order_show_delete => { type => 'boolean', default => 'true' }, ], primary_key_columns => [ 'id' ], diff --git a/SL/InstanceConfiguration.pm b/SL/InstanceConfiguration.pm index 65b7b7a3d..ac14b0ae0 100644 --- a/SL/InstanceConfiguration.pm +++ b/SL/InstanceConfiguration.pm @@ -124,6 +124,26 @@ sub get_ap_show_mark_as_paid { return $self->{data}->{ap_show_mark_as_paid}; } +sub get_sales_order_show_delete { + my ($self) = @_; + return $self->{data}->{sales_order_show_delete}; +} + +sub get_purchase_order_show_delete { + my ($self) = @_; + return $self->{data}->{purchase_order_show_delete}; +} + +sub get_sales_delivery_order_show_delete { + my ($self) = @_; + return $self->{data}->{sales_delivery_order_show_delete}; +} + +sub get_purchase_delivery_order_show_delete { + my ($self) = @_; + return $self->{data}->{purchase_delivery_order_show_delete}; +} + 1; __END__ @@ -225,6 +245,17 @@ Returns the default behavior for showing best before date, true or false Returns the default behavior for showing the mark as paid button for the corresponding record type (true or false). +=item C + +=item C + +=item C + +=item C + +Returns the default behavior for showing the delete button for the +corresponding record type (true or false). + =back =head1 BUGS diff --git a/locale/de/all b/locale/de/all index 8e9a59158..db5ff2c52 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1329,6 +1329,7 @@ $self->{texts} = { 'Order Number missing!' => 'Auftragsnummer fehlt!', 'Order deleted!' => 'Auftrag gelöscht!', 'Ordered' => 'Vom Kunde bestellt', + 'Orders / Delivery Orders deleteable' => 'Aufträge / Lieferscheine löschbar', 'Orientation' => 'Seitenformat', 'Orphaned' => 'Nie benutzt', 'Other users\' follow-ups' => 'Wiedervorlagen anderer Benutzer', @@ -1500,9 +1501,11 @@ $self->{texts} = { 'Projects' => 'Projekte', 'Projecttransactions' => 'Projektbuchungen', 'Prozentual/Absolut' => 'Prozentual/Absolut', + 'Purchase Delivery Orders deleteable' => 'Einkaufslieferscheine löschbar', 'Purchase Invoice' => 'Einkaufsrechnung', 'Purchase Order' => 'Lieferantenauftrag', 'Purchase Orders' => 'Lieferantenaufträge', + 'Purchase Orders deleteable' => 'Lieferantenaufträge löschbar', 'Purchase Price' => 'Einkaufspreis', 'Purchase Prices' => 'Einkaufspreise', 'Purchase delivery order' => 'Lieferschein (Einkauf)', @@ -1605,10 +1608,12 @@ $self->{texts} = { 'Saldo neu' => 'Saldo neu', 'Saldo per' => 'Saldo per', 'Sale Prices' => 'Verkaufspreise', + 'Sales Delivery Orders deleteable' => 'Verkaufslieferscheine löschbar', 'Sales Invoice' => 'Rechnung', 'Sales Invoices' => 'Kundenrechnung', 'Sales Order' => 'Kundenauftrag', 'Sales Orders' => 'Aufträge', + 'Sales Orders deleteable' => 'Kundenaufträge löschbar', 'Sales Price information' => 'Verkaufspreisinformation', 'Sales Report' => 'Verkaufsbericht', 'Sales and purchase invoices with inventory transactions with taxkeys' => 'Einkaufs- und Verkaufsrechnungen mit Warenbestandsbuchungen mit Steuerschlüsseln', @@ -1726,6 +1731,10 @@ $self->{texts} = { 'Show TODO list' => 'Aufgabenliste anzeigen', 'Show by default' => 'Standardmäßig anzeigen', 'Show custom variable search inputs' => 'Suchoptionen für Benutzerdefinierte Variablen verstecken', + 'Show delete button in purchase delivery orders?' => 'Soll der "Löschen"-Knopf bei Einkaufslieferscheinen angezeigt werden?', + 'Show delete button in purchase orders?' => 'Soll der "Löschen"-Knopf bei Lieferantenaufträgen angezeigt werden?', + 'Show delete button in sales delivery orders?' => 'Soll der "Löschen"-Knopf bei Verkaufslieferscheinen angezeigt werden?', + 'Show delete button in sales orders?' => 'Soll der "Löschen"-Knopf bei Kundenaufträgen angezeigt werden?', 'Show details' => 'Detailsanzeige', 'Show fields used for the best before date?' => 'Felder zur Eingabe des Mindesthaltbarkeitsdatums anzeigen?', 'Show follow ups...' => 'Zeige Wiedervorlagen...', diff --git a/locale/de_DE/all b/locale/de_DE/all index f24032bef..e07e39aca 100644 --- a/locale/de_DE/all +++ b/locale/de_DE/all @@ -1294,6 +1294,7 @@ $self->{texts} = { 'Order Number missing!' => 'Auftragsnummer fehlt!', 'Order deleted!' => 'Auftrag gelöscht!', 'Ordered' => 'Vom Kunde bestellt', + 'Orders / Delivery Orders deleteable' => 'Aufträge / Lieferscheine löschbar', 'Orientation' => 'Seitenformat', 'Orphaned' => 'Nie benutzt', 'Other users\' follow-ups' => 'Wiedervorlagen anderer Benutzer', @@ -1463,9 +1464,11 @@ $self->{texts} = { 'Projects' => 'Projekte', 'Projecttransactions' => 'Projektbuchungen', 'Prozentual/Absolut' => 'Prozentual/Absolut', + 'Purchase Delivery Orders deleteable' => 'Einkaufslieferscheine löschbar', 'Purchase Invoice' => 'Einkaufsrechnung', 'Purchase Order' => 'Lieferantenauftrag', 'Purchase Orders' => 'Einkaufsbestellungen', + 'Purchase Orders deleteable' => 'Lieferantenaufträge löschbar', 'Purchase Price' => 'Einkaufspreis', 'Purchase Prices' => 'Einkaufspreise', 'Purchase delivery order' => 'Lieferschein (Einkauf)', @@ -1564,10 +1567,12 @@ $self->{texts} = { 'Saldo neu' => 'Saldo neu', 'Saldo per' => 'Saldo per', 'Sale Prices' => 'Verkaufspreise', + 'Sales Delivery Orders deleteable' => 'Verkaufslieferscheine löschbar', 'Sales Invoice' => 'Rechnung', 'Sales Invoices' => 'Ausgangsrechnungen', 'Sales Order' => 'Kundenauftrag', 'Sales Orders' => 'Aufträge', + 'Sales Orders deleteable' => 'Kundenaufträge löschbar', 'Sales Price information' => '', 'Sales Report' => 'Verkaufsbericht', 'Sales and purchase invoices with inventory transactions with taxkeys' => 'Einkaufs- und Verkaufsrechnungen mit Warenbestandsbuchungen mit Steuerschlüsseln', @@ -1680,6 +1685,10 @@ $self->{texts} = { 'Show TODO list' => 'Meine Aufgaben', 'Show by default' => 'Standardmäßig anzeigen', 'Show custom variable search inputs' => 'Suche in erweiterten Datenfeldern', + 'Show delete button in purchase delivery orders?' => 'Soll der "Löschen"-Knopf bei Einkaufslieferscheinen angezeigt werden?', + 'Show delete button in purchase orders?' => 'Soll der "Löschen"-Knopf bei Lieferantenaufträgen angezeigt werden?', + 'Show delete button in sales delivery orders?' => 'Soll der "Löschen"-Knopf bei Verkaufslieferscheinen angezeigt werden?', + 'Show delete button in sales orders?' => 'Soll der "Löschen"-Knopf bei Kundenaufträgen angezeigt werden?', 'Show details' => 'Detailsanzeige', 'Show fields used for the best before date?' => 'Felder zur Eingabe des Mindesthaltbarkeitsdatums anzeigen?', 'Show follow ups...' => 'Zeige Wiedervorlagen...', diff --git a/locale/en/all b/locale/en/all index 7f1d0cb28..89a4ddf1c 100644 --- a/locale/en/all +++ b/locale/en/all @@ -1310,6 +1310,7 @@ $self->{texts} = { 'Order Number missing!' => '', 'Order deleted!' => '', 'Ordered' => '', + 'Orders / Delivery Orders deleteable' => '', 'Orientation' => '', 'Orphaned' => '', 'Other users\' follow-ups' => '', @@ -1480,9 +1481,11 @@ $self->{texts} = { 'Projects' => '', 'Projecttransactions' => '', 'Prozentual/Absolut' => '', + 'Purchase Delivery Orders deleteable' => '', 'Purchase Invoice' => '', 'Purchase Order' => '', 'Purchase Orders' => '', + 'Purchase Orders deleteable' => '', 'Purchase Price' => '', 'Purchase Prices' => '', 'Purchase delivery order' => '', @@ -1583,10 +1586,12 @@ $self->{texts} = { 'Saldo neu' => '', 'Saldo per' => '', 'Sale Prices' => '', + 'Sales Delivery Orders deleteable' => '', 'Sales Invoice' => '', 'Sales Invoices' => '', 'Sales Order' => '', 'Sales Orders' => '', + 'Sales Orders deleteable' => '', 'Sales Price information' => '', 'Sales Report' => '', 'Sales and purchase invoices with inventory transactions with taxkeys' => '', @@ -1703,6 +1708,10 @@ $self->{texts} = { 'Show TODO list' => '', 'Show by default' => '', 'Show custom variable search inputs' => '', + 'Show delete button in purchase delivery orders?' => '', + 'Show delete button in purchase orders?' => '', + 'Show delete button in sales delivery orders?' => '', + 'Show delete button in sales orders?' => '', 'Show details' => '', 'Show fields used for the best before date?' => '', 'Show follow ups...' => '', diff --git a/sql/Pg-upgrade2/defaults_show_delete_on_orders.sql b/sql/Pg-upgrade2/defaults_show_delete_on_orders.sql new file mode 100644 index 000000000..6f876eb87 --- /dev/null +++ b/sql/Pg-upgrade2/defaults_show_delete_on_orders.sql @@ -0,0 +1,9 @@ +-- @tag: defaults_show_delete_on_orders +-- @description: Einstellung, ob der "Löschen"-Knopf bei Aufträgen und Lieferscheinen angezeigt wird. +-- @depends: release_2_7_0 +-- @charset: utf-8 + +ALTER TABLE defaults ADD COLUMN sales_order_show_delete boolean DEFAULT TRUE; +ALTER TABLE defaults ADD COLUMN purchase_order_show_delete boolean DEFAULT TRUE; +ALTER TABLE defaults ADD COLUMN sales_delivery_order_show_delete boolean DEFAULT TRUE; +ALTER TABLE defaults ADD COLUMN purchase_delivery_order_show_delete boolean DEFAULT TRUE; diff --git a/templates/webpages/client_config/form.html b/templates/webpages/client_config/form.html index f772d3e7f..5fc0c04ac 100644 --- a/templates/webpages/client_config/form.html +++ b/templates/webpages/client_config/form.html @@ -131,6 +131,33 @@ + + [% 'Orders / Delivery Orders deleteable' | $T8 %] + + + [% 'Sales Orders deleteable' | $T8 %] + [% L.yes_no_tag('sales_order_show_delete', SELF.sales_order_show_delete) %] + [% 'Show delete button in sales orders?' | $T8 %] + + + [% 'Purchase Orders deleteable' | $T8 %] + [% L.yes_no_tag('purchase_order_show_delete', SELF.purchase_order_show_delete) %] + [% 'Show delete button in purchase orders?' | $T8 %] + + + [% 'Sales Delivery Orders deleteable' | $T8 %] + [% L.yes_no_tag('sales_delivery_order_show_delete', SELF.sales_delivery_order_show_delete) %] + [% 'Show delete button in sales delivery orders?' | $T8 %] + + + [% 'Purchase Delivery Orders deleteable' | $T8 %] + [% L.yes_no_tag('purchase_delivery_order_show_delete', SELF.purchase_delivery_order_show_delete) %] + [% 'Show delete button in purchase delivery orders?' | $T8 %] + + + + + [% 'Warehouse' | $T8 %] @@ -157,4 +184,6 @@ [%- L.hidden_tag('action', 'ClientConfig/dispatch') %] [%- L.submit_tag('action_save', LxERP.t8('Save')) %] +

+ diff --git a/templates/webpages/do/form_footer.html b/templates/webpages/do/form_footer.html index a37e94239..364367b92 100644 --- a/templates/webpages/do/form_footer.html +++ b/templates/webpages/do/form_footer.html @@ -82,8 +82,8 @@

[% 'Workflow Delivery Order' | $T8 %]
- [% UNLESS delivered %] - + [% UNLESS delivered || (vc == 'customer' && !INSTANCE_CONF.get_sales_delivery_order_show_delete) || (vc == 'vendor' && !INSTANCE_CONF.get_purchase_delivery_order_show_delete) %] + [% END %]

diff --git a/templates/webpages/oe/form_footer.html b/templates/webpages/oe/form_footer.html index ddf4a53d2..f83334c44 100644 --- a/templates/webpages/oe/form_footer.html +++ b/templates/webpages/oe/form_footer.html @@ -146,7 +146,10 @@
[% label_workflow %]
- + + [%- UNLESS (is_sales_ord && !INSTANCE_CONF.get_sales_order_show_delete) || (is_pur_ord && !INSTANCE_CONF.get_purchase_order_show_delete) %] + + [%- END %] [%- IF is_sales_quo %]