General Ledger multiple lines x++ -- Please Help

I am new to x++ and to dynamics ax 2009.

I need to grab data from a CSV file line by line and add the data into a general journal line by line. Currently I am just trying to create a general journal, with multiple lines. I’ve gotten my code to work with creating a general journal and one line, but the next line has the same voucher number as the first, which I need incremented.

Is there a method that I’m missing? I know I’ll eventually need to loop this code and put in the parameters from my CSV file, I’m just not there yet. Any help would be appreciated! Thank you.

This is where the journal gets created and the transactions

void create()
{
LedgerJournalTable jourTable;
LedgerJournalTrans jourTrans;
LedgerJournalTableData jourTableData;
LedgerJournalTransData jourTransData;
LedgerJournalStatic jourStatic;
;

jourTableData = JournalTableData::newTable(jourTable);
jourTable.JournalNum = jourTableData.nextJournalId();
jourTable.JournalType = LedgerJournalType::Daily;
jourTable.JournalName = ‘GEN JRN’;

jourTableData.initFromJournalName(LedgerJournalName::find(jourTable.JournalName));
jourTable.Name = date2Str(d, 321, 2, -1,2 , -1, 4) + " " + time2Str(time,1,2);

jourStatic = jourTableData.journalStatic();
jourTransData = jourStatic.newLedgerJournalTransData(jourTrans, jourTableData);
jourTransData.initFromJournalTable();

jourTrans.initValue();
jourTrans.TransDate = systemdateget();
jourTrans.AccountType = LedgerJournalACType::Vend;
jourTrans.AccountNum = ‘12345’;
jourTrans.OffsetAccount = ‘98765’;
jourTrans.AmountCurDebit = 1000;
jourTransData.create();

jourTrans.clear();
jourTransData = jourStatic.newLedgerJournalTransData(jourTrans, jourTableData);
jourTransData.initFromJournalTable();

jourTrans.initValue();
jourTrans.TransDate = systemdateget();
jourTrans.AccountType = LedgerJournalACType::Vend;
jourTrans.AccountNum = ‘23456’;
jourTrans.OffsetAccount = ‘87654’;
jourTrans.AmountCurCredit = 500;
jourTransData.create();

jourTable.insert();

}