Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d24e5589

Von Tamino Steinert vor 3 Monaten hinzugefügt

  • ID d24e5589fe9c082b174da27eb542f79903dce48f
  • Vorgänger 93ae5d0f
  • Nachfolger 0cdb369e

S:D:PeriodicInvoicesConfig: Periodizität von einmalig nicht überschreiben

Unterschiede anzeigen:

SL/BackgroundJob/CreatePeriodicInvoices.pm
103 103
  my $config            = shift;
104 104
  my $period_start_date = shift;
105 105

  
106
  my $period_length   = $config->periodicity eq 'o' ? $config->get_order_value_period_length : $config->get_billing_period_length;
106
  my $period_length   = $config->get_order_value_period_length || $config->get_billing_period_length || 1;
107 107
  my $period_end_date = $period_start_date->clone->add(months => $period_length)->subtract(days => 1);
108 108

  
109 109
  my @month_names       = ('',
SL/DB/PeriodicInvoicesConfig.pm
46 46
    $new_order->reqdate($period_start_date);
47 47
    $new_order->tax_point(
48 48
      add_months(
49
        $period_start_date, $self->get_billing_period_length
49
        $period_start_date, $self->get_billing_period_length || $self->get_order_value_period_length || 1
50 50
      )->add(days => -1)
51 51
    );
52 52
    my @items;
......
192 192

  
193 193
sub get_billing_period_length {
194 194
  my $self = shift;
195
  return $PERIOD_LENGTHS{ $self->periodicity } || 1;
195
  return $PERIOD_LENGTHS{ $self->periodicity };
196 196
}
197 197

  
198 198
sub get_order_value_period_length {
199 199
  my $self = shift;
200 200
  return $self->get_billing_period_length if $self->order_value_periodicity eq 'p';
201
  return $ORDER_VALUE_PERIOD_LENGTHS{ $self->order_value_periodicity } || 1;
201
  return $ORDER_VALUE_PERIOD_LENGTHS{ $self->order_value_periodicity };
202 202
}
203 203

  
204 204
sub add_months {

Auch abrufbar als: Unified diff