Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0e36c22a

Von Moritz Bunkus vor fast 11 Jahren hinzugefügt

  • ID 0e36c22a2610966d3c83957426d0c91b25c65da3
  • Vorgänger b1ed0099
  • Nachfolger b021f0f5

SEPA: Feld »Signaturdatum«; Bearbeiten der Felder in Stammdatenmasken; Speichern in sepa_export_items

Unterschiede anzeigen:

SL/CT.pm
308 308
  my $table        = $params{vc} eq 'customer' ? 'customer' : 'vendor';
309 309
  my @ids          = ref $params{id} eq 'ARRAY' ? @{ $params{id} } : ($params{id});
310 310
  my $placeholders = join ", ", ('?') x scalar @ids;
311
  my $query        = qq|SELECT id, name, account_number, bank, bank_code, iban, bic
311
  my $c_mandate    = $params{vc} eq 'customer' ? ', mandator_id, mandate_date_of_signature' : '';
312
  my $query        = qq|SELECT id, name, account_number, bank, bank_code, iban, bic ${c_mandate}
312 313
                        FROM ${table}
313 314
                        WHERE id IN (${placeholders})|;
314 315

  
SL/DB/MetaSetup/Customer.pm
9 9
__PACKAGE__->meta->table('customer');
10 10

  
11 11
__PACKAGE__->meta->columns(
12
  account_number      => { type => 'text' },
13
  bank                => { type => 'text' },
14
  bank_code           => { type => 'text' },
15
  bcc                 => { type => 'text' },
16
  bic                 => { type => 'varchar', length => 100 },
17
  business_id         => { type => 'integer' },
18
  c_vendor_id         => { type => 'text' },
19
  cc                  => { type => 'text' },
20
  city                => { type => 'varchar', length => 75 },
21
  contact             => { type => 'text' },
22
  country             => { type => 'varchar', length => 75 },
23
  creditlimit         => { type => 'numeric', default => '0', precision => 5, scale => 15 },
24
  currency_id         => { type => 'integer', not_null => 1 },
25
  customernumber      => { type => 'text' },
26
  delivery_term_id    => { type => 'integer' },
27
  department_1        => { type => 'varchar', length => 75 },
28
  department_2        => { type => 'varchar', length => 75 },
29
  depositor           => { type => 'text' },
30
  direct_debit        => { type => 'boolean', default => 'false' },
31
  discount            => { type => 'float', precision => 4 },
32
  email               => { type => 'text' },
33
  fax                 => { type => 'varchar', length => 30 },
34
  greeting            => { type => 'text' },
35
  homepage            => { type => 'text' },
36
  iban                => { type => 'varchar', length => 100 },
37
  id                  => { type => 'integer', not_null => 1, sequence => 'id' },
38
  itime               => { type => 'timestamp', default => 'now()' },
39
  klass               => { type => 'integer', default => '0' },
40
  language            => { type => 'varchar', length => 5 },
41
  language_id         => { type => 'integer' },
42
  mandator_id         => { type => 'text' },
43
  mtime               => { type => 'timestamp' },
44
  name                => { type => 'text', not_null => 1 },
45
  notes               => { type => 'text' },
46
  obsolete            => { type => 'boolean', default => 'false' },
47
  payment_id          => { type => 'integer' },
48
  phone               => { type => 'text' },
49
  salesman_id         => { type => 'integer' },
50
  street              => { type => 'varchar', length => 75 },
51
  taxincluded         => { type => 'boolean' },
52
  taxincluded_checked => { type => 'boolean' },
53
  taxnumber           => { type => 'text' },
54
  taxzone_id          => { type => 'integer', default => '0', not_null => 1 },
55
  terms               => { type => 'integer', default => '0' },
56
  user_password       => { type => 'text' },
57
  username            => { type => 'varchar', length => 50 },
58
  ustid               => { type => 'text' },
59
  zipcode             => { type => 'varchar', length => 10 },
12
  account_number            => { type => 'text' },
13
  bank                      => { type => 'text' },
14
  bank_code                 => { type => 'text' },
15
  bcc                       => { type => 'text' },
16
  bic                       => { type => 'varchar', length => 100 },
17
  business_id               => { type => 'integer' },
18
  c_vendor_id               => { type => 'text' },
19
  cc                        => { type => 'text' },
20
  city                      => { type => 'varchar', length => 75 },
21
  contact                   => { type => 'text' },
22
  country                   => { type => 'varchar', length => 75 },
23
  creditlimit               => { type => 'numeric', default => '0', precision => 5, scale => 15 },
24
  currency_id               => { type => 'integer', not_null => 1 },
25
  customernumber            => { type => 'text' },
26
  delivery_term_id          => { type => 'integer' },
27
  department_1              => { type => 'varchar', length => 75 },
28
  department_2              => { type => 'varchar', length => 75 },
29
  depositor                 => { type => 'text' },
30
  direct_debit              => { type => 'boolean', default => 'false' },
31
  discount                  => { type => 'float', precision => 4 },
32
  email                     => { type => 'text' },
33
  fax                       => { type => 'varchar', length => 30 },
34
  greeting                  => { type => 'text' },
35
  homepage                  => { type => 'text' },
36
  iban                      => { type => 'varchar', length => 100 },
37
  id                        => { type => 'integer', not_null => 1, sequence => 'id' },
38
  itime                     => { type => 'timestamp', default => 'now()' },
39
  klass                     => { type => 'integer', default => '0' },
40
  language                  => { type => 'varchar', length => 5 },
41
  language_id               => { type => 'integer' },
42
  mandate_date_of_signature => { type => 'date' },
43
  mandator_id               => { type => 'text' },
44
  mtime                     => { type => 'timestamp' },
45
  name                      => { type => 'text', not_null => 1 },
46
  notes                     => { type => 'text' },
47
  obsolete                  => { type => 'boolean', default => 'false' },
48
  payment_id                => { type => 'integer' },
49
  phone                     => { type => 'text' },
50
  salesman_id               => { type => 'integer' },
51
  street                    => { type => 'varchar', length => 75 },
52
  taxincluded               => { type => 'boolean' },
53
  taxincluded_checked       => { type => 'boolean' },
54
  taxnumber                 => { type => 'text' },
55
  taxzone_id                => { type => 'integer', default => '0', not_null => 1 },
56
  terms                     => { type => 'integer', default => '0' },
57
  user_password             => { type => 'text' },
58
  username                  => { type => 'varchar', length => 50 },
59
  ustid                     => { type => 'text' },
60
  zipcode                   => { type => 'varchar', length => 10 },
60 61
);
61 62

  
62 63
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
SL/DB/MetaSetup/SepaExportItem.pm
9 9
__PACKAGE__->meta->table('sepa_export_items');
10 10

  
11 11
__PACKAGE__->meta->columns(
12
  amount                   => { type => 'numeric', precision => 5, scale => 25 },
13
  ap_id                    => { type => 'integer' },
14
  ar_id                    => { type => 'integer' },
15
  chart_id                 => { type => 'integer', not_null => 1 },
16
  end_to_end_id            => { type => 'varchar', length => 35 },
17
  executed                 => { type => 'boolean', default => 'false' },
18
  execution_date           => { type => 'date' },
19
  id                       => { type => 'integer', not_null => 1, sequence => 'id' },
20
  our_bic                  => { type => 'varchar', length => 100 },
21
  our_depositor            => { type => 'text' },
22
  our_iban                 => { type => 'varchar', length => 100 },
23
  reference                => { type => 'varchar', length => 35 },
24
  requested_execution_date => { type => 'date' },
25
  sepa_export_id           => { type => 'integer', not_null => 1 },
26
  vc_bic                   => { type => 'varchar', length => 100 },
27
  vc_depositor             => { type => 'text' },
28
  vc_iban                  => { type => 'varchar', length => 100 },
12
  amount                       => { type => 'numeric', precision => 5, scale => 25 },
13
  ap_id                        => { type => 'integer' },
14
  ar_id                        => { type => 'integer' },
15
  chart_id                     => { type => 'integer', not_null => 1 },
16
  end_to_end_id                => { type => 'varchar', length => 35 },
17
  executed                     => { type => 'boolean', default => 'false' },
18
  execution_date               => { type => 'date' },
19
  id                           => { type => 'integer', not_null => 1, sequence => 'id' },
20
  our_bic                      => { type => 'varchar', length => 100 },
21
  our_depositor                => { type => 'text' },
22
  our_iban                     => { type => 'varchar', length => 100 },
23
  reference                    => { type => 'varchar', length => 35 },
24
  requested_execution_date     => { type => 'date' },
25
  sepa_export_id               => { type => 'integer', not_null => 1 },
26
  vc_bic                       => { type => 'varchar', length => 100 },
27
  vc_depositor                 => { type => 'text' },
28
  vc_iban                      => { type => 'varchar', length => 100 },
29
  vc_mandate_date_of_signature => { type => 'date' },
30
  vc_mandator_id               => { type => 'text' },
29 31
);
30 32

  
31 33
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
SL/DB/MetaSetup/Vendor.pm
36 36
  itime            => { type => 'timestamp', default => 'now()' },
