Gennovadc - Dialysis Plan vs Exec Tracker form changes 3
This commit is contained in:
parent
8677a2f554
commit
65957f9289
|
|
@ -1179,8 +1179,105 @@ $brandData2 = [
|
|||
$('label[for="execution-execution_week"]').html('<p class="form-label">Select Execution Week <span class="text-danger">*</span></p><p class="text-danger">*below total exe units & achv % will be calculated basis the week selected here</p>');
|
||||
$('label[for="execution-execution_product"]').html('<p class="form-label">Execution Product <span class="text-danger">*</span></p><p class="text-danger">*Pl enter exec/achv units for the week selected above;<br/> eg if week 3 is selected, enter achv/exec units for week 3 only; accordingly total units and percentage will get calculated</p>');
|
||||
|
||||
|
||||
function calculateExecution() {
|
||||
|
||||
let numOfWeek = $('#execution-execution_week').val();
|
||||
|
||||
if (!numOfWeek) return;
|
||||
|
||||
// Vintor 4K
|
||||
let v4kTotal =
|
||||
(parseInt($('#execution-vintor_4k_week1_exe').val()) || 0) +
|
||||
(parseInt($('#execution-vintor_4k_week2_exe').val()) || 0) +
|
||||
(parseInt($('#execution-vintor_4k_week3_exe').val()) || 0) +
|
||||
(parseInt($('#execution-vintor_4k_week4_exe').val()) || 0);
|
||||
|
||||
let v4kSelected = parseInt($('#execution-vintor_4k_week' + numOfWeek + '_exe').val()) || 0;
|
||||
let v4kPlan = parseInt($('#execution-vintor_4k_units').val()) || 0;
|
||||
|
||||
$('#execution-vintor_4k_units_execution').val(v4kTotal);
|
||||
$('#execution-vintor_4k_percent').val(
|
||||
v4kPlan ? ((v4kSelected / v4kPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Vintor 10K
|
||||
let v10kTotal =
|
||||
(parseInt($('#execution-vintor_10k_week1_exe').val()) || 0) +
|
||||
(parseInt($('#execution-vintor_10k_week2_exe').val()) || 0) +
|
||||
(parseInt($('#execution-vintor_10k_week3_exe').val()) || 0) +
|
||||
(parseInt($('#execution-vintor_10k_week4_exe').val()) || 0);
|
||||
|
||||
let v10kSelected = parseInt($('#execution-vintor_10k_week' + numOfWeek + '_exe').val()) || 0;
|
||||
let v10kPlan = parseInt($('#execution-vintor_10k_units').val()) || 0;
|
||||
|
||||
$('#execution-vintor_10k_units_execution').val(v10kTotal);
|
||||
$('#execution-vintor_10k_percent').val(
|
||||
v10kPlan ? ((v10kSelected / v10kPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Vintor 6K
|
||||
let v6kTotal =
|
||||
(parseInt($('#execution-vintor_6k_week1_exe').val()) || 0) +
|
||||
(parseInt($('#execution-vintor_6k_week2_exe').val()) || 0) +
|
||||
(parseInt($('#execution-vintor_6k_week3_exe').val()) || 0) +
|
||||
(parseInt($('#execution-vintor_6k_week4_exe').val()) || 0);
|
||||
|
||||
let v6kSelected = parseInt($('#execution-vintor_6k_week' + numOfWeek + '_exe').val()) || 0;
|
||||
let v6kPlan = parseInt($('#execution-vintor_6k_units').val()) || 0;
|
||||
|
||||
$('#execution-vintor_6k_units_execution').val(v6kTotal);
|
||||
$('#execution-vintor_6k_percent').val(
|
||||
v6kPlan ? ((v6kSelected / v6kPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Encicarb 500
|
||||
let e500Total =
|
||||
(parseInt($('#execution-encicarb_500_week1_exe').val()) || 0) +
|
||||
(parseInt($('#execution-encicarb_500_week2_exe').val()) || 0) +
|
||||
(parseInt($('#execution-encicarb_500_week3_exe').val()) || 0) +
|
||||
(parseInt($('#execution-encicarb_500_week4_exe').val()) || 0);
|
||||
|
||||
let e500Selected = parseInt($('#execution-encicarb_500_week' + numOfWeek + '_exe').val()) || 0;
|
||||
let e500Plan = parseInt($('#execution-encicarb_500_units').val()) || 0;
|
||||
|
||||
$('#execution-encicarb_500_units_execution').val(e500Total);
|
||||
$('#execution-encicarb_500_percent').val(
|
||||
e500Plan ? ((e500Selected / e500Plan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Encicarb 100
|
||||
let e100Total =
|
||||
(parseInt($('#execution-encicarb_100_week1_exe').val()) || 0) +
|
||||
(parseInt($('#execution-encicarb_100_week2_exe').val()) || 0) +
|
||||
(parseInt($('#execution-encicarb_100_week3_exe').val()) || 0) +
|
||||
(parseInt($('#execution-encicarb_100_week4_exe').val()) || 0);
|
||||
|
||||
let e100Selected = parseInt($('#execution-encicarb_100_week' + numOfWeek + '_exe').val()) || 0;
|
||||
let e100Plan = parseInt($('#execution-encicarb_100_units').val()) || 0;
|
||||
|
||||
$('#execution-encicarb_100_units_execution').val(e100Total);
|
||||
$('#execution-encicarb_100_percent').val(
|
||||
e100Plan ? ((e100Selected / e100Plan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Dynulta
|
||||
let dynTotal =
|
||||
(parseInt($('#execution-dynulta_week1_exe').val()) || 0) +
|
||||
(parseInt($('#execution-dynulta_week2_exe').val()) || 0) +
|
||||
(parseInt($('#execution-dynulta_week3_exe').val()) || 0) +
|
||||
(parseInt($('#execution-dynulta_week4_exe').val()) || 0);
|
||||
|
||||
let dynSelected = parseInt($('#execution-dynulta_week' + numOfWeek + '_exe').val()) || 0;
|
||||
let dynPlan = parseInt($('#execution-dynulta_units').val()) || 0;
|
||||
|
||||
$('#execution-dynulta_units_execution').val(dynTotal);
|
||||
$('#execution-dynulta_percent').val(
|
||||
dynPlan ? ((dynSelected / dynPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
}
|
||||
/*function calculateExecution() {
|
||||
|
||||
let numOfWeek = $('#execution-execution_week').val();
|
||||
|
||||
if(!numOfWeek) return;
|
||||
|
|
@ -1239,7 +1336,7 @@ $brandData2 = [
|
|||
$('#execution-dynulta_percent').val(
|
||||
dynPlan ? ((dyn / dynPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
// Auto calculate while typing
|
||||
|
|
|
|||
Loading…
Reference in New Issue