Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to add journal entry line details in a line object for QuickBooks Online

I have been working on trying to send a journal entry (JE) to QBO and I can't quite get a grasp on how to create the object completely.

So I have my overall JE object and set the base values in that. Then, in each JE object there is an array of Line objects that correspond to each line in the JEs. Each line then has a DetailType that needs to be set to JournalEntryLineDetail and then you are supposed to create JournalEntryLineDetail object that houses more information for the line. However, where do you put this JournalEntryLineDetail object in the Line object? Do you attach it to the Line.AnyIntuitObject object?

I've been reading over the documentation and there is like no definitive answer that says "this is where the JournalEntryLineDetail goes" and I can't find an answer anywhere.

I currently have something close to this:

Dim je As New Intuit.Ipp.Data.JournalEntry()
Dim l As New Intuit.Ipp.Data.Line()
Dim jeld As New Intuit.Ipp.Data.JournalEntryLineDetail()

je.PrivateNote = "Something"
je.TxnDate = Now

l.Description = "Something Squared"
l.Amount = 100000000.00
l.DetailType = Intuit.Ipp.Data.LineDetailTypeEnum.JournalEntryLineDetail

jeld.PostingType = Intuit.Ipp.Data.PostingTypeEnum.Credit
jeld.AccountRef = 80

'Line to put jeld into the line - This is what I don't know how to do.
je.Line = {l}

NOTE:
This code does not reflect my actual coding abilities in terms of naming conventions, simply threw it together to get an example up.

EDIT:
Intuit JE Doc
Intuit Line Doc

like image 717
Josh Braun Avatar asked Dec 13 '25 23:12

Josh Braun


2 Answers

When creating a JournalEntry object and saving the lines to the object, you do need to save the JournalEntryLineDetail to the Line.AnyIntuitObject object.

like image 61
Josh Braun Avatar answered Dec 15 '25 11:12

Josh Braun


                        JournalEntry journalEntry = new JournalEntry();
                        journalEntry.Adjustment = true;
                        journalEntry.AdjustmentSpecified = true;
                        //journalEntry.JournalEntryEx = 

                        journalEntry.DocNumber = "DocNu1";
                        journalEntry.TxnDate = DateTime.UtcNow.Date;
                        journalEntry.TxnDateSpecified = true;
                        journalEntry.HomeTotalAmt = 100;
                        journalEntry.HomeTotalAmtSpecified = true;
                        journalEntry.TotalAmt = 100;
                        journalEntry.TotalAmtSpecified = true;
                        List<Line> lineList = new List<Line>();

                        Line debitLine = new Line();
                        debitLine.Description = "nov portion of rider insurance";
                        debitLine.Amount = new Decimal(100.00);
                        debitLine.AmountSpecified = true;
                        debitLine.DetailType = LineDetailTypeEnum.JournalEntryLineDetail;
                        debitLine.DetailTypeSpecified = true;
                        JournalEntryLineDetail journalEntryLineDetail = new JournalEntryLineDetail();
                        journalEntryLineDetail.PostingType = PostingTypeEnum.Debit;
                        journalEntryLineDetail.PostingTypeSpecified = true;
                        journalEntryLineDetail.AccountRef = new ReferenceType() { name = "Accumulated Depreciation", Value = "36" };
                        debitLine.AnyIntuitObject = journalEntryLineDetail;
                        lineList.Add(debitLine);

                        Line creditLine = new Line();
                        creditLine.Description = "nov portion of rider insurance";
                        creditLine.Amount = new Decimal(100.00);
                        creditLine.AmountSpecified = true;
                        creditLine.DetailType = LineDetailTypeEnum.JournalEntryLineDetail;
                        creditLine.DetailTypeSpecified = true;
                        JournalEntryLineDetail journalEntryLineDetailCredit = new JournalEntryLineDetail();
                        journalEntryLineDetailCredit.PostingType = PostingTypeEnum.Credit;
                        journalEntryLineDetailCredit.PostingTypeSpecified = true;
                        journalEntryLineDetailCredit.AccountRef = new ReferenceType() { name = "Accumulated Depreciation", Value = "36" };
                        creditLine.AnyIntuitObject = journalEntryLineDetailCredit;
                        lineList.Add(creditLine);

                        journalEntry.Line = lineList.ToArray();
                        JournalEntry result = commonServiceQBO.Add(journalEntry) as JournalEntry;

You can refer the above for dotnet.

like image 26
nimisha shrivastava Avatar answered Dec 15 '25 11:12

nimisha shrivastava



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!