Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e78ebdb9

Von Jan Büren vor etwa 2 Jahren hinzugefügt

  • ID e78ebdb9868062007c5b25e425f5d222688c775a
  • Vorgänger bbfe8b79
  • Nachfolger f8013b9c

S/D/H/P: New call to within_skonto. POD edited.

Unterschiede anzeigen:

SL/DB/Helper/Payment.pm
659 659
  }
660 660
  # valid skonto date, check if skonto is preferred
661 661
  my $bt = SL::DB::BankTransaction->new(id => $bt_id)->load;
662
  if ($self->skonto_date && $self->within_skonto_period($bt->transdate)) {
662
  if ($self->skonto_date && $self->within_skonto_period(transdate => $bt->transdate)) {
663 663
    push(@options, { payment_type => 'without_skonto', display => t8('without skonto') });
664 664
    push(@options, { payment_type => 'with_skonto_pt', display => t8('with skonto acc. to pt'), selected => 1 }) if $skontoable;
665 665
  } else {
......
869 869
invoice, as it returns undef if there is no payment term or skonto days is set
870 870
to 0.
871 871

  
872
=item C<within_skonto_period [DATE]>
872
=item C<within_skonto_period [transdate =E<gt> DateTime]>
873 873

  
874
Returns 0 or 1.
874
Returns 1 if skonto_date is in a skontoable period.
875
Needs the mandatory named param 'transdate' as a 'DateTime', usually a bank
876
transaction date for imported bank data.
875 877

  
876
Checks whether the invoice has payment terms configured, and whether the date
877
is within the skonto max date. If no date is passed the current date is used.
878
Checks if the invoice has skontoable payment terms configured and whether the date
879
is within the skonto max date.
878 880

  
879
You can also pass a dateref object as a parameter to check whether skonto
880
applies for that date rather than the current date.
881
If one of the condition fails, a hopefully helpful error message is returned.
881 882

  
882 883
=item C<valid_skonto_amount>
883 884

  
......
1043 1044

  
1044 1045
=head1 AUTHOR
1045 1046

  
1046
G. Richardson E<lt>grichardson@kivitendo-premium.de<gt>
1047
G. Richardson E<lt>grichardson@kivitendo-premium.deE<gt>
1047 1048

  
1048 1049
=cut

Auch abrufbar als: Unified diff