Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6b1f644c

Von Moritz Bunkus vor etwa 14 Jahren hinzugefügt

  • ID 6b1f644cf4630cd22a91892eac6c3a2dfb25659c
  • Vorgänger ed179657
  • Nachfolger 67ae175a

Unterscheidung Bankeinzug/Überweisung in erster Maske (Auswahl Kunden/Lieferanten)

Unterschiede anzeigen:

SL/SEPA.pm
16 16
  my $form     = $main::form;
17 17

  
18 18
  my $dbh      = $params{dbh} || $form->get_standard_dbh($myconfig);
19
  my $arap     = $params{vc} eq 'customer' ? 'ar'       : 'ap';
20
  my $vc       = $params{vc} eq 'customer' ? 'customer' : 'vendor';
19 21

  
20 22
  my $query =
21 23
    qq|
22
       SELECT ap.id, ap.invnumber, ap.vendor_id, ap.amount AS invoice_amount, ap.invoice,
23
         v.name AS vendorname, ap.duedate as duedate,
24
       SELECT ${arap}.id, ${arap}.invnumber, ${arap}.${vc}_id, ${arap}.amount AS invoice_amount, ${arap}.invoice,
25
         vc.name AS vcname, ${arap}.duedate as duedate,
24 26

  
25
         COALESCE(v.iban, '') <> '' AND COALESCE(v.bic, '') <> '' AS vendor_bank_info_ok,
27
         COALESCE(vc.iban, '') <> '' AND COALESCE(vc.bic, '') <> '' AS vc_bank_info_ok,
26 28

  
27
         ap.amount - ap.paid - COALESCE(open_transfers.amount, 0) AS open_amount
29
         ${arap}.amount - ${arap}.paid - COALESCE(open_transfers.amount, 0) AS open_amount
28 30

  
29
       FROM ap
30
       LEFT JOIN vendor v ON (ap.vendor_id = v.id)
31
       FROM ${arap}
32
       LEFT JOIN ${vc} vc ON (${arap}.${vc}_id = vc.id)
31 33
       LEFT JOIN (SELECT sei.ap_id, SUM(sei.amount) AS amount
32 34
                  FROM sepa_export_items sei
33 35
                  LEFT JOIN sepa_export se ON (sei.sepa_export_id = se.id)
34 36
                  WHERE NOT se.closed
37
                    AND (se.vc = '${vc}')
35 38
                  GROUP BY sei.ap_id)
36
         AS open_transfers ON (ap.id = open_transfers.ap_id)
39
         AS open_transfers ON (${arap}.id = open_transfers.ap_id)
37 40

  
38
       WHERE ap.amount > (COALESCE(open_transfers.amount, 0) + ap.paid)
41
       WHERE ${arap}.amount > (COALESCE(open_transfers.amount, 0) + ${arap}.paid)
39 42

  
40
       ORDER BY lower(v.name) ASC, lower(ap.invnumber) ASC
43
       ORDER BY lower(vc.name) ASC, lower(${arap}.invnumber) ASC
41 44
|;
42 45

  
43 46
  my $results = selectall_hashref_query($form, $dbh, $query);
bin/mozilla/sepa.pl
20 20

  
21 21
  my $form          = $main::form;
22 22
  my $locale        = $main::locale;
23
  my $vc            = $form->{vc} eq 'customer' ? 'customer' : 'vendor';
23 24

  
24
  $form->{title}    = $locale->text('Prepare bank transfer via SEPA XML');
25
  $form->{title}    = $vc eq 'customer' ? $::locale->text('Prepare bank collection via SEPA XML') : $locale->text('Prepare bank transfer via SEPA XML');
25 26

  
26 27
  my $bank_accounts = SL::BankAccount->list();
27 28

  
......
29 30
    $form->error($locale->text('You have not added bank accounts yet.'));
30 31
  }
31 32

  
32
  my $invoices = SL::SEPA->retrieve_open_invoices();
33
  my $invoices = SL::SEPA->retrieve_open_invoices(vc => $vc);
