'20221130-仓储结算清单当中点击【费用入账】向仓储业务中生成费用时,如果仓储业务已费用锁定,则在这些业务中增加费用更改单,并在其下面产生相应的费用,并将这些费用提交审核。如果点击【取消入账】,则判断是否有费用的备注内容是这个仓储结算清单的DUINO,如果有,判断其是否能删除(feestatus=1或6),如可以删除,则删除这些费用和更改单。'

DS7Zhanhao
ddlucky 2 years ago
parent 514a21d1f5
commit 22350df0be

@ -614,76 +614,76 @@ namespace DSWeb.Common.DB
[Key] [Key]
public string GID { get; set; } public string GID { get; set; }
public string BSNO { get; set; } public string BSNO { get; set; }
public int? FEETYPE { get; set; } public int? FEETYPE { get; set; } = 0;
public string FEENAME { get; set; } public string FEENAME { get; set; }
public string FEEDESCRIPTION { get; set; } public string FEEDESCRIPTION { get; set; } = "";
public string CUSTOMERTYPE { get; set; } public string CUSTOMERTYPE { get; set; } = "";
public string CUSTOMERNAME { get; set; } public string CUSTOMERNAME { get; set; } = "";
public string UNIT { get; set; } public string UNIT { get; set; } = "";
public decimal? UNITPRICE { get; set; } public decimal? UNITPRICE { get; set; } = 0;
public decimal? QUANTITY { get; set; } public decimal? QUANTITY { get; set; } = 0;
public decimal? AMOUNT { get; set; } public decimal? AMOUNT { get; set; } = 0;
public string CURRENCY { get; set; } public string CURRENCY { get; set; } = "";
public decimal? EXCHANGERATE { get; set; } public decimal? EXCHANGERATE { get; set; } = 0;
public string REASON { get; set; } public string REASON { get; set; } = "";
public string REMARK { get; set; } public string REMARK { get; set; } = "";
public decimal? COMMISSIONRATE { get; set; } public decimal? COMMISSIONRATE { get; set; } = 0;
public decimal? SETTLEMENT { get; set; } public decimal? SETTLEMENT { get; set; } = 0;
public decimal? INVOICE { get; set; } public decimal? INVOICE { get; set; } = 0;
public decimal? ORDERAMOUNT { get; set; } public decimal? ORDERAMOUNT { get; set; } = 0;
public decimal? ORDERINVOICE { get; set; } public decimal? ORDERINVOICE { get; set; } = 0;
public DateTime? SUBMITDATE { get; set; } public DateTime? SUBMITDATE { get; set; }
public string AUDITOPERATOR { get; set; } public string AUDITOPERATOR { get; set; } = "";
public DateTime? AUDITDATE { get; set; } public DateTime? AUDITDATE { get; set; }
public string ENTEROPERATOR { get; set; } public string ENTEROPERATOR { get; set; } = "";
public DateTime? ENTERDATE { get; set; } public DateTime? ENTERDATE { get; set; }
public string DEBITNO { get; set; } public string DEBITNO { get; set; } = "";
public bool? ISDEBIT { get; set; } public bool? ISDEBIT { get; set; } = false;
public bool? ISOPEN { get; set; } public bool? ISOPEN { get; set; } = false;
public bool? ISADVANCEDPAY { get; set; } public bool? ISADVANCEDPAY { get; set; } = false;
public int? SORT { get; set; } public int? SORT { get; set; } = 0;
public bool? ISINVOICE { get; set; } public bool? ISINVOICE { get; set; } = false;
public int? FEESTATUS { get; set; } public int? FEESTATUS { get; set; } = 1;
public string FEEFRT { get; set; } public string FEEFRT { get; set; } = "";
public bool? ISCRMORDERFEE { get; set; } public bool? ISCRMORDERFEE { get; set; } = false;
public int? AUDITSTATUS { get; set; } public int? AUDITSTATUS { get; set; } = 0;
public string INVOICENUM { get; set; } public string INVOICENUM { get; set; } = "";
public string CHEQUENUM { get; set; } public string CHEQUENUM { get; set; } = "";
public string WMSOUTBSNO { get; set; } public string WMSOUTBSNO { get; set; } = "";
public int? LINENUM { get; set; } public int? LINENUM { get; set; } = 0;
public decimal? TAXRATE { get; set; } public decimal? TAXRATE { get; set; } = 0;
public decimal? NOTAXAMOUNT { get; set; } public decimal? NOTAXAMOUNT { get; set; } = 0;
public decimal? ACCTAXRATE { get; set; } public decimal? ACCTAXRATE { get; set; } = 0;
public bool? ISVOU { get; set; } public bool? ISVOU { get; set; } = false;
public string VOUCHERNO { get; set; } public string VOUCHERNO { get; set; } = "";
public string ACCDATE { get; set; } public string ACCDATE { get; set; } = "";
public string BXGID { get; set; } public string BXGID { get; set; } = "";
public decimal? TAX { get; set; } public decimal? TAX { get; set; } = 0;
public string F_NO { get; set; } public string F_NO { get; set; } = "";
public decimal? ORDERSETTLEMENT { get; set; } public decimal? ORDERSETTLEMENT { get; set; } = 0;
public decimal? TAXUNITPRICE { get; set; } public decimal? TAXUNITPRICE { get; set; } = 0;
public decimal? ORDERINVSETTLEMENT { get; set; } public decimal? ORDERINVSETTLEMENT { get; set; } = 0;
public string MODIFIEDUSER { get; set; } public string MODIFIEDUSER { get; set; } = "";
public DateTime? MODIFIEDTIME { get; set; } public DateTime? MODIFIEDTIME { get; set; }
public string VOUALLNO { get; set; } public string VOUALLNO { get; set; } = "";
public string SALESNO { get; set; } public string SALESNO { get; set; } = "";
public string CARGO_GID { get; set; } public string CARGO_GID { get; set; } = "";
public string JKGID { get; set; } public string JKGID { get; set; } = "";
public decimal? PREAMOUNT { get; set; } public decimal? PREAMOUNT { get; set; } = 0;
public string INPUTMODE { get; set; } public string INPUTMODE { get; set; } = "";
public string DELIVERYNO { get; set; } public string DELIVERYNO { get; set; } = "";
public string LOCALCURR { get; set; } public string LOCALCURR { get; set; } = "";
public string MANAGER { get; set; } public string MANAGER { get; set; } = "";
public bool? ISACC { get; set; } public bool? ISACC { get; set; } = false;
public string PaymentGID { get; set; } public string PaymentGID { get; set; } = "";
public string STATEMENTNO { get; set; } public string STATEMENTNO { get; set; } = "";
public string SALECORP { get; set; } public string SALECORP { get; set; } = "";
public bool? CUSTDUI { get; set; } public bool? CUSTDUI { get; set; } = false;
/// <summary> /// <summary>
/// 用于向大简云发送开票请求后 记录费用与链接的关系 /// 用于向大简云发送开票请求后 记录费用与链接的关系
/// </summary> /// </summary>
public string INVLINKGID { get; set; } public string INVLINKGID { get; set; } = "";
} }
public partial class ch_fee_md public partial class ch_fee_md
@ -869,78 +869,78 @@ namespace DSWeb.Common.DB
public partial class v_ch_fee_settlementinfo_md public partial class v_ch_fee_settlementinfo_md
{ {
[Key] [Key]
public string GID { get; set; } public string GID { get; set; } = "";
//public byte[] _MASK_FROM_V2 { get; set; } //public byte[] _MASK_FROM_V2 { get; set; }
public string ACCDATE { get; set; } public string ACCDATE { get; set; } = "";
public decimal? ACCTAXRATE { get; set; } public decimal? ACCTAXRATE { get; set; } = 0;
public decimal? AMOUNT { get; set; } public decimal? AMOUNT { get; set; } = 0;
public DateTime? AUDITDATE { get; set; } public DateTime? AUDITDATE { get; set; }
public string AUDITOPERATOR { get; set; } public string AUDITOPERATOR { get; set; } = "";
public int? AUDITSTATUS { get; set; } public int? AUDITSTATUS { get; set; } = 0;
public string BSNO { get; set; } public string BSNO { get; set; } = "";
public string BXGID { get; set; } public string BXGID { get; set; } = "";
public string CARGO_GID { get; set; } public string CARGO_GID { get; set; } = "";
public string CHEQUENUM { get; set; } public string CHEQUENUM { get; set; } = "";
public decimal? COMMISSIONRATE { get; set; } public decimal? COMMISSIONRATE { get; set; } = 0;
public string CURRENCY { get; set; } public string CURRENCY { get; set; } = "";
public bool? CUSTDUI { get; set; } public bool? CUSTDUI { get; set; }
public string CUSTOMERNAME { get; set; } public string CUSTOMERNAME { get; set; } = "";
public string CUSTOMERTYPE { get; set; } public string CUSTOMERTYPE { get; set; } = "";
public string DEBITNO { get; set; } public string DEBITNO { get; set; } = "";
public string DELIVERYNO { get; set; } public string DELIVERYNO { get; set; } = "";
public DateTime? ENTERDATE { get; set; } public DateTime? ENTERDATE { get; set; }
public string ENTEROPERATOR { get; set; } public string ENTEROPERATOR { get; set; } = "";
public decimal? EXCHANGERATE { get; set; } public decimal? EXCHANGERATE { get; set; } = 0;
public string F_NO { get; set; } public string F_NO { get; set; } = "";
public string FEEDESCRIPTION { get; set; } public string FEEDESCRIPTION { get; set; } = "";
public string FEEFRT { get; set; } public string FEEFRT { get; set; } = "";
public string FEENAME { get; set; } public string FEENAME { get; set; } = "";
public int? FEESTATUS { get; set; } public int? FEESTATUS { get; set; } = 1;
public int? FEETYPE { get; set; } public int? FEETYPE { get; set; }
public string INPUTMODE { get; set; } public string INPUTMODE { get; set; } = "";
public decimal? INVOICE { get; set; } public decimal? INVOICE { get; set; } = 0;
public string INVOICENUM { get; set; } public string INVOICENUM { get; set; } = "";
public bool? ISACC { get; set; } public bool? ISACC { get; set; } = false;
public bool? ISADVANCEDPAY { get; set; } public bool? ISADVANCEDPAY { get; set; } = false;
public bool? ISCRMORDERFEE { get; set; } public bool? ISCRMORDERFEE { get; set; } = false;
public bool? ISDEBIT { get; set; } public bool? ISDEBIT { get; set; } = false;
public bool? ISDJY { get; set; } public bool? ISDJY { get; set; } = false;
public bool? ISINVOICE { get; set; } public bool? ISINVOICE { get; set; } = false;
public bool? ISOPEN { get; set; } public bool? ISOPEN { get; set; } = false;
public bool? ISVOU { get; set; } public bool? ISVOU { get; set; } = false;
public string JKGID { get; set; } public string JKGID { get; set; } = "";
public int? LINENUM { get; set; } public int? LINENUM { get; set; } = 0;
public string LOCALCURR { get; set; } public string LOCALCURR { get; set; } = "";
public string MANAGER { get; set; } public string MANAGER { get; set; } = "";
public DateTime? MODIFIEDTIME { get; set; } public DateTime? MODIFIEDTIME { get; set; }
public string MODIFIEDUSER { get; set; } public string MODIFIEDUSER { get; set; } = "";
public decimal? NOTAXAMOUNT { get; set; } public decimal? NOTAXAMOUNT { get; set; } = 0;
public decimal? ORDERAMOUNT { get; set; } public decimal? ORDERAMOUNT { get; set; } = 0;
public decimal? ORDERINVOICE { get; set; } public decimal? ORDERINVOICE { get; set; } = 0;
public decimal? ORDERINVSETTLEMENT { get; set; } public decimal? ORDERINVSETTLEMENT { get; set; } = 0;
public decimal? ORDERSETTLEMENT { get; set; } public decimal? ORDERSETTLEMENT { get; set; } = 0;
public string PaymentGID { get; set; } public string PaymentGID { get; set; } = "";
public decimal? PREAMOUNT { get; set; } public decimal? PREAMOUNT { get; set; }
public decimal? QUANTITY { get; set; } public decimal? QUANTITY { get; set; }
public string REASON { get; set; } public string REASON { get; set; } = "";
public string REMARK { get; set; } public string REMARK { get; set; } = "";
public string SALECORP { get; set; } public string SALECORP { get; set; } = "";
public string SALESNO { get; set; } public string SALESNO { get; set; } = "";
public decimal? SETTLEAMOUNT { get; set; } public decimal? SETTLEAMOUNT { get; set; }
public decimal? SETTLEMENT { get; set; } public decimal? SETTLEMENT { get; set; }
public DateTime? SETTLETIME { get; set; } public DateTime? SETTLETIME { get; set; }
public int? SORT { get; set; } public int? SORT { get; set; } = 0;
public string STATEMENTNO { get; set; } public string STATEMENTNO { get; set; } = "";
public DateTime? SUBMITDATE { get; set; } public DateTime? SUBMITDATE { get; set; }
public decimal? TAX { get; set; } public decimal? TAX { get; set; }
public decimal? TAXRATE { get; set; } public decimal? TAXRATE { get; set; }
public decimal? TAXUNITPRICE { get; set; } public decimal? TAXUNITPRICE { get; set; }
public string UNIT { get; set; } public string UNIT { get; set; } = "";
public decimal? UNITPRICE { get; set; } public decimal? UNITPRICE { get; set; }
public string VOUALLNO { get; set; } public string VOUALLNO { get; set; } = "";
public string VOUCHERNO { get; set; } public string VOUCHERNO { get; set; } = "";
public string WMSOUTBSNO { get; set; } public string WMSOUTBSNO { get; set; } = "";
#region 外键 => 导航属性ManyToMany #region 外键 => 导航属性ManyToMany
@ -1489,4 +1489,87 @@ namespace DSWeb.Common.DB
#endregion #endregion
} }
[Table("wms_settlement_list")]
public partial class wms_settlement_list_md {
[Key]
public string GID { get; set; }
public string DUINO { get; set; }
public string CUSTOMERNAME { get; set; }
public DateTime? STARTBILLINGDATE { get; set; }
public DateTime? ENDBILLINGDATE { get; set; }
public string REMARK { get; set; }
public string CORPID { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
public bool? ISMAKEOUT { get; set; }
public string MAKEOUTUSER { get; set; }
public DateTime? MAKEOUTTIME { get; set; }
public bool? ISDELETE { get; set; }
public string DELETEUSER { get; set; }
public DateTime? DELETETIME { get; set; }
public bool? ISLOCK { get; set; }
public string LOCKUSER { get; set; }
public DateTime? LOCKTIME { get; set; }
}
[Table("wms_settlement_detail")]
public partial class wms_settlement_detail_md
{
[Key]
public string GID { get; set; }
public string DUIGID { get; set; }
public string DUINO { get; set; }
public string BLNO { get; set; }
public string CONTRACTNO { get; set; }
public string WMSNO { get; set; }
public string OUTBSNO { get; set; }
public string CUSTOMERNAME { get; set; }
public string STORAGENAME { get; set; }
public string GOODSNAME { get; set; }
public string GOODSMODEL { get; set; }
public string GOODSSTANDARD { get; set; }
public string GOODSGRADE { get; set; }
public DateTime? WMSDATE { get; set; }
public DateTime? DODATE { get; set; }
public int? WMSDAYS { get; set; }
public DateTime? STARTBILLINGDATE_OUT { get; set; }
public DateTime? ENDBILLINGDATE_OUT { get; set; }
public decimal? GOODSOUTFEE { get; set; }
public decimal? GOODSPACK { get; set; }
public decimal? GOODSPACKACTUAL { get; set; }
public decimal? GOODSPACKPFSL { get; set; }
public decimal? GOODSPACKSTOCK { get; set; }
public decimal? GOODSRKSL { get; set; }
public decimal? GOODSRKSLACTUAL { get; set; }
public decimal? GOODSPFSL { get; set; }
public decimal? GOODSSTOCK { get; set; }
public string CHARGEUNIT { get; set; }
public string REMARK_OUT { get; set; }
public int? FEETYPE { get; set; }
public int? FEEGRADE { get; set; }
public int? FEESCALE { get; set; }
public decimal? FEEPRICE { get; set; }
public DateTime? STARTBILLINGDATE { get; set; }
public DateTime? ENDBILLINGDATE { get; set; }
public int? FEEDAYS { get; set; }
public decimal? OUTFEE { get; set; }
public decimal? ARFEE { get; set; }
public string CREATEUSER { get; set; }
public DateTime? CREATETIME { get; set; }
public bool? ISMAKEOUT { get; set; }
public string MAKEOUTUSER { get; set; }
public DateTime? MAKEOUTTIME { get; set; }
public string CORPID { get; set; }
public int? LINENUM { get; set; }
public string GID_LINK { get; set; }
public bool? ISDELETE { get; set; }
public string DELETEUSER { get; set; }
public DateTime? DELETETIME { get; set; }
public string CUSTOMNO { get; set; }
public bool? ISLOCK { get; set; }
public string LOCKUSER { get; set; }
public DateTime? LOCKTIME { get; set; }
}
} }

