endpoints.path: /
endpoints.endpoint_type: HTTP
endpoints.scan_time: 2025-10-09T15:17:22.862854
endpoints.uri: https://cankiku-c76.analitza.com/
endpoints.protocol: HTTP/1.1
endpoints.status_reason: Found
endpoints.key: Set-Cookie
endpoints.headers: laravel_session=eyJpdiI6Ik5veTVYUGl1WHpGSThFejFIUGc2TlE9PSIsInZhbHVlIjoicGtkMHp3MGdXWDFmZWVtUUVxVURnZG51dGxTNDB4TTZxeGJRd203VVV2d3hQdnNjUTludXZOUHVpWk1jaHF1cyIsIm1hYyI6IjAyYmMwN2Q0MjMxNzA5YmE3YjA2ZjhlMDMzNDc1YjU5YjQ1MjA5MDJlMzc4OTI5MmFkNzQ3YzJhYzc0YjA5YjIifQ%3D%3D; expires=Fri, 09-Oct-2026 15:17:23 GMT; Max-Age=31536000; path=/; httponly l3J5BC2HhNwTdRU55gK0SKJvEQg4dSLeBtYrqmG4=eyJpdiI6Imk1UVNkclpVMEh1UUQrXC9cL1JPSEJxQT09IiwidmFsdWUiOiJLMXhHRVJwWDlIK1wvQWFBUmdQMzRzd0xKRDByZDR2M2I0XC9PNlRtNGNicjlLbndQQkZ6YmFaWGdXek96RmVpdzFrSmdcL0Z0OFVSd3YzeHBxUGlNSG95Z1N3aHdEeGg0V1NnY1pIN0dOWVQzVzlDVkEzMjVOdUQyWU04djE0WGJJdG5JNDdwTFZVT1VVUWhuYVpzTyt5dDkyc0hSeG5zeDg2VVdBSlI5TTV3NVRaWGRCdXVZb01ZblNQSkY3TktValB3WmdxcEYzend2b1cwQ09vYnliNEVMZ0lSZHJNcUpvcCtKR2Q1RlVKUDF4UnQrV2t0Q1B1Z05YcytBWGNTS2htT2hVZlRLRStRRndmaUdzalhxMXhFcldFdVloSTVpTXl5d1BjMGx5OXpYbzJxeGFvSU90V0NpQ1pXYnMxdGlWRXAyams3UDVpXC9ScVJFS3NGTmFnblpOTTBkUE44eFQzSzBZY3FWWjBPRExxMFNsWUpcLzYzMFdRaW1CekFnVnhmVUpVSlwvb2RcL0dMdFBQdVZcL2h6MWRadFNSdEx2TVp1M3pSUHFHeVZ5cjRZNXhvbGVcL0FzSmJTTlQ4VEhCQlBESzgyR09FbTF5OWFXT2krVHpxZ1N1elZMa1ZsQ3FaNWViRUJ0S0pLXC8xbHFNdkFUVHBUaDU4OUlkalVwbkZmMjV3UmozSmppTnhvZjNXNjR2RHJuTXNKSDJmcFFHeWNiZGlxOWVNQXR2M21EZ0tQU1wvNnFQM0ZXaG1DWUc4UE5UWWpiVWpxUEI0WE03bm1hWUJvYVhEQW94ejJ0MGZaaEVySkowNEFUWlpla2VRVXdIdFNkVDNkaFFIRlltQ21HVEM5K0VueG5jeW9lVFVpb3dGV0orcVd3RVZSekRxSWtYQngxcFI2cTNLVlZBT29tVGxxNlNzQTliOTNkYlwvRm5jUXFQanpyYVpwNERIMW1wQlJlWlZyUmZvTkp0TFhKNGJrNCs1aEFHOTBOZlF4ckdqRzVJVW53Y1diZjE2N1RLOXFkUWRhZmtPNUZFWjZ2U1dFMGlMUFU5R3BtSjJtdFI4YzJscjRVOTF2UDZZS3J0dHNtY0tsblUwNXhIbkNsTWxSVnVTNStWNWI5bE4wbktTV3BRUU92eXdoUVg0R0JycGttQ1MzTUNtcmdVNXU3dGRYRTAreEdRU2FOZ0doajE0cThlTEdzaTFlaSsxbnBMRHloRURhcGNDSmc9PSIsIm1hYyI6IjU3NTliY2IyYTU4MzIzMTI2MGUwNGNjMjA5MDJhY2VhMWYxZGRjMTVmOTY3ZTVhY2I1NGUwMDRkYTFmNTBiODUifQ%3D%3D; expires=Fri, 09-Oct-2026 15:17:23 GMT; Max-Age=31536000; path=/; httponly
endpoints.key: Content-Encoding
endpoints.headers: gzip
endpoints.key: Location
endpoints.headers: https://cankiku-c76.analitza.com/home
endpoints.key: Server
endpoints.headers: Apache/2.4.18 (Ubuntu)
endpoints.key: Vary
endpoints.headers: Accept-Encoding
endpoints.key: Content-Length
endpoints.headers: 205
endpoints.key: Date
endpoints.headers: <REDACTED>
endpoints.key: Cache-Control
endpoints.headers: no-cache, private
endpoints.key: Content-Type
endpoints.headers: text/html; charset=UTF-8
endpoints.html_tags: <title>Redirecting to https://cankiku-c76.analitza.com/home</title> <meta charset="UTF-8" /> <meta http-equiv="refresh" content="0;url=https://cankiku-c76.analitza.com/home" />
endpoints.body: <!DOCTYPE html>
  <html>
      <head>
          <meta charset="UTF-8" />
          <meta http-equiv="refresh" content="0;url=https://cankiku-c76.analitza.com/home" />
  
          <title>Redirecting to https://cankiku-c76.analitza.com/home</title>
      </head>
      <body>
          Redirecting to <a href="https://cankiku-c76.analitza.com/home">https://cankiku-c76.analitza.com/home</a>.
      </body>
  </html>
endpoints.html_title: Redirecting to https://cankiku-c76.analitza.com/home
endpoints.supported_versions: HTTP/1.1
endpoints.banner: HTTP/1.1 302 Found
  Date:  <REDACTED>
  Server: Apache/2.4.18 (Ubuntu)
  Cache-Control: no-cache, private
  Location: https://cankiku-c76.analitza.com/home
  Set-Cookie: laravel_session=eyJpdiI6Ik5veTVYUGl1WHpGSThFejFIUGc2TlE9PSIsInZhbHVlIjoicGtkMHp3MGdXWDFmZWVtUUVxVURnZG51dGxTNDB4TTZxeGJRd203VVV2d3hQdnNjUTludXZOUHVpWk1jaHF1cyIsIm1hYyI6IjAyYmMwN2Q0MjMxNzA5YmE3YjA2ZjhlMDMzNDc1YjU5YjQ1MjA5MDJlMzc4OTI5MmFkNzQ3YzJhYzc0YjA5YjIifQ%3D%3D; expires=Fri, 09-Oct-2026 15:17:23 GMT; Max-Age=31536000; path=/; httponly
  Set-Cookie: l3J5BC2HhNwTdRU55gK0SKJvEQg4dSLeBtYrqmG4=eyJpdiI6Imk1UVNkclpVMEh1UUQrXC9cL1JPSEJxQT09IiwidmFsdWUiOiJLMXhHRVJwWDlIK1wvQWFBUmdQMzRzd0xKRDByZDR2M2I0XC9PNlRtNGNicjlLbndQQkZ6YmFaWGdXek96RmVpdzFrSmdcL0Z0OFVSd3YzeHBxUGlNSG95Z1N3aHdEeGg0V1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OZ0doajE0cThlTEdzaTFlaSsxbnBMRHloRURhcGNDSmc9PSIsIm1hYyI6IjU3NTliY2IyYTU4MzIzMTI2MGUwNGNjMjA5MDJhY2VhMWYxZGRjMTVmOTY3ZTVhY2I1NGUwMDRkYTFmNTBiODUifQ%3D%3D; expires=Fri, 09-Oct-2026 15:17:23 GMT; Max-Age=31536000; path=/; httponly
  Content-Encoding: gzip
  Vary: Accept-Encoding
  Content-Length: 205
  Content-Type: text/html; charset=UTF-8
  
