]> wagnertech.de Git - kivitendo-erp.git/commitdiff
BankTransaction: Spaltennamen von CamelCase in snake_case umbenannt
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 16 Dec 2016 08:31:22 +0000 (09:31 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 16 Dec 2016 08:54:59 +0000 (09:54 +0100)
kivitendo nutzt rein lower-case-Spaltennamen mit Unterstrichen als
Worttrenner, kein CamelCase. Betrifft Spalten transactioncode und
transactiontext in bank_transfers.

SL/Controller/BankTransaction.pm
SL/DB/Helper/Payment.pm
SL/DB/MetaSetup/BankTransaction.pm
sql/Pg-upgrade2/bank_transactions_type.sql
sql/Pg-upgrade2/bank_transactions_type2.sql [new file with mode: 0644]
templates/webpages/bank_transactions/tabs/all.html
templates/webpages/bank_transactions/tabs/automatic.html

index 041e4ef79524954093beb668b7d68afe159ad230..fec37560e01b70dd02053b40be68cd2b4fc0fd95 100644 (file)
@@ -160,7 +160,7 @@ sub action_list {
     if ( $self->is_collective_transaction($bt) ) {
       foreach ( keys  %sepa_exports) {
         #$main::lxdebug->message(LXDebug->DEBUG2(),"Exp ID=".$_." compare sum amount ".($sepa_exports{$_}->{amount} *1) ." == ".($bt->amount * 1));
     if ( $self->is_collective_transaction($bt) ) {
       foreach ( keys  %sepa_exports) {
         #$main::lxdebug->message(LXDebug->DEBUG2(),"Exp ID=".$_." compare sum amount ".($sepa_exports{$_}->{amount} *1) ." == ".($bt->amount * 1));
-        if ( $bt->transactioncode eq '191' && abs(($sepa_exports{$_}->{amount} * 1) - ($bt->amount * 1)) < 0.01 ) {
+        if ( $bt->transaction_code eq '191' && abs(($sepa_exports{$_}->{amount} * 1) - ($bt->amount * 1)) < 0.01 ) {
           ## jupp
           $bt->{proposals} = $sepa_exports{$_}->{invoices} ;
           $bt->{agreement}    = 20;
           ## jupp
           $bt->{proposals} = $sepa_exports{$_}->{invoices} ;
           $bt->{agreement}    = 20;
@@ -540,7 +540,7 @@ sub action_save_proposals {
 
 sub is_collective_transaction {
   my ($self, $bt) = @_;
 
 sub is_collective_transaction {
   my ($self, $bt) = @_;
-  return $bt->transactioncode eq "191";
+  return $bt->transaction_code eq "191";
 }
 
 sub save_single_bank_transaction {
 }
 
 sub save_single_bank_transaction {
index 9ff921617cdaea35531a6296a761115b3b435dfa..4403b0238ba9f9e0399f56e4d17ba22b3c598448 100644 (file)
@@ -640,7 +640,7 @@ sub get_payment_select_options_for_bank_transaction {
   if ( $open_amount &&                   # invoice amount not 0
        $self->skonto_date &&             # check whether skonto applies
        ( abs(abs($self->amount_less_skonto) - abs($bt->amount)) < 0.01 ||
   if ( $open_amount &&                   # invoice amount not 0
        $self->skonto_date &&             # check whether skonto applies
        ( abs(abs($self->amount_less_skonto) - abs($bt->amount)) < 0.01 ||
-        ( $bt->transactioncode eq "191" && abs($self->amount_less_skonto) < abs($bt->amount) )) &&
+        ( $bt->transaction_code eq "191" && abs($self->amount_less_skonto) < abs($bt->amount) )) &&
        $self->check_skonto_configuration) {
          if ( $self->within_skonto_period($bt->transdate) ) {
            push(@options, { payment_type => 'without_skonto', display => t8('without skonto') });
        $self->check_skonto_configuration) {
          if ( $self->within_skonto_period($bt->transdate) ) {
            push(@options, { payment_type => 'without_skonto', display => t8('without skonto') });
index 77a24c94e44bcdba076bce625488670523f0974e..70c4132dfb1ba37e335784db442511cf47ccdc85 100644 (file)
@@ -20,9 +20,9 @@ __PACKAGE__->meta->columns(
   remote_account_number => { type => 'text' },
   remote_bank_code      => { type => 'text' },
   remote_name           => { type => 'text' },
   remote_account_number => { type => 'text' },
   remote_bank_code      => { type => 'text' },
   remote_name           => { type => 'text' },
+  transaction_code      => { type => 'text' },
   transaction_id        => { type => 'integer' },
   transaction_id        => { type => 'integer' },
-  transactioncode       => { type => 'text' },
-  transactiontext       => { type => 'text' },
+  transaction_text      => { type => 'text' },
   transdate             => { type => 'date', not_null => 1 },
   valutadate            => { type => 'date', not_null => 1 },
 );
   transdate             => { type => 'date', not_null => 1 },
   valutadate            => { type => 'date', not_null => 1 },
 );
index 9a3da5389593368178e2c803d6e2a8dc665aa7be..246765626e66d7b3ac7b51ef7aec7cde79a89573 100644 (file)
@@ -2,5 +2,5 @@
 -- @description: Erweitern der Tabelle bank_transactions mit Typ der Transaktion.
 -- @depends: bank_transactions
 
 -- @description: Erweitern der Tabelle bank_transactions mit Typ der Transaktion.
 -- @depends: bank_transactions
 
-ALTER TABLE bank_transactions ADD COLUMN transactionCode TEXT;
-ALTER TABLE bank_transactions ADD COLUMN transactionText TEXT;
+ALTER TABLE bank_transactions ADD COLUMN transactioncode TEXT;
+ALTER TABLE bank_transactions ADD COLUMN transactiontext TEXT;
diff --git a/sql/Pg-upgrade2/bank_transactions_type2.sql b/sql/Pg-upgrade2/bank_transactions_type2.sql
new file mode 100644 (file)
index 0000000..05aa106
--- /dev/null
@@ -0,0 +1,6 @@
+-- @tag: bank_transactions_type2
+-- @description: Spalten für Transaktions-Code und -Typen etwas besser benennen
+-- @depends: bank_transactions_type
+
+ALTER TABLE bank_transactions RENAME transactioncode TO transaction_code;
+ALTER TABLE bank_transactions RENAME transactiontext TO transaction_text;
index 1a36040b8801ae449854b932171cb607d34fdcef..8b7efdfd635b5052779c881ea04106c8a747be7d 100644 (file)
      <td align=right>[% LxERP.format_amount(bt.invoice_amount, 2) %]</td>
      <td>[% HTML.escape(bt.remote_name) %]</td>
      <td>[% HTML.escape(bt.purpose) %]</td>
      <td align=right>[% LxERP.format_amount(bt.invoice_amount, 2) %]</td>
      <td>[% HTML.escape(bt.remote_name) %]</td>
      <td>[% HTML.escape(bt.purpose) %]</td>
-     <td>[% HTML.escape(bt.transactiontext) %]</td>
+     <td>[% HTML.escape(bt.transaction_text) %]</td>
      <td>[% HTML.escape(bt.remote_account_number) %]</td>
      <td>[% HTML.escape(bt.remote_bank_code) %]</td>
      <td align=right>[% bt.valutadate_as_date %]</td>
      <td>[% HTML.escape(bt.remote_account_number) %]</td>
      <td>[% HTML.escape(bt.remote_bank_code) %]</td>
      <td align=right>[% bt.valutadate_as_date %]</td>
index 38b3b3ff7e5b519a307b7631d9a7b5b1d7a6dcc9..63f6d16e108dfd603809960ebeb1d59ae604933f 100644 (file)
@@ -33,7 +33,7 @@
             [% L.checkbox_tag('proposal_ids[]', checked=0, value=proposal.id) %]
           </td>
 
             [% L.checkbox_tag('proposal_ids[]', checked=0, value=proposal.id) %]
           </td>
 
-          <td>[% HTML.escape(proposal.transactiontext) %]</td>
+          <td>[% HTML.escape(proposal.transaction_text) %]</td>
           <td>[% proposal.id %]</td>
           <td>[% proposal.transdate_as_date %]</td>
           <td align="right">[% LxERP.format_amount(proposal.amount,2) %]</td>
           <td>[% proposal.id %]</td>
           <td>[% proposal.transdate_as_date %]</td>
           <td align="right">[% LxERP.format_amount(proposal.amount,2) %]</td>