diff --git a/src/cg/cg5400.cpp b/src/cg/cg5400.cpp index 1cc27b869..184371af8 100755 --- a/src/cg/cg5400.cpp +++ b/src/cg/cg5400.cpp @@ -44,11 +44,13 @@ bool TRipristina_stampa::reg_restore(const TString& regist, const TDate inizio_anno(1, 1, year); if (reg.read(_isequal, _lock) == NOERR) { - const TDate dlast(reg.get_date("D3")); - + TDate dlast(reg.get_date("D3")); const int ld = TDate::last_day(month, year); - if (day > ld) day = ld; - TDate d(day, month, year); // Data di ripristino + + dlast.set_end_month(); + if (day > ld) day = ld; + + TDate d(day, month, year); // Data di ripristino TRectype from(mov.curr()); from.zero(); TRectype to(from);