endpoints.ip: 5.9.153.140
endpoints.path: /home
endpoints.endpoint_type: HTTP
endpoints.scan_time: 2025-10-09T15:17:35.087673
endpoints.uri: https://cankiku-c76.analitza.com/home
endpoints.protocol: HTTP/1.1
endpoints.status_reason: Found
endpoints.key: Date
endpoints.headers: <REDACTED>
endpoints.key: Content-Type
endpoints.headers: text/html; charset=UTF-8
endpoints.key: Server
endpoints.headers: Apache/2.4.18 (Ubuntu)
endpoints.key: Location
endpoints.headers: https://cankiku-c76.analitza.com/login
endpoints.key: Vary
endpoints.headers: Accept-Encoding
endpoints.key: Cache-Control
endpoints.headers: no-cache, private
endpoints.key: Content-Length
endpoints.headers: 205
endpoints.key: Set-Cookie
endpoints.headers: laravel_session=eyJpdiI6ImFHTWhzdmdPM2Z6U2huWUhPcjhNZGc9PSIsInZhbHVlIjoibk1uNFBoU21IN0RXXC9NTnhxRkRLT1IwV0NCZ1FcL0djNkEycnFJazA3VjBTVVwvT2JZYmFtTkpUKzBVbG9IVkU4OCIsIm1hYyI6ImU4YTc5NGNmM2ZhMjU3NDllNWUzNWIwZDdjNmQwZmUyNDAwY2FiYmQ4NGMzMGRmYmI3YmY0ZDg3OGZlNjU5ZmMifQ%3D%3D; expires=Fri, 09-Oct-2026 15:17:36 GMT; Max-Age=31536000; path=/; httponly J3DTI16yqVlxRiER2CUd2lH4SHeHxil7bCweFhJu=eyJpdiI6IlowS3R2SmdzTDB5YmhNd2YxYkRTZXc9PSIsInZhbHVlIjoiMVU0Skp1bXVSU1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QU0V4SG5NV1BUS2JScDJLWDFIbEt3WEU0WmowMjlRXC9DKzRhRjRJQVwva05iTDArNmI0U2lyNit6OTZ1cExIejc0M1lGY3ZEbExRdkFjR2F2TUlzSldCeHhIZ0FDMytJSFwvd0xjekwzelg2eFV6dkxMamh4MURJZnd0ak0zNm93aGZIRTM1STlPbThEXC9ObDhhWTFnd1luQmNjODA4cklmRHlJR1dQamZidUY3VzYza0x0eDFRMlkrQnRzYklwYUZzazF1NHFIeVRIUTBlNFhVOVRuWXRXdzdocGs0SmZSV0FLVm1UT1R2dHAyTXd5ZTE5enAxckpVK245NkRBckY1d3J5djJcL0pSbDhiZno0clJoRytDRmQ3OVdlXC9oXC9NN1d6ZlpYMldTMWVuZkRiMlZpKzQ5Um1qREpPMlBnbEJEbDlpNXZubzdyUDBTRVFwc2I1SnpPNUpVM1FZZktZZjU1aUtCWW1ZM0ZNR2M1YjhrYXBTRFNPVjdoVytpVWZcL2VrOXdCaGhWeUdrVnFrY0toNUJwVkNWTW5PWlg1S0hHT3RBdmFGTGJEaFoxMXBwK0RCVmRwODV2RmVKWkVRUm9VQWZDeElUR1NFZWg3d2hZakNwanRnV3o4YklLVktWWGVRdHZGVUJNOWM3Ukp0Mm9zNnBPaVlNdFN5VXp2ODJJU3BUSE9OOHl5WDFTYXNvRXJBXC9mdmRyV1lERGNWR2gwejg9IiwibWFjIjoiNThmNGUzYjk1NjM4Mjg4NTdkMmEzYzA1NjMxNGE0NGYwOGNiNjI1YzE2YTExM2U1OGU3ZjFjYjg0ZWNhMDAxNiJ9; expires=Fri, 09-Oct-2026 15:17:36 GMT; Max-Age=31536000; path=/; httponly
endpoints.key: Content-Encoding
endpoints.headers: gzip
endpoints.html_tags: <title>Redirecting to https://cankiku-c76.analitza.com/login</title> <meta charset="UTF-8" /> <meta http-equiv="refresh" content="0;url=https://cankiku-c76.analitza.com/login" />
endpoints.body: <!DOCTYPE html>
  <html>
      <head>
          <meta charset="UTF-8" />
          <meta http-equiv="refresh" content="0;url=https://cankiku-c76.analitza.com/login" />
  
          <title>Redirecting to https://cankiku-c76.analitza.com/login</title>
      </head>
      <body>
          Redirecting to <a href="https://cankiku-c76.analitza.com/login">https://cankiku-c76.analitza.com/login</a>.
      </body>
  </html>
endpoints.html_title: Redirecting to https://cankiku-c76.analitza.com/login
endpoints.supported_versions: HTTP/1.1
endpoints.banner: HTTP/1.1 302 Found
  Date:  <REDACTED>
  Server: Apache/2.4.18 (Ubuntu)
  Cache-Control: no-cache, private
  Location: https://cankiku-c76.analitza.com/login
  Set-Cookie: laravel_session=eyJpdiI6ImFHTWhzdmdPM2Z6U2huWUhPcjhNZGc9PSIsInZhbHVlIjoibk1uNFBoU21IN0RXXC9NTnhxRkRLT1IwV0NCZ1FcL0djNkEycnFJazA3VjBTVVwvT2JZYmFtTkpUKzBVbG9IVkU4OCIsIm1hYyI6ImU4YTc5NGNmM2ZhMjU3NDllNWUzNWIwZDdjNmQwZmUyNDAwY2FiYmQ4NGMzMGRmYmI3YmY0ZDg3OGZlNjU5ZmMifQ%3D%3D; expires=Fri, 09-Oct-2026 15:17:36 GMT; Max-Age=31536000; path=/; httponly
  Set-Cookie: J3DTI16yqVlxRiER2CUd2lH4SHeHxil7bCweFhJu=eyJpdiI6IlowS3R2SmdzTDB5YmhNd2YxYkRTZXc9PSIsInZhbHVlIjoiMVU0Skp1bXVSU1wvT1FzNFZnN1pIT0FJTlZWZ25jekUwOWdKbE1jUjRPcnAwbHdVS1l3ejFKUEMwTDVqXC9IK29heTdkXC8rXC9aSmlVU01SVU9VcjZvYTh3VE1TZ0s3bklRUHZiMUNkSENDclBMWmJWUHpGNENqNUF3cFVLUGRja0RqU2hvaUE3M1BPbkRweWZzSzllblJZd3JpaDg3QkFMU0dwNEtcL1BlRWdtUmZcL3gyMVlDVE8wdkQwSWtkdmRFejRVbVc1cWZcL0tCZmxyWTZHaHluMFA2Z1RtNFNpeWNNSWpKc3ptMHdGTDBcLzBkWmUrTjZ3TlJxSHlkUkRsYTY3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cL0pSbDhiZno0clJoRytDRmQ3OVdlXC9oXC9NN1d6ZlpYMldTMWVuZkRiMlZpKzQ5Um1qREpPMlBnbEJEbDlpNXZubzdyUDBTRVFwc2I1SnpPNUpVM1FZZktZZjU1aUtCWW1ZM0ZNR2M1YjhrYXBTRFNPVjdoVytpVWZcL2VrOXdCaGhWeUdrVnFrY0toNUJwVkNWTW5PWlg1S0hHT3RBdmFGTGJEaFoxMXBwK0RCVmRwODV2RmVKWkVRUm9VQWZDeElUR1NFZWg3d2hZakNwanRnV3o4YklLVktWWGVRdHZGVUJNOWM3Ukp0Mm9zNnBPaVlNdFN5VXp2ODJJU3BUSE9OOHl5WDFTYXNvRXJBXC9mdmRyV1lERGNWR2gwejg9IiwibWFjIjoiNThmNGUzYjk1NjM4Mjg4NTdkMmEzYzA1NjMxNGE0NGYwOGNiNjI1YzE2YTExM2U1OGU3ZjFjYjg0ZWNhMDAxNiJ9; expires=Fri, 09-Oct-2026 15:17:36 GMT; Max-Age=31536000; path=/; httponly
  Content-Encoding: gzip
  Vary: Accept-Encoding
  Content-Length: 205
  Content-Type: text/html; charset=UTF-8
  
endpoints.ip: 5.9.153.140
endpoints.path: /login
endpoints.endpoint_type: HTTP
endpoints.scan_time: 2025-10-09T15:17:41.595766
endpoints.uri: https://cankiku-c76.analitza.com/login
endpoints.protocol: HTTP/1.1
endpoints.status_reason: OK
endpoints.key: Vary
endpoints.headers: Accept-Encoding
endpoints.key: Cache-Control
endpoints.headers: no-cache, private
endpoints.key: Set-Cookie
endpoints.headers: laravel_session=eyJpdiI6InBJaTJyMENoWWFjS3VVMXVBblcySmc9PSIsInZhbHVlIjoiemEyaExRTGxuQ1Y3dDVldUt2cWpqRGZHSzdhNzFSc3hpY3NTSUFpMzg5QUxjd3FFZWJDTlRGdkhNOUVFZmV1NSIsIm1hYyI6ImZhZGNiN2JiMzk3NzRkOWFjNmZiODg3YjRlMGZlYWQ3ZTY0OWIxYzFiZjFlYjgzMjg5YmJiZjgzN2MyMz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CJtYWMiOiI4NzI0ZDllYzRkMzgwMmIwODZlYTJhNTBhNjVlM2I5ZDdlYmNlYjg1NjdlMGJmZmFkNWE4NDRjNzYyN2ZkZDMzIn0%3D; expires=Fri, 09-Oct-2026 15:17:42 GMT; Max-Age=31536000; path=/; httponly
endpoints.key: Content-Encoding
endpoints.headers: gzip
endpoints.key: Transfer-Encoding
endpoints.headers: chunked
endpoints.key: Content-Type
endpoints.headers: text/html; charset=UTF-8
endpoints.key: Date
endpoints.headers: <REDACTED>
endpoints.key: Server
endpoints.headers: Apache/2.4.18 (Ubuntu)
endpoints.html_tags: <title>    Entrar
   | Analitza CM</title> <meta charset="utf-8"/> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"/> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-touch-fullscreen" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="default"> <meta content="" name="description"/> <meta content="" name="author"/>
