@@ -205,7 +205,7 @@ Ext4.define('MCC.window.MarkShippedWindow', {
205205 schemaName : 'study' ,
206206 queryName : 'Demographics' ,
207207 filterArray : [ LABKEY . Filter . create ( 'lsid' , lsids . join ( ';' ) , LABKEY . Filter . Types . IN ) ] ,
208- columns : 'Id,gender,colony,species,birth,death,center,Id/MostRecentDeparture/MostRecentDeparture,Id/mccAlias/externalAlias,calculated_status,dam,sire,damMccAlias/externalAlias,sireMccAlias/externalAlias' ,
208+ columns : 'Id,gender,colony,species,birth,death,center,Id/MostRecentDeparture/MostRecentDeparture,Id/MostRecentArrival/MostRecentArrival,Id/ mccAlias/externalAlias,calculated_status,dam,sire,damMccAlias/externalAlias,sireMccAlias/externalAlias' ,
209209 scope : this ,
210210 failure : LDK . Utils . getErrorCallback ( ) ,
211211 success : function ( results ) {
@@ -245,6 +245,26 @@ Ext4.define('MCC.window.MarkShippedWindow', {
245245 } ) ;
246246 }
247247
248+ var shouldAddArrival = ! row [ 'Id/MostRecentArrival/MostRecentArrival' ] ||
249+ row [ 'Id/MostRecentArrival/MostRecentArrival' ] !== Ext4 . Date . format ( row . effectiveDate , 'Y-m-d' ) ||
250+ row [ 'Id/MostRecentArrival/mccRequestId' ] !== requestId ||
251+ row . Id !== effectiveId ;
252+ commands . push ( {
253+ command : 'insert' ,
254+ schemaName : 'study' ,
255+ containerPath : targetFolder ,
256+ queryName : 'Arrival' ,
257+ rows : [ {
258+ Id : row . Id ,
259+ date : effectiveDate ,
260+ source : row . colony ,
261+ mccRequestId : requestId ,
262+ qcstate : null ,
263+ objectId : null ,
264+ QCStateLabel : 'Completed'
265+ } ]
266+ } ) ;
267+
248268 // If going to a new LK folder, we're creating a whole new record:
249269 if ( targetFolderId . toUpperCase ( ) !== LABKEY . Security . currentContainer . id . toUpperCase ( ) || effectiveId !== row . Id ) {
250270 commands . push ( {
0 commit comments