Revision 4e9bbb0a
Von Jan Büren vor etwa 2 Jahren hinzugefügt
SL/DB/Helper/Payment.pm | ||
---|---|---|
667 | 667 |
} |
668 | 668 |
# valid skonto date, check if skonto is preferred |
669 | 669 |
my $bt = SL::DB::BankTransaction->new(id => $bt_id)->load; |
670 |
if ($self->skonto_date && $self->within_skonto_period($bt->transdate)) { |
|
670 |
if ($self->skonto_date && $self->within_skonto_period(transdate => $bt->transdate)) {
|
|
671 | 671 |
push(@options, { payment_type => 'without_skonto', display => t8('without skonto') }); |
672 | 672 |
push(@options, { payment_type => 'with_skonto_pt', display => t8('with skonto acc. to pt'), selected => 1 }) if $skontoable; |
673 | 673 |
} else { |
... | ... | |
877 | 877 |
invoice, as it returns undef if there is no payment term or skonto days is set |
878 | 878 |
to 0. |
879 | 879 |
|
880 |
=item C<within_skonto_period [DATE]>
|
|
880 |
=item C<within_skonto_period [transdate =E<gt> DateTime]>
|
|
881 | 881 |
|
882 |
Returns 0 or 1. |
|
882 |
Returns 1 if skonto_date is in a skontoable period. |
|
883 |
Needs the mandatory named param 'transdate' as a 'DateTime', usually a bank |
|
884 |
transaction date for imported bank data. |
|
883 | 885 |
|
884 |
Checks whether the invoice has payment terms configured, and whether the date
|
|
885 |
is within the skonto max date. If no date is passed the current date is used.
|
|
886 |
Checks if the invoice has skontoable payment terms configured and whether the date
|
|
887 |
is within the skonto max date. |
|
886 | 888 |
|
887 |
You can also pass a dateref object as a parameter to check whether skonto |
|
888 |
applies for that date rather than the current date. |
|
889 |
If one of the condition fails, a hopefully helpful error message is returned. |
|
889 | 890 |
|
890 | 891 |
=item C<valid_skonto_amount> |
891 | 892 |
|
... | ... | |
1051 | 1052 |
|
1052 | 1053 |
=head1 AUTHOR |
1053 | 1054 |
|
1054 |
G. Richardson E<lt>grichardson@kivitendo-premium.de<gt> |
|
1055 |
G. Richardson E<lt>grichardson@kivitendo-premium.deE<gt>
|
|
1055 | 1056 |
|
1056 | 1057 |
=cut |
Auch abrufbar als: Unified diff
S/D/H/P: New call to within_skonto. POD edited.