2023-03-07 08:04:38 -07:00

24 lines
935 B
JavaScript

// (self.length != 0) ?
// self :
// (getContextData('2', 'cds.PRODUCT', '') == '-') ?
// self :
// getContextData('2', 'cds.PRODUCT', '')
getValue(self, self.length, getContextData('2', 'cds.PRODUCT', ''), $('dcp.HGCV3/pcl/Pattern', ''), $('dcp.HGCV3/pcl/Lot', ''));
function getValue(value, length, product, pattern, lot) {
if (pattern === 'ONEPT.PAT' && lot.toUpperCase().indexOf('EP') > -1)
return 'EpiPro';
else if (pattern === 'ONEPT.PAT' && lot.toUpperCase().indexOf('LO') > -1)
return 'Low';
else if (pattern === 'ONEPT.PAT' && lot.toUpperCase().indexOf('MI') > -1)
return 'Mid';
else if (pattern === 'ONEPT.PAT' && lot.toUpperCase().indexOf('HI') > -1)
return 'High';
else if (pattern === 'ONEPT.PAT' && lot.toUpperCase().indexOf('TH') > -1)
return 'Thin';
else if (length === 0)
return product;
else
return value;
}