diff --git a/PROFIT_SHARE_CALCULATOR/app/routes/application.js b/PROFIT_SHARE_CALCULATOR/app/routes/application.js index ec7328fe..a8349eb3 100644 --- a/PROFIT_SHARE_CALCULATOR/app/routes/application.js +++ b/PROFIT_SHARE_CALCULATOR/app/routes/application.js @@ -18,7 +18,13 @@ export default Route.extend({ desiredPayrollBufferMonths: item.desired_buffer_months, income: item.gross_revenue, expenses: item.gross_expenses, + benefits: item.gross_benefits, + subcontractors: item.subcontractors, + preSpent: item.pre_spent, + preSpentReinvestment: item.pre_spent_reinvestment, actualLaborCost: item.gross_payroll, + // This isn't a true equivalency: projected_monthly_cost_of_doing_business takes + // more than just payroll into account projectedLaborCost: item.projected_monthly_cost_of_doing_business, actualTotalPSUIssued: item.total_psu_issued, ficaPercentage: item.fica_tax_rate, diff --git a/PROFIT_SHARE_CALCULATOR/app/services/studio.js b/PROFIT_SHARE_CALCULATOR/app/services/studio.js index ae512416..d6ff57e8 100644 --- a/PROFIT_SHARE_CALCULATOR/app/services/studio.js +++ b/PROFIT_SHARE_CALCULATOR/app/services/studio.js @@ -29,6 +29,10 @@ export default Service.extend( actualLaborCost: 0, projectedLaborCost: 0, actualTotalPSUIssued: 0, + benefits: 0, + subcontractors: 0, + preSpent: 0, + preSpentReinvestment: 0, reset() { this.setProperties({ @@ -47,8 +51,13 @@ export default Service.extend( }); }, + // def raw_efficiency + // @actuals[:gross_revenue].to_f / total_cost_of_doing_business + // end /* Computed Properties */ rawEfficiency: computed('income', 'laborCost', 'expenses', function() { + if (get(this, 'mode') === Modes.REAL) return get(this, 'income') / (get(this, 'totalCostOfDoingBusiness')); + return get(this, 'income') / (get(this, 'laborCost') + get(this, 'expenses')); }).readOnly(), @@ -136,22 +145,39 @@ export default Service.extend( }; }).readOnly(), + // TODO: rename me to reflect more than labor laborCost: computed('technologists.@each.salary', 'mode', 'actualLaborCost', function() { /* The Labor Cost attribute is concerned with determining the years - * effeciency, so in Modes.REAL we use the "actuaLaborCost" for that + * efficiency, so in Modes.REAL we use the "actualLaborCost" for that * year, rather than a computed projection, as the team may have changed * substantially that year. */ - if (get(this, 'mode') === Modes.REAL) return get(this, 'actualLaborCost'); + if (get(this, 'mode') === Modes.REAL) return get(this, 'totalCostOfDoingBusiness'); + /* Modes.MOCK doesn't take anything other than payroll into account for cost*/ return get(this, 'technologists').reduce((a, tech) => a + get(tech, 'laborCostThisYear'), 0); }).readOnly(), + // def total_cost_of_doing_business + // @actuals[:gross_payroll].to_f + + // @actuals[:gross_expenses].to_f + + // @actuals[:gross_benefits].to_f + + // @actuals[:gross_subcontractors].to_f - + // @pre_spent - # Don't count prespent profit share against this + // @pre_spent_reinvestment # Don't count prespent reinvestment against this + // end + /* Total cost of doing business */ + totalCostOfDoingBusiness: computed('actuallaborCost', 'expenses', 'benefits', 'subcontractors', 'preSpent', 'preSpentReinvestment', function() { + return get(this, 'actualLaborCost') + get(this, 'expenses') + get(this, 'benefits') + get(this, 'subcontractors') - get(this, 'preSpent') - get(this, 'preSpentReinvestment'); + }).readOnly(), + monthlyLaborCost: computed('laborCost', 'mode', 'projectedLaborCost', function() { /* Monthly Labor Cost is concerned with Generating Payroll buffer, * so in Modes.REAL we use the most "up to date" projection for * salary costing, rather than actualLaborCost. */ + // This is really projected_monthly_cost_of_doing_business in Stacks, which takes + // more than labor into account if (get(this, 'mode') === Modes.REAL) return (get(this, 'projectedLaborCost') / 12); return get(this, 'laborCost') / 12; }).readOnly(), diff --git a/PROFIT_SHARE_CALCULATOR/app/templates/components/metrics-drawer.hbs b/PROFIT_SHARE_CALCULATOR/app/templates/components/metrics-drawer.hbs index 09e7b288..da3ebc88 100644 --- a/PROFIT_SHARE_CALCULATOR/app/templates/components/metrics-drawer.hbs +++ b/PROFIT_SHARE_CALCULATOR/app/templates/components/metrics-drawer.hbs @@ -50,7 +50,37 @@ Total PSU Issued (Computed) {{input value=studio.totalPSUIssued disabled=true}} -{{else}} +{{/if}} +{{#if (eq studio.mode studio.Modes.REAL)}} + + + + +{{/if}} -{{/if}}