function Notification_Index_OpenReferencesData(messageID){window.CurrentMessageID=messageID;window.CurrentMessageFromPopup=false;const rec=NotificationsStore.getById(window.CurrentMessageID);const referencesJson=rec.get('References');if(referencesJson.indexOf('JSON=')==0){Notification_Index_OpenReferencesJson(referencesJson,true);} else if(referencesJson.indexOf('References=')==0){Notification_Index_OpenReferencesHtml(referencesJson,true);}} function Notification_Index_OpenReferencesJson(referencesJson,mostTop){const $headerRow=$('#tblReferencesTable thead');referencesJson=referencesJson.replace('JSON=','');const reference=JSON.parse(referencesJson);$headerRow.html(Notification_Index_BuildReferencesHeader(reference.Headers,reference.RecordType));let tableData='';for(let i=0;i${headers[i]}`;} tr+='';return tr;} function Notification_Index_ReferencesRowBuilder(data){let tr='';for(let i=0;i${data[i]}`;} tr+='';return tr;};function Notification_SaleTask_ReferencesHeaderBuilder(headers){let tr='';for(let i=0;iSale order number';} if(headers[i]=='SaleOrderDate'){tr+='Sale order date';}} tr+='';return tr;} function Notification_SaleTask_ReferencesRowBuilder(data,headers){let tr='';let taskID;let taskTypeSign;for(var i=0;i${data[i]}`;} else{tr+=`${data[i]}`;}} tr+='';return tr;};function Notification_SaleShipment_ReferencesHeaderBuilder(headers){let tr='';for(let i=0;iCarrier';} else if(headers[i]=='TrackingNumber'){tr+='Tracking number';} else if(headers[i]=='TrackingUrl'){tr+='Tracking URL';} else if(headers[i]=='ShipmentDate'){tr+='Shipment date';} else{continue;}} tr+='';return tr;} function Notification_SaleShipment_ReferencesRowBuilder(data,headers){let tr='';tr+='';for(let i=0;i${data[i]}`;} else{continue;}} tr+='';return tr;};function Notification_SaleDiscount_ReferencesHeaderBuilder(headers){let tr='';for(let i=0;i${headers[i]}`;}} tr+='';return tr;} function Notification_SaleDiscount_ReferencesRowBuilder(data,headers){let tr='';tr+='';for(let i=0;i${data[i]}`;} else{continue;}} tr+='';return tr;};function Notification_ChangeInPrice_ReferencesHeaderBuilder(headers){let tr='';const localization={'SKU':'SKU','Name':'Name','Price':'Price','Old Price':'Old price','New Price':'New price','Location':'Location','Product Name':'Product name','Available':'Available','On Order':'On order','Reorder Quantity':'Reorder quantity','Product':'Product','Quantity':'Quantity','Sales':'Sales',};for(let i=0;i${localization[headers[i]]}`;} else{tr+=`${localization[headers[i]]}`;}} tr+='';return tr;} function Notification_ChangeInPrice_ReferencesRowBuilder(data,headers){let tr='';for(let i=0;i${data[i]}`;} else{tr+=`${data[i]}`;}} tr+='';return tr;};function Notification_Customer_ReferencesHeaderBuilder(headers){let tr='';for(let i=0;i${headers[i]}`;} tr+='';return tr;} function Notification_Customer_ReferencesRowBuilder(data,headers){let tr='';let customerID;for(var i=0;i${data[i]}`;} else{tr+=`${data[i]||''}`;}} tr+='';return tr;};function Notification_Production_RelatedTasks_HeaderBuilder(headers){let tr='';for(let i=0;iProduction order #';} else if(headers[i]=='RelatedOrderNumber'){tr+='Transfer/purchase order #';} else if(headers[i]=='LocationFrom'){tr+='Location from';} else if(headers[i]=='LocationTo'){tr+='Location to';} else if(headers[i]=='Components'){tr+='Components';}} tr+='';return tr;} function Notification_Production_RelatedTasks_ReferencesRowBuilder(data,headers){let tr='';let ProductionOrderID,RelatedOrderTaskID,RelatedTaskType;for(var i=0;i${data[i]}`;} else if(headers[i]=='RelatedOrderNumber'){tr+=`${data[i]}`;} else if(headers[i]=='Components'){tr+=`${data[i].replaceAll('|nr|','
')}`;} else{tr+=`${data[i]}`;}} tr+='';return tr;};function Notification_Production_Operations_HeaderBuilder(headers){let tr='';for(let i=0;iProduction order/run #';} else if(headers[i]=='ProductionOrderNumber'){tr+='Production order #';} else if(headers[i]=='OperationName'){tr+='Operation name';} else if(headers[i]=='DowntimeType'){tr+='Downtime type';} else if(headers[i]=='Reason'){tr+='Reason';} else if(headers[i]=='Downtime'){tr+='Downtime';} else if(headers[i]=='LocationName'){tr+='Location name';} else if(headers[i]=='Components'){tr+='Components';} else if(headers[i]=='ProductName'){tr+='Product';} else if(headers[i]=='Available'){tr+='Available';} else if(headers[i]=='Total'){tr+='Total';} else if(headers[i]=='SaleOrderNumber'){tr+='Sale #';} else if(headers[i]=='CustomerName'){tr+='Customer';} else if(headers[i]=='Version'){tr+='BOM version';}} tr+='';return tr;} function Notification_Production_Operations_ReferencesRowBuilder(data,headers){let tr='';let ProductionOrderID,ProductID;for(var i=0;i${data[i]}`;} else if(headers[i]=='Components'){tr+=`${data[i].replaceAll('|nr|','
')}`;} else if(headers[i]=='ProductName'&&ProductID!=null){tr+=`${data[i]}`;} else{tr+=`${data[i]}`;}} tr+='';return tr;};function Notification_ShipStationExportOrders_ReferencesHeaderBuilder(headers){let tr='';for(let i=0;i${headers[i]}`;} tr+='';return tr;} function Notification_ShipStationExportOrders_ReferencesRowBuilder(data,headers){let tr='';let saleRef;let invoiceRef;let ffRef;for(var i=0;i${data[i]}`;} else if(headers[i]=='Invoice#'&&invoiceRef){tr+=`${data[i]}`;} else if(headers[i]=='Fulfillment#'&&ffRef){tr+=`${data[i]}`;} else{tr+=`${data[i]}`;}} tr+='';return tr;};