=================================================================== RCS file: /cvs/RT/Invoicing/lib/RTI/State.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- RT/Invoicing/lib/RTI/State.pm 2012/08/15 01:52:28 1.5 +++ RT/Invoicing/lib/RTI/State.pm 2012/08/18 21:21:54 1.6 @@ -29,6 +29,12 @@ $invoice->{$_} = ymd_to_DateTime( $invoice->{$_} ) for qw/ invdate start end /; } + foreach my $custid (keys %{ $self->{payment} || {} }) { + foreach my $payment (@{ $self->{payment}->{$custid} || [] }) { + $payment->{date} = ymd_to_DateTime( $payment->{date} ) + if $payment->{date}; + } + } } bless $self, $class; @@ -136,6 +142,12 @@ else { delete $invoice->{$k}; } + } + } + foreach my $custid (keys %{ $self->{payment} || {} }) { + foreach my $payment (@{ $self->{payment}->{$custid} || [] }) { + $payment->{date} = $payment->{date}->ymd + if ref $payment->{date} eq 'DateTime'; } } DumpFile( $file, {%$self} ) or die "Unable to save state: $!";