Team 2 (Report Smartian POB)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 40s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 40s
Details
This commit is contained in:
parent
c6d800f309
commit
0f8833a6b8
|
|
@ -620,64 +620,90 @@ if (!empty($submissions->data->submissions)) {
|
|||
})*/
|
||||
|
||||
const pobConfig = [
|
||||
{ unit: 'breathe_o_meter_pob_units', val: 'breathe_o_meter_pob_value', price: 426 },
|
||||
{ unit: 'new_revolizer_pob_units', val: 'new_revolizer_pob_value', price: 255 },
|
||||
{ unit: 'tiova_inhaler_with_d_pob_units', val: 'tiova_inhaler_with_d_pob_value', price: 408 },
|
||||
{ unit: 'foracort_100_rotacap_pob_units', val: 'foracort_100_rotacap_pob_value', price: 95 },
|
||||
{ unit: 'foracort_200_cfc_wit_pob_units', val: 'foracort_200_cfc_wit_pob_value', price: 260 },
|
||||
{ unit: 'foracort_200_rotacap_pob_units', val: 'foracort_200_rotacap_pob_value', price: 126 },
|
||||
{ unit: 'foracort_400_cfc_wit_pob_units', val: 'foracort_400_cfc_wit_pob_value', price: 296 },
|
||||
{ unit: 'foracort_400_rotacap_pob_units', val: 'foracort_400_rotacap_pob_value', price: 153 },
|
||||
{ unit: 'foracort_forte_inh_w_pob_units', val: 'foracort_forte_inh_w_pob_value', price: 606 },
|
||||
{ unit: 'foracort_forte_rc_3_pob_units', val: 'foracort_forte_rc_3_pob_value', price: 361 },
|
||||
{ unit: 'niveoli_inhaler_120_metered_dose_pob_units', val: 'niveoli_inhaler_120_metered_dose_pob_value', price: 185 },
|
||||
{ unit: 'foracort_200_synchrobreathe_pob_units', val: 'foracort_200_synchrobreathe_pob_value', price: 321 },
|
||||
{ unit: 'foracort_400_synchrobreathe_pob_units', val: 'foracort_400_synchrobreathe_pob_value', price: 357 },
|
||||
{ unit: 'tiova_rotacaps_30_capsules_pob_units', val: 'tiova_rotacaps_30_capsules_pob_value', price: 235 },
|
||||
{ unit: 'tiova_synchrobreathe_9_mcg_120_md_pob_units', val: 'tiova_synchrobreathe_9_mcg_120_md_pob_value', price: 305 },
|
||||
{ unit: 'revolizer_pob_units', val: 'revolizer_pob_value', price: 255 },
|
||||
{ unit: 'tiova_hfa_inh_200_md_pob_units', val: 'tiova_hfa_inh_200_md_pob_value', price: 408 },
|
||||
{ unit: 'foracort_200_ciphaler_pob_units', val: 'foracort_200_ciphaler_pob_value', price: 251 },
|
||||
{ unit: 'foracort_400_ciphaler_pob_units', val: 'foracort_400_ciphaler_pob_value', price: 305 },
|
||||
{ unit: 'foracort_200_cfc_free_inh_120_mdi_pob_units', val: 'foracort_200_cfc_free_inh_120_mdi_pob_value', price: 106 },
|
||||
{ unit: 'foracort_200_rotacap_60_pob_units', val: 'foracort_200_rotacap_60_pob_value', price: 251 },
|
||||
{ unit: 'foracort_400_rotacap_60_pob_units', val: 'foracort_400_rotacap_60_pob_value', price: 305 },
|
||||
{ unit: 'foracort_100_synchrobreathe_pob_units', val: 'foracort_100_synchrobreathe_pob_value', price: 223 },
|
||||
{ unit: 'foracort_400_synchrobreathe_120_md_pob_units', val: 'foracort_400_synchrobreathe_120_md_pob_value', price: 357 },
|
||||
{ unit: 'foracort_200_cfc_free_inh_wdc_120_mdi_pob_units', val: 'foracort_200_cfc_free_inh_wdc_120_mdi_pob_value', price: 260 },
|
||||
{ unit: 'foracort_200_rotacaps_60s_pob_in_unit', val: 'foracort_200_rotacaps_60s_pob_value', price: 251 },
|
||||
{ unit: 'foracort_400_rotacaps_60s_pob_in_unit', val: 'foracort_400_rotacaps_60s_pob_value', price: 305 },
|
||||
{ unit: 'foracort_inhaler_180_pob_in_unit', val: 'foracort_inhaler_180_pob_value', price: 390 },
|
||||
{ unit: 'foracort_400_mdi_180_doses_pob_in_unit', val: 'foracort_400_mdi_180_doses_pob_value', price: 445 },
|
||||
{ unit: 'foracort_40012_inh_pob_in_unit', val: 'foracort_40012_inh_pob_value', price: 666 },
|
||||
{ unit: 'foracort_40012_rotacaps_pob_in_unit', val: 'foracort_40012_rotacaps_pob_value', price: 361 },
|
||||
{ unit: 'foracort_synchrobreathe_200_180s_pob_in_unit', val: 'foracort_synchrobreathe_200_180s_pob_in_value', price: 484 },
|
||||
{ unit: 'foracort_synchrobreathe_400_180s_pob_in_unit', val: 'foracort_synchrobreathe_400_180s_pob_in_value', price: 539 }
|
||||
{ unit: 'breathe_o_meter_pob_units', val: 'breathe_o_meter_pob_value', price: 426 },
|
||||
{ unit: 'new_revolizer_pob_units', val: 'new_revolizer_pob_value', price: 255 },
|
||||
{ unit: 'tiova_inhaler_with_d_pob_units', val: 'tiova_inhaler_with_d_pob_value', price: 408 },
|
||||
{ unit: 'foracort_100_rotacap_pob_units', val: 'foracort_100_rotacap_pob_value', price: 95 },
|
||||
{ unit: 'foracort_200_cfc_wit_pob_units', val: 'foracort_200_cfc_wit_pob_value', price: 260 },
|
||||
{ unit: 'foracort_200_rotacap_pob_units', val: 'foracort_200_rotacap_pob_value', price: 126 },
|
||||
{ unit: 'foracort_400_cfc_wit_pob_units', val: 'foracort_400_cfc_wit_pob_value', price: 296 },
|
||||
{ unit: 'foracort_400_rotacap_pob_units', val: 'foracort_400_rotacap_pob_value', price: 153 },
|
||||
{ unit: 'foracort_forte_inh_w_pob_units', val: 'foracort_forte_inh_w_pob_value', price: 606 },
|
||||
{ unit: 'foracort_forte_rc_3_pob_units', val: 'foracort_forte_rc_3_pob_value', price: 361 },
|
||||
{ unit: 'niveoli_inhaler_120_metered_dose_pob_units', val: 'niveoli_inhaler_120_metered_dose_pob_value', price: 185 },
|
||||
{ unit: 'foracort_200_synchrobreathe_pob_units', val: 'foracort_200_synchrobreathe_pob_value', price: 321 },
|
||||
{ unit: 'foracort_400_synchrobreathe_pob_units', val: 'foracort_400_synchrobreathe_pob_value', price: 357 },
|
||||
{ unit: 'tiova_rotacaps_30_capsules_pob_units', val: 'tiova_rotacaps_30_capsules_pob_value', price: 235 },
|
||||
{ unit: 'tiova_synchrobreathe_9_mcg_120_md_pob_units', val: 'tiova_synchrobreathe_9_mcg_120_md_pob_value', price: 305 },
|
||||
{ unit: 'revolizer_pob_units', val: 'revolizer_pob_value', price: 255 },
|
||||
{ unit: 'tiova_hfa_inh_200_md_pob_units', val: 'tiova_hfa_inh_200_md_pob_value', price: 408 },
|
||||
{ unit: 'foracort_200_ciphaler_pob_units', val: 'foracort_200_ciphaler_pob_value', price: 251 },
|
||||
{ unit: 'foracort_400_ciphaler_pob_units', val: 'foracort_400_ciphaler_pob_value', price: 305 },
|
||||
{ unit: 'foracort_200_cfc_free_inh_120_mdi_pob_units', val: 'foracort_200_cfc_free_inh_120_mdi_pob_value', price: 106 },
|
||||
{ unit: 'foracort_200_rotacap_60_pob_units', val: 'foracort_200_rotacap_60_pob_value', price: 251 },
|
||||
{ unit: 'foracort_400_rotacap_60_pob_units', val: 'foracort_400_rotacap_60_pob_value', price: 305 },
|
||||
{ unit: 'foracort_100_synchrobreathe_pob_units', val: 'foracort_100_synchrobreathe_pob_value', price: 223 },
|
||||
{ unit: 'foracort_400_synchrobreathe_120_md_pob_units', val: 'foracort_400_synchrobreathe_120_md_pob_value', price: 357 },
|
||||
{ unit: 'foracort_200_cfc_free_inh_wdc_120_mdi_pob_units', val: 'foracort_200_cfc_free_inh_wdc_120_mdi_pob_value', price: 260 },
|
||||
{ unit: 'foracort_200_rotacaps_60s_pob_in_unit', val: 'foracort_200_rotacaps_60s_pob_value', price: 251 },
|
||||
{ unit: 'foracort_400_rotacaps_60s_pob_in_unit', val: 'foracort_400_rotacaps_60s_pob_value', price: 305 },
|
||||
{ unit: 'foracort_inhaler_180_pob_in_unit', val: 'foracort_inhaler_180_pob_value', price: 390 },
|
||||
{ unit: 'foracort_400_mdi_180_doses_pob_in_unit', val: 'foracort_400_mdi_180_doses_pob_value', price: 445 },
|
||||
{ unit: 'foracort_40012_inh_pob_in_unit', val: 'foracort_40012_inh_pob_value', price: 666 },
|
||||
{ unit: 'foracort_40012_rotacaps_pob_in_unit', val: 'foracort_40012_rotacaps_pob_value', price: 361 },
|
||||
{ unit: 'foracort_synchrobreathe_200_180s_pob_in_unit', val: 'foracort_synchrobreathe_200_180s_pob_in_value', price: 484 },
|
||||
{ unit: 'foracort_synchrobreathe_400_180s_pob_in_unit', val: 'foracort_synchrobreathe_400_180s_pob_in_value', price: 539 }
|
||||
|
||||
|
||||
|
||||
];
|
||||
];
|
||||
|
||||
|
||||
const selector = pobConfig.map(item => `#field-${item.unit}`).join(',');
|
||||
const selector = pobConfig.map(item => `#field-${item.unit}`).join(',');
|
||||
|
||||
$(selector).on('keyup input', function () {
|
||||
let totalUnits = 0;
|
||||
let totalValue = 0;
|
||||
$(selector).on('keyup input', function () {
|
||||
let totalUnits = 0;
|
||||
let totalValue = 0;
|
||||
|
||||
pobConfig.forEach(item => {
|
||||
const units = parseInt($(`#field-${item.unit}`).val(), 10) || 0;
|
||||
const productVal = units * item.price;
|
||||
pobConfig.forEach(item => {
|
||||
const units = parseInt($(`#field-${item.unit}`).val(), 10) || 0;
|
||||
const productVal = units * item.price;
|
||||
|
||||
$(`#field-${item.val}`).val(productVal);
|
||||
$(`#field-${item.val}`).val(productVal);
|
||||
|
||||
totalUnits += units;
|
||||
totalValue += productVal;
|
||||
});
|
||||
totalUnits += units;
|
||||
totalValue += productVal;
|
||||
});
|
||||
|
||||
$('#field-total_pob_units').val(totalUnits);
|
||||
$('#field-total_pob_value').val(totalValue);
|
||||
});
|
||||
$('#field-total_pob_units').val(totalUnits);
|
||||
$('#field-total_pob_value').val(totalValue);
|
||||
|
||||
|
||||
let val200 = parseFloat($('#field-foracort_200_rotacaps_60s_pob_value').val()) || 0;
|
||||
let val400 = parseFloat($('#field-foracort_400_rotacaps_60s_pob_value').val()) || 0;
|
||||
let syncrobrethe_200=parseFloat($('#field-foracort_inhaler_180_pob_value').val() ||0);
|
||||
let syncrobrethe_400=parseFloat($('#field-foracort_400_mdi_180_doses_pob_value').val() ||0);
|
||||
let foracort_syncrobrethe_200=parseFloat($('#field-foracort_synchrobreathe_200_180s_pob_in_value').val() ||0);
|
||||
let foracort_syncrobrethe_400=parseFloat($('#field-foracort_synchrobreathe_400_180s_pob_in_value').val() ||0);
|
||||
|
||||
|
||||
|
||||
let dpiAdhTotal = val200 + val400;
|
||||
let mdiAdhTotal=syncrobrethe_200+syncrobrethe_400;
|
||||
let sbiAdhTotal=foracort_syncrobrethe_200+foracort_syncrobrethe_400;
|
||||
let total=dpiAdhTotal+mdiAdhTotal+sbiAdhTotal;
|
||||
|
||||
$('#report-form').append('<input name="dpi_adh_total_value" value="'+dpiAdhTotal+'" />');
|
||||
$('#report-form').append('<input name="mdi_adh_total_value" value="'+mdiAdhTotal+'" />');
|
||||
$('#report-form').append('<input name="sbi_adh_total_value" value="'+sbiAdhTotal+'" />');
|
||||
$('#report-form').append('<input name="total" value="'+total+'" />');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('#field-total_pob_units').prop("readonly","true");
|
||||
$('#field-total_pob_value').prop("readonly","true");
|
||||
|
|
|
|||
Loading…
Reference in New Issue