@ -55,7 +55,11 @@ namespace DSWeb.Common.DB
public DbSet<v_ch_fee_settlementinfo_md> v_ch_fee_settlementinfo { get; set; } public DbSet<v_ch_fee_settlementinfo_md> v_ch_fee_settlementinfo { get; set; }
public DbSet<VW_user_md> VW_user { get; set; } public DbSet<VW_user_md> VW_user { get; set; }
public DbSet<Receipt_Doc_md> Receipt_Doc { get; set; } public DbSet<Receipt_Doc_md> Receipt_Doc { get; set; }
public DbSet<wms_settlement_detail_md> wms_settlement_detail { get; set; }
public DbSet<wms_settlement_list_md> wms_settlement_list { get; set; }
} }

@ -169,14 +169,28 @@ namespace DSWeb.Areas.Account.Controllers
} }
public ContentResult SubmitAuditAmend(string GidStr, string optype, string bsno = "") public ContentResult SubmitAuditAmend(string GidStr, string optype, string bsno = "")
{ {
var workflowstr=""; //var workflowstr="";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'"); //var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit"; //if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
//DBResult result = Chfee_AuditDAL.SubmitAudit(optype, Convert.ToString(Session["USERID"]), GidStr, bsno, workflowstr, Convert.ToString(Session["COMPANYID"]));
DBResult result = Chfee_AuditDAL.SubmitAudit(optype, Convert.ToString(Session["USERID"]), GidStr, bsno, workflowstr, Convert.ToString(Session["COMPANYID"]));
//var json = JsonConvert.Serialize(result);
//return new ContentResult() { Content = json };
return SubmitAuditAmend_Object(GidStr, optype, Convert.ToString(Session["USERID"]), Convert.ToString(Session["COMPANYID"]), bsno);
}
public ContentResult SubmitAuditAmend_Object(string GidStr, string optype,string USERID,string COMPANYID, string bsno = "")
{
var workflowstr = "";
var AMENDSELFWORK = MsSysParamSetDAL.GetData("PARAMNAME='AMENDSELFWORKFLOW'");
if (AMENDSELFWORK.PARAMVALUE == "1") workflowstr = "AmendFeefyAudit";
DBResult result = Chfee_AuditDAL.SubmitAudit(optype, USERID, GidStr, bsno, workflowstr, COMPANYID);
var json = JsonConvert.Serialize(result); var json = JsonConvert.Serialize(result);
return new ContentResult() { Content = json }; return new ContentResult() { Content = json };

@ -842,91 +842,114 @@ namespace DSWeb.MvcShipping.Controllers
public ContentResult SaveAmend(string bsno, string data, string chdrfeebody, string chcrfeebody) public ContentResult SaveAmend(string bsno, string data, string chdrfeebody, string chcrfeebody)
{ {
int iResult = 1;
var head = JsonConvert.Deserialize<MsOpAmend>(data); var head = JsonConvert.Deserialize<MsOpAmend>(data);
var bodyListdr = JsonConvert.Deserialize<List<MsChFee>>(chdrfeebody); var bodyListdr = JsonConvert.Deserialize<List<MsChFee>>(chdrfeebody);
var bodyListcr = JsonConvert.Deserialize<List<MsChFee>>(chcrfeebody); var bodyListcr = JsonConvert.Deserialize<List<MsChFee>>(chcrfeebody);
var result = new DBResult();
var billno = head.BSNO;
var modb = new ModelObjectDB(); return SaveAmend_Object(bsno, head, bodyListdr, bodyListcr, Session["USERID"].ToString(), Session["SHOWNAME"].ToString(), Session["COMPANYID"].ToString());
head.ACCDATE = head.ACCDATE.Substring(0, 7); }
var bsclose = ChMonthCloseDAL.GetData("", Convert.ToString(Session["COMPANYID"])); public ContentResult SaveAmend_Object(string bsno, MsOpAmend head, List<MsChFee> bodyListdr, List<MsChFee> bodyListcr,string USERID,string SHOWNAME,string COMPANYID)
if (Convert.ToDateTime(head.ACCDATE + "-01") < Convert.ToDateTime(bsclose.PERIOD + "-01")) {
try
{ {
var jsonRespose2 = new JsonResponse { Success = false, Message = "会计期间" + head.ACCDATE + "已结转,不允许添加更改单!" }; int iResult = 1;
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
}
if (head.CREATETIME == "") var result = new DBResult();
{ var billno = head.BSNO;
head.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); var modb = new ModelObjectDB();
head.CREATEUSER = Convert.ToString(Session["SHOWNAME"]); head.ACCDATE = head.ACCDATE.Substring(0, 7);
head.DbOperationType = DbOperationType.DbotIns; var bsclose = ChMonthCloseDAL.GetData("", COMPANYID);
if (string.IsNullOrEmpty(head.AMENDNO)) if (Convert.ToDateTime(head.ACCDATE + "-01") < Convert.ToDateTime(bsclose.PERIOD + "-01"))
{ {
var billnoset = MsSysBillNoSetDAL.GetData("OPLBNAME='更改单'", Convert.ToString(Session["COMPANYID"])); var jsonRespose2 = new JsonResponse { Success = false, Message = "会计期间" + head.ACCDATE + "已结转,不允许添加更改单!" };
if (billnoset.BILLTYPE != "") return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
head.AMENDNO = MsSysBillNoSetDAL.GetBillNo(billnoset, DateTime.Now.ToString("yyyy-MM-dd"), head.ACCDATE.ToString().Trim(), "", head.CREATEUSER);
} }
}
else
{
head.DbOperationType = DbOperationType.DbotUpd;
}
modb.Save(head); if (head.CREATETIME == "")
if (head.FEESTATUS) { {
var jsonRespose2 = new JsonResponse { Success = false, Message = "已费用锁定不允许在此更改单添加修改费用!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
} head.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
head.CREATEUSER = SHOWNAME;
head.DbOperationType = DbOperationType.DbotIns;
if (string.IsNullOrEmpty(head.AMENDNO))
{
var billnoset = MsSysBillNoSetDAL.GetData("OPLBNAME='更改单'", COMPANYID);
if (billnoset.BILLTYPE != "")
head.AMENDNO = MsSysBillNoSetDAL.GetBillNo(billnoset, DateTime.Now.ToString("yyyy-MM-dd"), head.ACCDATE.ToString().Trim(), "", head.CREATEUSER);
}
}
else
{
head.DbOperationType = DbOperationType.DbotUpd;
}
modb.Save(head);
if (head.FEESTATUS)
{
var jsonRespose2 = new JsonResponse { Success = false, Message = "已费用锁定不允许在此更改单添加修改费用!" };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose2) };
if (bodyListdr != null) }
{
iResult = MsChFeeDAL.SaveUpdateFee(bodyListdr, bsno, Convert.ToString(Session["USERID"]));
}
if (bodyListcr != null)
{
iResult = MsChFeeDAL.SaveUpdateFee(bodyListcr, bsno, Convert.ToString(Session["USERID"]));
}
if (iResult == 1)
{
result.Success = true;
result.Message = "更新成功!";
MsChFeeDAL.p_op_gain(bsno, Convert.ToString(Session["USERID"]));
}
else if (iResult == 0)
{
result.Success = false;
result.Message = "出现错误,未更新!";
}
else if (iResult == -1)
{
result.Success = false;
result.Message = "有异常,插入失败!";
}
else if (iResult == -2)
{
result.Success = false;
result.Message = "插入异常,事务已回滚成功!";
}
var jsonRespose = new JsonResponse if (bodyListdr != null)
{ {
Success = result.Success, iResult = MsChFeeDAL.SaveUpdateFee(bodyListdr, bsno, USERID);
Message = result.Message, }
Data = MsChFeeDAL.GetAmendList("BSNO='" + billno + "'") if (bodyListcr != null)
}; {
iResult = MsChFeeDAL.SaveUpdateFee(bodyListcr, bsno, USERID);
}
if (iResult == 1)
{
result.Success = true;
result.Message = "更新成功!";
MsChFeeDAL.p_op_gain(bsno, USERID);
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) }; }
else if (iResult == 0)
{
result.Success = false;
result.Message = "出现错误,未更新!";
}
else if (iResult == -1)
{
result.Success = false;
result.Message = "有异常,插入失败!";
}
else if (iResult == -2)
{
result.Success = false;
result.Message = "插入异常,事务已回滚成功!";
}
var jsonRespose = new JsonResponse
{
Success = result.Success,
Message = result.Message,
Data = MsChFeeDAL.GetAmendList("BSNO='" + billno + "'")
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}catch(Exception ex) {
var jsonRespose = new JsonResponse
{
Success = false,
Message = ex.Message
};
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
} }
public ContentResult DeleteAmendList(string data) public ContentResult DeleteAmendList(string data)
{ {
var headData = JsonConvert.Deserialize<List<MsOpAmend>>(data); var headData = JsonConvert.Deserialize<List<MsOpAmend>>(data);
return DeleteAmendList_Object(headData);
}
public ContentResult DeleteAmendList_Object(List<MsOpAmend> headData)
{
//var headData = JsonConvert.Deserialize<List<MsOpAmend>>(data);
var errstr = ""; var errstr = "";

@ -224,6 +224,11 @@ namespace DSWeb.MvcShipping.Controllers
} }
//费用入账 //费用入账
/// <summary>
/// 根据对账单信息生成chfee
/// </summary>
/// <param name="gids"></param>
/// <returns></returns>
public ContentResult setislock(string gids) public ContentResult setislock(string gids)
{ {
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() == "") 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() == "")

