Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to process ESSP-funded Sale records #23

Open
ojablkach opened this issue Jan 16, 2023 · 10 comments
Open

Unable to process ESSP-funded Sale records #23

ojablkach opened this issue Jan 16, 2023 · 10 comments

Comments

@ojablkach
Copy link

Screenshot 2023-01-16 at 10 58 47
any idea why I get this after checking 2022 year?

@ncortines
Copy link
Owner

Uncaught ReferenceError: Footer is not defined

No idea about this. The script does not contain references to Footer. Have you modified the script?

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading "longTerm')

Something may have changed in the internal API and it seems to be affecting the processing of some Sale records. Unfortunately I'm not able to see this error using my account/data.

At lines 188 and 189:

const longTermCostTransactions = (sale.costBasis.longTerm && sale.costBasis.longTerm.rows) || []
const shortTermCostTransactions = (sale.costBasis.shortTerm && sale.costBasis.shortTerm.rows) || []

Seems like sale.costBasis is undefined. Could you please add at line 188 this line and run it again? (should be inserted before the two lines cited above)

console.info(JSON.stringify(sale, undefined, 2))

That console log should print one of more times. Please remove sensitive USD/PLN amounts data and send it over to me (or simply add it in a comment here)

The rest of the errors (GET...) are normal.

Thanks

@ojablkach
Copy link
Author

same result after i added the line, footer dont know why it was there probably I copied something with the code its not showing any more
Screenshot 2023-01-16 at 13 09 26

@ojablkach
Copy link
Author

this need to be at line 188 or 189 as on the screen as the explanation where to put it is misleading and I'm not a dev ;)

Screenshot 2023-01-16 at 13 19 33

@ojablkach
Copy link
Author

ojablkach commented Jan 16, 2023

