timestamp for a specific value change in a different column

I want an automatic time stamp to appear in column D (& # 39; Receive date & # 39;) when the value in column B (& # 39; Status & # 39;) changes to & # 39; Received & # 39; ; I have the script below, but it inserts a timestamp regardless of the status change (that is, In order, see notes etc.):

onEdit (e) {function
var sheet = e.source.getActiveSheet ();
if (sheet.getName () == "r date trial") {
var actRng = sheet.getActiveRange ();
var editColumn = actRng.getColumn ();
var rowIndex = actRng.getRowIndex ();
var headers = sheet.getRange (1, 1, 1, sheet.getLastColumn ()). getValues ​​();
var dateCol = headers[0].indexOf ("Receipt date") + 1;
var orderCol = headers[0].indexOf ("State") + 1;
if (dateCol> 0 && rowIndex> 1 && editColumn == orderCol) {
sheet.getRange (rowIndex, dateCol) .setValue (Utilities.formatDate (new Date (), "UTC + 8", "MM-dd-yyyy")); }
}
}

How do I change it so that the timestamp appears? only when the status received is marked? Here is the sheet if that helps.