Revision 23d55c85
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
SL/Controller/BankTransaction.pm | ||
---|---|---|
299 | 299 |
'filter.fromdate' => $::form->{filter}->{fromdate}, |
300 | 300 |
)); |
301 | 301 |
|
302 |
$self->render( |
|
303 |
'bank_transactions/create_invoice', |
|
304 |
{ layout => 0 }, |
|
305 |
title => t8('Create invoice'), |
|
306 |
TEMPLATES_GL => $use_vendor_filter && @{ $templates_ap } ? undef : $templates_gl, |
|
307 |
TEMPLATES_AP => $templates_ap, |
|
308 |
vendor_name => $use_vendor_filter && @{ $templates_ap } ? $vendor_of_transaction->name : undef, |
|
309 |
); |
|
302 |
# if we have exactly one ap match, use this directly |
|
303 |
if (1 == scalar @{ $templates_ap }) { |
|
304 |
$self->redirect_to($self->load_ap_record_template_url($templates_ap->[0])); |
|
305 |
|
|
306 |
} else { |
|
307 |
my $dialog_html = $self->render( |
|
308 |
'bank_transactions/create_invoice', |
|
309 |
{ layout => 0, output => 0 }, |
|
310 |
title => t8('Create invoice'), |
|
311 |
TEMPLATES_GL => $use_vendor_filter && @{ $templates_ap } ? undef : $templates_gl, |
|
312 |
TEMPLATES_AP => $templates_ap, |
|
313 |
vendor_name => $use_vendor_filter && @{ $templates_ap } ? $vendor_of_transaction->name : undef, |
|
314 |
); |
|
315 |
$self->js->run('kivi.BankTransaction.show_create_invoice_dialog', $dialog_html)->render; |
|
316 |
} |
|
310 | 317 |
} |
311 | 318 |
|
312 | 319 |
sub action_ajax_payment_suggestion { |
js/kivi.BankTransaction.js | ||
---|---|---|
42 | 42 |
}; |
43 | 43 |
|
44 | 44 |
ns.create_invoice = function(bank_transaction_id) { |
45 |
$.post('controller.pl?action=BankTransaction/create_invoice', |
|
46 |
'&bt_id=' + bank_transaction_id + "&filter.bank_account=" + $('#filter_bank_account').val() + '&filter.fromdate=' + $('#filter_fromdate').val() + '&filter.todate=' + $('#filter_todate').val(), |
|
47 |
kivi.eval_json_result); |
|
48 |
}; |
|
49 |
|
|
50 |
ns.show_create_invoice_dialog = function(dialog_html) { |
|
45 | 51 |
kivi.popup_dialog({ |
46 |
url: 'controller.pl?action=BankTransaction/create_invoice', |
|
47 |
data: '&bt_id=' + bank_transaction_id + "&filter.bank_account=" + $('#filter_bank_account').val() + '&filter.fromdate=' + $('#filter_fromdate').val() + '&filter.todate=' + $('#filter_todate').val(), |
|
48 |
type: 'POST', |
|
52 |
html: dialog_html, |
|
49 | 53 |
id: 'create_invoice_window', |
50 | 54 |
dialog: { title: kivi.t8('Create invoice') } |
51 | 55 |
}); |
52 |
return true; |
|
53 | 56 |
}; |
54 | 57 |
|
55 | 58 |
|
Auch abrufbar als: Unified diff
BankTransaction: Kreditorenvorlagen: Vorlage direkt laden, wenn genau 1 Treffer