Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/track support staff appointment percentage #1697

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<!-- TA Count -->
<td class="course-costs__table-cell">
<div class="budget-costs__label">
TAs
TAs (Appointment)
</div>
<div class="course-costs__edit-container">
<div ng-show="!isLiveDataScenario" class="course-costs__number-input">
Expand All @@ -82,6 +82,9 @@
<div ng-show="isLiveDataScenario">
{{ sectionGroupCost.taCount || 0 }}
</div>
<div class="budget-costs__label">
&nbsp;({{ sectionGroupCost.sectionGroup.taAppointmentPercentage || '50'}}%)
</div>
</div>
</td>
<!-- TA Cost -->
Expand All @@ -96,7 +99,7 @@
<!-- Reader Count -->
<td class="course-costs__table-cell">
<div class="budget-costs__label">
Readers
Readers (Appointment)
</div>
<div class="course-costs__edit-container">
<div ng-show="!isLiveDataScenario" class="course-costs__number-input">
Expand All @@ -117,6 +120,9 @@
<div ng-show="isLiveDataScenario">
{{ sectionGroupCost.readerCount || 0 }}
</div>
<div class="budget-costs__label">
&nbsp;({{ sectionGroupCost.sectionGroup.readerAppointmentPercentage || '25'}}%)
</div>
</div>
</td>
<!-- Reader Cost -->
Expand Down
4 changes: 2 additions & 2 deletions app/budget/directives/instructorList/instructorList.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
<tr>
<td>
<div class="instructor-list__cell-container instructor-list__cell-container--left">
TA
TA (50% Appointment)
</div>
</td>
<td>
Expand All @@ -106,7 +106,7 @@
<tr>
<td>
<div class="instructor-list__cell-container instructor-list__cell-container--left">
Reader
Reader (25% Appointment)
</div>
</td>
<td>
Expand Down
7 changes: 5 additions & 2 deletions app/budget/services/actions/scheduleCostCalculations.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,12 @@ class ScheduleCostCalculations {
_calculateSectionGroupFinancialCosts: function(sectionGroupCost) {
var budget = BudgetReducers._state.budget;

var readerApptAdjustment = sectionGroupCost.sectionGroup.readerAppointmentPercentage ? sectionGroupCost.sectionGroup.readerAppointmentPercentage / 25 : 1;
var taApptAdjustment = sectionGroupCost.sectionGroup.taAppointmentPercentage ? sectionGroupCost.sectionGroup.taAppointmentPercentage / 50 : 1;

// Support Costs
sectionGroupCost.readerCost = sectionGroupCost.readerCount > 0 ? sectionGroupCost.readerCount * budget.readerCost : 0;
sectionGroupCost.taCost = sectionGroupCost.taCount > 0 ? sectionGroupCost.taCount * budget.taCost : 0;
sectionGroupCost.readerCost = sectionGroupCost.readerCount > 0 ? sectionGroupCost.readerCount * budget.readerCost * readerApptAdjustment : 0;
sectionGroupCost.taCost = sectionGroupCost.taCount > 0 ? sectionGroupCost.taCount * budget.taCost * taApptAdjustment : 0;

sectionGroupCost.courseCostSubTotal = sectionGroupCost.taCost + sectionGroupCost.readerCost;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,21 @@ class BudgetComparisonReportCalculations {
};

sectionGroupCosts.ids.forEach(function(sectionGroupCostId) {
var sectionGroupCost = sectionGroupCosts.list[sectionGroupCostId];
var sectionGroupCost = sectionGroupCosts.list[sectionGroupCostId];

// TA default is 50, reader default is 25
var taApptAdjustment = sectionGroupCost.taAppointmentPercentage ? (sectionGroupCost.taAppointmentPercentage / 50) : 1;
var readerApptAdjustment = sectionGroupCost.readerAppointmentPercentage ? (sectionGroupCost.readerAppointmentPercentage / 25) : 1;

if (sectionGroupCost.budgetScenarioId != selectedScenarioId || sectionGroupCost.disabled) { return; }
if (activeTerms.indexOf(sectionGroupCost.termCode.slice(-2)) == -1) { return; }

supportCosts.taCount += sectionGroupCost.taCount || 0;
supportCosts.readerCount += sectionGroupCost.readerCount || 0;
});
supportCosts.readerCount += sectionGroupCost.readerCount || 0;

supportCosts.taCost = supportCosts.taCount * budget.taCost;
supportCosts.readerCost = supportCosts.readerCount * budget.readerCost;
supportCosts.taCost += sectionGroupCost.taCount * budget.taCost * taApptAdjustment;
supportCosts.readerCost += sectionGroupCost.readerCount * budget.readerCost * readerApptAdjustment;
});

