hanxuntao 6 months ago
parent d524d43934
commit dc010efff7

@ -166,6 +166,8 @@
</PropertyGroup>
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.props'))" />
<Error Condition="!Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\EntityFramework.6.4.4\build\EntityFramework.targets'))" />
<Error Condition="!Exists('..\packages\Microsoft.NETFramework.ReferenceAssemblies.net45.1.0.3\build\Microsoft.NETFramework.ReferenceAssemblies.net45.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.NETFramework.ReferenceAssemblies.net45.1.0.3\build\Microsoft.NETFramework.ReferenceAssemblies.net45.targets'))" />
</Target>
<Import Project="..\packages\EntityFramework.6.4.4\build\EntityFramework.targets" Condition="Exists('..\packages\EntityFramework.6.4.4\build\EntityFramework.targets')" />
<Import Project="..\packages\Microsoft.NETFramework.ReferenceAssemblies.net45.1.0.3\build\Microsoft.NETFramework.ReferenceAssemblies.net45.targets" Condition="Exists('..\packages\Microsoft.NETFramework.ReferenceAssemblies.net45.1.0.3\build\Microsoft.NETFramework.ReferenceAssemblies.net45.targets')" />
</Project>

@ -5,6 +5,7 @@
<package id="EntityFramework" version="6.4.4" targetFramework="net472" />
<package id="FluentFTP" version="34.0.0" targetFramework="net472" />
<package id="log4net" version="1.2.10" targetFramework="net472" />
<package id="Microsoft.NETFramework.ReferenceAssemblies.net45" version="1.0.3" targetFramework="net472" developmentDependency="true" />
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net472" />
<package id="Quartz" version="2.6.2" targetFramework="net472" />
<package id="RabbitMQ.Client" version="6.2.2" targetFramework="net472" />

@ -501,8 +501,8 @@ Ext.extend(Shipping.MsChInvoicehexiaoEdit, Ext.Panel, {
disableSelection: false,
selModel: this.GridCheckBoxModel,
tbar: [{
text: Zi.LAN.btnAddInvdetail,
tooltip: Zi.LAN.btnAddInvdetail,
text: Zi.LAN.btndelInvdetail,
tooltip: Zi.LAN.btndelInvdetail,
id: 'btndelbill',
iconCls: "btndeletedetail",
handler: function (button, event) {

@ -47,6 +47,9 @@ using DSWeb.MvcShipping.Models.MsSysThirdPartyAccount;
using javax.smartcardio;
using DSWeb.Areas.Import.Models.CwVouchers;
using DSWeb.LogManage;
using System.Security.Cryptography;
using Quartz.Collection;
using DSWeb.MvcShipping.DAL.MsCompanysDAL;
namespace DSWeb.MvcShipping.Controllers
{
@ -778,11 +781,27 @@ namespace DSWeb.MvcShipping.Controllers
}
}
public static string MD5Encrypt32(string password)
{
string cl = password;
string pwd = "";
MD5 md5 = MD5.Create(); //实例化一个md5对像
// 加密后是一个字节类型的数组这里要注意编码UTF8/Unicode等的选择 
byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(cl));
// 通过使用循环,将字节类型的数组转换为字符串,此字符串是常规字符格式化所得
for (int i = 0; i < s.Length; i++)
{
// 将得到的字符串使用十六进制类型格式。格式后的字符是小写的字母如果使用大写X则格式后的字符是大写字符
pwd = pwd + s[i].ToString("x2");
}
return pwd;
}
public ContentResult UpdateU8(string data)
{
var headList = JsonConvert.Deserialize<List<MsClient>>(data);
var U8URL = MsSysParamSetDAL.GetData("PARAMNAME='U8URL'").PARAMVALUE;
U8URL = U8URL.Replace("gl/voucher/insert", "uapbd/custdoc/insert");
//var U8CORP = MsSysParamSetDAL.GetData("PARAMNAME='U8CORP'").PARAMVALUE;
//var U8BOOKID = MsSysParamSetDAL.GetData("PARAMNAME='U8BOOKID'").PARAMVALUE;
var U8SYSTEM = MsSysParamSetDAL.GetData("PARAMNAME='U8SYSTEM'").PARAMVALUE;
@ -801,16 +820,16 @@ new { Success = false, Message ="U8接口资料不全" });
if (string.IsNullOrEmpty(thirdpartyaccount.ACCOUNT) || string.IsNullOrEmpty(thirdpartyaccount.ACCOUNTPSW))
{
var json3 = DSWeb.MvcShipping.Helper.JsonConvert.Serialize(
new { Success = false, Message = "U8接口账号密码不全" });
return new ContentResult() { Content = json3 };
var json33 = DSWeb.MvcShipping.Helper.JsonConvert.Serialize(
new { Success = false, Message = "U8接口账号密码不全" });
return new ContentResult() { Content = json33 };
}
var HeaderDic = new Dictionary<string, string>
{
{ "usercode",thirdpartyaccount.ACCOUNT},
{ "password",thirdpartyaccount.ACCOUNTPSW},
{ "password",MD5Encrypt32(thirdpartyaccount.ACCOUNTPSW)},
{ "system",U8SYSTEM},
{ "trantype","code"}
};
@ -821,15 +840,95 @@ new { Success = false, Message = "U8接口账号密码不全" });
string rtn2 = Areas.Dispatch.Helper.WebRequestHelper.DoPostHead(U8URL, HeaderDic, strVouJson);
var objRtn = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(rtn2, new { status = "", errormsg = "", data = "" });
if (objRtn.status == "success")
{
//var custbasvodetaillist = new List<custbasvodetail>();
//foreach (var CUST in headList) {
// var corpid = CUST.GID;
// var companyList = MsCompanysDAL.GetNoPicDataList("");
// foreach (var company in companyList)
// {
// var custbasvodetail = new custbasvodetail();
// custbasvodetail.custprop = "2";
// custbasvodetail.pk_corp = company.LICENSECODE;
// custbasvodetail.pk_cubasdoc = corpid;
// custbasvodetaillist.Add(custbasvodetail);
// }
//}
//if (custbasvodetaillist != null && custbasvodetaillist.Count != 0)
//{
// U8URL = U8URL.Replace("insert", "assign");
// var custbasvos = new custbasvos();
// custbasvos.custbasvo = custbasvodetaillist;
// var strVouJson2 = Newtonsoft.Json.JsonConvert.SerializeObject(custbasvos);
// string rtn4 = Areas.Dispatch.Helper.WebRequestHelper.DoPostHead(U8URL, HeaderDic, strVouJson2);
// if (rtn4 == "")
// {
// }
//}
//}
var objRtn3 = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(objRtn.data, new List<cbdocvo>());
if (objRtn3 != null && objRtn3.Count != 0)
{
var custbasvodetaillist = new List<custbasvodetail>();
foreach (var cbdocvo in objRtn3)
{
var corpid = cbdocvo.parentvo.pk_cubasdoc;
var companyList = MsCompanysDAL.GetNoPicDataList("");
foreach (var company in companyList)
{
var custbasvodetail = new custbasvodetail();
custbasvodetail.custprop = "2";
custbasvodetail.pk_corp = company.LICENSECODE;
custbasvodetail.pk_cubasdoc = corpid;
custbasvodetaillist.Add(custbasvodetail);
}
}
if (custbasvodetaillist != null && custbasvodetaillist.Count != 0)
{
U8URL = U8URL.Replace("insert", "assign");
var custbasvos = new custbasvos();
custbasvos.custbasvo = custbasvodetaillist;
var strVouJson2 = Newtonsoft.Json.JsonConvert.SerializeObject(custbasvos);
string rtn4 = Areas.Dispatch.Helper.WebRequestHelper.DoPostHead(U8URL, HeaderDic, strVouJson2);
if (rtn4 == "")
{
}
}
}
var json3 = DSWeb.MvcShipping.Helper.JsonConvert.Serialize(
new { Success = true, Message = "上传成功!" });
new { Success = true, Message = "上传成功!" });
return new ContentResult() { Content = json3 };
}
}
else {
var json3 = DSWeb.MvcShipping.Helper.JsonConvert.Serialize(
new { Success = false, Message = objRtn.errormsg });
new { Success = false, Message = objRtn.errormsg });
return new ContentResult() { Content = json3 };
}

