GennovsDC Changes
This commit is contained in:
parent
73b4c390dd
commit
e587732ab4
|
|
@ -21,6 +21,8 @@ $brandData = [
|
|||
|
||||
['brand'=>'Vintor 4K', 'slug'=>'vintor_4k_units','pseudoId'=>'vintor_4k_week1','pseudoId2'=>'vintor_4k_week2','pseudoId3'=>'vintor_4k_week3','pseudoId4'=>'vintor_4k_week4'],
|
||||
['brand'=>'Vintor 10K', 'slug'=>'vintor_10k_units','pseudoId'=>'vintor_10k_week1','pseudoId2'=>'vintor_10k_week2','pseudoId3'=>'vintor_10k_week3','pseudoId4'=>'vintor_10k_week4'],
|
||||
['brand'=>'Vintor 6K', 'slug'=>'vintor_6k_units','pseudoId'=>'vintor_6k_week1','pseudoId2'=>'vintor_6k_week2','pseudoId3'=>'vintor_6k_week3','pseudoId4'=>'vintor_6k_week4'],
|
||||
|
||||
['brand'=>'Encicarb 500', 'slug'=>'encicarb_500_units','pseudoId'=>'encicarb_500_week1','pseudoId2'=>'encicarb_500_week2','pseudoId3'=>'encicarb_500_week3','pseudoId4'=>'encicarb_500_week4'],
|
||||
['brand'=>'Encicarb 100', 'slug'=>'encicarb_100_units','pseudoId'=>'encicarb_100_week1','pseudoId2'=>'encicarb_100_week2','pseudoId3'=>'encicarb_100_week3','pseudoId4'=>'encicarb_100_week4'],
|
||||
// ['brand'=>'Epofer 4K', 'slug'=>'epofer_4k_units','pseudoId'=>'epofer_4k_week1','pseudoId2'=>'epofer_4k_week2','pseudoId3'=>'epofer_4k_week3','pseudoId4'=>'epofer_4k_week4'],
|
||||
|
|
@ -32,6 +34,8 @@ $brandData2 = [
|
|||
|
||||
['brand'=>'Vintor 4K', 'slug'=>'vintor_4k_units_execution','pseudoId'=>'vintor_4k_week1_exe','pseudoId2'=>'vintor_4k_week2_exe','pseudoId3'=>'vintor_4k_week3_exe','pseudoId4'=>'vintor_4k_week4_exe','pseudoId5'=>'vintor_4k_percent'],
|
||||
['brand'=>'Vintor 10K', 'slug'=>'vintor_10k_units_execution','pseudoId'=>'vintor_10k_week1_exe','pseudoId2'=>'vintor_10k_week2_exe','pseudoId3'=>'vintor_10k_week3_exe','pseudoId4'=>'vintor_10k_week4_exe','pseudoId5'=>'vintor_10k_percent'],
|
||||
['brand'=>'Vintor 6K', 'slug'=>'vintor_6k_units_execution','pseudoId'=>'vintor_6k_week1_exe','pseudoId2'=>'vintor_6k_week2_exe','pseudoId3'=>'vintor_6k_week3_exe','pseudoId4'=>'vintor_6k_week4_exe','pseudoId5'=>'vintor_6k_percent'],
|
||||
|
||||
['brand'=>'Encicarb 500', 'slug'=>'encicarb_500_units_execution','pseudoId'=>'encicarb_500_week1_exe','pseudoId2'=>'encicarb_500_week2_exe','pseudoId3'=>'encicarb_500_week3_exe','pseudoId4'=>'encicarb_500_week4_exe','pseudoId5'=>'encicarb_500_percent'],
|
||||
['brand'=>'Encicarb 100', 'slug'=>'encicarb_100_units_execution','pseudoId'=>'encicarb_100_week1_exe','pseudoId2'=>'encicarb_100_week2_exe','pseudoId3'=>'encicarb_100_week3_exe','pseudoId4'=>'encicarb_100_week4_exe','pseudoId5'=>'encicarb_100_percent'],
|
||||
// ['brand'=>'Epofer 4K', 'slug'=>'epofer_4k_units_execution','pseudoId'=>'epofer_4k_week1_exe','pseudoId2'=>'epofer_4k_week2_exe','pseudoId3'=>'epofer_4k_week3_exe','pseudoId4'=>'epofer_4k_week4_exe','pseudoId5'=>'epofer_4k_percent'],
|
||||
|
|
@ -102,6 +106,7 @@ $brandData2 = [
|
|||
<th>Plan Week</th>
|
||||
<th>Vintor 4K Month Plan Units</th>
|
||||
<th>Vintor 10K Month Plan Units</th>
|
||||
<th>Vintor 6K Month Plan Units</th>
|
||||
<th>Encicarb 500 Month Plan Units</th>
|
||||
<th>Encicarb 100 Month Plan Units</th>
|
||||
<th>Dynulta Month Plan Units</th>
|
||||
|
|
@ -109,30 +114,35 @@ $brandData2 = [
|
|||
|
||||
<th>Vintor 4K Week 1 planned units</th>
|
||||
<th>Vintor 10K Week 1 planned units</th>
|
||||
<th>Vintor 6K Week 1 planned units</th>
|
||||
<th>Encicarb 500 Week 1 planned units</th>
|
||||
<th>Encicarb 100 Week 1 planned units</th>
|
||||
<th>Dynulta Week 1 planned units</th>
|
||||
|
||||
<th>Vintor 4K Week 2 planned units</th>
|
||||
<th>Vintor 10K Week 2 planned units</th>
|
||||
<th>Vintor 6K Week 2 planned units</th>
|
||||
<th>Encicarb 500 Week 2 planned units</th>
|
||||
<th>Encicarb 100 Week 2 planned units</th>
|
||||
<th>Dynulta Week 2 planned units</th>
|
||||
|
||||
<th>Vintor 4K Week 3 planned units</th>
|
||||
<th>Vintor 10K Week 3 planned units</th>
|
||||
<th>Vintor 6K Week 3 planned units</th>
|
||||
<th>Encicarb 500 Week 3 planned units</th>
|
||||
<th>Encicarb 100 Week 3 planned units</th>
|
||||
<th>Dynulta Week 3 planned units</th>
|
||||
|
||||
<th>Vintor 4K Week 4 planned units</th>
|
||||
<th>Vintor 10K Week 4 planned units</th>
|
||||
<th>Vintor 6K Week 4 planned units</th>
|
||||
<th>Encicarb 500 Week 4 planned units</th>
|
||||
<th>Encicarb 100 Week 4 planned units</th>
|
||||
<th>Dynulta Week 4 planned units</th>
|
||||
|
||||
<th>Vintor 4K Total Executed units</th>
|
||||
<th>Vintor 10K Total Executed units</th>
|
||||
<th>Vintor 6K Total Executed units</th>
|
||||
<th>Encicarb 500 Total Executed units</th>
|
||||
<th>Encicarb 100 Total Executed units</th>
|
||||
<th>Dynulta Total Executed units</th>
|
||||
|
|
@ -140,30 +150,35 @@ $brandData2 = [
|
|||
|
||||
<th>Vintor 4K Percentage Achievement</th>
|
||||
<th>Vintor 10K Percentage Achievement</th>
|
||||
<th>Vintor 6K Percentage Achievement</th>
|
||||
<th>Encicarb 500 Percentage Achievement</th>
|
||||
<th>Encicarb 100 Percentage Achievement</th>
|
||||
<th>Dynulta Percentage Achievement</th>
|
||||
|
||||
<th>Vintor 4K Week 1 Execution units</th>
|
||||
<th>Vintor 10K Week 1 Execution units</th>
|
||||
<th>Vintor 6K Week 1 Execution units</th>
|
||||
<th>Encicarb 500 Week 1 Execution units</th>
|
||||
<th>Encicarb 100 Week 1 Execution units</th>
|
||||
<th>Dynulta Week 1 Execution units</th>
|
||||
|
||||
<th>Vintor 4K Week 2 Execution units</th>
|
||||
<th>Vintor 10K Week 2 Execution units</th>
|
||||
<th>Vintor 6K Week 2 Execution units</th>
|
||||
<th>Encicarb 500 Week 2 Execution units</th>
|
||||
<th>Encicarb 100 Week 2 Execution units</th>
|
||||
<th>Dynulta Week 2 Execution units</th>
|
||||
|
||||
<th>Vintor 4K Week 3 Execution units</th>
|
||||
<th>Vintor 10K Week 3 Execution units</th>
|
||||
<th>Vintor 6K Week 3 Execution units</th>
|
||||
<th>Encicarb 500 Week 3 Execution units</th>
|
||||
<th>Encicarb 100 Week 3 Execution units</th>
|
||||
<th>Dynulta Week 3 Execution units</th>
|
||||
|
||||
<th>Vintor 4K Week 4 Execution units</th>
|
||||
<th>Vintor 10K Week 4 Execution units</th>
|
||||
<th>Vintor 6K Week 4 Execution units</th>
|
||||
<th>Encicarb 500 Week 4 Execution units</th>
|
||||
<th>Encicarb 100 Week 4 Execution units</th>
|
||||
<th>Dynulta Week 4 Execution units</th>
|
||||
|
|
@ -220,6 +235,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_units) ? $sub->formdata->vintor_10k_units: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_units) ? $sub->formdata->vintor_6k_units: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_units) ? $sub->formdata->encicarb_500_units: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_units) ? $sub->formdata->encicarb_100_units: ''}}
|
||||
|
|
@ -232,6 +249,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_week1) ? (int)$sub->formdata->vintor_10k_week1: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_week1) ? (int)$sub->formdata->vintor_6k_week1: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_week1) ? (int)$sub->formdata->encicarb_500_week1: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_week1) ? (int)$sub->formdata->encicarb_100_week1: ''}}
|
||||
|
|
@ -244,6 +263,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_week2) ? (int)$sub->formdata->vintor_10k_week2: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_week2) ? (int)$sub->formdata->vintor_6k_week2: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_week2) ? (int)$sub->formdata->encicarb_500_week2: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_week2) ? (int)$sub->formdata->encicarb_100_week1: ''}}
|
||||
|
|
@ -257,6 +278,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_week3) ? (int)$sub->formdata->vintor_10k_week3: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_week3) ? (int)$sub->formdata->vintor_6k_week3: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_week3) ? (int)$sub->formdata->encicarb_500_week3: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_week3) ? (int)$sub->formdata->encicarb_100_week3: ''}}
|
||||
|
|
@ -269,6 +292,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_week4) ? (int)$sub->formdata->vintor_10k_week4: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_week4) ? (int)$sub->formdata->vintor_6k_week4: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_week4) ? (int)$sub->formdata->encicarb_500_week4: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_week4) ? (int)$sub->formdata->encicarb_100_week4: ''}}
|
||||
|
|
@ -282,6 +307,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_units_execution) ? $sub->formdata->vintor_10k_units_execution: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_units_execution) ? $sub->formdata->vintor_6k_units_execution: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_units_execution) ? $sub->formdata->encicarb_500_units_execution: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_units_execution) ? $sub->formdata->encicarb_100_units_execution: ''}}
|
||||
|
|
@ -294,6 +321,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_percent) ? $sub->formdata->vintor_10k_percent: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_percent) ? $sub->formdata->vintor_6k_percent: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_percent) ? $sub->formdata->encicarb_500_percent: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_percent) ? $sub->formdata->encicarb_100_percent: ''}}
|
||||
|
|
@ -307,6 +336,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_week1_exe) ? $sub->formdata->vintor_10k_week1_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_week1_exe) ? $sub->formdata->vintor_6k_week1_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_week1_exe) ? $sub->formdata->encicarb_500_week1_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_week1_exe) ? $sub->formdata->encicarb_100_week1_exe: ''}}
|
||||
|
|
@ -319,6 +350,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_week2_exe) ? $sub->formdata->vintor_10k_week2_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_week2_exe) ? $sub->formdata->vintor_6k_week2_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_week2_exe) ? $sub->formdata->encicarb_500_week2_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_week2_exe) ? $sub->formdata->encicarb_100_week2_exe: ''}}
|
||||
|
|
@ -331,6 +364,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_week3_exe) ? $sub->formdata->vintor_10k_week3_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_week3_exe) ? $sub->formdata->vintor_6k_week3_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_week3_exe) ? $sub->formdata->encicarb_500_week3_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_week3_exe) ? $sub->formdata->encicarb_100_week3_exe: ''}}
|
||||
|
|
@ -343,6 +378,8 @@ $brandData2 = [
|
|||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_10k_week4_exe) ? $sub->formdata->vintor_10k_week4_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->vintor_6k_week4_exe) ? $sub->formdata->vintor_6k_week4_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_500_week4_exe) ? $sub->formdata->encicarb_500_week4_exe: ''}}
|
||||
</td>
|
||||
<td>{{isset($sub->formdata->encicarb_100_week4_exe) ? $sub->formdata->encicarb_100_week4_exe: ''}}
|
||||
|
|
@ -1137,76 +1174,86 @@ $brandData2 = [
|
|||
|
||||
function calculateExecution() {
|
||||
|
||||
let numOfWeek = $('#execution-execution_week').val();
|
||||
let numOfWeek = $('#execution-execution_week').val();
|
||||
|
||||
if(!numOfWeek) return;
|
||||
if(!numOfWeek) return;
|
||||
|
||||
// Vintor 4K
|
||||
let v4k = parseInt($('#execution-vintor_4k_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let v4kPlan = parseInt($('#execution-vintor_4k_units').val()) || 0;
|
||||
// Vintor 4K
|
||||
let v4k = parseInt($('#execution-vintor_4k_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let v4kPlan = parseInt($('#execution-vintor_4k_units').val()) || 0;
|
||||
|
||||
$('#execution-vintor_4k_units_execution').val(v4k);
|
||||
$('#execution-vintor_4k_percent').val(
|
||||
v4kPlan ? ((v4k / v4kPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
$('#execution-vintor_4k_units_execution').val(v4k);
|
||||
$('#execution-vintor_4k_percent').val(
|
||||
v4kPlan ? ((v4k / v4kPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Vintor 10K
|
||||
let v10k = parseInt($('#execution-vintor_10k_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let v10kPlan = parseInt($('#execution-vintor_10k_units').val()) || 0;
|
||||
// Vintor 10K
|
||||
let v10k = parseInt($('#execution-vintor_10k_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let v10kPlan = parseInt($('#execution-vintor_10k_units').val()) || 0;
|
||||
|
||||
$('#execution-vintor_10k_units_execution').val(v10k);
|
||||
$('#execution-vintor_10k_percent').val(
|
||||
v10kPlan ? ((v10k / v10kPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Encicarb 500
|
||||
let e500 = parseInt($('#execution-encicarb_500_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let e500Plan = parseInt($('#execution-encicarb_500_units').val()) || 0;
|
||||
|
||||
$('#execution-encicarb_500_units_execution').val(e500);
|
||||
$('#execution-encicarb_500_percent').val(
|
||||
e500Plan ? ((e500 / e500Plan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Encicarb 100
|
||||
let e100 = parseInt($('#execution-encicarb_100_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let e100Plan = parseInt($('#execution-encicarb_100_units').val()) || 0;
|
||||
|
||||
$('#execution-encicarb_100_units_execution').val(e100);
|
||||
$('#execution-encicarb_100_percent').val(
|
||||
e100Plan ? ((e100 / e100Plan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Dynulta
|
||||
let dyn = parseInt($('#execution-dynulta_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let dynPlan = parseInt($('#execution-dynulta_units').val()) || 0;
|
||||
|
||||
$('#execution-dynulta_units_execution').val(dyn);
|
||||
$('#execution-dynulta_percent').val(
|
||||
dynPlan ? ((dyn / dynPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
}
|
||||
$('#execution-vintor_10k_units_execution').val(v10k);
|
||||
$('#execution-vintor_10k_percent').val(
|
||||
v10kPlan ? ((v10k / v10kPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
|
||||
// Auto calculate while typing
|
||||
$('[id*="_exe"]').on('keyup change', function () {
|
||||
calculateExecution();
|
||||
});
|
||||
// Vintor 6K
|
||||
let v6k = parseInt($('#execution-vintor_6k_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let v6kPlan = parseInt($('#execution-vintor_6k_units').val()) || 0;
|
||||
|
||||
$('#execution-vintor_6k_units_execution').val(v6k);
|
||||
$('#execution-vintor_6k_percent').val(
|
||||
v6kPlan ? ((v6k / v6kPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Encicarb 500
|
||||
let e500 = parseInt($('#execution-encicarb_500_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let e500Plan = parseInt($('#execution-encicarb_500_units').val()) || 0;
|
||||
|
||||
$('#execution-encicarb_500_units_execution').val(e500);
|
||||
$('#execution-encicarb_500_percent').val(
|
||||
e500Plan ? ((e500 / e500Plan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Encicarb 100
|
||||
let e100 = parseInt($('#execution-encicarb_100_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let e100Plan = parseInt($('#execution-encicarb_100_units').val()) || 0;
|
||||
|
||||
$('#execution-encicarb_100_units_execution').val(e100);
|
||||
$('#execution-encicarb_100_percent').val(
|
||||
e100Plan ? ((e100 / e100Plan) * 100).toFixed(2) : 0
|
||||
);
|
||||
|
||||
// Dynulta
|
||||
let dyn = parseInt($('#execution-dynulta_week'+numOfWeek+'_exe').val()) || 0;
|
||||
let dynPlan = parseInt($('#execution-dynulta_units').val()) || 0;
|
||||
|
||||
$('#execution-dynulta_units_execution').val(dyn);
|
||||
$('#execution-dynulta_percent').val(
|
||||
dynPlan ? ((dyn / dynPlan) * 100).toFixed(2) : 0
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Week change readonly logic
|
||||
$('#execution-execution_week').on('change', function () {
|
||||
// Auto calculate while typing
|
||||
$('[id*="_exe"]').on('keyup change', function () {
|
||||
calculateExecution();
|
||||
});
|
||||
|
||||
let selectedWeek = $(this).val();
|
||||
|
||||
$('[id*="_week"][id*="_exe"]').prop('readonly', true);
|
||||
// Week change readonly logic
|
||||
$('#execution-execution_week').on('change', function () {
|
||||
|
||||
if (selectedWeek) {
|
||||
$(`[id*="_week${selectedWeek}_exe"]`).prop('readonly', false);
|
||||
}
|
||||
let selectedWeek = $(this).val();
|
||||
|
||||
calculateExecution();
|
||||
});
|
||||
$('[id*="_week"][id*="_exe"]').prop('readonly', true);
|
||||
|
||||
if (selectedWeek) {
|
||||
$(`[id*="_week${selectedWeek}_exe"]`).prop('readonly', false);
|
||||
}
|
||||
|
||||
calculateExecution();
|
||||
});
|
||||
// $('#execution-execution_week').on('change',function(){
|
||||
// let numOfWeek=$('#execution-execution_week').val();
|
||||
// console.log("Number of Week : ",numOfWeek);
|
||||
|
|
|
|||
Loading…
Reference in New Issue