/*jadclipse*/// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
package com.kingdee.eas.fi.gl.client;
import com.kingdee.bos.BOSException;
import com.kingdee.bos.ctrl.kdf.data.datasource.BOSQueryDataSource;
import com.kingdee.bos.ctrl.kdf.data.impl.BOSQueryDelegate;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
import com.kingdee.bos.util.BOSUuid;
import com.kingdee.eas.basedata.assistant.*;
import com.kingdee.eas.basedata.master.account.*;
import com.kingdee.eas.basedata.master.account.AccountProperty;
import com.kingdee.eas.basedata.master.auxacct.*;
import com.kingdee.eas.basedata.master.cssp.CustomerInfo;
import com.kingdee.eas.basedata.org.CompanyOrgUnitInfo;
import com.kingdee.eas.common.EASBizException;
import com.kingdee.eas.common.SysConstant;
import com.kingdee.eas.common.client.SysContext;
import com.kingdee.eas.fi.gl.*;
import com.kingdee.eas.fi.gl.common.GLResUtil;
import com.kingdee.eas.util.SysUtil;
import com.kingdee.eas.util.client.EASResource;
import com.kingdee.jdbc.rowset.IRowSet;
import com.kingdee.jdbc.rowset.IRowSetMetaData;
import com.kingdee.jdbc.rowset.impl.ColInfo;
import com.kingdee.jdbc.rowset.impl.DynamicRowSet;
import java.math.BigDecimal;
import java.sql.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import org.apache.velocity.util.StringUtils;
// Referenced classes of package com.kingdee.eas.fi.gl.client:
// VoucherEditParam
public class VoucherRowSetProvider
implements BOSQueryDelegate
{
public VoucherRowSetProvider(VoucherCollection vc, VoucherEditParam editParam)
{
vchType = null;
this.editParam = null;
needCpmputeAsst = false;
vchCol = vc;
this.editParam = editParam;
}
public IRowSet execute(BOSQueryDataSource ds)
{
IRowSet rs = null;
int i = 4;
do
{
if(i > 30)
break;
if(("dsStandard" + i).equalsIgnoreCase(ds.getID()))
{
rs = getRowSet(false, i);
break;
}
if(("flowStandard" + i).equalsIgnoreCase(ds.getID()))
{
rs = getRowSetFlow(false, i);
break;
}
if(("ds1_Standard" + i).equalsIgnoreCase(ds.getID()))
{
rs = getRowSet(true, i);
break;
}
if(("flow1_Standard" + i).equalsIgnoreCase(ds.getID()))
{
rs = getRowSetFlow(true, i);
break;
}
if(("ds2_subtotal" + i).equalsIgnoreCase(ds.getID()))
{
rs = getRowSet2(i);
break;
}
if(("ds" + i).equalsIgnoreCase(ds.getID()))
{
rs = getRowSet3(i);
break;
}
if(("voucher_ds" + i).equalsIgnoreCase(ds.getID()))
{
rs = getRowSet4(i);
break;
}
if(("vchFlow" + i).equalsIgnoreCase(ds.getID()))
{
rs = getRowSet5(i);
break;
}
i++;
} while(true);
return rs;
}
public IRowSet getRowSet(boolean pltype, int rowLineCount)
{
java.util.Locale locale = SysContext.getSysContext().getLocale();
DateFormat df = new SimpleDateFormat(EASResource.getString("com.kingdee.eas.fi.gl.GLAutoGenerateResource", "20_RptAsstactXBalanceUI"));
DateFormat dft = DateFormat.getDateTimeInstance(2, 2, locale);
int colCount = col.length;
DynamicRowSet drs = null;
boolean bInserRow = false;
try
{
drs = new DynamicRowSet(colCount);
for(int i = 0; i < colCount; i++)
{
ColInfo ci = new ColInfo();
ci.colType = 12;
ci.columnName = col[i];
ci.nullable = 1;
drs.setColInfo(i + 1, ci);
}
drs.beforeFirst();
Iterator itrVch = vchCol.iterator();
int size = vchCol.size();
BigDecimal allDeit = SysConstant.BIGZERO;
BigDecimal allCret = SysConstant.BIGZERO;
int vchCount = 0;
while(itrVch.hasNext())
{
VoucherInfo vch = (VoucherInfo)itrVch.next();
if(pltype && computerVoucherType(vch))
vch = changeVoucher(vch);
String vchId = Integer.toString(++vchCount);
CompanyOrgUnitInfo com = vch.getCompany();
CurrencyInfo localCurrency = com.getBaseCurrency();
int lcpre = localCurrency.getPrecision();
CurrencyInfo reportingCurrency = com.getReportCurrency();
int rcpre = reportingCurrency.getPrecision();
allDeit = vch.getLocalDebitAmount();
allCret = vch.getLocalCreditAmount();
Iterator itrEntry = vch.getEntries().iterator();
EntryDC entryDC = null;
int entrySize = vch.getEntries().size();
int voucherCount = 0;
if(entrySize % rowLineCount == 0)
voucherCount = entrySize / rowLineCount;
else
voucherCount = entrySize / rowLineCount + 1;
int entryCount = 1;
while(itrEntry.hasNext())
{
VoucherEntryInfo e = (VoucherEntryInfo)itrEntry.next();
EntryDC dc = e.getEntryDC();
drs.moveToInsertRow();
clearRow(drs);
fillVoucherHeaderData(vch, drs, df, dft, size, allDeit, allCret);
fillVoucherEntryData(vchId, e, drs, lcpre, rcpre);
entryCount++;
int page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
}
drs.insertRow();
}
}
drs.beforeFirst();
}
catch(Exception ex)
{
ex.printStackTrace();
return null;
}
return drs;
}
public IRowSet getRowSetFlow(boolean pltype, int rowLineCount)
{
java.util.Locale locale = SysContext.getSysContext().getLocale();
DateFormat df = new SimpleDateFormat(EASResource.getString("com.kingdee.eas.fi.gl.GLAutoGenerateResource", "20_RptAsstactXBalanceUI"));
DateFormat dft = DateFormat.getDateTimeInstance(2, 2, locale);
int colCount = col.length;
DynamicRowSet drs = null;
CashflowRecordCollection cashflowRecordsCollection = null;
try
{
drs = new DynamicRowSet(colCount);
for(int i = 0; i < colCount; i++)
{
ColInfo ci = new ColInfo();
ci.colType = 12;
ci.columnName = col[i];
ci.nullable = 1;
drs.setColInfo(i + 1, ci);
}
drs.beforeFirst();
Iterator itrVch = vchCol.iterator();
int size = vchCol.size();
BigDecimal allDeit = SysConstant.BIGZERO;
BigDecimal allCret = SysConstant.BIGZERO;
int vchCount = 0;
while(itrVch.hasNext())
{
VoucherInfo vch = (VoucherInfo)itrVch.next();
if(pltype && computerVoucherType(vch))
vch = changeVoucher(vch);
String vchId = Integer.toString(++vchCount);
CompanyOrgUnitInfo com = vch.getCompany();
CurrencyInfo localCurrency = com.getBaseCurrency();
int lcpre = localCurrency.getPrecision();
CurrencyInfo reportingCurrency = com.getReportCurrency();
int rcpre = reportingCurrency.getPrecision();
allDeit = vch.getLocalDebitAmount();
allCret = vch.getLocalCreditAmount();
Iterator itrEntry = vch.getEntries().iterator();
EntryDC entryDC = null;
int entrySize = vch.getEntries().size();
int voucherCount = 0;
if(entrySize % rowLineCount == 0)
voucherCount = entrySize / rowLineCount;
else
voucherCount = entrySize / rowLineCount + 1;
int entryCount = 1;
while(itrEntry.hasNext())
{
VoucherEntryInfo e = (VoucherEntryInfo)itrEntry.next();
EntryDC dc = e.getEntryDC();
drs.moveToInsertRow();
clearRow(drs);
fillVoucherHeaderData(vch, drs, df, dft, size, allDeit, allCret);
fillVoucherEntryData(vchId, e, drs, lcpre, rcpre);
entryCount++;
int page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
}
if(chkPrintCashFlow)
printCashflow(drs, e, null, lcpre);
drs.insertRow();
}
}
drs.beforeFirst();
}
catch(Exception ex)
{
ex.printStackTrace();
return null;
}
return drs;
}
public IRowSet getRowSet2(int rowLineCount)
{
java.util.Locale locale = SysContext.getSysContext().getLocale();
DateFormat df = new SimpleDateFormat(EASResource.getString("com.kingdee.eas.fi.gl.GLAutoGenerateResource", "20_RptAsstactXBalanceUI"));
DateFormat dft = DateFormat.getDateTimeInstance(2, 2, locale);
int colCount = col.length;
DynamicRowSet drs = null;
IAssistantHG assistantHG = null;
IVoucherAssistRecord asstre = null;
try
{
drs = new DynamicRowSet(colCount);
for(int i = 0; i < colCount; i++)
{
ColInfo ci = new ColInfo();
ci.colType = 12;
ci.columnName = col[i];
ci.nullable = 1;
drs.setColInfo(i + 1, ci);
}
drs.beforeFirst();
Iterator itrVch = vchCol.iterator();
int size = vchCol.size();
BigDecimal allDeit = SysConstant.BIGZERO;
BigDecimal allCret = SysConstant.BIGZERO;
int vchCount = 0;
while(itrVch.hasNext())
{
VoucherInfo vch = (VoucherInfo)itrVch.next();
String vchId = Integer.toString(++vchCount);
CompanyOrgUnitInfo com = vch.getCompany();
CurrencyInfo localCurrency = com.getBaseCurrency();
int lcpre = localCurrency.getPrecision();
CurrencyInfo reportingCurrency = com.getReportCurrency();
int rcpre = reportingCurrency.getPrecision();
allDeit = vch.getLocalDebitAmount();
allCret = vch.getLocalCreditAmount();
Iterator itr = vch.getEntries().iterator();
int entrySize = 0;
int seq = 0;
while(itr.hasNext())
{
VoucherEntryInfo e = (VoucherEntryInfo)itr.next();
seq = e.getSeq();
VoucherAssistRecordCollection assitCollection = e.getAssistRecords();
if(assitCollection != null && assitCollection.size() > 0 && chkAssistant)
entrySize += assitCollection.size();
else
entrySize++;
}
Iterator itrEntry = vch.getEntries().iterator();
EntryDC entryDC = null;
int voucherCount = 0;
if((entrySize + seq) % rowLineCount == 0)
voucherCount = (entrySize + seq) / rowLineCount;
else
voucherCount = (entrySize + seq) / rowLineCount + 1;
int entryCount = 1;
while(itrEntry.hasNext())
{
VoucherEntryInfo e = (VoucherEntryInfo)itrEntry.next();
VoucherAssistRecordCollection assitCollection = e.getAssistRecords();
EntryDC dc = e.getEntryDC();
int asstCount = 0;
int page;
if(assitCollection != null && assitCollection.size() > 0 && chkAssistant)
{
for(Iterator itrASST = assitCollection.iterator(); itrASST.hasNext(); drs.insertRow())
{
VoucherAssistRecordInfo r = (VoucherAssistRecordInfo)itrASST.next();
drs.moveToInsertRow();
clearRow(drs);
fillVoucherHeaderData(vch, drs, df, dft, size, allDeit, allCret);
fillVoucherEntryData(vchId, e, drs, lcpre, rcpre);
if(chkAssistant)
fillVoucherASSTData(r, drs, df, lcpre, dc, assistantHG, asstre, e);
if(++asstCount > 1)
{
drs.updateString("e_seq", " ");
drs.updateString("e_account", null);
drs.updateString("e_account1", null);
}
entryCount++;
page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("sum", "");
}
}
} else
{
drs.moveToInsertRow();
clearRow(drs);
fillVoucherHeaderData(vch, drs, df, dft, size, allDeit, allCret);
fillVoucherEntryData(vchId, e, drs, lcpre, rcpre);
if(EntryDC.DEBIT.equals(dc))
{
drs.updateString("e_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("e_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("e_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
drs.updateString("r_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("r_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
} else
{
drs.updateString("e_localAmountCredit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("e_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("e_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
drs.updateString("r_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_localAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
}
entryCount++;
page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("sum", "");
}
drs.insertRow();
}
drs.moveToInsertRow();
drs.updateString("e_seq", "");
drs.updateString("e_description", "");
drs.updateString("e_account", "");
drs.updateString("e_account1", "");
drs.updateString("zc_account", "");
drs.updateString("e_currency", "");
drs.updateString("e_measureUnitName", "");
drs.updateString("e_measureUnitNumber", "");
drs.updateString("periodYear", "");
drs.updateString("periodNumber", "");
drs.updateString("bizDate", "");
drs.updateString("bookedDate", "");
drs.updateString("bookedDateYear", "");
drs.updateString("bookedDateMonth", "");
drs.updateString("r_description", "");
drs.updateString("r_settlementType", "");
drs.updateString("r_settlementCode", "");
drs.updateString("r_bizNumber", "");
drs.updateString("r_originalAmount", "");
drs.updateString("r_originalAmount", "");
drs.updateString("r_originalAmountDebit", "");
drs.updateString("r_localAmount", "");
drs.updateString("r_localAmountDebit", "");
drs.updateString("r_localAmountCredit", "");
drs.updateString("r_reportingAmount", "");
drs.updateString("r_reportingAmountDebit", "");
drs.updateString("r_reportingAmountCredit", "");
drs.updateString("r_measureUnitName", "");
drs.updateString("r_measureUnitNumber", "");
drs.updateString("r_price", "");
drs.updateString("r_quantity", "");
drs.updateString("r_bizDate", "");
drs.updateString("r_invoice", "");
drs.updateString("r_endDate", "");
drs.updateString("r_assGrp", "");
drs.updateString("r_longName", "");
drs.updateString("r_accountAsst", "");
drs.updateString("r_AsstHeadNumber", "");
drs.updateString("r_AsstNumber", "");
drs.updateString("r_AsstHeadName", "");
drs.updateString("r_AsstName", "");
drs.updateString("r_AsstLevelName", "");
drs.updateString("zc_assGrp", "");
drs.updateString("c_item", "");
drs.updateString("c_itemEbb", "");
drs.updateString("c_primItem", "");
drs.updateString("c_suppItem", "");
drs.updateString("c_oppAccount", "");
drs.updateString("c_originalAmount", "");
drs.updateString("c_localAmount", "");
drs.updateString("c_reportingAmount", "");
drs.updateString("c_primItemName", "");
drs.updateString("c_suppItemName", "");
drs.updateString("customer.number", "");
drs.updateString("customer.name", "");
drs.updateString("cusNumberName", "");
drs.updateString("vchId", vchId);
drs.updateString("e_isoCode", GLResUtil.getRes("subtotal"));
if(EntryDC.DEBIT.equals(dc))
{
drs.updateString("e_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("e_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("e_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
drs.updateString("r_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("r_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
} else
{
drs.updateString("e_localAmountCredit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("e_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("e_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
drs.updateString("r_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_localAmountCredit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("r_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
}
entryCount++;
page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
}
drs.insertRow();
}
}
drs.beforeFirst();
}
catch(Exception ex)
{
ex.printStackTrace();
return null;
}
return drs;
}
public IRowSet getRowSet3(int rowLineCount)
{
java.util.Locale locale = SysContext.getSysContext().getLocale();
DateFormat df = new SimpleDateFormat(EASResource.getString("com.kingdee.eas.fi.gl.GLAutoGenerateResource", "20_RptAsstactXBalanceUI"));
DateFormat dft = DateFormat.getDateTimeInstance(2, 2, locale);
int colCount = col.length;
DynamicRowSet drs = null;
IAssistantHG assistantHG = null;
IVoucherAssistRecord asstre = null;
VoucherEntryInfo e = null;
CashflowRecordCollection cashflowRecordsCollection = null;
try
{
drs = new DynamicRowSet(colCount);
for(int i = 0; i < colCount; i++)
{
ColInfo ci = new ColInfo();
ci.colType = 12;
ci.columnName = col[i];
ci.nullable = 1;
drs.setColInfo(i + 1, ci);
}
drs.beforeFirst();
Iterator itrVch = vchCol.iterator();
int size = vchCol.size();
BigDecimal allDeit = SysConstant.BIGZERO;
BigDecimal allCret = SysConstant.BIGZERO;
int vchCount = 0;
while(itrVch.hasNext())
{
VoucherInfo vch = (VoucherInfo)itrVch.next();
String vchId = Integer.toString(++vchCount);
CompanyOrgUnitInfo com = vch.getCompany();
CurrencyInfo localCurrency = com.getBaseCurrency();
int lcpre = localCurrency.getPrecision();
CurrencyInfo reportingCurrency = com.getReportCurrency();
int rcpre = reportingCurrency.getPrecision();
allDeit = vch.getLocalDebitAmount();
allCret = vch.getLocalCreditAmount();
Iterator itr = vch.getEntries().iterator();
int entrySize = 0;
while(itr.hasNext())
{
e = (VoucherEntryInfo)itr.next();
VoucherAssistRecordCollection assitCollection = e.getAssistRecords();
if(assitCollection != null && assitCollection.size() > 0 && chkAssistant)
entrySize += assitCollection.size();
else
entrySize++;
}
Iterator itrEntry = vch.getEntries().iterator();
EntryDC entryDC = null;
int rowCount = 0;
int voucherCount = 0;
if(entrySize % rowLineCount == 0)
voucherCount = entrySize / rowLineCount;
else
voucherCount = entrySize / rowLineCount + 1;
int entryCount = 0;
while(itrEntry.hasNext())
{
e = (VoucherEntryInfo)itrEntry.next();
VoucherAssistRecordCollection assitCollection = e.getAssistRecords();
EntryDC dc = e.getEntryDC();
int asstCount = 0;
if(assitCollection != null && assitCollection.size() > 0 && chkAssistant)
{
Iterator itrASST = assitCollection.iterator();
while(itrASST.hasNext())
{
VoucherAssistRecordInfo r = (VoucherAssistRecordInfo)itrASST.next();
drs.moveToInsertRow();
clearRow(drs);
fillVoucherHeaderData(vch, drs, df, dft, size, allDeit, allCret);
fillVoucherEntryData(vchId, e, drs, lcpre, rcpre);
if(chkAssistant)
fillVoucherASSTData(r, drs, df, lcpre, dc, assistantHG, asstre, e);
if(++asstCount > 1)
drs.updateString("e_seq", " ");
entryCount++;
int page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
}
drs.insertRow();
}
} else
{
drs.moveToInsertRow();
clearRow(drs);
fillVoucherHeaderData(vch, drs, df, dft, size, allDeit, allCret);
fillVoucherEntryData(vchId, e, drs, lcpre, rcpre);
if(EntryDC.DEBIT.equals(dc))
{
drs.updateString("e_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("e_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("e_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
drs.updateString("r_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("r_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
} else
{
drs.updateString("e_localAmountCredit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("e_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("e_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
drs.updateString("r_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_localAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
}
entryCount++;
int page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
}
drs.insertRow();
}
}
}
drs.beforeFirst();
}
catch(Exception ex)
{
ex.printStackTrace();
return null;
}
return drs;
}
public IRowSet getRowSet4(int rowLineCount)
{
java.util.Locale locale = SysContext.getSysContext().getLocale();
DateFormat df = new SimpleDateFormat(EASResource.getString("com.kingdee.eas.fi.gl.GLAutoGenerateResource", "20_RptAsstactXBalanceUI"));
DateFormat dft = DateFormat.getDateTimeInstance(2, 2, locale);
int colCount = col.length;
DynamicRowSet drs = null;
IAssistantHG assistantHG = null;
IVoucherAssistRecord asstre = null;
try
{
drs = new DynamicRowSet(colCount);
for(int i = 0; i < colCount; i++)
{
ColInfo ci = new ColInfo();
ci.colType = 12;
ci.columnName = col[i];
ci.nullable = 1;
drs.setColInfo(i + 1, ci);
}
drs.beforeFirst();
Iterator itrVch = vchCol.iterator();
int size = vchCol.size();
BigDecimal allDeit = SysConstant.BIGZERO;
BigDecimal allCret = SysConstant.BIGZERO;
int vchCount = 0;
while(itrVch.hasNext())
{
VoucherInfo vch = (VoucherInfo)itrVch.next();
String vchId = Integer.toString(++vchCount);
CompanyOrgUnitInfo com = vch.getCompany();
CurrencyInfo localCurrency = com.getBaseCurrency();
int lcpre = localCurrency.getPrecision();
CurrencyInfo reportingCurrency = com.getReportCurrency();
int rcpre = reportingCurrency.getPrecision();
allDeit = vch.getLocalDebitAmount();
allCret = vch.getLocalCreditAmount();
Iterator itr = vch.getEntries().iterator();
int entrySize = 0;
while(itr.hasNext())
{
VoucherEntryInfo e = (VoucherEntryInfo)itr.next();
VoucherAssistRecordCollection assitCollection = e.getAssistRecords();
if(assitCollection != null && assitCollection.size() > 0 && chkAssistant)
entrySize += assitCollection.size();
else
entrySize++;
}
Iterator itrEntry = vch.getEntries().iterator();
EntryDC entryDC = null;
int rowCount = 0;
int voucherCount = 0;
if(entrySize % rowLineCount == 0)
voucherCount = entrySize / rowLineCount;
else
voucherCount = entrySize / rowLineCount + 1;
int entryCount = 0;
BigDecimal creditTotal = GlUtils.zero;
BigDecimal debitTotal = GlUtils.zero;
HashMap creditmap = new HashMap();
HashMap debitmap = new HashMap();
itr = vch.getEntries().iterator();
label0:
do
{
if(!itr.hasNext())
break;
VoucherEntryInfo e = (VoucherEntryInfo)itr.next();
EntryDC dc = e.getEntryDC();
VoucherAssistRecordCollection assitCollection = e.getAssistRecords();
if(assitCollection != null && assitCollection.size() > 0 && chkAssistant)
{
Iterator itrASST = assitCollection.iterator();
do
{
int page;
do
{
if(!itrASST.hasNext())
continue label0;
VoucherAssistRecordInfo r = (VoucherAssistRecordInfo)itrASST.next();
entryCount++;
page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
if(entryCount % rowLineCount == 1)
{
creditTotal = GlUtils.zero;
debitTotal = GlUtils.zero;
}
if(EntryDC.DEBIT.equals(dc))
debitTotal = debitTotal.add(r.getLocalAmount());
else
creditTotal = creditTotal.add(r.getLocalAmount());
} while(entryCount % rowLineCount != 0);
creditmap.put(String.valueOf(page), creditTotal);
debitmap.put(String.valueOf(page), debitTotal);
} while(true);
}
entryCount++;
int page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
if(entryCount % rowLineCount == 1)
{
creditTotal = GlUtils.zero;
debitTotal = GlUtils.zero;
}
if(EntryDC.DEBIT.equals(dc))
debitTotal = debitTotal.add(e.getLocalAmount());
else
creditTotal = creditTotal.add(e.getLocalAmount());
if(entryCount % rowLineCount == 0)
{
creditmap.put(String.valueOf(page), creditTotal);
debitmap.put(String.valueOf(page), debitTotal);
}
} while(true);
entryCount = 0;
while(itrEntry.hasNext())
{
VoucherEntryInfo e = (VoucherEntryInfo)itrEntry.next();
VoucherAssistRecordCollection assitCollection = e.getAssistRecords();
EntryDC dc = e.getEntryDC();
int asstCount = 0;
if(assitCollection != null && assitCollection.size() > 0 && chkAssistant)
{
Iterator itrASST = assitCollection.iterator();
while(itrASST.hasNext())
{
VoucherAssistRecordInfo r = (VoucherAssistRecordInfo)itrASST.next();
drs.moveToInsertRow();
clearRow(drs);
fillVoucherHeaderData(vch, drs, df, dft, size, allDeit, allCret);
fillVoucherEntryData(vchId, e, drs, lcpre, rcpre);
if(chkAssistant)
fillVoucherASSTData(r, drs, df, lcpre, dc, assistantHG, asstre, e);
if(++asstCount > 1)
drs.updateString("e_seq", " ");
entryCount++;
int page = 0;
if(entryCount % rowLineCount == 0)
{
page = entryCount / rowLineCount;
} else
{
page = entryCount / rowLineCount + 1;
if(entryCount % rowLineCount == 1)
{
creditTotal = GlUtils.zero;
debitTotal = GlUtils.zero;
}
}
if(EntryDC.DEBIT.equals(dc))
debitTotal = debitTotal.add(r.getLocalAmount());
else
creditTotal = creditTotal.add(r.getLocalAmount());
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("sum", "");
} else
{
drs.updateString("debitTotal", GlUtils.formatNumber((BigDecimal)debitmap.get(String.valueOf(page)), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber((BigDecimal)creditmap.get(String.valueOf(page)), lcpre));
drs.updateString("sum", GLResUtil.getRes("subtotal"));
}
drs.insertRow();
}
} else
{
drs.moveToInsertRow();
clearRow(drs);
fillVoucherHeaderData(vch, drs, df, dft, size, allDeit, allCret);
fillVoucherEntryData(vchId, e, drs, lcpre, rcpre);
if(EntryDC.DEBIT.equals(dc))
{
drs.updateString("e_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("e_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("e_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
drs.updateString("r_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("r_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
} else
{
drs.updateString("e_localAmountCredit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("e_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("e_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
drs.updateString("r_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_localAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
}
entryCount++;
int page = 0;
if(entryCount % rowLineCount == 0)
{
page = entryCount / rowLineCount;
} else
{
page = entryCount / rowLineCount + 1;
if(entryCount % rowLineCount == 1)
{
creditTotal = GlUtils.zero;
debitTotal = GlUtils.zero;
}
}
if(EntryDC.DEBIT.equals(dc))
debitTotal = debitTotal.add(e.getLocalAmount());
else
creditTotal = creditTotal.add(e.getLocalAmount());
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("sum", "");
} else
{
drs.updateString("debitTotal", GlUtils.formatNumber((BigDecimal)debitmap.get(String.valueOf(page)), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber((BigDecimal)creditmap.get(String.valueOf(page)), lcpre));
drs.updateString("sum", GLResUtil.getRes("subtotal"));
}
drs.insertRow();
}
}
}
drs.beforeFirst();
}
catch(Exception ex)
{
ex.printStackTrace();
return null;
}
return drs;
}
public IRowSet getRowSet5(int rowLineCount)
{
java.util.Locale locale = SysContext.getSysContext().getLocale();
DateFormat df = new SimpleDateFormat(EASResource.getString("com.kingdee.eas.fi.gl.GLAutoGenerateResource", "20_RptAsstactXBalanceUI"));
DateFormat dft = DateFormat.getDateTimeInstance(2, 2, locale);
int colCount = col.length;
DynamicRowSet drs = null;
IAssistantHG assistantHG = null;
IVoucherAssistRecord asstre = null;
boolean bInserRow = false;
try
{
drs = new DynamicRowSet(colCount);
for(int i = 0; i < colCount; i++)
{
ColInfo ci = new ColInfo();
ci.colType = 12;
ci.columnName = col[i];
ci.nullable = 1;
drs.setColInfo(i + 1, ci);
}
drs.beforeFirst();
Iterator itrVch = vchCol.iterator();
int size = vchCol.size();
BigDecimal allDeit = SysConstant.BIGZERO;
BigDecimal allCret = SysConstant.BIGZERO;
int vchCount = 0;
while(itrVch.hasNext())
{
VoucherInfo vch = (VoucherInfo)itrVch.next();
String vchId = Integer.toString(++vchCount);
CompanyOrgUnitInfo com = vch.getCompany();
CurrencyInfo localCurrency = com.getBaseCurrency();
int lcpre = localCurrency.getPrecision();
CurrencyInfo reportingCurrency = com.getReportCurrency();
int rcpre = reportingCurrency.getPrecision();
allDeit = vch.getLocalDebitAmount();
allCret = vch.getLocalCreditAmount();
Iterator itr = vch.getEntries().iterator();
int entrySize = 0;
while(itr.hasNext())
{
VoucherEntryInfo e = (VoucherEntryInfo)itr.next();
VoucherAssistRecordCollection assitCollection = e.getAssistRecords();
if(assitCollection != null && assitCollection.size() > 0 && chkAssistant)
entrySize += assitCollection.size();
else
entrySize++;
}
Iterator itrEntry = vch.getEntries().iterator();
EntryDC entryDC = null;
int rowCount = 0;
int voucherCount = 0;
if(entrySize % rowLineCount == 0)
voucherCount = entrySize / rowLineCount;
else
voucherCount = entrySize / rowLineCount + 1;
int entryCount = 0;
BigDecimal creditTotal = GlUtils.zero;
BigDecimal debitTotal = GlUtils.zero;
HashMap creditmap = new HashMap();
HashMap debitmap = new HashMap();
itr = vch.getEntries().iterator();
label0:
do
{
if(!itr.hasNext())
break;
VoucherEntryInfo e = (VoucherEntryInfo)itr.next();
EntryDC dc = e.getEntryDC();
VoucherAssistRecordCollection assitCollection = e.getAssistRecords();
if(assitCollection != null && assitCollection.size() > 0 && chkAssistant)
{
Iterator itrASST = assitCollection.iterator();
do
{
int page;
do
{
if(!itrASST.hasNext())
continue label0;
VoucherAssistRecordInfo r = (VoucherAssistRecordInfo)itrASST.next();
entryCount++;
page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
if(entryCount % rowLineCount == 1)
{
creditTotal = GlUtils.zero;
debitTotal = GlUtils.zero;
}
if(EntryDC.DEBIT.equals(dc))
debitTotal = debitTotal.add(r.getLocalAmount());
else
creditTotal = creditTotal.add(r.getLocalAmount());
} while(entryCount % rowLineCount != 0);
creditmap.put(String.valueOf(page), creditTotal);
debitmap.put(String.valueOf(page), debitTotal);
} while(true);
}
entryCount++;
int page = 0;
if(entryCount % rowLineCount == 0)
page = entryCount / rowLineCount;
else
page = entryCount / rowLineCount + 1;
if(entryCount % rowLineCount == 1)
{
creditTotal = GlUtils.zero;
debitTotal = GlUtils.zero;
}
if(EntryDC.DEBIT.equals(dc))
debitTotal = debitTotal.add(e.getLocalAmount());
else
creditTotal = creditTotal.add(e.getLocalAmount());
if(entryCount % rowLineCount == 0)
{
creditmap.put(String.valueOf(page), creditTotal);
debitmap.put(String.valueOf(page), debitTotal);
}
} while(true);
entryCount = 0;
while(itrEntry.hasNext())
{
VoucherEntryInfo e = (VoucherEntryInfo)itrEntry.next();
VoucherAssistRecordCollection assitCollection = e.getAssistRecords();
EntryDC dc = e.getEntryDC();
int asstCount = 0;
if(assitCollection != null && assitCollection.size() > 0 && chkAssistant)
{
Iterator itrASST = assitCollection.iterator();
while(itrASST.hasNext())
{
VoucherAssistRecordInfo r = (VoucherAssistRecordInfo)itrASST.next();
drs.moveToInsertRow();
clearRow(drs);
fillVoucherHeaderData(vch, drs, df, dft, size, allDeit, allCret);
fillVoucherEntryData(vchId, e, drs, lcpre, rcpre);
if(chkAssistant)
fillVoucherASSTData(r, drs, df, lcpre, dc, assistantHG, asstre, e);
if(++asstCount > 1)
drs.updateString("e_seq", " ");
entryCount++;
int page = 0;
if(entryCount % rowLineCount == 0)
{
page = entryCount / rowLineCount;
} else
{
page = entryCount / rowLineCount + 1;
if(entryCount % rowLineCount == 1)
{
creditTotal = GlUtils.zero;
debitTotal = GlUtils.zero;
}
}
if(EntryDC.DEBIT.equals(dc))
debitTotal = debitTotal.add(r.getLocalAmount());
else
creditTotal = creditTotal.add(r.getLocalAmount());
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("sum", "");
} else
{
drs.updateString("debitTotal", GlUtils.formatNumber((BigDecimal)debitmap.get(String.valueOf(page)), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber((BigDecimal)creditmap.get(String.valueOf(page)), lcpre));
drs.updateString("sum", GLResUtil.getRes("subtotal"));
}
if(chkPrintCashFlow)
printCashflow(drs, e, r, lcpre);
drs.insertRow();
}
} else
{
drs.moveToInsertRow();
clearRow(drs);
fillVoucherHeaderData(vch, drs, df, dft, size, allDeit, allCret);
fillVoucherEntryData(vchId, e, drs, lcpre, rcpre);
if(EntryDC.DEBIT.equals(dc))
{
drs.updateString("e_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("e_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("e_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
drs.updateString("r_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("r_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
} else
{
drs.updateString("e_localAmountCredit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
drs.updateString("e_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("e_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
drs.updateString("r_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_localAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
drs.updateString("r_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
}
entryCount++;
int page = 0;
if(entryCount % rowLineCount == 0)
{
page = entryCount / rowLineCount;
} else
{
page = entryCount / rowLineCount + 1;
if(entryCount % rowLineCount == 1)
{
creditTotal = GlUtils.zero;
debitTotal = GlUtils.zero;
}
}
if(EntryDC.DEBIT.equals(dc))
debitTotal = debitTotal.add(e.getLocalAmount());
else
creditTotal = creditTotal.add(e.getLocalAmount());
drs.updateString("pageCount", page + "/" + voucherCount);
drs.updateString("pageCurrent", page + "");
drs.updateString("pageTotal", "" + voucherCount);
drs.updateString("bizStatus", vch.getBizStatus().toString());
drs.updateString("attachments", Integer.toString(vch.getAttachments()));
drs.updateString("attachmentsChinese", GlUtils.getChineseBig(vch.getAttachments()));
if(page == voucherCount)
{
drs.updateString("debitTotal", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("localAmountDebit", GlUtils.formatNumber(vch.getLocalDebitAmount(), lcpre));
drs.updateString("localAmountCredit", GlUtils.formatNumber(vch.getLocalCreditAmount(), lcpre));
drs.updateString("reportingAmountDebit", GlUtils.formatNumber(vch.getReportingDebitAmount(), lcpre));
drs.updateString("reportingAmountCredit", GlUtils.formatNumber(vch.getReportingCreditAmount(), lcpre));
drs.updateString("amountTotalChinese", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("amountTotal", GlUtils.getChineseFormat(vch.getLocalCreditAmount(), false));
drs.updateString("sum", "");
} else
{
drs.updateString("debitTotal", GlUtils.formatNumber((BigDecimal)debitmap.get(String.valueOf(page)), lcpre));
drs.updateString("creditTotal", GlUtils.formatNumber((BigDecimal)creditmap.get(String.valueOf(page)), lcpre));
drs.updateString("sum", GLResUtil.getRes("subtotal"));
}
if(chkPrintCashFlow)
printCashflow(drs, e, null, lcpre);
drs.insertRow();
}
}
}
drs.beforeFirst();
}
catch(Exception ex)
{
ex.printStackTrace();
return null;
}
return drs;
}
protected static void fillVoucherHeaderData(VoucherInfo vch, IRowSet rs, DateFormat df, DateFormat dft, int size, BigDecimal allDeit, BigDecimal allCret)
throws Exception
{
CompanyOrgUnitInfo com = vch.getCompany();
CurrencyInfo localCurrency = com.getBaseCurrency();
int lcpre = localCurrency.getPrecision();
CurrencyInfo reportingCurrency = com.getReportCurrency();
int rcpre = reportingCurrency.getPrecision();
rs.updateString("company", com.getName());
rs.updateString("companyBaseCurreny", com.getBaseCurrency().getName().toString());
rs.updateString("companyReportCurreny", com.getReportCurrency().getName().toString());
rs.updateString("description", vch.getDescription());
rs.updateString("bookedDate", GlUtils.formatDate(df, vch.getBookedDate()));
rs.updateString("voucherDate", GlUtils.formatDate(df, vch.getBookedDate()));
Date voucherBookDate = (Date)vch.getBookedDate();
Calendar now = Calendar.getInstance();
now.setTime(voucherBookDate);
rs.updateString("bookedDateYear", String.valueOf(now.get(1)));
int month = now.get(2) + 1;
rs.updateString("bookedDateMonth", month >= 10 ? "" + month : "0" + month);
int date = now.get(5);
rs.updateString("bookedDateDay", date >= 10 ? "" + date : "0" + date);
rs.updateString("bizDate", GlUtils.formatDate(df, vch.getBizDate()));
PeriodInfo prd = vch.getPeriod();
if(prd != null)
{
rs.updateString("periodYear", Integer.toString(prd.getPeriodYear()));
rs.updateString("periodNumber", Integer.toString(prd.getPeriodNumber()));
}
rs.updateString("sysDateNow", GlUtils.formatDate(dft, SysUtil.getAppServerTime(null)));
String type = GlUtils.getName(vch, "voucherType");
rs.updateString("voucherType", type);
String strNumber = vch.getNumber();
String strNumberShort = "";
if(strNumber != null)
{
int n = strNumber.length();
int il = 0;
char ch[] = new char[n];
int i = 0;
do
{
if(i >= n)
break;
ch[i] = strNumber.charAt(i);
if(ch[i] != '0')
break;
il++;
i++;
} while(true);
strNumberShort = strNumber.substring(il, n);
}
rs.updateString("number", vch.getNumber());
rs.updateString("numberShort", strNumberShort);
rs.updateString("vouchtTypeNumber", type + vch.getNumber());
rs.updateString("currency", GlUtils.getName(vch, "currency"));
rs.updateString("handler", GlUtils.getName(vch, "handler"));
rs.updateString("creator", GlUtils.getName(vch, "creator"));
rs.updateString("auditor", GlUtils.getName(vch, "auditor"));
rs.updateString("cashier", GlUtils.getName(vch, "cashier"));
rs.updateString("poster", GlUtils.getName(vch, "poster"));
rs.updateString("canceller", GlUtils.getName(vch, "canceller"));
}
protected static void fillVoucherEntryData(String vchId, VoucherEntryInfo e, IRowSet rs, int lcpre, int rcpre)
throws Exception
{
rs.updateString("vchId", vchId);
rs.updateString("e_seq", Integer.toString(e.getSeq()));
rs.updateString("e_description", e.getDescription());
if(rs.getString("r_description") == null)
rs.updateString("r_description", e.getDescription());
acctname = GlUtils.getNumberAndLongName(e, "account");
if(showAccountNumber && showAccountDetail)
acctname = GlUtils.getNumberAndLongName(e, "account");
else
if(!showAccountNumber && showAccountDetail)
acctname = GlUtils.getLongName(e, "account");
else
if(showAccountNumber && !showAccountDetail)
acctname = GlUtils.getNumberAndName(e, "account");
else
acctname = GlUtils.getName(e, "account");
String acctnameZC = GlUtils.getNumberAndLongName(e, "account");
String topAccountNumer = null;
AccountViewInfo account = (AccountViewInfo)e.get("account");
if(account != null && account.getLongNumber() != null && account.getLevel() != 1)
{
String longNumber = account.getLongNumber();
int idx = longNumber.indexOf("!");
topAccountNumer = longNumber.substring(0, idx);
}
if(acctnameZC != null)
{
if(acctnameZC.indexOf("_", 0) != -1 && acctnameZC.indexOf("_", 0) != -1)
{
if(showAccountNumber && topAccountNumer != null)
zc_acctname = topAccountNumer + " - " + acctnameZC.substring(acctnameZC.indexOf("-", 0) + 2, acctnameZC.indexOf("_", 0));
else
zc_acctname = acctnameZC.substring(acctnameZC.indexOf("-", 0) + 2, acctnameZC.indexOf("_", 0));
} else
if(showAccountNumber)
zc_acctname = acctnameZC;
else
zc_acctname = acctnameZC.substring(acctnameZC.indexOf("-", 0) + 2, acctnameZC.length());
} else
{
acctname = "";
zc_acctname = "";
}
rs.updateString("e_account", acctname);
if(acctname != null && (acctname.contains("N区域") || acctname.contains("K区域")))
rs.updateString("e_account", acctname.replaceAll("_N区域","").replaceAll("_K区域", ""));
else
rs.updateString("e_account", acctname);
rs.updateString("r_accountAsst", acctname);
rs.updateString("zc_account", zc_acctname);
if(e.getAccount() != null && e.getAccount().isIsQty())
{
if(e.getMeasureUnit() != null)
{
rs.updateString("e_measureUnitName", e.getMeasureUnit().getName());
rs.updateString("e_measureUnitNumber", e.getMeasureUnit().getNumber());
}
Object initData[] = getDefaultGLParam("defaultGLParam");
int pricePrecision = ((Integer)initData[7]).intValue();
rs.updateString("e_price", GlUtils.formatNumber(e.getPrice(), pricePrecision));
int quantityPrecision = ((Integer)initData[8]).intValue();
rs.updateString("e_quantity", GlUtils.formatNumber(e.getQuantity(), quantityPrecision));
}
if(e.getCustomer() != null)
{
rs.updateString("customer.number", e.getCustomer().getNumber());
rs.updateString("customer.name", e.getCustomer().getName());
rs.updateString("cusNumberName", e.getCustomer().getNumber() + "\uFF1A" + e.getCustomer().getName());
}
rs.updateString("e_currency", GlUtils.getName(e, "currency"));
if(e.getCurrency() != null)
{
rs.updateString("e_isoCode", e.getCurrency().getIsoCode());
rs.updateString("e_localExchangeRate", GlUtils.formatNumber(e.getLocalExchangeRate()));
rs.updateString("e_reportingExchangeRate", GlUtils.formatNumber(e.getReportingExchangeRate()));
}
rs.updateString("e_originalAmount", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
rs.updateString("r_originalAmount", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
EntryDC dc = e.getEntryDC();
if(EntryDC.DEBIT.equals(dc))
{
rs.updateString("e_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
rs.updateString("e_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
rs.updateString("e_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
rs.updateString("r_originalAmountDebit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
rs.updateString("r_localAmountDebit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
rs.updateString("r_reportingAmountDebit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
} else
{
rs.updateString("e_localAmountCredit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
rs.updateString("e_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
rs.updateString("e_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
rs.updateString("r_originalAmountCredit", GlUtils.formatNumber(e.getOriginalAmount(), lcpre));
rs.updateString("r_localAmountCredit", GlUtils.formatNumber(e.getLocalAmount(), lcpre));
rs.updateString("r_reportingAmountCredit", GlUtils.formatNumber(e.getReportingAmount(), lcpre));
}
}
protected static void fillVoucherASSTData(VoucherAssistRecordInfo r, IRowSet rs, DateFormat adf, int lcpre, EntryDC dc, IAssistantHG assistantHG, IVoucherAssistRecord asstre, VoucherEntryInfo e)
throws Exception
{
rs.updateString("r_description", r.getDescription());
if(rs.getString("r_description") == null)
rs.updateString("r_description", e.getDescription());
if(r.getMeasureUnit() != null)
{
rs.updateString("r_measureUnitName", r.getMeasureUnit().getName());
rs.updateString("r_measureUnitNumber", r.getMeasureUnit().getNumber());
rs.updateString("e_measureUnitName", r.getMeasureUnit().getName());
rs.updateString("e_measureUnitNumber", r.getMeasureUnit().getNumber());
}
if(r.getSettlementType() != null)
rs.updateString("r_settlementType", r.getSettlementType().getDisplayName());
if(e.getAccount() != null && e.getAccount().isAC())
rs.updateString("r_endDate", GlUtils.formatDate(adf, r.getEndDate()));
else
rs.updateString("r_endDate", "");
rs.updateString("r_settlementCode", r.getSettlementCode());
rs.updateString("r_bizNumber", r.getBizNumber());
rs.updateString("r_bizDate", GlUtils.formatDate(adf, r.getBizDate()));
rs.updateString("r_invoice", r.getInvoiceNumber());
if(EntryDC.DEBIT.equals(dc))
{
rs.updateString("e_originalAmountDebit", GlUtils.formatNumber(r.getOriginalAmount(), lcpre));
rs.updateString("e_localAmountDebit", GlUtils.formatNumber(r.getLocalAmount(), lcpre));
rs.updateString("e_reportingAmountDebit", GlUtils.formatNumber(r.getReportingAmount(), lcpre));
rs.updateString("r_originalAmountDebit", GlUtils.formatNumber(r.getOriginalAmount(), lcpre));
rs.updateString("r_localAmountDebit", GlUtils.formatNumber(r.getLocalAmount(), lcpre));
rs.updateString("r_reportingAmountDebit", GlUtils.formatNumber(r.getReportingAmount(), lcpre));
} else
{
rs.updateString("e_localAmountCredit", GlUtils.formatNumber(r.getLocalAmount(), lcpre));
rs.updateString("e_originalAmountCredit", GlUtils.formatNumber(r.getOriginalAmount(), lcpre));
rs.updateString("e_reportingAmountCredit", GlUtils.formatNumber(r.getReportingAmount(), lcpre));
rs.updateString("r_originalAmountCredit", GlUtils.formatNumber(r.getOriginalAmount(), lcpre));
rs.updateString("r_localAmountCredit", GlUtils.formatNumber(r.getLocalAmount(), lcpre));
rs.updateString("r_reportingAmountCredit", GlUtils.formatNumber(r.getReportingAmount(), lcpre));
}
rs.updateString("r_originalAmount", GlUtils.formatNumber(r.getOriginalAmount(), lcpre));
rs.updateString("r_reportingAmount", GlUtils.formatNumber(r.getReportingAmount(), lcpre));
rs.updateString("r_localAmount", GlUtils.formatNumber(r.getLocalAmount(), lcpre));
String assGrpId = null;
String name = null;
String fullName = null;
String levelName = null;
String assGrp = null;
String assGrpNumber = null;
String asstFull = null;
String asstFullNumber = null;
String asstheadnumber = null;
String asstnumber = null;
String asstheadname = null;
String asstname = null;
String asstlevelname = null;
String asstLevelNameNumber = null;
AssistantHGInfo assistantHGInfo = r.getAssGrp();
if(assistantHGInfo != null)
{
Object initData[] = getDefaultGLParam("defaultGLParam");
boolean isQty = ((Boolean)((Object[])initData[18])[17]).booleanValue();
if(e.getAccount().getCAA() != null && e.getAccount().isIsQty() && (e.getAccount().getCAA().isIsQty() || !isQty))
{
int pricePrecision = ((Integer)initData[7]).intValue();
int quantityPrecision = ((Integer)initData[8]).intValue();
rs.updateString("r_price", GlUtils.formatNumber(r.getPrice(), pricePrecision));
rs.updateString("r_quantity", GlUtils.formatNumber(r.getQuantity(), quantityPrecision));
rs.updateString("e_price", GlUtils.formatNumber(r.getPrice(), pricePrecision));
rs.updateString("e_quantity", GlUtils.formatNumber(r.getQuantity(), quantityPrecision));
}
IObjectValue value = null;
assGrpId = assistantHGInfo.getId().toString();
name = null;
fullName = null;
levelName = null;
if(showAsstDetail)
levelName = getAsstribute("r_AsstLevelNameNumber", assGrpId);
else
levelName = getAsstribute("r_AsstLevelName", assGrpId);
if(showAsstDetail && showAsstNumber)
{
fullName = getAsstribute("r_asstFullNumber", assGrpId);
name = fullName;
} else
if(showAsstDetail && !showAsstNumber)
{
fullName = getAsstribute("r_asstFull", assGrpId);
name = fullName;
} else
if(!showAsstDetail && !showAsstNumber)
{
fullName = getAsstribute("r_assGrp", assGrpId);
name = fullName;
} else
if(!showAsstDetail && showAsstNumber)
{
fullName = getAsstribute("r_assGrpNumber", assGrpId);
name = fullName;
}
assGrp = getAsstribute("assGrp", assGrpId);
assGrpNumber = getAsstribute("assGrpNumber", assGrpId);
asstFull = getAsstribute("asstFull", assGrpId);
asstFullNumber = getAsstribute("asstFullNumber", assGrpId);
asstheadnumber = getAsstribute("r_AsstHeadNumber", assGrpId);
asstnumber = getAsstribute("r_AsstNumber", assGrpId);
asstheadname = getAsstribute("r_AsstHeadName", assGrpId);
asstname = getAsstribute("r_AsstName", assGrpId);
asstlevelname = getAsstribute("r_AsstLevelName", assGrpId);
asstLevelNameNumber = getAsstribute("r_AsstLevelNameNumber", assGrpId);
if(name == null)
{
value = getAsstValue(r, assistantHG, asstre);
assGrp = value.getString("assGrp");
setAsstribute("r_assGrp", assGrpId, assGrp);
assGrpNumber = value.getString("assGrpNumber");
setAsstribute("r_assGrpNumber", assGrpId, assGrpNumber);
asstFull = value.getString("asstFull");
setAsstribute("r_asstFull", assGrpId, asstFull);
asstFullNumber = value.getString("asstFullNumber");
setAsstribute("r_asstFullNumber", assGrpId, asstFullNumber);
asstheadnumber = value.getString("asstheadnumber");
setAsstribute("r_AsstHeadNumber", assGrpId, asstheadnumber);
asstnumber = value.getString("asstnumber");
setAsstribute("r_AsstNumber", assGrpId, asstnumber);
asstheadname = value.getString("asstheadname");
setAsstribute("r_AsstHeadName", assGrpId, asstheadname);
asstname = value.getString("asstname");
setAsstribute("r_AsstName", assGrpId, asstname);
asstlevelname = value.getString("asstlevelname");
setAsstribute("r_AsstLevelName", assGrpId, asstlevelname);
asstLevelNameNumber = value.getString("asstLevelNameNumber");
setAsstribute("r_AsstLevelNameNumber", assGrpId, asstLevelNameNumber);
if(showAsstDetail)
levelName = asstLevelNameNumber;
else
levelName = asstlevelname;
if(showAsstDetail && showAsstNumber)
{
fullName = asstFullNumber;
name = fullName;
} else
if(showAsstDetail && !showAsstNumber)
{
fullName = asstFull;
name = fullName;
} else
if(!showAsstDetail && !showAsstNumber)
{
fullName = assGrp;
name = fullName;
} else
if(!showAsstDetail && showAsstNumber)
{
fullName = assGrpNumber;
name = fullName;
}
}
if(showAccountNumber && showAccountDetail)
acctname = GlUtils.getNumberAndLongName(e, "account");
else
if(!showAccountNumber && showAccountDetail)
acctname = GlUtils.getLongName(e, "account");
else
if(showAccountNumber && !showAccountDetail)
acctname = GlUtils.getNumberAndName(e, "account");
else
acctname = GlUtils.getName(e, "account");
String acctnameZC = GlUtils.getNumberAndLongName(e, "account");
if(acctnameZC.indexOf("_", 0) != -1)
zc_listacctname = acctnameZC.substring(acctnameZC.indexOf("_", 0) + 1, acctnameZC.length());
else
zc_listacctname = acctnameZC.substring(acctnameZC.indexOf("-", 0) + 1, acctnameZC.length());
}
String accountNumber = GlUtils.getNumber(e, "account");
if(fullName == null || "null".equals(fullName))
{
fullName = "";
name = fullName;
} else
{
fullName = "(" + fullName + ")";
}
if(!bselectedList)
{
rs.updateString("r_assGrp", getStr(name));
rs.updateString("r_longName", getStr(fullName));
rs.updateString("r_AsstHeadNumber", asstheadnumber);
rs.updateString("r_AsstNumber", asstnumber);
rs.updateString("r_AsstHeadName", asstheadname);
rs.updateString("r_AsstName", asstname);
rs.updateString("r_AsstLevelName", levelName);
rs.updateString("r_accountAsst", acctname + "" + getStr(fullName) + "");
rs.updateString("zc_assGrp", zc_listacctname + "" + getStr(fullName) + "");
} else
if(bselectedList && !balanceAccountIsInExistence(accountNumber))
{
rs.updateString("r_assGrp", getStr(name));
rs.updateString("r_longName", getStr(fullName));
rs.updateString("r_AsstHeadNumber", asstheadnumber);
rs.updateString("r_AsstNumber", asstnumber);
rs.updateString("r_AsstHeadName", asstheadname);
rs.updateString("r_AsstName", asstname);
rs.updateString("r_AsstLevelName", levelName);
rs.updateString("r_accountAsst", acctname + "" + getStr(fullName) + "");
rs.updateString("zc_assGrp", zc_listacctname + "" + getStr(fullName) + "");
} else
{
rs.updateString("r_assGrp", "");
rs.updateString("r_longName", "");
rs.updateString("r_AsstHeadNumber", "");
rs.updateString("r_AsstNumber", "");
rs.updateString("r_AsstHeadName", "");
rs.updateString("r_AsstName", "");
rs.updateString("r_AsstLevelName", "");
rs.updateString("r_accountAsst", "");
rs.updateString("zc_assGrp", "");
rs.updateString("r_description", e.getDescription());
}
}
protected static void printCashflow(DynamicRowSet drs, VoucherEntryInfo e, VoucherAssistRecordInfo r, int lcpre)
throws Exception
{
StringBuffer sbOriginalAmount = new StringBuffer();
StringBuffer sblocalAmount = new StringBuffer();
StringBuffer sbreportingAmount = new StringBuffer();
StringBuffer sbprimItem = new StringBuffer();
StringBuffer sbitem = new StringBuffer();
StringBuffer sbitemEbb = new StringBuffer();
StringBuffer sbsuppItem = new StringBuffer();
StringBuffer sbsupp = new StringBuffer();
StringBuffer sbsuppEbb = new StringBuffer();
StringBuffer sbfullInfoItem = new StringBuffer();
StringBuffer sbfullInfo = new StringBuffer();
StringBuffer sbfullInfoEbb = new StringBuffer();
BigDecimal bdPrimary = null;
BigDecimal bdSupp = null;
CashflowRecordCollection cashflowRecordsCollection = null;
int seq = e.getSeq();
if(printCashflowMeOrOther)
cashflowRecordsCollection = e.getCashflowEntry();
else
cashflowRecordsCollection = e.getCashflowRecords();
if(cashflowRecordsCollection != null && cashflowRecordsCollection.size() > 0)
{
Iterator itrCfr = cashflowRecordsCollection.iterator();
do
{
if(!itrCfr.hasNext())
break;
CashflowRecordInfo cfrInfo = (CashflowRecordInfo)itrCfr.next();
if(cfrInfo.getItemFlag() != null && cfrInfo.getItemFlag().getValue() != 5 && (printCashflowMeOrOther ? seq == cfrInfo.getEntry().getSeq() : seq == cfrInfo.getOpposingAccountEntry().getSeq() && (r == null || cfrInfo.getItemFlag().getValue() != 1 && cfrInfo.getItemFlag().getValue() != 2 && cfrInfo.getItemFlag().getValue() != 3 || cfrInfo.getOppVoucherAssistRecord() == null || r.getSeq() == cfrInfo.getOppVoucherAssistRecord().getSeq())))
{
bdPrimary = new BigDecimal(String.valueOf(cfrInfo.getPrimaryCoefficient()));
bdSupp = new BigDecimal(String.valueOf(cfrInfo.getSupplementaryCoefficient()));
sbOriginalAmount.append(GlUtils.formatNumber(cfrInfo.getOriginalAmount(), lcpre) + ";");
sblocalAmount.append(GlUtils.formatNumber(cfrInfo.getLocalAmount(), lcpre) + ";");
sbreportingAmount.append(GlUtils.formatNumber(cfrInfo.getReportingAmount(), lcpre) + ";");
drs.updateString("c_originalAmount", sbOriginalAmount.toString());
drs.updateString("c_localAmount", sblocalAmount.toString());
drs.updateString("c_reportingAmount", sbreportingAmount.toString());
CashFlowItemInfo cfinfo_primItem = cfrInfo.getPrimaryItem();
if(cfinfo_primItem != null)
{
String str_primItem_number = cfinfo_primItem.getNumber();
String str_primItem_name = cfinfo_primItem.getName();
sbprimItem.append(str_primItem_number + str_primItem_name + ";");
sbitem.append(cfinfo_primItem + GlUtils.formatNumber(cfrInfo.getLocalAmount().multiply(bdPrimary), lcpre) + ";");
sbitemEbb.append("(" + str_primItem_name + ")" + GlUtils.formatNumber(cfrInfo.getLocalAmount().multiply(bdPrimary), lcpre) + ";");
drs.updateString("c_primItem", sbprimItem.toString());
drs.updateString("c_item", sbitem.toString());
drs.updateString("c_itemEbb", sbitemEbb.toString());
drs.updateString("c_primItemName", str_primItem_name + ";");
}
CashFlowItemInfo cfinfo_suppItem = cfrInfo.getSupplementaryItem();
if(cfinfo_suppItem != null)
{
String str_suppItem_number = cfinfo_suppItem.getNumber();
String str_suppItem_name = cfinfo_suppItem.getName();
sbsuppItem.append(str_suppItem_number + str_suppItem_name + ";");
sbsupp.append(cfinfo_suppItem + GlUtils.formatNumber(cfrInfo.getLocalAmount().multiply(bdSupp), lcpre) + ";");
sbsuppEbb.append("(" + str_suppItem_name + ")" + GlUtils.formatNumber(cfrInfo.getLocalAmount().multiply(bdSupp), lcpre) + ";");
drs.updateString("c_suppItem", sbsuppItem.toString());
drs.updateString("c_supp", sbsupp.toString());
drs.updateString("c_suppEbb", sbsuppEbb.toString());
drs.updateString("c_suppItemName", str_suppItem_name + ";");
}
CashFlowItemInfo cfInfo_fullInfoItem = cfrInfo.getFullInfoItem();
if(cfInfo_fullInfoItem != null)
{
String str_fullInfoItem_number = cfInfo_fullInfoItem.getNumber();
String str_fullInfoItem_name = cfInfo_fullInfoItem.getName();
sbfullInfoItem.append(str_fullInfoItem_number + str_fullInfoItem_name + ";");
sbfullInfo.append(str_fullInfoItem_number + str_fullInfoItem_name + GlUtils.formatNumber(cfrInfo.getLocalAmount(), lcpre) + ";");
sbfullInfoEbb.append("(" + str_fullInfoItem_name + ")" + GlUtils.formatNumber(cfrInfo.getLocalAmount(), lcpre) + ";");
drs.updateString("c_fullInfoItem", sbfullInfoItem.toString());
drs.updateString("c_fullInfo", sbfullInfo.toString());
drs.updateString("c_fullInfoEbb", sbfullInfoEbb.toString());
}
}
} while(true);
}
}
protected boolean computerVoucherType(VoucherInfo vch)
{
boolean pnlAccExist = false;
int count = vch.getEntryCount();
for(int i = 0; i < count; i++)
{
AccountViewInfo acc = vch.getEntries().get(i).getAccount();
if(AccountProperty.SUNYI.equals(acc.getAccountTypeID().getProperty()))
pnlAccExist = true;
}
return pnlAccExist;
}
protected VoucherInfo changeVoucher(VoucherInfo vch)
{
VoucherInfo info = new VoucherInfo();
info.setId(vch.getId());
info.setNumber(vch.getNumber());
info.setAttachments(vch.getAttachments());
info.setBizOU(vch.getBizOU());
info.setPeriod(vch.getPeriod());
info.setBizDate(vch.getBizDate());
info.setBookedDate(vch.getBookedDate());
info.setCompany(vch.getCompany());
info.setCreateTime(vch.getCreateTime());
info.setCreator(vch.getCreator());
info.setCU(vch.getCU());
info.setCurrency(vch.getCurrency());
info.setDescription(vch.getDescription());
info.setDisplayFormat(vch.getDisplayFormat());
info.setLocalCreditAmount(vch.getLocalCreditAmount());
info.setLocalDebitAmount(vch.getLocalDebitAmount());
info.setReportingCreditAmount(vch.getReportingCreditAmount());
info.setReportingDebitAmount(vch.getReportingDebitAmount());
info.setHandler(vch.getHandler());
info.setAuditor(vch.getAuditor());
info.setCashier(vch.getCashier());
info.setCanceller(vch.getCanceller());
info.setPoster(vch.getPoster());
info.setHasCashAccount(vch.isHasCashAccount());
info.setHasEffected(vch.isHasEffected());
info.setLastUpdateTime(vch.getLastUpdateTime());
info.setLastUpdateUser(vch.getLastUpdateUser());
info.setVoucherType(vch.getVoucherType());
info.setVoucherTypeDetail(vch.getVoucherTypeDetail());
int infoCount = 0;
Map acctMap = new HashMap();
int count = vch.getEntryCount();
VoucherEntryCollection vchEntryCol = vch.getEntries();
VoucherEntryCollection infoEntryCol = info.getEntries();
for(int i = 0; i < count; i++)
{
VoucherEntryInfo vchEntryInfo = vchEntryCol.get(i);
VoucherEntryInfo entry = new VoucherEntryInfo();
entry.setAccount(vchEntryInfo.getAccount());
entry.setBill(info);
entry.setId(vchEntryInfo.getId());
entry.setCurrency(vchEntryInfo.getCurrency());
entry.setDescription(vchEntryInfo.getDescription());
entry.setDisplayFormat(vchEntryInfo.getDisplayFormat());
entry.setEntryDC(vchEntryInfo.getEntryDC());
entry.setMeasureUnit(vchEntryInfo.getMeasureUnit());
entry.setOriginalAmount(vchEntryInfo.getOriginalAmount());
entry.setLocalAmount(vchEntryInfo.getLocalAmount());
entry.setReportingAmount(vchEntryInfo.getReportingAmount());
entry.setLocalExchangeRate(vchEntryInfo.getLocalExchangeRate());
entry.setReportingExchangeRate(vchEntryInfo.getReportingExchangeRate());
entry.setPrice(vchEntryInfo.getPrice());
entry.setQuantity(vchEntryInfo.getQuantity());
entry.setStandardQuantity(vchEntryInfo.getStandardQuantity());
AccountViewInfo acc = entry.getAccount();
if(AccountProperty.SUNYI.equals(acc.getAccountTypeID().getProperty()))
{
AccountViewInfo accInfo = null;
try
{
IAccountView accountView = AccountViewFactory.getRemoteInstance();
BOSUuid accID = acc.getId();
ObjectUuidPK objectUUidPK = new ObjectUuidPK(accID);
accInfo = accountView.getAccountViewInfo(objectUUidPK);
}
catch(BOSException e)
{
e.printStackTrace();
}
catch(EASBizException e)
{
e.printStackTrace();
}
String flongnumber = accInfo.getLongNumber();
String flongname = accInfo.getLongName();
String fnumber = flongnumber;
String fname = flongname;
int index = flongnumber.indexOf("!");
if(index != -1)
{
fnumber = flongnumber.substring(0, flongnumber.indexOf("!"));
fname = flongname.substring(0, flongname.indexOf("_"));
}
acc.setName(fname);
acc.setNumber(fnumber);
acc.setLongName(fname);
acc.setLongNumber(fnumber);
if(acctMap.containsKey(fnumber))
{
VoucherEntryInfo entryInfo = (VoucherEntryInfo)acctMap.get(fnumber);
entryInfo.setOriginalAmount(entryInfo.getOriginalAmount().add(entry.getOriginalAmount()));
entryInfo.setLocalAmount(entryInfo.getLocalAmount().add(entry.getLocalAmount()));
entryInfo.setReportingAmount(entryInfo.getReportingAmount().add(entry.getReportingAmount()));
entryInfo.setQuantity(entryInfo.getQuantity().add(entry.getQuantity()));
entryInfo.setStandardQuantity(entryInfo.getStandardQuantity().add(entry.getStandardQuantity()));
} else
{
infoCount++;
entry.setSeq(infoCount);
acctMap.put(fnumber, entry);
}
} else
{
infoCount++;
entry.setSeq(infoCount);
infoEntryCol.add(entry);
}
}
info.setEntryCount(infoCount);
Set set = acctMap.keySet();
VoucherEntryInfo entryInfo;
for(Iterator iter = set.iterator(); iter.hasNext(); infoEntryCol.add(entryInfo))
{
String fnumber = (String)iter.next();
entryInfo = (VoucherEntryInfo)acctMap.get(fnumber);
}
return info;
}
protected static IObjectValue getAsstValue(VoucherAssistRecordInfo tmpAssistRecordInfo, IAssistantHG assistantHG, IVoucherAssistRecord asstre)
throws EASBizException, BOSException
{
BOSUuid assGrpId = tmpAssistRecordInfo.getAssGrp().getId();
if(assistantHG == null)
assistantHG = AssistantHGFactory.getRemoteInstance();
ObjectUuidPK objectUUidPK = new ObjectUuidPK(assGrpId);
AssistantHGInfo info = assistantHG.getAssistantHGInfo(objectUUidPK);
if(asstre == null)
asstre = VoucherAssistRecordFactory.getRemoteInstance();
IObjectValue value = asstre.getDefaultAssitInfo(info.getAsstAccount().getId().toString(), assGrpId.toString());
return value;
}
protected static String getBlankString(int size, String str)
{
StringBuffer name = new StringBuffer("");
for(int i = 0; i < size; i++)
name.append(" ");
name.append(str);
return name.toString();
}
protected static Object[] getDefaultGLParam(String defaultGLParam)
throws BOSException, EASBizException
{
Object objPrecision[] = null;
if(mapPrecision.containsKey(SysContext.getSysContext().getCurrentFIUnit().getId().toString() + "_" + defaultGLParam))
{
objPrecision = (Object[])mapPrecision.get(SysContext.getSysContext().getCurrentFIUnit().getId().toString() + "_" + defaultGLParam);
} else
{
objPrecision = GlUtils.getDefaultGLParam();
mapPrecision.put(SysContext.getSysContext().getCurrentFIUnit().getId().toString() + "_" + defaultGLParam, ((Object) (objPrecision)));
}
return objPrecision;
}
public static String getAsstribute(String asstribute, String id)
{
Map map = null;
String name = null;
if(asstributeMap == null)
asstributeMap = new HashMap();
if(asstributeMap.containsKey(asstribute))
{
map = (Map)asstributeMap.get(asstribute);
} else
{
map = new HashMap();
asstributeMap.put(asstribute, map);
}
if(map.containsKey(id))
{
name = (String)map.get(id);
map.put(id, name);
}
return name;
}
public static void setAsstribute(String asstribute, String id, String value)
{
Map map = null;
if(asstributeMap == null)
asstributeMap = new HashMap();
if(asstributeMap.containsKey(asstribute))
{
map = (Map)asstributeMap.get(asstribute);
} else
{
map = new HashMap();
asstributeMap.put(asstribute, map);
}
if(!map.containsKey(id))
map.put(id, value);
}
public String getString(String key)
{
return EASResource.getString("com.kingdee.eas.fi.gl.client.VoucherEditResource", key);
}
protected static void clearRow(IRowSet rs)
throws Exception
{
int colCount = rs.getRowSetMetaData().getColumnCount();
for(int i = 1; i <= colCount; i++)
rs.updateString(i, null);
}
protected static boolean balanceAccountIsInExistence(String strAccountNumber)
throws Exception
{
boolean isInExistence = false;
if(selectedList.length() != 0)
{
Object objToSelect[] = selectedList.split("\\,");
Object objSelectNumber[] = new Object[objToSelect.length];
int i = 0;
for(int n = objToSelect.length; i < n; i++)
{
Object objTemp[] = objToSelect[i].toString().split("\\ ");
objSelectNumber[i] = objTemp[0];
}
int j = 0;
for(int m = objSelectNumber.length; j < m; j++)
if(strAccountNumber.equalsIgnoreCase(objSelectNumber[j].toString()))
isInExistence = true;
return isInExistence;
} else
{
return isInExistence;
}
}
protected static String[] getAsstActList()
{
if(basstActSeleectedList)
{
String asstActList[] = StringUtils.split(asstActSeleectedList, ",");
return asstActList;
} else
{
return null;
}
}
protected static String getStr(String name)
{
String string = "";
String names[] = null;
if(name != null)
{
names = StringUtils.split(name, ";");
String asstActList[] = getAsstActList();
if(asstActList != null)
{
for(int i = 0; i < names.length; i++)
{
String s = names[i];
String temp[] = s.split(":");
for(int j = 0; j < asstActList.length; j++)
{
String asst = asstActList[j];
if(temp[0].toString().indexOf(asst.split("-")[1].toString()) != -1)
names[i] = "";
}
}
}
}
if(names != null)
{
for(int i = 0; i < names.length; i++)
{
string = string + names[i];
if(!")".equals(names[i]) && !"".equals(names[i]))
string = string + ";";
}
}
if(string.indexOf("(") != -1 && string.indexOf(")") != -1)
return string;
if(string.indexOf(")") != -1 && string.indexOf(")") != 0 && string.indexOf("(") == -1)
string = "(" + string;
else
if(string.indexOf(")") == 0)
string = "";
return string;
}
public void setVchType(String vchType)
{
this.vchType = vchType;
}
public String getAcctname()
{
return acctname;
}
public static void setShowAsstDetail(boolean v)
{
showAsstDetail = v;
}
public static void setShowAsstNumber(boolean v)
{
showAsstNumber = v;
}
public static void setChkPrintCashFlow(boolean v)
{
chkPrintCashFlow = v;
}
public static void setChkAssistant(boolean v)
{
chkAssistant = v;
}
public static void setPrintCashflowMeOrOther(boolean v)
{
printCashflowMeOrOther = v;
}
public static void setIsListOrEdit(boolean v)
{
isListOrEdit = v;
}
public static void setShowAccountNumber(boolean v)
{
showAccountNumber = v;
}
public static void setShowAccountDetail(boolean v)
{
showAccountDetail = v;
}
public static void setBselectedList(boolean v)
{
bselectedList = v;
}
public static void setSelectedList(String v)
{
selectedList = v;
}
public static void setBasstActSeleectedList(boolean v)
{
basstActSeleectedList = v;
}
public static void setAasstActSeleectedList(String v)
{
asstActSeleectedList = v;
}
public static void clearCache()
{
asstributeMap = null;
}
public static final String col[] = {
"pageCount", "pageCurrent", "pageTotal", "company", "companyBaseCurreny", "companyReportCurreny", "description", "attachments", "attachmentsChinese", "sum",
"periodYear", "periodNumber", "bizDate", "voucherDate", "bookedDate", "bookedDateYear", "bookedDateMonth", "bookedDateDay", "sysDateNow", "vchId",
"bizStatus", "voucherType", "number", "numberShort", "vouchtTypeNumber", "currency", "amountTotalChinese", "amountTotal", "creditTotal", "debitTotal",
"localAmountDebit", "localAmountCredit", "reportingAmountDebit", "reportingAmountCredit", "handler", "creator", "auditor", "cashier", "poster", "canceller",
"e_seq", "e_description", "e_account", "e_account1", "zc_account", "e_currency", "e_isoCode", "e_measureUnitName", "e_measureUnitNumber", "e_price", "e_quantity",
"e_originalAmount", "e_originalAmountDebit", "e_originalAmountCredit", "e_localExchangeRate", "e_localAmountDebit", "e_localAmountCredit", "e_reportingExchangeRate", "e_reportingAmountDebit", "e_reportingAmountCredit", "r_description",
"r_settlementType", "r_settlementCode", "r_bizNumber", "r_originalAmount", "r_originalAmountDebit", "r_originalAmountCredit", "r_localAmount", "r_localAmountDebit", "r_localAmountCredit", "r_reportingAmount",
"r_reportingAmountDebit", "r_reportingAmountCredit", "r_measureUnitName", "r_measureUnitNumber", "r_price", "r_quantity", "r_bizDate", "r_invoice", "r_endDate", "r_customer",
"r_supplier", "r_orgUnit", "r_matirial", "r_assGrp", "r_longName", "r_AsstHeadNumber", "r_AsstNumber", "r_AsstHeadName", "r_AsstName", "r_AsstLevelName",
"r_accountAsst", "zc_assGrp", "c_item", "c_itemEbb", "c_primItem", "c_supp", "c_suppEbb", "c_suppItem", "c_fullInfo", "c_fullInfoEbb",
"c_fullInfoItem", "c_oppAccount", "c_originalAmount", "c_localAmount", "c_reportingAmount", "c_primItemName", "c_suppItemName", "customer.number", "customer.name", "cusNumberName"
};
protected String vchType;
protected VoucherEditParam editParam;
protected VoucherCollection vchCol;
protected static boolean chkPrintCashFlow = false;
protected static boolean chkAssistant = true;
protected static boolean showAsstDetail = true;
protected static boolean showAsstNumber = true;
protected static boolean printCashflowMeOrOther = true;
protected static boolean isListOrEdit = true;
protected static boolean showAccountNumber = true;
protected static boolean showAccountDetail = true;
protected static String selectedList = null;
protected static boolean bselectedList = false;
protected static String asstActSeleectedList = null;
protected static boolean basstActSeleectedList = false;
protected boolean needCpmputeAsst;
protected static String acctname = null;
protected static String zc_acctname = null;
protected static String zc_listacctname = null;
protected static Map asstributeMap = null;
protected static final Map mapPrecision = new HashMap();
}
/*
DECOMPILATION REPORT
Decompiled from: W:\EAS705\lib\client\eas\fi_gl-client.jar
Total time: 249 ms
Jad reported messages/errors:
Exit status: 0
Caught exceptions:
*/
凭证套打类,注意如何更新IRowSet结果集。
最新推荐文章于 2022-04-24 19:45:48 发布