Revision c872d063
Von Moritz Bunkus vor etwa 14 Jahren hinzugefügt
SL/SEPA.pm | ||
---|---|---|
149 | 149 |
my $self = shift; |
150 | 150 |
my %params = @_; |
151 | 151 |
|
152 |
Common::check_params(\%params, qw(id)); |
|
152 |
Common::check_params(\%params, qw(id vc));
|
|
153 | 153 |
|
154 | 154 |
my $myconfig = \%main::myconfig; |
155 | 155 |
my $form = $main::form; |
156 |
my $vc = $params{vc} eq 'customer' ? 'customer' : 'vendor'; |
|
157 |
my $arap = $params{vc} eq 'customer' ? 'ar' : 'ap'; |
|
156 | 158 |
|
157 | 159 |
my $dbh = $params{dbh} || $form->get_standard_dbh($myconfig); |
158 | 160 |
|
159 | 161 |
my ($joins, $columns); |
160 | 162 |
|
161 | 163 |
if ($params{details}) { |
162 |
$columns = ', ap.invoice'; |
|
163 |
$joins = 'LEFT JOIN ap ON (se.ap_id = ap.id)';
|
|
164 |
$columns = ', arap.invoice';
|
|
165 |
$joins = "LEFT JOIN ${arap} arap ON (se.${arap}_id = arap.id)";
|
|
164 | 166 |
} |
165 | 167 |
|
166 | 168 |
my $query = |
... | ... | |
176 | 178 |
my ($columns, $joins); |
177 | 179 |
|
178 | 180 |
if ($params{details}) { |
179 |
$columns = qq|, ap.invnumber, ap.invoice, v.name AS vendor_name, c.accno AS chart_accno, c.description AS chart_description|;
|
|
180 |
$joins = qq|LEFT JOIN ap ON (sei.ap_id = ap.id)
|
|
181 |
LEFT JOIN vendor v ON (ap.vendor_id = v.id)
|
|
182 |
LEFT JOIN chart c ON (sei.chart_id = c.id)|;
|
|
181 |
$columns = qq|, arap.invnumber, arap.invoice, vc.name AS vc_name, c.accno AS chart_accno, c.description AS chart_description|;
|
|
182 |
$joins = qq|LEFT JOIN ${arap} arap ON (sei.${arap}_id = arap.id)
|
|
183 |
LEFT JOIN ${vc} vc ON (arap.${vc}_id = vc.id)
|
|
184 |
LEFT JOIN chart c ON (sei.chart_id = c.id)|;
|
|
183 | 185 |
} |
184 | 186 |
|
185 | 187 |
$query = qq|SELECT sei.* |
... | ... | |
187 | 189 |
FROM sepa_export_items sei |
188 | 190 |
$joins |
189 | 191 |
WHERE sei.sepa_export_id = ?|; |
192 |
|
|
190 | 193 |
$export->{items} = selectall_hashref_query($form, $dbh, $query, conv_i($params{id})); |
191 | 194 |
|
192 | 195 |
} else { |
bin/mozilla/sepa.pl | ||
---|---|---|
155 | 155 |
$form->{jsscript} = 1; |
156 | 156 |
|
157 | 157 |
$form->header(); |
158 |
print $form->parse_html_template('sepa/bank_transfer_search'); |
|
158 |
print $form->parse_html_template('sepa/bank_transfer_search', { vc => $vc });
|
|
159 | 159 |
|
160 | 160 |
$main::lxdebug->leave_sub(); |
161 | 161 |
} |
... | ... | |
231 | 231 |
|
232 | 232 |
$report->set_options('top_info_text' => join("\n", @options), |
233 | 233 |
'raw_top_info_text' => $form->parse_html_template('sepa/bank_transfer_list_top'), |
234 |
'raw_bottom_info_text' => $form->parse_html_template('sepa/bank_transfer_list_bottom', { 'show_buttons' => $open_available }), |
|
234 |
'raw_bottom_info_text' => $form->parse_html_template('sepa/bank_transfer_list_bottom', { 'show_buttons' => $open_available, vc => $vc }),
|
|
235 | 235 |
'std_column_visibility' => 1, |
236 | 236 |
'output_format' => 'HTML', |
237 | 237 |
'title' => $form->{title}, |
... | ... | |
272 | 272 |
|
273 | 273 |
my $form = $main::form; |
274 | 274 |
my $locale = $main::locale; |
275 |
my $vc = $form->{vc} eq 'customer' ? 'customer' : 'vendor'; |
|
275 | 276 |
|
276 | 277 |
my @ids = (); |
277 | 278 |
if (!$form->{mode} || ($form->{mode} eq 'single')) { |
... | ... | |
287 | 288 |
my $export; |
288 | 289 |
|
289 | 290 |
foreach my $id (@ids) { |
290 |
my $curr_export = SL::SEPA->retrieve_export('id' => $id, 'details' => 1); |
|
291 |
my $curr_export = SL::SEPA->retrieve_export('id' => $id, 'details' => 1, 'vc' => $vc);
|
|
291 | 292 |
|
292 | 293 |
foreach my $item (@{ $curr_export->{items} }) { |
293 | 294 |
map { $item->{"export_${_}"} = $curr_export->{$_} } grep { !ref $curr_export->{$_} } keys %{ $curr_export }; |
templates/webpages/sepa/bank_transfer_edit.html | ||
---|---|---|
1 | 1 |
[%- USE T8 %] |
2 | 2 |
[% USE HTML %] |
3 | 3 |
[% USE LxERP %] |
4 |
[% IF vc == 'vendor' %] |
|
5 |
[% SET is_vendor = 1 %] |
|
6 |
[% SET arap = 'ap' %] |
|
7 |
[% SET iris = 'ir' %] |
|
8 |
[% ELSE %] |
|
9 |
[% SET is_vendor = 0 %] |
|
10 |
[% SET arap = 'ar' %] |
|
11 |
[% SET iris = 'is' %] |
|
12 |
[%- END %] |
|
4 | 13 |
<body> |
5 | 14 |
|
6 | 15 |
<p><div class="listtop">[% title %]: [% HTML.escape(export.ids.join(', ')) %]</div></p> |
... | ... | |
15 | 24 |
<th class="listheading" align="center"><input type="checkbox" id="select_all"></th> |
16 | 25 |
[%- END %] |
17 | 26 |
<th class="listheading">[% 'Invoice' | $T8 %]</th> |
18 |
<th class="listheading">[% 'Vendor' | $T8 %]</th> |
|
19 |
<th class="listheading" colspan="2">[% 'Source bank account' | $T8 %]</th> |
|
20 |
<th class="listheading" colspan="2">[% 'Target bank account' | $T8 %]</th> |
|
27 |
<th class="listheading">[%- IF is_vendor %][% 'Vendor' | $T8 %][%- ELSE %][%- LxERP.t8('Customer') %][%- END %]</th> |
|
28 |
[%- IF is_vendor %] |
|
29 |
<th class="listheading" colspan="2">[% 'Source bank account' | $T8 %]</th> |
|
30 |
<th class="listheading" colspan="2">[% 'Target bank account' | $T8 %]</th> |
|
31 |
[%- ELSE %] |
|
32 |
<th class="listheading" colspan="2">[% 'Target bank account' | $T8 %]</th> |
|
33 |
<th class="listheading" colspan="2">[% 'Source bank account' | $T8 %]</th> |
|
34 |
[%- END %] |
|
21 | 35 |
<th class="listheading" align="right">[% 'Amount' | $T8 %]</th> |
22 | 36 |
<th class="listheading">[% 'Reference' | $T8 %]</th> |
23 | 37 |
<th class="listheading" align="right">[% 'Requested execution date' | $T8 %]</th> |
... | ... | |
52 | 66 |
</td> |
53 | 67 |
[%- END %] |
54 | 68 |
<td> |
55 |
<a href="[% IF item.invoice %]ir[% ELSE %]ap[% END %].pl?action=edit&type=invoice&id=[% HTML.url(item.ap_id) %]">[% HTML.escape(item.invnumber) %]</a>
|
|
69 |
<a href="[% IF item.invoice %][% iris %][% ELSE %][% arap %][% END %].pl?action=edit&type=invoice&id=[% IF is_vendor %][% HTML.url(item.ap_id) %][% ELSE %][% HTML.url(item.ar_id) %][% END %]">[% HTML.escape(item.invnumber) %]</a>
|
|
56 | 70 |
</td> |
57 |
<td>[% HTML.escape(item.vendor_name) %]</td>
|
|
71 |
<td>[% HTML.escape(item.vc_name) %]</td>
|
|
58 | 72 |
<td>[% HTML.escape(item.our_iban) %]</td> |
59 | 73 |
<td>[% HTML.escape(item.our_bic) %]</td> |
60 |
<td>[% HTML.escape(item.vendor_iban) %]</td>
|
|
61 |
<td>[% HTML.escape(item.vendor_bic) %]</td>
|
|
74 |
<td>[% HTML.escape(item.vc_iban) %]</td>
|
|
75 |
<td>[% HTML.escape(item.vc_bic) %]</td>
|
|
62 | 76 |
<td align="right">[% HTML.escape(LxERP.format_amount(item.amount, 2)) %]</td> |
63 | 77 |
<td>[% HTML.escape(item.reference) %]</td> |
64 | 78 |
<td align="right">[% HTML.escape(item.requested_execution_date) %]</td> |
... | ... | |
135 | 149 |
[%- END %] |
136 | 150 |
[%- END %] |
137 | 151 |
[%- END %] |
152 |
|
|
153 |
<input type="hidden" name="vc" value="[% HTML.escape(vc) %]"> |
|
138 | 154 |
</form> |
139 | 155 |
|
140 | 156 |
</body> |
templates/webpages/sepa/bank_transfer_list_bottom.html | ||
---|---|---|
4 | 4 |
[%- IF show_buttons %] |
5 | 5 |
<input type="hidden" name="action" value="dispatcher"> |
6 | 6 |
<input type="hidden" name="mode" value="multi"> |
7 |
<input type="hidden" name="vc" value="[%- HTML.escape(vc) %]"> |
|
7 | 8 |
|
8 | 9 |
<p> |
9 | 10 |
<input type="submit" class="submit" name="action_bank_transfer_download_sepa_xml" value="[% 'SEPA XML download' | $T8 %]"> |
Auch abrufbar als: Unified diff
Unterscheidung Bankeinzug/Überweisung bei Liste & Editmaske