@ -1563,6 +1563,7 @@ namespace DSWeb.MvcShipping.Controllers
headData.BSNO = "topseae" + Guid.NewGuid().ToString();
headData.MASTERNO = headData.BSNO;
headData.IRCODE = "";
headData.GOODSNAME = "";
if (bodyList != null)
{
@ -9283,7 +9284,7 @@ namespace DSWeb.MvcShipping.Controllers
company = MsCompanysDAL.GetNoPicData("FULLNAME='" + comp + "'", company.DBNAME);
// var enter = CookieConfig.GetCookie_UserId(Request);
var NEWBSNO = MsOpSeaeDAL.getBsNo(" MBLNO='"+opseae.MBLNO+ "' and HBLNO='"+opseae.HBLNO+"' AND CORPID='" + company.GID + "'", companyDBNAME);
var NEWBSNO = MsOpSeaeDAL.getBsNo(" MBLNO='"+opseae.MBLNO+ "' AND CORPID='" + company.GID + "'", companyDBNAME);
if (string.IsNullOrEmpty(NEWBSNO.BSNO))
{
var jsonRespose = new JsonResponse { Success = false, Message = "此主提单号在"+company.NAME+"不存在!" };
@ -9362,12 +9363,7 @@ namespace DSWeb.MvcShipping.Controllers
PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='MAILISSSL'");
if (PARAMVALUE.PARAMVALUE == "1") MAILISSSL = true;
var DONGSHENGMAILADDR = "myshipping@myshipping.net";
PARAMVALUE = MsSysParamSetDAL.GetData("PARAMNAME='DONGSHENGMAILADDR'");
if (PARAMVALUE.PARAMVALUE != "") DONGSHENGMAILADDR = PARAMVALUE.PARAMVALUE;
SendEmail se = new SendEmail(DONGSHENGMAILADDR, MAILTONAME, "", "", mailtopic, mailbody, false);
SendEmail se = new SendEmail(Email, MAILTONAME, "", "", mailtopic, mailbody, false);
try
{
se.SetSmtp(MAILTONAME, MAILTOPASSWORD, MAILTOSERVER, Convert.ToInt32(MAILTOPORT), MAILISSSL, System.Net.Mail.MailPriority.Normal); //必须在所有参数设置完后调用此方法

@ -24,6 +24,8 @@ using DSWeb.Areas.Account.DAL.Chfee_Settlement;
using DSWeb.MvcShipping.DAL.MsChFeeDAL;
using DSWeb.Common.DB;
using DSWeb.Areas.CommMng.DAL;
using com.sun.jdi.@event;
using DSWeb.Areas.CommMng.Models;
namespace DSWeb.MvcShipping.Controllers
{
@ -1431,7 +1433,7 @@ namespace DSWeb.MvcShipping.Controllers
/// <param name="iscvessel"></param>
/// <param name="remarks"></param>
/// <returns></returns>
public ContentResult CustomEdiMail(string bsnos, string dcarrier, int iscvessel, string remarks,string filetype="")
public ContentResult CustomEdiMail(string bsnos, string dcarrier, int iscvessel, string remarks,string filetype="",string coscotype="")
{
bsnos = bsnos.Replace(",", "','");
@ -1466,7 +1468,7 @@ namespace DSWeb.MvcShipping.Controllers
//增加费用
if(result.Success)
MakeFee(headList, dcarrier,filetype, Convert.ToString(Session["USERID"]));
MakeFee(headList, dcarrier,filetype, Convert.ToString(Session["USERID"]),false,0, coscotype);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message, Data = result.Data };
@ -1504,7 +1506,7 @@ namespace DSWeb.MvcShipping.Controllers
/// </summary>
/// <param name="bsnos">业务编号 逗号隔开的文本</param>
/// <param name="filetype">修改类型 B:新增 E:修改 D:删除</param>
public static void MakeFee(List<MsOpSeae> headlist, string dcarrier, string filetype, string USERID, bool isfen = false,int billcount=0)
public static void MakeFee(List<MsOpSeae> headlist, string dcarrier, string filetype, string USERID, bool isfen = false,int billcount=0,string coscotype="")
{
var list = new List<string>();
@ -1527,7 +1529,7 @@ namespace DSWeb.MvcShipping.Controllers
list.Add();
}
var amount = pricehelper.getPrice(dcarrier, filetype,item.PORTLOAD,isfen);
var amount = pricehelper.getPrice(dcarrier, filetype,item.PORTLOAD,isfen, coscotype);
//var amount = 0M;
//if (filetype == "B")
@ -1567,20 +1569,20 @@ namespace DSWeb.MvcShipping.Controllers
class helper
{
public List<tSysEnumValue_md> DetailList { get; set; }
public List<SysEnumValue> DetailList { get; set; }
private string carrier { get; set; }
private string filetype { get; set; }
private bool isfen { get; set; } = false;
public helper()
{
var cdc = new CommonDataContext();
//var cdc = new CommonDataContext();
DetailList = cdc.tSysEnumValue.Where(x => x.EnumTypeID == 81003).ToList();
DetailList = PubSysDAL.GetEnumValueList(81003, "");
}
public decimal getPrice(string carrier, string filetype,string portload, bool isfen = false)
public decimal getPrice(string carrier, string filetype,string portload, bool isfen = false, string coscotype="")
{
var result = 0M;
@ -1602,15 +1604,21 @@ namespace DSWeb.MvcShipping.Controllers
//Zi.LAN.CARRIER_ZhongHai = "中海";
//Zi.LAN.CARRIER_ZhongTong = "中通";
//Zi.LAN.CARRIER_ZhongYuan = "中远";
var _d = DetailList.First(x => x.EnumValueID == "其他");
var _d = DetailList.Find(x => x.EnumValueId == "其他");
// DetailList.First(x => x.EnumValueID == "其他");
if (portload.ToUpper().IndexOf("SHANGHAI") > 0) {
_d = DetailList.First(x => x.EnumValueID =="上海");
_d = DetailList.Find(x => x.EnumValueId == "上海");
}
if (DetailList.Exists(x => x.EnumValueID == carrier))
if (DetailList.Exists(x => x.EnumValueId == carrier))
{
_d = DetailList.First(x => x.EnumValueID == carrier);
_d = DetailList.Find(x => x.EnumValueId == carrier);
}
if (!string.IsNullOrEmpty(coscotype)) {
_d = DetailList.Find(x => x.EnumValueId == coscotype);
}
if (_d == null) return result;
var priceList = _d.EnumValueName.Split(',').ToList();
@ -1915,7 +1923,7 @@ namespace DSWeb.MvcShipping.Controllers
#region 直发舱单_分单
public ContentResult CustomBillEdiMail_HBLNO(string bsnos, string dcarrier, int iscvessel, string remarks, string strGIDs,string filetype="")
public ContentResult CustomBillEdiMail_HBLNO(string bsnos, string dcarrier, int iscvessel, string remarks, string strGIDs,string filetype="",string coscotype="")
{
//bsnos = bsnos.Replace(",", "','");
strGIDs = strGIDs.Replace(",", "','");
@ -1934,7 +1942,7 @@ namespace DSWeb.MvcShipping.Controllers
BasicDataRefDAL.SaveLog(JsonConvert.Serialize(result), "", "直发舱单_分单", "结果");
//增加费用
if (result.Success)
MakeFee(headList, dcarrier, filetype, Convert.ToString(Session["USERID"]), true, billList.Count);
MakeFee(headList, dcarrier, filetype, Convert.ToString(Session["USERID"]), true, billList.Count, coscotype);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message, Data = result.Data };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };

@ -30,6 +30,8 @@ using System.Security.Cryptography;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using System.Web.Mvc;
using DSWeb.LogManage;
using DSWeb.Areas.MvcShipping.Models.Message.VGM;
using DSWeb.Areas.Import.Models.CwVouitems;
namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
{
@ -49,18 +51,18 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
else
{
//strSql.Append(" order by convert(int,VOUNO) desc,VOUDATE desc");
strSql.Append(" order by VOUALLNO desc,VOUDATE desc");
strSql.Append(" order by VOUDATE desc,VOUALLNO desc");
}
strSql.Append(@") as num , ");
strSql.Append("ORDNO,VOUALLNO,VOUNO,VKNO,VOUDATE,ACCYEAR,ACCMONTH,ATTACHS,ACCDATE,PREPARED,ISCHECKED,CHECKED,ENTERED,ISEXPORT,SUM(case when FCYNO='RMB' THEN AMTDR ELSE 0 END) as AMTDR,SUM(case when FCYNO='RMB' THEN AMTCR ELSE 0 END) as AMTCR,SUM(FCYDR) as FCYDR,SUM(FCYCR) as FCYCR,SUM(AMTDR) as QTYDR,SUM(AMTCR) as QTYCR,CREATEUSER,CREATETIME,CREATEUSERNAME,MODIFIEDUSER,MODIFIEDTIME,MODIFIEDUSERNAME,ISCOPY,ISAUTO from VW_cw_vouchers_vouitems_gl WITH(NOLOCK) where STARTGID='" + strCwSTARTGID + "' and (ISDELETE=0 or ISDELETE is null)");
strSql.Append("ORDNO,VOUALLNO,EXPVOUNO,VOUNO,VKNO,VOUDATE,ACCYEAR,ACCMONTH,ATTACHS,ACCDATE,PREPARED,ISCHECKED,CHECKED,ENTERED,ISEXPORT,SUM(case when FCYNO='RMB' THEN AMTDR ELSE 0 END) as AMTDR,SUM(case when FCYNO='RMB' THEN AMTCR ELSE 0 END) as AMTCR,SUM(FCYDR) as FCYDR,SUM(FCYCR) as FCYCR,SUM(AMTDR) as QTYDR,SUM(AMTCR) as QTYCR,CREATEUSER,CREATETIME,CREATEUSERNAME,MODIFIEDUSER,MODIFIEDTIME,MODIFIEDUSERNAME,ISCOPY,ISAUTO from VW_cw_vouchers_vouitems_gl WITH(NOLOCK) where STARTGID='" + strCwSTARTGID + "' and (ISDELETE=0 or ISDELETE is null)");
if (!string.IsNullOrEmpty(strCondition))
{
strSql.Append(" and " + strCondition);
}
strSql.Append(" GROUP BY ORDNO,VOUALLNO,VOUNO,VKNO,VOUDATE,ACCYEAR,ACCMONTH,ATTACHS,ACCDATE,PREPARED,ISCHECKED,CHECKED,ENTERED,ISEXPORT,CREATEUSER,CREATETIME,CREATEUSERNAME,MODIFIEDUSER,MODIFIEDTIME,MODIFIEDUSERNAME,ISCOPY,ISAUTO");
strSql.Append(" GROUP BY ORDNO,VOUALLNO,EXPVOUNO,VOUNO,VKNO,VOUDATE,ACCYEAR,ACCMONTH,ATTACHS,ACCDATE,PREPARED,ISCHECKED,CHECKED,ENTERED,ISEXPORT,CREATEUSER,CREATETIME,CREATEUSERNAME,MODIFIEDUSER,MODIFIEDTIME,MODIFIEDUSERNAME,ISCOPY,ISAUTO");
//
strSql.Append(@")as t ");
@ -148,6 +150,8 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
data.ISAUTO = Convert.ToBoolean(reader["ISAUTO"]);
if (data.ISAUTO) data.ISAUTOSTR = "自动";
}
data.EXPVOUNO = (reader["EXPVOUNO"] == null ? "" : Convert.ToString(reader["EXPVOUNO"]));//唯一编码 newid()
#endregion
headList.Add(data);
}
@ -261,7 +265,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
else
{
//strSql.Append(" order by convert(int,VOUNO) desc,VOUDATE desc,ITEMNO");
strSql.Append(" order by VOUALLNO desc,VOUDATE desc,ITEMNO");
strSql.Append(" order by VOUDATE desc,VOUALLNO desc,ITEMNO");
}
@ -435,6 +439,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
data.ISAUTO = Convert.ToBoolean(reader["ISAUTO"]);
if (data.ISAUTO) data.ISAUTOSTR = "自动";
}
data.EXPVOUNO = (reader["EXPVOUNO"] == null ? "" : Convert.ToString(reader["EXPVOUNO"]));//唯一编码 newid()
#endregion
headList.Add(data);
@ -3014,7 +3019,21 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
#region 导出U8云接口
public static string MD5Encrypt32(string password)
{
string cl = password;
string pwd = "";
MD5 md5 = MD5.Create(); //实例化一个md5对像
// 加密后是一个字节类型的数组这里要注意编码UTF8/Unicode等的选择 
byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(cl));
// 通过使用循环,将字节类型的数组转换为字符串,此字符串是常规字符格式化所得
for (int i = 0; i < s.Length; i++)
{
// 将得到的字符串使用十六进制类型格式。格式后的字符是小写的字母如果使用大写X则格式后的字符是大写字符
pwd = pwd + s[i].ToString("x2");
}
return pwd;
}
public static DBResult setExcelReportGlU8YUN(string strCondition, string userid, string usercode, string companyid, string strCwSTARTGID)
{
@ -3059,23 +3078,27 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
var HeaderDic = new Dictionary<string, string>
{
{ "usercode",thirdpartyaccount.ACCOUNT},
{ "password",thirdpartyaccount.ACCOUNTPSW},
{ "password",MD5Encrypt32(thirdpartyaccount.ACCOUNTPSW)},
{ "system",U8SYSTEM},
{ "trantype","code"}
};
var u8voulist = new List<U8Voucher>();
var voustr = "";
foreach (var body in dataList)
{
var u8voulist = new List<U8Voucher>();
var voustr = "";
var enter = SysUserDAL.GetData(" SHOWNAME ='" + body.PREPARED + "'");
var newvou = new U8Voucher();
newvou.attachment = body.ATTACHS;
newvou.pk_corp = U8CORP;
newvou.pk_glorgbook = U8BOOKID;
newvou.pk_prepared = body.PREPARED;
newvou.pk_prepared = enter.MOBILE;
newvou.pk_vouchertype = body.VKNO;
newvou.prepareddate = body.VOUDATE;
newvou.pk_system = "DSJK";
@ -3113,7 +3136,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
if (vouitems.ISCORPACC && !string.IsNullOrEmpty(vouitems.CORPID))
{
var U8Ass = new U8Ass();
U8Ass.checktypecode = vouitems.FIELD1;
U8Ass.checktypecode = "73";
U8Ass.checkvaluecode = vouitems.CORPID;
U8AssList.Add(U8Ass);
}
@ -3159,31 +3182,44 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlDAL
}
newvou.details = u8detaillist;
u8voulist.Add(newvou);
}
var U8Vous = new U8Vouchers();
U8Vous.voucher = u8voulist;
var U8Vous = new U8Vouchers();
U8Vous.voucher = u8voulist;
var strVouJson = Newtonsoft.Json.JsonConvert.SerializeObject(U8Vous);
var strVouJson = Newtonsoft.Json.JsonConvert.SerializeObject(U8Vous);
T_ALL_DA T_ALL_DA = new T_ALL_DA();
var blUpSQL = " insert into sys_log(GID,NAME,LOGTYPE,LOGTIME,LOGCONTENT,CREATEUSER) values(NEWID(),'U8凭证上传','U8凭证上传','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + strVouJson + "','" + userid + "')";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
string rtn2 = Areas.Dispatch.Helper.WebRequestHelper.DoPostHead(U8URL, HeaderDic, strVouJson);
var objRtn = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(rtn2, new { status = "", errormsg = "", data = "" });
string rtn2 = Areas.Dispatch.Helper.WebRequestHelper.DoPostHead(U8URL, HeaderDic, strVouJson);
var objRtn = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(rtn2, new { status = "", errormsg = "", data = "" });
if (objRtn.status == "success")
{
sSql = " update cw_vouchers_gl set ISEXPORT=1 where " + strCondition.Replace("ACCDATE", "(ACCYEAR+'-'+ACCMONTH)");
SqlHelper.ExecuteSql(SqlHelper.ConnectionStringLocalTransaction, sSql);
result.Success = true;
result.Message = "导出成功";
}
else
{
result.Success = false;
result.Message = "导出错误" + objRtn.errormsg;
if (objRtn.status == "success")
{
var U8VouList = DSWeb.MvcShipping.Helper.JsonConvert.Deserialize<List<U8Voucher>>(objRtn.data);
foreach (var U8Vou in U8VouList)
{
sSql = " update cw_vouchers_gl set ISEXPORT=1,EXPVOUNO='" + U8Vou.year + "-" + U8Vou.period + "-" + U8Vou.no + "' where ORDNO='"+body.ORDNO+"'" ;
SqlHelper.ExecuteSql(SqlHelper.ConnectionStringLocalTransaction, sSql);
}
result.Success = true;
result.Message = "导出成功";
}
else
{
result.Success = false;
result.Message = "导出错误" + objRtn.errormsg;
}
}
return result;
}
#endregion

@ -1989,7 +1989,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
foreach (var items in CwVouitemsEntities)
{
if (items.ACCID == CRACCID.ACCID
&& items.FCYNO == dsVWChFeeAR.Tables[0].Rows[i]["CURRENCY"].ToString().Trim() &&
&& items.FCYNO == dsVWChFeeAR.Tables[0].Rows[i]["RECVCURR"].ToString().Trim() &&
((CRACCID.ISCORPACC && items.CUSTOMERNAME == dsVWChFeeAR.Tables[0].Rows[i]["CUSTOMERNAME"].ToString().Trim()) || !CRACCID.ISCORPACC)
&& ((CRACCID.ISDEPTACC && items.DEPTGID == dsVWChFeeAR.Tables[0].Rows[i]["DEPTGID"].ToString().Trim()) || !CRACCID.ISDEPTACC)
&& ((CRACCID.ISEMPLACC && items.SALE == dsVWChFeeAR.Tables[0].Rows[i]["SALE"].ToString().Trim()) || !CRACCID.ISEMPLACC)
@ -2026,7 +2026,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceDAL
if (CRACCID.ISFCY)
{
MsCwVouitemsGl.ISFCY = true;//是否外币
MsCwVouitemsGl.FCYNO = dsVWChFeeAR.Tables[0].Rows[i]["CURRENCY"].ToString().Trim();//外币
MsCwVouitemsGl.FCYNO = dsVWChFeeAR.Tables[0].Rows[i]["RECVCURR"].ToString().Trim();//外币
MsCwVouitemsGl.FCYCR = Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["OTCURRAMOUNT"].ToString().Trim());//本位币贷方金额(互斥)
}
else

@ -492,767 +492,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceHeXiaoDAL
string strCondition = sAndGids + " and BILLNO in (select [BSGID] from [cw_vouno_bs_gl] WITH(NOLOCK) where BSTABLENAME='ch_fee_invoicehexiao' and VOUALLNO='" + cfVOUALLNO + "' and STARTGID='" + strCwSTARTGID + "')";
////是否按照系统录入汇率
//if (headData.ISRATE == true)
//{
// #region 科目设置应付RMB dsAP、应付USD dsAPFC
// if (dsCwDesign.Tables[0].Rows[0]["AP"].ToString().Trim() == dsCwDesign.Tables[0].Rows[0]["APFC"].ToString().Trim())
// {
// #region 应付RMB==应付USD
// #region 摘要内容
// string sISEXPLAN = "";
// //是否核算客户
// if (dsAP.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLAN.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsAP.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsAP.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsAP.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币
// if (dsAP.Tables[0].Rows[0]["ISFCY"].ToString().Trim() == "True")
// {
// sqlAP = "SELECT EXCHANGERATE,CURRENCY,AMOUNT AS je,Convert(decimal(18,2),(AMOUNT*EXCHANGERATE)) AS hj " + strISEXPLAN + sISEXPLAN;
// sqlAP += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY='RMB'";
// sqlAP += " ORDER BY CURRENCY" + strISEXPLAN + sISEXPLAN;
// //
// sqlAPFC = "SELECT EXCHANGERATE,CURRENCY,AMOUNT AS je,Convert(decimal(18,2),(AMOUNT*EXCHANGERATE)) AS hj " + strISEXPLAN + sISEXPLAN;
// sqlAPFC += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY<>'RMB'";
// sqlAPFC += " ORDER BY CURRENCY" + strISEXPLAN + sISEXPLAN;
// }
// else
// {
// sqlAP = "SELECT AMOUNT AS je,Convert(decimal(18,2),(AMOUNT*EXCHANGERATE)) AS hj " + strISEXPLAN + sISEXPLAN;
// sqlAP += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + "";
// sqlAP += " ORDER BY VOUNO" + strISEXPLAN + sISEXPLAN;
// }
// #endregion
// }
// else
// {
// #region 应付RMB!=应付USD
// //应付RMB
// #region 摘要内容
// string sISEXPLAN = "";
// //是否核算客户
// if (dsAP.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLAN.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsAP.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsAP.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsAP.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币,因 应付RMB!=应付USD所以此处不需核算外币
// sqlAP = "SELECT AMOUNT AS je,Convert(decimal(18,2),(AMOUNT*EXCHANGERATE)) AS hj " + strISEXPLAN + sISEXPLAN;
// sqlAP += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY='RMB'";
// sqlAP += " ORDER BY VOUNO" + strISEXPLAN + sISEXPLAN;
// //应付USD
// #region 摘要内容
// sISEXPLAN = "";
// //是否核算客户
// if (dsAPFC.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLAN.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsAPFC.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsAPFC.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsAPFC.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币,因 应付RMB!=应付USD所以此处不需核算外币
// sqlAPFC = "SELECT EXCHANGERATE,CURRENCY,AMOUNT AS je,Convert(decimal(18,2),(AMOUNT*EXCHANGERATE)) AS hj " + strISEXPLAN + sISEXPLAN;
// sqlAPFC += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY<>'RMB'";
// sqlAPFC += " ORDER BY CURRENCY" + strISEXPLAN + sISEXPLAN;
// #endregion
// }
// #endregion
// #region 科目设置主营业务成本RMB dsMBSPENDING、主营成本外币USD dsTMSFC
// if (dsCwDesign.Tables[0].Rows[0]["MBSPENDING"].ToString().Trim() == dsCwDesign.Tables[0].Rows[0]["TMSFC"].ToString().Trim())
// {
// #region 主营业务成本RMB==主营成本外币USD
// string sISEXPLAN = "";
// #region 核算项目
// //是否核算客户
// if (dsMBSPENDING.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLANnull.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsMBSPENDING.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsMBSPENDING.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsMBSPENDING.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币
// if (dsMBSPENDING.Tables[0].Rows[0]["ISFCY"].ToString().Trim() == "True")
// {
// sqlMBSPENDING = "SELECT EXCHANGERATE,CURRENCY,(SUM(AMOUNT)-SUM(TAX)) AS je,(SUM(AMOUNT)-SUM(TAX)) AS hj " + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY='RMB'";
// sqlMBSPENDING += " group BY EXCHANGERATE,CURRENCY" + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " ORDER BY CURRENCY" + strISEXPLANnull + sISEXPLAN;
// //
// sqlTMSFC = "SELECT EXCHANGERATE,CURRENCY,(SUM(AMOUNT)-SUM(TAX)) AS je,(SUM(Convert(decimal(18,2),(AMOUNT*EXCHANGERATE)))-SUM(Convert(decimal(18,2),(TAX*EXCHANGERATE)))) AS hj " + strISEXPLANnull + sISEXPLAN;
// sqlTMSFC += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY<>'RMB'";
// sqlTMSFC += " group BY EXCHANGERATE,CURRENCY" + strISEXPLANnull + sISEXPLAN;
// sqlTMSFC += " ORDER BY CURRENCY" + strISEXPLANnull + sISEXPLAN;
// }
// else
// {
// sqlMBSPENDING = "SELECT (SUM(AMOUNT)-SUM(TAX)) AS je,(SUM(Convert(decimal(18,2),(AMOUNT*EXCHANGERATE)))-SUM(Convert(decimal(18,2),(TAX*EXCHANGERATE)))) AS hj " + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + "";
// sqlMBSPENDING += " group BY VOUNO" + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " ORDER BY VOUNO" + strISEXPLANnull + sISEXPLAN;
// }
// #endregion
// }
// else
// {
// #region 主营业务成本RMB!=主营成本外币USD
// //主营业务成本RMB
// string sISEXPLAN = "";
// #region 核算项目
// //是否核算客户
// if (dsMBSPENDING.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLANnull.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsMBSPENDING.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsMBSPENDING.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsMBSPENDING.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币,因 应付RMB!=应付USD所以此处不需核算外币
// sqlMBSPENDING = "SELECT (SUM(AMOUNT)-SUM(TAX)) AS je,(SUM(AMOUNT)-SUM(TAX)) AS hj " + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY='RMB'";
// sqlMBSPENDING += " group BY VOUNO" + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " ORDER BY VOUNO" + strISEXPLANnull + sISEXPLAN;
// //主营成本外币USD
// sISEXPLAN = "";
// #region 核算项目
// //是否核算客户
// if (dsTMSFC.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLANnull.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsTMSFC.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsTMSFC.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsTMSFC.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币,因 应付RMB!=应付USD所以此处不需核算外币
// sqlTMSFC = "SELECT EXCHANGERATE,CURRENCY,(SUM(AMOUNT)-SUM(TAX)) AS je,(SUM(Convert(decimal(18,2),(AMOUNT*EXCHANGERATE)))-SUM(Convert(decimal(18,2),(TAX*EXCHANGERATE)))) AS hj " + strISEXPLANnull + sISEXPLAN;
// sqlTMSFC += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY<>'RMB'";
// sqlTMSFC += " group BY EXCHANGERATE,CURRENCY" + strISEXPLANnull + sISEXPLAN;
// sqlTMSFC += " ORDER BY CURRENCY" + strISEXPLANnull + sISEXPLAN;
// #endregion
// }
// #endregion
// #region 科目设置:进项税 dsINPUTTAX
// #region 核算项目
// string ssISEXPLAN = "";
// //是否核算客户
// if (dsINPUTTAX.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// ssISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLANnull.IndexOf("CUSTOMERNAME") < 0)
// {
// ssISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsINPUTTAX.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// ssISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsINPUTTAX.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// ssISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsINPUTTAX.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// ssISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币
// if (dsINPUTTAX.Tables[0].Rows[0]["ISFCY"].ToString().Trim() == "True")
// {
// sqlINPUTTAX = "SELECT EXCHANGERATE,CURRENCY,SUM(TAX) AS je,SUM(TAX*EXCHANGERATE) AS hj " + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAX += " From VW_ch_fee_invoicehexiao WHERE 1=1 and TAX<>0" + strCondition + " and CURRENCY='RMB'";
// sqlINPUTTAX += " group BY EXCHANGERATE,CURRENCY" + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAX += " ORDER BY CURRENCY" + strISEXPLANnull + ssISEXPLAN;
// //
// sqlINPUTTAXUSD = "SELECT EXCHANGERATE,CURRENCY,SUM(TAX) AS je,SUM(Convert(decimal(18,2),(TAX*EXCHANGERATE))) AS hj " + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAXUSD += " From VW_ch_fee_invoicehexiao WHERE 1=1 and TAX<>0" + strCondition + " and CURRENCY<>'RMB'";
// sqlINPUTTAXUSD += " group BY EXCHANGERATE,CURRENCY" + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAXUSD += " ORDER BY CURRENCY" + strISEXPLANnull + ssISEXPLAN;
// }
// else
// {
// sqlINPUTTAX = "SELECT SUM(TAX) AS je,SUM(Convert(decimal(18,2),(TAX*EXCHANGERATE))) AS hj " + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAX += " From VW_ch_fee_invoicehexiao WHERE 1=1 and TAX<>0" + strCondition;
// sqlINPUTTAX += " group BY VOUNO" + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAX += " ORDER BY VOUNO" + strISEXPLANnull + ssISEXPLAN;
// }
// #endregion
//}
//else
//{
// #region 提取费率
// string tbRATE = "";
// if (bodyList != null)
// {
// if (bodyList.Count > 0)
// {
// for (int i = 0; i < bodyList.Count; i++)
// {
// tbRATE += " WHEN CURRENCY='" + bodyList[i].CURR.ToString().Trim() + "' THEN " + bodyList[i].FCYEXRATE.ToString().Trim();
// }
// }
// }
// #endregion
// #region 科目设置应付RMB dsAP、应付USD dsAPFC
// if (dsCwDesign.Tables[0].Rows[0]["AP"].ToString().Trim() == dsCwDesign.Tables[0].Rows[0]["APFC"].ToString().Trim())
// {
// #region 应付RMB==应付USD
// #region 摘要
// string sISEXPLAN = "";
// //是否核算客户
// if (dsAP.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLAN.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsAP.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsAP.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsAP.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币
// if (dsAP.Tables[0].Rows[0]["ISFCY"].ToString().Trim() == "True")
// {
// sqlAP = "SELECT EXCHANGERATE,CURRENCY,AMOUNT AS je,Convert(decimal(18,2),(AMOUNT*EXCHANGERATE)) AS hj " + strISEXPLAN + sISEXPLAN;
// sqlAP += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY='RMB'";
// sqlAP += " ORDER BY CURRENCY" + strISEXPLAN + sISEXPLAN;
// //
// sqlAPFC = "SELECT (CASE" + tbRATE + " ELSE EXCHANGERATE END) as EXCHANGERATE,CURRENCY,AMOUNT AS je,Convert(decimal(18,2),(AMOUNT*(CASE" + tbRATE + " ELSE EXCHANGERATE END))) AS hj " + strISEXPLAN + sISEXPLAN;
// sqlAPFC += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY<>'RMB'";
// sqlAPFC += " ORDER BY CURRENCY" + strISEXPLAN + sISEXPLAN;
// }
// else
// {
// sqlAP = "SELECT AMOUNT AS je,Convert(decimal(18,2),(AMOUNT*(CASE" + tbRATE + " ELSE EXCHANGERATE END))) AS hj " + strISEXPLAN + sISEXPLAN;
// sqlAP += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + "";
// sqlAP += " ORDER BY VOUNO" + strISEXPLAN + sISEXPLAN;
// }
// #endregion
// }
// else
// {
// #region 应付RMB!=应付USD
// //应付RMB
// #region 摘要
// string sISEXPLAN = "";
// //是否核算客户
// if (dsAP.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLAN.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsAP.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsAP.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsAP.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币,因 应付RMB!=应付USD所以此处不需核算外币
// sqlAP = "SELECT AMOUNT AS je,Convert(decimal(18,2),(AMOUNT*EXCHANGERATE)) AS hj " + strISEXPLAN + sISEXPLAN;
// sqlAP += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY='RMB'";
// sqlAP += " ORDER BY VOUNO" + strISEXPLAN + sISEXPLAN;
// //应付USD
// #region 摘要
// sISEXPLAN = "";
// //是否核算客户
// if (dsAPFC.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLAN.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsAPFC.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsAPFC.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsAPFC.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币,因 应付RMB!=应付USD所以此处不需核算外币
// sqlAPFC = "SELECT (CASE" + tbRATE + " ELSE EXCHANGERATE END) as EXCHANGERATE,CURRENCY,AMOUNT AS je,Convert(decimal(18,2),(AMOUNT*(CASE" + tbRATE + " ELSE EXCHANGERATE END))) AS hj " + strISEXPLAN + sISEXPLAN;
// sqlAPFC += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY<>'RMB'";
// sqlAPFC += " ORDER BY CURRENCY" + strISEXPLAN + sISEXPLAN;
// #endregion
// }
// #endregion
// #region 科目设置主营业务成本RMB dsMBSPENDING、主营成本外币USD dsTMSFC
// if (dsCwDesign.Tables[0].Rows[0]["MBSPENDING"].ToString().Trim() == dsCwDesign.Tables[0].Rows[0]["TMSFC"].ToString().Trim())
// {
// #region 主营业务成本RMB==主营成本外币USD
// string sISEXPLAN = "";
// #region 核算项目
// //是否核算客户
// if (dsMBSPENDING.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLANnull.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsMBSPENDING.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsMBSPENDING.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsMBSPENDING.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币
// if (dsMBSPENDING.Tables[0].Rows[0]["ISFCY"].ToString().Trim() == "True")
// {
// sqlMBSPENDING = "SELECT EXCHANGERATE,CURRENCY,(SUM(AMOUNT)-SUM(TAX)) AS je,(SUM(AMOUNT)-SUM(TAX)) AS hj " + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY='RMB'";
// sqlMBSPENDING += " group BY EXCHANGERATE,CURRENCY" + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " ORDER BY CURRENCY" + strISEXPLANnull + sISEXPLAN;
// //
// sqlTMSFC = "SELECT (CASE" + tbRATE + " ELSE EXCHANGERATE END) as EXCHANGERATE,CURRENCY,(SUM(AMOUNT)-SUM(TAX)) AS je,(SUM(Convert(decimal(18,2),(AMOUNT*(CASE" + tbRATE + " ELSE EXCHANGERATE END))))-SUM(Convert(decimal(18,2),(TAX*(CASE" + tbRATE + " ELSE EXCHANGERATE END))))) AS hj " + strISEXPLANnull + sISEXPLAN;
// sqlTMSFC += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY<>'RMB'";
// sqlTMSFC += " group BY EXCHANGERATE,CURRENCY" + strISEXPLANnull + sISEXPLAN;
// sqlTMSFC += " ORDER BY CURRENCY" + strISEXPLANnull + sISEXPLAN;
// }
// else
// {
// sqlMBSPENDING = "SELECT (SUM(AMOUNT)-SUM(TAX)) AS je,(SUM(Convert(decimal(18,2),(AMOUNT*(CASE" + tbRATE + " ELSE EXCHANGERATE END))))-SUM(Convert(decimal(18,2),(TAX*(CASE" + tbRATE + " ELSE EXCHANGERATE END))))) AS hj " + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + "";
// sqlMBSPENDING += " group BY VOUNO" + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " ORDER BY VOUNO" + strISEXPLANnull + sISEXPLAN;
// }
// #endregion
// }
// else
// {
// #region 主营业务成本RMB!=主营成本外币USD
// //主营业务成本RMB
// string sISEXPLAN = "";
// #region 核算项目
// //是否核算客户
// if (dsMBSPENDING.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLANnull.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsMBSPENDING.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsMBSPENDING.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsMBSPENDING.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币,因 应付RMB!=应付USD所以此处不需核算外币
// sqlMBSPENDING = "SELECT (SUM(AMOUNT)-SUM(TAX)) AS je,(SUM(AMOUNT)-SUM(TAX)) AS hj " + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY='RMB'";
// sqlMBSPENDING += " group BY VOUNO" + strISEXPLANnull + sISEXPLAN;
// sqlMBSPENDING += " ORDER BY VOUNO" + strISEXPLANnull + sISEXPLAN;
// //主营成本外币USD
// sISEXPLAN = "";
// #region 核算项目
// //是否核算客户
// if (dsTMSFC.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLANnull.IndexOf("CUSTOMERNAME") < 0)
// {
// sISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsTMSFC.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsTMSFC.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// sISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsTMSFC.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// sISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币,因 应付RMB!=应付USD所以此处不需核算外币
// sqlTMSFC = "SELECT (CASE" + tbRATE + " ELSE EXCHANGERATE END) as EXCHANGERATE,CURRENCY,(SUM(AMOUNT)-SUM(TAX)) AS je,(SUM(Convert(decimal(18,2),(AMOUNT*(CASE" + tbRATE + " ELSE EXCHANGERATE END))))-SUM(Convert(decimal(18,2),(TAX*(CASE" + tbRATE + " ELSE EXCHANGERATE END))))) AS hj " + strISEXPLANnull + sISEXPLAN;
// sqlTMSFC += " From VW_ch_fee_invoicehexiao WHERE 1=1" + strCondition + " and CURRENCY<>'RMB'";
// sqlTMSFC += " group BY EXCHANGERATE,CURRENCY" + strISEXPLANnull + sISEXPLAN;
// sqlTMSFC += " ORDER BY CURRENCY" + strISEXPLANnull + sISEXPLAN;
// #endregion
// }
// #endregion
// #region 科目设置:进项税 dsINPUTTAX
// #region 核算项目
// string ssISEXPLAN = "";
// //是否核算客户
// if (dsINPUTTAX.Tables[0].Rows[0]["ISCORPACC"].ToString().Trim() == "True")
// {
// if (dsCwDesign.Tables[0].Rows[0]["ISCLIENTNAME"].ToString().Trim() != "True")
// {
// ssISEXPLAN += ",CUSTOMERNAME";//是否发票单位
// }
// else
// {
// if (strISEXPLANnull.IndexOf("CUSTOMERNAME") < 0)
// {
// ssISEXPLAN += ",CUSTOMERNAME";//是否委托单位
// }
// }
// }
// //是否核算人员
// if (dsINPUTTAX.Tables[0].Rows[0]["ISEMPLACC"].ToString().Trim() == "True")
// {
// ssISEXPLAN += ",SALE";//是否揽货人
// }
// //是否核算部门
// if (dsINPUTTAX.Tables[0].Rows[0]["ISDEPTACC"].ToString().Trim() == "True")
// {
// ssISEXPLAN += ",DEPTGID";//是否揽货人的部门
// }
// //是否核算项目
// if (dsINPUTTAX.Tables[0].Rows[0]["ISITEMACC"].ToString().Trim() == "True")
// {
// if (dsCwDesignItem != null)
// {
// ssISEXPLAN += ",OPLBNAME";//是否核算项目
// }
// }
// #endregion
// //ISFCY 是否核算外币
// if (dsINPUTTAX.Tables[0].Rows[0]["ISFCY"].ToString().Trim() == "True")
// {
// sqlINPUTTAX = "SELECT EXCHANGERATE,CURRENCY,SUM(TAX) AS je,SUM(TAX) AS hj " + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAX += " From VW_ch_fee_invoicehexiao WHERE 1=1 and TAX<>0" + strCondition + " and CURRENCY='RMB'";
// sqlINPUTTAX += " group BY EXCHANGERATE,CURRENCY" + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAX += " ORDER BY CURRENCY" + strISEXPLANnull + ssISEXPLAN;
// //
// sqlINPUTTAXUSD = "SELECT (CASE" + tbRATE + " ELSE EXCHANGERATE END) as EXCHANGERATE,CURRENCY,SUM(TAX) AS je,SUM(Convert(decimal(18,2),(TAX*(CASE" + tbRATE + " ELSE EXCHANGERATE END)))) AS hj " + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAXUSD += " From VW_ch_fee_invoicehexiao WHERE 1=1 and TAX<>0" + strCondition + " and CURRENCY<>'RMB'";
// sqlINPUTTAXUSD += " group BY EXCHANGERATE,CURRENCY" + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAXUSD += " ORDER BY CURRENCY" + strISEXPLANnull + ssISEXPLAN;
// }
// else
// {
// sqlINPUTTAX = "SELECT SUM(TAX) AS je,SUM(Convert(decimal(18,2),(TAX*(CASE" + tbRATE + " ELSE EXCHANGERATE END)))) AS hj " + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAX += " From VW_ch_fee_invoicehexiao WHERE 1=1 and TAX<>0" + strCondition + "";
// sqlINPUTTAX += " group BY VOUNO" + strISEXPLANnull + ssISEXPLAN;
// sqlINPUTTAX += " ORDER BY VOUNO" + strISEXPLANnull + ssISEXPLAN;
// }
// #endregion
//}
//DataSet dsVWChFeeInvoiceAP = T_ALL_DA.GetAllSQL(sqlAP);
//DataSet dsVWChFeeInvoiceAPFC = null;
//if (sqlAPFC.Trim() != "")
//{
// dsVWChFeeInvoiceAPFC = T_ALL_DA.GetAllSQL(sqlAPFC);
//}
//DataSet dsVWChFeeInvoiceMBSPENDING = T_ALL_DA.GetAllSQL(sqlMBSPENDING);
//DataSet dsVWChFeeInvoiceTMSFC = null;
//if (sqlTMSFC.Trim() != "")
//{
// dsVWChFeeInvoiceTMSFC = T_ALL_DA.GetAllSQL(sqlTMSFC);
//}
//DataSet dsVWChFeeInvoiceINPUTTAX = T_ALL_DA.GetAllSQL(sqlINPUTTAX);
//DataSet dsVWChFeeInvoiceINPUTTAXUSD = null;
//if (sqlINPUTTAXUSD.Trim() != "")
//{
// dsVWChFeeInvoiceINPUTTAXUSD = T_ALL_DA.GetAllSQL(sqlINPUTTAXUSD);
//}
#endregion
@ -1453,6 +693,22 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceHeXiaoDAL
&& ((dsAP.ACCID == dsAPFC.ACCID && dsAP.ISFCY) || dsAP.ACCID != dsAPFC.ACCID))
{
var isfind = false;
decimal EXRATE = 0;
if (bodyList != null)
{
if (bodyList.Count > 0)
{
for (int Z = 0; Z < bodyList.Count; Z++)
{
if (bodyList[Z].CURR.ToString().Trim() == dsVWChFeeAR.Tables[0].Rows[i]["CURRENCY"].ToString().Trim()) {
EXRATE =Convert.ToDecimal(bodyList[Z].FCYEXRATE.ToString().Trim());
}
}
}
}
if (dsCwDesign.Tables[0].Rows[0]["PiaoHao"].ToString().Trim() != "INVOICENO")
{
@ -1472,9 +728,9 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceHeXiaoDAL
isfind = true;
items.FCYCR = items.FCYCR + Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["AMOUNT"].ToString().Trim());//外币借方金额
items.AMTCR = items.AMTCR + Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["INVAMOUNT"].ToString().Trim());
iAMTCR = iAMTCR + Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["INVAMOUNT"].ToString().Trim());
dRMBS += Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["INVAMOUNT"].ToString().Trim());//本位币借方金额(互斥)
items.AMTCR = items.AMTCR + (Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["AMOUNT"].ToString().Trim())* EXRATE);
iAMTCR = iAMTCR + (Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["AMOUNT"].ToString().Trim()) * EXRATE);
dRMBS += (Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["AMOUNT"].ToString().Trim()) * EXRATE);//本位币借方金额(互斥)
break;
@ -1498,10 +754,10 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceHeXiaoDAL
MsCwVouitemsGl.GRADE = 0;//科目级别
#region 应收账款
iAMTCR = iAMTCR + Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["INVAMOUNT"].ToString().Trim());
MsCwVouitemsGl.AMTCR = Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["INVAMOUNT"].ToString().Trim());//本位币借方金额(互斥)
iAMTCR = iAMTCR + (Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["AMOUNT"].ToString().Trim()) * EXRATE);
MsCwVouitemsGl.AMTCR = (Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["AMOUNT"].ToString().Trim()) * EXRATE);//本位币借方金额(互斥)
MsCwVouitemsGl.FCYCR = Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["AMOUNT"].ToString().Trim());//外币借方金额
dRMBS += Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["INVAMOUNT"].ToString().Trim());//本位币借方金额(互斥)
dRMBS += (Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["AMOUNT"].ToString().Trim()) * EXRATE);//本位币借方金额(互斥)
@ -1513,7 +769,6 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceHeXiaoDAL
MsCwVouitemsGl.FCYNO = dsVWChFeeAR.Tables[0].Rows[i]["CURRENCY"].ToString().Trim();//外币
strFCY = MsCwVouitemsGl.FCYNO;
MsCwVouitemsGl.FCYCR = 0;//外币贷方金额
//
MsCwVouitemsGl.ACCNAME = dsAPFC.ACCLNAME;//科目名称
@ -1575,7 +830,7 @@ namespace DSWeb.MvcShipping.DAL.MsCwVouchersGlInvoiceHeXiaoDAL
MsCwVouitemsGl.ACCALL = dsAPFC.ACCNAME + strACCALL;
MsCwVouitemsGl.EXPLAN = strEXPLAN;//摘要
if(Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["AMOUNT"].ToString().Trim())!=0)
MsCwVouitemsGl.FCYEXRATE = Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["INVAMOUNT"].ToString().Trim()) / Decimal.Parse(dsVWChFeeAR.Tables[0].Rows[i]["AMOUNT"].ToString().Trim());//汇率
MsCwVouitemsGl.FCYEXRATE = EXRATE;//汇率
dEXCHANGERATE = MsCwVouitemsGl.FCYEXRATE;//汇率
MsCwVouitemsGl.BLNO = "";
string strBLNONAME = dsCwDesign.Tables[0].Rows[0]["PiaoHao"].ToString().Trim();

