static void DIPL_ExcelImportGeneralJournals(Args _args)
{
SysExcelApplication application;
SysExcelWorkbooks workbooks;
SysExcelWorkbook workbook;
SysExcelWorksheets worksheets;
SysExcelWorksheet worksheet;
SysExcelCells cells;
COMVariantType type;
Name name;
FileName filename;
int row;
str path;
str filetype;
int i;
NoYes NoYes;
FileIoPermission perm;
DocuValue docuvalue;
#define.FileMode('W')
LedgerJournalName LedgerJournalName;
LedgerJournalTable ledgerJournalTable;
LedgerJournalTrans ledgerJournalTrans;
LedgerJournalCheckPost ledgerJournalCheckPost;
LedgerJournalACType LedgerJournalACType;
ledgerJournalTrans_Project ledgerJournalTrans_Project;
NumberSeq numberseq;
voucher voucher;
int flag,flag1 ;
LedgerJournalNameId LedgerJournalNameId = 'BPJ 16-17';
//BankAccountID BankAccountID = 'EUR OPER';
//ledgerAccount offsetAccount = '601500';
amountCur amountCur = 102;
;
//specify the file path that you want to read
filename = "E:\\GenLines1.xls"; //path of excel
perm = new FileIOPermission(filename, #FileMode);
perm.assert();
application = SysExcelApplication::construct();
workbooks = application.workbooks();
try
{
workbooks.open(filename);
}
catch (Exception::Error)
{
throw error("File cannot be opened.");
}
workbook = workbooks.item(1);
worksheets = workbook.worksheets();
worksheet = worksheets.itemFromNum(1);
cells = worksheet.cells();
flag = 0;
//progress.setAnimation(#AviTransfer);
Row=1;
try
{
do
{
row++;
ttsbegin;
if(flag==0)
{
// Find a ledgerJournalName record
select firstonly LedgerJournalName
where LedgerJournalName.JournalName ==LedgerJournalNameId;
//Created the ledgerJournalTable
ledgerJournalTable.JournalName =LedgerJournalName.JournalName;
ledgerJournalTable.initFromLedgerJournalName();
ledgerJournalTable.Name = 'Bank Payment Journal';
ledgerJournalTable.insert();
flag = 1;
}
// if(flag==1)
// {
// numberseq =NumberSeq::newGetVoucherFromCode(ledgerJournalName.VoucherSeries);
// flag++;
// }
ledgerJournalTrans.clear();
ledgerJournalTrans.initValue();
if (!voucher)
{
numberseq = numberseq::newGetVoucherFromCode(ledgerJournalName.VoucherSeries);
voucher = numberseq.voucher();
}
ledgerJournalTrans.Voucher = voucher;
//Generate the transaction line
ledgerJournalTrans.JournalNum =ledgerJournalTable.JournalNum;
//ledgerJournalTrans.ExchRate =Currency::exchRate(ledgerJournalTrans.CurrencyCode);
ledgerJournalTrans.AccountType =str2enum(LedgerJournalACType,cells.item(row,1).value().bstr());
ledgerJournalTrans.TransDate = today();
ledgerJournalTrans.AccountNum = cells.item(row, 2).value().bStr();
ledgerJournalTrans.Txt = cells.item(row, 3).value().bStr();
ledgerJournalTrans.AmountCurDebit = cells.item(row, 4).value().double();
ledgerJournalTrans.AmountCurCredit = cells.item(row, 5).value().double();
ledgerJournalTrans.CurrencyCode = cells.item(row, 6).value().bStr();
// ledgerJournalTrans.OffsetAccount = offsetAccount;
ledgerJournalTrans.OffsetAccountType = LedgerJournalACType::Bank;
if(ledgerJournalTrans.validateWrite())
{
ledgerJournalTrans.insert();
}
if(ledgerJournalTrans.AccountType==LedgerJournalACType::Project)
{
ledgerJournalTrans_Project.clear();
ledgerJournalTrans_Project.initValue();
ledgerJournalTrans_Project.CategoryId = cells.item(row, 7).value().bStr();
ledgerJournalTrans_Project.RefRecId = ledgerJournalTrans.RecId;
ledgerJournalTrans_Project.LinePropertyId = cells.item(row, 8).value().bStr();
ledgerJournalTrans_Project.ProjId = ledgerJournalTrans.AccountNum;
if(ledgerJournalTrans.AmountCurCredit)
{
ledgerJournalTrans_Project.CostPrice = ledgerJournalTrans.AmountCurCredit;
}
else if(ledgerJournalTrans.AmountCurDebit)
{
ledgerJournalTrans_Project.CostPrice = ledgerJournalTrans.AmountCurDebit;
ledgerJournalTrans_Project.Qty = 1;
ledgerJournalTrans_Project.SalesCurrencyId = ledgerJournalTrans.currencyCode();
if(ledgerJournalTrans_Project.validateWrite())
{
ledgerJournalTrans_Project.insert();
}
}
}
info(strfmt('Journal Id:%1',ledgerJournalTable.JournalNum));
//Post the Journal
// ledgerJournalCheckPost= ledgerJournalCheckPost::newLedgerJournalTable(ledgerJournalTable,NoYes::Yes);
// ledgerJournalCheckPost.run();
ttscommit;
type = cells.item(row+1, 1).value().variantType();
}
while (type != COMVariantType::VT_EMPTY);
info('done');
}
catch(Exception::Error)
{
workbooks.close();
CodeAccessPermission::revertAssert();
application.quit();
ttsabort;
}
workbooks.close();
CodeAccessPermission::revertAssert();
application.quit();
}
{
SysExcelApplication application;
SysExcelWorkbooks workbooks;
SysExcelWorkbook workbook;
SysExcelWorksheets worksheets;
SysExcelWorksheet worksheet;
SysExcelCells cells;
COMVariantType type;
Name name;
FileName filename;
int row;
str path;
str filetype;
int i;
NoYes NoYes;
FileIoPermission perm;
DocuValue docuvalue;
#define.FileMode('W')
LedgerJournalName LedgerJournalName;
LedgerJournalTable ledgerJournalTable;
LedgerJournalTrans ledgerJournalTrans;
LedgerJournalCheckPost ledgerJournalCheckPost;
LedgerJournalACType LedgerJournalACType;
ledgerJournalTrans_Project ledgerJournalTrans_Project;
NumberSeq numberseq;
voucher voucher;
int flag,flag1 ;
LedgerJournalNameId LedgerJournalNameId = 'BPJ 16-17';
//BankAccountID BankAccountID = 'EUR OPER';
//ledgerAccount offsetAccount = '601500';
amountCur amountCur = 102;
;
//specify the file path that you want to read
filename = "E:\\GenLines1.xls"; //path of excel
perm = new FileIOPermission(filename, #FileMode);
perm.assert();
application = SysExcelApplication::construct();
workbooks = application.workbooks();
try
{
workbooks.open(filename);
}
catch (Exception::Error)
{
throw error("File cannot be opened.");
}
workbook = workbooks.item(1);
worksheets = workbook.worksheets();
worksheet = worksheets.itemFromNum(1);
cells = worksheet.cells();
flag = 0;
//progress.setAnimation(#AviTransfer);
Row=1;
try
{
do
{
row++;
ttsbegin;
if(flag==0)
{
// Find a ledgerJournalName record
select firstonly LedgerJournalName
where LedgerJournalName.JournalName ==LedgerJournalNameId;
//Created the ledgerJournalTable
ledgerJournalTable.JournalName =LedgerJournalName.JournalName;
ledgerJournalTable.initFromLedgerJournalName();
ledgerJournalTable.Name = 'Bank Payment Journal';
ledgerJournalTable.insert();
flag = 1;
}
// if(flag==1)
// {
// numberseq =NumberSeq::newGetVoucherFromCode(ledgerJournalName.VoucherSeries);
// flag++;
// }
ledgerJournalTrans.clear();
ledgerJournalTrans.initValue();
if (!voucher)
{
numberseq = numberseq::newGetVoucherFromCode(ledgerJournalName.VoucherSeries);
voucher = numberseq.voucher();
}
ledgerJournalTrans.Voucher = voucher;
//Generate the transaction line
ledgerJournalTrans.JournalNum =ledgerJournalTable.JournalNum;
//ledgerJournalTrans.ExchRate =Currency::exchRate(ledgerJournalTrans.CurrencyCode);
ledgerJournalTrans.AccountType =str2enum(LedgerJournalACType,cells.item(row,1).value().bstr());
ledgerJournalTrans.TransDate = today();
ledgerJournalTrans.AccountNum = cells.item(row, 2).value().bStr();
ledgerJournalTrans.Txt = cells.item(row, 3).value().bStr();
ledgerJournalTrans.AmountCurDebit = cells.item(row, 4).value().double();
ledgerJournalTrans.AmountCurCredit = cells.item(row, 5).value().double();
ledgerJournalTrans.CurrencyCode = cells.item(row, 6).value().bStr();
// ledgerJournalTrans.OffsetAccount = offsetAccount;
ledgerJournalTrans.OffsetAccountType = LedgerJournalACType::Bank;
if(ledgerJournalTrans.validateWrite())
{
ledgerJournalTrans.insert();
}
if(ledgerJournalTrans.AccountType==LedgerJournalACType::Project)
{
ledgerJournalTrans_Project.clear();
ledgerJournalTrans_Project.initValue();
ledgerJournalTrans_Project.CategoryId = cells.item(row, 7).value().bStr();
ledgerJournalTrans_Project.RefRecId = ledgerJournalTrans.RecId;
ledgerJournalTrans_Project.LinePropertyId = cells.item(row, 8).value().bStr();
ledgerJournalTrans_Project.ProjId = ledgerJournalTrans.AccountNum;
if(ledgerJournalTrans.AmountCurCredit)
{
ledgerJournalTrans_Project.CostPrice = ledgerJournalTrans.AmountCurCredit;
}
else if(ledgerJournalTrans.AmountCurDebit)
{
ledgerJournalTrans_Project.CostPrice = ledgerJournalTrans.AmountCurDebit;
ledgerJournalTrans_Project.Qty = 1;
ledgerJournalTrans_Project.SalesCurrencyId = ledgerJournalTrans.currencyCode();
if(ledgerJournalTrans_Project.validateWrite())
{
ledgerJournalTrans_Project.insert();
}
}
}
info(strfmt('Journal Id:%1',ledgerJournalTable.JournalNum));
//Post the Journal
// ledgerJournalCheckPost= ledgerJournalCheckPost::newLedgerJournalTable(ledgerJournalTable,NoYes::Yes);
// ledgerJournalCheckPost.run();
ttscommit;
type = cells.item(row+1, 1).value().variantType();
}
while (type != COMVariantType::VT_EMPTY);
info('done');
}
catch(Exception::Error)
{
workbooks.close();
CodeAccessPermission::revertAssert();
application.quit();
ttsabort;
}
workbooks.close();
CodeAccessPermission::revertAssert();
application.quit();
}
The King Casino Company - Ventureberg
ReplyDeleteIt was born in 출장샵 1934. The https://septcasino.com/review/merit-casino/ Company offers luxury hotels, If you don't have a poker room in your ventureberg.com/ house, then 바카라 you'll find a poker room in 토토 the