Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision da2f5aa8

Von G. Richardson vor mehr als 4 Jahren hinzugefügt

  • ID da2f5aa8cea79ff0a3e1e5e88e74cbf7e9e79794
  • Vorgänger 5eb836e4
  • Nachfolger f2f0fb50

AccountingPeriod - Methode an get_balance_starting_date übergeben

Für den Fall, daß man die Methode zur Ermittlung des Startdatums nicht
aus der Mandantenkonfiguration nehmen möchte, sondern diese selber
vorgeben, gibt es nun einen neuen Parameter, um die Methode selber zu
bestimmen. Der Default ist weiterhin der Wert aus der
Mandantenkonfiguration.

Unterschiede anzeigen:

SL/DB/Helper/AccountingPeriod.pm
20 20
}
21 21

  
22 22
sub get_balance_starting_date {
23
  my ($self,$asofdate) = @_;
23
  my ($self, $asofdate, $startdate_method) = @_;
24 24

  
25
  $asofdate ||= DateTime->today_local;
25
  $asofdate         ||= DateTime->today_local;
26
  $startdate_method ||= $::instance_conf->get_balance_startdate_method;
26 27

  
27 28
  unless ( ref $asofdate eq 'DateTime' ) {
28 29
    $asofdate = $::locale->parse_date_to_object($asofdate);
......
30 31

  
31 32
  my $dbh = $::form->get_standard_dbh;
32 33

  
33
  my $startdate_method = $::instance_conf->get_balance_startdate_method;
34 34

  
35 35
  # We could use the following objects to determine the starting date for
36 36
  # calculating the balance from asofdate (the reference date for the balance):
......
122 122
Returns an arrayref of translated options for determining the startdate of a
123 123
balance period or the yearend period. To be used as the options for a dropdown.
124 124

  
125
=item C<get_balance_starting_date $date>
125
=item C<get_balance_starting_date $date $startdate_method>
126 126

  
127 127
Given a date this method calculates and returns the starting date of the
128 128
financial period relative to that date, according to the configured
......
134 134

  
135 135
If no argument is passed the current day is assumed as default.
136 136

  
137
If no startdate method is passed, the default method from defaults is used.
138

  
137 139
=back
138 140

  
139 141
=head1 BUGS

Auch abrufbar als: Unified diff