37 37
  language         => { type => 'varchar', length => 5 },
38 38
  language_id      => { type => 'integer' },
39
  mandator_id      => { type => 'text' },
40 39
  mtime            => { type => 'timestamp' },
41 40
  name             => { type => 'varchar', length => 75, not_null => 1 },
42 41
  notes            => { type => 'text' },
SL/SEPA.pm
19 19
  my $arap     = $params{vc} eq 'customer' ? 'ar'       : 'ap';
20 20
  my $vc       = $params{vc} eq 'customer' ? 'customer' : 'vendor';
21 21

  
22
  my $mandate  = $params{vc} eq 'customer' ? " AND COALESCE(vc.mandator_id, '') <> '' AND vc.mandate_date_of_signature IS NOT NULL " : '';
23

  
22 24
  my $query =
23 25
    qq|
24 26
       SELECT ${arap}.id, ${arap}.invnumber, ${arap}.${vc}_id as vc_id, ${arap}.amount AS invoice_amount, ${arap}.invoice,
25 27
         vc.name AS vcname, vc.language_id, ${arap}.duedate as duedate, ${arap}.direct_debit,
26 28

  
27
         COALESCE(vc.iban, '') <> '' AND COALESCE(vc.bic, '') <> '' AS vc_bank_info_ok,