@ -1642,8 +1642,6 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient
var u8voulist = new List<cbdocvo>();
var voustr = "";
foreach (var body in custList)
{
var cbdocvo = new cbdocvo();
@ -1653,7 +1651,16 @@ namespace DSWeb.MvcShipping.DAL.MsInfoClient
parentvo.custname = body.DESCRIPTION;
parentvo.custshortname = body.SHORTNAME;
parentvo.custprop = body.CUSTTYPE;
parentvo.pk_areacl = "88";
parentvo.pk_corp = body.GID;
if (!string.IsNullOrEmpty(body.CUSTTYPE))
{
parentvo.pk_areacl = "01";
}
else {
parentvo.pk_areacl = "02";
parentvo.custprop = "0";
}
cbdocvo.parentvo = parentvo;
u8voulist.Add(cbdocvo);

@ -847,6 +847,8 @@ namespace DSWeb.MvcShipping.Models.MsCwVouchersGl
}
public string ISAUTOSTR { get; set; }
public string EXPVOUNO { get; set; }
#endregion
public MsCwVouchersVouitemsGl()

@ -1937,6 +1937,10 @@ namespace DSWeb.MvcShipping.Models.MsInfoClient
public string custname { get; set; }
public string custprop { get; set; }
public string pk_corp { get; set; }
public string pk_cubasdoc { get; set; }
}
[JsonObject]
@ -1947,6 +1951,28 @@ namespace DSWeb.MvcShipping.Models.MsInfoClient
/// </summary>
public parentvo parentvo { get; set; }
}
[JsonObject]
public class custbasvodetail
{
/// <summary>
///
/// </summary>
public string custprop { get; set; }
public string pk_corp { get; set; }
public string pk_cubasdoc { get; set; }
}
[JsonObject]
public class custbasvos
{
/// <summary>
///
/// </summary>
public List<custbasvodetail> custbasvo { get; set; }
}
[JsonObject]
public class U8Customer

