旧仓储,仓储费结算清单,改为对明细出库的业务同样适用。

DS7_JinGang
ddlucky 2 years ago
parent 8c2d76c74f
commit 3e060d3d47

@ -20,10 +20,10 @@ namespace DSWeb.Common.DB
public DateTime? MODIFIEDTIME { get; set; }
public string PARAMTYPE { get; set; }
public string FIELDTYPE { get; set; }
public string COMPANYID { get; set; }
public string PARAMVALUE2 { get; set; }
public string PARAMVALUE3 { get; set; }
public string PARAMVALUE4 { get; set; }
//public string COMPANYID { get; set; }
//public string PARAMVALUE2 { get; set; }
//public string PARAMVALUE3 { get; set; }
//public string PARAMVALUE4 { get; set; }
}
[Table("sys_parameter_value")]

@ -691,7 +691,8 @@ Ext.extend(Shipping.ChPayapplicationAudit, Ext.Panel, {
enableTextSelection: true
},
disableSelection: false,
tbar: [{
tbar: [
{
text: Zi.LAN.Saveliststyle,
id: "btntestbody",
menu: [
@ -705,7 +706,10 @@ Ext.extend(Shipping.ChPayapplicationAudit, Ext.Panel, {
}
}],
scope: this
}],
}
],
columns: this.girdbillcolums,
// paging bar on the bottom
bbar: [Ext.create('Ext.PagingToolbar', {

@ -24,7 +24,9 @@ namespace DSWeb.MvcShipping.DAL.MsSysParamSet
strSql.Append("SELECT ");
strSql.Append("GID,PARAMNAME,PARAMTYPE,PARAMDESCRIPTION,PARAMVALUE,MODIFIEDUSER,MODIFIEDTIME,FIELDTYPE");
strSql.Append(",(CASE WHEN PARAMNAME='CWSTARTUSING' THEN (SELECT TOP 1 STARTNAME FROM cw_design_startusing WHERE GID=sys_param_set.PARAMVALUE) ELSE ");
strSql.Append("(select top 1 DISPVALUE from sys_parameter_value where PARAMNAME=sys_param_set.PARAMNAME and PARAMVALUE=sys_param_set.PARAMVALUE) END) DISPVALUE,COMPANYID,PARAMVALUE2,PARAMVALUE3,PARAMVALUE4");
strSql.Append("(select top 1 DISPVALUE from sys_parameter_value where PARAMNAME=sys_param_set.PARAMNAME and PARAMVALUE=sys_param_set.PARAMVALUE) END) DISPVALUE");
//strSql.Append(",COMPANYID,PARAMVALUE2,PARAMVALUE3,PARAMVALUE4");
strSql.Append(" from sys_param_set ");
if (!string.IsNullOrEmpty(strCondition))

@ -155,8 +155,14 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
+ ", isnull((select sum(GOODSPACKPFSL) as GOODSPACKPFSL from wms_out_detail where INBSNO=wms.GID " + strCondition4 + "),0) as GOODSPACKPFSL"
+ ", isnull((select sum(GOODSPACKPFSL) as GOODSPACKPFSL from wms_out_detail where INBSNO=wms.GID " + strCondition2 + "),0) as GOODSPACKPFSL_MONTH"
+ ", GOODSPACKACTUAL, GOODSRKSLACTUAL, CORPID "
+ " FROM wms WHERE CHARGEUNIT <> 'CBM' AND ISDELETE = 0 " + strCondition
+ " FROM wms WHERE ISDELETE = 0 "
//20230214 增加 防止明细出库的仓储信息出现在这里
+ " and not exists(select 1 from wms_out_detail where INBSNO in(select gid from wms_in where ASSOCIATEDNO=wms.GID)) "
+ strCondition //CHARGEUNIT <> 'CBM' AND
+ ") as A where 1=1 " + strCondition3
+ " GROUP BY GID, WMSNO, CUSTOMERNAME, STORAGENAME, AREANAME, BLNO, GOODSNAME, GOODSMODEL, ASSOCIATEDNO, CONTRACTNO, CHARGEUNIT, CUSTOMNO, GOODSGRADE, GOODSSLICE, GOODSSTANDARD, GOODSRKSL, GOODSPACK, GOODSPACKACTUAL, GOODSRKSLACTUAL, WMSDATE, STARTBILLINGDATE"
+ " UNION ALL "
+ "select GID, WMSNO, WMSDATE, STARTBILLINGDATE, CUSTOMERNAME, BLNO, STORAGENAME, AREANAME, GOODSNAME, GOODSMODEL, ASSOCIATEDNO, CONTRACTNO, CHARGEUNIT, CUSTOMNO, GOODSGRADE, ISNULL(GOODSSLICE, 0) AS GOODSSLICE, GOODSSTANDARD, '' AS REMARK"
@ -181,7 +187,10 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
+ ", isnull((select sum(GOODSPACKPFSL) as GOODSPACKPFSL from wms_out_detail where INBSNO=i.GID " + strCondition4 + "),0) as GOODSPACKPFSL"
+ ", isnull((select sum(GOODSPACKPFSL) as GOODSPACKPFSL from wms_out_detail where INBSNO=i.GID " + strCondition2 + "),0) as GOODSPACKPFSL_MONTH"
+ ", i.GOODSPACKACTUAL, i.GOODSRKSLACTUAL, w.CORPID "
+ " FROM wms_in AS i LEFT OUTER JOIN wms AS w ON i.ASSOCIATEDNO = w.GID WHERE i.CHARGEUNIT = 'CBM' AND i.ISDELETE = 0 " + strCondition
+ " FROM wms_in AS i LEFT OUTER JOIN wms AS w ON i.ASSOCIATEDNO = w.GID WHERE i.ISDELETE = 0 " + strCondition // i.CHARGEUNIT = 'CBM'AND
+ " and exists(select 1 from wms_out_detail where INBSNO =i.GID) "
+ ") as A where 1=1 " + strCondition3
+ " GROUP BY GID, WMSNO, CUSTOMERNAME, STORAGENAME, AREANAME, BLNO, GOODSNAME, GOODSMODEL, ASSOCIATEDNO, CONTRACTNO, CHARGEUNIT, CUSTOMNO, GOODSGRADE, GOODSSLICE, GOODSSTANDARD, GOODSRKSL, GOODSPACK, GOODSPACKACTUAL, GOODSRKSLACTUAL, WMSDATE, STARTBILLINGDATE) as a";
iState = SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, strSql, null);
@ -192,8 +201,38 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
}
#endregion
//20230214 增加对旧仓储业务明细出库的支持
//首先看这票货的GID查找wms_in.ASSOCIATEDNO=wms.gid 看入库明细
//然后看这些入库明细wms_in.GID 看是否有出库明细的inbsno=这些入库明细的wms_in.gid
//如果有 则具有【明细出库】
//如具有【明细出库】 则依据每次明细出库的数量 增加一条TableName_ls的记录同时减少这票货的总数
//var wmsgidList = new List<string>();
//strSql = "select distinct GID from [" + TableName_ls + "] where CREATEUSER='" + strUserID + "' and CORPID='" + strCompanyID + "'";
//DataSet dsKCMX = SqlHelper.ExecuteQueryDataset(sqlTran, CommandType.Text, strSql, null);
//if (dsKCMX != null)
//{
// foreach (DataRow dr in dsKCMX.Tables[0].Rows)
// {
// wmsgidList.Add( dr["GID"].ToString());
// }
//}
//var cdc = new CommonDataContext();
//foreach (var wmsgid in wmsgidList) {
// var wmsinList = cdc.wms_in.Where(x => x.ASSOCIATEDNO == wmsgid);
// var wmsinGidList = wmsinList.Select(s => s.GID).ToList();
// var wmsoutDetailList = cdc.wms_out_detail.Where(x => wmsinGidList.Contains(x.INBSNO)).ToList();
// if (wmsoutDetailList != null && wmsoutDetailList.Count > 0) {
// //如具有【明细出库】 则依据每次明细出库的数量 增加一条TableName_ls的记录同时减少这票货的总数
// wmsoutDetailList = wmsoutDetailList.OrderBy(o => o.DODATE).ThenBy(o => o.BSNO).ToList();
// foreach (var wmsoutdetail in wmsoutDetailList) {
// }
// }
//}
#region 5.从【库存】中提取数据,生成【仓储明细表[wms_settlement_detail_rate_detail_temp]】
strSql = "select * from [" + TableName_ls + "] where CREATEUSER='" + strUserID + "' and CORPID='" + strCompanyID + "'";
DataSet dsKC = SqlHelper.ExecuteQueryDataset(sqlTran, CommandType.Text, strSql, null);
if (dsKC != null)

@ -672,13 +672,15 @@ namespace DSWeb.Areas.MvcShipping.Helper
var =new List<wms_out_detail_md>();
var ingidlist= wmsoutdetailList.Select(s=>s.ASSOCIATEDNO).ToList();
var wmsList = cdc.wms.Where(x => ingidlist.Contains(x.GID)).ToList();
var wmsinList = cdc.wms_in.Where(x => ingidlist.Contains(x.ASSOCIATEDNO)).ToList();
var wmsList = cdc.wms.Where(x => ingidlist.Contains(x.GID) || ingidlist.Contains(x.ASSOCIATEDNO)).ToList();
var wmsgidlist = wmsList.Select(s => s.GID).ToList();
var wmsinList = cdc.wms_in.Where(x => wmsgidlist.Contains(x.ASSOCIATEDNO)).ToList();
foreach (var item in wmsoutdetailList)
{
var wms = wmsList.First(x => x.GID == item.ASSOCIATEDNO);
var wms = wmsList.First(x => x.GID == item.ASSOCIATEDNO || ingidlist.Contains(x.ASSOCIATEDNO));
var wmsin = new wms_in_md();

Loading…
Cancel
Save