zhangxiaofeng 3 months ago
commit 9514fd670e

@ -21,6 +21,18 @@ namespace DS.WMS.Core.Application.Entity
[SugarColumn(ColumnDescription = "申请单ID", IsNullable = false)]
public long ApplicationId { get; set; }
/// <summary>
/// 发票商品编码ID
/// </summary>
[SugarColumn(ColumnDescription = "发票商品编码ID", IsNullable = true)]
public long? CodeId { get; set; }
///// <summary>
///// 发票商品编码
///// </summary>
//[Navigate(NavigateType.OneToOne, nameof(CodeId))]
//public CodeInvoice? CodeInvoice { get; set; }
/// <summary>
/// 明细项名称
/// </summary>

@ -5,6 +5,7 @@ using DS.Module.Core.Extensions;
using DS.WMS.Core.Application.Dtos;
using DS.WMS.Core.Application.Entity;
using DS.WMS.Core.Application.Interface;
using DS.WMS.Core.Code.Entity;
using DS.WMS.Core.Fee.Dtos;
using DS.WMS.Core.Fee.Entity;
using DS.WMS.Core.Info.Entity;
@ -511,7 +512,7 @@ namespace DS.WMS.Core.Application.Method
await TenantDb.Deleteable<InvoiceDetail>().Where(x => x.ApplicationId == application.Id).ExecuteCommandAsync();
//然后根据申请单明细重新生成
await CreateInvoiceDetailsAsync([application]);
await FillInvoiceDetailsAsync([application]);
if (application.InvoiceDetails?.Count > 0)
{
@ -528,8 +529,8 @@ namespace DS.WMS.Core.Application.Method
await base.OnSaveAsync(application, fees);
}
//生成发票明细
async Task CreateInvoiceDetailsAsync(IEnumerable<InvoiceApplication> applications)
//根据费用明细填充发票明细
async Task FillInvoiceDetailsAsync(IEnumerable<InvoiceApplication> applications)
{
foreach (var application in applications)
{
@ -539,7 +540,8 @@ namespace DS.WMS.Core.Application.Method
if (application.Details.Count > 0 && (application.InvoiceDetails == null || application.InvoiceDetails.Count == 0))
{
var ids = application.Details.Select(x => x.RecordId).ToList();
var feesCodes = await TenantDb.Queryable<FeeRecord>().InnerJoin<FeeCode>((f, c) => f.FeeId == c.Id && ids.Contains(f.Id))
var feesCodes = await TenantDb.Queryable<FeeRecord>()
.InnerJoin<FeeCode>((f, c) => f.FeeId == c.Id && ids.Contains(f.Id))
.Select((f, c) => new
{
FeeId = c.Id,
@ -551,10 +553,24 @@ namespace DS.WMS.Core.Application.Method
Name = x.Key,
FeeIds = x.Select(y => y.FeeId)
}).ToList();
var goodsNames = list.Select(x => x.Name);
var invCodes = await TenantDb.Queryable<CodeInvoice>().Where(x => goodsNames.Contains(x.Name))
.Select(x => new
{
x.Id,
x.Name,
x.DefaultCurrency,
x.TaxRate,
x.Specification,
x.Unit
}).ToListAsync();
application.InvoiceDetails = new List<InvoiceDetail>(list.Count);
foreach (var item in list)
{
var invDetail = new InvoiceDetail
var invCode = invCodes.Find(x => x.Name == item.Name);
var detail = new InvoiceDetail
{
ApplicationId = application.Id,
Name = item.Name,
@ -563,10 +579,18 @@ namespace DS.WMS.Core.Application.Method
TaxUnitPrice = application.Details.FindAll(x => item.FeeIds.Contains(x.FeeId)).Sum(x => x.ApplyAmount),
Category = DetailCategory.InvoiceApplication
};
invDetail.TaxAmount = invDetail.TaxUnitPrice * application.TaxRate;
invDetail.UnitPrice = invDetail.TaxUnitPrice - invDetail.TaxAmount;
invDetail.Amount = invDetail.TaxUnitPrice * invDetail.Quantity;
application.InvoiceDetails.Add(invDetail);
if (invCode != null)
{
detail.TaxRate = invCode.TaxRate;
detail.Specification = invCode.Specification;
detail.Unit = invCode.Unit;
}
detail.TaxAmount = detail.TaxUnitPrice * application.TaxRate;
detail.UnitPrice = detail.TaxUnitPrice - detail.TaxAmount;
detail.Amount = detail.TaxUnitPrice * detail.Quantity;
application.InvoiceDetails.Add(detail);
}
}
}
@ -615,7 +639,7 @@ namespace DS.WMS.Core.Application.Method
await TenantDb.Deleteable<InvoiceDetail>().Where(x => appIds.Contains(x.ApplicationId)).ExecuteCommandAsync();
await CreateInvoiceDetailsAsync(applications);
await FillInvoiceDetailsAsync(applications);
var invDetails = applications.SelectMany(x => x.InvoiceDetails).ToList();
if (invDetails.Count > 0)
await TenantDb.Insertable(invDetails).ExecuteCommandAsync();

@ -40,12 +40,36 @@ namespace DS.WMS.Core.Code.Entity
[SugarColumn(ColumnDescription = "零税率标识")]
public ZeroTaxRateIdentification Identification { get; set; }
/// <summary>
/// 税收分类编码
/// </summary>
[SugarColumn(ColumnDescription = "税收分类编码", Length = 100, IsNullable = true)]
public string? TaxClassificationCode { get; set; }
/// <summary>
/// 税收分类名称
/// </summary>
[SugarColumn(ColumnDescription = "税收分类名称", Length = 100, IsNullable = true)]
public string? TaxClassificationName { get; set; }
/// <summary>
/// 是否含税
/// </summary>
[SugarColumn(ColumnDescription = "是否含税")]
public bool IsIncludingTax { get; set; }
/// <summary>
/// 是否享受优惠政策
/// </summary>
[SugarColumn(ColumnDescription = "是否享受优惠政策")]
public bool HasPreferentialPolicy { get; set; }
/// <summary>
/// 优惠政策说明
/// </summary>
[SugarColumn(ColumnDescription = "优惠政策说明", Length = 200, IsNullable = true)]
public string? PreferentialPolicyDescription { get; set; }
/// <summary>
/// 是否默认商品名
/// </summary>

@ -22,13 +22,6 @@ public interface IFeeCustTemplateDetailService
/// <param name="model"></param>
/// <returns></returns>
Task<DataResult> EditAsync(FeeCustTemplateDetailReq model);
/// <summary>
/// 获取详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
DataResult<FeeCustTemplateDetailRes> GetFeeCustTemplateDetailInfo(string id);
/// <summary>
/// 根据ID批量删除

@ -61,20 +61,6 @@ namespace DS.WMS.Core.Fee.Method
}
}
/// <summary>
/// 详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public DataResult<FeeCustTemplateDetailRes> GetFeeCustTemplateDetailInfo(string id)
{
var data = TenantDb.Queryable<FeeCustTemplateDetail>()
.Where(x => x.Id == long.Parse(id))
.Select<FeeCustTemplateDetailRes>()
.First();
return DataResult<FeeCustTemplateDetailRes>.Success(data, MultiLanguageConst.DataQuerySuccess);
}
/// <summary>
/// 根据ID批量删除
/// </summary>

