module.exports=(async (wb) => {
    var sheet = wb.getWorksheet(4);
    var insertrows = [];
    sheet.eachRow({ includeEmpty: true }, function (row, rowNumber) {
        if (rowNumber >= 5 && rowNumber <= 30) {
            row.eachCell({ includeEmpty: true }, function (cell, colNumber) {
                    if (colNumber == 2) {
                        if (typeof cell.value == "object") {
                            desc="";
                            cell.value.richText.forEach(element => {
                                desc += element.text.replace(" ","");
                            });
                        } else {
                            desc = cell.value.replace(" ","");
                        }
                        cachetmp=desc;
                  
                        
                    }
                    if (colNumber == 3) {
                        desc=cachetmp+"/销售费用";
                    
                    }
                    if (colNumber == 4) {
                        desc=cachetmp+"/其中：境外支付";
                    }
                    if (colNumber == 5) {
                        desc+=cachetmp+"/管理费用";
                    }
                    if (colNumber == 6) {
                        desc=cachetmp+"/其中：境外支付";
                    }
                    if (colNumber == 7) {
                        desc=cachetmp+"/财务费用";
                    }
                    if (colNumber == 8) {
                        desc=cachetmp+"/其中：境外支付";
                    }
                    
                    if (colNumber >=3 && colNumber <=8) {
                        var colpos=colNumber-2;
                        var buildRow = {};
                        buildRow.rpttypecode = "ITY_PERIOD";
                        buildRow.valstr = cell.value?(typeof cell.value=="object"?cell.value.result:cell.value):"0";
                        buildRow.desc = desc;
                        buildRow.position = rowNumber + "-" + colpos;
                        insertrows.push(buildRow);
                    }
            });
        }
    });
    return insertrows;
});