@ -622,6 +622,9 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
Decimal strDai = 0 ;
if ( dsVWChFeeAR ! = null )
{
int n = 1 ;
@ -630,6 +633,9 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
{
if ( dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "GID" ] . ToString ( ) . Trim ( ) = = invgid ) {
var sqlARFCEXCHANGE = "select distinct ORIGCURRENCY,EXCHANGERATE from ch_fee_do WHERE BILLNO='" + dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "BILLNO" ] . ToString ( ) . Trim ( ) + "'" ;
DataSet dsVWChFeeARExChange = T_ALL_DA . GetAllSQL ( sqlARFCEXCHANGE ) ;
#region 摘要内容
strEXPLAN = "" ;
strEXPLAN = DREXPLAN ;
@ -639,6 +645,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
{
strEXPLAN = strEXPLAN . Replace ( "[发票抬头]" , dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "INVOICECUSTNAME" ] . ToString ( ) . Trim ( ) ) ;
strEXPLAN = strEXPLAN . Replace ( "[发票号]" , dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "INVOICENO" ] . ToString ( ) . Trim ( ) ) ;
strEXPLAN = strEXPLAN . Replace ( "[客户名称]" , dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "CUSTOMERNAME" ] . ToString ( ) . Trim ( ) ) ;
}
else
{
@ -657,7 +664,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
MsCwVouitemsGl . GRADE = 0 ; //科目级别
#region 应收账款
if ( dsVWChFeeAR. Tables [ 0 ] . Rows [ i ] [ "OTCURRAMOUNT" ] . ToString ( ) . Trim ( ) = = "0" )
if ( Decimal. Parse ( dsVWChFeeAR. Tables [ 0 ] . Rows [ i ] [ "OTCURRAMOUNT" ] . ToString ( ) . Trim ( ) ) = = 0 )
{
iAMTDR = iAMTDR + Decimal . Parse ( dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "INVAMOUNT" ] . ToString ( ) . Trim ( ) ) ;
/ /
@ -682,6 +689,8 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
{
MsCwVouitemsGl . DC = "C" ; //贷方向
}
MsCwVouitemsGl . FCYEXRATE = 1 ; //汇率
}
else
{
@ -709,6 +718,22 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
MsCwVouitemsGl . DC = "C" ; //贷方向
}
if ( dsVWChFeeARExChange ! = null )
{
for ( int j = 0 ; j < dsVWChFeeARExChange . Tables [ 0 ] . Rows . Count ; j + + )
{
if ( dsVWChFeeARExChange . Tables [ 0 ] . Rows [ j ] [ "ORIGCURRENCY" ] . ToString ( ) . Trim ( ) = = dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "RECVCURR" ] . ToString ( ) )
{
MsCwVouitemsGl . FCYEXRATE = Decimal . Parse ( dsVWChFeeARExChange . Tables [ 0 ] . Rows [ j ] [ "EXCHANGERATE" ] . ToString ( ) . Trim ( ) ) ; //汇率
}
}
}
}
strJie = strJie + MsCwVouitemsGl . AMTCR ;
/ /
@ -724,7 +749,6 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
}
MsCwVouitemsGl . EXPLAN = strEXPLAN ; //摘要
MsCwVouitemsGl . FCYEXRATE = 1 ; //汇率
dEXCHANGERATE = 1 ; //汇率
MsCwVouitemsGl . BLNO = "" ;
//string strBLNONAME = dsCwDesign.Tables[0].Rows[0]["PiaoHao"].ToString().Trim();
@ -740,7 +764,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
{
MsCwVouitemsGl . ISSYS = true ; //是否手动录入
}
if ( dsVWChFeeAR. Tables [ 0 ] . Rows [ i ] [ "OTCURRAMOUNT" ] . ToString ( ) . Trim ( ) = = "0" )
if ( Decimal. Parse ( dsVWChFeeAR. Tables [ 0 ] . Rows [ i ] [ "OTCURRAMOUNT" ] . ToString ( ) . Trim ( ) ) = = 0 )
{
MsCwVouitemsGl . ACCALL = BasicDataRefDAL . setCAGA ( dsAR . Tables [ 0 ] . Rows [ 0 ] [ "PACCGID" ] . ToString ( ) , MsCwVouitemsGl . ACCNAME . ToString ( ) . Trim ( ) ) + strACCALL ;
@ -788,6 +812,8 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
{
strEXPLAN = strEXPLAN . Replace ( "[发票抬头]" , dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "INVOICECUSTNAME" ] . ToString ( ) . Trim ( ) ) ;
strEXPLAN = strEXPLAN . Replace ( "[发票号]" , dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "INVOICENO" ] . ToString ( ) . Trim ( ) ) ;
strEXPLAN = strEXPLAN . Replace ( "[客户名称]" , dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "CUSTOMERNAME" ] . ToString ( ) . Trim ( ) ) ;
}
else
{
@ -806,39 +832,103 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
MsCwVouitemsGl . PACCID = "" ; //父级科目贷码
MsCwVouitemsGl . PROPERTY = 0 ; //科目属性
MsCwVouitemsGl . GRADE = 0 ; //科目级别
MsCwVouitemsGl . ACCID = dsCwDesign . Tables [ 0 ] . Rows [ 0 ] [ "MBINCOME" ] . ToString ( ) . Trim ( ) ; //主营业务收入科目贷码
MsCwVouitemsGl . AMTDR = 0 ; //本位币借方金额(互斥)
MsCwVouitemsGl . AMTCR = Decimal . Parse ( dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "INVAMOUNT" ] . ToString ( ) . Trim ( ) ) ; //本位币贷方金额(互斥)
strDai = strDai + MsCwVouitemsGl . AMTCR ;
MsCwVouitemsGl . ISFCY = false ; //是否外币
MsCwVouitemsGl . FCYNO = "RMB" ; //外币
MsCwVouitemsGl . FCYDR = 0 ; //外币借方金额
MsCwVouitemsGl . FCYCR = 0 ; //外币贷方金额
MsCwVouitemsGl . ACCNAME = dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ACCNAME" ] . ToString ( ) . Trim ( ) ; //科目名称
MsCwVouitemsGl . ISDEPTACC = Boolean . Parse ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ISDEPTACC" ] . ToString ( ) . Trim ( ) ) ; //核算部门,按规则设置生成
MsCwVouitemsGl . ISEMPLACC = Boolean . Parse ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ISEMPLACC" ] . ToString ( ) . Trim ( ) ) ; //核算人员,按规则设置生成
MsCwVouitemsGl . ISCORPACC = Boolean . Parse ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ISCORPACC" ] . ToString ( ) . Trim ( ) ) ; //核算客户,按规则设置生成
MsCwVouitemsGl . ISITEMACC = Boolean . Parse ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ISITEMACC" ] . ToString ( ) . Trim ( ) ) ; //核算项目,按规则设置生成
if ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "DC" ] . ToString ( ) . Trim ( ) = = "借" )
if ( Decimal . Parse ( dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "OTCURRAMOUNT" ] . ToString ( ) . Trim ( ) ) = = 0 )
{
MsCwVouitemsGl . DC = "D" ; //借方向
MsCwVouitemsGl . ACCID = dsCwDesign . Tables [ 0 ] . Rows [ 0 ] [ "MBINCOME" ] . ToString ( ) . Trim ( ) ; //主营业务收入科目贷码
MsCwVouitemsGl . AMTDR = 0 ; //本位币借方金额(互斥)
MsCwVouitemsGl . AMTCR = Decimal . Parse ( dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "INVAMOUNT" ] . ToString ( ) . Trim ( ) ) ; //本位币贷方金额(互斥)
strDai = strDai + MsCwVouitemsGl . AMTCR ;
MsCwVouitemsGl . ISFCY = false ; //是否外币
MsCwVouitemsGl . FCYNO = "RMB" ; //外币
MsCwVouitemsGl . FCYDR = 0 ; //外币借方金额
MsCwVouitemsGl . FCYCR = 0 ; //外币贷方金额
MsCwVouitemsGl . ACCNAME = dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ACCNAME" ] . ToString ( ) . Trim ( ) ; //科目名称
MsCwVouitemsGl . FCYEXRATE = 1 ; //汇率
MsCwVouitemsGl . ISDEPTACC = Boolean . Parse ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ISDEPTACC" ] . ToString ( ) . Trim ( ) ) ; //核算部门,按规则设置生成
MsCwVouitemsGl . ISEMPLACC = Boolean . Parse ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ISEMPLACC" ] . ToString ( ) . Trim ( ) ) ; //核算人员,按规则设置生成
MsCwVouitemsGl . ISCORPACC = Boolean . Parse ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ISCORPACC" ] . ToString ( ) . Trim ( ) ) ; //核算客户,按规则设置生成
MsCwVouitemsGl . ISITEMACC = Boolean . Parse ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ISITEMACC" ] . ToString ( ) . Trim ( ) ) ; //核算项目,按规则设置生成
if ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "DC" ] . ToString ( ) . Trim ( ) = = "借" )
{
MsCwVouitemsGl . DC = "D" ; //借方向
}
else
{
MsCwVouitemsGl . DC = "C" ; //贷方向
}
/ /
strACCALL = "" ;
MsCwVouitemsGl . CORPID = "" ; // strEMPLID;//人员(系统)本来应该放客户
MsCwVouitemsGl . CUSTOMERNAME = "" ; // strSALE;//人员(系统)本来应该放客户
if ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ISCORPACC" ] . ToString ( ) . Trim ( ) = = "True" )
{
MsCwVouitemsGl . CORPID = "" ; //客户(系统)
MsCwVouitemsGl . CUSTOMERNAME = dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "CUSTOMERNAME" ] . ToString ( ) . Trim ( ) ; //客户(系统)
strACCALL + = "▁" + MsCwVouitemsGl . CUSTOMERNAME ;
}
}
else
else {
MsCwVouitemsGl . ACCID = dsCwDesign . Tables [ 0 ] . Rows [ 0 ] [ "TMFCI" ] . ToString ( ) . Trim ( ) ; //主营业务收入科目贷码
MsCwVouitemsGl . AMTDR = 0 ; //本位币借方金额(互斥)
MsCwVouitemsGl . AMTCR = Decimal . Parse ( dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "INVAMOUNT" ] . ToString ( ) . Trim ( ) ) ; //本位币贷方金额(互斥)
strDai = strDai + MsCwVouitemsGl . AMTCR ;
MsCwVouitemsGl . ISFCY = true ; //是否外币
MsCwVouitemsGl . FCYNO = dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "RECVCURR" ] . ToString ( ) ; //外币编号usd
MsCwVouitemsGl . FCYCR = Decimal . Parse ( dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "OTCURRAMOUNT" ] . ToString ( ) . Trim ( ) ) ; //外币借方金额
MsCwVouitemsGl . FCYDR = 0 ; //外币贷方金额
MsCwVouitemsGl . ACCNAME = dsTMFCI . Tables [ 0 ] . Rows [ 0 ] [ "ACCNAME" ] . ToString ( ) . Trim ( ) ; //科目名称
if ( dsVWChFeeARExChange ! = null )
{
for ( int j = 0 ; j < dsVWChFeeARExChange . Tables [ 0 ] . Rows . Count ; j + + )
{
if ( dsVWChFeeARExChange . Tables [ 0 ] . Rows [ j ] [ "ORIGCURRENCY" ] . ToString ( ) . Trim ( ) = = dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "RECVCURR" ] . ToString ( ) )
{
MsCwVouitemsGl . FCYEXRATE = Decimal . Parse ( dsVWChFeeARExChange . Tables [ 0 ] . Rows [ j ] [ "EXCHANGERATE" ] . ToString ( ) . Trim ( ) ) ; //汇率
}
}
}
MsCwVouitemsGl . ISDEPTACC = Boolean . Parse ( dsTMFCI . Tables [ 0 ] . Rows [ 0 ] [ "ISDEPTACC" ] . ToString ( ) . Trim ( ) ) ; //核算部门,按规则设置生成
MsCwVouitemsGl . ISEMPLACC = Boolean . Parse ( dsTMFCI . Tables [ 0 ] . Rows [ 0 ] [ "ISEMPLACC" ] . ToString ( ) . Trim ( ) ) ; //核算人员,按规则设置生成
MsCwVouitemsGl . ISCORPACC = Boolean . Parse ( dsTMFCI . Tables [ 0 ] . Rows [ 0 ] [ "ISCORPACC" ] . ToString ( ) . Trim ( ) ) ; //核算客户,按规则设置生成
MsCwVouitemsGl . ISITEMACC = Boolean . Parse ( dsTMFCI . Tables [ 0 ] . Rows [ 0 ] [ "ISITEMACC" ] . ToString ( ) . Trim ( ) ) ; //核算项目,按规则设置生成
if ( dsTMFCI . Tables [ 0 ] . Rows [ 0 ] [ "DC" ] . ToString ( ) . Trim ( ) = = "借" )
{
MsCwVouitemsGl . DC = "D" ; //借方向
}
else
{
MsCwVouitemsGl . DC = "C" ; //贷方向
}
/ /
strACCALL = "" ;
MsCwVouitemsGl . CORPID = "" ; // strEMPLID;//人员(系统)本来应该放客户
MsCwVouitemsGl . CUSTOMERNAME = "" ; // strSALE;//人员(系统)本来应该放客户
if ( dsTMFCI . Tables [ 0 ] . Rows [ 0 ] [ "ISCORPACC" ] . ToString ( ) . Trim ( ) = = "True" )
{
MsCwVouitemsGl . CORPID = "" ; //客户(系统)
MsCwVouitemsGl . CUSTOMERNAME = dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "CUSTOMERNAME" ] . ToString ( ) . Trim ( ) ; //客户(系统)
strACCALL + = "▁" + MsCwVouitemsGl . CUSTOMERNAME ;
}
}
if ( Decimal . Parse ( dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "OTCURRAMOUNT" ] . ToString ( ) . Trim ( ) ) = = 0 )
{
MsCwVouitemsGl . DC = "C" ; //贷方向
MsCwVouitemsGl . ACCALL = BasicDataRefDAL . setCAGA ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "PACCGID" ] . ToString ( ) , MsCwVouitemsGl . ACCNAME . ToString ( ) . Trim ( ) ) + strACCALL ;
}
/ /
strACCALL = "" ;
MsCwVouitemsGl . CORPID = "" ; // strEMPLID;//人员(系统)本来应该放客户
MsCwVouitemsGl . CUSTOMERNAME = "" ; // strSALE;//人员(系统)本来应该放客户
if ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "ISCORPACC" ] . ToString ( ) . Trim ( ) = = "True" )
else
{
MsCwVouitemsGl . CORPID = "" ; //客户(系统)
MsCwVouitemsGl . CUSTOMERNAME = dsVWChFeeAR . Tables [ 0 ] . Rows [ i ] [ "CUSTOMERNAME" ] . ToString ( ) . Trim ( ) ; //客户(系统)
strACCALL + = "▁" + MsCwVouitemsGl . CUSTOMERNAME ;
MsCwVouitemsGl . ACCALL = BasicDataRefDAL . setCAGA ( dsTMFCI . Tables [ 0 ] . Rows [ 0 ] [ "PACCGID" ] . ToString ( ) , MsCwVouitemsGl . ACCNAME . ToString ( ) . Trim ( ) ) + strACCALL ;
}
MsCwVouitemsGl . ACCALL = BasicDataRefDAL . setCAGA ( dsMBINCOME . Tables [ 0 ] . Rows [ 0 ] [ "PACCGID" ] . ToString ( ) , MsCwVouitemsGl . ACCNAME . ToString ( ) . Trim ( ) ) + strACCALL ;
MsCwVouitemsGl . FCYEXRATE = 1 ; //汇率
if ( dsCwDesign . Tables [ 0 ] . Rows [ 0 ] [ "ISVBM" ] . ToString ( ) . Trim ( ) = = "True" )
{
MsCwVouitemsGl . ISSYS = false ; //是否手动录入