@ -24,6 +24,7 @@ using System.Web.UI.WebControls;
using DSWeb.Areas.MvcShipping.Models.Message.VGM ;
using DSWeb.MvcShipping.DAL.MsInfoClient ;
using DSWeb.MvcShipping.Models.SysBillType ;
using DSWeb.MvcShipping.DAL.MsCompanysDAL ;
namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
{
@ -311,6 +312,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
{
var result = new DBResult ( ) ;
var BankdataList = ChBankdataDAL . GetDataList ( condition , userid , username , companyid ) ;
var stlBankdataList = new List < ChBankdata > ( ) ;
if ( BankdataList ! = null & & BankdataList . Count ! = 0 )
{
@ -632,7 +634,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
var result2 = modb . Save ( head ) ;
if ( result2 . Success )
{
var addinvlist = ChsettlementDAL . GetPayDCData All List( "BILLNO in (select BILLNO FROM ch_fee_bankdata_fitdetail WHERE LINKGID='" + Bankdata . GID + "')" , "" , "RMB" ) ;
var addinvlist = ChsettlementDAL . GetPayDCData List( "BILLNO in (select BILLNO FROM ch_fee_bankdata_fitdetail WHERE LINKGID='" + Bankdata . GID + "')" , userid , username , companyid , "" , "RMB" ) ;
if ( addinvlist ! = null & & addinvlist . Count ! = 0 )
{
var exrateList = ChsettlementDAL . GetAppCurrExrateData ( addinvlist , head . CURR , "" , true ) ;
@ -662,6 +664,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
public static DBResult AddAutoBankDataSTL ( List < ChBankdata > BankdataList , string userid , string username , string companyid )
{
var result = new DBResult ( ) ;
var companylist = MsCompanysDAL . GetNoPicDataList ( "" ) ;
if ( BankdataList ! = null & & BankdataList . Count ! = 0 )
{
foreach ( var Bankdata in BankdataList )
@ -680,18 +683,18 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
head . SETTLEUSER = userid ;
head . SETTLEUSERREF = username ;
var period = ChMonthCloseDAL . GetData ( "" , companyid ) ;
if ( Convert . ToDateTime ( period . FDAY ) > DateTime . Now )
if ( Convert . ToDateTime ( period . FDAY ) > Convert . ToDateTime ( Bankdata . TRANSDATE ) )
{
head . SETTLETIME = period . FDAY ;
}
else
head . SETTLETIME = DateTime. Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) ;
head . SETTLETIME = Bankdata. TRANSDATE ;
head . CURR = Bankdata . CURRENCY . Replace ( "CNY" , "RMB" ) . Trim ( ) ;
head . CUSTOMERNAME = MsInfoClientDAL . GetData ( "[DESCRIPTION]='" + Bankdata . DRAWEE_NAME . Trim ( ) + "'" ) . SHORTNAME ;
if ( string . IsNullOrEmpty ( head . CUSTOMERNAME ) ) {
if ( addinvlist ! = null & & addinvlist . Count ! = 0 )
{
head . CUSTOMERNAME = addinvlist [ 0 ] . CUSTOMERNAME ;
head . CUSTOMERNAME = addinvlist [ 0 ] . CUSTOMERNAME ;
}
}
@ -704,6 +707,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
head . BILLNO = MsSysBillNoSetDAL . GetBillNo ( billnoset , head . SETTLETIME . ToString ( ) . Trim ( ) , head . BILLDATE . ToString ( ) . Trim ( ) ) ;
else head . BILLNO = PubSysDAL . GetBillNo ( "0305" ) ;
head . COMPANYID = companyid ;
var salecorp = companylist . Find ( x = > x . FULLNAME = = Bankdata . PAYEE_NAME ) ;
if ( salecorp ! = null ) {
head . SALECORPID = salecorp . GID ;
}
head . DbOperationType = DbOperationType . DbotIns ;
var bankList = MsBaseInfoDAL . GetBANKList ( "ACCOUNT='" + Bankdata . PAYEE_ACCOUNT . Trim ( ) + "'" , "" ) ;
if ( bankList ! = null & & bankList . Count ! = 0 )
@ -749,12 +757,12 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
head . SETTLEUSER = userid ;
head . SETTLEUSERREF = username ;
var period = ChMonthCloseDAL . GetData ( "" , companyid ) ;
if ( Convert . ToDateTime ( period . FDAY ) > DateTime. Now )
if ( Convert . ToDateTime ( period . FDAY ) > Convert. ToDateTime ( Bankdata . TRANSDATE ) )
{
head . SETTLETIME = period . FDAY ;
}
else
head . SETTLETIME = DateTime. Now . ToString ( "yyyy-MM-dd HH:mm:ss" ) ;
head . SETTLETIME = Bankdata. TRANSDATE ;
head . CURR = Bankdata . CURRENCY . Replace ( "CNY" , "RMB" ) . Trim ( ) ;
head . SETTLETYPE = 7 ;
head . RATE = 1 ;
@ -787,6 +795,11 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
}
}
var salecorp = companylist . Find ( x = > x . FULLNAME = = Bankdata . PAYEE_NAME ) ;
if ( salecorp ! = null )
{
head . SALECORPID = salecorp . GID ;
}
var modb = new ModelObjectDB ( ) ;
var result2 = modb . Save ( head ) ;