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 插件. 它可以延迟加载长页面中的图片. 在浏览器可视区域外的图片不会被载入, 直到用户将页面滚动到它们所在的位置. 这与图片预 ...
随机推荐
- PHP代码实用片段
一.黑名单过滤 function is_spam($text, $file, $split = ':', $regex = false){ $handle = fopen($file, 'rb'); ...
- Web前端开发学习心得(一)
说快也快,说慢也慢.自学前端一个月了,进步不算大,不过仔细想来,倒也收获不少.码几行字,一是总结经验,二是继往开来. 刚开始是跟慕课网学的HTML+CSS,慕课网的课程虽然好,但好多知识都是特别基础的 ...
- Unity 相关经典博客资源总结(持续更新)
就作为一个记录吧,把平时看过的Unity相关的一些好的Blog记录并分享. 好的论坛: Unity官方脚本 点评:这个不用说了,最核心的内容,理解整个Unity引擎的方方面面,梳理结构. Unity ...
- Android 启动模式及常用的Intent的Flag
LaunchMode 在声明Activity的xml中指定 android:launchMode="xxx" standard 标准模式.这是系统默认的模式,每次启动Activit ...
- tomcat解决加载JSP文件过大错误
当遇到多个Jsp include一起的时候加载时遇到如下错误: Error:SEVERE: Servlet.service() for servlet jsp threw exception org. ...
- SQL分页语句
有关分页 SQL 的资料很多,有的使用存储过程,有的使用游标.本人不喜欢使用游标,我觉得它耗资.效率低:使用存储过程是个不错的选择,因为存储过程是经过预编译的,执行效率高,也更灵活.先看看单条 SQL ...
- AlwaysOn添加高可用性自定义登陆用户的方法
1.在主服务器添加自定义登陆用户,比如TestUser 2.在主服务器执行如下SQL,在master数据库创建存储过程sp_hexadecimal,sp_help_revlogin USE maste ...
- 将 ASP.NET MVC3 Razor 项目部署到虚拟主机中
国内很多网站空间都只支持.NET 2.0 和 .NET 3.0 3.5,很少有空间商支持.NET 4的,即使有个别支持.NET 4,但是不支持MVC的默认路由访问形式. Go Daddy 的主机支持, ...
- webstorm 运行配置gulp
打开Run/Debug Configurations,设置
- python调用外部子进程,通过管道实现异步标准输入和输出的交互
我们通常会遇到这样的需求:通过C++或其他较底层的语言实现了一个复杂的功能模块,需要搭建一个基于Web的Demo,方法查询数据.由于Python语言的强大和简洁,其用来搭建Demo非常合适,Flask ...