supportCosts.totalCount += supportCosts.taCount + supportCosts.readerCount;
supportCosts.totalCost += supportCosts.taCost + supportCosts.readerCost;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,54 +1,87 @@
<div class="course-header">
<div class="course-header__name">
{{ sectionGroup.subjectCode }} {{ sectionGroup.courseNumber }} {{ sectionGroup.sequencePattern }} {{ sectionGroup.title }}
</div>
<div class="course-header__name">
{{ sectionGroup.subjectCode }} {{ sectionGroup.courseNumber }}
{{ sectionGroup.sequencePattern }} {{ sectionGroup.title }}
</div>

<table>
<tbody>
<tr>
<td class="course-header__cell">
<div>
TAs
</div>
</td>
<td class="course-header__cell">
<course-appointment-input
section-group="sectionGroup"
view-type="'Teaching Assistants'"
read-only="readOnly">
</course-appointment-input>
</td>
</tr>
<tr>
<td class="course-header__cell">
<div>
Readers
</div>
</td>
<td class="course-header__cell">
<course-appointment-input
section-group="sectionGroup"
view-type="'Readers'"
read-only="readOnly">
</course-appointment-input>
</td>
</tr>
<tr>
<td class="course-header__cell">
Seats
</td>
<td class="course-header__cell course-header__cell--push-right">
{{ sectionGroup.plannedSeats }}
</td>
</tr>
<tr>
<td class="course-header__cell">
Units
</td>
<td class="course-header__cell course-header__cell--push-right">
{{ sectionGroup.units }}
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<td class="course-header__cell">
<div>
TAs
</div>
</td>
<td class="course-header__cell">
<course-appointment-input
section-group="sectionGroup"
view-type="'Teaching Assistants'"
read-only="readOnly"
>
</course-appointment-input>
</td>
<td>
<div>Appt %</div>
</td>
<td>
<div class="course-appointment-input">
<ipa-input
on-update="updateTeachingAssistantAppointments(sectionGroup)"
value="sectionGroup.taAppointmentPercentage"
mode="'number'"
place-holder="'50'"
uib-tooltip="Default value is 50%"
>
</ipa-input>
</div>
</td>
</tr>
<tr>
<td class="course-header__cell">
<div>
Readers
</div>
</td>
<td class="course-header__cell">
<course-appointment-input
section-group="sectionGroup"
view-type="'Readers'"
read-only="readOnly"
>
</course-appointment-input>
</td>
<td>
<div>Appt %</div>
</td>
<td>
<div class="course-appointment-input">
<ipa-input
on-update="updateReaderAppointments(sectionGroup)"
value="sectionGroup.readerAppointmentPercentage"
mode="'number'"
place-holder="'25'"
uib-tooltip="Default value is 25%"
>
</ipa-input>
</div>
</td>
</tr>
<tr>
<td class="course-header__cell">
Seats
</td>
<td class="course-header__cell course-header__cell--push-right">
{{ sectionGroup.plannedSeats }}
</td>
</tr>
<tr>
<td class="course-header__cell">
Units
</td>
<td class="course-header__cell course-header__cell--push-right">
{{ sectionGroup.units }}
</td>
</tr>
</tbody>
</table>
</div>
9 changes: 5 additions & 4 deletions app/supportAssignment/services/supportActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class SupportActions {
plannedSeats: sectionGroupDTO.plannedSeats,
teachingAssistantAppointments: sectionGroupDTO.teachingAssistantAppointments,
readerAppointments: sectionGroupDTO.readerAppointments,
taAppointmentPercentage: parseInt(sectionGroupDTO.taAppointmentPercentage),
readerAppointmentPercentage: parseInt(sectionGroupDTO.readerAppointmentPercentage),
showTheStaff: sectionGroupDTO.showTheStaff,
showPlaceholderAI: sectionGroupDTO.showPlaceholderAI
};
Expand All @@ -128,13 +130,12 @@ class SupportActions {
plannedSeats: sectionGroupDTO.plannedSeats,
teachingAssistantAppointments: sectionGroupDTO.teachingAssistantAppointments,
readerAppointments: sectionGroupDTO.readerAppointments,
taAppointmentPercentage: parseInt(sectionGroupDTO.taAppointmentPercentage),
readerAppointmentPercentage: parseInt(sectionGroupDTO.readerAppointmentPercentage),
showTheStaff: sectionGroupDTO.showTheStaff,
showPlaceholderAI: sectionGroupDTO.showPlaceholderAI
};

sectionGroup.teachingAssistantAppointments = sectionGroupDTO.teachingAssistantAppointments;



SupportService.updateSectionGroup(sectionGroup).then(function() {
$rootScope.$emit('toast', { message: "Updated Teaching Assistants", type: "SUCCESS" });
SupportReducer.reduce({
Expand Down