{
  "name": "Back-Office Club · Suivi des devis Pennylane → Google Sheets",
  "flow": [
    {
      "id": 1,
      "module": "http:ActionSendData",
      "version": 3,
      "parameters": {
        "handleErrors": true,
        "useNewZLibDeCompress": true
      },
      "mapper": {
        "ca": "",
        "qs": [
          {
            "name": "limit",
            "value": "100"
          }
        ],
        "url": "https://app.pennylane.com/api/external/v2/quotes",
        "data": "",
        "gzip": true,
        "method": "get",
        "headers": [
          {
            "name": "Authorization",
            "value": "Bearer COLLE_ICI_TON_TOKEN_PENNYLANE"
          },
          {
            "name": "Accept",
            "value": "application/json"
          }
        ],
        "timeout": "",
        "useMtls": false,
        "authPass": "",
        "authUser": "",
        "bodyType": "raw",
        "contentType": "application/json",
        "serializeUrl": false,
        "shareCookies": false,
        "parseResponse": true,
        "followRedirect": true,
        "useQuerystring": false,
        "followAllRedirects": false,
        "rejectUnauthorized": true
      },
      "metadata": {
        "designer": {
          "x": 0,
          "y": 0,
          "name": "Pennylane · liste des devis"
        }
      }
    },
    {
      "id": 2,
      "module": "builtin:BasicFeeder",
      "version": 1,
      "parameters": {},
      "mapper": {
        "array": "{{1.data.items}}"
      },
      "metadata": {
        "designer": {
          "x": 300,
          "y": 0,
          "name": "Un devis à la fois"
        }
      }
    },
    {
      "id": 3,
      "module": "builtin:BasicAggregator",
      "version": 1,
      "parameters": {
        "feeder": 2,
        "target": "5.rows"
      },
      "filter": {
        "name": "Devis ouverts (en attente ou acceptés)",
        "conditions": [
          [
            {
              "a": "{{2.status}}",
              "b": "pending",
              "o": "text:equal"
            }
          ],
          [
            {
              "a": "{{2.status}}",
              "b": "accepted",
              "o": "text:equal"
            }
          ]
        ]
      },
      "mapper": {
        "values": [
          "{{2.quote_number}}",
          "{{2.label}}",
          "{{2.date}}",
          "{{2.deadline}}",
          "{{2.currency_amount_before_tax}}",
          "{{2.currency_amount}}",
          "{{switch(2.status; \"pending\"; \"En attente\"; \"accepted\"; \"Accepté\"; \"denied\"; \"Refusé\"; \"invoiced\"; \"Facturé\"; \"expired\"; \"Expiré\"; 2.status)}}",
          "{{formatDate(now; \"DD/MM/YYYY HH:mm\"; \"Europe/Paris\")}}"
        ]
      },
      "metadata": {
        "designer": {
          "x": 600,
          "y": 0,
          "name": "Préparer les lignes"
        }
      }
    },
    {
      "id": 4,
      "module": "google-sheets:clearValuesFromRange",
      "version": 2,
      "parameters": {
        "__IMTCONN__": null
      },
      "mapper": {
        "range": "A2:H",
        "sheet": "Devis",
        "select": "fromAll",
        "spreadsheetId": "COLLE_ICI_L_ID_DE_TON_GOOGLE_SHEETS"
      },
      "metadata": {
        "designer": {
          "x": 900,
          "y": 0,
          "name": "Vider le tableau"
        }
      }
    },
    {
      "id": 5,
      "module": "google-sheets:updateMultipleRows",
      "version": 2,
      "parameters": {
        "__IMTCONN__": null
      },
      "mapper": {
        "rows": "{{3.array}}",
        "range": "A2:H",
        "sheetId": "Devis",
        "spreadsheetId": "COLLE_ICI_L_ID_DE_TON_GOOGLE_SHEETS",
        "valueInputOption": "USER_ENTERED"
      },
      "metadata": {
        "designer": {
          "x": 1200,
          "y": 0,
          "name": "Réécrire les devis"
        }
      }
    }
  ],
  "metadata": {
    "instant": false,
    "version": 1,
    "scenario": {
      "roundtrips": 1,
      "maxErrors": 3,
      "autoCommit": true,
      "autoCommitTriggerLast": true,
      "sequential": false,
      "slots": null,
      "confidential": false,
      "dataloss": false,
      "dlq": false,
      "freshVariables": false
    },
    "designer": {
      "orphans": []
    },
    "zone": "eu1.make.com",
    "notes": []
  }
}
