hanxuntao 5 months ago
parent f162e8bc98
commit 815d0d62d0

@ -18,6 +18,7 @@ using DSWeb.MvcShipping.Models.MsSysBillNoSet;
using DSWeb.MvcShipping.DAL.MsSysParamSet;
using System.Data;
using DSWeb.MvcShipping.DAL.MsCodeGoodInv;
using System.Web;
namespace DSWeb.Areas.Account.Controllers
@ -525,6 +526,13 @@ namespace DSWeb.Areas.Account.Controllers
public ContentResult Delete(string data)
{
var headData = JsonConvert.Deserialize<ChInvoiceapplication>(data);
var head = ChinvoiceapplicationDAL.GetData(" GID='"+headData.GID+"'");
if (!string.IsNullOrEmpty(head.INVOICENOREF)) {
var jsonRespose2 = new JsonResponse { Success = false, Message = "发票申请已生成发票,请刷新!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
var dataList = ChinvoiceapplicationDAL.GetBodyList("BILLNO='" + headData.BILLNO + "'");
DBResult result = ChinvoiceapplicationDAL.DelFeeDo(dataList,headData.GID);
@ -549,6 +557,13 @@ namespace DSWeb.Areas.Account.Controllers
DBResult result = new DBResult();
foreach (var headData in headList)
{
var head = ChinvoiceapplicationDAL.GetData(" GID='" + headData.GID + "'");
if (!string.IsNullOrEmpty(head.INVOICENOREF))
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "发票申请已生成发票,请刷新!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
var dataList = ChinvoiceapplicationDAL.GetBodyList("BILLNO='" + headData.BILLNO + "'");
result = ChinvoiceapplicationDAL.DelFeeDo(dataList, headData.GID);

@ -319,7 +319,7 @@ namespace DSWeb.Areas.Account.Controllers
{
var BLCOUNT = T_ALL_DA.GetStrSQL("BLCOUNT", "select COUNT(*) BLCOUNT from ch_fee where FEETYPE=1 and (AMOUNT<>SETTLEMENT AND AMOUNT<>ORDERAMOUNT) and BSNO='" + bodyList[0].BSNO + "'");
var BLCOUNT2 = T_ALL_DA.GetStrSQL("BLCOUNT", "select COUNT(*) BLCOUNT from ch_fee where FEETYPE=1 and (AMOUNT<>SETTLEMENT and (AMOUNT<>ORDERINVOICE OR AMOUNT<>ORDERAMOUNT) ) and CUSTOMERNAME='" + bodyList[0].CustomerName + "'");
var BLCOUNT2 = T_ALL_DA.GetStrSQL("BLCOUNT", "select COUNT(*) BLCOUNT from ch_fee where FEETYPE=1 and (AMOUNT<>SETTLEMENT and (AMOUNT<>ORDERINVOICE AND AMOUNT<>ORDERAMOUNT) ) and CUSTOMERNAME='" + bodyList[0].CustomerName + "'");
var errstr = "";
if (BLCOUNT != "0") errstr = errstr + "此票存在未结算的应收费用";
if (BLCOUNT2 != "0") errstr = errstr + ",此客户有未提交的应收费用";
@ -379,7 +379,7 @@ namespace DSWeb.Areas.Account.Controllers
if (MBLNOSTR != "") MBLNOSTR = ",注意:主提单号 " + MBLNOSTR + " 业务应收费用中存在未结算的费用!";
var BLCOUNT2 = T_ALL_DA.GetStrSQL("BLCOUNT", "select COUNT(*) BLCOUNT from ch_fee where FEETYPE=1 and (AMOUNT<>SETTLEMENT and (AMOUNT<>ORDERINVOICE OR AMOUNT<>ORDERAMOUNT) ) and CUSTOMERNAME='" + billcust + "'");
var BLCOUNT2 = T_ALL_DA.GetStrSQL("BLCOUNT", "select COUNT(*) BLCOUNT from ch_fee where FEETYPE=1 and (AMOUNT<>SETTLEMENT and (AMOUNT<>ORDERINVOICE AND AMOUNT<>ORDERAMOUNT) ) and CUSTOMERNAME='" + billcust + "'");
if (BLCOUNT2 != "0") MBLNOSTR = MBLNOSTR + ",此客户有未提交的应收费用";
@ -423,7 +423,7 @@ namespace DSWeb.Areas.Account.Controllers
if (MBLNOSTR != "") MBLNOSTR = ",注意:主提单号 " + MBLNOSTR + " 业务应收费用中存在未审核的费用!";
var BLCOUNT2 = T_ALL_DA.GetStrSQL("BLCOUNT", "select COUNT(*) BLCOUNT from ch_fee where FEETYPE=1 and (AMOUNT<>SETTLEMENT and (AMOUNT<>ORDERINVOICE OR AMOUNT<>ORDERAMOUNT) ) and CUSTOMERNAME='" + billcust + "'");
var BLCOUNT2 = T_ALL_DA.GetStrSQL("BLCOUNT", "select COUNT(*) BLCOUNT from ch_fee where FEETYPE=1 and (AMOUNT<>SETTLEMENT and (AMOUNT<>ORDERINVOICE AND AMOUNT<>ORDERAMOUNT) ) and CUSTOMERNAME='" + billcust + "'");
if (BLCOUNT2 != "0") MBLNOSTR = MBLNOSTR + ",此客户有未提交的应收费用";
result.Message = "添加成功" + MBLNOSTR;

@ -789,7 +789,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_Payapplication
strSql.Append(" ,b.OPLBNAME,b.BSSTATUS,b.ACCDATE,b.MBLNO,b.HBLNO,b.CUSTNO,b.CUSTOMNO,(CASE b.BSSTATUS WHEN 1 THEN '锁定' else '未锁定' end) as BSSTATUSREF");
strSql.Append(",(CASE b.FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF,b.CUSTOMERNAME,b.BLISSUESTATUS,b.CNTRTOTAL");
strSql.Append(",b.VESSEL,b.VOYNO,b.CARRIER,b.ETD,b.ETA,b.PORTLOAD,b.ENTERP,(select [NAME] FROM company where GID=B.SALECORPID) BSSALECORP");
strSql.Append(",b.PORTDISCHARGE,b.INPUTBY,b.OP,b.CUSTSERVICE,b.BSSOURCE,B.BSSOURCEDETAIL,B.OPTYPE,b.PARENTID,b.GOODSNAME");
strSql.Append(",b.PORTDISCHARGE,b.INPUTBY,b.OP,b.CUSTSERVICE,b.BSSOURCE,B.BSSOURCEDETAIL,B.OPTYPE,b.PARENTID,CASE WHEN isnull(f.BSGOODSNAME,'')='' THEN b.GOODSNAME ELSE f.BSGOODSNAME END GOODSNAME");
strSql.Append(",b.DOC,b.SALE,(select top 1 INVNO from ch_fee_invoicehexiao where BILLNO IN (SELECT BILLNO FROM ch_fee_do_invoice WHERE FEEID=c.FEEID)) INVOICENO ");
strSql.Append(",(select TOP 1 BLSTATUS from op_blissuelist WHERE GID IN (SELECT LINKGID FROM op_blissuelist_Detail WHERE BSNO=B.PARENTID)) TFBLSTATUS");
strSql.Append(",(select TOP 1 SPREMARK from v_op_blissuelist_Detail WHERE BSNO=B.PARENTID) TFREMARK");

@ -4329,7 +4329,7 @@ Ext.extend(Shipping.MsChfeeAudit, Ext.Panel, {
var bodyAddDatas = [];
for (var i = 0; i < records.length; i++) {
var rec = records[i];
if (rec.data.BillFeeStatus == "2") {
if (rec.data.BillFeeStatus!="1") {
Ext.Msg.show({ title: '提示', msg: '请先撤销最终审核,才能驳回审核!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}

@ -206,8 +206,14 @@ namespace DSWeb.MvcContainer.Controllers
string blUpSQL = "update op_ctnbscard set AGENTNAME='" + headData.AGENTNAME + "',PRE_CNT_TIME=" + updatestr + " where APPLYNO='" + headData.BSNO + "'";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
//MsOpCtnApplyDAL.SaveApplyFee(headData, Convert.ToString(Session["USERID"]), Convert.ToString(Session["SHOWNAME"]), Convert.ToString(Session["COMPANYID"]));
}
//var OP = T_ALL_DA.GetStrSQL("USERID", "select top 1 USERID from VW_user where SHOWNAME='" + headData.OP + "'");
//MsOpCtnApplyDAL.SaveFeeDR(headData.CTN_PRICE, headData.CURRENCY, GID, Convert.ToString(Session["USERID"]), Convert.ToInt16(headData.CTNNUM), headData.OWNERCTN, OP);
}

@ -1276,7 +1276,7 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnApply
+ ",[CREATEUSER] ,[CREATETIME] ,[TASKBEGINDATE] ,[COMPLETETYPE] ,[COMPLETETIME] ,[KPI],[MBLNO],[FILENO],[MAILNO],[FILEPATH],[ISPUBLIC],[OP],[BSNO],ISCOMPLETE)"
+ " SELECT NEWID(),NEWID() as [任务编号],null as [上级任务号], '成本审批驳回' as [任务类型], '账单审核' as [任务来源], '未开始' as [任务状态], '驳回原因:" + headdata.COSTAUDITRESULT + "' as [任务说明],"
+ "'" + username + "' as [发起人],GETDATE() as [录入日期],GETDATE() as[任务开始时间], '手动' as [完成方式],null as [完成时间] ,null as [KPI值] , '" + headdata.BSNO + "' as [提单号], "
+ " null as [文件编号], '' as [邮件编号], '' as [电子档案路径], 0 as 是否公共,'" + op.BSNO + "' as 客服员,'" + headdata.BSNO + "' as 编号,0");
+ " null as [文件编号], '' as [邮件编号], '' as [电子档案路径], 0 as 是否公共,'" + GetUserNameWithUserId(op.BSNO) + "' as 客服员,'" + headdata.BSNO + "' as 编号,0");
db.ExecuteNonQuery(cmdUpdateTask, tran);
}
@ -1306,6 +1306,13 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnApply
return result;
}
private static string GetUserNameWithUserId(string userid)
{
string sql = "select showname from [user] where gid = '" + userid + "' ";
Database db = DatabaseFactory.CreateDatabase();
return db.ExecuteScalar(CommandType.Text, sql).ToString();
}
public static DBResult MNGAudit(OpCtnApply headdata, string userid)
{
var result = new DBResult();
@ -2757,7 +2764,7 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnApply
feestatus = 0;
}
var MsOpSeae = MsOpSeaeDAL.GetData("APPLYNO='" + headData.BSNO + "' AND ISCANCEL<>1 ");
var MsOpSeae = MsOpSeaeDAL.GetData("APPLYNO like '%" + headData.BSNO + "%' AND ISCANCEL<>1 ");
if (string.IsNullOrEmpty(MsOpSeae.APPLYNO)) {
result.Success = false;
result.Message = "不存在此申请单业务!";
@ -3288,12 +3295,12 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnApply
MsChFeeDAL.p_op_gain(BSNO);
}
catch (Exception)
catch (Exception e)
{
tran.Rollback();
result.Success = false;
result.Message = "保存出现错误,请重试或联系系统管理员";
result.Message = "保存出现错误,请重试或联系系统管理员"+e.Message;
return result;
}

@ -6545,7 +6545,7 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnBsCard
var opseae = GetData("GID='" + enumValue.GID + "'","",db,tran);
var isPost = true;
tmperrstr = ismodify(opseae, modifydata);
tmperrstr = ismodify(opseae, modifydata, userid);
if (!string.IsNullOrEmpty(tmperrstr))
{
isPost = false;
@ -6662,7 +6662,7 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnBsCard
var OPLOG = new OPLOG();
OPLOG.BSNO = enumValue.GID;
OPLOG.BSTYPE = "OP_CTNBSCARD";
OPLOG.FIELDNAME = "ETD";
OPLOG.FIELDNAME = "开船日期";
OPLOG.OLDVALUE = opseae.ETD;
OPLOG.NEWVALUE = modifydata.ETD;
OPLOG.CREATEUSER = userid;
@ -6683,7 +6683,7 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnBsCard
var OPLOG = new OPLOG();
OPLOG.BSNO = enumValue.GID;
OPLOG.BSTYPE = "OP_CTNBSCARD";
OPLOG.FIELDNAME = "ETA";
OPLOG.FIELDNAME = "到港日期";
OPLOG.OLDVALUE = opseae.ETA;
OPLOG.NEWVALUE = modifydata.ETA;
OPLOG.CREATEUSER = userid;
@ -7008,7 +7008,7 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnBsCard
}
var BSLockField = new BSLockField();
BSLockField.BSNO = enumValue.GID;
BSLockField.FIELDNAME = "D_ETD";
BSLockField.FIELDNAME = "I_DEST_CNT_TIME";
BsLockList.Add(BSLockField);
}
if (modifydata.I_DEST_RTCNT_TIME != "" && modifydata.I_DEST_RTCNT_TIME != null)
@ -7356,34 +7356,368 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnBsCard
return result;
}
public static string ismodify(OpCtnBsCard opseae, OpCtnBsCard modifydata)
public static string ismodify(OpCtnBsCard headData, OpCtnBsCard modifydata,string userid)
{
string errstr = "";
errstr = errstr + ismodifyDate(modifydata.PORTLOAD_CNT_TIME, modifydata.ETD, opseae.ETD,"0","0","起运港提箱日期","开船日期","");
errstr = errstr + ismodifyDate(modifydata.ETD, modifydata.ETA, opseae.ETA,opseae.PORTLOAD_CNT_TIME, modifydata.PORTLOAD_CNT_TIME, "开船日期","到港日期", "起运港提箱日期");
errstr = errstr + ismodifyDate(modifydata.ETA, modifydata.DEST_CNT_TIME, opseae.DEST_CNT_TIME, opseae.ETD, modifydata.ETD, "到港日期", "目的港提箱日期", "开船日期");
errstr = errstr + ismodifyDate(modifydata.DEST_CNT_TIME, modifydata.DEST_RTCNT_TIME, opseae.DEST_RTCNT_TIME, opseae.ETA, modifydata.ETA, "目的港提箱日期", "目的港还箱日期", "到港日期");
if (opseae.IDTYPE == "调拨-空返")
string errorstr = "";
if (modifydata.ETD != "" && modifydata.ETD != null)
headData.ETD = modifydata.ETD;
if (modifydata.ETA != "" && modifydata.ETA != null)
headData.ETA = modifydata.ETA;
if (modifydata.PORTLOAD_CNT_TIME != "" && modifydata.PORTLOAD_CNT_TIME != null)
headData.PORTLOAD_CNT_TIME = modifydata.PORTLOAD_CNT_TIME;
if (modifydata.DEST_CNT_TIME != "" && modifydata.DEST_CNT_TIME != null)
headData.DEST_CNT_TIME = modifydata.DEST_CNT_TIME;
if (modifydata.DEST_RTCNT_TIME != "" && modifydata.DEST_RTCNT_TIME != null)
headData.DEST_RTCNT_TIME = modifydata.DEST_RTCNT_TIME;
if (modifydata.I_ETD != "" && modifydata.I_ETD != null)
headData.I_ETD = modifydata.I_ETD;
if (modifydata.I_ETA != "" && modifydata.I_ETA != null)
headData.I_ETA = modifydata.I_ETA;
if (modifydata.I_PORTLOAD_CNT_TIME != "" && modifydata.I_PORTLOAD_CNT_TIME != null)
headData.I_PORTLOAD_CNT_TIME = modifydata.I_PORTLOAD_CNT_TIME;
if (modifydata.I_DEST_CNT_TIME != "" && modifydata.I_DEST_CNT_TIME != null)
headData.I_DEST_CNT_TIME = modifydata.I_DEST_CNT_TIME;
if (modifydata.I_DEST_RTCNT_TIME != "" && modifydata.I_DEST_RTCNT_TIME != null)
{
headData.I_DEST_RTCNT_TIME = modifydata.I_DEST_RTCNT_TIME;
}
if (modifydata.D_ETD != "" && modifydata.D_ETD != null)
headData.D_ETD = modifydata.D_ETD;
if (modifydata.D_ETA != "" && modifydata.D_ETA != null)
headData.D_ETA = modifydata.D_ETA;
if (modifydata.D_PORTLOAD_CNT_TIME != "" && modifydata.D_PORTLOAD_CNT_TIME != null)
headData.D_PORTLOAD_CNT_TIME = modifydata.D_PORTLOAD_CNT_TIME;
if (modifydata.D_DEST_CNT_TIME != "" && modifydata.D_DEST_CNT_TIME != null)
headData.D_DEST_CNT_TIME = modifydata.D_DEST_CNT_TIME;
if (modifydata.D_DEST_RTCNT_TIME != "" && modifydata.D_DEST_RTCNT_TIME != null)
{
headData.D_DEST_RTCNT_TIME = modifydata.D_DEST_RTCNT_TIME;
}
var PREHEAD = MsOpCtnBsCardDAL.GetData(" BSNO IN (SELECT TOP 1 BSNO FROM op_ctnbscard WHERE CTNNO='" + headData.CTNNO + "' AND GID<>'" + headData.GID + "' AND (PORTLOAD_CNT_TIME<'" + headData.PORTLOAD_CNT_TIME + "' or ETD<'" + headData.ETD + "') ORDER BY ETD,PORTLOAD_CNT_TIME ) ", userid);
if (headData.PORTLOAD_CNT_TIME == "")
{
if (headData.ETD != "")
{
errorstr = "开船日期不能小于提箱日期";
}
}
else
{
if (headData.ETD != "" && (Convert.ToDateTime(headData.ETD) < Convert.ToDateTime(headData.PORTLOAD_CNT_TIME)))
{
errorstr = "开船日期不能小于提箱日期";
}
if (PREHEAD.BSNO != "" && PREHEAD.BSNO != null)
{
if ((PREHEAD.IS_DB && PREHEAD.D_DEST_RTCNT_TIME == "") || (PREHEAD.IS_RETURE_EMPTY && PREHEAD.I_DEST_RTCNT_TIME == ""))
{
errorstr = "前一循环,返空目的港还箱日期未填";
}
else
if (PREHEAD.DEST_RTCNT_TIME == "")
{
errorstr = "前一循环,目的港还箱日期未填";
}
}
}
if (headData.ETD == "")
{
if (headData.ETA != "")
{
errorstr = "开船日期不能为空!";
}
}
else
{
errstr = errstr + ismodifyDate(modifydata.DEST_RTCNT_TIME, modifydata.D_PORTLOAD_CNT_TIME, opseae.D_PORTLOAD_CNT_TIME, opseae.DEST_CNT_TIME, modifydata.DEST_CNT_TIME, "目的港还箱日期", "调拨起运港提箱日期", "目的港提箱日期");
errstr = errstr + ismodifyDate(modifydata.D_PORTLOAD_CNT_TIME, modifydata.D_ETD, opseae.D_ETD, opseae.DEST_RTCNT_TIME, modifydata.DEST_RTCNT_TIME, "调拨起运港提箱日期", "调拨开船日期", "目的港还箱日期");
errstr = errstr + ismodifyDate(modifydata.D_DEST_RTCNT_TIME, modifydata.I_PORTLOAD_CNT_TIME, opseae.I_PORTLOAD_CNT_TIME, opseae.D_DEST_CNT_TIME, modifydata.D_DEST_CNT_TIME, "调拨目的港还箱日期", "空返起运港提箱日期", "调拨目的港提箱日期");
if (headData.ETA != "" && (Convert.ToDateTime(headData.ETA) < Convert.ToDateTime(headData.ETD)))
{
errorstr = "到港日期不能小于开船日期";
}
}
if (headData.ETA == "")
{
if (headData.DEST_CNT_TIME != "")
{
errorstr = "到港日期不能为空!";
}
}
else
{
errstr = errstr + ismodifyDate(modifydata.DEST_RTCNT_TIME, modifydata.I_PORTLOAD_CNT_TIME, opseae.I_PORTLOAD_CNT_TIME, opseae.DEST_CNT_TIME, modifydata.DEST_CNT_TIME, "目的港还箱日期", "空返起运港提箱日期", "目的港提箱日期");
errstr = errstr + ismodifyDate(modifydata.I_PORTLOAD_CNT_TIME, modifydata.I_ETD, opseae.I_ETD, opseae.DEST_RTCNT_TIME, modifydata.DEST_RTCNT_TIME, "空返起运港提箱日期", "空返开船日期", "目的港还箱日期");
errstr = errstr + ismodifyDate(modifydata.I_DEST_RTCNT_TIME, modifydata.D_PORTLOAD_CNT_TIME, opseae.D_PORTLOAD_CNT_TIME, opseae.I_DEST_CNT_TIME, modifydata.I_DEST_CNT_TIME, "空返目的港还箱日期", "调拨起运港提箱日期", "空返目的港提箱日期");
if (headData.DEST_CNT_TIME != "" && (Convert.ToDateTime(headData.DEST_CNT_TIME) < Convert.ToDateTime(headData.ETA)))
{
errorstr = "提箱日期不能小于到港日期";
}
}
errstr = errstr + ismodifyDate(modifydata.I_ETD, modifydata.I_ETA, opseae.I_ETA, opseae.I_PORTLOAD_CNT_TIME, modifydata.I_PORTLOAD_CNT_TIME, "空返开船日期", "空返到港日期", "空返起运港提箱日期");
errstr = errstr + ismodifyDate(modifydata.I_ETA, modifydata.I_DEST_CNT_TIME, opseae.I_DEST_CNT_TIME, opseae.I_ETD, modifydata.I_ETD, "空返到港日期", "空返目的港提箱日期", "空返开船日期");
errstr = errstr + ismodifyDate(modifydata.I_DEST_CNT_TIME, modifydata.I_DEST_RTCNT_TIME, opseae.I_DEST_RTCNT_TIME, opseae.I_ETA, modifydata.I_ETA, "空返目的港提箱日期", "空返目的港还箱日期", "空返到港日期");
errstr = errstr + ismodifyDate(modifydata.D_PORTLOAD_CNT_TIME, modifydata.D_ETD, opseae.D_ETD, opseae.DEST_RTCNT_TIME, modifydata.DEST_RTCNT_TIME, "调拨起运港提箱日期", "调拨开船日期", "目的港还箱日期");
errstr = errstr + ismodifyDate(modifydata.D_ETD, modifydata.D_ETA, opseae.D_ETA, opseae.D_PORTLOAD_CNT_TIME, modifydata.D_PORTLOAD_CNT_TIME, "调拨开船日期", "调拨到港日期", "调拨起运港提箱日期");
errstr = errstr + ismodifyDate(modifydata.D_ETA, modifydata.D_DEST_CNT_TIME, opseae.D_DEST_CNT_TIME, opseae.D_ETD, modifydata.D_ETD, "调拨到港日期", "调拨目的港提箱日期", "调拨开船日期");
errstr = errstr + ismodifyDate(modifydata.D_DEST_CNT_TIME, modifydata.D_DEST_RTCNT_TIME, opseae.D_DEST_RTCNT_TIME, opseae.D_ETA, modifydata.D_ETA, "调拨目的港提箱日期", "调拨目的港还箱日期", "调拨到港日期");
if (headData.DEST_CNT_TIME == "")
{
if (headData.DEST_RTCNT_TIME != "")
{
errorstr = "目的港提箱日期不能为空!";
}
}
else
{
return errstr;
if (headData.DEST_RTCNT_TIME != "" && (Convert.ToDateTime(headData.DEST_RTCNT_TIME) < Convert.ToDateTime(headData.DEST_CNT_TIME)))
{
errorstr = "目的港还箱日期不能小于目的港提箱日期";
}
}
if (headData.DEST_RTCNT_TIME == "")
{
if (headData.I_PORTLOAD_CNT_TIME != "")
{
errorstr = "目的港还箱日期不能为空!";
}
}
else
{
if (headData.I_PORTLOAD_CNT_TIME != "" && (Convert.ToDateTime(headData.I_PORTLOAD_CNT_TIME) < Convert.ToDateTime(headData.DEST_RTCNT_TIME)))
{
errorstr = "空返提箱日期不能小于目的港还箱日期";
}
if (headData.D_PORTLOAD_CNT_TIME != "" && (Convert.ToDateTime(headData.D_PORTLOAD_CNT_TIME) < Convert.ToDateTime(headData.DEST_RTCNT_TIME)))
{
errorstr = "调拨提箱日期不能小于目的港还箱日期";
}
}
if (headData.I_PORTLOAD_CNT_TIME == "")
{
if (headData.I_ETD != "")
{
errorstr = "空返开船日期不能小于提箱日期";
}
}
else
{
if (headData.I_ETD != "" && (Convert.ToDateTime(headData.I_ETD) < Convert.ToDateTime(headData.I_PORTLOAD_CNT_TIME)))
{
errorstr = "空返开船日期不能小于提箱日期";
}
}
if (headData.I_ETD == "")
{
if (headData.I_ETA != "")
{
errorstr = "空返开船日期不能为空!";
}
}
else
{
if (headData.I_ETA != "" && (Convert.ToDateTime(headData.I_ETA) < Convert.ToDateTime(headData.I_ETD)))
{
errorstr = "空返到港日期不能小于开船日期";
}
}
if (headData.I_ETA == "")
{
if (headData.I_DEST_CNT_TIME != "")
{
errorstr = "空返到港日期不能为空!";
}
}
else
{
if (headData.I_DEST_CNT_TIME != "" && (Convert.ToDateTime(headData.I_DEST_CNT_TIME) < Convert.ToDateTime(headData.I_ETA)))
{
errorstr = "空返提箱日期不能小于到港日期";
}
}
if (headData.I_DEST_CNT_TIME == "")
{
if (headData.I_DEST_RTCNT_TIME != "")
{
errorstr = "空返目的港提箱日期不能为空!";
}
}
else
{
if (headData.I_DEST_RTCNT_TIME != "" && (Convert.ToDateTime(headData.I_DEST_RTCNT_TIME) < Convert.ToDateTime(headData.I_DEST_CNT_TIME)))
{
errorstr = "空返目的港还箱日期不能小于目的港提箱日期";
}
}
if (headData.D_PORTLOAD_CNT_TIME == "")
{
if (headData.D_ETD != "")
{
errorstr = "调拨开船日期不能小于调拨提箱日期";
}
}
else
{
if (headData.D_ETD != "" && (Convert.ToDateTime(headData.D_ETD) < Convert.ToDateTime(headData.D_PORTLOAD_CNT_TIME)))
{
errorstr = "调拨开船日期不能小于调拨提箱日期";
}
}
if (headData.D_ETD == "")
{
if (headData.D_ETA != "")
{
errorstr = "调拨开船日期不能为空!";
}
}
else
{
if (headData.D_ETA != "" && (Convert.ToDateTime(headData.D_ETA) < Convert.ToDateTime(headData.D_ETD)))
{
errorstr = "调拨到港日期不能小于开船日期";
}
}
if (headData.D_ETA == "")
{
if (headData.D_DEST_CNT_TIME != "")
{
errorstr = "调拨到港日期不能为空!";
}
}
else
{
if (headData.D_DEST_CNT_TIME != "" && (Convert.ToDateTime(headData.D_DEST_CNT_TIME) < Convert.ToDateTime(headData.D_ETA)))
{
errorstr = "调拨提箱日期不能小于到港日期";
}
}
if (headData.D_DEST_CNT_TIME == "")
{
if (headData.D_DEST_RTCNT_TIME != "")
{
errorstr = "调拨目的港提箱日期不能为空!";
}
}
else
{
if (headData.D_DEST_RTCNT_TIME != "" && (Convert.ToDateTime(headData.D_DEST_RTCNT_TIME) < Convert.ToDateTime(headData.D_DEST_CNT_TIME)))
{
errorstr = "调拨目的港还箱日期不能小于目的港提箱日期";
}
}
if (headData.IS_DB && headData.IS_RETURE_EMPTY)
{
if ((!string.IsNullOrEmpty(headData.I_PORTLOAD_CNT_TIME)) && !string.IsNullOrEmpty(headData.D_PORTLOAD_CNT_TIME))
{
if (Convert.ToDateTime(headData.D_PORTLOAD_CNT_TIME) < Convert.ToDateTime(headData.I_PORTLOAD_CNT_TIME))
headData.IDTYPE = "调拨-空返";
}
else
{
}
if (headData.IDTYPE == "调拨-空返")
{
if ((!string.IsNullOrEmpty(headData.I_PORTLOAD_CNT_TIME)) && !string.IsNullOrEmpty(headData.D_DEST_RTCNT_TIME))
{
if (Convert.ToDateTime(headData.I_PORTLOAD_CNT_TIME) < Convert.ToDateTime(headData.D_DEST_RTCNT_TIME))
{
errorstr = "空返提箱日期不能小于调拨目的港返箱日期";
}
}
}
else
{
if ((!string.IsNullOrEmpty(headData.D_PORTLOAD_CNT_TIME)) && !string.IsNullOrEmpty(headData.I_DEST_RTCNT_TIME))
{
if (Convert.ToDateTime(headData.D_PORTLOAD_CNT_TIME) < Convert.ToDateTime(headData.I_DEST_RTCNT_TIME))
{
errorstr = "调拨提箱日期不能小于空返目的港返箱日期";
}
}
}
}
else
{
}
//errstr = errstr + ismodifyDate(modifydata.PORTLOAD_CNT_TIME, modifydata.ETD, opseae.ETD,"0","0","起运港提箱日期","开船日期","");
//errstr = errstr + ismodifyDate(modifydata.ETD, modifydata.ETA, opseae.ETA,opseae.PORTLOAD_CNT_TIME, modifydata.PORTLOAD_CNT_TIME, "开船日期","到港日期", "起运港提箱日期");
//errstr = errstr + ismodifyDate(modifydata.ETA, modifydata.DEST_CNT_TIME, opseae.DEST_CNT_TIME, opseae.ETD, modifydata.ETD, "到港日期", "目的港提箱日期", "开船日期");
//errstr = errstr + ismodifyDate(modifydata.DEST_CNT_TIME, modifydata.DEST_RTCNT_TIME, opseae.DEST_RTCNT_TIME, opseae.ETA, modifydata.ETA, "目的港提箱日期", "目的港还箱日期", "到港日期");
//if (opseae.IDTYPE == "调拨-空返")
//{
// errstr = errstr + ismodifyDate(modifydata.DEST_RTCNT_TIME, modifydata.D_PORTLOAD_CNT_TIME, opseae.D_PORTLOAD_CNT_TIME, opseae.DEST_CNT_TIME, modifydata.DEST_CNT_TIME, "目的港还箱日期", "调拨起运港提箱日期", "目的港提箱日期");
// errstr = errstr + ismodifyDate(modifydata.D_PORTLOAD_CNT_TIME, modifydata.D_ETD, opseae.D_ETD, opseae.DEST_RTCNT_TIME, modifydata.DEST_RTCNT_TIME, "调拨起运港提箱日期", "调拨开船日期", "目的港还箱日期");
// errstr = errstr + ismodifyDate(modifydata.D_DEST_RTCNT_TIME, modifydata.I_PORTLOAD_CNT_TIME, opseae.I_PORTLOAD_CNT_TIME, opseae.D_DEST_CNT_TIME, modifydata.D_DEST_CNT_TIME, "调拨目的港还箱日期", "空返起运港提箱日期", "调拨目的港提箱日期");
//}
//else
//{
// errstr = errstr + ismodifyDate(modifydata.DEST_RTCNT_TIME, modifydata.I_PORTLOAD_CNT_TIME, opseae.I_PORTLOAD_CNT_TIME, opseae.DEST_CNT_TIME, modifydata.DEST_CNT_TIME, "目的港还箱日期", "空返起运港提箱日期", "目的港提箱日期");
// errstr = errstr + ismodifyDate(modifydata.I_PORTLOAD_CNT_TIME, modifydata.I_ETD, opseae.I_ETD, opseae.DEST_RTCNT_TIME, modifydata.DEST_RTCNT_TIME, "空返起运港提箱日期", "空返开船日期", "目的港还箱日期");
// errstr = errstr + ismodifyDate(modifydata.I_DEST_RTCNT_TIME, modifydata.D_PORTLOAD_CNT_TIME, opseae.D_PORTLOAD_CNT_TIME, opseae.I_DEST_CNT_TIME, modifydata.I_DEST_CNT_TIME, "空返目的港还箱日期", "调拨起运港提箱日期", "空返目的港提箱日期");
//}
//errstr = errstr + ismodifyDate(modifydata.I_ETD, modifydata.I_ETA, opseae.I_ETA, opseae.I_PORTLOAD_CNT_TIME, modifydata.I_PORTLOAD_CNT_TIME, "空返开船日期", "空返到港日期", "空返起运港提箱日期");
//errstr = errstr + ismodifyDate(modifydata.I_ETA, modifydata.I_DEST_CNT_TIME, opseae.I_DEST_CNT_TIME, opseae.I_ETD, modifydata.I_ETD, "空返到港日期", "空返目的港提箱日期", "空返开船日期");
//errstr = errstr + ismodifyDate(modifydata.I_DEST_CNT_TIME, modifydata.I_DEST_RTCNT_TIME, opseae.I_DEST_RTCNT_TIME, opseae.I_ETA, modifydata.I_ETA, "空返目的港提箱日期", "空返目的港还箱日期", "空返到港日期");
//errstr = errstr + ismodifyDate(modifydata.D_PORTLOAD_CNT_TIME, modifydata.D_ETD, opseae.D_ETD, opseae.DEST_RTCNT_TIME, modifydata.DEST_RTCNT_TIME, "调拨起运港提箱日期", "调拨开船日期", "目的港还箱日期");
//errstr = errstr + ismodifyDate(modifydata.D_ETD, modifydata.D_ETA, opseae.D_ETA, opseae.D_PORTLOAD_CNT_TIME, modifydata.D_PORTLOAD_CNT_TIME, "调拨开船日期", "调拨到港日期", "调拨起运港提箱日期");
//errstr = errstr + ismodifyDate(modifydata.D_ETA, modifydata.D_DEST_CNT_TIME, opseae.D_DEST_CNT_TIME, opseae.D_ETD, modifydata.D_ETD, "调拨到港日期", "调拨目的港提箱日期", "调拨开船日期");
//errstr = errstr + ismodifyDate(modifydata.D_DEST_CNT_TIME, modifydata.D_DEST_RTCNT_TIME, opseae.D_DEST_RTCNT_TIME, opseae.D_ETA, modifydata.D_ETA, "调拨目的港提箱日期", "调拨目的港还箱日期", "调拨到港日期");
return errorstr;
}
@ -7437,10 +7771,10 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnBsCard
}
}
else {
//if (!string.IsNullOrEmpty(afterdate2))
//{
// errstr = errstr + "," + frdatename + "不允许大于" + afterdatename;
//}
if (!string.IsNullOrEmpty(afterdate2))
{
errstr = errstr + "," + frdatename + "不允许大于" + afterdatename;
}
}
return errstr;
@ -7495,7 +7829,7 @@ namespace DSWeb.MvcContainer.DAL.MsOpCtnBsCard
var opseae = GetData("GID='" + enumValue.GID + "'", "", db, tran);
var isPost = true;
tmperrstr = ismodify(opseae, modifydata);
tmperrstr = ismodify(opseae, modifydata,userid);
if (!string.IsNullOrEmpty(tmperrstr))
{
isPost = false;

@ -1064,6 +1064,10 @@ Ext.extend(Shipping.MsOpCtnBsCardFee, Ext.Panel, {
}
} else {
sql = "CTNNO='" + this.EditRecord.get('CTNNO') + "' AND CUSTNO='" + this.EditRecord.get('CUSTNO') +"'";
}
this.sqlcontext = sql;
this.storeList.load({

@ -342,7 +342,7 @@ Ext.extend(Shipping.MsOpCtnInsuranceEdit, Ext.Panel, {
//#region 明细表-单据图片档案管理
_this = this;
_thisctninsurance = this;
this.storeDocList = Ext.create('Ext.data.Store', {
model: 'ReceiptDocmb',
remoteSort: true,

@ -1363,6 +1363,9 @@ namespace DSWeb.MvcShipping.Controllers
{
string blUpSQL = " update ch_fee set WMSOUTBSNO='" + custno + "' where GID='"+bill.GId+"'";
bool bl = T_ALL_DA.GetExecuteSqlCommand(blUpSQL);
string blUpSQL2 = " update ch_fee set BSGOODSNAME=ISNULL((SELECT TOP 1 GOODSNAME FROM op_ctnbscard WHERE GID=ch_fee.BSNO),'') from ch_fee where WMSOUTBSNO='" + bill.GId + "'";
bool bl2 = T_ALL_DA.GetExecuteSqlCommand(blUpSQL2);
}
}

@ -1117,7 +1117,7 @@ namespace DSWeb.MvcShipping.Controllers
}
if (_dmb.BSSOURCE != "") headData.BSSOURCE = _dmb.BSSOURCE;
}
var nowperiod = ChMonthCloseDAL.GetData("", Convert.ToString(Session["COMPANYID"]));
if (opstatus == "add")
{
headData.INPUTBY = CookieConfig.GetCookie_UserName(Request);
@ -1126,11 +1126,29 @@ namespace DSWeb.MvcShipping.Controllers
headData.FEESTATUS = false;
headData.DbOperationType = DbOperationType.DbotIns;
headData.ISCANCEL = "";
if (Convert.ToDateTime(nowperiod.PERIOD + "-01") > Convert.ToDateTime(headData.ACCDATE + "-01"))
{
isPost = false;
errorstr = "已月末结转,不允许添加业务!";
}
}
else if (opstatus == "edit")
{
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
if (Convert.ToDateTime(nowperiod.PERIOD + "-01") > Convert.ToDateTime(headData.ACCDATE + "-01"))
{
var ACCDATE = T_ALL_DA.GetStrSQL("ACCDATE", "select ACCDATE from v_op_bill WHERE BSNO='" + headData.BSNO + "'");
if (ACCDATE != headData.ACCDATE)
{
isPost = false;
errorstr = "已月末结转,不允许修改会计期间!";
}
}
}
else
{

@ -842,6 +842,7 @@ namespace DSWeb.MvcShipping.Controllers
if (headData.PREETD == "") headData.PREETD = null;
#endregion
//
var nowperiod = ChMonthCloseDAL.GetData("", Convert.ToString(Session["COMPANYID"]));
if (opstatus == "add")
{
#region 默认值
@ -884,12 +885,28 @@ namespace DSWeb.MvcShipping.Controllers
}
#endregion
//
headData.DbOperationType = DbOperationType.DbotIns;
headData.DbOperationType = DbOperationType.DbotIns;
if (Convert.ToDateTime(nowperiod.PERIOD + "-01") > Convert.ToDateTime(headData.ACCDATE + "-01"))
{
isPost = false;
errorstr = "已月末结转,不允许添加业务!";
}
}
else if (opstatus == "edit")
{
headData.DbOperationType = DbOperationType.DbotUpd;
headData.ModelUIStatus = "E";
if (Convert.ToDateTime(nowperiod.PERIOD + "-01") > Convert.ToDateTime(headData.ACCDATE + "-01"))
{
var ACCDATE = T_ALL_DA.GetStrSQL("ACCDATE", "select ACCDATE from v_op_bill WHERE BSNO='" + headData.BSNO + "'");
if (ACCDATE != headData.ACCDATE)
{
isPost = false;
errorstr = "已月末结转,不允许修改会计期间!";
}
}
}
else
{

@ -43,12 +43,12 @@ namespace DSWeb.MvcShipping.Controllers
public ActionResult CDIndex()
{
return View();
}
}
//
// GET/RptMng/MsRptPcHeadQry/QryData
public ContentResult BsListData(int start, int limit, string condition, string sort, string printstr, string sortstr, string amendstr = "false",string nodaystr="")
public ContentResult BsListData(int start, int limit, string condition, string sort, string printstr, string sortstr, string amendstr = "false", string nodaystr = "")
{
if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "")
@ -72,7 +72,8 @@ namespace DSWeb.MvcShipping.Controllers
}
var NORPTFEESTATUS = MsSysParamSetDAL.GetData("PARAMNAME='NORPTFEESTATUS'");
if (NORPTFEESTATUS.PARAMVALUE == "1") {
if (NORPTFEESTATUS.PARAMVALUE == "1")
{
if (!string.IsNullOrEmpty(condition))
{
condition = condition + " and F.FEESTATUS<>1 ";
@ -101,7 +102,8 @@ namespace DSWeb.MvcShipping.Controllers
strSql.Append("SELECT *,dbo.F_FeeStatusStr(DRFEESTATUS) DRFEESTATUSREF,dbo.F_FeeStatusStr(CRFEESTATUS) CRFEESTATUSREF ");
}
else {
else
{
strSql.Append(@"SELECT * FROM (SELECT row_number() over (");
var sortstring = DatasetSort.Getsortstring(sort);
if (!string.IsNullOrEmpty(sortstring))
@ -175,20 +177,21 @@ namespace DSWeb.MvcShipping.Controllers
strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(ORDERAMOUNT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS ORDERTTLDR,");
strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(ORDERAMOUNT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS ORDERTTLCR");
//strSql.Append(",case when isnull(SUM(F.AMOUNT),0)<>isnull(SUM(F.SETTLEMENT),0) then (case A.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],A.OPDATE, GETDATE()) end) ");
//strSql.Append(" else (case A.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],A.OPDATE, S.SETTLETIME) end) end AS ACTUALDAY,S.SETTLETIME");
strSql.Append(",case when isnull(SUM(F.AMOUNT),0)<>isnull(SUM(F.SETTLEMENT),0) then (case A.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],A.OPDATE, GETDATE()) end) ");
strSql.Append(" else (case A.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],A.OPDATE, S.SETTLETIME) end) end AS ACTUALDAY,S.SETTLETIME");
//if (NORPTSTLDATETYPE.PARAMVALUE == "1")
//{
// strSql.Append(",[dbo].[GetCustStlDay](A.OPDATE,F.CUSTOMERNAME,A.SALE) AS STLDATE");
// strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE WITH (NOLOCK) where LINKGID = (select top 1 GID from info_client WITH (NOLOCK) where shortname =F.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
if (NORPTSTLDATETYPE.PARAMVALUE == "1")
{
strSql.Append(",[dbo].[GetCustStlDay](A.OPDATE,F.CUSTOMERNAME,A.SALE) AS STLDATE");
strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE WITH (NOLOCK) where LINKGID = (select top 1 GID from info_client WITH (NOLOCK) where shortname =F.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
//}
//else {
// strSql.Append(",CASE WHEN A.STLDATE IS NULL THEN A.OPDATE ELSE A.STLDATE END STLDATE");
// strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE WITH (NOLOCK) where LINKGID = (select top 1 GID from info_client WITH (NOLOCK) where shortname =A.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
}
else
{
strSql.Append(",CASE WHEN A.STLDATE IS NULL THEN A.OPDATE ELSE A.STLDATE END STLDATE");
strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE WITH (NOLOCK) where LINKGID = (select top 1 GID from info_client WITH (NOLOCK) where shortname =A.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
//}
}
@ -227,11 +230,12 @@ namespace DSWeb.MvcShipping.Controllers
strSql.Append(" ,A.CUSTOMDATE");
strSql.Append(" ,A.CUSTSERVICE, A.PORTLOAD, A.PORTDISCHARGE,B.DESTINATION, A.CUSTOMNO, A.ACCDATE,A.CARRIER, A.BSSOURCE, A.LANE, A.FORWARDER,A.NETWEIGHT,A.KGS,A.TEU,A.CNTRTOTAL,A.CORPID");
strSql.Append(" ,A.CNTR1,A.CNTR2,A.CNTR3,A.CNTR4,A.CNTR5,A.CNTR6,A.CNTR7,A.CNTR8,A.CNTR9,A.CNTR10,A.OTCNTR,A.TRADETYPE,A.GOODSNAME,A.FEESTATUS,A.PKGS,A.CBM,A.ORDERNO,A.SALECORPID,A.STLDATE,F.CUSTOMERNAME,C.[DESCRIPTION],C.CRMREMARK6 ");
//strSql.Append(" ,A.STLNAME, S.SETTLETIME,B.SALE,B.OPDATE,INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
strSql.Append(" ,A.STLNAME, B.SALE,B.OPDATE,INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
strSql.Append(" ,A.STLNAME, S.SETTLETIME,B.SALE,B.OPDATE,INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
}
else {
else
{
strSql.Append("SELECT B.BSNO,B.OPTYPE, B.OPLBNAME, B.BSTYPE,B.CUSTOMERNAME, B.CUSTNO, B.MBLNO, B.HBLNO,B.VESSEL, B.VOYNO, B.INPUTBY, B.CREATETIME, B.BSSTATUS, B.SALE, B.OP, B.DOC,B.YARD,B.BLISSUESTATUS,B.BLTYPE,");
strSql.Append("case B.ETD when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), B.ETD,23) end as ETD");
@ -279,21 +283,21 @@ namespace DSWeb.MvcShipping.Controllers
strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(ORDERAMOUNT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS ORDERTTLDR,");
strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(ORDERAMOUNT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS ORDERTTLCR");
//strSql.Append(",case when isnull(SUM(F.AMOUNT),0)<>isnull(SUM(F.SETTLEMENT),0) then (case B.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],B.OPDATE, GETDATE()) end) ");
//strSql.Append(" else (case B.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],B.OPDATE, S.SETTLETIME) end) end AS ACTUALDAY,S.SETTLETIME");
strSql.Append(",case when isnull(SUM(F.AMOUNT),0)<>isnull(SUM(F.SETTLEMENT),0) then (case B.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],B.OPDATE, GETDATE()) end) ");
strSql.Append(" else (case B.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],B.OPDATE, S.SETTLETIME) end) end AS ACTUALDAY,S.SETTLETIME");
//if (NORPTSTLDATETYPE.PARAMVALUE == "1")
//{
// strSql.Append(",[dbo].[GetCustStlDay](B.OPDATE,F.CUSTOMERNAME,B.SALE) AS STLDATE");
// strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE where LINKGID = (select top 1 GID from info_client where shortname =F.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
if (NORPTSTLDATETYPE.PARAMVALUE == "1")
{
strSql.Append(",[dbo].[GetCustStlDay](B.OPDATE,F.CUSTOMERNAME,B.SALE) AS STLDATE");
strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE where LINKGID = (select top 1 GID from info_client where shortname =F.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
//}
//else
//{
// strSql.Append(",CASE WHEN B.STLDATE IS NULL THEN B.OPDATE ELSE B.STLDATE END STLDATE");
// strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE where LINKGID = (select top 1 GID from info_client where shortname =B.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
}
else
{
strSql.Append(",CASE WHEN B.STLDATE IS NULL THEN B.OPDATE ELSE B.STLDATE END STLDATE");
strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE where LINKGID = (select top 1 GID from info_client where shortname =B.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
//}
}
if (PROFITRATEDR.PARAMVALUE != "1")
{
@ -329,20 +333,17 @@ namespace DSWeb.MvcShipping.Controllers
//}
//else
strSql.Append(",'' INVOICENO");
strSql.Append(",'' INVOICENO");
//strSql.Append(",dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS");
//strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS");
strSql.Append(",'' DRFEESTATUS");
strSql.Append(",'' CRFEESTATUS");
strSql.Append(",dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS");
strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS");
strSql.Append(" FROM CH_FEE F ");
strSql.Append(" INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) ");
strSql.Append("INNER JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO) ");
strSql.Append(" INNER JOIN info_client C WITH (NOLOCK) ON (C.SHORTNAME=F.CUSTOMERNAME) ");
//strSql.Append(" LEFT JOIN V_MAX_SETTLEMENTTIME S ON (S.CUSTOMERNAME=F.CUSTOMERNAME AND S.BSNO=B.BSNO) ");
strSql.Append(" LEFT JOIN V_MAX_SETTLEMENTTIME S ON (S.CUSTOMERNAME=F.CUSTOMERNAME AND S.BSNO=B.BSNO) ");
strSql.Append(" LEFT JOIN ( select d.CUSTOMERNAME,d.BSNO,SUM(CASE WHEN d.CURRENCY='RMB' THEN d.AMOUNT ELSE 0 END) INVRMB , SUM(CASE WHEN d.CURRENCY = 'USD' THEN d.AMOUNT ELSE 0 END) INVUSD");
strSql.Append(",MAX(d.EXCHANGERATE) INVEXCHANGERATE FROM ch_fee_do d WHERE d.CATEGORY = 7 GROUP BY d.BSNO,d.CUSTOMERNAME) INV ON(INV.BSNO= B.BSNO and INV.CUSTOMERNAME=F.CUSTOMERNAME) ");
@ -358,8 +359,8 @@ namespace DSWeb.MvcShipping.Controllers
strSql.Append(" ,B.CUSTOMDATE");
strSql.Append(" ,B.CUSTSERVICE, B.PORTLOAD, B.PORTDISCHARGE,B.DESTINATION, B.CUSTOMNO, B.ACCDATE,B.CARRIER, B.BSSOURCE, B.LANE, B.FORWARDER,B.NETWEIGHT,B.KGS,B.TEU,B.CNTRTOTAL,B.CORPID");
strSql.Append(" ,B.CNTR1,B.CNTR2,B.CNTR3,B.CNTR4,B.CNTR5,B.CNTR6,B.CNTR7,B.CNTR8,B.CNTR9,B.CNTR10,B.OTCNTR,B.TRADETYPE,B.GOODSNAME,B.FEESTATUS,B.PKGS,B.CBM,B.ORDERNO,B.SALECORPID,B.STLDATE,F.CUSTOMERNAME,C.[DESCRIPTION],C.CRMREMARK6 ");
//strSql.Append(" ,B.STLNAME, S.SETTLETIME,INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
strSql.Append(" ,B.STLNAME, INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
strSql.Append(" ,B.STLNAME, S.SETTLETIME,INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
}
@ -441,18 +442,424 @@ namespace DSWeb.MvcShipping.Controllers
paramps_sSQL.DbType = DbType.String;
paramps_sSQL.Direction = ParameterDirection.Input;
paramps_sSQL.Value = strSql.ToString();
dbparams.Add(paramps_sSQL);
dbparams.Add(paramps_sSQL);
T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
var BLCOUNT2 = T_ALL_DA.GetStrSQL("CT", strSqlCount.ToString());
var dbRptResult = PubSysDAL.GetMsSqlPrcDataSet("sMsExesqlQry", dbparams, "Result_Set");
var json = RptHelper.GetRptJsonResult(0, limit, dbRptResult, "Result_Set", true,null,"",Convert.ToInt32(BLCOUNT2));
var json = RptHelper.GetRptJsonResult(0, limit, dbRptResult, "Result_Set", true, null, "", Convert.ToInt32(BLCOUNT2));
return new ContentResult() { Content = json };
}
}
//public ContentResult BsListData(int start, int limit, string condition, string sort, string printstr, string sortstr, string amendstr = "false",string nodaystr="")
//{
// if (Convert.ToString(Session["COMPANYID"]).ToString().Trim() == "" || Convert.ToString(Session["USERID"]).ToString().Trim() == "" || Convert.ToString(Session["CODENAME"]).ToString().Trim() == "" || Convert.ToString(Session["SHOWNAME"]).ToString().Trim() == "" || Convert.ToString(Session["DEPTNAME"]).ToString().Trim() == "")
// {
// var jsonRespose2 = new JsonResponse { Success = false, Message = "登录超时,请退出系统重新登录!" };
// return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
// }
// var strDa = GetRangDAStr("index", Convert.ToString(Session["USERID"]).ToString().Trim(), Convert.ToString(Session["SHOWNAME"]).ToString().Trim(), Convert.ToString(Session["COMPANYID"]).ToString().Trim());
// if (!string.IsNullOrEmpty(strDa))
// {
// if (!string.IsNullOrEmpty(condition))
// {
// condition = condition + " and " + strDa;
// }
// else
// {
// condition = strDa;
// }
// }
// var NORPTFEESTATUS = MsSysParamSetDAL.GetData("PARAMNAME='NORPTFEESTATUS'");
// if (NORPTFEESTATUS.PARAMVALUE == "1") {
// if (!string.IsNullOrEmpty(condition))
// {
// condition = condition + " and F.FEESTATUS<>1 ";
// }
// else
// {
// condition = " F.FEESTATUS<>1 ";
// }
// }
// var PROFITRATEDR = MsSysParamSetDAL.GetData("PARAMNAME='PROFITRATEDR'");
// var NORPTSTLDATETYPE = MsSysParamSetDAL.GetData("PARAMNAME='NORPTSTLDATETYPE'");
// var strSql = new StringBuilder();
// var strSqlCount = new StringBuilder();
// if ((!string.IsNullOrEmpty(printstr)) && (printstr == "true"))
// {
// if (!string.IsNullOrEmpty(nodaystr)) strSql.Append("SELECT * FROM (");
// strSql.Append("SELECT *,dbo.F_FeeStatusStr(DRFEESTATUS) DRFEESTATUSREF,dbo.F_FeeStatusStr(CRFEESTATUS) CRFEESTATUSREF ");
// }
// else {
// strSql.Append(@"SELECT * FROM (SELECT row_number() over (");
// var sortstring = DatasetSort.Getsortstring(sort);
// if (!string.IsNullOrEmpty(sortstring))
// {
// strSql.Append(" order by " + sortstring);
// }
// else
// {
// strSql.Append(" order by CUSTNAME,OPDATE,MBLNO ");
// }
// strSql.Append(@") as num , ");
// strSql.Append(" *,dbo.F_FeeStatusStr(DRFEESTATUS) DRFEESTATUSREF,dbo.F_FeeStatusStr(CRFEESTATUS) CRFEESTATUSREF ");
// }
// strSql.Append(",case OPDATE when '' then 0 else case when BALTTLDR<>0 OR BALTTLCR<>0 then DATEDIFF([day],OPDATE,GETDATE()) ");
// strSql.Append(" else (DATEDIFF([day],OPDATE,OPDATE)) end end AS NODAY");
// strSql.Append(" FROM (");
// if (amendstr == "true")
// {
// strSql.Append("SELECT A.BSNO,'' OPTYPE,A.OPLBNAME, A.BSTYPE,A.CUSTOMERNAME, A.CUSTNO, A.MBLNO,A.HBLNO,A.VESSEL,A.VOYNO, A.INPUTBY, A.CREATETIME, A.BSSTATUS, A.SALE, A.OP,A.DOC,A.YARD,A.BLISSUESTATUS,A.BLTYPE,");
// strSql.Append("case A.ETD when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), A.ETD,23) end as ETD");
// strSql.Append(",case A.ETA when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), A.ETA,23) end as ETA");
// strSql.Append(",CASE WHEN A.CUSTOMERNAME=F.CUSTOMERNAME THEN A.STLNAME ELSE isnull((select top 1 ACCTYPE from Info_Client_ACCDATE WITH (NOLOCK) where LINKGID = (select top 1 GID from info_client WITH (NOLOCK) where shortname =F.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=A.SALE)) and BGNDATE<=A.OPDATE AND ENDDATE>=A.OPDATE),'现结买单') END STLNAME");
// strSql.Append(",case A.OPDATE when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), A.OPDATE,23) end as OPDATE,A.ENTERP,A.DELIVERYDATE");
// strSql.Append(",case A.CUSTOMDATE when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), A.CUSTOMDATE,23) end as CUSTOMDATE");
// strSql.Append(",A.CUSTSERVICE, A.PORTLOAD, A.PORTDISCHARGE,B.DESTINATION, A.CUSTOMNO, A.ACCDATE,A.CARRIER, A.BSSOURCE,A.LANE, A.FORWARDER,A.NETWEIGHT,A.KGS,A.TEU,A.CNTRTOTAL,A.CORPID");
// strSql.Append(",A.CNTR1,A.CNTR2,A.CNTR3,A.CNTR4,A.CNTR5,A.CNTR6,A.CNTR7,A.CNTR8,A.CNTR9,A.CNTR10,A.OTCNTR,A.TRADETYPE,A.GOODSNAME,A.FEESTATUS,A.PKGS,A.CBM,A.ORDERNO,A.SALECORPID,(select [NAME] from [company] where GID=A.SALECORPID) as SALECORP");
// strSql.Append(",(CASE A.FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF ");
// strSql.Append(",F.CUSTOMERNAME AS CUSTNAME ");
// strSql.Append(",C.[DESCRIPTION] AS CUSTFULLNAME,C.CRMREMARK6 ");
// strSql.Append(",isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(AMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS RMBDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(AMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS RMBCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(SETTLEMENT,0) ELSE 0 END) ELSE 0 END),0) AS STLRMBDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS STLRMBCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END) ELSE 0 END),0) AS BALRMBDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END) ELSE 0 END),0) AS BALRMBCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS ORDERRMBDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS ORDERRMBCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS USDDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS USDCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS STLUSDDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS STLUSDCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS BALUSDDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS BALUSDCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS ORDERUSDDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS ORDERUSDCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT,0) END) END)ELSE 0 END),0) AS OTDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT,0) END) END)ELSE 0 END),0) AS OTCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(SETTLEMENT,0) END) END)ELSE 0 END),0) AS STLOTDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(SETTLEMENT,0) END) END)ELSE 0 END),0) AS STLOTCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT-SETTLEMENT,0) END) END) ELSE 0 END),0) AS BALOTDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT-SETTLEMENT,0) END) END) ELSE 0 END),0) AS BALOTCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(ORDERAMOUNT,0) END) END)ELSE 0 END),0) AS ORDEROTDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(ORDERAMOUNT,0) END) END)ELSE 0 END),0) AS ORDEROTCR,");
// strSql.Append("INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE,");
// strSql.Append("isnull(SUM(CASE WHEN CURRENCY<>'USD' AND CURRENCY<>'RMB' THEN ISNULL(INVOICE,0) ELSE 0 END),0) AS INVOT,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(AMOUNT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS TTLDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(AMOUNT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS TTLCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(SETTLEMENT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS STLTTLDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(SETTLEMENT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS STLTTLCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(AMOUNT-SETTLEMENT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS BALTTLDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(AMOUNT-SETTLEMENT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS BALTTLCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(ORDERAMOUNT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS ORDERTTLDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(ORDERAMOUNT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS ORDERTTLCR");
// //strSql.Append(",case when isnull(SUM(F.AMOUNT),0)<>isnull(SUM(F.SETTLEMENT),0) then (case A.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],A.OPDATE, GETDATE()) end) ");
// //strSql.Append(" else (case A.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],A.OPDATE, S.SETTLETIME) end) end AS ACTUALDAY,S.SETTLETIME");
// //if (NORPTSTLDATETYPE.PARAMVALUE == "1")
// //{
// // strSql.Append(",[dbo].[GetCustStlDay](A.OPDATE,F.CUSTOMERNAME,A.SALE) AS STLDATE");
// // strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE WITH (NOLOCK) where LINKGID = (select top 1 GID from info_client WITH (NOLOCK) where shortname =F.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
// //}
// //else {
// // strSql.Append(",CASE WHEN A.STLDATE IS NULL THEN A.OPDATE ELSE A.STLDATE END STLDATE");
// // strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE WITH (NOLOCK) where LINKGID = (select top 1 GID from info_client WITH (NOLOCK) where shortname =A.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
// //}
// if (PROFITRATEDR.PARAMVALUE != "1")
// {
// strSql.Append(", (CASE WHEN (SUM(G.TTLDR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLDR)) * 100, 10, 2))) END) AS PROFITRATE");
// }
// else
// strSql.Append(", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE");
// //strSql.Append(",case B.OPDATE when '1900-01-01 00:00:00.000' then 0 else case when isnull(SUM(F.AMOUNT),0)<>isnull(SUM(F.SETTLEMENT),0) then DATEDIFF([day],B.OPDATE,(CASE C.STLNAME WHEN '月结' THEN ");
// //strSql.Append("DATEADD(month,1,DATEADD(day,ISNULL(CAST(C.STLDATE AS INT),1),DATEADD(day,-Day(B.OPDATE)+1,B.OPDATE)))");
// //strSql.Append("WHEN '半月结' THEN (CASE WHEN DATEPART(DAY, GETDATE())<=15 THEN DATEADD(day,ISNULL(CAST(C.STLFIRSTHALFDATE AS INT),16),DATEADD(Day,-Day(B.OPDATE)+1,B.OPDATE))");
// //strSql.Append("ELSE DATEADD(MONTH,1,DATEADD(day,ISNULL(CAST(C.STLMIDDLEDATE AS INT),1),DATEADD(Day,-Day(B.OPDATE)+1,B.OPDATE))) END)");
// //strSql.Append("ELSE GETDATE() END)) else (DATEDIFF([day],B.OPDATE, S.SETTLETIME)) end end AS NODAY");
// strSql.Append(",dbo.F_GetBillDrFeeStatus(A.BSNO) DRFEESTATUS");
// strSql.Append(",dbo.F_GetBillCrFeeStatus(A.BSNO) CRFEESTATUS");
// strSql.Append(" FROM CH_FEE F ");
// strSql.Append(" INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) ");
// strSql.Append(" INNER JOIN V_OP_BS A ON (A.BSNO=B.PARENTID) ");
// strSql.Append("LEFT JOIN v_op_gain_sum G ON (G.BSNO=A.BSNO) ");
// strSql.Append(" INNER JOIN info_client C WITH (NOLOCK) ON (C.SHORTNAME=F.CUSTOMERNAME) ");
// strSql.Append(" LEFT JOIN V_MAX_SETTLEMENTTIME S ON (S.CUSTOMERNAME=F.CUSTOMERNAME AND S.BSNO=B.BSNO) ");
// strSql.Append(" LEFT JOIN ( select d.CUSTOMERNAME,d.BSNO,SUM(CASE WHEN d.CURRENCY='RMB' THEN d.AMOUNT ELSE 0 END) INVRMB , SUM(CASE WHEN d.CURRENCY = 'USD' THEN d.AMOUNT ELSE 0 END) INVUSD");
// strSql.Append(",MAX(d.EXCHANGERATE) INVEXCHANGERATE FROM ch_fee_do d WHERE d.CATEGORY = 7 GROUP BY d.BSNO,d.CUSTOMERNAME) INV ON(INV.BSNO= B.BSNO and INV.CUSTOMERNAME=F.CUSTOMERNAME) ");
// if (!string.IsNullOrEmpty(condition))
// {
// strSql.Append(" Where " + condition);
// }
// strSql.Append(" GROUP BY A.BSNO,A.OPLBNAME, A.BSTYPE,A.CUSTOMERNAME, A.CUSTNO, A.MBLNO,A.HBLNO,A.VESSEL, A.VOYNO, A.INPUTBY, A.CREATETIME, A.BSSTATUS, A.SALE, A.OP, A.DOC,A.YARD,A.BLISSUESTATUS,A.BLTYPE,");
// strSql.Append(" A.ETD,A.ETA");
// strSql.Append(" ,A.OPDATE,A.ENTERP,A.DELIVERYDATE");
// strSql.Append(" ,A.CUSTOMDATE");
// strSql.Append(" ,A.CUSTSERVICE, A.PORTLOAD, A.PORTDISCHARGE,B.DESTINATION, A.CUSTOMNO, A.ACCDATE,A.CARRIER, A.BSSOURCE, A.LANE, A.FORWARDER,A.NETWEIGHT,A.KGS,A.TEU,A.CNTRTOTAL,A.CORPID");
// strSql.Append(" ,A.CNTR1,A.CNTR2,A.CNTR3,A.CNTR4,A.CNTR5,A.CNTR6,A.CNTR7,A.CNTR8,A.CNTR9,A.CNTR10,A.OTCNTR,A.TRADETYPE,A.GOODSNAME,A.FEESTATUS,A.PKGS,A.CBM,A.ORDERNO,A.SALECORPID,A.STLDATE,F.CUSTOMERNAME,C.[DESCRIPTION],C.CRMREMARK6 ");
// //strSql.Append(" ,A.STLNAME, S.SETTLETIME,B.SALE,B.OPDATE,INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
// strSql.Append(" ,A.STLNAME, B.SALE,B.OPDATE,INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
// }
// else {
// strSql.Append("SELECT B.BSNO,B.OPTYPE, B.OPLBNAME, B.BSTYPE,B.CUSTOMERNAME, B.CUSTNO, B.MBLNO, B.HBLNO,B.VESSEL, B.VOYNO, B.INPUTBY, B.CREATETIME, B.BSSTATUS, B.SALE, B.OP, B.DOC,B.YARD,B.BLISSUESTATUS,B.BLTYPE,");
// strSql.Append("case B.ETD when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), B.ETD,23) end as ETD");
// strSql.Append(",case B.ETA when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), B.ETA,23) end as ETA");
// strSql.Append(",CASE WHEN B.CUSTOMERNAME=F.CUSTOMERNAME THEN B.STLNAME ELSE isnull((select top 1 ACCTYPE from Info_Client_ACCDATE where LINKGID = (select top 1 GID from info_client where shortname =F.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),'现结买单') END STLNAME");
// strSql.Append(",case B.OPDATE when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), B.OPDATE,23) end as OPDATE,B.ENTERP,B.DELIVERYDATE");
// strSql.Append(",case B.CUSTOMDATE when '1900-01-01 00:00:00.000' then '' else CONVERT(varchar(100), B.CUSTOMDATE,23) end as CUSTOMDATE");
// strSql.Append(",B.CUSTSERVICE, B.PORTLOAD, B.PORTDISCHARGE,B.DESTINATION, B.CUSTOMNO, B.ACCDATE,B.CARRIER, B.BSSOURCE, B.LANE, B.FORWARDER,B.NETWEIGHT,B.KGS,B.TEU,B.CNTRTOTAL,B.CORPID");
// strSql.Append(",B.CNTR1,B.CNTR2,B.CNTR3,B.CNTR4,B.CNTR5,B.CNTR6,B.CNTR7,B.CNTR8,B.CNTR9,B.CNTR10,B.OTCNTR,B.TRADETYPE,B.GOODSNAME,B.FEESTATUS,B.PKGS,B.CBM,B.ORDERNO,B.SALECORPID,(select [NAME] from [company] where GID=B.SALECORPID) as SALECORP");
// strSql.Append(",(CASE B.FEESTATUS WHEN 1 THEN '锁定' else '未锁定' end) as FEESTATUSREF ");
// strSql.Append(",F.CUSTOMERNAME AS CUSTNAME ");
// strSql.Append(",C.[DESCRIPTION] AS CUSTFULLNAME,C.CRMREMARK6 ");
// strSql.Append(",isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(AMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS RMBDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(AMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS RMBCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(SETTLEMENT,0) ELSE 0 END) ELSE 0 END),0) AS STLRMBDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS STLRMBCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END) ELSE 0 END),0) AS BALRMBDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END) ELSE 0 END),0) AS BALRMBCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS ORDERRMBDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'RMB' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END) ELSE 0 END),0) AS ORDERRMBCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS USDDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS USDCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS STLUSDDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS STLUSDCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS BALUSDDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(AMOUNT-SETTLEMENT,0) ELSE 0 END)ELSE 0 END),0) AS BALUSDCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS ORDERUSDDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN ISNULL(ORDERAMOUNT,0) ELSE 0 END)ELSE 0 END),0) AS ORDERUSDCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT,0) END) END)ELSE 0 END),0) AS OTDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT,0) END) END)ELSE 0 END),0) AS OTCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(SETTLEMENT,0) END) END)ELSE 0 END),0) AS STLOTDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(SETTLEMENT,0) END) END)ELSE 0 END),0) AS STLOTCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT-SETTLEMENT,0) END) END) ELSE 0 END),0) AS BALOTDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(AMOUNT-SETTLEMENT,0) END) END) ELSE 0 END),0) AS BALOTCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(ORDERAMOUNT,0) END) END)ELSE 0 END),0) AS ORDEROTDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN (CASE CURRENCY WHEN 'USD' THEN 0 ELSE (CASE CURRENCY WHEN 'RMB' THEN 0 ELSE ISNULL(ORDERAMOUNT,0) END) END)ELSE 0 END),0) AS ORDEROTCR,");
// strSql.Append("INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE,");
// strSql.Append("isnull(SUM(CASE WHEN CURRENCY<>'USD' AND CURRENCY<>'RMB' THEN ISNULL(INVOICE,0) ELSE 0 END),0) AS INVOT,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(AMOUNT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS TTLDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(AMOUNT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS TTLCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(SETTLEMENT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS STLTTLDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(SETTLEMENT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS STLTTLCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(AMOUNT-SETTLEMENT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS BALTTLDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(AMOUNT-SETTLEMENT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS BALTTLCR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 1 THEN cast(round(ISNULL(ORDERAMOUNT,0) * ISNULL(EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS ORDERTTLDR,");
// strSql.Append("isnull(SUM(CASE FEETYPE WHEN 2 THEN cast(round(ISNULL(ORDERAMOUNT,0) *ISNULL( EXCHANGERATE,0),2) as numeric(20,2)) ELSE 0 END),0) AS ORDERTTLCR");
// //strSql.Append(",case when isnull(SUM(F.AMOUNT),0)<>isnull(SUM(F.SETTLEMENT),0) then (case B.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],B.OPDATE, GETDATE()) end) ");
// //strSql.Append(" else (case B.OPDATE when '1900-01-01 00:00:00.000' then 0 else DATEDIFF([day],B.OPDATE, S.SETTLETIME) end) end AS ACTUALDAY,S.SETTLETIME");
// //if (NORPTSTLDATETYPE.PARAMVALUE == "1")
// //{
// // strSql.Append(",[dbo].[GetCustStlDay](B.OPDATE,F.CUSTOMERNAME,B.SALE) AS STLDATE");
// // strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE where LINKGID = (select top 1 GID from info_client where shortname =F.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
// //}
// //else
// //{
// // strSql.Append(",CASE WHEN B.STLDATE IS NULL THEN B.OPDATE ELSE B.STLDATE END STLDATE");
// // strSql.Append(",isnull((select top 1 case ACCTYPE WHEN '月结' then accmonth*30 + accdays WHEN '季结' then accmonth*90 + accdays else accdays end from Info_Client_ACCDATE where LINKGID = (select top 1 GID from info_client where shortname =B.CUSTOMERNAME ) AND ((ISNULL(SALE,'')='') or (ISNULL(SALE,'')=B.SALE)) and BGNDATE<=B.OPDATE AND ENDDATE>=B.OPDATE),0) CONTRACTDAY ");
// //}
// if (PROFITRATEDR.PARAMVALUE != "1")
// {
// strSql.Append(", (CASE WHEN (SUM(G.TTLDR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLDR)) * 100, 10, 2))) END) AS PROFITRATE");
// }
// else
// strSql.Append(", (CASE WHEN (SUM(G.TTLCR))= 0 THEN 0 ELSE CONVERT(NUMERIC(18,2),ltrim(str((SUM(G.TTLDR-G.TTLCR)) / (SUM(G.TTLCR)) * 100, 10, 2))) END) AS PROFITRATE");
// strSql.Append(",case B.OPDATE when '1900-01-01 00:00:00.000' then 0 else case when isnull(SUM(F.AMOUNT),0)<>isnull(SUM(F.SETTLEMENT),0) then DATEDIFF([day],B.OPDATE,(CASE C.STLNAME WHEN '月结' THEN ");
// strSql.Append("DATEADD(month,1,DATEADD(day,ISNULL(CAST(C.STLDATE AS INT),1),DATEADD(day,-Day(B.OPDATE)+1,B.OPDATE)))");
// strSql.Append("WHEN '半月结' THEN (CASE WHEN DATEPART(DAY, GETDATE())<=15 THEN DATEADD(day,ISNULL(CAST(C.STLFIRSTHALFDATE AS INT),16),DATEADD(Day,-Day(B.OPDATE)+1,B.OPDATE))");
// strSql.Append("ELSE DATEADD(MONTH,1,DATEADD(day,ISNULL(CAST(C.STLMIDDLEDATE AS INT),1),DATEADD(Day,-Day(B.OPDATE)+1,B.OPDATE))) END)");
// strSql.Append("ELSE GETDATE() END)) else (DATEDIFF([day],B.OPDATE, S.SETTLETIME)) end end AS NODAY");
// //var FEEDEBITINVISMUST = MsSysParamSetDAL.GetData("PARAMNAME='RPTNOINVOICENO'");
// //if (FEEDEBITINVISMUST.PARAMVALUE == "1")
// //{
// // if (condition.IndexOf("F.FEETYPE=1") >= 0)
// // {
// // // strSql.Append(",INVOICENO = stuff ((SELECT distinct INVOICENUM+',' FROM CH_FEE AS t WHERE ISNULL(t.INVOICENUM,'')<>'' AND t .BSNO = B.BSNO and t.CUSTOMERNAME=f.CUSTOMERNAME FOR xml path('')), 1, 0, '') ");
// // strSql.Append(",INVOICENO = stuff ((SELECT distinct i.INVOICENO+',' FROM CH_FEE_DO AS t left join ch_fee_invoice i on (i.BILLNO=t.BILLNO) WHERE t.CATEGORY=7 and t .BSNO = B.BSNO and i.CUSTOMERNAME=f.CUSTOMERNAME FOR xml path('')), 1, 0, '') ");
// // }
// // else
// // {
// // strSql.Append(",INVOICENO = stuff ((SELECT distinct BILLNO+',' FROM CH_FEE_DO AS t WHERE t.CATEGORY=4 and t .BSNO = B.BSNO and t.CUSTOMERNAME=f.CUSTOMERNAME FOR xml path('')), 1, 0, '') ");
// // }
// //}
// //else
// strSql.Append(",'' INVOICENO");
// strSql.Append(",dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS");
// strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS");
// //strSql.Append(",'' DRFEESTATUS");
// //strSql.Append(",'' CRFEESTATUS");
// strSql.Append(" FROM CH_FEE F ");
// strSql.Append(" INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) ");
// strSql.Append("INNER JOIN v_op_gain_sum G ON (G.BSNO=B.BSNO) ");
// strSql.Append(" INNER JOIN info_client C WITH (NOLOCK) ON (C.SHORTNAME=F.CUSTOMERNAME) ");
// strSql.Append(" LEFT JOIN V_MAX_SETTLEMENTTIME S ON (S.CUSTOMERNAME=F.CUSTOMERNAME AND S.BSNO=B.BSNO) ");
// strSql.Append(" LEFT JOIN ( select d.CUSTOMERNAME,d.BSNO,SUM(CASE WHEN d.CURRENCY='RMB' THEN d.AMOUNT ELSE 0 END) INVRMB , SUM(CASE WHEN d.CURRENCY = 'USD' THEN d.AMOUNT ELSE 0 END) INVUSD");
// strSql.Append(",MAX(d.EXCHANGERATE) INVEXCHANGERATE FROM ch_fee_do d WHERE d.CATEGORY = 7 GROUP BY d.BSNO,d.CUSTOMERNAME) INV ON(INV.BSNO= B.BSNO and INV.CUSTOMERNAME=F.CUSTOMERNAME) ");
// if (!string.IsNullOrEmpty(condition))
// {
// strSql.Append(" Where " + condition);
// }
// strSql.Append(" GROUP BY B.BSNO,B.OPTYPE,B.OPLBNAME, B.BSTYPE,B.CUSTOMERNAME, B.CUSTNO, B.MBLNO, B.HBLNO,B.VESSEL, B.VOYNO, B.INPUTBY, B.CREATETIME, B.BSSTATUS, B.SALE, B.OP, B.DOC,B.YARD,B.BLISSUESTATUS,B.BLTYPE,");
// strSql.Append(" B.ETD,B.ETA");
// strSql.Append(" ,B.OPDATE,B.ENTERP,B.DELIVERYDATE");
// strSql.Append(" ,B.CUSTOMDATE");
// strSql.Append(" ,B.CUSTSERVICE, B.PORTLOAD, B.PORTDISCHARGE,B.DESTINATION, B.CUSTOMNO, B.ACCDATE,B.CARRIER, B.BSSOURCE, B.LANE, B.FORWARDER,B.NETWEIGHT,B.KGS,B.TEU,B.CNTRTOTAL,B.CORPID");
// strSql.Append(" ,B.CNTR1,B.CNTR2,B.CNTR3,B.CNTR4,B.CNTR5,B.CNTR6,B.CNTR7,B.CNTR8,B.CNTR9,B.CNTR10,B.OTCNTR,B.TRADETYPE,B.GOODSNAME,B.FEESTATUS,B.PKGS,B.CBM,B.ORDERNO,B.SALECORPID,B.STLDATE,F.CUSTOMERNAME,C.[DESCRIPTION],C.CRMREMARK6 ");
// strSql.Append(" ,B.STLNAME, S.SETTLETIME,INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
// //strSql.Append(" ,B.STLNAME, INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
// }
// strSql.Append(") AS T ");
// if ((!string.IsNullOrEmpty(printstr)) && (printstr == "true"))
// {
// if (!string.IsNullOrEmpty(nodaystr))
// {
// strSql.Append(" ) AS Y WHERE " + nodaystr);
// }
// if (!string.IsNullOrEmpty(sortstr))
// {
// strSql.Append(" order by " + sortstr);
// }
// else
// {
// strSql.Append(" order by CUSTNAME,OPDATE,MBLNO ");
// //if (amendstr == "true")
// // strSql.Append(" order by F.CUSTOMERNAME,A.OPDATE,B.MBLNO ");
// //else strSql.Append(" order by F.CUSTOMERNAME,B.OPDATE,B.MBLNO ");
// }
// var jsonRespose = new JsonResponse
// {
// Success = true,
// Message = condition,
// Data = strSql.ToString()
// };
// return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
// }
// else
// {
// if (!string.IsNullOrEmpty(nodaystr))
// {
// strSql.Append(" ) AS Y WHERE " + nodaystr);
// }
// //var sortstring = DatasetSort.Getsortstring(sort);
// //if (!string.IsNullOrEmpty(sortstring))
// //{
// // strSql.Append(" order by " + sortstring);
// //}
// //else
// //{
// // strSql.Append(" order by CUSTNAME,OPDATE,MBLNO ");
// //}
// strSql.Append(@")as t ");
// strSql.Append(string.Format("where t.num>{0} and t.num<={1} order by t.num ", start, start + limit)); //
// strSqlCount.Append(" SELECT COUNT(1) CT FROM (");
// strSqlCount.Append(" SELECT B.BSNO,F.CUSTOMERNAME");
// strSqlCount.Append(" FROM CH_FEE F ");
// strSqlCount.Append(" INNER JOIN V_OP_BILL B ON (F.BSNO=B.BSNO) ");
// if (!string.IsNullOrEmpty(condition))
// {
// strSqlCount.Append(" Where " + condition);
// }
// strSqlCount.Append(" GROUP BY B.BSNO,F.CUSTOMERNAME) AS V ");
// var dbparams = new List<CustomDbParamter>();
// var paramps_sSQL = new CustomDbParamter();
// paramps_sSQL.ParameterName = "@sSQL";
// paramps_sSQL.DbType = DbType.String;
// paramps_sSQL.Direction = ParameterDirection.Input;
// paramps_sSQL.Value = strSql.ToString();
// dbparams.Add(paramps_sSQL);
// T_ALL_DA T_ALL_DA = new EntityDA.T_ALL_DA();
// var BLCOUNT2 = T_ALL_DA.GetStrSQL("CT", strSqlCount.ToString());
// var dbRptResult = PubSysDAL.GetMsSqlPrcDataSet("sMsExesqlQry", dbparams, "Result_Set");
// var json = RptHelper.GetRptJsonResult(0, limit, dbRptResult, "Result_Set", true,null,"",Convert.ToInt32(BLCOUNT2));
// return new ContentResult() { Content = json };
// }
//}
public ContentResult GetSqlStr(string condition)
{

@ -712,6 +712,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
static public int DeleteFee(string tempGId)
{
int iResult = 0;

@ -41,6 +41,7 @@ Ext.extend(Shipping.MsCodeFeeSetListEdit, Ext.Panel, {
this.StoreDefaultUnit.add({ 'value': '个', 'text': '个' });
this.StoreDefaultUnit.add({ 'value': '小时', 'text': '小时' });
this.StoreDefaultUnit.add({ 'value': '20TK', 'text': '20TK' });
this.StoreDefaultUnit.add({ 'value': '台', 'text': '台' });
this.comboxDefaultUnit = Ext.create('DsExt.ux.RefTableCombox', {
fieldLabel: Zi.LAN.DEFAULTUNIT, //'默认计费标准',

@ -1173,10 +1173,6 @@ Ext.extend(Shipping.MsOpSeaeIndex, Ext.Panel, {
header: Zi.LAN.ENTERP, //'货物标识',
width: 70
}, {
dataIndex: 'DELIVERYDATE',
header: Zi.LAN.DELIVERYDATE, //'货物标识',
width: 70
}, {
dataIndex: 'ISCANCEL',
header: '退舱', //'退舱',
width: 60,

@ -4,7 +4,7 @@
<ProjectView>ShowAllFiles</ProjectView>
<NameOfLastUsedPublishProfile>D:\DONGSHENG7\D7HENGCHENG\DSWeb\Properties\PublishProfiles\配置文件1.pubxml</NameOfLastUsedPublishProfile>
<UseIISExpress>true</UseIISExpress>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<Use64BitIISExpress />
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />

@ -9,9 +9,9 @@
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>D:\DONGSHENGWEBHC2</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<publishUrl>D:\DS7发布\DONGSHENGWEBHC</publishUrl>
<DeleteExistingFiles>true</DeleteExistingFiles>
</PropertyGroup>
</Project>

@ -6,8 +6,8 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TimeStampOfAssociatedLegacyPublishXmlFile>2018-03-02T16:59:08.8750562+08:00</TimeStampOfAssociatedLegacyPublishXmlFile>
<_PublishTargetUrl>D:\DONGSHENGWEBHC2</_PublishTargetUrl>
<History>False|2024-04-29T09:52:38.5503406Z;False|2024-04-29T17:26:13.0332784+08:00;False|2024-04-29T17:24:27.2283158+08:00;False|2024-04-29T17:21:02.7760525+08:00;False|2024-04-29T17:15:23.0790860+08:00;False|2024-04-29T17:13:16.3908539+08:00;False|2024-04-29T17:10:51.6254597+08:00;False|2024-04-29T17:09:35.0339596+08:00;</History>
<_PublishTargetUrl>D:\DS7发布\DONGSHENGWEBHC</_PublishTargetUrl>
<History>True|2024-07-04T06:05:54.8854677Z;True|2024-07-01T10:41:18.2261097+08:00;True|2024-07-01T07:32:26.2448777+08:00;True|2024-06-28T14:53:31.5250758+08:00;True|2024-06-28T11:24:52.3384934+08:00;True|2024-06-21T10:38:56.6985088+08:00;False|2024-04-29T17:52:38.5503406+08:00;False|2024-04-29T17:26:13.0332784+08:00;False|2024-04-29T17:24:27.2283158+08:00;False|2024-04-29T17:21:02.7760525+08:00;False|2024-04-29T17:15:23.0790860+08:00;False|2024-04-29T17:13:16.3908539+08:00;False|2024-04-29T17:10:51.6254597+08:00;False|2024-04-29T17:09:35.0339596+08:00;</History>
<LastFailureDetails />
</PropertyGroup>
<ItemGroup>
@ -402,7 +402,7 @@
<publishTime>04/18/2022 10:10:31</publishTime>
</File>
<File Include="Areas/Account/Viewsjs/Chfee_Audit/Chfee_AuditBL.js">
<publishTime>04/10/2024 10:52:47</publishTime>
<publishTime>06/20/2024 14:13:34</publishTime>
</File>
<File Include="Areas/Account/Viewsjs/Chfee_Audit/Chfee_AuditLR.js">
<publishTime>03/16/2021 14:28:12</publishTime>
@ -5754,7 +5754,7 @@
<publishTime>09/23/2022 08:56:03</publishTime>
</File>
<File Include="Areas/MvcContainer/Viewsjs/MsOpCtnApply/MsOpCtnApplySaleEdit.js">
<publishTime>09/12/2023 14:38:09</publishTime>
<publishTime>05/30/2024 10:03:22</publishTime>
</File>
<File Include="Areas/MvcContainer/Viewsjs/MsOpCtnApply/MsOpCtnApplySaleIndex.js">
<publishTime>01/10/2024 11:24:31</publishTime>
@ -5817,7 +5817,7 @@
<publishTime>02/07/2024 10:32:58</publishTime>
</File>
<File Include="Areas/MvcContainer/Viewsjs/MsOpCtnBsCard/MsOpCtnBsCardFeeIndex2.js">
<publishTime>03/22/2024 15:34:27</publishTime>
<publishTime>06/21/2024 10:35:58</publishTime>
</File>
<File Include="Areas/MvcContainer/Viewsjs/MsOpCtnBsCard/MsOpCtnBsCardFeeSumIndex.js">
<publishTime>12/26/2023 16:34:26</publishTime>
@ -5844,7 +5844,7 @@
<publishTime>02/20/2024 10:33:35</publishTime>
</File>
<File Include="Areas/MvcContainer/Viewsjs/MsOpCtnBsCard/MsOpCtnInsuranceEdit.js">
<publishTime>04/10/2024 13:46:38</publishTime>
<publishTime>06/21/2024 10:10:04</publishTime>
</File>
<File Include="Areas/MvcContainer/Viewsjs/MsOpCtnBsCard/MsOpCtnInsuranceIndex.js">
<publishTime>03/14/2024 09:35:05</publishTime>
@ -8358,7 +8358,7 @@
<publishTime>03/01/2018 17:06:33</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsCodeFeeSetList/MsCodeFeeSetListEdit.js">
<publishTime>06/08/2021 16:39:21</publishTime>
<publishTime>05/28/2024 11:37:24</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsCodeFeeSetList/MsCodeFeeSetListIndex.js">
<publishTime>05/18/2020 15:11:46</publishTime>
@ -10257,7 +10257,7 @@
<publishTime>06/14/2018 09:45:27</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEdit.js">
<publishTime>03/26/2024 16:34:40</publishTime>
<publishTime>05/09/2024 08:04:34</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeEditView.js">
<publishTime>01/04/2024 13:51:25</publishTime>
@ -10275,7 +10275,7 @@
<publishTime>06/04/2020 14:31:29</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeIndex.js">
<publishTime>10/13/2023 09:39:42</publishTime>
<publishTime>06/07/2024 15:07:44</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsOpSeae/MsOpSeaeModel.js">
<publishTime>01/05/2024 08:36:04</publishTime>
@ -10818,7 +10818,7 @@
<publishTime>12/30/2020 11:03:47</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsRptNoTotal/MsRptNoTotalIndex.js">
<publishTime>11/14/2023 17:14:06</publishTime>
<publishTime>05/09/2024 09:50:48</publishTime>
</File>
<File Include="Areas/MvcShipping/Viewsjs/MsRptNoTotalMonth/MsRptNoTotalMonthIndex.js">
<publishTime>05/20/2020 15:01:30</publishTime>
@ -15318,19 +15318,19 @@
<publishTime>03/01/2018 17:08:26</publishTime>
</File>
<File Include="bin/DSWeb.dll">
<publishTime>04/29/2024 17:55:43</publishTime>
<publishTime>07/04/2024 14:13:53</publishTime>
</File>
<File Include="bin/DSWeb.pdb">
<publishTime>04/29/2024 17:55:43</publishTime>
<publishTime>07/04/2024 14:13:53</publishTime>
</File>
<File Include="bin/DSWeb.XmlSerializers.dll">
<publishTime>04/29/2024 17:55:44</publishTime>
<publishTime>07/04/2024 14:13:54</publishTime>
</File>
<File Include="bin/DSWebComponent.dll">
<publishTime>04/29/2024 17:09:15</publishTime>
<publishTime>06/21/2024 10:37:39</publishTime>
</File>
<File Include="bin/DSWebComponent.pdb">
<publishTime>04/29/2024 17:09:15</publishTime>
<publishTime>06/21/2024 10:37:39</publishTime>
</File>
<File Include="bin/EntityFramework.dll">
<publishTime>10/23/2017 13:15:18</publishTime>
@ -15357,10 +15357,10 @@
<publishTime>05/17/2018 14:25:17</publishTime>
</File>
<File Include="bin/HcDBUtility.dll">
<publishTime>04/29/2024 17:09:15</publishTime>
<publishTime>06/21/2024 10:37:39</publishTime>
</File>
<File Include="bin/HcDBUtility.pdb">
<publishTime>04/29/2024 17:09:15</publishTime>
<publishTime>06/21/2024 10:37:39</publishTime>
</File>
<File Include="bin/HtmlTextBoxControl.dll">
<publishTime>03/01/2018 17:08:26</publishTime>
@ -15465,10 +15465,10 @@
<publishTime>03/10/2017 15:05:10</publishTime>
</File>
<File Include="bin/JsonHelper.dll">
<publishTime>04/29/2024 17:09:14</publishTime>
<publishTime>06/21/2024 10:37:39</publishTime>
</File>
<File Include="bin/JsonHelper.pdb">
<publishTime>04/29/2024 17:09:14</publishTime>
<publishTime>06/21/2024 10:37:39</publishTime>
</File>
<File Include="bin/junit.dll">
<publishTime>03/10/2017 15:05:10</publishTime>
@ -15495,7 +15495,7 @@
<publishTime>05/30/2019 17:57:06</publishTime>
</File>
<File Include="bin/Microsoft.mshtml.dll">
<publishTime>04/13/2024 15:54:27</publishTime>
<publishTime>05/15/2024 13:35:06</publishTime>
</File>
<File Include="bin/Microsoft.Owin.dll">
<publishTime>05/30/2019 17:57:06</publishTime>
@ -15549,10 +15549,10 @@
<publishTime>10/29/2019 16:00:07</publishTime>
</File>
<File Include="bin/OfficeHelper.dll">
<publishTime>04/29/2024 17:09:14</publishTime>
<publishTime>06/21/2024 10:37:39</publishTime>
</File>
<File Include="bin/OfficeHelper.pdb">
<publishTime>04/29/2024 17:09:14</publishTime>
<publishTime>06/21/2024 10:37:39</publishTime>
</File>
<File Include="bin/Owin.dll">
<publishTime>05/30/2019 17:57:06</publishTime>
@ -15606,10 +15606,10 @@
<publishTime>03/01/2018 17:08:26</publishTime>
</File>
<File Include="bin/WebSqlHelper.dll">
<publishTime>04/29/2024 17:09:15</publishTime>
<publishTime>06/21/2024 10:37:39</publishTime>
</File>
<File Include="bin/WebSqlHelper.pdb">
<publishTime>04/29/2024 17:09:15</publishTime>
<publishTime>06/21/2024 10:37:39</publishTime>
</File>
<File Include="bin/zh-CN/ChnCharInfo.resources.dll">
<publishTime>02/22/2023 13:31:10</publishTime>
@ -26523,7 +26523,7 @@
<publishTime>05/28/2020 13:54:15</publishTime>
</File>
<File Include="Web.config">
<publishTime>03/27/2024 11:54:40</publishTime>
<publishTime>06/20/2024 10:37:31</publishTime>
</File>
<File Include="WebSearchEngine/SearchEngineAdapter.aspx">
<publishTime>03/01/2018 17:05:43</publishTime>

Loading…
Cancel
Save