Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 02ba4e7a

Von Kivitendo Admin vor mehr als 8 Jahren hinzugefügt

  • ID 02ba4e7a63f45723a274083225ce87530dfe0a52
  • Vorgänger 58e48c01
  • Nachfolger 784c2880

Payment Helper exchangerate Methode verbessert

Unterschiede anzeigen:

SL/DB/Helper/Payment.pm
657 657

  
658 658
  return 1 if $self->currency_id == $::instance_conf->get_currency_id;
659 659

  
660
  die "transdate isn't a DateTime object:" . ref($self->transdate) unless ref($self->transdate) eq 'DateTime';
660 661
  my $rate = SL::DB::Manager::Exchangerate->find_by(currency_id => $self->currency_id,
661 662
                                                    transdate   => $self->transdate,
662 663
                                                   );
663 664
  return undef unless $rate;
664
  $self->is_sales ? return $rate->sell : return $rate->buy;
665

  
666
  return $self->is_sales ? $rate->buy : $rate->sell; # also undef if not defined
665 667
};
666 668

  
667 669
sub get_payment_suggestions {
......
1106 1108

  
1107 1109
=item C<exchangerate>
1108 1110

  
1109
Returns the exchangerate in database format for the invoice according to that invoice's transdate.
1110
Returns 'sell' for sales, 'buy' for purchases.
1111
Returns 1 immediately if the record uses the default currency.
1112

  
1113
Returns the exchangerate in database format for the invoice according to that
1114
invoice's transdate, returning 'buy' for sales, 'sell' for purchases.
1115

  
1116
If no exchangerate can be found for that day undef is returned.
1111 1117

  
1112 1118
=back
1113 1119

  

Auch abrufbar als: Unified diff