|
|
@ -1,4 +1,4 @@ |
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.ComponentModel.DataAnnotations; |
|
|
|
using System.Linq; |
|
|
@ -82,7 +82,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpPost] |
|
|
|
[UnitOfWork(false)] |
|
|
|
[UnitOfWork(IsDisabled = false)] |
|
|
|
public virtual async Task<IActionResult> ApprovalPassed(List<string> p_invs) |
|
|
|
{ |
|
|
|
List<ERR_EXP_DTO> errors = new List<ERR_EXP_DTO>(); |
|
|
@ -189,9 +189,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
else if (invs.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) |
|
|
|
{ |
|
|
|
var B = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); |
|
|
|
|
|
|
|
B.OrderBy(p => p.LineCode); |
|
|
|
|
|
|
|
List<INVOICE_WAIT_DETAIL_BJ_DTO> BMap = new List<INVOICE_WAIT_DETAIL_BJ_DTO>(); |
|
|
|
foreach (var itm in B) |
|
|
|
{ |
|
|
@ -201,7 +199,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
bj.PRICE = itm.PRICE; |
|
|
|
bj.InvbillNum = itm.InvbillNum; |
|
|
|
bj.InvGroupNum = itm.InvGroupNum; |
|
|
|
bj.DeliveryNumber =itm.ExtraProperties["DeliveryIndexNumber"].ToSqlValue(); |
|
|
|
bj.DeliveryIndexNumber =itm.ExtraProperties["DeliveryIndexNumber"].ToSqlValue(); |
|
|
|
bj.Qty = itm.Qty; |
|
|
|
bj.PRICE = itm.PRICE; |
|
|
|
bj.Amt = Math.Round(itm.PRICE * itm.Qty, 2); |
|
|
@ -209,6 +207,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
bj.VendorCode = itm.ExtraProperties["VendorCode"].ToSqlValue();//供应商代码
|
|
|
|
bj.VendorName = itm.ExtraProperties["VendorName"].ToSqlValue();//供应商名称
|
|
|
|
bj.DeliveryNumber = itm.ExtraProperties["DeliveryNumber"].ToSqlValue();//交货号;
|
|
|
|
bj.BeginDate=itm.BeginDate; |
|
|
|
bj.EndDate = itm.EndDate; |
|
|
|
|
|
|
|
//bj.DeliveryNumber = itm.GetProperty("DeliveryNumber", "");//交货号
|
|
|
|
//bj.InvbillNum = itm.GetProperty("InvoiceNumber", "");//发票号
|
|
|
@ -223,32 +223,32 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
|
|
|
|
//var BMap = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_BJ_DTO>>(B);
|
|
|
|
var bjquery = from itm in BMap |
|
|
|
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum |
|
|
|
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp |
|
|
|
from tm in temp.DefaultIfEmpty() |
|
|
|
select |
|
|
|
new INVOICE_WAIT_DETAIL_BJ_DTO() |
|
|
|
{ |
|
|
|
PartDesc = tm == null ? string.Empty : itm.PartDesc, |
|
|
|
InvDate = itm1.CreationTime, |
|
|
|
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, |
|
|
|
//Version = itm.Version,
|
|
|
|
InvbillNum = itm.InvbillNum, |
|
|
|
InvGroupNum = itm.InvGroupNum, |
|
|
|
LU = itm.LU, |
|
|
|
PartCode = itm.PartCode, |
|
|
|
PRICE = itm.PRICE, |
|
|
|
Qty = itm.Qty, |
|
|
|
Amt = itm.Amt, |
|
|
|
DeliveryNumber = itm.DeliveryNumber , |
|
|
|
VendorCode = itm.VendorCode , |
|
|
|
VendorName = itm.VendorName , |
|
|
|
// PurchaseOrderNumber = itm.PurchaseOrderNumber,
|
|
|
|
DeliveryIndexNumber =itm.DeliveryIndexNumber , |
|
|
|
Extend1 = itm.Extend1, |
|
|
|
BeginDate = itm.BeginDate, |
|
|
|
EndDate = itm.EndDate, |
|
|
|
}; |
|
|
|
join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum |
|
|
|
join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp |
|
|
|
from tm in temp.DefaultIfEmpty() |
|
|
|
select |
|
|
|
new INVOICE_WAIT_DETAIL_BJ_DTO() |
|
|
|
{ |
|
|
|
PartDesc = tm == null ? string.Empty : itm.PartDesc, |
|
|
|
InvDate = itm1.CreationTime, |
|
|
|
RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, |
|
|
|
//Version = itm.Version,
|
|
|
|
InvbillNum = itm.InvbillNum, |
|
|
|
InvGroupNum = itm.InvGroupNum, |
|
|
|
LU = itm.LU, |
|
|
|
PartCode = itm.PartCode, |
|
|
|
PRICE = itm.PRICE, |
|
|
|
Qty = itm.Qty, |
|
|
|
Amt = itm.Amt, |
|
|
|
DeliveryNumber = itm.DeliveryNumber, |
|
|
|
VendorCode = itm.VendorCode, |
|
|
|
VendorName = itm.VendorName, |
|
|
|
// PurchaseOrderNumber = itm.PurchaseOrderNumber,
|
|
|
|
DeliveryIndexNumber = itm.DeliveryIndexNumber, |
|
|
|
Extend1 = itm.Extend1, |
|
|
|
BeginDate = itm.BeginDate, |
|
|
|
EndDate = itm.EndDate, |
|
|
|
}; |
|
|
|
entity.INVOICE_WAIT_DETAIL_BJ = bjquery.ToList(); |
|
|
|
} |
|
|
|
else |
|
|
@ -350,8 +350,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
.Select(p => new JIT_UNSETTLED_DETAIL_DTO { LU = p.Key.LU, GroupNum = p.Key.SettleGroupNum, Qty = p.Sum(itm => itm.Qty.Value) }); |
|
|
|
entity.JIT_UNSETTLED_DETAIL = unsettledList.ToList().OrderBy(p => p.GroupNum).ThenBy(p => p.LU).ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (first.BusinessType == EnumBusinessType.JisHBPO || first.BusinessType == EnumBusinessType.JisBBAC) |
|
|
|
{ |
|
|
|
entity.INVOICE_MAP_GROUP = lscompare.ToList().OrderBy(p => p.SettleGroupNum).ToList();//包含不可结结算分组号
|
|
|
@ -384,7 +382,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
}); |
|
|
|
} |
|
|
|
entity.MAIDAN_HBPO_UNSETTLED_DETAIL = unsettle; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
entity.ADJ_DETAIL = adjQuery.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList(); |
|
|
@ -495,7 +492,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
_excel.Append(hbpounsettle, "未结零件汇总"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC) |
|
|
|
{ |
|
|
|
if (jitunsettle != null) |
|
|
|
{ |
|
|
|
_excel.Append(jitunsettle, "未结零件汇总"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//jis业务,发票分组对应关系,未结数据,调整数据
|
|
|
|
if (first.BusinessType == EnumBusinessType.JisBBAC || first.BusinessType == EnumBusinessType.JisHBPO) |
|
|
|
{ |
|
|
|