endpoints.body: <!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8"/>
  <title>    Entrar
   | Analitza CM</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no"/>
  <link rel="icon" type="image/x-icon" href="https://cankiku-c76.analitza.com/favicon.ico"/>
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-touch-fullscreen" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="default">
  <meta content="" name="description"/>
  <meta content="" name="author"/>
  <link href="https://cankiku-c76.analitza.com/plugins/jquery-scrollbar/jquery.scrollbar.min.css" rel="stylesheet" type="text/css"/>
  <link href="https://cankiku-c76.analitza.com/plugins/font-awesome/css/all.min.css?v5.10.3" rel="stylesheet" type="text/css"/>
  <link rel="stylesheet" type="text/css" href="https://cankiku-c76.analitza.com/plugins/jquery-datatables/datatables.min.css"/>
  <link rel="stylesheet" type="text/css" href=" https://cankiku-c76.analitza.com/plugins/bootstrapv3/css/bootstrap.min.css" />
  <link rel="stylesheet" type="text/css" href=" https://cankiku-c76.analitza.com/plugins/bootstrap-select2/select2.css" media="screen" />
  <link rel="stylesheet" type="text/css" class="main-stylesheet" href="https://cankiku-c76.analitza.com/css/style.css?v1.54" />
  <script>
      var stringToColour = function (str) {
          var colhash = 0;
          for (var i = 0; i < str.length; i++) {
              colhash = str.charCodeAt(i) + ((colhash << 5) - colhash);
          }
          var color = "#";
          for (var i = 0; i < 3; i++) {
              var value = (colhash >> (i * 8)) & 0xFF;
              color += ("00" + value.toString(16)).substr(-2);
          }
          return color;
      };
  
      document.addEventListener("DOMContentLoaded", function (event) {
          document.getElementById("content-space").style.display = "block";
      });
  
      // function formatCash(cash) {
      //     // filter and format it
      //     cash = parseFloat(cash)
      //
      //     if (cash > 1000000000000) {
      //         num = cash / 1000000000000
      //         return Math.round(num * 100) / 100 + 'T' + " \u20AC";
      //     }
      //     else if (cash > 1000000000) {
      //         num = cash / 1000000000
      //         return Math.round(num * 100) / 100 + 'B' + " \u20AC";
      //     }
      //     else if (cash > 1000000) {
      //         num = cash / 1000000
      //         return Math.round(num * 100) / 100 + 'M' + " \u20AC";
      //     }
      //     else if (cash > 1000) {
      //         num = cash / 1000
      //         return Math.round(num * 100) / 100 + 'K' + " \u20AC";
      //     }
      //
      //     return cash + " \u20AC";
      // }
  
  
      function formatDate(date) {
          return date.getDate() + "/" + (date.getMonth() + 1) + "/" + date.getFullYear();
      }
  
      function formatCashDatatables(data, type, full) {
          // if (typeof data == "number") {
          if (type === "display") {
              if (data === 0) return data;
              else return data === "" ? "" : data.toString().replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") + " €";
          } else if (type === "filter") {
              return data === "" ? "" : data.toString().replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".") + " " + data;
          }
          return parseFloat(data);
          // }
          // else {
          //     return data;
          // }
          // 'sort', 'type' and undefined all just use the integer
      }
  
      function formatCashNewDatatables(data, type, full) {
          // if (typeof data == "number") {
          if (type === "display") {
              return data === "" ? "" : formatNumber(data) + " €";
          } else if (type === "filter") {
              return data === "" ? "" : formatNumber(data) + " " + data;
          }
          return parseFloat(data);
          // }
          // else {
          //     return data;
          // }
          // 'sort', 'type' and undefined all just use the integer
      }
  
      function formatQuantityNewDatatables(data, type, full) {
          // if (typeof data == "number") {
          if (type === "display") {
              return data === "" ? "" : formatNumber(data) + " #";
          } else if (type === "filter") {
              return data === "" ? "" : formatNumber(data) + " " + data;
          }
          return parseFloat(data);
          // }
          // else {
          //     return data;
          // }
          // 'sort', 'type' and undefined all just use the integer
      }
  
      function formatNumber(number) {
          return number.toString().replace(".", ",").replace(/\B(?=(\d{3})+(?!\d))/g, ".")
      }
  
      String.prototype.replaceAll = function (search, replacement) {
          var target = this;
          return target.replace(new RegExp(search, 'g'), replacement);
      };
  
      function exportTable(data) {
          data = data.toString().replace(/(&nbsp;|<([^>]+)>)/ig, ""); //Per defecte, el plugin d'excel elimina el HTML, però al body format hem de eliminar-lo manualment
          if (data.split(" ").pop() === "€") {
              data = data.replaceAll('\\.', "");
              data = data.replaceAll(',', ".");
              return data.replace("€", '');
          } else if (data.split(" ").pop() === "#") {
              data = data.replaceAll('\\.', "");
              data = data.replaceAll(',', ".");
              return data.replace("#", '');
          } else if (data.split(" ").pop() === '%') {
              data = data.replaceAll('\\.', "");
              var percentage = data.replace('%', '');
              return parseFloat(percentage) / 100;
          } else {
              return data
          }
      }
  
      function getGoogleChartSeriesColors(num_series) {
          var series = [];
          for (var i = 0; i < num_series; i++) {
              series[i] = {};
              if (i === num_series - 2) {
                  series[i].color = "#f4f4f4";
              } else if (i === num_series - 1) {
                  series[i].color = "#3498db";
              }
          }
          return series;
      }
  
      function basicButtonsDatatables(clipboard, excel, print) {
          return [
              {
                  extend: 'copy',
                  title: "",
                  footer: true,
                  text: '<i class="fa fa-copy m-r-5" title=' + clipboard + '></i>',
                  className: "btn btn-light",
                  exportOptions: {
                      columns: [':visible:not(.not-export-col):not(.hidden)'],
                      createEmptyCells: true,
                      format: {
                          body: function (data, row, column, node) {
                              return exportTable(data);
                          },
                          footer: function (data, row, column, node) {
                              return exportTable(data);
                          },
                      }
                  },
              },
              {
                  extend: 'excelHtml5',
                  autoFilter: true,
                  footer: true,
                  title: "",
                  text: '<i class="fa fa-download m-r-5" title=' + excel + '></i>',
                  className: "btn btn-light",
                  exportOptions: {
                      columns: [':visible:not(.not-export-col):not(.hidden)'],
                      createEmptyCells: true,
                      format: {
                          body: function (data, row, column, node) {
                              return exportTable(data);
                          },
                          footer: function (data, row, column, node) {
                              return exportTable(data);
                          },
                      }
                  },
              },
              {
                  extend: 'print',
                  title: "",
                  footer: true,
                  text: '<i class="fa fa-print m-r-5" title=' + print + '></i>',
                  className: "btn btn-light",
                  exportOptions: {
                      columns: [':visible:not(.not-export-col):not(.hidden)'],
                  }
              },
          ];
      }
  
      function formatDateDatatables(data, type, full) {
          if (type === "display") {
              return data;
          } else if (type === "filter") {
              return data;
          }
          // 'sort', 'type' and undefined all just use the integer
          return data.split("/").reverse().join("-");
      }
  
      function formatPercentage(data, type, full) {
          if (type === "display") {
              if (data !== "") {
                  return Math.round(data * 100, 0) + " %";
              } else {
                  return "";
              }
          }
  
          // 'sort', 'type' and undefined all just use the integer
          return parseFloat(data);
      }
  
      function getIndexColumnName(column_names, name) {
          var index = 0;
          var found = false;
          while (!found) {
              found = column_names[index]['name'] === name;
              if (!found) {
                  index++;
              }
          }
          if (!found) {
              return -1;
          } else {
              return index;
          }
      }
  
      function avg_monthly_days(value, days) {
          if (days > 0) {
              return value / days;
          } else {
              return 0;
          }
      }
  
      function business_days_company(current_date) {
          var days = 0;
          var workingDays = "1,2,3,4,5".split(",");
          var lastDate = moment(current_date).startOf('day');
          var currDate = moment([lastDate.year(), lastDate.month(), 1]).startOf('day');
          do {
              if (workingDays.includes(currDate.weekday().toString())) {
                  days++;
              }
          } while (currDate.add(1, 'days').diff(lastDate) <= 0)
          return days;
      }
  
  
      //function formatSector(data,type,full){
      //    console.log();
      //    var short = data.charAt(0)
      //    if (type === 'display') {
      //        return short;
      //    }
      //    else if (type === 'filter') {
      //        return data +" "+short;
      //    }
      //    // 'sort', 'type' and undefined all just use the integer
      //    return short;
      //}
      //
      //function formatSalesman(data,type,full){
      //    var short = 1;
      //    if (type === 'display') {
      //        return data;
      //    }
      //    else if (type === 'filter') {
      //        return data;
      //    }
      //    // 'sort', 'type' and undefined all just use the integer
      //    return data.split("/").reverse().join("-");
      //}
      if (!String.prototype.startsWith) {
          String.prototype.startsWith = function (searchString, position) {
              position = position || 0;
              return this.indexOf(searchString, position) === position;
          };
      }
  
      String.prototype.ucwords = function () {
          str = this.toLowerCase();
          return str.replace(/(^([a-zA-Z\p{M}]))|([ -][a-zA-Z\p{M}])/g,
              function (s) {
                  return s.toUpperCase();
              });
      };
  
      String.prototype.ucfirst = function () {
          str = this.toLowerCase();
          var f = str.charAt(0)
              .toUpperCase()
          return f + str.substr(1)
      };
      String.prototype.formatcash = function () {
          str = this.toLowerCase();
          return str.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")
      };
  
      function googleTooltip(date, val, min, max) {
          var minmax = "";
          if (min || max) {
              minmax = "[ " + formatNumber(min) + " , " + formatNumber(max) + " ]";
          }
          return "<div style='padding:2px;white-space: nowrap;'>" + date + ": <b>" + formatNumber(val) + " " + minmax + "</b></div>";
      }
  
      function drawUsageChart(container, counter_name) {
          var divs = document.querySelectorAll(container);
          var values = [];
          [].forEach.call(divs, function (div) {
              values = values.concat($(div).data("values"));
          });
          var min_value = Math.min.apply(Math, values);
          var max_value = Math.max.apply(Math, values);
          var d11 = moment();
          var d12 = moment().subtract(6, 'days');
  
          var d21 = moment().subtract(7, 'days');
          var d22 = moment().subtract(13, 'days');
  
          var d31 = moment().subtract(14, 'days');
          var d32 = moment().subtract(20, 'days');
  
          var d41 = moment().subtract(21, 'days');
          var d42 = moment().subtract(27, 'days');
  
          [].forEach.call(divs, function (div) {
              var values = $(div).data("values");
              $(div).sparkline(values, {
                  type: 'bar',
                  barWidth: 6,
                  barColor: '#3498db',
                  zeroColor: '#fd6b5f',
                  chartRangeMinX: 0,
                  chartRangeMaxX: 4,
                  chartRangeMin: min_value,
                  chartRangeMax: max_value,
                  zeroAxis: true,
                  tooltipFormat: '\{\{offset:offset}} <br> \{\{value}} ' + counter_name,
                  tooltipValueLookups: {
                      'offset': {
                          0: d42.format('D MMM').toString().ucwords() + " - " + d41.format('D MMM').toString().ucwords(),
                          1: d32.format('D MMM').toString().ucwords() + " - " + d31.format('D MMM').toString().ucwords(),
                          2: d22.format('D MMM').toString().ucwords() + " - " + d21.format('D MMM').toString().ucwords(),
                          3: d12.format('D MMM').toString().ucwords() + " - " + d11.format('D MMM').toString().ucwords()
                      }
                  }
              });
          });
      }
  
      function drawHistoricChart(container) {
          var divs = document.querySelectorAll(container);
          [].forEach.call(divs, function (div) {
              var purchases_per_month = $(div).data("values");
              var x = 0;
              var len = purchases_per_month.length;
              var this_year = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
              var last_year = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
              // console.log(purchases_per_month)
              var count_this_year = 0;
              var count_last_year = 0;
              for (var i = len - 1; i >= 0; i--) {
                  if (count_this_year >= 12) {
                      last_year[23 - count_last_year] = purchases_per_month[i].toFixed(2);
                      last_year[22 - count_last_year] = purchases_per_month[i].toFixed(2);
                      count_last_year += 2;
                  } else {
                      this_year[11 - count_this_year] = purchases_per_month[i].toFixed(2);
                      count_this_year++;
                  }
              }
              // console.log(last_year,this_year)
              var all = this_year.concat(last_year);
              var min_value = Math.min.apply(Math, all);
              if (min_value > 0) {
                  min_value = 0;
              }
              var max_value = Math.max.apply(Math, all);
  
              $(div).sparkline(this_year, {
                  type: 'bar',
                  barWidth: 6,
                  barColor: '#3498db',
                  negBarColor: '#ef4836',
                  chartRangeMinX: 0,
                  chartRangeMaxX: 12,
                  chartRangeMin: min_value,
                  chartRangeMax: max_value,
                  zeroAxis: true
              });
              $(div).sparkline(last_year, {
                  composite: true,
                  type: 'line',
                  lineColor: '#ef4836',
                  width: 83,
                  zeroAxis: true,
                  chartRangeClip: true,
                  chartRangeMin: min_value,
                  chartRangeMax: max_value,
                  chartRangeMinX: 0,
                  chartRangeMaxX: 12,
                  fillColor: null,
                  spotColor: null,
                  minSpotColor: null,
                  maxSpotColor: null,
                  highlightSpotColor: null,
                  highlightLineColor: null
              });
          });
      }
  
      function sendValidation(data, selector) {
          $.ajax({
              type: "POST",
              dataType: 'json',
              headers: {
                  'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
              },
              url: "/validations",
              data: data,
              success: function (data) {
                  selector.text(data.response);
              },
              error: function (data) {
                  var response = data.responseJSON;
                  if (data.status === 401) {
                      window.location.href = response.redirect;
                  } else {
                      selector.text(data.response);
                  }
              }
          });
      }
  
      function percentRankColor(array, n) {
          var rank = percentRank(array, n);
  
          if (rank <= 1 / 6) {
              return '#63be7b';
          } else if (rank <= 2 / 6) {
              return '#b9d780';
          } else if (rank <= 3 / 6) {
              return '#ffe583';
          } else if (rank <= 4 / 6) {
              return '#fed380';
          } else if (rank <= 5 / 6) {
              return '#fba176';
          } else {
              return '#f8696b';
          }
      }
  
      // Retorna el percentil d'un valor dins un array
      // src: https://gist.github.com/IceCreamYou/6ffa1b18c4c8f6aeaad2
      function percentRank(array, n) {
          array.sort();
  
          var L = 0;
          var S = 0;
          var N = array.length;
  
          for (var i = 0; i < array.length; i++) {
              if (array[i] < n) {
                  L += 1
              } else if (array[i] === n) {
                  S += 1
              } else {
  
              }
          }
  
          var pct = (L + (0.5 * S)) / N;
          return pct
      }
  
      /*
           Converteix un numero n p.ex. 0.98 a %, p.ex 98, amb el nombre de decimals especificat per d
           */
      function to_tpc(n, d) {
          d = (typeof d !== 'undefined') ? d : 0;
          n = n * 100;
          return Math.round(n, d);
      }
  
  
      function partial_to_tpc(partial, total) {
          var tpc = (total === 0) ? 0 : partial / total;
          return to_tpc(tpc);
      }
  
      function draw_monthly_forecast_chart(chart_id, previous_year, current_year, forecast, max_value) {
          // normalitzem els valors i fem que no puguin ser inferiors a 0
          previous_year = Math.max(0, previous_year / (max_value * 1.05));
          current_year = Math.max(0, current_year / (max_value * 1.05));
          forecast = Math.max(0, forecast / (max_value * 1.05));
  
          var chart_options = {
              type: 'bullet',
              height: '18px',
              rangeColors: ['#f4f4f4'],
              disableInteraction: true,
              width: '100%',
              targetColor: '#aaa',
              disabledHiddenCheck: true
          };
  
          if (forecast === 0) {
              chart_options['targetColor'] = 'transparent';
          }
  
          chart_options['performanceColor'] = (current_year > previous_year) ? '#acd67a' : '#f55753';
          if (current_year <= 0) {
              chart_options['performanceColor'] = 'transparent';
          }
  
          var container = chart_id.closest('.tab-pane')[0];
          container.style.display = 'block';
          chart_id.sparkline([forecast, current_year, previous_year, 1], chart_options);
          container.style.display = '';
  
      }
  
      function draw_monthly_forecast_line_charts_old_client(placeholder_id, data) {
          var monthly_forecast = new google.visualization.DataTable();
          monthly_forecast.addColumn('string', 'month');
          monthly_forecast.addColumn('number', data['label_previous']);
          monthly_forecast.addColumn('number', data['label_current']);
          monthly_forecast.addColumn('number', data['label_prediction']);
  
          var dataLength = data['data'].length;
          var greatherThanPrediction = true;
          for (var i = 0; i < dataLength; i++) {
              monthly_forecast.addRow([
                  data['data'][i]['month'],
                  data['data'][i]['previous'],
                  data['data'][i]['current'],
                  data['data'][i]['forecast']
              ]);
  
              if (data['data'][i]['current'] !== null && data['data'][i]['forecast'] !== null
                  && data['data'][i]['previous'] > data['data'][i]['forecast']) {
                  greatherThanPrediction = false;
              }
          }
  
          if (greatherThanPrediction) {
              var color = '#acd67a';
          } else {
              var color = '#fd6b5f'
          }
  
          var options_monthly_forecast = {
              curveType: 'function',
              title: '',
              seriesType: 'bars',
              bar: {groupWidth: "90%"},
              hAxis: {
                  titleTextStyle: {
                      color: '#333'
                  },
                  gridlines: {
                      color: '#fff',
                      count: 3
                  },
                  baselineColor: '#eee',
                  format: 'd',
                  // ticks: tickMarks,
                  textPosition: 'in',
                  allowContainerBoundaryTextCufoff: true,
                  textStyle: {
                      // fontSize: 9 // or the number you want
                  }
              },
              fontSize: 11,
              lineWidth: 3,
              pointSize: 3,
              'chartArea': {
                  left: 10,
                  right: 10, //!!! works !!!
                  bottom: 20,  // !!! works !!!
                  top: 0,
                  width: "100%",
                  height: "100%"
              },
              'legend': {position: 'bottom', alignment: 'start'},
              vAxis: {
                  viewWindowMode: 'explicit',
                  baselineColor: '#ccc',
                  textPosition: 'in',
                  format: '#,### €'
                  // minValue: 0
              },
              height: '100%',
              // series: [{'color': "#e5e5e5"}, {'color': '#ff8a80',type: 'line'}, {'color': '#3498db',type: 'line'}]
              series: [{'color': "#ccc"}, {'color': color, type: 'line'}, {
                  'color': color,
                  type: 'line',
                  lineDashStyle: [10, 4]
              }]
          };
  
          var container = $($('#' + placeholder_id)[0]).closest('.tab-pane')[0];
          container.style.display = 'block';
          var chart_monthly_forecast = new google.visualization.ComboChart($('#' + placeholder_id)[0]);
          google.visualization.events.addListener(chart_monthly_forecast, 'ready', function () {
              container.style.display = '';
          });
          chart_monthly_forecast.draw(monthly_forecast, options_monthly_forecast);
  
      }
  
      function sumAggFooter(datatables_key, filter_criteria, summary_user,totals) {
          var metrics_distinct_product_uuid_active_unique = totals['metrics_distinct_product_uuid_active_unique'];
          setValueFormat(datatables_key, "metrics_distinct_product_uuid_active_unique", metrics_distinct_product_uuid_active_unique,metrics_distinct_product_uuid_active_unique);
  
          var metrics_distinct_client_uuid_active_unique = totals['metrics_distinct_client_uuid_active_unique'];
          setValueFormat(datatables_key, "metrics_distinct_client_uuid_active_unique", metrics_distinct_client_uuid_active_unique,metrics_distinct_client_uuid_active_unique);
  
          // var metrics_distinct_product_uuid_active = totals['metrics_distinct_product_uuid_active'];
          // setValueFormat(datatables_key, "metrics_distinct_product_uuid_active", metrics_distinct_product_uuid_active,metrics_distinct_product_uuid_active);
  
          var metrics_avg_product_client = totals['metrics_avg_product_client'];
          setValueFormat(datatables_key, "metrics_avg_product_client", metrics_avg_product_client, Number(parseFloat(metrics_avg_product_client)).toFixed(1));
  
          var metrics_avg_mtd_client = Number(parseFloat(totals['metrics_avg_mtd_client']).toFixed());
          var metrics_avg_ytd_client = Number(parseFloat(totals['metrics_avg_ytd_client']).toFixed());
  
          if (field_criteria === "net_amount") {
              setValueFormat(datatables_key, "metrics_avg_mtd_client", metrics_avg_mtd_client,formatCashNewDatatables(metrics_avg_mtd_client, "display"));
              setValueFormat(datatables_key, "metrics_avg_ytd_client", metrics_avg_ytd_client,formatCashNewDatatables(metrics_avg_ytd_client, "display"));
          } else {
              setValueFormat(datatables_key, "metrics_avg_mtd_client", metrics_avg_mtd_client,formatQuantityNewDatatables(metrics_avg_mtd_client, "display"));
              setValueFormat(datatables_key, "metrics_avg_ytd_client", metrics_avg_ytd_client,formatQuantityNewDatatables(metrics_avg_ytd_client, "display"));
          }
  
          if (!jQuery.isEmptyObject(filter_criteria) || datatables[datatables_key].page.info().recordsDisplay !== datatables[datatables_key].page.info().recordsTotal || jQuery.isEmptyObject(summary_user)) {
              //Sum values from table
              sumAggColumns(datatables_key, "metrics_MTD-1_avg", "metrics_MTD_avg", "metrics_%_MTD_avg_MINUS_MTD-1_avg", "metrics_%_MTD-1_avg_VS_MTD_avg");
              sumAggColumns(datatables_key, "metrics_MTD-1", "metrics_MTD", "metrics_%_MTD_MINUS_MTD-1", "metrics_%_MTD-1_VS_MTD");
              sumAggColumns(datatables_key, "metrics_M-1", "metrics_FORECAST_M", "metrics_%_FORECAST_M_MINUS_M-1", "metrics_%_M-1_VS_FORECAST_M");
              sumAggColumns(datatables_key, "metrics_YTD-1", "metrics_YTD", "metrics_%YTD_M_MINUS_YTD-1", "metrics_%_YTD-1_VS_YTD");
              sumAggColumns(datatables_key, "metrics_Y-1", "metrics_FORECAST_Y", "metrics_%_FORECAST_Y_MINUS_Y-1", "metrics_%_Y-1_VS_FORECAST_Y");
  
              /* returns */
              var total_YTD = sumAggColumn(datatables_key, "metrics_YTD");
              var total_returns = sumAggColumn(datatables_key, "metrics_RETURNS_YTD");
              var divisor_percentage_returns = Math.max(total_YTD, 0) + Math.abs(total_returns);
              if (divisor_percentage_returns === 0) {
                  var percentage_returns = 0;
              } else {
                  var percentage_returns = Math.round(Math.abs(total_returns) / divisor_percentage_returns * 100);
              }
              setValueFormat(datatables_key, "metrics_RETURNS_YTD", total_returns, formatCashNewDatatables(total_returns, "display"));
              setValueFormat(datatables_key, "metrics_%RETURNS_YTD_VS_YTD", percentage_returns, percentageFormat(percentage_returns));
              var element_percentage = $(datatables[datatables_key].column('metrics_%RETURNS_YTD_VS_YTD:name').footer());
              getColorReturns(element_percentage, percentage_returns);
              /* end returns */
  
              /* credit_notes */
                          /* end credit_notes */
  
              /* margin */
                          if (field_criteria === "net_amount" ) {
                  var total_margin = sumAggColumn(datatables_key, "metrics_MARGIN_YTD");
                  if (total_YTD === 0) {
                      var percentage_margin = 0;
                  } else {
                      var percentage_margin = total_margin / total_YTD * 100;
                  }
                  setValueFormat(datatables_key, "metrics_MARGIN_YTD", total_margin, formatCashNewDatatables(total_margin, "display"));
                  {
                      setValueFormat(datatables_key, "metrics_%MARGIN_YTD_VS_YTD", percentage_margin, percentageFormat(percentage_margin));
                  }
                                  var element_percentage_margin = $(datatables[datatables_key].column('metrics_%MARGIN_YTD_VS_YTD:name').footer());
                  getColor2(element_percentage_margin, percentage_margin);
              }
                          /* end margin */
  
              var forecast_next_year =sumAggColumn(datatables_key, "metrics_FORECAST_NEXT_Y")
              if (field_criteria === "net_amount") {
                  setValueFormat(datatables_key, "metrics_FORECAST_NEXT_Y", forecast_next_year,formatCashNewDatatables(forecast_next_year, "display"));
              } else {
                  setValueFormat(datatables_key, "metrics_FORECAST_NEXT_Y", forecast_next_year,formatQuantityNewDatatables(forecast_next_year, "display"));
              }
  
                      } else {
              // load data from users precalculated fields
              var keys_amount = [
                  "metrics_MTD-1_avg",
                  "metrics_MTD_avg",
                  "metrics_%_MTD_avg_MINUS_MTD-1_avg",
                  "metrics_MTD-1",
                  "metrics_MTD",
                  "metrics_%_MTD_MINUS_MTD-1",
                  "metrics_M-1",
                  "metrics_FORECAST_M",
                  "metrics_%_FORECAST_M_MINUS_M-1",
                  "metrics_YTD-1",
                  "metrics_YTD",
                  "metrics_%YTD_M_MINUS_YTD-1",
                  "metrics_Y-1",
                  "metrics_FORECAST_Y",
                  "metrics_FORECAST_NEXT_Y",
                  "metrics_%_FORECAST_Y_MINUS_Y-1",
                  "metrics_RETURNS_YTD",
                  "metrics_CREDIT-NOTES_YTD",
                  "metrics_MARGIN_YTD",
              ];
              var keys_percentage = [
                  "metrics_%_MTD-1_avg_VS_MTD_avg",
                  "metrics_%_MTD-1_VS_MTD",
                  "metrics_%_M-1_VS_FORECAST_M",
                  "metrics_%_YTD-1_VS_YTD",
                  "metrics_%_Y-1_VS_FORECAST_Y",
  
              ];
  
              
              if (field_criteria === "net_amount") {
                  keys_amount.forEach(function (key) {
                      var number = Number(parseFloat(summary_user[key]).toFixed());
                      setValueFormat(datatables_key, key, number, formatCashNewDatatables(number, "display"));
                  });
              } else {
                  keys_amount.forEach(function (key) {
                      var number = Number(parseFloat(summary_user[key]).toFixed());
                      setValueFormat(datatables_key, key, number, formatQuantityNewDatatables(number, "display"));
                  });
              }
              keys_percentage.forEach(function (key) {
                  setValueFormat(datatables_key, key, summary_user[key], percentageFormat(summary_user[key]));
                  var element = $(datatables[datatables_key].column(key + ':name').footer());
                  getColor2(element, summary_user[key]);
              });
  
              setValueFormat(datatables_key, "metrics_%RETURNS_YTD_VS_YTD", summary_user["metrics_%RETURNS_YTD_VS_YTD"], percentageFormat(summary_user["metrics_%RETURNS_YTD_VS_YTD"]));
              var element_percentage = $(datatables[datatables_key].column('metrics_%RETURNS_YTD_VS_YTD:name').footer());
              getColorReturns(element_percentage,  summary_user["metrics_%RETURNS_YTD_VS_YTD"]);
  
              setValueFormat(datatables_key, "metrics_%CREDIT-NOTES_YTD_VS_YTD", summary_user["metrics_%CREDIT-NOTES_YTD_VS_YTD"], percentageFormat(summary_user["metrics_%CREDIT-NOTES_YTD_VS_YTD"]));
              var element_percentage = $(datatables[datatables_key].column('metrics_%CREDIT-NOTES_YTD_VS_YTD:name').footer());
              getColorReturns(element_percentage,  summary_user["metrics_%CREDIT-NOTES_YTD_VS_YTD"]);
  
              if (field_criteria === "net_amount") {
                  {
                      setValueFormat(datatables_key, "metrics_%MARGIN_YTD_VS_YTD", summary_user["metrics_%MARGIN_YTD_VS_YTD"], percentageFormat(summary_user["metrics_%MARGIN_YTD_VS_YTD"]));
                  }
                                  var element_percentage_margin = $(datatables[datatables_key].column('metrics_%MARGIN_YTD_VS_YTD:name').footer());
                  getColor2(element_percentage_margin, summary_user["metrics_%MARGIN_YTD_VS_YTD"]);
              }
          }
      }
  
      function getColor2(element, percentage) {
          /* new */
          if (percentage === "" || percentage ===0) {
              return
          }
          if (percentage < 0) {
              element.css('background-color', "#FFC7CE");
              element.css('color', '#f00');
          } else {
              element.css('background-color', "#C8DB81");
              element.css('color', 'inherit');
          }
      }
  
      function getColorReturns(element, percentage) {
          /* new */
          if (percentage > 0) {
              element.css('background-color', "#FFC7CE");
              element.css('color', '#f00');
          }
      }
  
  
      function percentageFormat(data,decimals=0) {
          if (data !== "") {
              data = round(data,decimals);
              return data + " %";
          } else {
              return data;
          }
      }
  
      function setValueFormat(datatables_key, column, value, formated_value) {
          $(datatables[datatables_key].column(column + ':name').footer()).html(formated_value);
          if (value < 0) {
              $(datatables[datatables_key].column(column + ':name').footer()).css('color', '#f00');
          } else {
              $(datatables[datatables_key].column(column + ':name').footer()).css('color', 'inherit');
          }
      }
  
      function setValueFormatPercentage(datatables_key, column, previous, current) {
          var percent = previous === 0 ? "" : 100 * (current - previous) / Math.abs(previous);
          var element = $(datatables[datatables_key].column(column + ':name').footer());
          if (previous !== 0) {
              element.html(percentageFormat(percent));
              // var color = getColor(percentage);
              // element.css('background-color', color);
              getColor2(element, percent);
          } else {
              element.html("");
              element.css('background-color', "#f6f6f6");
              element.css('color', 'inherit');
          }
      }
  
      function sumAggColumns(datatables_key, last, current, amount, percentage) {
          var m_12 = sumAggColumn(datatables_key, last);
          var f_12 = sumAggColumn(datatables_key, current);
  
          if (field_criteria === "net_amount") {
              setValueFormat(datatables_key, current, f_12, formatCashNewDatatables(f_12, "display"));
              setValueFormat(datatables_key, last, m_12, formatCashNewDatatables(m_12, "display"));
              setValueFormat(datatables_key, amount, f_12 - m_12, formatCashNewDatatables(f_12 - m_12, "display"));
          } else { /* quantity */
              setValueFormat(datatables_key, current, f_12, formatQuantityNewDatatables(f_12, "display"));
              setValueFormat(datatables_key, last, m_12, formatQuantityNewDatatables(m_12, "display"));
              setValueFormat(datatables_key, amount, f_12 - m_12, formatQuantityNewDatatables(f_12 - m_12, "display"));
          }
          setValueFormatPercentage(datatables_key, percentage, m_12, f_12);
      }
  
      function sumAggColumn(datatables_key, name) {
          var sum = datatables[datatables_key].column(name + ':name', {"filter": "applied"}).data()
              .reduce(function (a, b) {
                  var x = parseFloat(a) || 0;
                  var y = parseFloat(b) || 0;
                  return x + y;
              }, 0);
          return Number(sum.toFixed());
      }
  
  
      function drawTableInvoices(serie, id_element, data_value_key) {
          var locale = "ca";
          $("#" + id_element).empty();
          var is_net_amount = data_value_key === "net_amount";
  
          if (serie) {
              var data = isJSON(serie) ? JSON.parse(serie) : serie;
              var dates = Object.keys(data).sort();
  
              var start = dates[0];
              var end = dates[dates.length - 1];
              moment.locale(locale);
              var yearStart = parseInt(moment(start, "YYYY-MM-DD").format("YYYY"));
              var yearEnd = parseInt(moment(end, "YYYY-MM-DD").format("YYYY"));
  
              //Initialize table and columns name row
              var tablearea = document.getElementById(id_element),
                  table = document.createElement('table'),
                  thead = document.createElement('thead'),
                  tbody = document.createElement('tbody');
              table.className = 'table dataTable cell-border table-striped table-invoices no-footer ';
              var months = moment.monthsShort();
  
              var tr = document.createElement('tr');
              tr.appendChild(document.createElement('th'));
              tr.cells[0].appendChild(document.createTextNode(""));
  
              for (var i = 0; i < months.length; i++) {
                  var th = document.createElement('th');
                  th.className = "text-right";
                  tr.appendChild(th);
                  tr.cells[i + 1].appendChild(document.createTextNode(months[i].substring(0, months[i].length - 1).toUpperCase()))
              }
  
              var th = document.createElement('th');
              th.className = "text-right";
              tr.appendChild(th);
              tr.cells[months.length + 1].appendChild(document.createTextNode('total'));
  
              var th = document.createElement('th');
              th.className = "text-right";
              tr.appendChild(th);
              tr.cells[months.length + 2].appendChild(document.createTextNode('%'));
  
              thead.appendChild(tr);
              table.appendChild(thead);
  
              //fill data
              var indexDate = 0;
              var totals = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
              var total_last_year = 0;
              for (i = 0; i <= yearEnd - yearStart; i++) {
                  var total_year = 0;
                  var tmp_current_year = yearStart + i;
                  tr = document.createElement('tr');
                  for (var j = 0; j < months.length + 3; j++) {
                      var td = document.createElement('td');
                      if (j === 0 || j === months.length + 1) {
                          td.className = "text-right bold"
                      } else if (j === 0) {
                          td.className = "text-left bold"
                      } else {
                          td.className = "text-right";
                      }
                      td.style.padding = "4px";
  
                      tr.appendChild(td);
                  }
                  tr.cells[0].appendChild(document.createTextNode(tmp_current_year));
  
                  var finish = false;
                  while (!finish && indexDate < dates.length) {
                      var percentage_diff = "";
                      var tmp_date = dates[indexDate];
                      var tmp_year = parseInt(moment(tmp_date, "YYYY-MM-DD").format("YYYY"));
                      var tmp_month = parseInt(moment(tmp_date, "YYYY-MM-DD").format("M"));
  
                      if (tmp_year === tmp_current_year) {
                          var tmp_val = data[tmp_date][data_value_key];
                          var tmp_val_rounded = Math.round(tmp_val);
                          var tmp_value = is_net_amount ? formatCashNewDatatables(tmp_val_rounded, "display") : formatQuantityNewDatatables(tmp_val_rounded, "display");
  
                          // if (tmp_val!==0){
                          //     var percentatge_marge =Math.round(((((tmp_val/10) % 10)%4)+4)*5)+" % ";
                          //     tmp_value+= "<br><span style='font-size:7pt;color:#999'>" + percentatge_marge + "</span>";
                          // }
  
                          if ("last_year" in data[tmp_date]) {
                              var tmp_val_last_year = data[tmp_date]['last_year'];
                              tmp_val_last_year = Math.round(tmp_val_last_year);
                              tmp_val_last_year = is_net_amount ? formatCashNewDatatables(tmp_val_last_year, "display") : formatQuantityNewDatatables(tmp_val_last_year, "display");
                              tmp_value += "<br><span style='color:#626262'>(" + tmp_val_last_year + ")*</span>";
                          }
  
                          var tmp_span = document.createElement('span');
                          var t = "";
                          if (tmp_val_rounded < 0) {
                              t = "bold";
                              tmp_span.className = "color-negative-value  " + t;
                          }
                          var tmp_color_month = "";
                          if (i !== 0 && tmp_val_rounded < totals[tmp_month - 1] && totals[tmp_month - 1] !== -1) {
                              tr.cells[tmp_month].className = "text-right color-red " + t;
                          }
  
                          tr.cells[tmp_month].appendChild(tmp_span);
                          $(tmp_span).append(tmp_value);
                          totals[tmp_month - 1] = tmp_val_rounded;
                          total_year += tmp_val;
                          indexDate++;
                      } else {
                          finish = true;
                      }
                  }
  
                  if (total_last_year > total_year) {
                      tr.cells[months.length + 1].className = "text-right color-red bold";
                      var class_percentage = " color-negative-value";
                  } else {
                      var class_percentage = " color-positive-value";
                  }
                  if (total_last_year !== 0) {
                      percentage_diff = "<span class='" + class_percentage + "'>" + Math.round((total_year - total_last_year) / Math.abs(total_last_year) * 100) + " % </span>";
                  }
                  total_last_year = total_year;
                  var total_year_string = is_net_amount ? formatCashNewDatatables(Math.round(total_year), "display") : formatQuantityNewDatatables(Math.round(total_year), "display");
  
                  // if (total_year!==0){
                  //     var percentatge_marge =Math.round(((((total_year/10) % 10)%4)+4)*5)+" % ";
                  //     total_year_string+= "<br><span style='font-size:7pt;color:#999'>" + percentatge_marge + "</span>";
                  // }
  
                  var total_node = $("<span>" + total_year_string + "</span>");
                  $(tr.cells[months.length + 1]).append(total_node);
                  $(tr.cells[months.length + 2]).append(percentage_diff);
                  tbody.appendChild(tr);
                  // tbody.insertBefore(tr, tbody.firstChild);
              }
              table.appendChild(tbody);
              tablearea.appendChild(table);
  
              $('#' + id_element).scrollbar();
          }
      }
  
      function drawTableInvoicesWeek(serie, id_element, data_value_key) {
          var locale = "ca";
          $("#" + id_element).empty();
          var is_net_amount = data_value_key === "net_amount";
  
          if (serie) {
              var data = isJSON(serie) ? JSON.parse(serie) : serie;
              var dates = Object.keys(data);
  
              var start = dates[0];
              var end = dates[dates.length - 1];
              moment.locale(locale);
              var yearStart = parseInt(start.split("-")[0]);
              var yearEnd = parseInt(end.split("-")[0]);
  
              //Initialize table and columns name row
              var tablearea = document.getElementById(id_element),
                  table = document.createElement('table'),
                  thead = document.createElement('thead'),
                  tbody = document.createElement('tbody');
              table.className = 'table dataTable cell-border table-striped table-invoices no-footer ';
              var weeks = [];
              for (var i = 1; i <= 53; i++) {
                  weeks.push("S" + i);
                  /* TODO translate S to messages */
              }
              var tr = document.createElement('tr');
              tr.appendChild(document.createElement('th'));
              tr.cells[0].appendChild(document.createTextNode(""));
  
              for (var i = 0; i < weeks.length; i++) {
                  var th = document.createElement('th');
                  th.className = "text-right";
                  tr.appendChild(th);
                  tr.cells[i + 1].appendChild(document.createTextNode(weeks[i]))
              }
  
              var th = document.createElement('th');
              th.className = "text-right";
              tr.appendChild(th);
              tr.cells[weeks.length + 1].appendChild(document.createTextNode('total'));
  
              var th = document.createElement('th');
              th.className = "text-right";
              tr.appendChild(th);
              tr.cells[weeks.length + 2].appendChild(document.createTextNode('%'));
  
              thead.appendChild(tr);
              table.appendChild(thead);
  
              // //fill data
              var indexDate = 0;
              var totals = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1];
              var total_last_year = 0;
              for (i = 0; i <= yearEnd - yearStart; i++) {
                  var total_year = 0;
                  var tmp_current_year = yearStart + i;
                  tr = document.createElement('tr');
                  for (var j = 0; j < weeks.length + 3; j++) {
                      var td = document.createElement('td');
                      if (j === 0 || j === weeks.length + 1) {
                          td.className = "text-right bold"
                      } else if (j === 0) {
                          td.className = "text-left bold"
                      } else {
                          td.className = "text-right";
                      }
                      td.style.padding = "4px";
  
                      tr.appendChild(td);
                  }
                  tr.cells[0].appendChild(document.createTextNode(tmp_current_year));
  
                  for (var week = 1; week <= weeks.length; week++) {
                      var index_year_week = tmp_current_year + "-" + week;
  
                      if (!data.hasOwnProperty(index_year_week)) {
                          continue;
                      }
  
                      var percentage_diff = "";
                      var tmp_val = data[index_year_week][data_value_key];
                      var tmp_val_rounded = Math.round(tmp_val);
                      var tmp_value = is_net_amount ? formatCashNewDatatables(tmp_val_rounded, "display") : formatQuantityNewDatatables(tmp_val_rounded, "display");
  
                      var tmp_span = document.createElement('span');
                      var t = "";
                      if (tmp_val_rounded < 0) {
                          t = "bold";
                          tmp_span.className = "color-negative-value  " + t;
                      }
                      var tmp_color_month = "";
                      if (i !== 0 && tmp_val_rounded < totals[week - 1] && totals[week - 1] !== -1) {
                          tr.cells[week].className = "text-right color-red " + t;
                      }
  
                      tr.cells[week].appendChild(tmp_span);
                      $(tmp_span).append(tmp_value);
                      totals[week - 1] = tmp_val_rounded;
                      total_year += tmp_val;
                      indexDate++;
                  }
  
                  if (total_last_year > total_year) {
                      tr.cells[weeks.length + 1].className = "text-right color-red bold";
                      var class_percentage = " color-negative-value";
                  } else {
                      var class_percentage = " color-positive-value";
                  }
                  if (total_last_year !== 0) {
                      percentage_diff = "<span class='" + class_percentage + "'>" + Math.round((total_year - total_last_year) / Math.abs(total_last_year) * 100) + " % </span>";
                  }
                  total_last_year = total_year;
                  var total_year_string = is_net_amount ? formatCashNewDatatables(Math.round(total_year), "display") : formatQuantityNewDatatables(Math.round(total_year), "display");
  
                  // if (total_year!==0){
                  //     var percentatge_marge =Math.round(((((total_year/10) % 10)%4)+4)*5)+" % ";
                  //     total_year_string+= "<br><span style='font-size:7pt;color:#999'>" + percentatge_marge + "</span>";
                  // }
  
                  var total_node = $("<span>" + total_year_string + "</span>");
                  $(tr.cells[weeks.length + 1]).append(total_node);
                  $(tr.cells[weeks.length + 2]).append(percentage_diff);
                  tbody.appendChild(tr);
                  // tbody.insertBefore(tr, tbody.firstChild);
              }
              table.appendChild(tbody);
              tablearea.appendChild(table);
  
              $('#' + id_element).scrollbar();
          }
      }
  
      function isJSON(str) {
          try {
              return (JSON.parse(str) && !!str);
          } catch (e) {
              return false;
          }
      }
  
      function drawDailyForecast(current_date, data, key, placeholder_id, annotations, show_forecast) {
          var current_date = moment(current_date);
          var current_day = current_date.date();
  
          /* Defining color */
          var total_last_year = Math.round(data[key]['last_year'][Object.keys(data[key]['last_year']).length][field_criteria]);
          var total_fcast = Math.round(data[key]['forecast'][Object.keys(data[key]['forecast']).length][field_criteria]);
  
          if (!annotations) {
              var total_last_year2 = 0;
              for (var i = 1; i <= Object.keys(data[key]['last_year']).length; i++) {
                  total_last_year2 += data[key]['last_year'][i][field_criteria];
              }
  
              var total_fcast2 = 0;
              for (var i = 1; i <= Object.keys(data[key]['real']).length; i++) {
                  total_fcast2 += data[key]['real'][i][field_criteria];
              }
              for (var i = 1; i <= Object.keys(data[key]['forecast']).length; i++) {
                  total_fcast2 += data[key]['forecast'][i][field_criteria];
              }
  
              total_last_year = Math.round(total_last_year2 / Object.keys(data[key]['real']).length);
              total_fcast = total_fcast2;
              var greatherThanPrediction = total_fcast > total_last_year2;
          } else {
              var greatherThanPrediction = total_fcast > total_last_year;
          }
  
          if (greatherThanPrediction) {
              var color = '#acd67a';
          } else {
              var color = '#fd6b5f'
          }
          /* End defining color */
  
          var current = [];
          var previous = [];
          var previous_2 = [];
          var forecast = [];
          var labels = [];
          for (var i = 1; i <= Object.keys(data[key]['real']).length; i++) {
              var val_previous = null;
              if (data[key]['last_year'][i][field_criteria] != null) {
                  val_previous = Math.round(data[key]['last_year'][i][field_criteria]);
              }
              previous.push(val_previous);
  
              var val_previous_2 = null;
              if (data[key]['last_2_year'][i][field_criteria] != null) {
                  val_previous_2 = Math.round(data[key]['last_2_year'][i][field_criteria]);
              }
              previous_2.push(val_previous_2);
  
              var val_real = null;
              if (data[key]['real'][i][field_criteria] != null && i <= current_day) {
                  val_real = Math.round(data[key]['real'][i][field_criteria]);
              }
              current.push(val_real);
  
              var val_forecast = null;
              if (data[key]['forecast'][i][field_criteria] != null && i >= current_day) {
                  val_forecast = Math.round(data[key]['forecast'][i][field_criteria]);
              }
              forecast.push(val_forecast);
              labels.push(i);
          }
  
          var data_chart = {
              'current': {
                  'label': moment(data['date']).year(),
                  'data': current
              },
              'previous': {
                  'label': moment(data['date']).year() - 1,
                  'data': previous
              },
              'previous_2': {
                  'label': moment(data['date']).year() - 2,
                  'data': previous_2
              },
              'forecast': {
                  'label': 'PREVISIÓ',
                  'data': forecast
              },
              'labels': labels,
              'color': color
          };
          draw_real_previous_forecast_chart(placeholder_id, data_chart, show_forecast);
      }
  
      function getFormatSign(field_force) {
          if(field_force){
              return field_force === "net_amount" ? '€' : '#';
          }
          else {
              return field_criteria === "net_amount" ? '€' : '#';
          }
      }
  
      function drawDailyForecastOld(current_date, data, key, element, annotations) {
          var current_date = moment(current_date);
          var current_day = current_date.date();
  
          /* DAILY FORECAST */
          var data_daily_forecast = new google.visualization.DataTable();
          data_daily_forecast.addColumn('number', 'date');
          data_daily_forecast.addColumn('number', 'ANY PASSAT');
          data_daily_forecast.addColumn('number', 'REAL');
          data_daily_forecast.addColumn({type: 'string', role: 'annotation'});
          data_daily_forecast.addColumn('number', 'MESSAGES.FORECAT');
          data_daily_forecast.addColumn({type: 'string', role: 'annotation'});
  
  
          var total_last_year = Math.round(data[key]['last_year'][Object.keys(data[key]['last_year']).length][field_criteria]);
          var total_fcast = Math.round(data[key]['forecast'][Object.keys(data[key]['forecast']).length][field_criteria]);
  
          if (!annotations) {
              var total_last_year2 = 0;
              for (var i = 1; i <= Object.keys(data[key]['last_year']).length; i++) {
                  total_last_year2 += data[key]['last_year'][i][field_criteria];
              }
  
              var total_fcast2 = 0;
              for (var i = 1; i <= Object.keys(data[key]['real']).length; i++) {
                  total_fcast2 += data[key]['real'][i][field_criteria];
              }
              for (var i = 1; i <= Object.keys(data[key]['forecast']).length; i++) {
                  total_fcast2 += data[key]['forecast'][i][field_criteria];
              }
  
              total_last_year = Math.round(total_last_year2 / Object.keys(data[key]['real']).length);
              total_fcast = total_fcast2;
              var greatherThanPrediction = total_fcast > total_last_year2;
          } else {
              var greatherThanPrediction = total_fcast > total_last_year;
          }
  
          if (greatherThanPrediction) {
              var color = '#acd67a';
          } else {
              var color = '#fd6b5f'
          }
  
  
          var values = [];
          for (var i = 1; i <= Object.keys(data[key]['real']).length; i++) {
              var val_last_year = null;
              if (data[key]['last_year'][i][field_criteria] != null) {
                  val_last_year = Math.round(data[key]['last_year'][i][field_criteria]);
              }
  
              var val_real = null;
              var val_real_string = null;
              if (data[key]['real'][i][field_criteria] != null && i <= current_day) {
                  val_real = Math.round(data[key]['real'][i][field_criteria]);
              }
              var val_forecast = null;
              var val_forecast_string = null;
              if (data[key]['forecast'][i][field_criteria] != null && i > current_day) {
                  val_forecast = Math.round(data[key]['forecast'][i][field_criteria]);
              } else if (data[key]['forecast'][i][field_criteria] != null && i === current_day) {
                  val_forecast = val_real;
              }
  
              if (annotations) {
                  if (data[key]['forecast'][i][field_criteria] != null && data[key]['real'][i][field_criteria] != null && i <= current_day) {
                      val_real_string = formatNumber(val_real).toString();
                  }
                  if (i === Object.keys(data[key]['real']).length && i >= current_day) {
                      val_forecast_string = formatNumber(val_forecast).toString();
                  }
              }
              data_daily_forecast.addRow([i, val_last_year, val_real, val_real_string, val_forecast, val_forecast_string]);
              values.push(val_real);
              values.push(val_last_year);
              values.push(val_forecast);
          }
  
          var min_value = Math.min.apply(null, values);
          var max_value = Math.max.apply(null, values);
  
          var tickMarks = [];
          for (var i = data_daily_forecast.getNumberOfRows() - 1; i > 0; i -= 2) {
              var testDate = data_daily_forecast.getValue(i, 0);
              tickMarks.push(testDate);
          }
          var options_daily_forecast = {
              // curveType: 'function',
              title: '',
              seriesType: 'bars',
              bar: {groupWidth: "90%"},
              hAxis: {
                  titleTextStyle: {
                      color: '#333'
                  },
                  gridlines: {
                      color: '#fff',
                      count: 10
                  },
                  baselineColor: '#eee',
                  // format: 'd',
                  ticks: tickMarks,
                  textPosition: 'in',
                  allowContainerBoundaryTextCufoff: false,
                  textStyle: {
                      // fontSize: 9 // or the number you want
                  }
              },
              fontSize: 11,
              lineWidth: 3,
              pointSize: 4,
              'chartArea': {
                  left: 10,
                  right: 10, // !!! works !!!
                  bottom: 20,  // !!! works !!!
                  top: 10,
                  width: "100%",
                  height: "10%"
              },
              'legend': {position: 'bottom', alignment: 'start'},
              vAxis: {
                  viewWindowMode: 'explicit',
                  baselineColor: '#ccc',
                  textPosition: 'in',
                  minValue: 0,
                  format: '#,### ' + getFormatSign(),
                  viewWindow: {
                      min: min_value,
                      max: max_value
                  }
              },
              height: '100%',
              series: [{'color': "#f4f4f4"}, {'color': color, type: 'line'}, {
                  'color': color,
                  type: 'line',
                  lineDashStyle: [10, 4],
                  pointSize: 0
              }, {'color': "#3498db", type: 'line', lineDashStyle: [4, 4], pointSize: 0}]
          };
  
  
          var container = $($(element)[0]).closest('.tab-pane')[0];
          container.style.display = 'block';
          var chart_daily_forecast = new google.visualization.ComboChart($(element)[0]);
          google.visualization.events.addListener(chart_daily_forecast, 'ready', function () {
              container.style.display = '';
          });
  
          chart_daily_forecast.draw(data_daily_forecast, options_daily_forecast);
      }
  
      function clearCanvas(placeholder_id) {
          var c = document.getElementById(placeholder_id);
          var ctx = c.getContext("2d");
          ctx.clearRect(0, 0, c.width, c.height);
          ctx.destroy();
      }
  
      function draw_real_previous_forecast_chart(placeholder_id, data, show_forecast) {
          var saved_placeholder_id = "charts_" + placeholder_id;
          // console.log(window[saved_placeholder_id])
          if (window[saved_placeholder_id]) {
              window[saved_placeholder_id].clear();
              window[saved_placeholder_id].destroy();
          }
  
          // console.log(data);
          if (show_forecast) {
              var data_chart = {
                  labels: data['labels'],
                  datasets: [
                      {
                          label: data['forecast']['label'],
                          borderColor: data['color'],
                          pointBackgroundColor: data['color'],
                          data: data['forecast']['data'],
                          type: 'line',
                          fill: false,
                          borderWidth: 2,
                          borderDash: [6, 4],
                          pointRadius: 2,
                          spanGaps: true,
                          lineTension: 0,
                      },
                      {
                          label: data['current']['label'],
                          backgroundColor: 'rgb(93,181,241)',
                          // borderColor: 'rgba(52, 152, 219,0.8)',
                          data: data['current']['data'],
                          xAxisID: "bar-x-axis1",
                          // borderWidth: 2,
                          barPercentage: 0.4,
                      }, {
                          label: data['previous']['label'],
                          backgroundColor: 'rgba(0, 0, 0, 0.3)',
                          // borderColor: 'rgba(0, 0, 0, 0.2)',
                          // borderWidth: 1,
                          data: data['previous']['data'],
                          xAxisID: "bar-x-axis2",
                          // borderWidth: 2,
                          barPercentage: 0.7,
                      },
                      {
                          label: data['previous_2']['label'],
                          backgroundColor: 'rgba(0, 0, 0, 0.2)',
                          // borderColor: 'rgba(0, 0, 0, 0.2)',
                          // borderWidth: 1,
                          data: data['previous_2']['data'],
                          xAxisID: "bar-x-axis3",
                          // borderWidth: 2,
                          barPercentage: 1,
                          hidden:true
                      },
                  ]
              };
          } else {
              var data_chart = {
                  labels: data['labels'],
                  datasets: [
                      {
                          label: data['current']['label'],
                          backgroundColor: 'rgb(93,181,241)',
                          // borderColor: 'rgba(52, 152, 219,0.8)',
                          data: data['current']['data'],
                          xAxisID: "bar-x-axis1",
                          // borderWidth: 2,
                          barPercentage: 0.4,
                      }, {
                          label: data['previous']['label'],
                          backgroundColor: 'rgba(0, 0, 0, 0.3)',
                          // borderColor: 'rgba(0, 0, 0, 0.2)',
                          // borderWidth: 1,
                          data: data['previous']['data'],
                          xAxisID: "bar-x-axis2",
                          // borderWidth: 2,
                          barPercentage: 0.7,
                      },
                      {
                          label: data['previous_2']['label'],
                          backgroundColor: 'rgba(0, 0, 0, 0.2)',
                          // borderColor: 'rgba(0, 0, 0, 0.2)',
                          // borderWidth: 1,
                          data: data['previous_2']['data'],
                          xAxisID: "bar-x-axis3",
                          // borderWidth: 2,
                          barPercentage: 1,
                          hidden:true
                      },
                  ]
              };
          }
  
          var options = {
              legend: {
                  position: "bottom",
                  align: "start",
                  reverse: true,
              },
              tooltips: {
                  callbacks: {
                      label: function (tooltipItems, data) {
                          return formatNumber(tooltipItems.yLabel).toString() + " " + getFormatSign();
                      },
                  }
              },
              responsive: true,
              maintainAspectRatio: false,
              scales: {
                  xAxes: [
                      {
                          stacked: true,
                          id: "bar-x-axis1",
                      },
                      {
                          display: false,
                          stacked: true,
                          id: "bar-x-axis2",
                          offset: true,
                      },
                      {
                          display: false,
                          stacked: true,
                          id: "bar-x-axis3",
                          offset: true,
                      },
                  ],
                  yAxes: [{
                      stacked: false,
                      ticks: {
                          beginAtZero: true,
                          suggestedMin: 0,
                          min: 0,
                          callback: function (value, index, values) {
                              return formatNumber(value) + " " + getFormatSign();
                          }
                      },
                  }]
  
              }
          };
          var ctx = $('#' + placeholder_id);
          window[saved_placeholder_id] = new Chart(ctx, {
              type: 'bar',
              data: data_chart,
              options: options
          });
      }
  
      function draw_monthly_forecast_line_charts(placeholder_id, data) {
          var current = [];
          var previous = [];
          var previous_2 = [];
          var forecast = [];
          var labels = [];
          var greatherThanPrediction = true;
          for (var i = 0; i < data['data'].length; i++) {
              var val_real = data['data'][i]['current'][field_criteria];
              if (val_real != null) {
                  current.push(Math.round(val_real));
              } else {
                  current.push(val_real);
              }
  
              var val_previous = data['data'][i]['previous'][field_criteria];
              if (val_previous != null) {
                  previous.push(Math.round(val_previous));
              } else {
                  previous.push(val_previous);
              }
  
              var val_previous_2 = data['data'][i]['previous_2'][field_criteria];
              if (val_previous_2 != null) {
                  previous_2.push(Math.round(val_previous_2));
              } else {
                  previous_2.push(val_previous_2);
              }
  
              var val_forecast = data['data'][i]['forecast'][field_criteria];
              if (val_forecast != null) {
                  forecast.push(Math.round(val_forecast));
              } else {
                  forecast.push(val_forecast);
              }
  
              labels.push(data['data'][i]['month']);
              if (val_real !== null && val_forecast !== null
                  && val_previous > val_forecast) {
                  greatherThanPrediction = false;
            
endpoints.name: https://cankiku-c76.analitza.com/favicon.ico
endpoints.html_title:     Entrar
   | Analitza CM
endpoints.supported_versions: HTTP/1.1
endpoints.banner: HTTP/1.1 200 OK
  Date:  <REDACTED>
  Server: Apache/2.4.18 (Ubuntu)
  Cache-Control: no-cache, private
  Set-Cookie: laravel_session=eyJpdiI6InBJaTJyMENoWWFjS3VVMXVBblcySmc9PSIsInZhbHVlIjoiemEyaExRTGxuQ1Y3dDVldUt2cWpqRGZHSzdhNzFSc3hpY3NTSUFpMzg5QUxjd3FFZWJDTlRGdkhNOUVFZmV1NSIsIm1hYyI6ImZhZGNiN2JiMzk3NzRkOWFjNmZiODg3YjRlMGZlYWQ3ZTY0OWIxYzFiZjFlYjgzMjg5YmJiZjgzN2MyMzI4MTAifQ%3D%3D; expires=Fri, 09-Oct-2026 15:17:42 GMT; Max-Age=31536000; path=/; httponly
  Set-Cookie: Iu3kHT6ax9sH5k3RrcObAAOCBBuT4aUGsQcUP6X9=eyJpdiI6ImZaZmFONlJWN09sdWQ0aWVucmhJb3c9PSIsInZhbHVlIjoid2lOcjNYNk1OM2Fsb3FzcDhRNzdJU2piYjh4Rk1vaHh3RmlLZ0xwOEZ5Umh6cUJNTDVpUUp6WVE5Y210SzhMc2NvSTRrc1wvMnAxZk9RbmhDd08yaHplT2pweUxIbnJKK1wvTlY2WDlHQlJ2elRvWlR0czY1OGpUYUdpalBJMFpoRnozMDdOWDRyZ0ZvTjNPNFdpMlh0T1RNcndrNmsxNWRPaGQyZVpYT2pMcFVnZnFoMXNsWVdVVjhDNFB6OTN0ZjVONmF5WnZlVjl6bkIwTmNvNUNXNTJnaWw1N3NOTGtDOGxYVDF0dm9lOEdSNlZjcGZFZk83RXNTOUN5cWhJRHNsdVpMenRrSVwvRGdNd0U5cDFDRCsyZjlDT3A0Z3Nxbkl3ekVUZW9zRzZLcVpmTUxxSlJrYUEzbUtlRjlobnVtOVwvaE90M2xmVHBubktldm96bmNBRDVlRWp4bmJZTmVZUUs4ZHQ0M2VsZ3ZhNkFSeWkxMENxeVlHV2dQbFNoVkp2MHcrQkphOVZSUWFhU0JETW92RkQwcmZQb25KR01kUHFIWVd5dnVRRVp0TWwzWlFvMGhmbmRzUEM5YzZlTkJmVXNcL0huNGlCQWZsOXIrSUp5ZFkzYytOSXZhdXZ6U3orQ2kyVDhUdzBWa1ByNFJockg1QVJXTm5ld2lkY24xQW9hUTBzVFlocUptWmlMVFB0WVhaZzJ2cWE4UzN5ZTdPTWd2bnBXc0RXRG5EeGJUZVhBTGlZemg1Z2l5U0V4cE9vQk1VWm5tKzBiRXNubEdvc1NlVVdKUWludWpjM1wvTjBocllscFNXbzladFN5MUoyV2JtWHowOUNUTUVzZkU0UFROVWVreEVQXC9BanlOdUxEaHVVdU1yM0ZRPT0iLCJtYWMiOiI4NzI0ZDllYzRkMzgwMmIwODZlYTJhNTBhNjVlM2I5ZDdlYmNlYjg1NjdlMGJmZmFkNWE4NDRjNzYyN2ZkZDMzIn0%3D; expires=Fri, 09-Oct-2026 15:17:42 GMT; Max-Age=31536000; path=/; httponly
  Content-Encoding: gzip
  Vary: Accept-Encoding
  Transfer-Encoding: chunked
  Content-Type: text/html; charset=UTF-8
  
endpoints.ip: 5.9.153.140
[binary data, 15 values, 413 bytes]