調整匯款沖帳
This commit is contained in:
@@ -10,6 +10,7 @@ using System.Collections;
|
||||
using MyWeb;
|
||||
using System.Web.WebPages;
|
||||
using System.Data.Entity;
|
||||
using Model;
|
||||
|
||||
[ezAuthorize]
|
||||
public class transfer_registerController : ApiController
|
||||
@@ -269,6 +270,7 @@ public class transfer_registerController : ApiController
|
||||
public string check_memo { get; set; }
|
||||
public string draft { get; set; }
|
||||
public int? acc_kind { get; set; } // 新增關聯欄位
|
||||
public int? kind { get; set; }
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
@@ -315,7 +317,7 @@ public class transfer_registerController : ApiController
|
||||
{
|
||||
uptime = dto.check_date,
|
||||
category = 1, // 收入
|
||||
kind = 27, // 固定值:法會收入/功德項目
|
||||
kind = dto.kind,//27, // 固定值:法會收入/功德項目
|
||||
kind2 = dto.acc_num,
|
||||
price = (float)(dto.check_amount ?? 0),
|
||||
tax = 0,
|
||||
@@ -346,6 +348,7 @@ public class transfer_registerController : ApiController
|
||||
item.check_memo = dto.check_memo;
|
||||
item.draft = dto.draft;
|
||||
item.acc_kind = dto.acc_kind;
|
||||
|
||||
}
|
||||
}
|
||||
_db.SaveChanges();
|
||||
@@ -958,7 +961,10 @@ public class transfer_registerController : ApiController
|
||||
activity_name = x.activity != null ? x.activity.subject : "",
|
||||
activity_num = x.activity_num,
|
||||
acc_name = x.acc_num != null ? _db.accounting_kind2.Where(a => a.num == x.acc_num).Select(a => a.kind).FirstOrDefault() : "",
|
||||
|
||||
price_totals=_db.pro_order_detail.
|
||||
Where(a => _db.pro_order.Where (po=>po.f_num==x.f_num&&po.activity_num==x.activity_num).
|
||||
Select(po => po.order_no).Any(p=>p.Equals(a.order_no))).Sum(a => a.price*a.qty),
|
||||
pay_totals=_db.transfer_register.Where(a=>a.activity_num==x.activity_num&&a.f_num==x.f_num).Sum(a=>a.check_amount),
|
||||
// pro_order_record 資訊 (透過 transfer_id 關聯)
|
||||
pro_order_records = x.pro_order_record.Select(pr => new {
|
||||
pr.num,
|
||||
|
||||
Reference in New Issue
Block a user