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. 第六章第一个linux个程序:统计单词个数

    第六章第一个linux个程序:统计单词个数 从本章就开始激动人心的时刻——实战,去慢慢揭开linux神秘的面纱.本章的实例是统计一片文章或者一段文字中的单词个数.  第 1 步:建立 Linu x 驱 ...

  2. Ionic2学习笔记

    Component nav: <ion-nav [root] = 'rootComponent'></ion-nav> ....import {Nav} from 'ionic ...

  3. URL Scheme APP跳转safari以及跳回APP

    上图 : 在plist文件里面设置. URL identifier 一般为反域名+项目名称 (尽可能保证少重复) URL Schemes是一个数组.一个APP可以添加多个.该参数为跳转时使用的标识. ...

  4. 关于Ubuntu共享文件夹的设置

    一.Xshell连接虚拟机(先关闭虚拟机的防火墙) sudo apt-get install openssh-serve sudo ufw disable sudo ufw allow 22 二.虚拟 ...

  5. Jenkins的配置(rpm red hat方式)

    Jenkins的配置文件位置 #### sudo chown -R admin /usr/lib/jenkins sudo chgrp -R admin /usr/lib/jenkins #### s ...

  6. jQuery 简介

    jQuery 简介 jQuery 库可以通过一行简单的标记被添加到网页中. jQuery 库 - 特性 jQuery 是一个 JavaScript 函数库. jQuery 库包含以下特性: HTML ...

  7. 2016HUAS_ACM暑假集训3F - Jungle Roads

    这个题目属于最小生成树问题,可以用Prim,也可以用Kruskal(还没试).题意简单直接,给你一个图,求出它最小生成树的权值. 题目最有趣的地方就是图的顶点是字母,稍微处理一下就好了. Sample ...

  8. [IOS8兼容性]IOS8上收不到通知

    应用中用到了通知功能,同时有远程通知和本地通知. 测试报告应用在iphone6 plus上,收不到本地通知. 因为所有的第三方闹钟应用采用的都是本地通知方式,所以第一时间随机下载了5款不同的闹钟应用. ...

  9. JavaScript 的循环语句语法摘要

     if条件语句语法: if(condition){ statements; } 理解:圆括号里的是条件参数  ,花括号里的为执行的语句. 示例代码:if(1>2){ alert("Th ...

  10. 从网易与淘宝的font-size思考前端设计稿与工作流 (转)

    从网易与淘宝的font-size思考前端设计稿与工作流   阅读目录 1. 问题的引出 2. 简单问题简单解决 3. 网易的做法 4. 淘宝的做法 5. 比较网易与淘宝的做法 6. 如何与设计协作 7 ...