diff --git a/resources/views/form/rapport-team3/1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php b/resources/views/form/rapport-team3/1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php index a9d8ed1e..28253085 100644 --- a/resources/views/form/rapport-team3/1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php +++ b/resources/views/form/rapport-team3/1790230856-a5ff58a6-d509-4ac0-9b18-6d366a74965e.blade.php @@ -584,6 +584,10 @@ $(function () { return /^[A-Za-z0-9]+(?:[ ]+[A-Za-z0-9]+)*$/.test(value); } + function stockistAddressOk(value) { + return /^(?=.*[A-Za-z0-9])[A-Za-z0-9 ,.\-\/#&()']+$/.test(value); + } + function doctorAddressOk(value) { return /^[A-Za-z0-9]+(?:[ ,]+[A-Za-z0-9]+)*$/.test(value); } @@ -773,7 +777,8 @@ $(function () { fail('A chemist with this mobile number already exists.'); return; } - var badStockist = false; + var badStockistName = false; + var badStockistAddress = false; $('#chemist-fields .stockist-pick').each(function () { if (this.value !== 'others') { return; @@ -782,12 +787,19 @@ $(function () { var otherName = block.find('.stockist-other-name').val().trim(); var otherAddress = block.find('.stockist-location').val().trim(); block.find('.stockist-name').val(otherName); - if (!addressOk(otherName) || !addressOk(otherAddress)) { - badStockist = true; + if (!addressOk(otherName)) { + badStockistName = true; + } + if (!stockistAddressOk(otherAddress)) { + badStockistAddress = true; } }); - if (badStockist) { - fail('Other stockist name and address can contain letters, numbers and spaces only.'); + if (badStockistName) { + fail('Other stockist name can contain letters, numbers and spaces only.'); + return; + } + if (badStockistAddress) { + fail('Other stockist address can contain letters, numbers, spaces and symbols such as comma, period, hyphen, slash, hash, ampersand, parentheses and apostrophe.'); return; } if (!therapiesFilled('#chemist-fields')) { diff --git a/resources/views/form/rapport-team3/1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php b/resources/views/form/rapport-team3/1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php index 11f37697..922be71f 100644 --- a/resources/views/form/rapport-team3/1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php +++ b/resources/views/form/rapport-team3/1791391025-cf688862-93e7-43b5-bf4e-7a29b30e3830.blade.php @@ -85,7 +85,6 @@ Action Chemist Name - Speciality MSL Code @@ -428,24 +427,27 @@ var child = document.createElement('tr'); child.className = 'pob-child'; child.setAttribute('data-open', 'yes'); - child.innerHTML = 'Loading...'; + var colSpan = row.closest('table') && row.closest('table').id === 'chemist-table' ? 3 : 4; + child.innerHTML = 'Loading...'; row.after(child); $.getJSON('/form/pobhistory', { form_id: formId, contact_id: contactId }, function (data) { var submissions = (data && data.submissions) || []; var orderRows = submissions.map(function (submission) { var info = submission.formdata || {}; - var open = info.submission_status === 'Order Taken' || info.submission_status === 'Rejected'; - var button = open - ? '' - + '' - : ''; + var payload = esc(JSON.stringify(submission)); + var button = ''; + if (info.supply_status === 'No' && info.submission_status === 'Order Taken') { + button = ''; + } else if (info.supply_status === 'Yes' && info.submission_status === 'Rejected') { + button = ''; + } return '' + button + '' + esc(info.record_date || '') + '' + esc(info.submission_status || '') + '' + esc(info.total_pob_value || '') + '' + esc(info.total_actual_pob_value || '') + ''; }).join(''); - child.innerHTML = '
' + child.innerHTML = ''; }).fail(function () { - child.innerHTML = ''; + child.innerHTML = ''; }); } @@ -453,8 +455,9 @@ var body = document.querySelector('#' + tableId + ' tbody'); var rows = contacts[type] || []; body.innerHTML = ''; + var chemist = type === 'ebt_chemist'; if (!rows.length) { - body.innerHTML = ''; + body.innerHTML = ''; return; } rows.forEach(function (item) { @@ -463,7 +466,7 @@ tr.setAttribute('data-contact', item.value); tr.innerHTML = '' + '' - + '' + + (chemist ? '' : '') + ''; tr.querySelector('.report-btn').addEventListener('click', function () { showReport(type, item.value); diff --git a/resources/views/form/rapport-team3/partials/doctor-chemist-chemist.blade.php b/resources/views/form/rapport-team3/partials/doctor-chemist-chemist.blade.php index 97be56ac..873218c2 100644 --- a/resources/views/form/rapport-team3/partials/doctor-chemist-chemist.blade.php +++ b/resources/views/form/rapport-team3/partials/doctor-chemist-chemist.blade.php @@ -1,5 +1,5 @@ @php -$chemistTypes = ['Attached','Floating','Semi','Chain Pharmacy']; +$chemistTypes = ['Attached','Floating','Semi','Semi/Sub-Stockists','Chain Pharmacy']; $products = ['Asthalin Inhaler' => 'asthalin_inhaler','Asthalin Rotacap' => 'asthalin_rotacap','Aerocort Inhaler' => 'aerocort_inhaler','Aerocort Rotacap' => 'aerocort_rotacap','Aerocort Forte Rotacap' => 'aerocort_forte_rotacap']; $therapies = [ 'Nebulization No. of Respules per Month (all included)' => 'neb_respules', @@ -8,7 +8,7 @@ $therapies = [ 'Asthalin Syrup No. of Units per Month' => 'asthalin_syrup_units', 'Levolin Syrup No. of Units per Month' => 'levolin_syrup_units', 'Deriphyllin No. of Units per Month' => 'deriphyllin_units', - 'Beclomethasone Tablet No. of Units per Month' => 'beclomethasone_units', + 'Betnesol Tablet No. of Units per Month' => 'beclomethasone_units', 'Methylprednisolone Tablet No. of Units per Month' => 'methylprednisolone_units', 'Prednisolone Tablet No. of Units per Month' => 'prednisolone_units', 'Cough Syrups No. of Units per Month' => 'cough_syrups_units', diff --git a/resources/views/form/rapport-team3/partials/doctor-chemist-doctor.blade.php b/resources/views/form/rapport-team3/partials/doctor-chemist-doctor.blade.php index d0d396ef..69853dc4 100644 --- a/resources/views/form/rapport-team3/partials/doctor-chemist-doctor.blade.php +++ b/resources/views/form/rapport-team3/partials/doctor-chemist-doctor.blade.php @@ -1,6 +1,6 @@ @php $degrees = ['B. Pharm','D. Pharm','M.B.B.S.','M.D.','B.A.M.S.','B.U.M.S.','B.H.M.S.','D.A.M.S.','D.H.M.S.','B.M.S.','D.M.S.','B.E.M.S.','R.M.P.','B.I.A.M.','D.I.A.M.','C.M.S.','C.M.S. & E.D.','C.C.M.P.','G.A.M.S.','B.P.T.','B.S.C.','Other']; -$specialties = ['G.P (General Physician)','R.M.P (Registered Medical Practitioner)','C.P (Consulting Physician)','Child Specialist','Pediatrician','Family Physician','Multi Speciality','Gynecologist','Urologist','Physiotherapy','Other']; +$specialties = ['G.P (General Physician)','R.M.P (Registered Medical Practitioner)','C.P (Consulting Physician)','Child Specialist','Pediatrician','Family Physician','Multi Speciality','Gynecologist','Urologist','Physiotherapy','D.C.H.','Other']; $bands = ['0 to 10','10 to 20','20 to 30','30 to 40','40 to 50','More than 50']; $doctorTypes = ['Standalone Clinic','Nursing Home','Hospital','Dispensing Doctors (Doctor with Self Purchase)']; $products = ['Asthalin Inhaler' => 'asthalin_inhaler','Asthalin Rotacap' => 'asthalin_rotacap','Aerocort Inhaler' => 'aerocort_inhaler','Aerocort Rotacap' => 'aerocort_rotacap','Aerocort Forte Rotacap' => 'aerocort_forte_rotacap']; @@ -62,7 +62,7 @@ $products = ['Asthalin Inhaler' => 'asthalin_inhaler','Asthalin Rotacap' => 'ast 'Asthalin Syrup No. of Units per Month' => 'asthalin_syrup_units', 'Levolin Syrup No. of Units per Month' => 'levolin_syrup_units', 'Deriphyllin No. of Units per Month' => 'deriphyllin_units', - 'Beclomethasone Tablet No. of Units per Month' => 'beclomethasone_units', + 'Betnesol Tablet No. of Units per Month' => 'beclomethasone_units', 'Methylprednisolone Tablet No. of Units per Month' => 'methylprednisolone_units', 'Prednisolone Tablet No. of Units per Month' => 'prednisolone_units', 'Cough Syrups No. of Units per Month' => 'cough_syrups_units',
ActionDateStatusTotal ValueActual Total
' + (orderRows || '') + '
ActionDateStatusTotal ValueActual Total
No orders yet.
Could not load orders.Could not load orders.
No ' + (type === 'ebt_doctor' ? 'doctors' : 'chemists') + ' yet.
No ' + (chemist ? 'chemists' : 'doctors') + ' yet.
' + esc(item.display || contact.name || '') + '' + esc(contact.speciality || '') + '' + esc(contact.speciality || '') + '' + esc(contact.msl_code || '') + '