load mainaccount
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的更多相关文章
- load和initialize方法
一.load 方法什么时候调用: 在main方法还没执行的时候 就会 加载所有类,调用所有类的load方法. load方法是线程安全的,它使用了锁,我们应该避免线程阻塞在load方法. 在项目中使 ...
- "NHibernate.Exceptions.GenericADOException: could not load an entity" 解决方案
今天,测试一个项目的时候,抛出了这个莫名其妙的异常,然后就开始了一天的调试之旅... 花了很长时间,没有从代码找出任何问题... 那么到底哪里出问题呢? 根据下面那段长长的错误日志: -- ::, ...
- hibernate的get和load的区别
在hibernate中我们知道如果要从数据库中得到一个对象,通常有两种方式,一种是通过session.get()方法,另一种就是通过session.load()方法,然后其实这两种方法在获得一个实体对 ...
- DOM加载过程中ready和load的区别
在浏览器地址栏输入URL地址,浏览器开始加载页面时,有以下几个过程 1.浏览器开始解析HTML文档 2. 浏览器遇到HTML文档中的<script>元素以及CSS样式文件,并且没有asyn ...
- Resources.Load加载文件返回null的原因
1.文件夹都要放在Resources目录下 2.加载时photoName不需要扩展名 Texture2D t = Resources.Load<Texture2D>("Loadi ...
- elasticsearch按照配置时遇到的一些坑 [Failed to load settings from [elasticsearch.yml]]
这里整理几个空格引起的问题. 版本是elasticsearch-2.3.0 或者elasticsearch-rtf-master Exception in thread "main" ...
- jq方法中 $(window).load() 与 $(document).ready() 的区别
通过自学进入了前端的行列,只知道在js中,一开头就写一个: window.onload = function(){ //doing sth} 然后所有的乱七八糟的代码全塞里面,大概知道window.o ...
- 事件DOMContentLoaded和load的区别
1.当 onload 事件触发时,页面上所有的DOM,样式表,脚本,图片,flash都已经加载完成了. 2.当 DOMContentLoaded 事件触发时,仅当DOM加载完成,不包括样式表,图片,f ...
- Lazy Load, 延迟加载图片的 jQuery 插件.
Lazy Load 是一个用 JavaScript 编写的 jQuery 插件. 它可以延迟加载长页面中的图片. 在浏览器可视区域外的图片不会被载入, 直到用户将页面滚动到它们所在的位置. 这与图片预 ...
随机推荐
- bx, bp, si, di寄存器的使用规则
首先,都可以单独使用. 另外,组合使用的情况下: 记住这张图片就行了=_= 意思就是,bx只能和si,di组合.bp只能和si,di组合.
- 什么是Ajax
AJAX不是一种新的编程语言,而是一种用于创建更好更快以及交互性更强的Web应用程序的技术. 使用Javascript向服务器提出请求并处理响应而不阻塞用户!核心对象XMLHTTPRequest.通过 ...
- 【jq】c#零基础学习之路(2)循环和分支
一.循环语句 1).do { //循环体,先运行一次. } while (true); 2). while (true) { //循环体 } 3). for (int i = 0; i < le ...
- 十分钟搞定微信企业帐号“echostr校验失败,请您检查是否正确解密并输出明文echostr”
问题域:在这里我们只解决密文可以正确解密,但微信验证提示“echostr校验失败,请您检查是否正确解密并输出明文echostr”的问题. 干货:没有正确验证的原因是:你给微信返回的是字符串,而微信需要 ...
- LeetCode 【318. Maximum Product of Word Lengths】
Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the tw ...
- halcon运行版设置
- js调用页面打印
----------------------调用页面打印-------------------------------- <body> <div id="divPrint& ...
- -Three.js开发指南---用three.js创建你的第一个三维场景(第一章)
本章主要做了下面的工作 1 生成一个简单的场景,该场景的物体只有平面和坐标轴 2 在第一个demo的基础上添加光源和方块物体,并生成阴影 3 在第二个demo的基础上,增加动画,使得方块进行旋转 4 ...
- Linux--01入门
一.远程控制台 Linux和windows不太一样,win系列默认都有桌面,我们买了服务器,一般都用远程桌面去连接. 而linux一般都是为了追求低成本或者高性能,可能我们就不需要桌面了,所以使用命令 ...
- STM32固件库3.5+uCOS2.86移植(转自暴走的工程师)
考了很多移植的资料和代码,终于移植好了...应该是完美移植吧~~哈哈哈~~ 编译环境是IAR 工程适用于STM32F10X大容量产品,如果不是,请自行修改启动文件和工程配置 编译器优化等级最高...这 ...