发票申请bug修复

usertest
嵇文龙 3 months ago
parent e8d8692142
commit a6322caf55

@ -26,17 +26,17 @@ namespace DS.WMS.Core.Application.Dtos
public string? CustomerName { get; set; }
/// <summary>
/// 客户银行账号ID
/// RMB客户银行ID
/// </summary>
public long? CustomerBankId { get; set; }
/// <summary>
/// 客户银行
/// RMB银行名称
/// </summary>
public string? CustomerBank { get; set; }
public string? CustomerBankName { get; set; }
/// <summary>
/// 客户银行
/// RMB银行账号
/// </summary>
public string? CustomerAccount { get; set; }

@ -91,11 +91,6 @@ namespace DS.WMS.Core.Application.Dtos
/// </summary>
public string? InvoiceBillNO { get; set; }
/// <summary>
/// 开票币别
/// </summary>
public string InvoiceCurrency { get; set; }
/// <summary>
/// 金额描述
/// </summary>
@ -123,6 +118,21 @@ namespace DS.WMS.Core.Application.Dtos
/// </summary>
public string? InvoiceRemark { get; set; }
/// <summary>
/// USD客户银行ID
/// </summary>
public long? USDCustomerBankId { get; set; }
/// <summary>
/// USD银行名称
/// </summary>
public string? USDCustomerBankName { get; set; }
/// <summary>
/// USD银行账号
/// </summary>
public string? USDCustomerAccount { get; set; }
/// <summary>
/// 创建人ID
/// </summary>

@ -43,7 +43,7 @@ namespace DS.WMS.Core.Application.Entity
/// <summary>
/// 客户银行账号ID
/// </summary>
[SugarColumn(ColumnDescription = "客户银行账号ID", Length = 100)]
[SugarColumn(ColumnDescription = "客户银行账号ID", IsNullable = true)]
public long? CustomerBankId { get; set; }
/// <summary>
@ -61,7 +61,7 @@ namespace DS.WMS.Core.Application.Entity
/// <summary>
/// 所属分部
/// </summary>
[SugarColumn(ColumnDescription = "所属分部")]
[SugarColumn(ColumnDescription = "所属分部", IsNullable = true)]
public long? SaleDeptId { get; set; }
/// <summary>

@ -1,4 +1,5 @@
using DS.Module.Core.Enums;
using DS.WMS.Core.Info.Entity;
using SqlSugar;
namespace DS.WMS.Core.Application.Entity
@ -9,6 +10,18 @@ namespace DS.WMS.Core.Application.Entity
[SugarTable("application_invoice", TableDescription = "发票申请单")]
public class InvoiceApplication : ApplicationForm
{
/// <summary>
/// 客户银行美元账号ID
/// </summary>
[SugarColumn(ColumnDescription = "客户银行美元账号ID", IsNullable = true)]
public long? USDCustomerBankId { get; set; }
/// <summary>
/// 客户银行美元账号
/// </summary>
[Navigate(NavigateType.OneToOne, nameof(USDCustomerBankId))]
public InfoClientBank? USDCustomerBank { get; set; }
/// <summary>
/// 状态
/// </summary>
@ -33,12 +46,6 @@ namespace DS.WMS.Core.Application.Entity
[SugarColumn(ColumnDescription = "发票单据号", Length = 30, IsNullable = true)]
public string? InvoiceBillNO { get; set; }
/// <summary>
/// 开票币别
/// </summary>
[SugarColumn(ColumnDescription = "开票币别", Length = 3, IsNullable = false)]
public string? InvoiceCurrency { get; set; }
/// <summary>
/// 发票税率
/// </summary>
@ -49,7 +56,7 @@ namespace DS.WMS.Core.Application.Entity
/// 纳税人识别号
/// </summary>
[SugarColumn(ColumnDescription = "纳税人识别号", Length = 60, IsNullable = false)]
public string TaxID { get; set; }
public string TaxID { get; set; } = string.Empty;
/// <summary>
/// 申请金额
@ -63,12 +70,6 @@ namespace DS.WMS.Core.Application.Entity
[SugarColumn(ColumnDescription = "申请金额大写", Length = 100, IsNullable = true)]
public string? AmountUppercase { get; set; }
/// <summary>
/// 所属机构(公司)
/// </summary>
[SugarColumn(ColumnDescription = "所属机构(公司)")]
public long? OrgId { get; set; }
/// <summary>
/// 客户地址电话
/// </summary>

@ -14,7 +14,7 @@ namespace DS.WMS.Core.Application.Interface
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
Task<DataResult<List<InvoiceApplicationDto>>> GetListAsync(PageRequest request);
Task<DataResult<List<InvoiceApplicationDto>>> GetListAsync(PageRequest<bool?> request);
}

