From: Moritz Bunkus Date: Mon, 23 Jun 2014 13:16:17 +0000 (+0200) Subject: Einkauf/Verkauf: Eingabe der Vorgangsbezeichnung optional erzwingen X-Git-Tag: release-3.2.0beta~411^2~26 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0194799c9cd192f01db7df4cf056e18871c979e0;p=kivitendo-erp.git Einkauf/Verkauf: Eingabe der Vorgangsbezeichnung optional erzwingen Wird über eine Option in der Mandantenkonfiguration eingeschaltet. --- diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index 5242ccea7..3c84351d6 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -67,6 +67,7 @@ __PACKAGE__->meta->columns( profit_determination => { type => 'text' }, purchase_delivery_order_show_delete => { type => 'boolean', default => 'true' }, purchase_order_show_delete => { type => 'boolean', default => 'true' }, + require_transaction_description_ps => { type => 'boolean', default => 'false', not_null => 1 }, requirement_spec_section_order_part_id => { type => 'integer' }, revtrans => { type => 'boolean', default => 'false' }, rfqnumber => { type => 'text' }, diff --git a/js/kivi.SalesPurchase.js b/js/kivi.SalesPurchase.js index bcae1145a..f6c163362 100644 --- a/js/kivi.SalesPurchase.js +++ b/js/kivi.SalesPurchase.js @@ -53,6 +53,14 @@ namespace('kivi.SalesPurchase', function(ns) { return confirm(kivi.t8('This sales order has an active configuration for periodic invoices. If you save then all subsequently created invoices will contain those changes as well, but not those that have already been created. Do you want to continue?')); }; + this.check_transaction_description = function() { + if ($('#transaction_description').val() != '') + return true; + + alert(kivi.t8('A transaction description is required.')); + return false; + }; + this.on_submit_checks = function() { var $button = $(this); if (($button.data('check-transfer-qty') == 1) && !kivi.SalesPurchase.delivery_order_check_transfer_qty()) @@ -61,6 +69,9 @@ namespace('kivi.SalesPurchase', function(ns) { if (($button.data('warn-save-active-periodic-invoice') == 1) && !kivi.SalesPurchase.oe_warn_save_active_periodic_invoice()) return false; + if (($button.data('require-transaction-description') == 1) && !kivi.SalesPurchase.check_transaction_description()) + return false; + return true; }; diff --git a/js/locale/de.js b/js/locale/de.js index 4b46dc950..3b7e86524 100644 --- a/js/locale/de.js +++ b/js/locale/de.js @@ -1,4 +1,5 @@ namespace("kivi").setupLocale({ +"A transaction description is required.":"Die Vorgangsbezeichnung muss eingegeben werden.", "Add function block":"Funktionsblock hinzufügen", "Add linked record":"Verknüpften Beleg hinzufügen", "Add picture":"Bild hinzufügen", diff --git a/locale/de/all b/locale/de/all index f386c05b4..c4200bb04 100755 --- a/locale/de/all +++ b/locale/de/all @@ -49,6 +49,7 @@ $self->{texts} = { 'A lot of the usability of kivitendo has been enhanced with javascript. Although it is currently possible to use every aspect of kivitendo without javascript, we strongly recommend it. In a future version this may change and javascript may be necessary to access advanced features.' => 'Die Bedienung von kivitendo wurde an vielen Stellen mit Javascript verbessert. Obwohl es derzeit möglich ist, jeden Aspekt von kivitendo auch ohne Javascript zu benutzen, empfehlen wir es. In einer zukünftigen Version wird Javascript eventuell notwendig sein um weitergehende Features zu benutzen.', 'A lower-case character is required.' => 'Ein Kleinbuchstabe ist vorgeschrieben.', 'A special character is required (valid characters: #1).' => 'Ein Sonderzeichen ist vorgeschrieben (gültige Zeichen: #1).', + 'A transaction description is required.' => 'Die Vorgangsbezeichnung muss eingegeben werden.', 'A unit with this name does already exist.' => 'Eine Einheit mit diesem Namen existiert bereits.', 'A valid taxkey is missing!' => 'Einen gültiger Steuerschlüssel fehlt!', 'A variable marked as \'editable\' can be changed in each quotation, order, invoice etc.' => 'Eine als \'editierbar\' markierte Variable kann in jedem Angebot, Auftrag, jeder Rechnung etc für jede Position geändert werden.', @@ -1191,6 +1192,7 @@ $self->{texts} = { 'If amounts differ more than "Maximal amount difference" (see settings), this item is marked as invalid.' => 'Weichen die Beträge mehr als die "maximale Betragsabweichung" (siehe Einstellungen) ab, so wird diese Position als ungültig markiert.', 'If checked the taxkey will not be exported in the DATEV Export, but only IF chart taxkeys differ from general ledger taxkeys' => 'Falls angehakt wird der DATEV-Steuerschlüssel bei Buchungen auf dieses Konto nicht beim DATEV-Export mitexportiert, allerdings nur wenn zusätzlich der Konto-Steuerschlüssel vom Buchungs (Hauptbuch) Steuerschlüssel abweicht', 'If configured this bin will be preselected for all new parts. Also this bin will be used as the master default bin, if default transfer out with master bin is activated.' => 'Falls konfiguriert, wird dieses Lager mit Lagerplatz für neu angelegte Waren vorausgewählt.', + 'If enabled purchase and sales records cannot be saved if no transaction description has been entered.' => 'Wenn angeschaltet, so können Einkaufs- und Verkaufsbelege nicht gespeichert werden, solange keine Vorgangsbezeichnung eingegeben wurde.', 'If missing then the start date will be used.' => 'Falls es fehlt, so wird die erste Rechnung für das Startdatum erzeugt.', 'If the article type is set to \'mixed\' then a column called \'type\' must be present.' => 'Falls der Artikeltyp auf \'gemischt\' gestellt wird, muss eine Spalte namens \'type\' vorhanden sein.', 'If the automatic creation of invoices for fees and interest is switched on for a dunning level then the following accounts will be used for the invoice.' => 'Wenn das automatische Erstellen einer Rechnung über Mahngebühren und Zinsen für ein Mahnlevel aktiviert ist, so werden die folgenden Konten für die Rechnung benutzt.', @@ -1844,6 +1846,7 @@ $self->{texts} = { 'Purchase net amount' => 'EK-Betrag', 'Purchase price' => 'EK-Preis', 'Purchase price total' => 'EK-Betrag', + 'Purchasing & Sales' => 'Einkauf & Verkauf', 'Purpose' => 'Verwendungszweck', 'Qty' => 'Menge', 'Qty according to delivery order' => 'Menge laut Lieferschein', @@ -1929,6 +1932,7 @@ $self->{texts} = { 'Requested execution date from' => 'Gewünschtes Ausführungsdatum von', 'Requested execution date to' => 'Gewünschtes Ausführungsdatum bis', 'Requests for Quotation' => 'Preisanfragen', + 'Require a transaction description in purchase and sales records' => 'Vorgangsbezeichnung in Einkaufs- und Verkaufsbelegen erzwingen', 'Required by' => 'Lieferdatum', 'Requirement Spec Status' => 'Pflichtenheftstatus', 'Requirement Spec Statuses' => 'Pflichtenheftstatus', diff --git a/sql/Pg-upgrade2/defaults_require_transaction_description.sql b/sql/Pg-upgrade2/defaults_require_transaction_description.sql new file mode 100644 index 000000000..250175ae1 --- /dev/null +++ b/sql/Pg-upgrade2/defaults_require_transaction_description.sql @@ -0,0 +1,9 @@ +-- @tag: defaults_require_transaction_description +-- @description: Mandantenkonfiguration: optional Existenz der Vorgangsbezeichnung erzwingen +-- @depends: release_3_1_0 +ALTER TABLE defaults ADD COLUMN require_transaction_description_ps BOOLEAN; +UPDATE defaults SET require_transaction_description_ps = FALSE; + +ALTER TABLE defaults + ALTER COLUMN require_transaction_description_ps SET DEFAULT FALSE, + ALTER COLUMN require_transaction_description_ps SET NOT NULL; diff --git a/templates/webpages/client_config/_features.html b/templates/webpages/client_config/_features.html index af504a880..af14bb98b 100644 --- a/templates/webpages/client_config/_features.html +++ b/templates/webpages/client_config/_features.html @@ -57,6 +57,14 @@ + [% LxERP.t8("Purchasing & Sales") %] + + + [% LxERP.t8('Require a transaction description in purchase and sales records') %] + [% L.yes_no_tag('defaults.require_transaction_description_ps', SELF.defaults.require_transaction_description_ps) %] + [% LxERP.t8('If enabled purchase and sales records cannot be saved if no transaction description has been entered.') %] + + [% LxERP.t8("Requirement Specs") %] diff --git a/templates/webpages/do/form_footer.html b/templates/webpages/do/form_footer.html index 2f1d753f6..e15b44099 100644 --- a/templates/webpages/do/form_footer.html +++ b/templates/webpages/do/form_footer.html @@ -68,26 +68,26 @@ [%- END %] [%- END %] - - + + [%- UNLESS delivered %] - + [%- IF vc == 'customer' %] - + [% IF transfer_default %] - + [%- END %] [%- ELSE %] - + [% IF transfer_default %] - + [%- END %] [%- END %] [%- END %] [%- IF id %] [%- UNLESS closed %] - + [%- END %] [%- END %] @@ -96,7 +96,7 @@ [%- IF id %]

[% 'Workflow Delivery Order' | $T8 %]
- + [% UNLESS delivered || (vc == 'customer' && !INSTANCE_CONF.get_sales_delivery_order_show_delete) || (vc == 'vendor' && !INSTANCE_CONF.get_purchase_delivery_order_show_delete) %] [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm=LxERP.t8('Are you sure?')) %] [% END %] diff --git a/templates/webpages/do/form_header.html b/templates/webpages/do/form_header.html index 63d43cb1c..4d2a0ab20 100644 --- a/templates/webpages/do/form_header.html +++ b/templates/webpages/do/form_header.html @@ -214,7 +214,7 @@ [% 'Transaction description' | $T8 %] - + diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html index 5ab55b739..d3c8ccf3a 100644 --- a/templates/webpages/is/form_footer.html +++ b/templates/webpages/is/form_footer.html @@ -153,20 +153,20 @@ - - + + [% IF show_storno %] - + [% END %] [% IF id && !is_type_credit_note %] - + [% END %] [% IF show_delete && !storno %] - + [% END %] @@ -175,10 +175,10 @@ [% UNLESS locked %] - - - - + + + + [%- END %] [% END # id %] @@ -198,3 +198,6 @@ + diff --git a/templates/webpages/is/form_header.html b/templates/webpages/is/form_header.html index c65878f48..0fa1066e2 100644 --- a/templates/webpages/is/form_header.html +++ b/templates/webpages/is/form_header.html @@ -160,7 +160,7 @@ [% 'Transaction description' | $T8 %] - + diff --git a/templates/webpages/oe/form_footer.html b/templates/webpages/oe/form_footer.html index aa52392b6..b082bf25c 100644 --- a/templates/webpages/oe/form_footer.html +++ b/templates/webpages/oe/form_footer.html @@ -129,17 +129,17 @@ [% label_edit %]
- - - - + + + + [%- IF id %]
[% label_workflow %]
- + [%- UNLESS (is_sales_ord && !INSTANCE_CONF.get_sales_order_show_delete) || (is_pur_ord && !INSTANCE_CONF.get_purchase_order_show_delete) %] [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm=LxERP.t8('Are you sure?')) %] diff --git a/templates/webpages/oe/form_header.html b/templates/webpages/oe/form_header.html index 014663f8f..6a88c012f 100644 --- a/templates/webpages/oe/form_header.html +++ b/templates/webpages/oe/form_header.html @@ -146,7 +146,7 @@ [% 'Transaction description' | $T8 %] - + [%- IF show_delivery_customer %]