hanxuntao 6 months ago
parent bd49eb5501
commit f162e8bc98

@ -175,20 +175,20 @@ 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,8 +227,8 @@ 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, 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 {
@ -279,21 +279,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")
{
@ -332,14 +332,17 @@ namespace DSWeb.MvcShipping.Controllers
strSql.Append(",'' INVOICENO");
strSql.Append(",dbo.F_GetBillDrFeeStatus(B.BSNO) DRFEESTATUS");
strSql.Append(",dbo.F_GetBillCrFeeStatus(B.BSNO) CRFEESTATUS");
//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 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) ");
@ -355,8 +358,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, S.SETTLETIME,INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
strSql.Append(" ,B.STLNAME, INV.INVRMB,INV.INVUSD,INV.INVEXCHANGERATE");
}

@ -478,53 +478,65 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
displayField: 'SHOWNAME'
});
this.storeListMailProject = Ext.create('Ext.data.Store', {
fields: [
{ name: 'GID', type: 'string' },
{ name: 'CUSTNAME', type: 'string' },
{ name: 'PROJECTNAME', type: 'string' },
{ name: 'ISDEF', type: 'bool' },
{ name: 'ISDEFREF', type: 'string' },
{ name: 'INPUTBY', type: 'string' },
{ name: 'INPUTBYREF', type: 'string' },
{ name: 'INPUTTIME', type: 'string' },
{ name: 'REMARK', type: 'string' }
],
pageSize: 5000,
remoteSort: true,
proxy: {
type: 'ajax',
url: '/MvcShipping/MsInfoClientMailProject/GetDataList',
reader: {
id: '',
root: 'data',
totalProperty: 'totalCount'
}
}
});
//this.storeListMailProject = Ext.create('Ext.data.Store', {
// fields: [
// { name: 'GID', type: 'string' },
// { name: 'CUSTNAME', type: 'string' },
// { name: 'PROJECTNAME', type: 'string' },
// { name: 'ISDEF', type: 'bool' },
// { name: 'ISDEFREF', type: 'string' },
// { name: 'INPUTBY', type: 'string' },
// { name: 'INPUTBYREF', type: 'string' },
// { name: 'INPUTTIME', type: 'string' },
// { name: 'REMARK', type: 'string' }
// ],
// pageSize: 5000,
// remoteSort: true,
// proxy: {
// type: 'ajax',
// url: '/MvcShipping/MsInfoClientMailProject/GetDataList',
// reader: {
// id: '',
// root: 'data',
// totalProperty: 'totalCount'
// }
// }
//});
//this.comboxMailProject = Ext.create('DsExt.ux.RefTableCombox', {
// store: this.storeListMailProject,
// // forceSelection: true,
// fieldLabel: Zi.LAN.MAILPROJECT, //'费用类型',
// valueField: 'GID',
// name: 'MAILPROJECT',
// displayField: 'PROJECTNAME',
// listeners: {
// scope: this,
// 'focus': function (combo, records, eOpts) {
// var custname = this.formHead.getForm().findField('CUSTOMERNAME').getValue();
// if (custname != '') {
// var sql = " CUSTNAME='" + custname + "'";
// this.storeListMailProject.load({
// params: { start: 0, limit: 5000, sort: '', condition: sql },
// waitMsg: "正在查询数据...",
// scope: this
// });
// }
// }
// }
//});
this.storeListMailProject = Ext.create('DsExt.ux.RefEnumStore', {});
this.storeListMailProject.load({ params: { enumTypeId: 97065 } });
this.comboxMailProject = Ext.create('DsExt.ux.RefTableCombox', {
store: this.storeListMailProject,
// forceSelection: true,
fieldLabel: Zi.LAN.MAILPROJECT, //'费用类型',
valueField: 'GID',
fieldLabel: '运费模式',
allowBlank: true,
name: 'MAILPROJECT',
displayField: 'PROJECTNAME',
listeners: {
scope: this,
'focus': function (combo, records, eOpts) {
var custname = this.formHead.getForm().findField('CUSTOMERNAME').getValue();
if (custname != '') {
var sql = " CUSTNAME='" + custname + "'";
this.storeListMailProject.load({
params: { start: 0, limit: 5000, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
}
}
}
valueField: 'EnumValueName',
displayField: 'EnumValueName'
});
@ -11694,12 +11706,12 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
//this.formMBL.getForm().reset();
//this.formMBL.getForm().setValues(data);
if (data.CUSTOMERNAME != '') {
var sql = " CUSTNAME='" + data.CUSTOMERNAME + "'";
this.storeListMailProject.load({
params: { start: 0, limit: 5000, sort: '', condition: sql },
waitMsg: "正在查询数据...",
scope: this
});
//var sql = " CUSTNAME='" + data.CUSTOMERNAME + "'";
//this.storeListMailProject.load({
// params: { start: 0, limit: 5000, sort: '', condition: sql },
// waitMsg: "正在查询数据...",
// scope: this
//});
}
if (data.APPLYNO != '') {
@ -19470,7 +19482,7 @@ Ext.extend(Shipping.MsOpSeaeEdit, Ext.Panel, {
return;
}
var mailproject = this.editRecord.get('MAILPROJECT');
var mailproject ='';
if (isemail=='1') {
Ext.Msg.wait('正在整理数据...');

@ -52,7 +52,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
this.isquery = false;
this.nodaystr = '';
this.selectbsno = '';
Ext.Ajax.timeout = 120000;
Ext.Ajax.timeout = 1200000;
this.storectndisp = Ext.create('DsExt.ux.RefTableStore', {
model: 'DsShipping.ux.CtnDispModel',
@ -178,7 +178,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptNoTotal/BsListData',
timeout: 120000,
timeout: 1200000,
reader: {
id: '',
root: 'data',
@ -1176,7 +1176,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptNoTotal/FeeListData',
timeout: 120000,
timeout: 1200000,
reader: {
id: '',
root: 'data',
@ -2534,7 +2534,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptNoTotal/BsListData',
timeout: 120000,
timeout: 1200000,
reader: {
id: '',
root: 'data',
@ -3483,7 +3483,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptNoTotal/FeeListData',
timeout: 120000,
timeout: 1200000,
reader: {
id: '',
root: 'data',
@ -4062,7 +4062,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptNoTotal/SaleListData',
timeout: 120000,
timeout: 1200000,
reader: {
id: '',
root: 'data',
@ -4323,7 +4323,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptNoTotal/CustListData',
timeout: 120000,
timeout: 1200000,
reader: {
id: '',
root: 'data',
@ -4636,7 +4636,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptNoTotal/SaleCustListData',
timeout: 120000,
timeout: 1200000,
reader: {
id: '',
root: 'data',
@ -4897,7 +4897,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
remoteSort: true,
proxy: {
type: 'ajax',
timeout: 120000,
timeout: 1200000,
url: '/MvcShipping/MsRptNoTotal/VesselVoyListData',
reader: {
id: '',
@ -5159,7 +5159,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
proxy: {
type: 'ajax',
url: '/MvcShipping/MsRptNoTotal/DeptListData',
timeout: 120000,
timeout: 1200000,
reader: {
id: '',
root: 'data',
@ -5406,7 +5406,7 @@ Ext.extend(Shipping.MsRptNoTotalIndex, Ext.Panel, {
remoteSort: true,
proxy: {
type: 'ajax',
timeout: 120000,
timeout: 1200000,
url: '/MvcShipping/MsRptNoTotal/SumListData',
reader: {
id: '',

Loading…
Cancel
Save