29
         COALESCE(vc.iban, '') <> '' AND COALESCE(vc.bic, '') <> '' ${mandate} AS vc_bank_info_ok,
28 30

  
29 31
         ${arap}.amount - ${arap}.paid - COALESCE(open_transfers.amount, 0) AS open_amount
30 32

  
......
76 78

  
77 79
  my $q_item_id = qq|SELECT nextval('id')|;
78 80
  my $h_item_id = prepare_query($form, $dbh, $q_item_id);
81
  my $c_mandate = $params{vc} eq 'customer' ? ', vc_mandator_id, vc_mandate_date_of_signature' : '';
82
  my $p_mandate = $params{vc} eq 'customer' ? ', ?, ?' : '';
79 83

  
80 84
  my $q_insert =
81 85
    qq|INSERT INTO sepa_export_items (id,          sepa_export_id,           ${arap}_id,  chart_id,
82 86
                                      amount,      requested_execution_date, reference,   end_to_end_id,
83
                                      our_iban,    our_bic,                  vc_iban,     vc_bic)
87
                                      our_iban,    our_bic,                  vc_iban,     vc_bic ${c_mandate})
84 88
       VALUES                        (?,           ?,                        ?,           ?,
85 89
                                      ?,           ?,                        ?,           ?,
86
                                      ?,           ?,                        ?,           ?)|;
90
                                      ?,           ?,                        ?,           ? ${p_mandate})|;
87 91
  my $h_insert = prepare_query($form, $dbh, $q_insert);
88 92

  
89 93
  my $q_reference =
......
130 134
                  $transfer->{reference},            $end_to_end_id,
131 135
                  map { my $pfx = $_; map { $transfer->{"${pfx}_${_}"} } qw(iban bic) } qw(our vc));
132 136

  
137
    push @values, $transfer->{vc_mandator_id}, conv_date($transfer->{vc_mandate_date_of_signature}) if $params{vc} eq 'customer';
138

  
133 139
    do_statement($form, $h_insert, $q_insert, @values);
134 140
  }
