]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Konfigurierbares Angebotsgültigkeits-Intervall hinzugefügt
authorJan Büren <jan@kivitendo-premium.de>
Tue, 30 Sep 2014 09:28:18 +0000 (11:28 +0200)
committerJan Büren <jan@kivitendo-premium.de>
Tue, 30 Sep 2014 09:28:18 +0000 (11:28 +0200)
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).

SL/DB/MetaSetup/Default.pm
SL/OE.pm
bin/mozilla/oe.pl
locale/de/all
sql/Pg-upgrade2/defaults_reqdate_interval.pl [new file with mode: 0644]
templates/webpages/client_config/_posting_configuration.html

index 2822b86b7fda0ba6c5fa1efdfea9458df87896a6..6f9ea2b37f55cf2760fb9a5035715438c92a4a27 100644 (file)
@@ -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' },
   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' },
   require_transaction_description_ps       => { type => 'boolean', default => 'false', not_null => 1 },
   requirement_spec_section_order_part_id   => { type => 'integer' },
   revtrans                                 => { type => 'boolean', default => 'false' },
index 52a5a61d683565b7c8e876d134b01636eda1d365..8e746f43c37580748fd8f3d7c3fc2b41e0dfe0a0 100644 (file)
--- 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 (!$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|;
   }
 
     $query_add       = qq|, current_date AS transdate, date(current_date + interval '${next_workday} days') AS reqdate|;
   }
 
index 2d64e34562a93776fd566261b4a6a10a5b0a0e8c..3f33c7f75dd4374ebf4b9553b20582d8966d5858 100644 (file)
@@ -240,7 +240,7 @@ sub order_links {
   # get customer/vendor
   $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP");
 
   # 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};
   $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;
 
       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';
       my $query = 'SELECT
                      date(current_date + interval \''. $next_workday .' days\') AS reqdate,
                      date(current_date) AS transdate';
index 4a48544d165499b633e4dc05d28fbe59e466b20f..733048ced02901bbd5e1a0d2dfab7b4185b18416 100755 (executable)
@@ -2033,6 +2033,7 @@ $self->{texts} = {
   'Sales Orders'                => 'Aufträge',
   'Sales Orders deleteable'     => 'Kundenaufträge löschbar',
   'Sales Price information'     => 'Verkaufspreisinformation',
   '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',
   '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',
   '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',
   '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 (file)
index 0000000..05335c6
--- /dev/null
@@ -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;
index 8096c87748561428aadb3d4c06d486eae5c889d3..2d4733dc7d368871f8538d01b290fd3e45323423 100644 (file)
    <td>[% L.select_tag('defaults.balance_startdate_method', SELF.balance_startdate_method_options, value_key = 'value', title_key = 'title', default = SELF.defaults.balance_startdate_method) %]</td>
    <td>[% LxERP.t8('This option controls the method used for determining the startdate for the balance report.') %]</td>
   </tr>
    <td>[% L.select_tag('defaults.balance_startdate_method', SELF.balance_startdate_method_options, value_key = 'value', title_key = 'title', default = SELF.defaults.balance_startdate_method) %]</td>
    <td>[% LxERP.t8('This option controls the method used for determining the startdate for the balance report.') %]</td>
   </tr>
+  <tr>
+   <td align="right">[% LxERP.t8('Sales Quotation valid interval') %]</td>
+   <td>[% L.input_tag('defaults.reqdate_interval', LxERP.format_amount(SELF.defaults.reqdate_interval, 0), style=style) %]</td>
+   <td>[% 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).') %]</td>
+  </tr>
  </table>
 </div>
  </table>
 </div>