Label: Third Party + Index + Item Line Index

To be replaced:

  • ID_INDEX_DETECTION = Id of the classic index e.g. “INVOICE_NUMBER_INDEX”
  • ID_ARTICLE_LINE = Item line id, e.g. “ARTICLES_LINE_INDEX”
  • EX_ARTICLE_LINE = Id of the child index of the item line e.g. “DESCRIPTION_ARTICLES_LINE_INDEX”
var getSimpleIndex = function(pParameters, idIndex){
    return getTextFromIndexInfo(getFirstIndexFromID(pParameters, idIndex));   
};
var getIndexArticleLine = function(pParameters, idArticleLine, idIndex){
    var articleLine = getArticleLine(pParameters, idArticleLine, ID_UNIT); 
     if(articleLine != null && articleLine.indexInfos != null && articleLine.indexInfos.length > 0)
        return getTextFromIndexInfo(getIndexFromArticleLine(articleLine, idIndex));
    return "";
};

var resultLabel = THIRDPART.name + " " + getSimpleIndex(pParameters, ID_INDEX_DETECTION);
if(IS_ARTICLE)
	resultLabel += " " + getIndexArticleLine(pParameters, ID_ARTICLE_LINE, ID_INDEX_ARTICLE_LINE);
return resultLabel;