{
  "apiVersion": 64,
  "label": "Order Quote Payment Field Inheritance",
  "description": "On Quote-sourced Order create, stamp PingCAP billing fields from the source Quote. This is creation-time inheritance, not ongoing Quote-to-Order synchronization.",
  "status": "Active",
  "processType": "AutoLaunchedFlow",
  "runAtomically": true,
  "triggerOrder": 100,
  "start": {
    "locationX": 0,
    "locationY": 0,
    "object": "Order",
    "triggerType": "RecordBeforeSave",
    "recordTriggerType": "Create",
    "filterLogic": "and",
    "filters": [
      {
        "field": "QuoteId",
        "operator": "IsNull",
        "value": {
          "booleanValue": false
        }
      }
    ],
    "connector": {
      "targetReference": "Get_Source_Quote"
    }
  },
  "recordLookups": [
    {
      "name": "Get_Source_Quote",
      "label": "Get Source Quote",
      "locationX": 0,
      "locationY": 120,
      "assignNullValuesIfNoRecordsFound": false,
      "connector": {
        "targetReference": "Stamp_Order_Payment_Fields"
      },
      "filterLogic": "and",
      "filters": [
        {
          "field": "Id",
          "operator": "EqualTo",
          "value": {
            "elementReference": "$Record.QuoteId"
          }
        }
      ],
      "getFirstRecordOnly": true,
      "object": "Quote",
      "queriedFields": [
        "Id",
        "Payment_Term__c",
        "Payment_Type__c"
      ],
      "storeOutputAutomatically": true
    }
  ],
  "assignments": [
    {
      "name": "Stamp_Order_Payment_Fields",
      "label": "Stamp Order Payment Fields",
      "locationX": 0,
      "locationY": 240,
      "assignmentItems": [
        {
          "assignToReference": "$Record.Payment_Term__c",
          "operator": "Assign",
          "value": {
            "elementReference": "Get_Source_Quote.Payment_Term__c"
          }
        },
        {
          "assignToReference": "$Record.Payment_Type__c",
          "operator": "Assign",
          "value": {
            "elementReference": "Get_Source_Quote.Payment_Type__c"
          }
        }
      ]
    }
  ]
}
