Skip to content

Commit

Permalink
Merge pull request #759 from episphere/742-add-email-to-shipping-report
Browse files Browse the repository at this point in the history
742 add email to shipping report
  • Loading branch information
nbirus authored Nov 15, 2024
2 parents c8651c9 + a9bbdcb commit 04f9771
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
27 changes: 15 additions & 12 deletions src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -2257,19 +2257,21 @@ const populateBoxReportsTable = (source) => {
currRow.insertCell(0).innerText = "Tracking Number";
currRow.insertCell(1).innerText = "Date Shipped";
currRow.insertCell(2).innerText = "Shipping Location";
currRow.insertCell(3).innerText = "Box Id";
currRow.insertCell(4).innerText = "View Manifest";
currRow.insertCell(5).innerHTML = `Received<span style="display:block;">(Yes/No)</span>`;
currRow.insertCell(6).innerText = "Date Received";
currRow.insertCell(7).innerText = "Condition";
currRow.insertCell(8).innerText = "Comments";
currRow.insertCell(3).innerText = "Shipped By";
currRow.insertCell(4).innerText = "Box Id";
currRow.insertCell(5).innerText = "View Manifest";
currRow.insertCell(6).innerHTML = `Received<span style="display:block;">(Yes/No)</span>`;
currRow.insertCell(7).innerText = "Date Received";
currRow.insertCell(8).innerText = "Condition";
currRow.insertCell(9).innerText = "Comments";

for (let i = 0; i < reportPageBoxData.data.length; i++) {
rowCount = currTable.rows.length;
currRow = currTable.insertRow(rowCount);
const currBox = convertToOldBox(reportPageBoxData.data[i]);
const trackingNumber = currBox[conceptIds.shippingTrackingNumber] ?? '';
const shippedDate = currBox[conceptIds.shippingShipDate] ? retrieveDateFromIsoString(currBox[conceptIds.shippingShipDate]) : '';
const shippedBy = `<a href="mailto:${currBox[conceptIds.shippedByFirstName]}">${currBox[conceptIds.shippedByFirstName]}</a>`;
const receivedDate = currBox[conceptIds.siteShipmentDateReceived] ? retrieveDateFromIsoString(currBox[conceptIds.siteShipmentDateReceived]) : '';
const packagedCondition = currBox[conceptIds.packageCondition] || '';
const shippingLocation = conceptIdToSiteSpecificLocation[currBox[conceptIds.shippingLocation]];
Expand All @@ -2282,12 +2284,13 @@ const populateBoxReportsTable = (source) => {
currRow.insertCell(0).innerText = trackingNumber;
currRow.insertCell(1).innerText = shippedDate;
currRow.insertCell(2).innerText = shippingLocation;
currRow.insertCell(3).innerText = boxId;
currRow.insertCell(4).innerHTML = viewManifestButton;
currRow.insertCell(5).innerText = isReceived;
currRow.insertCell(6).innerText = receivedDate;
currRow.insertCell(7).innerHTML = packageConditionValue;
currRow.insertCell(8).innerText = packageComments;
currRow.insertCell(3).innerHTML = shippedBy;
currRow.insertCell(4).innerText = boxId;
currRow.insertCell(5).innerHTML = viewManifestButton;
currRow.insertCell(6).innerText = isReceived;
currRow.insertCell(7).innerText = receivedDate;
currRow.insertCell(8).innerHTML = packageConditionValue;
currRow.insertCell(9).innerText = packageComments;

addEventViewManifestButton('reportsViewManifest' + i, currBox, source);
}
Expand Down
3 changes: 1 addition & 2 deletions src/pages/homeCollection/kitStatusReportsShipped.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const displayKitStatusShippedTable = (shippedKitStatusParticipantsArray) => {
<thead>
<tr style="top: 0; position: sticky;">
<th class="sticky-row" style="background-color: #f7f7f7;" scope="col">Connect ID</th>
<th class="sticky-row" style="background-color: #f7f7f7;" scope="col">Study Site </th>
<th class="sticky-row" style="background-color: #f7f7f7;" scope="col">Study Site</th>
<th class="sticky-row" style="background-color: #f7f7f7;" scope="col">Shipped Date</th>
<th class="sticky-row" style="background-color: #f7f7f7;" scope="col">Supply Kit ID</th>
<th class="sticky-row" style="background-color: #f7f7f7;" scope="col">Collection ID</th>
Expand Down Expand Up @@ -77,7 +77,6 @@ const createShippedRows = (shippedKitStatusParticipantsArray) => {
const supplyKitTrackingNum = particpantObj[conceptIds.supplyKitTrackingNum];
const returnKitTrackingNum = particpantObj[conceptIds.returnKitTrackingNum];
const mouthwashSurveyStatus = convertSurveyCompletionStatus(particpantObj[conceptIds.mouthwashSurveyCompletionStatus]);

template += `
<tr class="row-color-enrollment-dark participantRow">
<td>${connectID}</td>
Expand Down

0 comments on commit 04f9771

Please sign in to comment.