{
  "bookValuePerUnit": {
    "amount": "129.377249",
    "currency": "USD"
  },
  "cashDeliveryInstructions": {
    "bankReference": {
      "accountHolderName": "-------",
      "deliveryMethodType": "CASH_WIRE",
      "mainSection": {
        "accountCurrency": "PLN",
        "accountNumber": "",
        "auBankBsbNumber": "",
        "bankBsbNumber": "",
        "bankName": "-----",
        "bankReferenceType": "EUR",
        "branchAddress": "------",
        "branchName": "XXX",
        "cdnBankFinNumber": "",
        "cdnTransitNumber": "",
        "domiciledCountry": "PL",
        "intlBankIbanNumber": "------",
        "memo": "",
        "nationalIdentifier": "",
        "sicCode": "",
        "swiftBicNumber": "PPABPLPK",
        "ukBankSortCode": "",
        "usBankAbaNumber": "",
        "zaBranchCode": ""
      },
      "subAccountHolderName": "",
      "subAccountHolderNumber": ""
    },
    "currencyControlMessage": "",
    "deliveryMethodLabel": "Transfer funds via wire (USD or Currency)",
    "digitalSharesIssued": false,
    "digitalSharesNotIssued": false,
    "disbursementDate": "2022-12-16",
    "drsAgentName": "",
    "drsIdentifierLabel": "",
    "drsIdentifierValue": "",
    "shouldMaskBrokerageAccountNumber": false,
    "transferToEsppSavingsPlanName": ""
  },
  "enteredDuringBlackout": false,
  "historical": false,
  "listItem": {
    "actionDescription": "",
    "awardNamePlural": "",
    "awardNameSingular": "",
    "awardTypeOrPlanNames": "Pegasystems ESPP",
    "createdInstant": "2022-12-13T13:44:00.741Z",
    "exchange": "NASDAQ",
    "fundCurrency": "USD",
    "fundPK": "31047501515",
    "fundType": "STOCK",
    "orderReferenceNumber": "DTB 02100",
    "proceedsSummaries": [
      {
        "moneyValue": {
          "amount": "1661.199997",
          "currency": "PLN"
        }
      }
    ],
    "quantity": "10.004",
    "realtimeTransactionPK": "358044281822",
    "referenceNumber": "WRC74BC1938-1EE",
    "savingsPlanPK": "127281947724",
    "settlementDate": "2022-12-15",
    "shareWithdrawal": false,
    "spfWithdrawalPKs": [
      "358046352459"
    ],
    "status": "COMPLETE",
    "statusCancelled": false,
    "statusComplete": true,
    "statusDescription": "Complete",
    "statusExpired": false,
    "statusPendingDistribution": false,
    "statusUnderReview": false,
    "symbol": "PEGA",
    "symbolDescription": "PEGA - NASDAQ",
    "transactionDate": "2022-12-13",
    "txApiType": "WITHDRAWAL_REALTIME_TRANSACTION",
    "txNoun": "Sale",
    "withdrawalQuantityType": "UNITS",
    "withdrawalType": "ADHOC"
  },
  "moneySources": [
    {
      "moneySource": "EE",
      "moneySourceLabel": "Employee",
      "quantity": "10.004",
      "quantityType": "UNITS",
      "quantityTypeDescription": "Units",
      "requestedWithdrawalQuantity": "10.004"
    }
  ],
  "order": [
    {
      "exchangeFriendlyTzShortName": "EST",
      "fillsIfNotTooMany": [
        {
          "fillDateTime": "2022-12-13T09:30:03",
          "fillPrice": {
            "amount": "38.18",
            "currency": "USD"
          },
          "fillQuantity": "10"
        },
        {
          "fillDateTime": "2022-12-13T09:30:03",
          "fillPrice": {
            "amount": "38.18",
            "currency": "USD"
          },
          "fillQuantity": "0.004"
        }
      ],
      "formattedSymbolAndExchange": "PEGA:NASDAQ",
      "goodTillCancel": true,
      "limitOrder": true,
      "limitPrice": {
        "amount": "36.6",
        "currency": "USD"
      },
      "orderDate": "2022-12-13",
      "orderQuantity": "10",
      "orderReferenceNumber": "DTB 02100",
      "orderStatusDescription": "Order is done",
      "orderSubType": "LIMIT_GOOD_TILL_CANCEL",
      "settlementDate": "2022-12-15",
      "totalFillQuantity": "10.004",
      "uniqueFillDate": "2022-12-13",
      "weightedAverageFillPrice": {
        "amount": "38.18",
        "currency": "USD"
      }
    }
  ],
  "planName": "Pegasystems ESPP",
  "realtimeTransactionPK": "358044281822",
  "referenceNumber": "WRC74BC1938-1EE",
  "settlementDate": "2022-12-15",
  "sharesForfeited": "0",
  "simpleFundInfo": {
    "cash": false,
    "currency": "USD",
    "exchange": "NASDAQ",
    "fundPK": "31047501515",
    "longName": "PEGA - NASDAQ",
    "privateStock": false,
    "shortName": "PEGA:NASDAQ",
    "unitBased": false
  },
  "status": "COMPLETE",
  "statusDescription": "Complete",
  "subTypeDescription": "",
  "summary": {
    "summarySold": {
      "companyProceeds": {
        "amount": "0",
        "currency": "USD"
      },
      "companyProceedsRatio": 0,
      "fees": {
        "amount": "0.01",
        "currency": "USD"
      },
      "feesRatio": 0.000026181437360911114,
      "grossProceeds": {
        "amount": "381.95",
        "currency": "USD"
      },
      "netProceeds": {
        "amount": "381.94",
        "currency": "USD"
      },
      "netProceedsRatio": 0.9999738185626391,
      "taxes": {
        "amount": "0",
        "currency": "USD"
      },
      "taxesRatio": 0
    }
  },
  "totalBookValue": {
    "amount": "1294.29",
    "currency": "USD"
  },
  "txApiType": "WITHDRAWAL_REALTIME_TRANSACTION",
  "txBreakdown": {
    "blocks": [
      {
        "headerText": "Breakdown",
        "headerTextSuffix": "",
        "maxFractionalDigitsForNumberFP": 3,
        "rows": [
          {
            "labelText": "Shares To Be Sold",
            "labelTextSuffix": "",
            "operatorText": "",
            "rowType": "DATA",
            "strongStyle": false,
            "valueMoneyIsPerUnitAmount": false,
            "valueNumberFP": "10.004"
          },
          {
            "labelText": "Market Price per Unit",
            "labelTextSuffix": "",
            "operatorText": "×",
            "rowType": "DATA",
            "strongStyle": false,
            "valueMoney": {
              "amount": "38.18",
              "currency": "USD"
            },
            "valueMoneyIsPerUnitAmount": true
          },
          {
            "labelText": "",
            "labelTextSuffix": "",
            "operatorText": "",
            "rowType": "LINE",
            "strongStyle": false,
            "valueMoneyIsPerUnitAmount": false
          },
          {
            "labelText": "Proceeds",
            "labelTextSuffix": "",
            "operatorText": "",
            "rowType": "DATA",
            "strongStyle": false,
            "valueMoney": {
              "amount": "381.95",
              "currency": "USD"
            },
            "valueMoneyIsPerUnitAmount": false
          },
          {
            "labelText": "Supplemental Transaction Fee",
            "labelTextSuffix": "",
            "operatorText": "-",
            "rowType": "DATA",
            "strongStyle": false,
            "valueMoney": {
              "amount": "0.01",
              "currency": "USD"
            },
            "valueMoneyIsPerUnitAmount": false
          },
          {
            "labelText": "",
            "labelTextSuffix": "",
            "operatorText": "",
            "rowType": "LINE",
            "strongStyle": false,
            "valueMoneyIsPerUnitAmount": false
          },
          {
            "labelText": "Net Proceeds",
            "labelTextSuffix": "",
            "operatorText": "",
            "rowType": "DATA",
            "strongStyle": false,
            "valueMoney": {
              "amount": "381.94",
              "currency": "USD"
            },
            "valueMoneyIsPerUnitAmount": false
          },
          {
            "labelText": "Currency Conversion",
            "labelTextSuffix": "",
            "operatorText": "×",
            "rowType": "DATA",
            "strongStyle": false,
            "valueConversionRateOrFactor": 4.34937424,
            "valueMoneyIsPerUnitAmount": false
          },
          {
            "labelText": "",
            "labelTextSuffix": "",
            "operatorText": "",
            "rowType": "LINE",
            "strongStyle": false,
            "valueMoneyIsPerUnitAmount": false
          },
          {
            "labelText": "Converted Net Proceeds",
            "labelTextSuffix": "",
            "operatorText": "",
            "rowType": "DATA",
            "strongStyle": true,
            "valueMoney": {
              "amount": "1661.199997",
              "currency": "PLN"
            },
            "valueMoneyIsPerUnitAmount": false
          },
          {
            "labelText": "",
            "labelTextSuffix": "",
            "operatorText": "",
            "rowType": "LINE",
            "strongStyle": false,
            "valueMoneyIsPerUnitAmount": false
          },
          {
            "labelText": "Ordinary Income",
            "labelTextSuffix": "",
            "operatorText": "",
            "rowType": "DATA",
            "strongStyle": false,
            "valueMoney": {
              "amount": "194.06",
              "currency": "USD"
            },
            "valueMoneyIsPerUnitAmount": false
          },
          {
            "labelText": "Capital Gain or Loss",
            "labelTextSuffix": "",
            "operatorText": "",
            "rowType": "DATA",
            "strongStyle": false,
            "valueMoney": {
              "amount": "-912.04",
              "currency": "USD"
            },
            "valueMoneyIsPerUnitAmount": false
          }
        ]
      }
    ],
    "showAmountDue": false,
    "showCurrency": true
  },
  "typeDescription": "Ad Hoc",
  "withdrawalDate": "2022-12-13"
}