@ -31,7 +31,8 @@ namespace DS.WMS.Core.Application.Method
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public async Task<DataResult<List<InvoiceApplicationDto>>> GetListAsync(PageRequest request)
/// <remarks>注意!!【仅查看待审核】需要通过 OtherQueryCondition 属性传入</remarks>
public async Task<DataResult<List<InvoiceApplicationDto>>> GetListAsync(PageRequest<bool?> request)
{
var query = CreateListQuery();
@ -39,28 +40,14 @@ namespace DS.WMS.Core.Application.Method
{
var whereList = Db.ConfigQuery.Context.Utilities.JsonToConditionalModels(request.QueryCondition);
int? index = null;
foreach (var item in whereList)
//设置了状态筛选
if (request.OtherQueryCondition.HasValue)
{
ConditionalModel? model = item as ConditionalModel;
if (model == null)
continue;
//设置了状态筛选
if (string.Equals(model.FieldName, nameof(InvoiceApplicationDto.IsAudited)) && bool.TryParse(model.FieldValue, out bool isAudited))
{
if (isAudited)
query = query.Where(x => x.Status == InvoiceApplicationStatus.AuditPassed || x.Status == InvoiceApplicationStatus.AuditRejected);
else
query = query.Where(x => x.Status == InvoiceApplicationStatus.AuditSubmittd);
index = whereList.IndexOf(item);
break;
}
if (request.OtherQueryCondition.Value)
query = query.Where(x => x.Status == InvoiceApplicationStatus.AuditPassed || x.Status == InvoiceApplicationStatus.AuditRejected);
else
query = query.Where(x => x.Status == InvoiceApplicationStatus.AuditSubmittd);
}
if (index.HasValue)
whereList.RemoveAt(index.Value);
query = query.Where(whereList);
}

@ -48,7 +48,6 @@ namespace DS.WMS.Core.Application.Method
InvoiceHeader = x.InvoiceHeader,
Currency = x.Currency,
ApplyAmount = x.ApplyAmount,
InvoiceCurrency = x.InvoiceCurrency,
InvoiceAmount = x.InvoiceAmount,
CreateTime = x.CreateTime, //申请时间
CreateBy = x.CreateBy, //申请人ID
@ -280,21 +279,20 @@ namespace DS.WMS.Core.Application.Method
public async Task<DataResult<InvoiceApplicationDto>> GetAsync(long id)
{
var dto = await TenantDb.Queryable<InvoiceApplication>().Where(a => a.Id == id)
.LeftJoin<InfoClientBank>((a, b) => a.CustomerBankId == b.Id)
.Select((a, b) => new InvoiceApplicationDto
.LeftJoin<InfoClientBank>((a, b1) => a.CustomerBankId == b1.Id)
.LeftJoin<InfoClientBank>((a, b1, b2) => a.USDCustomerBankId == b2.Id)
.Select((a, b1, b2) => new InvoiceApplicationDto
{
Id = a.Id,
ApplicationNO = a.ApplicationNO,
Currency = a.Currency,
CustomerId = a.CustomerId,
CustomerName = a.CustomerName,
CustomerBankId = a.CustomerBankId,
Status = a.Status,
CreateTime = a.CreateTime,
CreateBy = a.CreateBy,
InvoiceDate = a.InvoiceDate,
InvoiceAmount = a.InvoiceAmount,
InvoiceCurrency = a.InvoiceCurrency,
InvoiceHeader = a.InvoiceHeader,
InvoiceNO = a.InvoiceNO,
InvoiceBillNO = a.InvoiceBillNO,
@ -305,13 +303,21 @@ namespace DS.WMS.Core.Application.Method
OtherCurrencyAmount = a.OtherCurrencyAmount,
Category = a.Category,
CustomerAddTel = a.CustomerAddTel,
CustomerBank = b.BankName,
CustomerAccount = b.Account,
CustomerBankId = a.CustomerBankId,
CustomerBankName = b1.BankName,
CustomerAccount = b1.Account,
USDCustomerBankId = a.USDCustomerBankId,
USDCustomerBankName = b2.BankName,
USDCustomerAccount = b2.Account
}).FirstAsync();
if (dto != null)
{
dto.InvoiceDetails = await TenantDb.Queryable<InvoiceDetail>().Where(x => x.ApplicationId == dto.Id).ToListAsync();
dto.CreateByName = await Db.Queryable<SysUser>().Where(x => x.Id == dto.CreateBy).Select(x => x.UserName).FirstAsync();
dto.InvoiceDetails = await TenantDb.Queryable<InvoiceDetail>().Where(x => x.ApplicationId == dto.Id && x.Category == DetailCategory.InvoiceApplication).ToListAsync();
dto.Details = await TenantDb.Queryable<ApplicationDetail>().LeftJoin<FeeRecord>((d, f) => d.RecordId == f.Id)
.Where(d => d.ApplicationId == id).Select((d, f) => new InvoiceApplicationDetailDto
@ -524,9 +530,6 @@ namespace DS.WMS.Core.Application.Method
.UpdateColumns(x => new { x.OrderInvoiceAmount })
.ExecuteCommandAsync();
//if (application.InvoiceCurrency.IsNullOrEmpty())
// application.InvoiceCurrency = FeeCurrency.RMB_CODE;
await base.OnSaveAsync(application, fees);
}

@ -112,7 +112,7 @@ namespace DS.WMS.Core.Application.Method
Note = a.Note,
BillNO = s.CustomerNo, //业务编号=委托编号
CustomerBankId = a.CustomerBankId,
CustomerBank = b.BankName,
CustomerBankName = b.BankName,
CustomerAccount = b.Account
});

@ -99,7 +99,7 @@ namespace DS.WMS.Core.Application.Method
Note = a.Note,
BillNO = s.CustomerNo, //业务编号=委托编号
CustomerBankId = a.CustomerBankId,
CustomerBank = a.CustomerBank.BankName, //结算对象银行
CustomerBankName = a.CustomerBank.BankName, //结算对象银行
CustomerAccount = a.CustomerBank.Account, //结算对象账号
//汇总项
RestAmountRMB = SqlFunc.Subqueryable<FeeRecord>().Where(f => f.Id == d.RecordId && f.FeeStatus == FeeStatus.AuditPassed
@ -277,7 +277,7 @@ namespace DS.WMS.Core.Application.Method
CustomerId = a.CustomerId,
CustomerName = a.CustomerName,
CustomerBankId = a.CustomerBankId,
CustomerBank = b.BankAccountNo,
CustomerBankName = b.BankAccountNo,
Status = a.Status,
CreateTime = a.CreateTime,
CreateBy = a.CreateBy,

@ -31,8 +31,8 @@ namespace DS.WMS.Core.Op.Entity.TaskInteraction
/// <summary>
/// 内容模板
/// </summary>
[SugarColumn(ColumnDescription = "内容", ColumnDataType = "text", IsNullable = false)]
public string Content { get; set; } = string.Empty;
[SugarColumn(ColumnDescription = "内容", ColumnDataType = "longtext", IsNullable = false)]
public string? Content { get; set; }
/// <summary>
/// 客户名称

@ -265,7 +265,7 @@ namespace DS.WMS.Core.Settlement.Method
CustomerId = a.CustomerId,
CustomerName = a.CustomerName, //结算单位
CustomerBankId = a.CustomerBankId,
CustomerBank = a.CustomerBank.BankName, //结算对象银行
CustomerBankName = a.CustomerBank.BankName, //结算对象银行
CustomerAccount = a.CustomerBank.Account, //结算对象账号
Currency = a.Currency,
AmountRMB = a.AmountRMB.GetValueOrDefault(), //RMB申请金额

@ -28,6 +28,7 @@ namespace DS.WMS.FeeApi.Controllers
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
/// <remarks>注意!!【仅看待审批】需要通过 OtherQueryCondition 属性传入</remarks>
[HttpPost, Route("GetList")]
public async Task<DataResult<List<FeeAuditBusiness>>> ListAsync([FromBody] PageRequest<bool> request)
{

@ -30,7 +30,7 @@ namespace DS.WMS.FeeApi.Controllers
/// <param name="request"></param>
/// <returns></returns>
[HttpPost, Route("GetList")]
public async Task<DataResult<List<InvoiceApplicationDto>>> ListAsync([FromBody] PageRequest request)
public async Task<DataResult<List<InvoiceApplicationDto>>> ListAsync([FromBody] PageRequest<bool?> request)
{
return await _auditService.GetListAsync(request);
}

Loading…
Cancel
Save