From: Jan Büren Date: Tue, 30 Sep 2014 09:28:18 +0000 (+0200) Subject: Konfigurierbares Angebotsgültigkeits-Intervall hinzugefügt X-Git-Tag: release-3.2.0beta~303 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=833f083eae2a4547c49f8f92a2fdca6ba4dfe5f4;p=kivitendo-erp.git Konfigurierbares Angebotsgültigkeits-Intervall hinzugefügt Standardmässig ist ein Verkaufsangebot bis zum nächsten Werktag gültig. Dieses Intervall wird dann noch hinzugerechnet, bspw. nächster Werktag plus 14, 28 etc. Falls das Intervall nicht gesetzt oder wir nicht den Typ sales_quotation haben, passiert nichts. Der Datentyp ist Integer, Tippfehler werden bisher nur dort abgefangen (Wird wahrscheinlich nur einmalig von einem Kunden gesetzt). --- diff --git a/SL/DB/MetaSetup/Default.pm b/SL/DB/MetaSetup/Default.pm index 2822b86b7..6f9ea2b37 100644 --- a/SL/DB/MetaSetup/Default.pm +++ b/SL/DB/MetaSetup/Default.pm @@ -72,6 +72,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' }, + reqdate_interval => { type => 'integer', default => '0' }, require_transaction_description_ps => { type => 'boolean', default => 'false', not_null => 1 }, requirement_spec_section_order_part_id => { type => 'integer' }, revtrans => { type => 'boolean', default => 'false' }, diff --git a/SL/OE.pm b/SL/OE.pm index 52a5a61d6..8e746f43c 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -795,6 +795,11 @@ sub retrieve { if (!$form->{id}) { my $wday = (localtime(time))[6]; my $next_workday = $wday == 5 ? 3 : $wday == 6 ? 2 : 1; + + # if we have a client configured interval for sales quotation, we add this + $next_workday += $::instance_conf->get_reqdate_interval if ($::instance_conf->get_reqdate_interval && + $form->{type} eq 'sales_quotation' ); + $query_add = qq|, current_date AS transdate, date(current_date + interval '${next_workday} days') AS reqdate|; } diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 2d64e3456..3f33c7f75 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -240,7 +240,7 @@ sub order_links { # get customer/vendor $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP"); - # retrieve order/quotation + # retrieve order/quotation and webdav config $form->{webdav} = $::instance_conf->get_webdav; my $editing = $form->{id}; @@ -1629,6 +1629,10 @@ sub save_as_new { my $wday = (localtime(time))[6]; my $next_workday = $wday == 5 ? 3 : $wday == 6 ? 2 : 1; + # if we have a client configured interval for sales quotation, we add this + $next_workday += $::instance_conf->get_reqdate_interval if ($::instance_conf->get_reqdate_interval && + $form->{type} eq 'sales_quotation' ); + my $query = 'SELECT date(current_date + interval \''. $next_workday .' days\') AS reqdate, date(current_date) AS transdate'; diff --git a/locale/de/all b/locale/de/all index 4a48544d1..733048ced 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2033,6 +2033,7 @@ $self->{texts} = { 'Sales Orders' => 'Aufträge', 'Sales Orders deleteable' => 'Kundenaufträge löschbar', 'Sales Price information' => 'Verkaufspreisinformation', + 'Sales Quotation valid interval' => 'Angebotsgültigkeitsintervall', 'Sales Quotations' => 'Angebote', 'Sales Report' => 'Verkaufsbericht', 'Sales and purchase invoices with inventory transactions with taxkeys' => 'Einkaufs- und Verkaufsrechnungen mit Warenbestandsbuchungen mit Steuerschlüsseln', @@ -2763,6 +2764,7 @@ $self->{texts} = { 'Updating the client fields in the database "#1" on host "#2:#3" failed.' => 'Die Aktualisierung der Mandantenfelder in der Datenbank "#1" auf Host "#2:#3" schlug fehl.', 'Uploaded at' => 'Hochgeladen um', 'Uploaded on #1, size #2 kB' => 'Am #1 hochgeladen, Größe #2 kB', + 'Usally the sales quotation is valid until the next working day. This entry will be added to this date (i.e. 14, 28).' => 'Standardmässig ist ein Verkaufsangebot bis zum nächsten Werktag gültig. Dieses Intervall wird dann noch hinzugerechnet, bspw. nächster Werktag plus 14, 28 etc.', 'Use As New' => 'Als neu verwenden', 'Use WebDAV Repository' => 'WebDAV-Ablage verwenden', 'Use existing templates' => 'Vorhandene Druckvorlagen verwenden', diff --git a/sql/Pg-upgrade2/defaults_reqdate_interval.pl b/sql/Pg-upgrade2/defaults_reqdate_interval.pl new file mode 100644 index 000000000..05335c632 --- /dev/null +++ b/sql/Pg-upgrade2/defaults_reqdate_interval.pl @@ -0,0 +1,19 @@ +# @tag: defaults_reqdate_interval +# @description: Einstellen der Angebotsgültigkeit per Intervall (z.B.: +28 Tage) +# @depends: release_3_1_0 +package SL::DBUpgrade2::defaults_reqdate_interval; + +use utf8; + +use parent qw(SL::DBUpgrade2::Base); +use strict; + +sub run { + my ($self) = @_; + + # this query will fail if column already exist (new database) + $self->db_query(qq|ALTER TABLE defaults ADD COLUMN reqdate_interval integer DEFAULT 0|); + return 1; +} + +1; diff --git a/templates/webpages/client_config/_posting_configuration.html b/templates/webpages/client_config/_posting_configuration.html index 8096c8774..2d4733dc7 100644 --- a/templates/webpages/client_config/_posting_configuration.html +++ b/templates/webpages/client_config/_posting_configuration.html @@ -86,5 +86,10 @@ [% L.select_tag('defaults.balance_startdate_method', SELF.balance_startdate_method_options, value_key = 'value', title_key = 'title', default = SELF.defaults.balance_startdate_method) %] [% LxERP.t8('This option controls the method used for determining the startdate for the balance report.') %] + + [% LxERP.t8('Sales Quotation valid interval') %] + [% L.input_tag('defaults.reqdate_interval', LxERP.format_amount(SELF.defaults.reqdate_interval, 0), style=style) %] + [% LxERP.t8('Usally the sales quotation is valid until the next working day. This entry will be added to this date (i.e. 14, 28).') %] +