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 插件. 它可以延迟加载长页面中的图片. 在浏览器可视区域外的图片不会被载入, 直到用户将页面滚动到它们所在的位置. 这与图片预 ...
随机推荐
- svn:cleanup failed previous operation has not finished; run cleanup if it was interrupted
svn:cleanup failed previous operation has not finished; run cleanup if it was interrupted 今天 大脑一时短路 ...
- Linux运维人员如何学习python编程
Linux运维人员如何学习python编程 从不会写代码,到自己独立能写代码解决问题 .这个问题很重要!盲目学习所谓的项目,最后 还是不会自己写代码解决问题.首先解决了独立能写代码解决问题,再通过项目 ...
- bash获取properties文件资源
#!/bin/sh prop_value="" function getProperty() { file=$ prop_key=$ prop_value=`cat $file | ...
- 手把手写一个html_json信息源
html_json用于从网页里提取json数据. 这里用新浪读书的书讯举个例子,手把手写一个html_json信息源. 打开新浪读书的首页,可以看到页面下方有最新.书讯.童书.小说等几个Tab,这里我 ...
- install Hadoop
Installing Java Hadoop runs on both Unix and Windows operating systems, and requires Java to beinsta ...
- 基站查询接口,基站查询API
查询接口为商用,用于软件开发,非开发用户用不上.(说明:接口不能进行手机定位) 如需申请key,请联系QQ 2258172309. 1.移动联通基站查询接口 请求示例:http://www.cellm ...
- Linux LVM硬盘管理之二:创建逻辑卷步骤
创建逻辑卷(LV)的顺序:Linux分区---物理卷(PV)---卷组(VG)---逻辑卷(LV)---挂载到文件系统 删除逻辑卷(LV)的顺序:卸载文件系统----逻辑卷(LV)---卷组(VG)- ...
- [Linux] - Docker制作nginx+php
使用Docker制作nginx+php的镜像,这里的镜像是centos + nginx 1.9.7 + php 5.6.14 首先下载到nginx和php: nginx-1.9.5.tar.gz 下载 ...
- IIS7.5打开GZip压缩,同时启用GZip压缩JS/CSS文件的设置方法[bubuko.com]
IIS7.5或者IIS7.0开启GZip压缩方法:打开IIS,在右侧点击某个网站,在功能视图中的“IIS”区域,双击进入“压缩”,如图下图: 分别勾选“启用动态内容压缩”和“启用静态内容压缩”.这样最 ...
- android-8~23 View.java - dispatchTouchEvent源码
android-8 /** * Pass the touch screen motion event down to the target view, or this * view if it is ...