function kauflandGS() {
    SpreadsheetApp.getActiveSpreadsheet().setSpreadsheetLocale("de")
    const ss = SpreadsheetApp.getActiveSheet()
    const lr = ss.getLastRow()
    ss.getRange(1,1,lr,1).splitTextToColumns(SpreadsheetApp.TextToColumnsDelimiter.SEMICOLON);
    let lc = ss.getLastColumn()
    let topRange = ss.getRange(1,1,1,lc-1)
    let topArray = topRange.getValues()

    let indice = topArray[0].indexOf("billing.last_name")
   // Logger.log(indice)
    ss.insertColumnsAfter(indice+1,1)
    ss.getRange(1,indice+2,1,1).setValue("Full Name")
    let arrFn = ss.getRange(2,indice,lr-1,1).getValues()
    let arrLn = ss.getRange(2,indice+1,lr-1,1).getValues()
    let fName = []

      //Concatenate First name and Last name (Aprox column "AN") to Array "fName"
      for ( let i = 0; i <arrLn.length; i++) {
            arrFn[i][0]===""?fName[i] = "Kaufland.de":fName[i] = arrFn[i][0]+" "+arrLn[i][0]     
            }
      fName.forEach((item,index,array) => array[index] = [item]);
      ss.getRange(2, indice+2, lr-1, 1).setValues(fName)


    //Fill "zero" amounts in "sum_price_gross" column with "Amount" column data
    const iSumPrice = topArray[0].indexOf("sum_price_gross") +1
    const iAmount = topArray[0].indexOf("amount") +1
    const rangoSumPrice = ss.getRange(2,iSumPrice,lr-1,1)
    const rangoAmount = ss.getRange(2,iAmount,lr-1,1)
    //Logger.log(indice)
    let amountArray = rangoAmount.getValues();
    //Logger.log(amountArray.length)
    let sumPriceGrossArray = rangoSumPrice.getValues()
    for ( let i=0; i<= amountArray.length; i++ ) {
       if (sumPriceGrossArray[i]==0) sumPriceGrossArray[i]=amountArray[i]
    }
    rangoSumPrice.setValues(sumPriceGrossArray)

    //get Gebühren amount
    const iFee = topArray[0].indexOf("fee_gross") +1
    const rangoFee = ss.getRange(2,iFee,lr-1,1)
    let feeArray = rangoFee.getValues()
    let sumFees = 0
    for (i=0; i<=feeArray.length-1; i++) {
      sumFees = sumFees+parseFloat(feeArray[i])
      sumFees.toFixed(2)
    }
    ss.getRange(lr+1,iSumPrice,1,1).setValue(0-sumFees)


    //Fill new row data and formatting dates in column A 
    const rangoDates = ss.getRange(2,1,lr,1)
    rangoDates.setNumberFormat("@")
    ss.getRange("A"+(lr+1)).setValue(ss.getRange("A"+lr).getValue())
    let arrayfechas = rangoDates.getValues()
    let arrayfechas2 = arrayfechas.flat()
    const fechasString =[]
    arrayfechas2.forEach((value,index,array)=> {
       value = array[index].slice(8,10)+"."+array[index].slice(5,7)+"."+array[index].slice(0,4)
       fechasString.push(value)
    })
    arrayfechas = fechasString.map(function(e){return [e];})
    ss.getRange(2,1,lr,1).setValues(arrayfechas)

    rangoDates.setNumberFormat("dd.MM.yyyy")
    const ibooking_text = topArray[0].indexOf("booking_text") +1
    ss.getRange(lr+1,ibooking_text,1,1).setValue("Gebühren")
    ss.getRange(lr+1,indice+2,1,1).setValue("Kaufland.de Gebühren")


    // Rename headers:
    const ibooking_date = topArray[0].indexOf("booking_date") +1
    const iorder_number = topArray[0].indexOf("order_number") +1
    ss.getRange(1,ibooking_date,1,1).setValue("Buchungsdatum")
    ss.getRange(1,ibooking_text,1,1).setValue("Buchungstext")
    ss.getRange(1,iorder_number,1,1).setValue("Zahlungsreferenz")
    ss.getRange(1,iSumPrice,1,1).setValue("Betrag")
    ss.getRange(1,indice+2,1,1).setValue("Empfänger/Zahlungspflichtiger")

    
    // Mark columns to be filtered
    topRange = ss.getRange(1,1,1,lc+1)
    topArray = topRange.getValues()
    const stayArray = ["Buchungsdatum","Buchungstext","Zahlungsreferenz","Betrag","Empfänger/Zahlungspflichtiger"]

    //Filter irrelevant Columns 
    const indices = [];
    topArray[0].forEach((element, index) => {
      if(!stayArray.includes(element)){
         indices.push(index);
      };
   });

    //Delete irrelevant columns
    for (let i =indices.length-1; i >=0; i-- ) {
        //Logger.log(indices[i]+1)
        ss.deleteColumn(indices[i]+1)
      }
    ss.getRange(1,1,lr+1,lc).createTextFinder(",").replaceAllWith(".")
    ss.getRange("D1:D"+(lr+1)).setHorizontalAlignment("right")
}

