Fix to report name when completed
This commit is contained in:
@@ -418,7 +418,18 @@ namespace Swarmops.Logic.Financial
|
||||
nextReportConcerns, nextReportConcerns.AddMonths(monthInterval - 1));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static string LastReportDescription(Organization organization)
|
||||
{
|
||||
VatReports reports = VatReports.ForOrganization(organization, true);
|
||||
if (reports.Count == 0)
|
||||
{
|
||||
throw new InvalidOperationException("Cannot look up last description of nonexistent VAT report collection");
|
||||
}
|
||||
|
||||
reports.Sort(VatReports.VatReportSorterByDate);
|
||||
return reports.Last().Description;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -49,8 +49,11 @@ namespace Swarmops.Frontend.Pages.Ledgers
|
||||
EomItem vatReport = new EomItem();
|
||||
vatReport.Id = "VatReport";
|
||||
vatReport.Callback = "CreateVatReport";
|
||||
vatReport.Name = String.Format(Resources.Pages.Ledgers.EndOfMonth_CreateVatReport, VatReport.NextReportDescription (this.CurrentOrganization));
|
||||
vatReport.Completed = (vatRequired == ReportRequirement.Completed ? true : false);
|
||||
vatReport.Name = String.Format(Resources.Pages.Ledgers.EndOfMonth_CreateVatReport,
|
||||
(vatReport.Completed
|
||||
? VatReport.LastReportDescription(this.CurrentOrganization)
|
||||
: VatReport.NextReportDescription(this.CurrentOrganization);
|
||||
vatReport.Icon = "document";
|
||||
|
||||
group2.Items.Add(vatReport);
|
||||
|
||||
Reference in New Issue
Block a user