@ -1,6 +1,7 @@
using DS.Module.Core;
using DS.WMS.Core.Application.Method;
using DS.WMS.Core.Invoice.Dtos;
using DS.WMS.Core.Sys.Entity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
@ -33,6 +34,12 @@ namespace DS.WMS.Core.Invoice.Method
{
ArgumentNullException.ThrowIfNull(ids, nameof(ids));
long userId = long.Parse(User.UserId);
var userInfo = await Db.Queryable<SysUser>().Where(x => x.Id == userId).Select(x => new
{
x.Id,
}).FirstAsync();
//请求参数设置
InvoiceIssuanceRequest request = new()
{

@ -4,6 +4,7 @@ using DS.WMS.Core.Code.Dtos;
using DS.WMS.Core.Op.Entity;
using Masuit.Tools.Systems;
using SqlSugar;
using System.ComponentModel;
namespace DS.WMS.Core.Op.Dtos;
@ -1458,4 +1459,10 @@ public class SeaExportRes
///
/// </summary>
public long OrgId { get; set; }
/// <summary>
/// 创建人名称
/// </summary>
[Description("创建人名称")]
public string CreateUserName { get; set; }
}

@ -1,4 +1,4 @@
@* @model DS.WMS.Core.Op.Entity.MailTemplateModel<DS.WMS.Core.TaskPlat.Dtos.TaskPOLContainerNotPickUpShowDto> *@
@* @model DS.WMS.Core.Op.Entity.MailTemplateModel<DS.WMS.Core.TaskPlat.Dtos.TaskBCTransferDto> *@
@{
var item = Model.Primary;
}
@ -18,42 +18,125 @@
</tr>
<tr>
<td>
<table class="out-table" border="0" cellpadding="8" cellspacing="0" width="800" bgcolor="#FFFFFF" align="center" style="font-size: 12px;font-family: Arial;">
<table class="out-table" border="0" cellpadding="8" cellspacing="0" width="800" bgcolor="#FFFFFF" align="center">
<tr>
<td>
<p>尊敬的客户,</p>
<p>Dear Customer,</p>
</td>
</tr>
<tr>
<td>
<table class="base-table" border="1" cellpadding="8" cellspacing="0" width="100%" align="center" style="border-collapse: collapse;border-color: #ebeef5;font-size: 12px;font-family: Arial;">
<table class="base-table" border="1" cellpadding="8" cellspacing="0" width="100%" align="center" style="border-collapse: collapse;border-color: #ebeef5">
<tr>
<td class="billno-label" width="120px;">船名/航次</td>
<td class="billno-val">@item.Vessel/@item.Voyno</td>
<td class="billno-label" width="15%">提单号</td>
<td class="billno-val" width="160">@item.MBLNo</td>
</tr>
<tr>
<td class="billno-label" width="120px;">定舱号码</td>
<td class="billno-val">@item.MBlNo</td>
<td class="takebillno-label" width="15%">提箱提单号</td>
<td class="takebillno-val" width="160">@item.RealMBLNo</td>
</tr>
<tr>
<td class="pol-label" width="15%">POL:</td>
<td class="pol-val" width="160">@item.OrigPlaceReceipt</td>
</tr>
<tr>
<td class="pod-label" width="15%">POD:</td>
<td class="pod-val" width="160">@item.OrigPlaceDelivery</td>
</tr>
<tr>
<td class="ctn-label" width="15%">箱型箱量:</td>
<td class="ctn-val" width="160">@item.CtnStat</td>
</tr>
@if (!string.IsNullOrWhiteSpace(@item.Vessel))
{
<tr>
<td class="etd-label" width="15%">船名 变更为:</td>
<td class="etd-val" width="160">@item.Vessel</td>
</tr>
}
@if (!string.IsNullOrWhiteSpace(@item.VoyNo))
{
<tr>
<td class="etd-label" width="15%">航次号 变更为:</td>
<td class="etd-val" width="160">@item.Vessel</td>
</tr>
}
@if (!string.IsNullOrWhiteSpace(@item.ETD))
{
<tr>
<td class="etd-label" width="15%">ETD 变更为:</td>
<td class="etd-val" width="160">@item.ETD</td>
</tr>
}
@if (!string.IsNullOrWhiteSpace(@item.ETA))
{
<tr>
<td class="eta-label" width="15%">ETA 变更为:</td>
<td class="eta-val" width="160">@item.ETA</td>
</tr>
}
@if (!string.IsNullOrWhiteSpace(@item.CustomSICutDate))
{
<tr>
<td class="eta-label" width="15%">样单截止日期 变更为:</td>
<td class="eta-val" width="160">@item.CustomSICutDate</td>
</tr>
}
@if (!string.IsNullOrWhiteSpace(@item.CYCutoffTime))
{
<tr>
<td class="eta-label" width="15%">截港时间 变更为:</td>
<td class="eta-val" width="160">@item.CYCutoffTime</td>
</tr>
}
@if (!string.IsNullOrWhiteSpace(@item.ManifestCutDate))
{
<tr>
<td class="eta-label" width="15%">舱单截止时间 变更为:</td>
<td class="eta-val" width="160">@item.ManifestCutDate</td>
</tr>
}
@if (!string.IsNullOrWhiteSpace(@item.VGMCutoffTime))
{
<tr>
<td class="eta-label" width="15%">截VGM时间 变更为:</td>
<td class="eta-val" width="160">@item.VGMCutoffTime</td>
</tr>
}
@if (!string.IsNullOrWhiteSpace(@item.MDGFCutDate))
{
<tr>
<td class="eta-label" width="15%">MDGF提交截止时间 变更为:</td>
<td class="eta-val" width="160">@item.MDGFCutDate</td>
</tr>
}
@if (!string.IsNullOrWhiteSpace(@item.PlaceReceipt))
{
<tr>
<td class="eta-label" width="15%">收货地 变更为:</td>
<td class="eta-val" width="160">@item.PlaceReceipt</td>
</tr>
}
@if (!string.IsNullOrWhiteSpace(@item.PlaceDelivery))
{
<tr>
<td class="eta-label" width="15%">交货地 变更为:</td>
<td class="eta-val" width="160">@item.PlaceDelivery</td>
</tr>
}
</table>
</td>
</tr>
<tr class="email-noreply">
<td>
<p class="dynamic-val"></p>
<p class="notice1-val">以上是贵司还未提柜记录的定舱现已接近截箱时间请参考如下信息操作否则您的订舱将在CY cut-off deadline取消</p>
<p class="notice1-val">A. 推下一航次,请&lt;在CY&nbsp;Closing&nbsp;-&nbsp;1&nbsp;天之前&gt;提交更改</p>
<p class="notice1-val">B. <font style="color: #4051f0; font-weight: 500;">已提柜,且于马士基网站未查询到柜号,<font style="background-color: #f1de2f; font-weight: 500;">请立即联系 @Model.Sender.DisplayName邮箱 @Model.Sender.MailAddress电话 @Model.Sender.Phone</font></font>告知柜号。若网站已有完整柜号且确认正常出运,请自行安排,无需再回复邮件,<font style="color: #f70f0f; font-weight: 500;">目前Maersk不接受未提供明确柜号而保留订舱的要求。</font></p>
<p class="notice1-val">
鉴于船舶配载方面的要求Maersk将在配载前将所有没有提柜记录以Maersk EDI记录为准的定舱视为无效定舱,并统一在取消,因此,<font style="background-color: #5bcef1; font-weight: 500;">友情提醒:请尽快提柜并告知柜号,以免产生不必要的工作和费用。</font>
如果上方的单号需要取消订舱, 或已经提交过取消操作, 无需回复邮件。
如有任何疑问,欢迎垂询我司操作。
</p>
<p class="notice1-val"><font style="color: #f70f0f; font-weight: 500;">请您按照更新的ETD在免箱期内用箱以免产生超期箱使费谢谢</font></p>
<p class="notice2-val"><font style="color: #4051f0; font-weight: 500;">请不要回复此邮箱(自动发送邮箱无人处理邮件),如有疑问,</font><font style="background-color: #f1de2f; font-weight: 500;">请联系 @Model.Sender.DisplayName邮箱 @Model.Sender.MailAddress电话 @Model.Sender.Phone谢谢</font></p>
<p>顺祝</p>
<p>商祺</p>
<p class="notice-comp-val">@item.TenantCompanyName</p>
<p class="notice3-val">货物到港后,贵司保证目的港收货人及时提取货物。因货物提取不及时/弃货产生的滞箱费、堆存费、港口费、货物处理费等概由贵司或者目的港收货人承担。如果我司对外承担了上述费用,则贵司应当无条件支付给我司,如果因此给我司造成了经济损失,则贵司还应当赔偿我司所有经济损失,包括但不限于律师费、诉讼费等等。一旦此票提箱出运就视为同意此条款,谢谢配合!</p>
<p class="notice-company-val">@item.TenantCompanyName</p>
@if (!string.IsNullOrWhiteSpace(item.CompareDiffLabels))
{
<p class="notice-compare-val">请注意 @item.CompareDiffLabels 变更,请您按相关的更新安排操作,谢谢!</p>
}
</td>
</tr>
</table>
@ -64,3 +147,4 @@
</html>

@ -370,6 +370,11 @@
/// 批次号
/// </summary>
public string BatchNo { get; set; }
/// <summary>
/// 样单截止日期
/// </summary>
public Nullable<DateTime> CustomSICutDate { get; set; }
}
public class TaskBCShowBaseKeywordDto

