|
BudgetRequirement
Requirements for Budget
Phase-Requirements Requirements for BudgetNOTE: The database has been updated. Make sure you update your local database. I have attached the updated SQL file. updated SQL file is also available updated SQL file is also available here USER INTERFACE
the entry system will contain these fields:startdate,enddate,service_sales, ...... tax,reinvestement (ie: all the fields in Budget table)
BACKEND
(refer to sample P&L report screenshot Monthly_PNL_rpt_sample.jpg)
Budget getBudget(Calendar startDate, Calendar endDate) {Budget requiredBudget = new Budget(); ..... // requiredBudget contains all fields of budget column filled according to the startDate and endDate return requiredBudget; }
Budget getProjection(Calendar startDate, Calendar endDate) {Budget requiredProjection = new Budget(); ..... // requiredProjection contains all fields of projection column filled according to the startDate and endDate return requiredProjection; }
Budget getActual(Calendar startDate, Calendar endDate) {Budget requiredActual = new Budget(); // CHECK IF THE ACTUAL FIELD OF THIS BUDGET (startDate - endDate combination) has already been calculated or not // by checking whether the actual fields in the table in NULL or not. ..... // requiredProjection contains all fields of actual column filled according to the startDate and endDate // NOTE: You need to execute some serious HQL statements here to get the data for each row of the Actual column // in the P&L report. // At present you can leave the calculations for 'product_sales' field as we have not implemented item yet! // NOTE: Before you return values of Actual column to users, don't forget to store the calculated values in the // respective table row (ie: replace the NULL values in the Actual column of the respective row of the Budget // table so that you don't need to re-execute same set of HQLs to get the same data. return requiredActual; }
NOTE: UI will pass the start date and the current time (the time upto which the data will be collected to generate YTD values). Let the UI send currentDate as there can be some lag between the user pressing submit button and the backend doing calculations. So to be safe, let UI decide the date/time for YTD calculations Budget getYTD(Calendar startDate, Calendar currentDate) {Budget requiredYTD = new Budget(); ..... // NOTE: You need to execute some serious HQL statements here to get the data for each row of the YTD column // in the P&L report. // At present you can leave the calculations for these 'product_sales' field as we have not implemented item yet! return requiredYTD; } |