KSUP: How I Engineered a Smart Financial Planning Module with Dynamic Reporting

Published on
4 mins read
--- views

Task

It was necessary to generate financial plans under the special role of the CFO, based on existing operational plans, presales, contracts, and sales.

Implementation

Lists with content plans were prepared for these needs. Forms for creation and editing were developed. A scenario for generating report data was implemented. The list item display was significantly improved: a jQuery plugin was written to render the JSON content of the field containing the generated report data. Under the hood, the plugin uses jQuery DataTables and the Mustache templating engine.

Financial Plan Feature Overview
Financial Plan Feature Overview
Financial Plan Table Example
Financial Plan Table Example
Financial Plan Creation Form
Financial Plan Creation Form

Content `Source Code` requires special access key

Please, communicate with administrator to obtain the access key here

Content `Source Code` requires special access key

Please, communicate with administrator to obtain the access key here

Content `Source Code` requires special access key

Please, communicate with administrator to obtain the access key here

Content `Source Code` requires special access key

Please, communicate with administrator to obtain the access key here

Content `Source Code` requires special access key

Please, communicate with administrator to obtain the access key here

Content `Source Code` requires special access key

Please, communicate with administrator to obtain the access key here

Module Covered by Tests

[TestFixture]
class FinancialPlanCompanyServiceTests : BaseTest
{
    private FinancialPlanCompanyServiceParent _service;

    [OneTimeSetUp]
    public void OneTimeSetUp()
    {
        this._service = new FinancialPlanCompanyServiceParent(_testContext.SalesManagementWeb);
        LocatorExtensions.RegisterAllServices(_testContext.Site);
    }

    [OneTimeTearDown]
    public override void OneTimeTearDown()
    {
        this.OneTimeTearDownBase();
        _service?.Dispose();
        LocatorExtensions.Reset();
    }

    [Test]
    [Ignore("Finplan for company spec in progress")]
    public void GetSales_SaleAndContractGot_SalesAndContractExist()
    {
        DivisionValueSet.Department.TestListItem(_testContext.KnowledgeBaseWeb, true).TryExecute(testDivision =>
        {
            using (var testSale = SaleValueSet.WithPaymentPlan1.TestListItem(_testContext.SalesManagementWeb, testDivision.LookupTitle(),
                null, true, new SPFieldLookupValueCollection() { testDivision.LookupTitle() }))
            using (var testContract = ContractValueSet.WithPaymentPlan1.TestListItem(
                _testContext.SalesManagementWeb, testDivision.LookupTitle(), null,
                new SPFieldLookupValueCollection() {testDivision.LookupTitle()}))
            {
                var sales = _service.GetSalesWrapper().Invoke(0, 3025, null);
                Assert.True(sales.Any(x => x.ID == testSale.ListItem.ID));

                var contracts = _service.GetContractsWrapper().Invoke(0, 3025, null);
                Assert.True(contracts.Any(x => x.ID == testContract.ListItem.ID));
            }
        });
    }
}