X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FChart.pm;h=d51332f7d8c1d29cbbd5198dec962693d92ba63d;hb=5e9cefa2067da6326e3cb9ab6834c51f21bfca2c;hp=0c8636c81cbdbd3ef5e5b10f583c5fa3a05011bc;hpb=fea07b8edfb2b41496aa383e6df80d0f2139e57f;p=kivitendo-erp.git diff --git a/SL/DB/Chart.pm b/SL/DB/Chart.pm index 0c8636c81..d51332f7d 100644 --- a/SL/DB/Chart.pm +++ b/SL/DB/Chart.pm @@ -87,6 +87,16 @@ sub has_transaction { $self->db->dbh->selectrow_array('select exists(select 1 from acc_trans where chart_id = ?)', {}, $self->id); } +sub new_chart_valid { + my ($self) = @_; + + if ( $self->valid_from && DateTime->today >= $self->valid_from ) { + return 1; + } else { + return 0; + }; +} + sub displayable_name { my ($self) = @_; @@ -170,6 +180,12 @@ or not. Returns the date of the last transaction of the chart in the database, which may lie in the future. +=item C + +Checks whether a follow-up chart is configured, and returns 1 or 0 depending on +whether the valid_from date is before or after the current date. +Is this even used anywhere? + =back =head1 BUGS