|
|
|
@ -693,11 +693,30 @@ namespace DSWeb.Areas.Account.Controllers
|
|
|
|
|
|
|
|
|
|
public ContentResult Lock(string bill, string remark,string billtype="0")
|
|
|
|
|
{
|
|
|
|
|
var headData = ChsettlementDAL.GetData("BILLNO='" + bill + "'");
|
|
|
|
|
var errstr = "";
|
|
|
|
|
if (headData.AMOUNTRMB != 0 || headData.AMOUNTUSD != 0)
|
|
|
|
|
{
|
|
|
|
|
if (headData.ACCOUNTS_MONEY == 0 && headData.AHSR_MONEY == 0 && headData.PREPAY_MONEY == 0 && headData.FINANCIAL_MONEY == 0 && headData.ADVANCE_MONEY == 0)
|
|
|
|
|
{
|
|
|
|
|
errstr = errstr + " 预收付信息有错误不允许锁定!";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(errstr))
|
|
|
|
|
{
|
|
|
|
|
var result2 = new DBResult();
|
|
|
|
|
result2.Success = false;
|
|
|
|
|
result2.Message = errstr;
|
|
|
|
|
var json2 = JsonConvert.Serialize(result2);
|
|
|
|
|
return new ContentResult() { Content = json2 };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DBResult result = ChsettlementDAL.Lock(bill,remark);
|
|
|
|
|
if (result.Success) {
|
|
|
|
|
if (billtype == "2") {
|
|
|
|
|
var headData = ChsettlementDAL.GetData("BILLNO='"+ bill + "'");
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(headData.INVOICENO) || !string.IsNullOrEmpty(headData.INVOICEDATE) || !string.IsNullOrEmpty(headData.INVOICEAMOUNT))
|
|
|
|
|
{
|
|
|
|
|
T_ALL_DA T_ALL_DA = new T_ALL_DA();
|
|
|
|
@ -746,6 +765,26 @@ namespace DSWeb.Areas.Account.Controllers
|
|
|
|
|
public ContentResult LockListNew(string data)
|
|
|
|
|
{
|
|
|
|
|
var headList = JsonConvert.Deserialize<List<ChSettlement>>(data);
|
|
|
|
|
var errstr = "";
|
|
|
|
|
foreach (var bill in headList)
|
|
|
|
|
{
|
|
|
|
|
if (bill.AMOUNTRMB != 0 || bill.AMOUNTUSD != 0) {
|
|
|
|
|
if (bill.ACCOUNTS_MONEY == 0 && bill.AHSR_MONEY == 0 && bill.PREPAY_MONEY == 0 && bill.FINANCIAL_MONEY == 0 && bill.ADVANCE_MONEY == 0) {
|
|
|
|
|
errstr = errstr + " 单号:" + bill.BILLNO + " 预收付信息有错误";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (!string.IsNullOrEmpty(errstr)) {
|
|
|
|
|
var result2 = new DBResult();
|
|
|
|
|
result2.Success = false;
|
|
|
|
|
result2.Message = errstr+" 不能锁定";
|
|
|
|
|
var json2 = JsonConvert.Serialize(result2);
|
|
|
|
|
return new ContentResult() { Content = json2 };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DBResult result = ChsettlementDAL.LockListNew(headList);
|
|
|
|
|
|
|
|
|
|
var json = JsonConvert.Serialize(result);
|
|
|
|
|