]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Option für Datev-Check in Mandantenkonfiguration verschoben.
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 2 Nov 2012 11:17:25 +0000 (12:17 +0100)
committerBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 2 Nov 2012 12:45:22 +0000 (13:45 +0100)
14 files changed:
SL/AP.pm
SL/AR.pm
SL/Controller/ClientConfig.pm
SL/DB/MetaSetup/Default.pm
SL/GL.pm
SL/IR.pm
SL/IS.pm
SL/InstanceConfiguration.pm
config/kivitendo.conf.default
locale/de/all
locale/de_DE/all
locale/en/all
sql/Pg-upgrade2/defaults_datev_check.pl [new file with mode: 0644]
templates/webpages/client_config/form.html

index 839d40be6c33d96d9b546082c272f39fe1a760b4..95bde38e5cf2aea81dbc93ad8094d162fd2ecd32 100644 (file)
--- a/SL/AP.pm
+++ b/SL/AP.pm
@@ -355,7 +355,7 @@ sub post_transaction {
   IO->set_datepaid(table => 'ap', id => $form->{id}, dbh => $dbh);
 
   # safety check datev export
-  if ($::lx_office_conf{datev_check}{check_on_ap_transaction}) {
+  if ($::instance_conf->get_datev_check_on_ap_transaction) {
     my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
     $transdate  ||= DateTime->today;
 
index fcf898ea0510f4ffd39cafaeb6b40322728d1f50..1f8a0c0f55af8a3d5ecc160e884e6ab6b717ae37 100644 (file)
--- a/SL/AR.pm
+++ b/SL/AR.pm
@@ -276,7 +276,7 @@ sub post_transaction {
   IO->set_datepaid(table => 'ar', id => $form->{id}, dbh => $dbh);
 
   # safety check datev export
-  if ($::lx_office_conf{datev_check}{check_on_ar_transaction}) {
+  if ($::instance_conf->get_datev_check_on_ar_transaction) {
     my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
     $transdate  ||= DateTime->today;
 
index 97ff15a6d162fabfe701074ff66c9c96fb3d4617..e6e687806e0c0e45515ea5b4f6d2f55ee2c0e269 100644 (file)
@@ -19,6 +19,12 @@ sub action_edit {
   $self->{payments_changeable} = SL::DB::Default->get->payments_changeable;
   $self->{show_bestbefore}     = SL::DB::Default->get->show_bestbefore;
 
+  map { $self->{$_} = SL::DB::Default->get->$_ } 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);
+  # datev check: not implemented yet:
+  #check_on_cash_and_receipt = 0
+  #check_on_dunning = 0
+  #check_on_sepa_import = 0
+
   $self->render('client_config/form', title => $::locale->text('Client Configuration'));
 }
 
@@ -29,6 +35,8 @@ sub action_save {
   SL::DB::Default->get->update_attributes('payments_changeable' => $::form->{payments_changeable});
   SL::DB::Default->get->update_attributes('show_bestbefore'     => $::form->{show_bestbefore});
 
+  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);
+
   flash_later('info', $::locale->text('Client Configuration saved!'));
 
   $self->redirect_to(action => 'edit');
index 8920ef582f859e5eb487a3c1fd93b6429740e700..0822368bf47bfc8e118b7aca0dc2f0762c1e8b9d 100644 (file)
@@ -10,45 +10,50 @@ __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' },
+    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' },
   ],
 
   primary_key_columns => [ 'id' ],
index cdd9d406ffcd6380852677cae3f8096e42f6b8aa..c9fcd9c476ecf207ef064e26ea476e1a77ff5f9c 100644 (file)
--- a/SL/GL.pm
+++ b/SL/GL.pm
@@ -186,7 +186,7 @@ sub post_transaction {
   }
 
   # safety check datev export
-  if ($::lx_office_conf{datev_check}{check_on_gl_transaction}) {
+  if ($::instance_conf->get_datev_check_on_gl_transaction) {
     my $transdate = $::form->{transdate} ? DateTime->from_lxoffice($::form->{transdate}) : undef;
     $transdate  ||= DateTime->today;
 
index 7be04aef2d49273388d05cd7206ed329ed482b33..04e071e27c5c4529d2572741ee44adb832be5e27 100644 (file)
--- a/SL/IR.pm
+++ b/SL/IR.pm
@@ -686,7 +686,7 @@ sub post_invoice {
                                'table'   => 'ap',);
 
   # safety check datev export
-  if ($::lx_office_conf{datev_check}{check_on_purchase_invoice}) {
+  if ($::instance_conf->get_datev_check_on_purchase_invoice) {
     my $transdate = $::form->{invdate} ? DateTime->from_lxoffice($::form->{invdate}) : undef;
     $transdate  ||= DateTime->today;
 
index 8f00225bec301928c9ff3408f860b4d24d4ca711..db18d5a43816a36572fc8988bd55c013df941d16 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -1077,7 +1077,7 @@ sub post_invoice {
                                'table'   => 'ar',);
 
   # safety check datev export
-  if ($::lx_office_conf{datev_check}{check_on_sales_invoice}) {
+  if ($::instance_conf->get_datev_check_on_sales_invoice) {
     my $transdate = $::form->{invdate} ? DateTime->from_lxoffice($::form->{invdate}) : undef;
     $transdate  ||= DateTime->today;
 
index 4629e9423fc94a89c4a14f7e9054a4dc2674e62d..58025ce5792257fb20ccb5b090d498e5b9c2fc85 100644 (file)
@@ -49,6 +49,31 @@ sub get_profit_determination {
   return $self->{data}->{profit_determination};
 }
 
+sub get_datev_check_on_sales_invoice {
+  my ($self) = @_;
+  return $self->{data}->{datev_check_on_sales_invoice};
+}
+
+sub get_datev_check_on_purchase_invoice {
+  my ($self) = @_;
+  return $self->{data}->{datev_check_on_purchase_invoice};
+}
+
+sub get_datev_check_on_ar_transaction {
+  my ($self) = @_;
+  return $self->{data}->{datev_check_on_ar_transaction};
+}
+
+sub get_datev_check_on_ap_transaction {
+  my ($self) = @_;
+  return $self->{data}->{datev_check_on_ap_transaction};
+}
+
+sub get_datev_check_on_gl_transaction {
+  my ($self) = @_;
+  return $self->{data}->{datev_check_on_gl_transaction};
+}
+
 sub get_show_bestbefore {
   my ($self) = @_;
   return $self->{data}->{show_bestbefore};
@@ -106,6 +131,26 @@ Returns the default inventory system, perpetual or periodic
 
 Returns the default profit determination method, balance or income
 
+=item C<get_datev_check_on_sales_invoice>
+
+Returns true if datev check should be performed on sales invoices
+
+=item C<get_datev_check_on_purchase_invoice>
+
+Returns true if datev check should be performed on purchase invoices
+
+=item C<get_datev_check_on_ar_transaction>
+
+Returns true if datev check should be performed on ar transactions
+
+=item C<get_datev_check_on_ap_transaction>
+
+Returns true if datev check should be performed on ap transactions
+
+=item C<get_datev_check_on_gl_transaction>
+
+Returns true if datev check should be performed on gl transactions
+
 =item C<get_show_bestbefore>
 
 Returns the default behavior for showing best before date, true or false
index e3d5adbadb9d5ad9bd8ac266f53b34db86e7e722..96a7d429020d122d4cd285716ace9cce7cd26abd 100644 (file)
@@ -198,27 +198,6 @@ email_subject  = kivitendo self test report
 # template. currently txt and html templates are recognized and correctly mime send.
 email_template = templates/mail/self_test/status_mail.txt
 
-[datev_check]
-# it is possible to make a quick DATEV export everytime you post a record to ensure things
-# work nicely with their data requirements. This will result in a slight overhead though
-# you can enable this for each type of record independantly.
-
-# check when a sales invoice or a payment for a sales invoice is posted
-check_on_sales_invoice = 1
-# check when a purchase invoice or a payment for a purchase invoice is posted
-check_on_purchase_invoice = 1
-# check when an ar transaction is posted
-check_on_ar_transaction = 1
-# check when an ap transaction is posted
-check_on_ap_transaction = 1
-# check when a gl transaction is posted
-check_on_gl_transaction = 1
-
-# not implemented yet:
-#check_on_cash_and_receipt = 0
-#check_on_dunning = 0
-#check_on_sepa_import = 0
-
 [console]
 # autologin to use if none is given
 login =
index 1ee4ea3d6946ba063383f7ec2a1f4f22e12fa340..63a677df8f98a2c4a78774ea9331f88b303e8b6c 100644 (file)
@@ -399,6 +399,11 @@ $self->{texts} = {
   'Check'                       => 'Scheck',
   'Check Details'               => 'Bitte Angaben überprüfen',
   'Check for duplicates'        => 'Dublettencheck',
+  'Check on ap transaction'     => 'Prüfen bei Kreditorenbuchung',
+  'Check on ar transaction'     => 'Prüfen bei Debitorenbuchung',
+  'Check on gl transaction'     => 'Prüfen bei Dialogbuchung',
+  'Check on purchase invoice'   => 'Prüfen bei Einkaufsrechnung',
+  'Check on sales invoice'      => 'Prüfen bei Verkaufsrechnung',
   'Checks'                      => 'Schecks',
   'Choose Customer'             => 'Endkunde wählen:',
   'Choose Outputformat'         => 'Ausgabeformat auswählen...',
@@ -542,6 +547,7 @@ $self->{texts} = {
   'DATEV - Export Assistent'    => 'DATEV-Exportassistent',
   'DATEV Angaben'               => 'DATEV-Angaben',
   'DATEV Export'                => 'DATEV-Export',
+  'DATEV check configuration'   => 'Einstellungen für DATEV-Prüfung',
   'DATEV check returned errors:' => 'Die DATEV Prüfung dieser Buchung ergab Fehler:',
   'DATEX - Export Assistent'    => 'DATEV-Exportassistent',
   'DELETED'                     => 'Gelöscht',
@@ -1036,6 +1042,7 @@ $self->{texts} = {
   'It is possible that even after such a correction there is something wrong with this transaction (e.g. taxes that don\'t match the selected taxkey). Therefore you should re-run the general ledger analysis.' => 'Auch nach einer Korrektur kann es mit dieser Buchung noch weitere Probleme geben (z.B. nicht zum Steuerschlüssel passende Steuern), weshalb ein erneutes Ausführen der Hauptbuchanalyse empfohlen wird.',
   'It is possible to do this automatically for some Buchungsgruppen, but not for all.' => 'Es ist m&ouml;glich, dies f&uuml;r einige, aber nicht f&uuml;r alle Buchungsgruppen automatisch zu erledigen.',
   'It is possible to do this automatically for some units, but for others the user has to chose the new unit.' => 'Das ist f&uuml;r einige Einheiten automatisch m&ouml;glich, aber bei anderen muss der Benutzer die neue Einheit ausw&auml;hlen.',
+  'It is possible to make a quick DATEV export everytime you post a record to ensure things work nicely with their data requirements. This will result in a slight overhead though you can enable this for each type of record independantly.' => 'Es ist möglich, bei jeder Buchung einen schnellen DATEV-Export durchzuführen, um sicherzustellen, dass die Datensätze den DATEV-Anforderungen genügen. Da dies einen kleinen Overhead bedeutet, lässt sich dei Einstellung für jeden Buchungstyp getrennt einstellen.',
   'It may optionally be compressed with &quot;gzip&quot;.' => 'Sie darf optional mit &quot;gzip&quot; komprimiert sein.',
   'It will simply set the taxkey to 0 (meaning "no taxes") which is the correct value for such inventory transactions.' => 'Es wird einfach die Steuerschlüssel auf  0 setzen, was "keine Steuer" bedeutet und für solche Warenbestandsbuchungen der richtige Wert ist.',
   'Item deleted!'               => 'Artikel gelöscht!',
@@ -1375,6 +1382,11 @@ $self->{texts} = {
   'Payments'                    => 'Zahlungsausgänge',
   'Payments Changeable'         => 'Änderbarkeit von Zahlungen',
   'Per. Inv.'                   => 'Wied. Rech.',
+  'Perform check when a gl transaction is posted?' => 'Prüfung durchführen, wenn eine Dialogbuchung gebucht wird?',
+  'Perform check when a purchase invoice or a payment for a purchase invoice is posted?' => 'Prüfung durchführen, wenn eine Einkaufsrechnung oder ein Zahlungsausgang hierfür gebucht wird?',
+  'Perform check when a sales invoice or a payment for a sales invoice is posted?' => 'Prüfung durchführen, wenn eine Verkaufsrechnung oder ein Zahlungseingang hierfür gebucht wird?',
+  'Perform check when an ap transaction is posted?' => 'Prüfung durchführen, wenn Kreditorenbuchung gebucht wird?',
+  'Perform check when an ar transaction is posted?' => 'Prüfung durchführen, wenn Debiotorenbuchung gebucht wird?',
   'Period'                      => 'Zeitraum',
   'Period:'                     => 'Zeitraum:',
   'Periodic Invoices'           => 'Wiederkehrende Rechnungen',
@@ -2353,8 +2365,8 @@ $self->{texts} = {
   'not yet executed'            => 'Noch nicht ausgeführt',
   'number'                      => 'Nummer',
   'oe.pl::search called with unknown type' => 'oe.pl::search mit unbekanntem Typ aufgerufen',
-  'one-time execution'          => 'einmalige Ausführung',
   'on the same day'             => 'am selben Tag',
+  'one-time execution'          => 'einmalige Ausführung',
   'only OB Transactions'        => 'nur EB-Buchungen',
   'open'                        => 'Offen',
   'order'                       => 'Reihenfolge',
index f90ecaf1e69b7b73e85f47fe9290cdd6e275e739..cd9ba9097da3a766a8d222aa5153edee38a297ed 100644 (file)
@@ -390,6 +390,11 @@ $self->{texts} = {
   'Check'                       => 'Scheck',
   'Check Details'               => 'Bitte Angaben überprüfen',
   'Check for duplicates'        => 'Dublettencheck',
+  'Check on ap transaction'     => 'Prüfen bei Kreditorenbuchung',
+  'Check on ar transaction'     => 'Prüfen bei Debitorenbuchung',
+  'Check on gl transaction'     => 'Prüfen bei Dialogbuchung',
+  'Check on purchase invoice'   => 'Prüfen bei Einkaufsrechnung',
+  'Check on sales invoice'      => 'Prüfen bei Verkaufsrechnung',
   'Checks'                      => 'Schecks',
   'Choose Customer'             => 'Endkunde wählen:',
   'Choose Outputformat'         => 'Ausgabeformat auswählen...',
@@ -520,6 +525,7 @@ $self->{texts} = {
   'Customers'                   => 'Kunden',
   'Customers and vendors'       => 'Kunden und Lieferanten',
   'Customized Report'           => 'Vorgewählte Zeiträume',
+  'DATEV check configuration'   => 'Einstellungen für DATEV-Prüfung',
   'DATEV - Export Assistent'    => 'DATEV-Exportassistent',
   'DATEV Angaben'               => 'DATEV-Angaben',
   'DATEV Export'                => 'DATEV-Export',
@@ -1004,6 +1010,7 @@ $self->{texts} = {
   'It is possible that even after such a correction there is something wrong with this transaction (e.g. taxes that don\'t match the selected taxkey). Therefore you should re-run the general ledger analysis.' => 'Auch nach einer Korrektur kann es mit dieser Buchung noch weitere Probleme geben (z.B. nicht zum Steuerschlüssel passende Steuern), weshalb ein erneutes Ausführen der Hauptbuchanalyse empfohlen wird.',
   'It is possible to do this automatically for some Buchungsgruppen, but not for all.' => 'Es ist m&ouml;glich, dies f&uuml;r einige, aber nicht f&uuml;r alle Buchungsgruppen automatisch zu erledigen.',
   'It is possible to do this automatically for some units, but for others the user has to chose the new unit.' => 'Das ist f&uuml;r einige Einheiten automatisch m&ouml;glich, aber bei anderen muss der Benutzer die neue Einheit ausw&auml;hlen.',
+  'It is possible to make a quick DATEV export everytime you post a record to ensure things work nicely with their data requirements. This will result in a slight overhead though you can enable this for each type of record independantly.' => 'Es ist möglich, bei jeder Buchung einen schnellen DATEV-Export durchzuführen, um sicherzustellen, dass die Datensätze den DATEV-Anforderungen genügen. Da dies einen kleinen Overhead bedeutet, lässt sich dei Einstellung für jeden Buchungstyp getrennt einstellen.',
   'It may optionally be compressed with &quot;gzip&quot;.' => 'Sie darf optional mit &quot;gzip&quot; komprimiert sein.',
   'It will simply set the taxkey to 0 (meaning "no taxes") which is the correct value for such inventory transactions.' => 'Es wird einfach die Steuerschlüssel auf  0 setzen, was "keine Steuer" bedeutet und für solche Warenbestandsbuchungen der richtige Wert ist.',
   'Item deleted!'               => 'Artikel gelöscht!',
@@ -1339,6 +1346,11 @@ $self->{texts} = {
   'Payments'                    => 'Zahlungsausgänge',
   'Payments Changeable'         => 'Änderbarkeit von Zahlungen',
   'Per. Inv.'                   => 'Wied. Rech.',
+  'Perform check when a gl transaction is posted?' => 'Prüfung durchführen, wenn eine Dialogbuchung gebucht wird?',
+  'Perform check when a purchase invoice or a payment for a purchase invoice is posted?' => 'Prüfung durchführen, wenn eine Einkaufsrechnung oder ein Zahlungsausgang hierfür gebucht wird?',
+  'Perform check when a sales invoice or a payment for a sales invoice is posted?' => 'Prüfung durchführen, wenn eine Verkaufsrechnung oder ein Zahlungseingang hierfür gebucht wird?',
+  'Perform check when an ap transaction is posted?' => 'Prüfung durchführen, wenn Kreditorenbuchung gebucht wird?',
+  'Perform check when an ar transaction is posted?' => 'Prüfung durchführen, wenn Debiotorenbuchung gebucht wird?',
   'Period'                      => 'Zeitraum',
   'Period:'                     => 'Zeitraum:',
   'Periodic Invoices'           => 'Wiederkehrende Rechnungen',
index e76c86695de92ea292b38d90891d096cf2be89c7..87ec3176972a8e03ac37e434444e051d582d01e9 100644 (file)
@@ -391,6 +391,11 @@ $self->{texts} = {
   'Check'                       => 'Cheque',
   'Check Details'               => '',
   'Check for duplicates'        => '',
+  'Check on ap transaction'     => '',
+  'Check on ar transaction'     => '',
+  'Check on gl transaction'     => '',
+  'Check on purchase invoice'   => '',
+  'Check on sales invoice'      => '',
   'Checks'                      => '',
   'Choose Customer'             => '',
   'Choose Outputformat'         => '',
@@ -531,6 +536,7 @@ $self->{texts} = {
   'DATEV - Export Assistent'    => '',
   'DATEV Angaben'               => '',
   'DATEV Export'                => '',
+  'DATEV check configuration'   => '',
   'DATEV check returned errors:' => '',
   'DATEX - Export Assistent'    => '',
   'DELETED'                     => '',
@@ -1020,6 +1026,7 @@ $self->{texts} = {
   'It is possible that even after such a correction there is something wrong with this transaction (e.g. taxes that don\'t match the selected taxkey). Therefore you should re-run the general ledger analysis.' => '',
   'It is possible to do this automatically for some Buchungsgruppen, but not for all.' => '',
   'It is possible to do this automatically for some units, but for others the user has to chose the new unit.' => '',
+  'It is possible to make a quick DATEV export everytime you post a record to ensure things work nicely with their data requirements. This will result in a slight overhead though you can enable this for each type of record independantly.' => '',
   'It may optionally be compressed with &quot;gzip&quot;.' => '',
   'It will simply set the taxkey to 0 (meaning "no taxes") which is the correct value for such inventory transactions.' => '',
   'Item deleted!'               => '',
@@ -1355,6 +1362,11 @@ $self->{texts} = {
   'Payments'                    => '',
   'Payments Changeable'         => '',
   'Per. Inv.'                   => '',
+  'Perform check when a gl transaction is posted?' => '',
+  'Perform check when a purchase invoice or a payment for a purchase invoice is posted?' => '',
+  'Perform check when a sales invoice or a payment for a sales invoice is posted?' => '',
+  'Perform check when an ap transaction is posted?' => '',
+  'Perform check when an ar transaction is posted?' => '',
   'Period'                      => '',
   'Period:'                     => '',
   'Periodic Invoices'           => '',
diff --git a/sql/Pg-upgrade2/defaults_datev_check.pl b/sql/Pg-upgrade2/defaults_datev_check.pl
new file mode 100644 (file)
index 0000000..5077281
--- /dev/null
@@ -0,0 +1,54 @@
+# @tag: defaults_datev_check
+# @description: Einstellung für DATEV-Überprüfungen (datev_check) vom Config-File in die DB verlagern.
+# @depends: release_2_7_0
+# @charset: utf-8
+
+use utf8;
+use strict;
+
+die("This script cannot be run from the command line.") unless ($main::form);
+
+sub mydberror {
+  my ($msg) = @_;
+  die($dbup_locale->text("Database update error:") .
+      "<br>$msg<br>" . $DBI::errstr);
+}
+
+sub do_query {
+  my ($query, $may_fail) = @_;
+
+  if (!$dbh->do($query)) {
+    mydberror($query) unless ($may_fail);
+    $dbh->rollback();
+    $dbh->begin_work();
+  }
+}
+
+sub do_update {
+
+  # this query will fail if column already exist (new database)
+  do_query(qq|ALTER TABLE defaults ADD COLUMN datev_check_on_sales_invoice boolean    DEFAULT true|, 1);
+  do_query(qq|ALTER TABLE defaults ADD COLUMN datev_check_on_purchase_invoice boolean DEFAULT true|, 1);
+  do_query(qq|ALTER TABLE defaults ADD COLUMN datev_check_on_ar_transaction boolean   DEFAULT true|, 1);
+  do_query(qq|ALTER TABLE defaults ADD COLUMN datev_check_on_ap_transaction boolean   DEFAULT true|, 1);
+  do_query(qq|ALTER TABLE defaults ADD COLUMN datev_check_on_gl_transaction boolean   DEFAULT true|, 1);
+
+  # check current configuration and set default variables accordingly, so that
+  # kivitendo's behaviour isn't changed by this update
+  # if checks are not set in config set it to true
+  foreach my $check (qw(check_on_sales_invoice check_on_purchase_invoice check_on_ar_transaction check_on_ap_transaction check_on_gl_transaction)) {
+    my $check_set = 1;
+    if (!$::lx_office_conf{datev_check}->{$check}) {
+      $check_set = 0;
+    }
+
+    my $update_column = "UPDATE defaults SET datev_$check = '$check_set';";
+    do_query($update_column);
+  }
+
+
+  return 1;
+}
+
+return do_update();
+
index 448c244e6f85407eedde0f9e04cb93837ceefcc7..416d66d0be3c07ada0df99a3578df9b040bb4ff7 100644 (file)
  <tr> </tr>
  <tr> </tr>
 
+ <tr class='listheading'>
+   <th colspan="3">[% 'DATEV check configuration' | $T8 %]</th>
+ </tr>
+ <tr>
+   <td colspan="3">[% 'It is possible to make a quick DATEV export everytime you post a record to ensure things work nicely with their data requirements. This will result in a slight overhead though you can enable this for each type of record independantly.' | $T8 %]</td>
+ </tr>
+ <tr>
+   <td align="right">[% 'Check on sales invoice' | $T8 %]</td>
+   <td>[% L.yes_no_tag('datev_check_on_sales_invoice', SELF.datev_check_on_sales_invoice) %]</td>
+   <td>[% 'Perform check when a sales invoice or a payment for a sales invoice is posted?' | $T8 %]</td>
+ </tr>
+ <tr>
+   <td align="right">[% 'Check on purchase invoice' | $T8 %]</td>
+   <td>[% L.yes_no_tag('datev_check_on_purchase_invoice', SELF.datev_check_on_purchase_invoice) %]</td>
+   <td>[% 'Perform check when a purchase invoice or a payment for a purchase invoice is posted?' | $T8 %]</td>
+ </tr>
+ <tr>
+   <td align="right">[% 'Check on ar transaction' | $T8 %]</td>
+   <td>[% L.yes_no_tag('datev_check_on_ar_transaction', SELF.datev_check_on_ar_transaction) %]</td>
+   <td>[% 'Perform check when an ar transaction is posted?' | $T8 %]</td>
+ </tr>
+ <tr>
+   <td align="right">[% 'Check on ap transaction' | $T8 %]</td>
+   <td>[% L.yes_no_tag('datev_check_on_ap_transaction', SELF.datev_check_on_ap_transaction) %]</td>
+   <td>[% 'Perform check when an ap transaction is posted?' | $T8 %]</td>
+ </tr>
+ <tr>
+   <td align="right">[% 'Check on gl transaction' | $T8 %]</td>
+   <td>[% L.yes_no_tag('datev_check_on_gl_transaction', SELF.datev_check_on_gl_transaction) %]</td>
+   <td>[% 'Perform check when a gl transaction is posted?' | $T8 %]</td>
+ </tr>
+
+ <tr> </tr>
+ <tr> </tr>
+
  <tr class='listheading'>
    <th colspan="3">[% 'Warehouse' | $T8 %]</th>
  </tr>