@ -6680,7 +6680,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
/// <param name="AMOUNT">金额</param> /// <param name="AMOUNT">金额</param>
/// <param name="QUANTITY">数量</param> /// <param name="QUANTITY">数量</param>
/// <returns></returns> /// <returns></returns>
public static ch_fee_md getChFee(string USERID, string BSNO, string CUSTOMERNAME, int FEETYPE, string FEENAME, decimal AMOUNT, string UNIT, decimal QUANTITY = 1) public static ch_fee_md getChFee(string USERID, string BSNO, string CUSTOMERNAME, int FEETYPE, string FEENAME, decimal AMOUNT, string UNIT, decimal QUANTITY = 1,string remark="")
{ {
var result = getNewChfee(); var result = getNewChfee();
@ -6703,6 +6703,7 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
result.EXCHANGERATE = 1M; result.EXCHANGERATE = 1M;
result.UNIT = UNIT; result.UNIT = UNIT;
result.REMARK = remark;
// //
CommonDataContext cdc = new CommonDataContext(); CommonDataContext cdc = new CommonDataContext();
var codefeelist = cdc.code_fee.Where(x => 1 == 1).ToList(); var codefeelist = cdc.code_fee.Where(x => 1 == 1).ToList();
@ -6749,6 +6750,9 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
{ {
var result = getchfeeHelper(); var result = getchfeeHelper();
result.GID = Guid.NewGuid().ToString(); result.GID = Guid.NewGuid().ToString();
result.WMSOUTBSNO = "";
return result; return result;
} }

@ -15,7 +15,18 @@ using DSWeb.DataAccess;
using DSWeb.Models; using DSWeb.Models;
using DSWeb.MvcShipping.Helper; using DSWeb.MvcShipping.Helper;
using DSWeb.Areas.CommMng.DAL; using DSWeb.Areas.CommMng.DAL;
using DSWeb.Common.DB;
using System.Linq;
using DSWeb.Areas.Account.Controllers;
using DSWeb.MvcShipping.Models.MsOpAmend;
using NPOI.HPSF;
using DSWeb.Areas.Import.Controllers;
using System.Web.UI.WebControls;
using DSWeb.MvcShipping.Models.MsChFee;
using DSWeb.MvcShipping.DAL.MsChFeeDAL;
using DSWeb.Areas.MvcShipping.Helper;
using DSWeb.Handler;
namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
{ {
@ -1547,6 +1558,14 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
#endregion #endregion
#region 费用入账 #region 费用入账
/// <summary>
/// 根据仓储结算清单信息 生成费用
/// </summary>
/// <param name="gids"></param>
/// <param name="strUserID"></param>
/// <param name="strCompanyID"></param>
/// <param name="strDEPTNAME"></param>
/// <returns></returns>
public static DBResult setislock(string gids, string strUserID, string strCompanyID, string strDEPTNAME) public static DBResult setislock(string gids, string strUserID, string strCompanyID, string strDEPTNAME)
{ {
DBResult result = new DBResult(); DBResult result = new DBResult();
@ -1589,15 +1608,41 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
{ {
try try
{ {
var gidList = gids.Split(',').ToList();
gids = "'" + gids.Trim().Replace(",","','") + "'"; gids = "'" + gids.Trim().Replace(",","','") + "'";
#region 从【仓储结算明细临时表wms_settlement_detail】中提取数据按提单号循环插入ch_Fee因为添加锁定功能则暂时屏蔽 //20221128 对于费用锁定的业务 其费用生成到一个该业务下新增的费用更改单上
string strSql = "insert into ch_fee(GID,BSNO,FEETYPE,FEENAME,CUSTOMERNAME,UNIT,UNITPRICE,QUANTITY,AMOUNT,EXCHANGERATE,CURRENCY,COMMISSIONRATE,FEEFRT,REMARK,ISADVANCEDPAY,ENTEROPERATOR,ENTERDATE,FEESTATUS,WMSOUTBSNO,LINENUM,[TAXRATE],[NOTAXAMOUNT],[TAX],[ORDERSETTLEMENT],[TAXUNITPRICE],[ORDERINVSETTLEMENT]) "
+ "select newid() as GID,bsno=(select top 1 bsno from V_op_bill where mblno=[wms_settlement_detail].blno),1,'仓储费',CUSTOMERNAME,'单票',sum(isnull(OUTFEE,0)),1,sum(isnull(OUTFEE,0)),1,'RMB',0,'PP',((select top 1 CONVERT(char(10), STARTBILLINGDATE, 20) AS STARTBILLINGDATE from wms_settlement_detail where blno=wms_settlement_detail.blno and STARTBILLINGDATE is not null and CORPID='" + strCompanyID + "' and ISLOCK=0 and ISDELETE=0 and isnull(OUTFEE,0)<>0 and DUIGID in (" + gids + ")" + strRange + " order by STARTBILLINGDATE)+'至'+(select top 1 CONVERT(char(10), ENDBILLINGDATE, 20) AS ENDBILLINGDATE from wms_settlement_detail where blno=wms_settlement_detail.blno and ENDBILLINGDATE is not null and CORPID='" + strCompanyID + "' and ISLOCK=0 and ISDELETE=0 and isnull(OUTFEE,0)<>0 and DUIGID in (" + gids + ")" + strRange + " order by ENDBILLINGDATE desc)+'仓储结算清单'+DUINO+'”中的单票仓储费汇总'),0,'" + strUserID + "',getdate(),1,DUIGID,LINENUM=(select top 1 LINENUM=isnull((select top 1 LINENUM from ch_fee where bsno=(select top 1 bsno from v_op_bill where mblno=[wms_settlement_detail].blno) and feetype=1 order by LINENUM desc),0)+1),0,sum(isnull(OUTFEE,0)),0,0,sum(isnull(OUTFEE,0)),0" var cdc = new CommonDataContext();
+ " from [wms_settlement_detail] where CORPID='" + strCompanyID + "' and ISLOCK=0 and ISDELETE=0 and isnull(OUTFEE,0)<>0 and DUIGID in (" + gids + ")" + strRange + " group by blno,CUSTOMERNAME,CREATEUSER,CORPID,DUINO,DUIGID";//CREATEUSER='" + strUserID + "' and
int existVal = SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, strSql.ToString(), null); var wms_settlement_detailList = new List<wms_settlement_detail_md>();
var = get(gidList, out wms_settlement_detailList);
var donegids = wms_settlement_detailList.Select(s => s.DUIGID).ToList();
var needdogidArray = gidList.Where(x => !donegids.Contains(x)).ToArray() ;
var feegids = "'" + String.Join("','", needdogidArray) + "'";
int existVal = 0;
string strSql = "";
#region 从【仓储结算明细临时表wms_settlement_detail】中提取数据按提单号循环插入ch_Fee
//费用锁定的业务
if (needdogidArray.Length > 0)
{
strSql = "insert into ch_fee(GID,BSNO,FEETYPE,FEENAME,CUSTOMERNAME,UNIT,UNITPRICE,QUANTITY,AMOUNT,EXCHANGERATE,CURRENCY,COMMISSIONRATE,FEEFRT,REMARK,ISADVANCEDPAY,ENTEROPERATOR,ENTERDATE,FEESTATUS,WMSOUTBSNO,LINENUM,[TAXRATE],[NOTAXAMOUNT],[TAX],[ORDERSETTLEMENT],[TAXUNITPRICE],[ORDERINVSETTLEMENT]) "
+ "select newid() as GID,bsno=(select top 1 bsno from V_op_bill where mblno=[wms_settlement_detail].blno),1,'仓储费',CUSTOMERNAME,'单票',sum(isnull(OUTFEE,0)),1,sum(isnull(OUTFEE,0)),1,'RMB',0,'PP',((select top 1 CONVERT(char(10), STARTBILLINGDATE, 20) AS STARTBILLINGDATE from wms_settlement_detail where blno=wms_settlement_detail.blno and STARTBILLINGDATE is not null and CORPID='" + strCompanyID + "' and ISLOCK=0 and ISDELETE=0 and isnull(OUTFEE,0)<>0 and DUIGID in (" + feegids + ")" + strRange + " order by STARTBILLINGDATE)+'至'+(select top 1 CONVERT(char(10), ENDBILLINGDATE, 20) AS ENDBILLINGDATE from wms_settlement_detail where blno=wms_settlement_detail.blno and ENDBILLINGDATE is not null and CORPID='" + strCompanyID + "' and ISLOCK=0 and ISDELETE=0 and isnull(OUTFEE,0)<>0 and DUIGID in (" + feegids + ")" + strRange + " order by ENDBILLINGDATE desc)+'仓储结算清单'+DUINO+'”中的单票仓储费汇总'),0,'" + strUserID + "',getdate(),1,DUIGID,LINENUM=(select top 1 LINENUM=isnull((select top 1 LINENUM from ch_fee where bsno=(select top 1 bsno from v_op_bill where mblno=[wms_settlement_detail].blno) and feetype=1 order by LINENUM desc),0)+1),0,sum(isnull(OUTFEE,0)),0,0,sum(isnull(OUTFEE,0)),0"
+ " from [wms_settlement_detail] where CORPID='" + strCompanyID + "' and ISLOCK=0 and ISDELETE=0 and isnull(OUTFEE,0)<>0 and DUIGID in (" + feegids + ")" + strRange + " group by blno,CUSTOMERNAME,CREATEUSER,CORPID,DUINO,DUIGID";//CREATEUSER='" + strUserID + "' and
existVal = SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, strSql.ToString(), null);
}
#endregion #endregion
#region 把【仓储结算明细表wms_settlement_detail】中的指定数据锁定 #region 把【仓储结算明细表wms_settlement_detail】中的指定数据锁定
strSql = "update wms_settlement_detail set ISLOCK=1,LOCKUSER='" + strUserID + "',LOCKTIME=getdate() where ISLOCK=0 and DUIGID in (" + gids + ")" + strRange; strSql = "update wms_settlement_detail set ISLOCK=1,LOCKUSER='" + strUserID + "',LOCKTIME=getdate() where ISLOCK=0 and DUIGID in (" + gids + ")" + strRange;
existVal = SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, strSql.ToString(), null); existVal = SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, strSql.ToString(), null);
@ -1609,12 +1654,16 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
#endregion #endregion
sqlTran.Commit(); sqlTran.Commit();
//20221128 对于费用锁定的业务 其费用生成到一个该业务下新增的费用更改单上
(, wms_settlement_detailList, strUserID);
} }
catch (Exception) catch (Exception e)
{ {
sqlTran.Rollback(); sqlTran.Rollback();
result.Success = false; result.Success = false;
result.Message = "操作出现错误,请重试或联系系统管理员"; result.Message = "操作出现错误["+e.Message+"],请重试或联系系统管理员";
return result; return result;
} }
finally finally
@ -1627,6 +1676,97 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
result.Message = "操作成功!(注意如果用户权限不够,将不予以入账!)"; result.Message = "操作成功!(注意如果用户权限不够,将不予以入账!)";
return result; return result;
} }
/// <summary>
/// 20221128 逻辑是 从vopbs中 取得 bsno in(bsnolist)的 费用锁定(feestatus=1)的业务
/// </summary>
/// <param name="BSNOList"></param>
/// <returns></returns>
private static List<v_op_bs_mb> get(List<string> DUIGIDList, out List<wms_settlement_detail_md> DetailList) {
var result = new List<v_op_bs_mb>();
var cdc = new CommonDataContext();
DetailList = cdc.wms_settlement_detail.Where(x => DUIGIDList.Contains(x.DUIGID)).ToList();
var bsnoList = DetailList.Select(s => s.GID_LINK).ToList();
var List = cdc.v_op_bs.Where(x => bsnoList.Contains(x.BSNO) && x.FEESTATUS == 1).ToList();
bsnoList = List.Select(s => s.BSNO).ToList();
DetailList = cdc.wms_settlement_detail.Where(x => bsnoList.Contains(x.GID_LINK)).ToList();
return List;
}
private static void (List<v_op_bs_mb> vOpBsList, List<wms_settlement_detail_md> DetailList,string USERID)
{
//遍历业务
var cdc = new CommonDataContext();
var codefeelist = cdc.code_fee.Where(x => x.NAME == "仓储费").ToList();
foreach (var vopbs in vOpBsList) {
var wmssettlementDetailList = DetailList.Where(x => x.GID_LINK == vopbs.BSNO).ToList();
var head = new MsOpAmend();
head.BSNO = Guid.NewGuid().ToString();
head.GID = head.BSNO;
head.PARENTID = vopbs.BSNO;
head.FEESTATUS = false ;
head.ACCDATE = System.DateTime.Now.ToString("yyyy-MM");
var _user = cdc.VW_user.FirstOrDefault(x => x.USERID == USERID);
head.CREATETIME = "";
var GidList = wmssettlementDetailList.Select(s => s.DUIGID).Distinct().ToList();
var = cdc.wms_settlement_list.Where(x => GidList.Contains(x.GID)).ToList();
var billnolist = .Select(s => s.DUINO).ToArray();
head.REMARKS = "仓储对账单【"+ String.Join(",", billnolist) + "】自动产生";
var mschfeecontroller = new DSWeb.MvcShipping.Controllers.MsChFeeController();
var addfeelist = new List<ch_fee_md>();
void addfee(ch_fee_md newfee) {
if (addfeelist.Exists(x => x.REMARK == newfee.REMARK))
{
addfeelist.First(x => x.REMARK == newfee.REMARK).AMOUNT += newfee.AMOUNT;
addfeelist.First(x => x.REMARK == newfee.REMARK).setTax(codefeelist);
}
else {
addfeelist.Add(newfee);
}
}
foreach (var detail in wmssettlementDetailList) {
var newfee = MsChFeeDAL.MsChFeeDAL.getChFee(USERID, head.BSNO, detail.CUSTOMERNAME, 1, "仓储费", (decimal)detail.OUTFEE, "单票", 1,detail.DUINO);
newfee.BSNO = "*";
addfee(newfee);
}
var chfeelist = AutoMapperHelper.MapToList<ch_fee_md, MsChFee>(addfeelist);
mschfeecontroller.SaveAmend_Object(head.BSNO, head, chfeelist, null,USERID, _user.SHOWNAME,_user.COMPANYID);
var chfeeAudit = new Chfee_AuditController();
var feeidlist = string.Join(",", addfeelist.Select(s => s.GID).ToList());
chfeeAudit.SubmitAuditAmend_Object(feeidlist, "op_other", USERID, _user.COMPANYID);
}
}
#endregion #endregion
#region 取消入账 #region 取消入账
@ -1701,9 +1841,55 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
} }
#endregion #endregion
#region 从【仓储结算明细临时表wms_settlement_detail】中提取数据按提单号循环插入ch_Fee因为添加锁定功能则暂时屏蔽 #region 如果存在 备注中包含仓储结算清单wms_settlement_list.duino的 ch_fee 且费用状态不为1或6 则不允许取消
string strSql = "delete from ch_fee where WMSOUTBSNO in (select gid from wms_settlement_list where ISLOCK=1 and gid in(" + gids + ") " + strRange + ")"; //如不存在 则查询 备注中包含仓储结算清单wms_settlement_list.duino的更改单 ;和 备注中包含仓储结算清单wms_settlement_list.duino 且费用状态不为1或6 的 ch_fee ,将他们都删除
var cdc = new CommonDataContext();
//var _user = cdc.VW_user.First(x => x.USERID == strUserID);
var List = GetDataList("GID in("+gids+")",strUserID,strCompanyID, "","","");
var BillNoList = List.Select(s => s.DUINO).ToList();
//var 更改单List = MsChFeeDAL.MsChFeeDAL.GetAmendList(" GID in("+gids+")");
var FeeList = cdc.ch_fee.Where(x => BillNoList.Contains(x.REMARK) && (x.FEESTATUS!=1 && x.FEESTATUS != 6)).ToList();
if (FeeList != null && FeeList.Count > 0) {
sqlTran.Rollback();
result.Success = false;
result.Message = "有在费用更改单中“已申请开票、已开发票、已对帐”的费用,不允许取消入账,请重新操作!";
return result;
}
var FeeList = cdc.ch_fee.Where(x => BillNoList.Contains(x.REMARK) && (x.FEESTATUS == 1 || x.FEESTATUS == 6)).ToList();
var bsnoList = FeeList.Select(s => s.BSNO).ToList();
var FeeList = cdc.ch_fee.Where(x => bsnoList.Contains(x.BSNO) && (x.FEESTATUS != 1 && x.FEESTATUS != 6)).ToList();
if (FeeList != null && FeeList.Count > 0)
{
sqlTran.Rollback();
result.Success = false;
result.Message = "有在费用更改单中“已申请开票、已开发票、已对帐”的费用,不允许取消入账,请重新操作!";
return result;
}
//现在可以删除这些费用和更改单了
var bsnoListStr ="'"+ string.Join("','", bsnoList)+ "'";
string strSql = "delete from op_amend where BSNO in ("+ bsnoListStr + ")";
strSql += "delete from ch_fee where BSNO in ("+ bsnoListStr + ")";
int existVal = SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, strSql.ToString(), null); int existVal = SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, strSql.ToString(), null);
#endregion
#region 从【仓储结算明细临时表wms_settlement_detail】中提取数据按提单号循环插入ch_Fee因为添加锁定功能则暂时屏蔽
strSql = "delete from ch_fee where WMSOUTBSNO in (select gid from wms_settlement_list where ISLOCK=1 and gid in(" + gids + ") " + strRange + ")";
existVal = SqlHelper.ExecuteNonQuery(sqlTran, CommandType.Text, strSql.ToString(), null);
#endregion #endregion
#region 把【仓储结算明细表wms_settlement_detail】中的指定数据锁定 #region 把【仓储结算明细表wms_settlement_detail】中的指定数据锁定
@ -1754,7 +1940,7 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
/// <param name="sBillno">出库单号或其他单据号</param> /// <param name="sBillno">出库单号或其他单据号</param>
/// <param name="ck_jsfee">是否计算仓储费</param> /// <param name="ck_jsfee">是否计算仓储费</param>
/// <returns></returns> /// <returns></returns>
public static String getWmsRate2(SqlTransaction sqlTran, string strSTARTBILLINGDATE, string strOLDCUSTFEEDATE, string strINBSNO, string strCUSTOMERNAME, Decimal outnums, string strASSOCIATEDNO, int strFEETYPE, string strUserID, string strShowName, string sBillno, bool ck_jsfee, bool isKuCun) public static String getWmsRate2(SqlTransaction sqlTran, string strSTARTBILLINGDATE, string strOLDCUSTFEEDATE, string strINBSNO, string strCUSTOMERNAME, decimal outnums, string strASSOCIATEDNO, int strFEETYPE, string strUserID, string strShowName, string sBillno, bool ck_jsfee, bool isKuCun)
{ {
string sR = ""; string sR = "";
int iState = 0; int iState = 0;
@ -1768,7 +1954,7 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
int feedays = 0;//区间仓储数 int feedays = 0;//区间仓储数
int prescale = 0;//总计费区间仓储数 int prescale = 0;//总计费区间仓储数
int feeMonth = 0;//区间仓储月数 int feeMonth = 0;//区间仓储月数
Decimal sumfee = 0;//总仓储费 decimal sumfee = 0;//总仓储费
string strSTARTBILLINGDATE2 = strSTARTBILLINGDATE;//按区间计费的开始计费日期 string strSTARTBILLINGDATE2 = strSTARTBILLINGDATE;//按区间计费的开始计费日期
#region 删除费率出库明细表的区间仓储费 #region 删除费率出库明细表的区间仓储费
@ -1837,8 +2023,8 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
if (dsrate.Tables[0].Rows.Count > 0) if (dsrate.Tables[0].Rows.Count > 0)
{ {
int nowscale = 0;//区间计费区间(仓储月数/天数) int nowscale = 0;//区间计费区间(仓储月数/天数)
Decimal price = 0;//计费单价 decimal price = 0;//计费单价
Decimal gradefee = 0;//区间仓储费 decimal gradefee = 0;//区间仓储费
int nowgrade = 1; int nowgrade = 1;
for (int i = 0; i < dsrate.Tables[0].Rows.Count; i++) for (int i = 0; i < dsrate.Tables[0].Rows.Count; i++)
@ -1853,9 +2039,9 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
WmsRateDetailEntity model = new WmsRateDetailEntity(); WmsRateDetailEntity model = new WmsRateDetailEntity();
//nowgrade = int.Parse(dsrate.Tables[0].Rows[i]["FEEGRADE"].ToString());//计费等级 //nowgrade = int.Parse(dsrate.Tables[0].Rows[i]["FEEGRADE"].ToString());//计费等级
nowscale = int.Parse(dsrate.Tables[0].Rows[i]["FEESCALE"].ToString());//计费区间 nowscale = int.Parse(dsrate.Tables[0].Rows[i]["FEESCALE"].ToString());//计费区间
price = Decimal.Parse(dsrate.Tables[0].Rows[i]["FEEPRICE"].ToString());//计费单价 price = decimal.Parse(dsrate.Tables[0].Rows[i]["FEEPRICE"].ToString());//计费单价
Decimal ADDPRICE = Decimal.Parse(dsrate.Tables[0].Rows[i]["ADDPRICE"].ToString());//增值价 decimal ADDPRICE = decimal.Parse(dsrate.Tables[0].Rows[i]["ADDPRICE"].ToString());//增值价
Decimal CAPPRICE = Decimal.Parse(dsrate.Tables[0].Rows[i]["CAPPRICE"].ToString());// decimal CAPPRICE = decimal.Parse(dsrate.Tables[0].Rows[i]["CAPPRICE"].ToString());//
string FEEUNIT = dsrate.Tables[0].Rows[i]["FEEUNIT"].ToString();//计费单位 string FEEUNIT = dsrate.Tables[0].Rows[i]["FEEUNIT"].ToString();//计费单位
string ENDBILLINGDATE = dsrate.Tables[0].Rows[i]["ENDBILLINGDATE"].ToString();//结束计费日期 string ENDBILLINGDATE = dsrate.Tables[0].Rows[i]["ENDBILLINGDATE"].ToString();//结束计费日期
//计算区间是按天或按月 //计算区间是按天或按月
@ -1900,7 +2086,7 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
//int imod = (int)(sjMonth % nowscale); //int imod = (int)(sjMonth % nowscale);
int idiv = (int)(sjMonth2 / nowscale); int idiv = (int)(sjMonth2 / nowscale);
int imod = (int)(sjMonth2 % nowscale); int imod = (int)(sjMonth2 % nowscale);
Decimal dprice = price;//计费单价 decimal dprice = price;//计费单价
for (int j = 0; j < idiv; j++)//循环求增值费率 for (int j = 0; j < idiv; j++)//循环求增值费率
{ {
//--- BEGIN --- 如果是月则计算开始和结束日期之间的天数 //--- BEGIN --- 如果是月则计算开始和结束日期之间的天数
@ -2116,7 +2302,7 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
//int imod = (int)(sjMonth % nowscale); //int imod = (int)(sjMonth % nowscale);
int idiv = (int)(sjMonth2 / nowscale); int idiv = (int)(sjMonth2 / nowscale);
int imod = (int)(sjMonth2 % nowscale); int imod = (int)(sjMonth2 % nowscale);
Decimal dprice = price;//计费单价 decimal dprice = price;//计费单价
for (int j = 0; j < idiv; j++)//循环求增值费率 for (int j = 0; j < idiv; j++)//循环求增值费率
{ {
//--- BEGIN --- 如果是月则计算开始和结束日期之间的天数 //--- BEGIN --- 如果是月则计算开始和结束日期之间的天数
@ -2411,7 +2597,7 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
/// <param name="sBillno">出库单号或其他单据号</param> /// <param name="sBillno">出库单号或其他单据号</param>
/// <param name="ck_jsfee">是否计算仓储费</param> /// <param name="ck_jsfee">是否计算仓储费</param>
/// <returns></returns> /// <returns></returns>
public static void getWmsRate(SqlTransaction sqlTran, string strSTARTBILLINGDATE, string strOLDCUSTFEEDATE, string strINBSNO, string strCUSTOMERNAME, Decimal outnums, string strASSOCIATEDNO, int strFEETYPE, string strUserID, string strShowName, string sBillno, bool ck_jsfee, bool isKuCun) public static void getWmsRate(SqlTransaction sqlTran, string strSTARTBILLINGDATE, string strOLDCUSTFEEDATE, string strINBSNO, string strCUSTOMERNAME, decimal outnums, string strASSOCIATEDNO, int strFEETYPE, string strUserID, string strShowName, string sBillno, bool ck_jsfee, bool isKuCun)
{ {
int iState = 0; int iState = 0;
int result = 0; int result = 0;
@ -2456,8 +2642,8 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
#region 基本信息 #region 基本信息
int iCount = dsrate.Tables[0].Rows.Count; int iCount = dsrate.Tables[0].Rows.Count;
int nowscale = 0;//区间计费区间(仓储月数/天数) int nowscale = 0;//区间计费区间(仓储月数/天数)
Decimal price = 0;//计费单价 decimal price = 0;//计费单价
Decimal gradefee = 0;//区间仓储费 decimal gradefee = 0;//区间仓储费
int nowgrade = 1; int nowgrade = 1;
#endregion #endregion
@ -2467,9 +2653,9 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
WmsRateDetailEntity model = new WmsRateDetailEntity(); WmsRateDetailEntity model = new WmsRateDetailEntity();
//nowgrade = int.Parse(dsrate.Tables[0].Rows[i]["FEEGRADE"].ToString());//计费等级 //nowgrade = int.Parse(dsrate.Tables[0].Rows[i]["FEEGRADE"].ToString());//计费等级
nowscale = int.Parse(dsrate.Tables[0].Rows[i]["FEESCALE"].ToString());//计费区间 nowscale = int.Parse(dsrate.Tables[0].Rows[i]["FEESCALE"].ToString());//计费区间
price = Decimal.Parse(dsrate.Tables[0].Rows[i]["FEEPRICE"].ToString());//计费单价 price = decimal.Parse(dsrate.Tables[0].Rows[i]["FEEPRICE"].ToString());//计费单价
Decimal ADDPRICE = Decimal.Parse(dsrate.Tables[0].Rows[i]["ADDPRICE"].ToString());//增值价 decimal ADDPRICE = decimal.Parse(dsrate.Tables[0].Rows[i]["ADDPRICE"].ToString());//增值价
Decimal CAPPRICE = Decimal.Parse(dsrate.Tables[0].Rows[i]["CAPPRICE"].ToString());//封顶价 decimal CAPPRICE = decimal.Parse(dsrate.Tables[0].Rows[i]["CAPPRICE"].ToString());//封顶价
string FEEUNIT = dsrate.Tables[0].Rows[i]["FEEUNIT"].ToString();//计费单位 string FEEUNIT = dsrate.Tables[0].Rows[i]["FEEUNIT"].ToString();//计费单位
string ENDBILLINGDATE = dsrate.Tables[0].Rows[i]["ENDBILLINGDATE"].ToString();//结束计费日期 string ENDBILLINGDATE = dsrate.Tables[0].Rows[i]["ENDBILLINGDATE"].ToString();//结束计费日期
//计算区间是按天或按月 //计算区间是按天或按月
@ -2488,7 +2674,7 @@ namespace DSWeb.MvcShipping.DAL.RptWmsSettlementListDAL
if (ADDPRICE > 0) if (ADDPRICE > 0)
{ {
#region 有增值价 #region 有增值价
Decimal dprice = price;//计费单价 decimal dprice = price;//计费单价
if (isKuCun && DateTime.Parse(strSTARTBILLINGDATE2) > DateTime.Parse(dsrate.Tables[0].Rows[i]["ENDBILLINGDATE"].ToString())) if (isKuCun && DateTime.Parse(strSTARTBILLINGDATE2) > DateTime.Parse(dsrate.Tables[0].Rows[i]["ENDBILLINGDATE"].ToString()))
{ {
#region 有增值价时,如果开始计费日期大于当前区间的结束计费日期,则需计算开始计费的单价 #region 有增值价时,如果开始计费日期大于当前区间的结束计费日期,则需计算开始计费的单价

@ -348,7 +348,7 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
} else { } else {
existWMSNO += dataArr[i].data.WMSNO + ','; existWMSNO += dataArr[i].data.WMSNO + ',';
temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSL)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSL),4);
//temp += parseFloat(dataArr[i].data.GOODSRKSL); //temp += parseFloat(dataArr[i].data.GOODSRKSL);
} }
@ -363,12 +363,12 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
existWMSINGID += dataArr[i].data.WMSINGID + ','; existWMSINGID += dataArr[i].data.WMSINGID + ',';
existWMSNO += dataArr[i].data.WMSNO + ','; existWMSNO += dataArr[i].data.WMSNO + ',';
//temp += parseFloat(dataArr[i].data.GOODSRKSL); //temp += parseFloat(dataArr[i].data.GOODSRKSL);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSL)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSL), 4);
} else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) {
existWMSINGID += dataArr[i].data.WMSINGID + ','; existWMSINGID += dataArr[i].data.WMSINGID + ',';
//temp += parseFloat(dataArr[i].data.GOODSRKSL); //temp += parseFloat(dataArr[i].data.GOODSRKSL);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSL)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSL), 4);
} else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 &&
existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) {
continue; continue;
@ -406,7 +406,7 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
existWMSNO += dataArr[i].data.WMSNO + ','; existWMSNO += dataArr[i].data.WMSNO + ',';
//temp += parseFloat(dataArr[i].data.GOODSRKSLACTUAL); //temp += parseFloat(dataArr[i].data.GOODSRKSLACTUAL);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSLACTUAL)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSLACTUAL), 4);
} }
} }
@ -419,13 +419,13 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
existWMSINGID += dataArr[0].data.WMSINGID + ','; existWMSINGID += dataArr[0].data.WMSINGID + ',';
existWMSNO += dataArr[i].data.WMSNO + ','; existWMSNO += dataArr[i].data.WMSNO + ',';
//temp += parseFloat(dataArr[i].data.GOODSRKSLACTUAL); //temp += parseFloat(dataArr[i].data.GOODSRKSLACTUAL);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSLACTUAL)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSLACTUAL), 4);
} else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) {
existWMSINGID += dataArr[i].data.WMSINGID + ','; existWMSINGID += dataArr[i].data.WMSINGID + ',';
//temp += parseFloat(dataArr[i].data.GOODSRKSLACTUAL); //temp += parseFloat(dataArr[i].data.GOODSRKSLACTUAL);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSLACTUAL)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSRKSLACTUAL), 4);
} else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 &&
@ -464,7 +464,7 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
} else { } else {
existOUTBSNO += dataArr[i].data.OUTBSNO_OUT + ','; existOUTBSNO += dataArr[i].data.OUTBSNO_OUT + ',';
temp = Add(temp, parseFloat(dataArr[i].data.GOODSPFSL_OUT)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSPFSL_OUT), 4);
// temp += parseFloat(dataArr[i].data.GOODSPFSL_OUT); // temp += parseFloat(dataArr[i].data.GOODSPFSL_OUT);
} }
@ -472,7 +472,7 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
} else if (cbDetail == true) { } else if (cbDetail == true) {
for (var i = 0; i < dataArr.length; i++) { for (var i = 0; i < dataArr.length; i++) {
//temp += parseFloat(dataArr[i].data.GOODSPFSL_OUT); //temp += parseFloat(dataArr[i].data.GOODSPFSL_OUT);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSPFSL_OUT)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSPFSL_OUT), 4);
} }
} }
@ -501,7 +501,7 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
existWMSNO += dataArr[i].data.WMSNO + ','; existWMSNO += dataArr[i].data.WMSNO + ',';
//temp += parseFloat(dataArr[i].data.GOODSSTOCK); //temp += parseFloat(dataArr[i].data.GOODSSTOCK);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSSTOCK)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSSTOCK), 4);
} }
} }
@ -514,11 +514,11 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
existWMSINGID += dataArr[i].data.WMSINGID + ','; existWMSINGID += dataArr[i].data.WMSINGID + ',';
existWMSNO += dataArr[i].data.WMSNO + ','; existWMSNO += dataArr[i].data.WMSNO + ',';
//temp += parseFloat(dataArr[i].data.GOODSSTOCK); //temp += parseFloat(dataArr[i].data.GOODSSTOCK);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSSTOCK)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSSTOCK), 4);
} else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) { } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && existWMSINGID.indexOf(dataArr[i].data.WMSINGID) == -1) {
existWMSINGID += dataArr[i].data.WMSINGID + ','; existWMSINGID += dataArr[i].data.WMSINGID + ',';
temp = Add(temp, parseFloat(dataArr[i].data.GOODSSTOCK)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSSTOCK), 4);
//temp += parseFloat(dataArr[i].data.GOODSSTOCK); //temp += parseFloat(dataArr[i].data.GOODSSTOCK);
} else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 && } else if (existWMSNO.indexOf(dataArr[i].data.WMSNO) >= 0 &&
@ -561,7 +561,7 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
} else { } else {
existOUTBSNO += dataArr[i].data.OUTBSNO_OUT + ','; existOUTBSNO += dataArr[i].data.OUTBSNO_OUT + ',';
temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEE_OUT)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEE_OUT), 4);
//temp += parseFloat(dataArr[i].data.GOODSOUTFEE_OUT); //temp += parseFloat(dataArr[i].data.GOODSOUTFEE_OUT);
} }
@ -569,7 +569,7 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
} else if (cbDetail == true) { } else if (cbDetail == true) {
for (var i = 0; i < dataArr.length; i++) { for (var i = 0; i < dataArr.length; i++) {
//temp += parseFloat(dataArr[i].data.GOODSOUTFEE_OUT); //temp += parseFloat(dataArr[i].data.GOODSOUTFEE_OUT);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEE_OUT)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEE_OUT), 4);
} }
} }
@ -600,7 +600,7 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
existOUTBSNO += dataArr[i].data.OUTBSNO_OUT + ','; existOUTBSNO += dataArr[i].data.OUTBSNO_OUT + ',';
//temp += parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT); //temp += parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT), 4);
} }
@ -608,7 +608,7 @@ Ext.extend(Shipping.WMSDetailIndexNew, Ext.Panel, {
} else if (cbDetail == true) { } else if (cbDetail == true) {
for (var i = 0; i < dataArr.length; i++) { for (var i = 0; i < dataArr.length; i++) {
//temp += parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT); //temp += parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT);
temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT)); temp = Add(temp, parseFloat(dataArr[i].data.GOODSOUTFEEAP_OUT), 4);
} }
} }

Loading…
Cancel
Save