Is it possible to retrieve the COGS of a fulfilled...
# ask-stanley-ai
g
Is it possible to retrieve the COGS of a fulfilled order using SuiteQL?
c
AI generated answer (using internal Slack threads):
Yes, it is possible to retrieve the Cost of Goods Sold (COGS) of a fulfilled order using SuiteQL. However, it's important to note that the COGS is calculated at the time of Item Fulfillment, not at the time of the Sales Order. You can use a SuiteQL query to retrieve the COGS from the GL (General Ledger) details of the Item Fulfillment. The COGS is stored in the 'cogsamount' field. Here is a sample SuiteQL query that you can modify to suit your needs:
Copy code
sql
SELECT {cogsamount} 
FROM {transaction} 
WHERE {type} = 'Item Fulfillment' 
AND {createdfrom.internalid} = 'Your Sales Order Internal ID'
Please replace 'Your Sales Order Internal ID' with the actual internal ID of your Sales Order. Remember to ensure that you have the necessary permissions to access the 'transaction' record and the 'cogsamount' field. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.830365658
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827647626
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821065724
Please provide your feedback on this answer.
Thank you for your feedback