module.exports=(async (wb) => {
    var sheet = wb.getWorksheet(7);
    var insertrows = [];
    sheet.eachRow({ includeEmpty: true }, function (row, rowNumber) {
        if (rowNumber >= 6 && rowNumber <= 17) {
            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+"/可弥补年限5年";
                    }
                    if (colNumber == 7) {
                        desc=cachetmp+"/可弥补年限10年";
                    }
                    if (colNumber == 8) {
                        desc=cachetmp+"/弥补亏损企业类型";
                    }
                    if (colNumber == 9) {
                        desc=cachetmp+"/当年亏损额";
                    }
                    if (colNumber == 10) {
                        desc=cachetmp+"/ 当年待弥补的亏损额";
                    }
                    if (colNumber == 11) {
                        desc=cachetmp+"/使用境内所得弥补";
                    }
                    if (colNumber == 12) {
                        desc=cachetmp+"/使用境外所得弥补";
                    }
                    if (colNumber == 13) {
                        desc=cachetmp+"/当年可结转以后年度弥补的亏损额";
                    }
                    if (colNumber >=3 && colNumber <=13) {
                        var colpos=colNumber-2;
                        var buildRow = {};
                        buildRow.rpttypecode = "ITY_FILL_LOST";
                        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;
});