@ncortines
Copy link
Owner

ncortines commented Jan 19, 2023

Thanks for the screen share session :)

Seems like the problem is ESPP-funded sale records are missing the costBasis section, which is surprising.

We need to contact Morgan Stanley and ask them to include this information.

Without it, we won't be able to accurately report to the treasury department.

@ncortines
Copy link
Owner

ncortines commented Jan 19, 2023

Thanks for reaching out to Morgan Stanley.

To summarise, there is a way to get to the data, but it's a tedious manual process:

  1. Go to Portfolio
  2. Go to Share Purchase and Holdings
  3. Find Pegasystems ESSP and click details
  4. Find the Sale record and click on it to get a new report containing the missing Cost Basis information

@ncortines ncortines changed the title some api calls gets errors Unable to process ESSP-funded Sale records Jan 19, 2023
@ncortines
Copy link
Owner

Latest information from MS is that they are not planning to fix the Sale report because it's too much of an effort.

@RaNo99
Copy link
Contributor

RaNo99 commented Mar 5, 2023

Thanks for reaching out to Morgan Stanley.

To summarise, there is a way to get to the data, but it's a tedious manual process:

1. Go to _Portfolio_

2. Go to _Share Purchase and Holdings_

3. Find _Pegasystems ESSP_ and click _details_

4. Find the _Sale_ record and click on it to get a new report containing the missing Cost Basis information

After clicking detals, I'm seeing two sections:

  • Purchase History for PEGA - NASDAQ
  • Activity for PEGA - NASDAQ in Pegasystems ESPP From 05-Mar-2022 to 05-Mar-2023

In which of these two do you see the Sale records? I don't see any. Maybe because I had sales only before 05-Mar-2022 and I don't know how to remove the time limitation for that section :(

@ncortines
Copy link
Owner

@RaNo99 I haven's joined ESPP program so I can't really help much other than relaying the instructions that @ojablkach got from MS.

@ncortines
Copy link
Owner

@RaNo99 these are the instructions I got from a different threat:

  • Access PORTFOLIO tab
  • Access Share Purchase and Holdings
  • Scroll down to Transaction View of Pegasystems Inc ESPP Plan
  • Under Fund click the (details) link
  • Scroll down to Activity for Pega
  • Scroll to date of SALE and click the Sale link
  • Scroll to Purchase Lot Qualification Information (This is the cost basis for the sale).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants