Revision f72a365d
Von Jan Büren vor etwa 6 Jahren hinzugefügt
SL/DB/Helper/Payment.pm | ||
---|---|---|
629 | 629 |
sub get_payment_select_options_for_bank_transaction { |
630 | 630 |
my ($self, $bt_id, %params) = @_; |
631 | 631 |
|
632 |
# no skonto date -> no select option |
|
633 |
return { payment_type => 'without_skonto', display => t8('without skonto') , selected => 1 } unless $self->skonto_date; |
|
634 |
|
|
632 | 635 |
my $bt = SL::DB::BankTransaction->new(id => $bt_id)->load; |
633 | 636 |
|
634 | 637 |
my @options; |
... | ... | |
1055 | 1058 |
Make suggestion for a skonto payment type by returning an HTML blob of the options |
1056 | 1059 |
of a HTML drop-down select with the most likely option preselected. |
1057 | 1060 |
|
1058 |
This is a helper function for BankTransaction/ajax_payment_suggestion. |
|
1061 |
This is a helper function for BankTransaction/ajax_payment_suggestion and |
|
1062 |
template/webpages/bank_transactions/invoices.html |
|
1059 | 1063 |
|
1060 | 1064 |
We are working with an existing payment, so difference_as_skonto never makes sense. |
1061 | 1065 |
|
1066 |
If skonto is not possible (skonto_date does not exists) simply return |
|
1067 |
the single 'no skonto' option as a visual hint. |
|
1068 |
|
|
1062 | 1069 |
If skonto is possible (skonto_date exists), add two possibilities: |
1063 | 1070 |
without_skonto and with_skonto_pt if payment date is within skonto_date, |
1064 | 1071 |
preselect with_skonto_pt, otherwise preselect without skonto. |
Auch abrufbar als: Unified diff
Payment-Helper: get_payment_select_options_for_bank_transaction verbessern
Falls es kein Skonto-Datum gibt, d.h. der Beleg hat überhaupt keine
Skonto-Option, dann auch dem Benutzer erst gar nicht die Auswahl
anbieten.
Prinzipiell die Auswahl anzeigen ist sinnvoll, damit das Verhalten
durchgängig ist und dem Anwender visuell klarer ist, was gebucht werden wird.