@ -535,7 +535,14 @@ Ext.extend(Shipping.MsCwVouchersGlIndex, Ext.Panel, {
header: '凭证号',
align: 'center',
width: 50
},
},
{
sortable: true,
dataIndex: 'EXPVOUNO',
header: '导出凭证号',
align: 'center',
width: 50
},
{
sortable: false,
dataIndex: 'AMTDR',
@ -813,7 +820,14 @@ Ext.extend(Shipping.MsCwVouchersGlIndex, Ext.Panel, {
header: '凭证号',
align: 'center',
width: 50
},
},
{
sortable: true,
dataIndex: 'EXPVOUNO',
header: '导出凭证号',
align: 'center',
width: 50
},
{
sortable: false,
dataIndex: 'EXPLAN',

@ -55,6 +55,7 @@ Ext.define('MsCwVouitemsGlModel', {
{name: 'CUSTOMERNAME', type: 'string' }, //CUSTOMERNAME
{name: 'SALE', type: 'string' },
{name: 'BLNO', type: 'string' },
{ name: 'EXPVOUNO', type: 'string' },
{name: 'ITEMGID', type: 'string' },
{name: 'DEPTGID', type: 'string' },
{name: 'ACCALL', type: 'string' },
@ -70,7 +71,9 @@ Ext.define('MsCwVVModel', {
//{name: 'VOUNO', type: 'string' }, //自动生成编号,月初清零
{name: 'VOUNO', type: 'int' }, //自动生成编号,月初清零
{name: 'VKNO', type: 'string' }, //凭证字
{name: 'VOUDATE', type: 'string' }, //凭证日期
{ name: 'VOUDATE', type: 'string' }, //凭证日期
{ name: 'EXPVOUNO', type: 'string' },
{name: 'EXPLAN', type: 'string' }, //摘要,规则生成
{name: 'ACCALL', type: 'string' },
{ name: 'ACCID', type: 'string' },

@ -1193,7 +1193,7 @@ Ext.extend(Shipping.MsInfoClientIndex, Ext.Panel, {
return;
}
Ext.MessageBox.confirm(Zi.LAN.TiShi, Zi.LAN.QueDingShanChuGaiJiLuMa, function (btn) {
Ext.MessageBox.confirm(Zi.LAN.TiShi,'确实要同步U8客商信息吗', function (btn) {
if (btn == 'yes') {
Ext.Ajax.request({

@ -355,11 +355,11 @@ Ext.extend(Shipping.MsOpFeeView, Ext.Panel, {
this.panelFee.StoreDrOpRange.load({ params: { optype: oplbdrOp} });
this.panelFee.StoreCrOpRange.load({ params: { optype: oplbCrOp} });
//if (data.OPTYPE == '更改单') {
this.panelFee.storeDrChFee.load({ params: { billno: bsno, type: 1, optype: oplb, condition: " FeeType=1 and BSNO='" + bsno + "'" } });
this.panelFee.storeCrChFee.load({ params: { billno: bsno, type: 2, optype: oplb, condition: " FeeType=2 and BSNO='" + bsno + "'" } });
//this.panelFee.storeDrChFee.load({ params: { billno: bsno, type: 1, optype: oplb, condition: " FeeType=1 and BSNO='" + bsno + "'" } });
//this.panelFee.storeCrChFee.load({ params: { billno: bsno, type: 2, optype: oplb, condition: " FeeType=2 and BSNO='" + bsno + "'" } });
//} else {
// this.panelFee.storeDrChFee.load({ params: { billno: bsno, type: 1, optype: oplb, condition: " FeeType=1 and exists (select 1 from v_op_bill b where b.BSNO=ch_fee.BSNO and b.PARENTID='" + bsno + "')" } });
// this.panelFee.storeCrChFee.load({ params: { billno: bsno, type: 2, optype: oplb, condition: " FeeType=2 and exists (select 1 from v_op_bill b where b.BSNO=ch_fee.BSNO and b.PARENTID='" + bsno + "')" } });
this.panelFee.storeDrChFee.load({ params: { billno: bsno, type: 1, optype: oplb, condition: " FeeType=1 and exists (select 1 from v_op_bill b where b.BSNO=ch_fee.BSNO and b.PARENTID='" + bsno + "')" } });
this.panelFee.storeCrChFee.load({ params: { billno: bsno, type: 2, optype: oplb, condition: " FeeType=2 and exists (select 1 from v_op_bill b where b.BSNO=ch_fee.BSNO and b.PARENTID='" + bsno + "')" } });
//}
this.panelFee.storeBodySum.load({ params: { bsno: this.bsno, optype: oplb} });
this.panelFee.storeChFeeGain.load({ params: { bsno: this.bsno, optype: oplb} });

@ -8436,6 +8436,30 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
checked: false
}
]
}, {
xtype: 'radiogroup',
fieldLabel: '中远订舱', //'船公司',
columns: 3,
vertical: true,
id: 'dCOSCO',
items: [
{
boxLabel: '无', //'外代',
name: 'COSCO',
inputValue: '', //'外代',
checked: true
}, {
boxLabel: '中远自订舱', //'外代',
name: 'COSCO',
inputValue:'中远自订舱', //'外代',
checked: false
}, {
boxLabel:'中远非自订舱', //'外运',
name: 'COSCO',
inputValue:'中远非自订舱', //'外运',
checked: false
}
]
},
//this.CheckVessel = new Ext.form.Checkbox({
@ -8508,7 +8532,10 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
}
_this.onSendDS(CARRIER.CARRIER, IsCgVessel, REMARK, FILETYPE);
var cgCOSCO = Ext.getCmp('dCOSCO');
var COSCO = cgCOSCO.getValue();
_this.onSendDS(CARRIER.CARRIER, IsCgVessel, REMARK, FILETYPE, COSCO);
}
}, {
text: Zi.LAN.GuanBi, //"关闭",
@ -12602,6 +12629,30 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
inputValue: '东方海外', //'中海',
checked: false
}]
}, {
xtype: 'radiogroup',
fieldLabel: '中远订舱', //'船公司',
columns: 3,
vertical: true,
id: 'dCOSCO_HBLNO',
items: [
{
boxLabel: '无', //'外代',
name: 'COSCO',
inputValue: '', //'外代',
checked: true
}, {
boxLabel: '中远自订舱', //'外代',
name: 'COSCO',
inputValue: '中远自订舱', //'外代',
checked: false
}, {
boxLabel: '中远非自订舱', //'外运',
name: 'COSCO',
inputValue: '中远非自订舱', //'外运',
checked: false
}
]
},
//, this.CheckVessel_HBLNO
@ -12673,7 +12724,10 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
return;
}
_this.onSendDS_HBLNO(CARRIER.CARRIER, IsCgVessel, REMARK, FILETYPE);
var cgCOSCO= Ext.getCmp('dCOSCO_HBLNO');
var COSCO = cgCOSCO.getValue();
_this.onSendDS_HBLNO(CARRIER.CARRIER, IsCgVessel, REMARK, FILETYPE, COSCO);
}
}, {
text: Zi.LAN.GuanBi, //"关闭",
@ -16555,7 +16609,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
_this.winDSMANIFESTShow.show();
},
onSendDS: function (carrier, iscgvessel, remarks,filetype) {
onSendDS: function (carrier, iscgvessel, remarks,filetype,coscotype) {
var BSNO = this.formHead.getForm().findField('BSNO').getValue();
var BSNOStr = "'" + BSNO + "'";
var _this = this;
@ -16584,13 +16638,13 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
if (confirms) {
Ext.MessageBox.confirm('提示', '已发送过舱单,确认再次发送?', function (btn) {
if (btn == 'yes') {
_this.doSendEdi(BSNO, carrier, iscgvessel, remarks, filetype);
_this.doSendEdi(BSNO, carrier, iscgvessel, remarks, filetype, coscotype);
} else {
return false;
}
})
} else {
_this.doSendEdi(BSNO, carrier, iscgvessel, remarks, filetype);
_this.doSendEdi(BSNO, carrier, iscgvessel, remarks, filetype, coscotype);
}
},
scope: this
@ -16599,7 +16653,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
}
},
doSendEdi: function (BSNO, carrier, iscgvessel, remarks, filetype) {
doSendEdi: function (BSNO, carrier, iscgvessel, remarks, filetype, coscotype) {
Ext.Ajax.request({
waitMsg: Zi.LAN.ZhengZaiCaoZuoShuJu, //'正在生成...',
@ -16609,7 +16663,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
dcarrier: carrier,
iscvessel: iscgvessel,
remarks: remarks,
filetype:filetype
filetype: filetype,
coscotype: coscotype
},
callback: function (options, success, response) {
if (success) {
@ -16639,7 +16694,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
//#region 直发舱单EDI_分单
onSendDS_HBLNO: function (carrier, iscgvessel, remarks, filetype) {
onSendDS_HBLNO: function (carrier, iscgvessel, remarks, filetype, coscotype) {
var selections = this.gridListManifest.getSelectionModel().getSelection(); //获得选中的项
if (selections.length == 0) {
this.gridList.getSelectionModel().selectAll;
@ -16678,7 +16733,8 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
iscvessel: iscgvessel,
remarks: remarks,
strGIDs: strGIDs,
filetype: filetype
filetype: filetype,
coscotype: coscotype
},
callback: function (options, success, response) {
if (success) {

@ -1394,7 +1394,7 @@ Ext.extend(Shipping.MsOp_BLISSUEIndex, Ext.Panel, {
}
});
//this.storeBlInfoList.load({ params: { SALE: SALE, CUSTNAME: CUSTOMERNAME} });
this.storeBlInfoList.load({ params: { SALE: _SALE, CUSTNAME: _CUSTOMERNAME } });
// this.storeBlInfoList.load({ params: { SALE: _SALE, CUSTNAME: _CUSTOMERNAME } });
} else {
this.storeLog.removeAll();

@ -3107,6 +3107,16 @@ Ext.extend(Shipping.MsOp_BLISSUESPEdit, Ext.Panel, {
, onSP_StartClick: function (optype) {
if (this.storeBodyList.getCount() == 0) {
Ext.Msg.show({ title: '提示', msg: '业务明细为空不能提交审核!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
var basicForm = this.formEdit.getForm();
if (!basicForm.isValid()) {

Loading…
Cancel
Save