@ -0,0 +1,140 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DS.WMS.Core.TaskPlat.Dtos
{
/// <summary>
///
/// </summary>
public class TaskBCTransferDto
{
/// <summary>
/// 主任务ID
/// </summary>
public long TaskPkId { get; set; }
/// <summary>
/// 业务主键
/// </summary>
public long Id { get; set; }
/// <summary>
/// 订舱ID
/// </summary>
public Nullable<long> BookingId { get; set; }
/// <summary>
/// 原主单号
/// </summary>
public string OrigMBLNo { get; set; }
/// <summary>
/// 主单号
/// </summary>
public string MBLNo { get; set; }
/// <summary>
/// 真提单号
/// </summary>
public string RealMBLNo { get; set; }
/// <summary>
/// 收货地
/// </summary>
public string PlaceReceipt { get; set; }
/// <summary>
/// 原收货地
/// </summary>
public string OrigPlaceReceipt { get; set; }
/// <summary>
/// 交货地
/// </summary>
public string PlaceDelivery { get; set; }
/// <summary>
/// 原交货地
/// </summary>
public string OrigPlaceDelivery { get; set; }
/// <summary>
/// 箱型箱量
/// </summary>
public string CtnStat { get; set; }
/// <summary>
/// 船名
/// </summary>
public string Vessel { get; set; }
/// <summary>
/// 航次
/// </summary>
public string VoyNo { get; set; }
/// <summary>
/// 船公司
/// </summary>
public string Carrier { get; set; }
/// <summary>
/// ETD(预计离港时间)
/// </summary>
public string ETD { get; set; }
/// <summary>
/// ETA(预计到港时间)
/// </summary>
public string ETA { get; set; }
/// <summary>
/// 样单截止日期
/// </summary>
public string SICutDate { get; set; }
/// <summary>
/// 截VGM时间
/// </summary>
public string VGMCutoffTime { get; set; }
/// <summary>
/// 舱单截止时间
/// </summary>
public string ManifestCutDate { get; set; }
/// <summary>
/// MDGF提交截止时间
/// </summary>
public string MDGFCutDate { get; set; }
/// <summary>
/// 样单截止日期
/// </summary>
public string CustomSICutDate { get; set; }
/// <summary>
/// 截港时间
/// </summary>
public string CYCutoffTime { get; set; }
/// <summary>
/// 租户ID
/// </summary>
public long TenantId { get; set; }
/// <summary>
/// 租户名称
/// </summary>
public string TenantCompanyName { get; set; }
/// <summary>
/// 比对差异标签内容
/// </summary>
public string CompareDiffLabels { get; set; }
}
}

@ -156,7 +156,8 @@ namespace DS.WMS.Core.TaskPlat.Dtos.Mapper
.Map(dest => dest.SecondETA, src => src.SECOND_ETA)
.Map(dest => dest.BookingSlotId, src => src.BOOKING_SLOT_ID)
.Map(dest => dest.BookingConfirmDate, src => src.BOOKING_COMFIRM_DATE)
.Map(dest => dest.BatchNo, src => src.BATCH_NO);
.Map(dest => dest.BatchNo, src => src.BATCH_NO)
.Map(dest => dest.CustomSICutDate, src => src.CUSTOM_SI_CUT_DATE);
}
// BC子任务箱信息转前端Dto TaskBCCTNInfo, TaskBCCTNInfoDto

Loading…
Cancel
Save