Commit b4af6c5d by 陶然

优化插入发票验证重复发票的问题

parent eb33f05b
......@@ -31,11 +31,11 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Kivii.Common.V4.5, Version=5.6.2022.5000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Common.5.6.2022.5001\lib\net45\Kivii.Common.V4.5.dll</HintPath>
<Reference Include="Kivii.Common.V4.5, Version=5.6.2022.6220, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Kivii.Common.5.6.2022.6220\lib\net45\Kivii.Common.V4.5.dll</HintPath>
</Reference>
<Reference Include="Kivii.Core.V4.5, Version=5.6.2022.5000, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Core.5.6.2022.5000\lib\net45\Kivii.Core.V4.5.dll</HintPath>
<Reference Include="Kivii.Core.V4.5, Version=5.6.2022.6220, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Kivii.Core.5.6.2022.6220\lib\net45\Kivii.Core.V4.5.dll</HintPath>
</Reference>
<Reference Include="Kivii.Linq.V4.5, Version=5.6.2022.5020, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Kivii.Linq.5.6.2022.5020\lib\net45\Kivii.Linq.V4.5.dll</HintPath>
......
......@@ -246,8 +246,12 @@ namespace Kivii.Finances.Transforms
var category = preCorrelatingPayments.IsNullOrEmpty() ? InvoiceApplyType.Debit : InvoiceApplyType.Payment;
foreach (var info in Items)
{
//重复的发票
(!exists.IsNullOrEmpty() && exists.Exists(o => o.SerialNumber == info.SerialNumber)).ThrowIfTrue($"存在重复录入的发票信息:{info.SerialNumber}");
//重复的发票,如果传了对应到账,那重复的发票就要抛异常,否则跳过
if(!exists.IsNullOrEmpty() && exists.Exists(o => o.SerialNumber == info.SerialNumber))
{
if (!Payments.IsNullOrEmpty()) throw new Exception($"存在重复录入的发票信息:{info.SerialNumber}");
else continue;
}
#region 开票成功的情况处理
var invoiceKvid = Guid.NewGuid();
var invoice = new Invoice();
......
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Kivii.Common" version="5.6.2022.5001" targetFramework="net45" />
<package id="Kivii.Core" version="5.6.2022.5000" targetFramework="net45" />
<package id="Kivii.Common" version="5.6.2022.6220" targetFramework="net45" />
<package id="Kivii.Core" version="5.6.2022.6220" targetFramework="net45" />
<package id="Kivii.Linq" version="5.6.2022.5020" targetFramework="net45" />
</packages>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment