Revision f3a5bf8a
Von Martin Helmling vor fast 8 Jahren hinzugefügt
bin/mozilla/sepa.pl | ||
---|---|---|
54 | 54 |
my $translation_list = GenericTranslations->list(translation_type => 'sepa_remittance_info_pfx'); |
55 | 55 |
my %translations = map { ( ($_->{language_id} || 'default') => $_->{translation} ) } @{ $translation_list }; |
56 | 56 |
my $current_date = DateTime->today_local; |
57 |
|
|
57 |
my %sorted_invoices; |
|
58 |
my $sec = 0; |
|
59 |
|
|
58 | 60 |
foreach my $invoice (@{ $invoices }) { |
59 | 61 |
my $prefix = $translations{ $invoice->{language_id} } || $translations{default} || $::locale->text('Invoice'); |
60 | 62 |
$prefix .= ' ' unless $prefix =~ m/ $/; |
... | ... | |
66 | 68 |
my $prefix_vc_number = $translations{ $invoice->{language_id} } || $translations{default} || $vc_no; |
67 | 69 |
$prefix_vc_number .= ' ' unless $prefix_vc_number =~ m/ $/; |
68 | 70 |
$invoice->{reference_prefix_vc} = ' ' . $prefix_vc_number unless $prefix_vc_number =~ m/^ /; |
69 |
} |
|
70 | 71 |
|
72 |
my $vc_prefix = $invoice->{vc_number} eq '' ? '' |
|
73 |
: $vc eq 'customer' ? $translations{ $invoice->{language_id} } || $translations{default} || ' ' . $::locale->text('Ven.nr.') . ' ' |
|
74 |
: $translations{ $invoice->{language_id} } || $translations{default} || ' ' . $::locale->text('Cust.nr.') . ' '; |
|
75 |
$invoice->{vc_prefix} = $vc_prefix; |
|
76 |
|
|
77 |
# Check due date for SEPA bank collections. |
|
78 |
if ((DateTime->from_kivitendo($invoice->{duedate}) < $current_date) && ($vc eq 'customer')) { |
|
79 |
$invoice->{vc_bank_info_ok} = '2' if $invoice->{vc_bank_info_ok}; |
|
80 |
} |
|
81 |
$invoice->{duedate} = $invoice->{transdate} if !$invoice->{duedate}; |
|
82 |
$invoice->{is_before_today} = 0; |
|
83 |
if ( $invoice->{within_skonto_period} ) { |
|
84 |
$invoice->{is_before_today} = 1 if DateTime->from_kivitendo($invoice->{skonto_date}) <= $current_date; |
|
85 |
$sorted_invoices{DateTime->from_kivitendo($invoice->{skonto_date})->add_duration(DateTime::Duration->new(seconds => $sec))} = $invoice; |
|
86 |
} else { |
|
87 |
$invoice->{is_before_today} = 1 if DateTime->from_kivitendo($invoice->{duedate}) <= $current_date; |
|
88 |
$sorted_invoices{DateTime->from_kivitendo($invoice->{duedate})->add_duration(DateTime::Duration->new(seconds => $sec))} = $invoice; |
|
89 |
} |
|
90 |
$sec++; |
|
91 |
} |
|
92 |
my $newinvoices; |
|
93 |
@{ $newinvoices } = map { $sorted_invoices{$_} } sort keys %sorted_invoices; |
|
71 | 94 |
$::request->layout->use_javascript('js/kivi.Sepa.js'); |
72 | 95 |
|
73 | 96 |
$form->header(); |
74 | 97 |
print $form->parse_html_template('sepa/bank_transfer_add', |
75 |
{ 'INVOICES' => $invoices, |
|
98 |
{ 'INVOICES' => $newinvoices,
|
|
76 | 99 |
'BANK_ACCOUNTS' => $bank_accounts, |
77 | 100 |
'vc' => $vc, |
78 | 101 |
'show_empty' => $show_empty, |
js/kivi.Sepa.js | ||
---|---|---|
1 | 1 |
namespace('kivi.Sepa', function(ns) { |
2 |
this.paymentTypeChanged = function() {
|
|
2 |
ns.paymentTypeChanged = function() {
|
|
3 | 3 |
var type_id = $(this).attr('id'); |
4 | 4 |
var id = type_id.match(/\d*$/); |
5 | 5 |
|
... | ... | |
13 | 13 |
|
14 | 14 |
else if ( $(this).val() == "with_skonto_pt" ) |
15 | 15 |
$('#' + id).val( $('#amount_less_skonto_' + id).val() ); |
16 |
kivi.Sepa.updateSumAmount(); |
|
16 | 17 |
}; |
17 | 18 |
|
18 |
this.verifyBankAccountSelected = function() {
|
|
19 |
ns.verifyBankAccountSelected = function() {
|
|
19 | 20 |
if ($('#bank_account').val()) |
20 | 21 |
return true; |
21 | 22 |
|
... | ... | |
23 | 24 |
return false; |
24 | 25 |
}; |
25 | 26 |
|
26 |
this.initBankTransferAdd = function(vc) { |
|
27 |
ns.selectRow = function(elem) { |
|
28 |
if ( elem.target.localName != 'td' ) |
|
29 |
return true; |
|
30 |
if ($(this).find('INPUT[name="bank_transfers[].selected"]').prop('checked')) |
|
31 |
$(this).find('INPUT[name="bank_transfers[].selected"]').prop('checked', false); |
|
32 |
else |
|
33 |
$(this).find('INPUT[name="bank_transfers[].selected"]').prop('checked', true); |
|
34 |
kivi.Sepa.updateSumAmount(); |
|
35 |
return false; |
|
36 |
}; |
|
37 |
|
|
38 |
ns.updateSumAmount = function() { |
|
39 |
var sum_amount=0; |
|
40 |
$('INPUT[name="bank_transfers[].selected"]:checked').each(function(idx,elem) |
|
41 |
{ |
|
42 |
var $trans = $(elem).closest('tr').find('INPUT[name="bank_transfers[].amount"]'); |
|
43 |
sum_amount += kivi.parse_amount($trans.val()); |
|
44 |
}); |
|
45 |
$('#sepa_sum_amount').text(kivi.format_amount(sum_amount,2)); |
|
46 |
return false; |
|
47 |
}; |
|
48 |
|
|
49 |
ns.initBankTransferAdd = function(vc) { |
|
27 | 50 |
$("#select_all").checkall('INPUT[name="bank_transfers[].selected"]'); |
51 |
$("#select_all").change(kivi.Sepa.updateSumAmount); |
|
52 |
$('INPUT[name="bank_transfers[].selected"]').change(kivi.Sepa.updateSumAmount); |
|
53 |
$('INPUT[name="bank_transfers[].amount"]').change(kivi.Sepa.updateSumAmount); |
|
28 | 54 |
$(".type_target").change(kivi.Sepa.paymentTypeChanged); |
55 |
$('.invoice_row').click(kivi.Sepa.selectRow); |
|
29 | 56 |
$('[type=submit]').click(kivi.Sepa.verifyBankAccountSelected); |
30 | 57 |
}; |
31 | 58 |
}); |
locale/de/all | ||
---|---|---|
390 | 390 |
'Bank transfer amount' => 'Überweisungssumme', |
391 | 391 |
'Bank transfer payment list for export #1' => 'Überweisungszahlungsliste für SEPA-Export #1', |
392 | 392 |
'Bank transfer via SEPA' => 'Überweisung via SEPA', |
393 |
'Bank transfer<br>amount' => 'Überweisungs-<br>betrag',
|
|
393 |
'Bank transfer<br>amount' => 'Zahlungs-<br>betrag',
|
|
394 | 394 |
'Bank transfers via SEPA' => 'Überweisungen via SEPA', |
395 | 395 |
'Base unit' => 'Basiseinheit', |
396 | 396 |
'Basic Data' => 'Basisdaten', |
... | ... | |
946 | 946 |
'Description of #1' => 'Beschreibung von #1', |
947 | 947 |
'Destination BIC' => 'Ziel-BIC', |
948 | 948 |
'Destination IBAN' => 'Ziel-IBAN', |
949 |
'Destination bank account for the collections:' => 'Bankkonto als Ziel für Einzüge:', |
|
949 | 950 |
'Destination bin' => 'Ziellagerplatz', |
950 | 951 |
'Destination warehouse' => 'Ziellager', |
951 | 952 |
'Destination warehouse and bin' => 'Ziellager und -lagerplatz', |
... | ... | |
2706 | 2707 |
'Source BIC' => 'Quell-BIC', |
2707 | 2708 |
'Source IBAN' => 'Quell-IBAN', |
2708 | 2709 |
'Source bank account' => 'Quellkonto', |
2710 |
'Source bank account for the transfers:' => 'Bankkonto als Quelle für Überweisungen:', |
|
2709 | 2711 |
'Source bin' => 'Quelllagerplatz', |
2710 | 2712 |
'Space' => 'Leerzeichen', |
2711 | 2713 |
'Split entry detected. The values you have entered will result in an entry with more than one position on both debit and credit. Due to known problems involving accounting software kivitendo does not allow these.' => 'Splitbuchung! Die eingebenen Werte würden eine Buchung auslösen, die jeweils mehr als eine Position auf Soll und Haben hätte. Um Kompatibilität mit DATEV zu gewährleisten erlaubt kivitendo keine Splitbuchungen.', |
... | ... | |
3586 | 3588 |
'You do not have permission to access this entry.' => 'Sie verfügen nicht über die Berechtigung, auf diesen Eintrag zuzugreifen.', |
3587 | 3589 |
'You do not have the permissions to access this function.' => 'Sie verfügen nicht über die notwendigen Rechte, um auf diese Funktion zuzugreifen.', |
3588 | 3590 |
'You don\'t have the rights to edit this customer.' => 'Sie verfügen nicht über die erforderlichen Rechte, um diesen Kunden zu bearbeiten.', |
3591 |
'You have changed the currency. Please check and corrrect prices if necessary.' => 'Sie haben die Währung gewechselt. Bitte prüfen und korrigieren Sie gegebenenfalls die Preise', |
|
3589 | 3592 |
'You have entered or selected the following shipping address for this customer:' => 'Sie haben die folgende Lieferadresse eingegeben oder ausgewählt:', |
3590 | 3593 |
'You have never worked with currencies.' => 'Sie haben noch nie mit Währungen gearbeitet.', |
3591 | 3594 |
'You have not added bank accounts yet.' => 'Sie haben noch keine Bankkonten angelegt.', |
templates/webpages/sepa/bank_transfer_add.html | ||
---|---|---|
14 | 14 |
<p><div class="listtop">[% title %]</div></p> |
15 | 15 |
|
16 | 16 |
<form action="sepa.pl" method="post"> |
17 |
<p> |
|
17 |
<table border="0"> |
|
18 |
<tr> |
|
19 |
<th style='text-align:left;'> |
|
18 | 20 |
[%- IF is_vendor %] |
19 |
[% 'Please select the source bank account for the transfers:' | $T8 %]
|
|
21 |
[% 'Source bank account for the transfers:' | $T8 %]
|
|
20 | 22 |
[%- ELSE %] |
21 |
[% 'Please select the destination bank account for the collections:' | $T8 %]
|
|
23 |
[% 'Destination bank account for the collections:' | $T8 %]
|
|
22 | 24 |
[%- END %] |
23 |
<br>
|
|
24 |
[% L.select_tag('bank_account', |
|
25 |
</th><th style='width:800px; text-align:left;'>
|
|
26 |
[% L.select_tag('bank_account',
|
|
25 | 27 |
BANK_ACCOUNTS, |
26 | 28 |
title_key='displayable_name', |
27 | 29 |
with_empty=show_empty, |
28 | 30 |
style='width:450px', |
29 | 31 |
) %] |
30 |
</p> |
|
31 |
|
|
32 |
<p> |
|
32 |
</th> |
|
33 |
<th> |
|
34 |
[%- IF is_vendor %][% 'Bank transfer amount' | $T8 %][%- ELSE %][%- |
|
35 |
LxERP.t8('Bank collection amount') %][%- END %]: |
|
36 |
</th> |
|
37 |
<td><span id="sepa_sum_amount">0</span> € </td> |
|
38 |
</tr> |
|
39 |
</table> |
|
33 | 40 |
<table border="0"> |
34 | 41 |
<tr> |
35 | 42 |
<th class="listheading" align="center"><input type="checkbox" id="select_all"></th> |
... | ... | |
47 | 54 |
</tr> |
48 | 55 |
|
49 | 56 |
[%- FOREACH invoice = INVOICES %] |
50 |
<input type="hidden" name="bank_transfers[+].[% arap %]_id" value="[% HTML.escape(invoice.id) %]"> |
|
51 |
<input type="hidden" id="amount_less_skonto_[% loop.count %]" name="amount_less_skonto_[% loop.count %]" value="[% LxERP.format_amount(invoice.amount_less_skonto, 2) %]"> |
|
52 |
<input type="hidden" id="invoice_open_amount_[% loop.count %]" name="invoice_open_amount_[% loop.count %]" value="[% LxERP.format_amount(invoice.open_amount - invoice.open_sepa_transfer_amount, 2) %]"> |
|
53 |
<input type="hidden" id="skonto_amount_[% loop.count %]" name="skonto_amount_[% loop.count %]" value="[% LxERP.format_amount(invoice.skonto_amount, 2) %]"> |
|
57 |
<tr class="[%- IF invoice.is_before_today %]listrow_highlight[%- ELSE %]listrow[%- END %][% loop.count % 2 %] invoice_row"> |
|
58 |
<td align="center"> |
|
59 |
|
|
60 |
<input type="hidden" name="bank_transfers[+].[% arap %]_id" value="[% HTML.escape(invoice.id) %]"> |
|
61 |
<input type="hidden" id="amount_less_skonto_[% loop.count %]" name="amount_less_skonto_[% loop.count %]" value="[% LxERP.format_amount(invoice.amount_less_skonto, 2) %]"> |
|
62 |
<input type="hidden" id="invoice_open_amount_[% loop.count %]" name="invoice_open_amount_[% loop.count %]" value="[% LxERP.format_amount(invoice.open_amount - invoice.open_sepa_transfer_amount, 2) %]"> |
|
63 |
<input type="hidden" id="skonto_amount_[% loop.count %]" name="skonto_amount_[% loop.count %]" value="[% LxERP.format_amount(invoice.skonto_amount, 2) %]"> |
|
54 | 64 |
|
55 | 65 |
|
56 |
<tr class="listrow[% loop.count % 2 %]"> |
|
57 |
<td align="center"> |
|
58 | 66 |
[%- IF invoice.vc_bank_info_ok && (invoice.vc_bank_info_ok != '2') %] |
59 | 67 |
<input type="checkbox" name="bank_transfers[].selected" value="1"[% IF invoice.checked %] checked[% END %]> |
60 | 68 |
[%- END %] |
61 | 69 |
</td> |
62 |
<td align="right">[% invoice.duedate %]</td>
|
|
70 |
<td align="right">[%- IF invoice.within_skonto_period %][% invoice.skonto_date %][%- ELSE %][% invoice.duedate %][%- END %]</td>
|
|
63 | 71 |
<td> |
64 | 72 |
[%- IF loop.first || (previous_vcname != invoice.vcname) %] |
65 | 73 |
<a href="controller.pl?action=CustomerVendor/edit&db=[% vc %]&id=[% HTML.url(invoice.vc_id) %]&callback=[% HTML.url('sepa.pl?action=bank_transfer_add&vc=' _ vc) %]"> |
... | ... | |
85 | 93 |
<td align="right">[% LxERP.format_amount(invoice.invoice_amount-invoice.open_sepa_transfer_amount, 2) %]</td> |
86 | 94 |
<td align="right">[% LxERP.format_amount(invoice.open_amount-invoice.open_sepa_transfer_amount, 2) %]</td> |
87 | 95 |
<td align="right">[% invoice.transdate %]</td> |
88 |
<td align="left">[% HTML.escape(invoice.pt_description) %]</td> |
|
96 |
<td align="left">[% HTML.escape(invoice.pt_description) %][%- IF invoice.within_skonto_period %] bis [% invoice.duedate %][%- END %]</td>
|
|
89 | 97 |
<td align="left" [%- IF invoice.within_skonto_period %]style="background-color: LightGreen"[%- END %]>[%- IF invoice.skonto_amount %] [% LxERP.format_amount(invoice.percent_skonto, 2) %] % = [% LxERP.format_amount(invoice.skonto_amount, 2) %] € bis [% invoice.skonto_date %] [%- END %]</td> |
90 | 98 |
<td> |
91 | 99 |
[% IF INSTANCE_CONF.get_sepa_reference_add_vc_vc_id %] |
... | ... | |
97 | 105 |
[% L.select_tag('bank_transfers[].payment_type', invoice.payment_select_options, value_key => 'payment_type', title_key => 'display', id => 'payment_type_' _ loop.count, class => 'type_target' ) %] |
98 | 106 |
</td> |
99 | 107 |
<td align="right"> |
100 |
<input id=[% loop.count %] name="bank_transfers[].amount" id="amount_[% loop.count %]" value="[% LxERP.format_amount(invoice.invoice_amount_suggestion, 2) %]" style="text-align: right" size="12">
|
|
108 |
<input id=[% loop.count %] name="bank_transfers[].amount" id="amount_[% loop.count %]" value="[% LxERP.format_amount(invoice.invoice_amount_suggestion, 2) %]" style="text-align: right" size="8">
|
|
101 | 109 |
</td> |
102 | 110 |
<td> |
103 | 111 |
[%- SET reference = invoice.reference_prefix _ invoice.invnumber _ invoice.substitution _ invoice.vc_prefix _ invoice.vc_number %] |
templates/webpages/sepa/bank_transfer_create.html | ||
---|---|---|
44 | 44 |
<br> |
45 | 45 |
<table> |
46 | 46 |
<tr> |
47 |
<th class="listheading">[%- IF is_vendor %][% 'Vendor' | $T8 %][%- ELSE %][%- LxERP.t8('Customer') %][%- END %]</th> |
|
48 |
<th class="listheading">[% 'Depositor' | $T8 %]</th> |
|
47 |
<th class="listheading" id='cv' style="min-width:250px">[%- IF is_vendor %][% 'Vendor' | $T8 %][%- ELSE %][%- LxERP.t8('Customer') %][%- END %]</th>
|
|
48 |
<th class="listheading" id='depo'>[% 'Depositor' | $T8 %]</th>
|
|
49 | 49 |
<th class="listheading">[% 'IBAN' | $T8 %]</th> |
50 | 50 |
<th class="listheading">[% 'BIC' | $T8 %]</th> |
51 | 51 |
<th class="listheading">[% 'Bank' | $T8 %]</th> |
... | ... | |
54 | 54 |
<th class="listheading">[% 'Mandate Date of Signature' | $T8 %]</th> |
55 | 55 |
[%- END %] |
56 | 56 |
</tr> |
57 |
|
|
58 | 57 |
[%- FOREACH vbi = VC_BANK_INFO %] |
59 | 58 |
<tr class="listrow[% loop.count % 1 %]"> |
60 | 59 |
<td> |
... | ... | |
62 | 61 |
<input type="hidden" name="vc_bank_info[].name" value="[% HTML.escape(vbi.name) %]"> |
63 | 62 |
[% HTML.escape(vbi.name) %] |
64 | 63 |
</td> |
65 |
<td><input name="vc_bank_info[].depositor" size="20" value="[% HTML.escape(vbi.depositor) %]"></td> |
|
64 |
<td><input name="vc_bank_info[].depositor" style="width:97%;" size="20" value="[% HTML.escape(vbi.depositor) %]"></td>
|
|
66 | 65 |
<td><input name="vc_bank_info[].iban" size="34" value="[% HTML.escape(vbi.iban.substr(0, 34)) %]" maxlength="34"></td> |
67 | 66 |
<td><input name="vc_bank_info[].bic" size="20" value="[% HTML.escape(vbi.bic.substr(0, 20)) %]" maxlength="20"></td> |
68 | 67 |
<td><input name="vc_bank_info[].bank" size="30" value="[% HTML.escape(vbi.bank) %]"></td> |
... | ... | |
74 | 73 |
[%- END %] |
75 | 74 |
</table> |
76 | 75 |
</p> |
77 |
|
|
76 |
<script type='text/javascript'> |
|
77 |
$("#depo").css("width",$("#cv").width()+"px"); |
|
78 |
</script> |
|
78 | 79 |
<p> |
79 | 80 |
3. [% 'Enter the requested execution date or leave empty for the quickest possible execution:' | $T8 %] |
80 | 81 |
<br> |
Auch abrufbar als: Unified diff
SEPA-Überweisungen: GUI-Verbesserung #2
1. Sortierung der Liste nach Fälligkeitsdatum:
- Für Rechnungen deren Skonto-Datum nicht überschritten wurde wird als Fälligkeitsdatum das Skontodatum verwendet
und die Rechnung entsprechend dort einsortiert, unter den Zahlungsbedingungen wird dann auch das Fälligkeitsdatum ohne Skonto angezeigt
- Für Rechnungen deren Skonto-Datum überschritten wurde - nur nach Fälligkeitsdatum wie gehabt
2. Aktivieren/Deaktivieren der Checkbox durch anklicken der ganzen Zeile
3. Einblenden der Summe der Überweisungsbeträge (oben), permanente Aktualisierung der Summe
3.1 bei Checkbox Änderung (auch alle An/Aus)
3.2 bei Betragänderung
3.3 bei Auswahl anderer Skontobedingung
4. Bankkonto-Auswahl in einer Zeile unterbringen, dazu
- Text Ändern in "Bankkonto als Quelle für Überweisungen:" (bei Bankeinzügen: Bankkonto als Ziel für Einzüge)
- danach Pulldownliste ohne Zeilenumbruch dazwischen
- "Überweisungsbetrag" weiter nach Rechts, ca. in Höhe von der Spalte "Überweisungsbetrag"
5. Spaltenüberschrift "Überweisungs-betrag" kürzen in "Zahlungs-Betrag", Spaltenbreite verringert.
6. Optische Erkennung durch Grünfärbung der Buchungen bis aktuellem Termin
7. In "Schritt Zwei" - (Überprüfung der Kontoinformationen):
- Spalte Kontoinhaber passt sich dynamisch der Breite von Lieferant an
-- Herausnahme des Setzens der Zahlungsbedingungen
fix #4483