Revision 3ba87b60
Von Tamino Steinert vor 4 Monaten hinzugefügt
SL/DB/PeriodicInvoiceItemsConfig.pm | ||
---|---|---|
15 | 15 |
return $ITEM_PERIOD_LENGTHS{ $self->periodicity }; |
16 | 16 |
} |
17 | 17 |
|
18 |
sub active { |
|
19 |
my ($self) = @_; |
|
20 |
return 0 if $self->periodicity eq 'n'; |
|
21 |
if ($self->periodicity eq 'o') { |
|
22 |
return 0 if $self->once_invoice_id; |
|
23 |
return 1; |
|
24 |
} |
|
25 |
return 1 if !$self->end_date || (!$self->terminated && $self->extend_automatically_by); |
|
26 |
my $order_config = $self->order_item->order->periodic_invoices_config; |
|
27 |
my $last_billing_date = $order_config->get_previous_billed_period_start_date; |
|
28 |
if ($last_billing_date) { |
|
29 |
my $next_billing_date = $order_config->add_months( |
|
30 |
$last_billing_date, $self->get_item_period_length |
|
31 |
); |
|
32 |
return 0 if $next_billing_date > $self->end_date; |
|
33 |
} |
|
34 |
return 1; |
|
35 |
} |
|
36 |
|
|
18 | 37 |
1; |
templates/design40_webpages/order/tabs/_row.html | ||
---|---|---|
5 | 5 |
[% USE P %] |
6 | 6 |
|
7 | 7 |
<tbody class="row_entry listrow" data-position="[%- HTML.escape(ITEM.position) -%]"[%- IF MYCONFIG.show_form_details -%] data-expanded="1"[%- END -%]> |
8 |
<tr> |
|
8 |
<tr [% IF ITEM.periodic_invoice_items_config && !ITEM.periodic_invoice_items_config.active %] class="listrow_warning" [% END %]>
|
|
9 | 9 |
<td> |
10 | 10 |
[% IF MYCONFIG.show_form_details %] |
11 | 11 |
[% L.img_tag(src="image/collapse.svg", |
templates/webpages/order/tabs/_row.html | ||
---|---|---|
5 | 5 |
[%- USE P %] |
6 | 6 |
|
7 | 7 |
<tbody class="row_entry listrow" data-position="[%- HTML.escape(ITEM.position) -%]"[%- IF MYCONFIG.show_form_details -%] data-expanded="1"[%- END -%]> |
8 |
<tr> |
|
8 |
<tr [% IF ITEM.periodic_invoice_items_config && !ITEM.periodic_invoice_items_config.active %] class="listrow_error" [% END %]>
|
|
9 | 9 |
<td align="center"> |
10 | 10 |
[%- IF MYCONFIG.show_form_details %] |
11 | 11 |
[% L.img_tag(src="image/collapse.svg", |
Auch abrufbar als: Unified diff
S:D:PeriodicInvoiceItemsConfig: nicht aktive hervorheben