static

void LoadMainAccountCSV(Args _args)

{

/*

SysExcelApplication        excel;

SysExcelWorkbooks      workbooks;

SysExcelWorkbook        workbook,_workbook;

SysExcelWorksheets    worksheets,_worksheets;

SysExcelWorksheet      worksheet,_worksheet;

SysExcelCells              cells,_cells;

*/

CommaIo           csvFile;

COMVariantType              type,_type;

;

MainAccount                   _MainAccount;

MainAccountLegalEntity        _MainAccountLegalEntity;

FileName                      fileName;

container                     readCon = conNull();

AccountNum                 mainAccountId;

;

filename =

@'C:\COA_live.csv';

csvFile =

new CommaIo(filename, 'r');

csvFile.inFieldDelimiter(

','); // Delimiter...

/*

#define.filename(@'C:\chartofaccount.xlsx')

excel = SysExcelApplication::construct();

workbooks = excel.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();

//row = row + 1;

type = cells.item(row+1, 1).value().variantType();

//通过循环读取导入信息

*/

ttsBegin;

//delete_from _MainAccount;

if (csvFile)

{

readCon = csvFile.read();

while (csvFile.status() == IO_Status::OK)

{

readCon = csvFile.read();

)

{

break;

}

)).RecId)

{

 

_MainAccount.clear();

_MainAccount.MainAccountId =

);

_MainAccount.LedgerChartOfAccounts =

;

))

{

case"Total":

_MainAccount.Type = DimensionLedgerAccountType::Total;

break;

case"Asset":

_MainAccount.Type = DimensionLedgerAccountType::Asset;

break;

case"Liability":

_MainAccount.Type = DimensionLedgerAccountType::Liability;

break;

case"Equity":

_MainAccount.Type = DimensionLedgerAccountType::Equity;

break;

case"BalanceSheet":

_MainAccount.Type = DimensionLedgerAccountType::BalanceSheet;

break;

case"Expense":

_MainAccount.Type = DimensionLedgerAccountType::Expense;

break;

case"Revenue":

_MainAccount.Type = DimensionLedgerAccountType::Revenue;

break;

case"ProfitAndLoss":

_MainAccount.Type = DimensionLedgerAccountType::ProfitAndLoss;

break;

case"Blank":

_MainAccount.Type = DimensionLedgerAccountType::Blank;

break;

case"Reporting":

_MainAccount.Type = DimensionLedgerAccountType::Reporting;

break;

case"Common_CN":

_MainAccount.Type = DimensionLedgerAccountType::Common_CN;

break;

}

_MainAccount.Name =

);

_MainAccount.insert();

}

else

{

mainAccountId =

);

selectforUpdate _MainAccount

where _MainAccount.MainAccountId == mainAccountId;

if(_MainAccount)

{

))

{

case"Total":

_MainAccount.Type = DimensionLedgerAccountType::Total;

break;

case"Asset":

_MainAccount.Type = DimensionLedgerAccountType::Asset;

break;

case"Liability":

_MainAccount.Type = DimensionLedgerAccountType::Liability;

break;

case"Equity":

_MainAccount.Type = DimensionLedgerAccountType::Equity;

break;

case"BalanceSheet":

_MainAccount.Type = DimensionLedgerAccountType::BalanceSheet;

break;

case"Expense":

_MainAccount.Type = DimensionLedgerAccountType::Expense;

break;

case"Revenue":

_MainAccount.Type = DimensionLedgerAccountType::Revenue;

break;

case"ProfitAndLoss":

_MainAccount.Type = DimensionLedgerAccountType::ProfitAndLoss;

break;

case"Blank":

_MainAccount.Type = DimensionLedgerAccountType::Blank;

break;

case"Reporting":

_MainAccount.Type = DimensionLedgerAccountType::Reporting;

break;

case"Common_CN":

_MainAccount.Type = DimensionLedgerAccountType::Common_CN;

break;

}

}

_MainAccount.update();

}

}

 

}

ttsCommit;

 

/*

ttsBegin;

//delete_from _MainAccountLegalEntity;

while select _MainAccount

{

_MainAccountLegalEntity.clear();

_MainAccountLegalEntity.LegalEntity = 5637144577;

_MainAccountLegalEntity.MainAccount = _MainAccount.RecId;

_MainAccountLegalEntity.insert();

}

ttsCommit;

*/

info(

"ok");

}