135 141

  
......
177 183
  if ($export->{id}) {
178 184
    my ($columns, $joins);
179 185

  
180
    my $mandator_id = $params{vc} eq 'customer' ? ', mandator_id' : '';
186
    my $mandator_id = $params{vc} eq 'customer' ? ', mandator_id, mandate_date_of_signature' : '';
181 187

  
182 188
    if ($params{details}) {
183
      $columns = qq|, arap.invnumber, arap.invoice, arap.transdate AS reference_date, vc.name AS vc_name, vc.${vc}number AS vc_number, c.accno AS chart_accno, c.description AS chart_description, ${mandator_id}|;
189
      $columns = qq|, arap.invnumber, arap.invoice, arap.transdate AS reference_date, vc.name AS vc_name, vc.${vc}number AS vc_number, c.accno AS chart_accno, c.description AS chart_description ${mandator_id}|;
184 190
      $joins   = qq|LEFT JOIN ${arap} arap ON (sei.${arap}_id = arap.id)
185 191
                    LEFT JOIN ${vc} vc     ON (arap.${vc}_id  = vc.id)
186 192
                    LEFT JOIN chart c      ON (sei.chart_id   = c.id)|;
SL/SEPA/XML.pm
224 224

  
225 225
        $xml->startTag('MndtRltdInf');
226 226
        $xml->dataElement('MndtId', $self->_restricted_identification_sepa2($transaction->get('mandator_id')));
227
        $xml->dataElement('DtOfSgntr', $transaction->get('reference_date', 2010-12-02));
227
        $xml->dataElement('DtOfSgntr', $self->_restricted_identification_sepa2($transaction->get('date_of_signature')));
228 228
        $xml->endTag('MndtRltdInf');
229 229

  
230 230
        $xml->startTag('CdtrSchmeId');
bin/mozilla/sepa.pl
110 110
  my ($vc_bank_info);
111 111
  my $error_message;
112 112

  
113
  my @bank_columns    = qw(iban bic);
114
  push @bank_columns, qw(mandator_id mandate_date_of_signature) if $vc eq 'customer';
115

  
113 116
  if ($form->{confirmation}) {
114 117
    $vc_bank_info = { map { $_->{id} => $_ } @{ $form->{vc_bank_info} || [] } };
115 118

  
116 119
    foreach my $info (values %{ $vc_bank_info }) {
117
      if (any { !$info->{$_} } qw(iban bic)) {
120
      if (any { !$info->{$_} } @bank_columns) {
118 121
        $error_message = $locale->text('The bank information must not be empty.');
119 122
        last;
120 123
      }
......
143 146

  
144 147
  } else {
145 148
    foreach my $bank_transfer (@bank_transfers) {
146
      foreach (qw(iban bic)) {
149
      foreach (@bank_columns) {
147 150
        $bank_transfer->{"vc_${_}"}  = $vc_bank_info->{ $bank_transfer->{vc_id} }->{$_};
148 151
        $bank_transfer->{"our_${_}"} = $bank_account->{$_};
149 152
      }
......
506 509
      my ($yy, $mm, $dd)      = $locale->parse_date($myconfig, $item->{reference_date});
507 510
      $item->{reference_date} = sprintf '%04d-%02d-%02d', $yy, $mm, $dd;
508 511
      $mandator_id = $item->{mandator_id};
512
      if ($item->{mandate_date_of_signature}) {
513
        ($yy, $mm, $dd)                    = $locale->parse_date($myconfig, $item->{mandate_date_of_signature});
514
        $item->{mandate_date_of_signature} = sprintf '%04d-%02d-%02d', $yy, $mm, $dd;
515
      }
509 516
    }
510 517

  
511 518
    $sepa_xml->add_transaction({ 'src_iban'       => $item->{our_iban},
......
519 526
                                 'mandator_id'    => $mandator_id,
520 527
                                 'reference_date' => $item->{reference_date},
521 528
                                 'execution_date' => $requested_execution_date,
522
                                 'end_to_end_id'  => $item->{end_to_end_id} });
529
                                 'end_to_end_id'  => $item->{end_to_end_id},
530
                                 'date_of_signature' => $item->{mandate_date_of_signature}, });
523 531
  }
524 532

  
525 533
  my $xml = $sepa_xml->to_xml();
locale/de/all
1287 1287
  'Make default profile'        => 'Zu Standardprofil machen',
1288 1288
  'Manage Custom Variables'     => 'Benutzerdefinierte Variablen',
1289 1289
  'Mandantennummer'             => 'Mandantennummer',
1290
  'Mandate Date of Signature'   => 'Mandat-Unterschriftsdatum',
1290 1291
  'Mandator ID'                 => 'Mandanten-ID',
1291 1292
  'Mandatory Departments'       => 'Benutzer muss Abteilungen vergeben',
1292 1293
  'Map'                         => 'Karte',
......
2227 2228
  'The project type has been deleted.' => 'Der Projekttyp wurde gelöscht.',
2228 2229
  'The project type has been saved.' => 'Der Projekttyp wurde gespeichert.',
2229 2230
  'The project type is in use and cannot be deleted.' => 'Der Projekttyp wird verwendet und kann nicht gelöscht werden.',
2231
  'The required information consists of the IBAN and the BIC.' => 'Die benötigten Informationen bestehen aus der IBAN und der BIC.',
2232
  'The required information consists of the IBAN, the BIC, the mandator ID and the mandate\'s date of signature.' => 'Die benötigten Informationen bestehen aus IBAN, BIC, Mandanten-ID und dem Unterschriftsdatum des Mandates.',
2230 2233
  'The second reason is that kivitendo allowed the user to enter the tax amount manually regardless of the taxkey used.' => 'Der zweite Grund war, dass kivitendo zuließ, dass die Benutzer beliebige, von den tatsächlichen Steuerschlüsseln unabhängige Steuerbeträge eintrugen.',
2231 2234
  'The second way is to use Perl\'s CPAN module and let it download and install the module for you.' => 'Die zweite Variante besteht darin, Perls CPAN-Modul zu benutzen und es das Modul f&uuml;r Sie installieren zu lassen.',
2232 2235
  'The selected bank account does not exist anymore.' => 'Das ausgewählte Bankkonto existiert nicht mehr.',
sql/Pg-upgrade2/add_customer_mandator_id.sql
1 1
-- @tag: add_customer_mandator_id
2
-- @description: Einführen einer Mandanten ID Spalte bei Kunden und Lieferanten.
2
-- @description: Einführen einer Mandanten-ID- und Signatur-Datums-Spalte bei Kunden.
3 3
-- @depends: release_3_0_0
4 4

  
5
ALTER TABLE customer ADD mandator_id text;
6
ALTER TABLE vendor   ADD mandator_id text;
5
ALTER TABLE customer          ADD COLUMN mandator_id                  text;
6
ALTER TABLE customer          ADD COLUMN mandate_date_of_signature    date;
7
ALTER TABLE sepa_export_items ADD COLUMN vc_mandator_id               text;
8
ALTER TABLE sepa_export_items ADD COLUMN vc_mandate_date_of_signature date;
9

  
10
UPDATE sepa_export_items
11
SET vc_mandator_id = (
12
  SELECT c.customernumber
13
  FROM ar
14
  LEFT JOIN customer c ON (ar.customer_id = c.id)
15
  WHERE ar.id = sepa_export_items.ar_id
16
),
17
vc_mandate_date_of_signature = '2010-01-01'::date
18
WHERE ar_id IS NOT NULL;
templates/webpages/customer_vendor/tabs/bank.html
12 12
        [% L.input_tag('cv.depositor', SELF.cv.depositor, size = 20) %]
13 13
      </td>
14 14

  
15
    [%- IF ( SELF.is_customer ) %]
15 16
      <th align="right">[% 'Mandator ID' | $T8 %]</th>
16 17
      <td>
17 18
        [% L.input_tag('cv.mandator_id', SELF.cv.mandator_id, size = 20) %]
18 19
      </td>
20

  
21
      <th align="right">[% 'Mandate Date of Signature' | $T8 %]</th>
22
      <td>
23
        [% L.date_tag('cv.mandate_date_of_signature', SELF.cv.mandate_date_of_signature) %]
24
      </td>
25
    [%- END %]
19 26
    </tr>
20 27

  
21 28
    <tr>
templates/webpages/sepa/bank_transfer_add.html
89 89
    <sup>(1)</sup>
90 90
    [%- IF is_vendor %]
91 91
     [%- 'No bank information has been entered in this vendor\'s master data entry. You cannot create bank transfers unless you enter bank information.' | $T8 %]
92
     [% "The required information consists of the IBAN and the BIC." | $T8 %]
92 93
    [%- ELSE %]
93 94
     [%- 'No bank information has been entered in this customer\'s master data entry. You cannot create bank collections unless you enter bank information.' | $T8 %]
95
     [% "The required information consists of the IBAN, the BIC, the mandator ID and the mandate's date of signature." | $T8 %]
94 96
    [%- END %]
95 97
   </p>
96 98
  [%- END %]
templates/webpages/sepa/bank_transfer_create.html
49 49
     <th class="listheading">[% 'Bank' | $T8 %]</th>
50 50
     [% IF vc == 'customer' %]
51 51
      <th class="listheading">[% 'Mandator ID' | $T8 %]</th>
52
      <th class="listheading">[% 'Mandate Date of Signature' | $T8 %]</th>
52 53
     [%- END %]
53 54
    </tr>
54 55

  
......
64 65
     <td><input name="vc_bank_info[].bank" size="30" value="[% HTML.escape(vbi.bank) %]"></td>
65 66
     [% IF vc == 'customer' %]
66 67
      <td><input name="vc_bank_info[].mandator_id" size="30" value="[% HTML.escape(vbi.mandator_id) %]"></td>
68
      <td>[% L.date_tag("vc_bank_info[].mandate_date_of_signature", vbi.mandate_date_of_signature) %]</td>
67 69
     [%- END %]
68 70
    </tr>
69 71
    [%- END %]

Auch abrufbar als: Unified diff