Does anyone know if the "Schedule" data on a quote...
# suitescript
a
Does anyone know if the "Schedule" data on a quote is accessible via SuiteAnalytics Connect or via SuiteScripts? See the screenshot below:
m
What I've found with SuiteAnalytics Connect is this query will basically build that sublist with and without tax (requires Avatax).
Copy code
SELECT SUM(BS.BILL_AMOUNT_FOREIGN),
       SUM(BS.LINE_AVATAX_SUBTOTAL),
       BS.BILL_DATE
FROM BILLING_SCHEDULE BS
         INNER JOIN TRANSACTION_LINES TL
                    ON BS.TRANSACTION_ID = TL.TRANSACTION_ID
                        AND BS.TRANSACTION_LINE_ID = TL.TRANSACTION_LINE_ID
         INNER JOIN ITEMS I
                    ON TL.ITEM_ID = I.ITEM_ID
WHERE BS.TRANSACTION_ID = 495276
GROUP BY BS.BILL_DATE
ORDER BY BS.BILL_DATE;
I have an open support case with NetSuite to figure out how to get this data via SuiteScript and using SuiteQL, this query works...sometimes. It only returns data if the Billing Schedule recurrence type is set to 'Custom'...and it only includes the pre-tax amounts.
Copy code
SELECT BSR.RECURRENCEDATE,
       SUM(TL.FOREIGNAMOUNT * BSR.AMOUNT) / 100 * -1
FROM TRANSACTIONLINE TL
         INNER JOIN ITEM I
                    ON TL.ITEM = I.ID
         INNER JOIN BILLINGSCHEDULERECURRENCE BSR
                    ON TL.BILLINGSCHEDULE = BSR.BILLINGSCHEDULE
WHERE TL.TRANSACTION = 495276
GROUP BY BSR.RECURRENCEDATE
ORDER BY BSR.RECURRENCEDATE
a
Sweet, thanks. So it looks like the schedule stuff is inside the "Billing_Schedule" table. It looks like you joined on the transaction_lines, does that change if you only set the billing schedule on the header of the transaction? Do you know if it still builds it out line by line, or would be be for the whole transaction?