33 34

  
34 35
  if (!scalar @{ $invoices }) {
35 36
    $form->show_generic_information($locale->text('Either there are no open invoices, or you have already initiated bank transfers ' .
......
44 45
  print $form->parse_html_template('sepa/bank_transfer_add',
45 46
                                   { 'INVOICES'           => $invoices,
46 47
                                     'BANK_ACCOUNTS'      => $bank_accounts,
47
                                     'bank_account_label' => $bank_account_label_sub, });
48
                                     'bank_account_label' => $bank_account_label_sub,
49
                                     'vc'                 => $vc,
50
                                   });
48 51

  
49 52
  $main::lxdebug->leave_sub();
50 53
}
locale/de/all
197 197
  'Are you sure you want to update the prices' => 'Sind Sie sicher, dass Sie die Preise aktualisieren wollen?',
198 198
  'Article Code'                => 'Artikelk?rzel',
199 199
  'Article Code missing!'       => 'Artikelk?rzel fehlt',
200
  'Artikel'                     => '',
200 201
  'As a result, the saved onhand values of the present goods can be stored into a warehouse designated by you, or will be reset for a proper warehouse tracking' => 'Als Konsequenz k&ouml;nnen die gespeicherten Mengen entweder in ein Lager &uuml;berf&uuml;hrt werden, oder f&uuml;r eine frische Lagerverwaltung resettet werden.',
201 202
  'Assemblies'                  => 'Erzeugnisse',
202 203
  'Assembly Description'        => 'Erzeugnis-Beschreibung',
......
242 243
  'Bank Connections'            => 'Bankverbindungen',
243 244
  'Bank accounts'               => 'Bankkonten',
244 245
  'Bank code'                   => 'Bankleitzahl',
246
  'Bank collection via SEPA'    => 'Bankeinzug via SEPA',
247
  'Bank collections via SEPA'   => 'Bankeinz?ge via SEPA',
245 248
  'Bank transfer amount'        => '?berweisungssumme',
246 249
  'Bank transfer payment list for export #1' => '?berweisungszahlungsliste f?r SEPA-Export #1',
247 250
  'Bank transfer via SEPA'      => '?berweisung via SEPA',
......
595 598
  'EAN-Code'                    => 'EAN-Code',
596 599
  'EB-Wert'                     => 'EB-Wert',
597 600
  'EK'                          => 'EK',
598
  'EK-Preis'                    => 'Purchase price',
599 601
  'ELSE'                        => 'Zusatz',
600 602
  'ELSTER Export (Taxbird)'     => 'ELSTER-Export nach Taxbird',
601 603
  'ELSTER Export (Winston)'     => 'ELSTER Export nach Winston',
......
1061 1063
  'No Vendor was found matching the search parameters.' => 'Zu dem Suchbegriff wurde kein H?ndler gefunden',
1062 1064
  'No action defined.'          => 'Keine Aktion definiert.',
1063 1065
  'No backup file has been uploaded.' => 'Es wurde keine Sicherungsdatei hochgeladen.',
1066
  'No bank information has been entered in this customer\'s master data entry. You cannot create bank collections unless you enter bank information.' => 'F?r diesen Kunden wurden in seinen Stammdaten keine Kontodaten hinterlegt. Solange dies nicht geschehen ist, k?nnen Sie keine ?berweisungen f?r den Lieferanten anlegen.',
1064 1067
  'No bank information has been entered in this vendor\'s master data entry. You cannot create bank transfers unless you enter bank information.' => 'F?r diesen Lieferanten wurden in seinen Stammdaten keine Kontodaten hinterlegt. Solange dies nicht geschehen ist, k?nnen Sie keine ?berweisungen f?r den Lieferanten anlegen.',
1065 1068
  'No bins have been added to this warehouse yet.' => 'Es wurden zu diesem Lager noch keine Lagerpl&auml;tze angelegt.',
1066 1069
  'No customer has been selected yet.' => 'Es wurde noch kein Kunde ausgew?hlt.',
......
1219 1222
  'Please select a vendor from the list below.' => 'Bitte einen H?ndler aus der Liste ausw?hlen',
1220 1223
  'Please select the chart of accounts this installation is using from the list below.' => 'Bitte w&auml;hlen Sie den Kontenrahmen aus, der bei dieser Installation verwendet wird.',
1221 1224
  'Please select the database you want to backup' => 'Bitte w&auml;hlen Sie die zu sichernde Datenbank gefunden',
1225
  'Please select the destination bank account for the collections:' => 'Bitte w?hlen Sie das Bankkonto als Ziel f?r die Einz?ge aus:',
1222 1226
  'Please select the source bank account for the transfers:' => 'Bitte w?hlen Sie das Bankkonto als Quelle f?r die ?berweisungen aus:',
1223 1227
  'Please seletct the dataset you want to delete:' => 'Bitte w&auml;hlen Sie die zu l&ouml;schende Datenbank aus:',
1224 1228
  'Please specify a description for the warehouse designated for these goods.' => 'Bitte geben Sie den Namen des Ziellagers f&uuml;r die &uuml;bernommenen Daten ein.',
......
1236 1240
  'Preis'                       => 'Preis',
1237 1241
  'Preisgruppe'                 => 'Preisgruppe',
1238 1242
  'Preisklasse'                 => 'Preisgruppe',
1243
  'Prepare bank collection via SEPA XML' => 'Einzug via SEPA XML vorbereiten',
1239 1244
  'Prepare bank transfer via SEPA XML' => '?berweisung via SEPA XML vorbereiten',
1240 1245
  'Prepayment'                  => 'Vorauszahlung',
1241 1246
  'Preview'                     => 'Druckvorschau',
menu.ini
345 345
module=rc.pl
346 346
action=reconciliation
347 347

  
348
[Cash--Bank collection via SEPA]
349
module=sepa.pl
350
action=bank_transfer_add
351
vc=customer
352

  
348 353
[Cash--Bank transfer via SEPA]
349 354
module=sepa.pl
350 355
action=bank_transfer_add
356
vc=vendor
351 357

  
352 358
[Cash--Reports]
353 359
module=menu.pl
......
365 371
action=report
366 372
report=payments
367 373

  
374
[Cash--Reports--Bank collections via SEPA]
375
module=sepa.pl
376
action=bank_transfer_search
377
vc=customer
378

  
368 379
[Cash--Reports--Bank transfers via SEPA]
369 380
module=sepa.pl
370 381
action=bank_transfer_search
382
vc=vendor
371 383

  
372 384
[Reports]
373 385

  
templates/webpages/sepa/bank_transfer_add.html
1 1
[%- USE T8 %]
2 2
[% USE HTML %][% USE LxERP %]
3
[% IF vc == 'vendor' %]
4
 [% SET is_vendor = 1 %]
5
 [% SET arap = 'ap' %]
6
 [% SET iris = 'ir' %]
7
[% ELSE %]
8
 [% SET is_vendor = 0 %]
9
 [% SET arap = 'ar' %]
10
 [% SET iris = 'is' %]
11
[%- END %]
3 12
<body>
4 13

  
5 14
 <p><div class="listtop">[% title %]</div></p>
6 15

  
7 16
 <form action="sepa.pl" method="post">
8 17
  <p>
9
   [% 'Please select the source bank account for the transfers:' | $T8 %]
18
   [%- IF is_vendor %]
19
    [% 'Please select the source bank account for the transfers:' | $T8 %]
20
   [%- ELSE %]
21
    [% 'Please select the destination bank account for the collections:' | $T8 %]
22
   [%- END %]
10 23
   <br>
11 24
   [%- INCLUDE generic/multibox.html
12 25
         name      = 'bank_account.id',
......
20 33
   <table border="0">
21 34
    <tr>
22 35
     <th class="listheading" align="center"><input type="checkbox" id="select_all"></th>
23
     <th class="listheading">[% 'Vendor' | $T8 %]</th>
36
     <th class="listheading">[% IF is_vendor %][% 'Vendor' | $T8 %][%- ELSE %][%- LxERP.t8('Customer') %][%- END %]</th>
24 37
     <th class="listheading">[% 'Invoice' | $T8 %]</th>
25 38
     <th class="listheading" align="right">[% 'Amount' | $T8 %]</th>
26 39
     <th class="listheading" align="right">[% 'Open amount' | $T8 %]</th>
......
30 43
    </tr>
31 44

  
32 45
    [%- FOREACH invoice = INVOICES %]
33
     <input type="hidden" name="bank_transfers[+].ap_id" value="[% HTML.escape(invoice.id) %]">
46
     <input type="hidden" name="bank_transfers[+].[% arap %]_id" value="[% HTML.escape(invoice.id) %]">
34 47

  
35 48
     <tr class="listrow[% loop.count % 2 %]">
36 49
      <td align="center">
37
       [%- IF invoice.vendor_bank_info_ok %]
50
       [%- IF invoice.vc_bank_info_ok %]
38 51
        <input type="checkbox" name="bank_transfers[].selected" value="1">
39 52
       [%- END %]
40 53
      </td>
41 54
      <td>
42
       [%- IF loop.first || (previous_vendorname != invoice.vendorname) %]
43
        <a href="ct.pl?action=edit&db=vendor&id=[% HTML.url(invoice.vendor_id) %]&callback=[% HTML.url('sepa.pl?action=bank_transfer_add') %]">
44
         [%- GET HTML.escape(invoice.vendorname);
45
             SET previous_vendorname = invoice.vendorname;
46
             IF !invoice.vendor_bank_info_ok;
55
       [%- IF loop.first || (previous_vcname != invoice.vcname) %]
56
        <a href="ct.pl?action=edit&db=[% vc %]&id=[% HTML.url(invoice.vc_id) %]&callback=[% HTML.url('sepa.pl?action=bank_transfer_add&vc=' _ vc) %]">
57
         [%- GET HTML.escape(invoice.vcname);
58
             SET previous_vcname = invoice.vcname;
59
             IF !invoice.vc_bank_info_ok;
47 60
               GET ' <sup>(1)</sup>';
48
               SET show_vendor_bank_info_footnote = '1';
61
               SET show_vc_bank_info_footnote = '1';
49 62
             END; -%]
50 63
        </a>
51 64
       [%- END -%]
52 65
      </td>
53 66

  
54 67
      <td>
55
       <a href="[% IF invoice.invoice %]ir[% ELSE %]ap[% END %].pl?action=edit&id=[% HTML.escape(invoice.id) %]">
68
       <a href="[% IF invoice.invoice %][% iris %][% ELSE %][% arap %][% END %].pl?action=edit&id=[% HTML.escape(invoice.id) %]">
56 69
        [% HTML.escape(invoice.invnumber) %]
57 70
       </a>
58 71
      </td>
......
69 82
   </table>
70 83
  </p>
71 84

  
72
  [%- IF show_vendor_bank_info_footnote %]
85
  [%- IF show_vc_bank_info_footnote %]
73 86
   <p>
74
    <sup>(1)</sup> [%- 'No bank information has been entered in this vendor\'s master data entry. You cannot create bank transfers unless you enter bank information.' | $T8 %]
87
    <sup>(1)</sup>
88
    [%- IF is_vendor %]
89
     [%- 'No bank information has been entered in this vendor\'s master data entry. You cannot create bank transfers unless you enter bank information.' | $T8 %]
90
    [%- ELSE %]
91
     [%- 'No bank information has been entered in this customer\'s master data entry. You cannot create bank collections unless you enter bank information.' | $T8 %]
92
    [%- END %]
75 93
   </p>
76 94
  [%- END %]
77 95

  
......
80 98
  </p>
81 99

  
82 100
  <input type="hidden" name="action" value="dispatcher">
101
  <input type="hidden" name="vc" value="[%- HTML.escape(vc) %]">
83 102
 </form>
84 103

  
85 104
 <script type="text/javascript" src="js/jquery.js"></script>

Auch abrufbar als: Unified diff