#Newmark

#Construction Tracking

#Loan Draws Interactive HTML Report

#SQL

create sproc

Create a modified version of the ct_g_LoanDraws procedure which returns all the same fields, but broken down by cost code (as it exists natively in the ct_DrawsBudget table), instead of grouped by title and header

add allocation columns to table

Add “BondAllocation”, “LoanAllocation”, and “EntityAllocation” columns to ct_DrawsBudget table, which will be used to indicate the amount allocated to be spent against from each source of funds, for each cost code

create sprocs for drill downs


DECLARE        @CostCode    VARCHAR(50) = '020300',
            @DrawId        INT            = 158,
            @DrawType    VARCHAR(50) = 'Total'

DECLARE        @GLCode        VARCHAR(50)
SELECT        @GLCode =    (SELECT Value FROM ct_Params WHERE ParamType = 'Draw Type' AND [Description] = @DrawType)

IF @DrawType = 'Total'
BEGIN
    SELECT        *
    FROM        CT_INVOICES        i
    INNER JOIN    CT_DRAWBATCHES    b
    ON            i.DrawBatchId = b.DrawBatchId
    WHERE        CostCode      = @CostCode        
    AND            i.DrawBatchID < @DrawId
    AND            (i.GLCode      =    (SELECT Value FROM ct_Params WHERE ParamType = 'Draw Type' AND [Description] = 'Loan') 
        OR         i.GLCode      = (SELECT Value FROM ct_Params WHERE ParamType = 'Draw Type' AND [Description] = 'Bond') 
                )
END
ELSE
    SELECT        *
    FROM        CT_INVOICES        i
    INNER JOIN    CT_DRAWBATCHES    b
    ON            i.DrawBatchId = b.DrawBatchId
    WHERE        CostCode      = @CostCode        
    AND            i.DrawBatchID < @DrawId
    AND            i.GLCode      = @GLCode

#VB

create web method for report

[
    {
        Header: "Hard Costs",
        Titles: 
        [
            {
                Title: "Site Costs",
                CostCodes:
                [
                    "CostCode": "020101",
                    "CostCode": "020102"
                ]
                SortOrder: 8
            },
            {
                Title: "Vertical Costs",
                CostCodes:
                [
                    "CostCode": "030201",
                    "CostCode": "030204"
                ]
                SortOrder: 9
            }

        ]
    }
]

create web methods for drill downs

#Front-End

create service

set up angular service function to return structured JSON data object from getDrawLoans web method

create interactive draw loans template

create HTML template and angular controller to display nested arrays using example logic:


<table> <tbody> <tr ng-repeat-start="header in headers"> </tr> <tr ng-repeat-start="title in titles"> </tr> <tr ng-repeat="costcode in costcodes" ng-repeat-end> </tr> </tbody> </table>

So that it will be possible to group the nested arrays together.

implement bootstrap-collapse functionality

drilldowns