load mainaccount的更多相关文章

  1. load和initialize方法

      一.load 方法什么时候调用: 在main方法还没执行的时候 就会 加载所有类,调用所有类的load方法. load方法是线程安全的,它使用了锁,我们应该避免线程阻塞在load方法. 在项目中使 ...

  2. "NHibernate.Exceptions.GenericADOException: could not load an entity" 解决方案

     今天,测试一个项目的时候,抛出了这个莫名其妙的异常,然后就开始了一天的调试之旅... 花了很长时间,没有从代码找出任何问题... 那么到底哪里出问题呢? 根据下面那段长长的错误日志: -- ::, ...

  3. hibernate的get和load的区别

    在hibernate中我们知道如果要从数据库中得到一个对象,通常有两种方式,一种是通过session.get()方法,另一种就是通过session.load()方法,然后其实这两种方法在获得一个实体对 ...

  4. DOM加载过程中ready和load的区别

    在浏览器地址栏输入URL地址,浏览器开始加载页面时,有以下几个过程 1.浏览器开始解析HTML文档 2. 浏览器遇到HTML文档中的<script>元素以及CSS样式文件,并且没有asyn ...

  5. Resources.Load加载文件返回null的原因

    1.文件夹都要放在Resources目录下 2.加载时photoName不需要扩展名 Texture2D t = Resources.Load<Texture2D>("Loadi ...

  6. elasticsearch按照配置时遇到的一些坑 [Failed to load settings from [elasticsearch.yml]]

    这里整理几个空格引起的问题. 版本是elasticsearch-2.3.0 或者elasticsearch-rtf-master Exception in thread "main" ...

  7. jq方法中 $(window).load() 与 $(document).ready() 的区别

    通过自学进入了前端的行列,只知道在js中,一开头就写一个: window.onload = function(){ //doing sth} 然后所有的乱七八糟的代码全塞里面,大概知道window.o ...

  8. 事件DOMContentLoaded和load的区别

    1.当 onload 事件触发时,页面上所有的DOM,样式表,脚本,图片,flash都已经加载完成了. 2.当 DOMContentLoaded 事件触发时,仅当DOM加载完成,不包括样式表,图片,f ...

  9. Lazy Load, 延迟加载图片的 jQuery 插件.

    Lazy Load 是一个用 JavaScript 编写的 jQuery 插件. 它可以延迟加载长页面中的图片. 在浏览器可视区域外的图片不会被载入, 直到用户将页面滚动到它们所在的位置. 这与图片预 ...

随机推荐

  1. android 底层开发入门(一)

    第一个Linux驱动程序:统计单词个数 一.首先了解一下: 打印机驱动写入数据:对于打印机驱动来说,需要接收这些被写入的数据,并将它们通过PC的并口.USB等端口发送给打印机.要实现这一过程就需要Li ...

  2. HTML5 3D爱心动画 晚来的七夕礼物

    在线演示源码下载 这么好看的HTML5爱心动画,我们当然要把源代码分享给大家,下面是小编整理的源代码,主要是HTML代码和CSS代码. HTML代码: <div class=’heart3d’& ...

  3. vs2010配置boost编程环境(照抄并简化)

    第一步:下载boost,我下载的方法是从http://www.boost.org/上找最新的下载.名字叫boost_1_50_0.7z. 第二步:在D盘(我C盘空间不大,准备出至少10G的空间吧)创建 ...

  4. 王爽<<汇编语言>> 实验十四

    ;以"年/月/日 时:分:秒"的格式, 显示当前的日期, 时间 assume cs:code code segment main: out 70h,al ;告诉CMOS RAM将要 ...

  5. NOIp 2011 mayan游戏 搜索

    题目描述 Mayan puzzle是最近流行起来的一个游戏.游戏界面是一个 7 行5 列的棋盘,上面堆放着一些方块,方块不能悬空堆放,即方块必须放在最下面一行,或者放在其他方块之上.游戏通关是指在规定 ...

  6. HDU 5964 平行四边形

    假设直线L和L'相交于原点O.假设S ={s1,s2,...,sn}是平面上的n个点.你打 算找四个点满足如下条件:1.   A ∈ L 而 A' ∈ L'.2.   B,B'都属于S;即 B∈S 且 ...

  7. Matlab 进阶学习记录

    最近在看 Faster RCNN的Matlab code,发现很多matlab技巧,在此记录: 1. conf_proposal  =  proposal_config('image_means', ...

  8. OWIN是什么?

    OWIN的英文全称是Open Web Interface for .NET. 如果仅从名称上解析,可以得出这样的信息:OWIN是针对.NET平台的开放Web接口. 那Web接口是谁和谁之间的接口呢?是 ...

  9. Install Maya 2015 x64 in CentOS 7

    Thanks for Must(QQ ID)'s big help for installing Maya in CentOS7. This is my steps for installing ma ...

  10. Install CentOS 7 on Thinkpad t430

    - BIOS settings: - Thinkpadt430, BIOS settings: Config---------------------------- Network: wake on ...