|
|
|
@ -483,6 +483,57 @@ namespace DSWeb.MvcShipping.Controllers
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
var APPLYACCDATESAME = MsSysParamSetDAL.GetData("PARAMNAME='APPLYACCDATESAME'");
|
|
|
|
|
if (!string.IsNullOrEmpty(APPLYACCDATESAME.PARAMVALUE)) {
|
|
|
|
|
var nowperiod = ChMonthCloseDAL.GetData("", Convert.ToString(Session["COMPANYID"]));
|
|
|
|
|
if (APPLYACCDATESAME.PARAMVALUE == "ETD") {
|
|
|
|
|
if (Convert.ToDateTime(headData.ETD) >= Convert.ToDateTime(nowperiod.FDAY)) {
|
|
|
|
|
var myaccdate = Convert.ToDateTime(headData.ETD).ToString("yyyy-MM");
|
|
|
|
|
if (nowperiod.CLOSEDAY != 0) {
|
|
|
|
|
if (Convert.ToDateTime(headData.ETD).Day > nowperiod.CLOSEDAY) {
|
|
|
|
|
myaccdate = Convert.ToDateTime(headData.ETD).AddMonths(1).ToString("yyyy-MM");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
headData.ACCDATE = myaccdate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}else if (APPLYACCDATESAME.PARAMVALUE == "CUSTOMDATE")
|
|
|
|
|
{
|
|
|
|
|
if (Convert.ToDateTime(headData.CUSTOMDATE) >= Convert.ToDateTime(nowperiod.FDAY))
|
|
|
|
|
{
|
|
|
|
|
var myaccdate = Convert.ToDateTime(headData.CUSTOMDATE).ToString("yyyy-MM");
|
|
|
|
|
if (nowperiod.CLOSEDAY != 0)
|
|
|
|
|
{
|
|
|
|
|
if (Convert.ToDateTime(headData.CUSTOMDATE).Day > nowperiod.CLOSEDAY)
|
|
|
|
|
{
|
|
|
|
|
myaccdate = Convert.ToDateTime(headData.CUSTOMDATE).AddMonths(1).ToString("yyyy-MM");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
headData.ACCDATE = myaccdate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (APPLYACCDATESAME.PARAMVALUE == "OPDATE")
|
|
|
|
|
{
|
|
|
|
|
if (Convert.ToDateTime(headData.OPDATE) >= Convert.ToDateTime(nowperiod.FDAY))
|
|
|
|
|
{
|
|
|
|
|
var myaccdate = Convert.ToDateTime(headData.OPDATE).ToString("yyyy-MM");
|
|
|
|
|
if (nowperiod.CLOSEDAY != 0)
|
|
|
|
|
{
|
|
|
|
|
if (Convert.ToDateTime(headData.OPDATE).Day > nowperiod.CLOSEDAY)
|
|
|
|
|
{
|
|
|
|
|
myaccdate = Convert.ToDateTime(headData.OPDATE).AddMonths(1).ToString("yyyy-MM");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
headData.ACCDATE = myaccdate;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (headData.CORPID == ""||headData.CORPID ==null)
|
|
|
|
|
{
|
|
|
|
|
headData.CORPID = Convert.ToString(Session["COMPANYID"]);
|
|
|
|
|