a
This commit is contained in:
109
CY.AR_RecMatchFilter/CY.AR_RecMatchFilter.csproj
Normal file
109
CY.AR_RecMatchFilter/CY.AR_RecMatchFilter.csproj
Normal file
@@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{7822C382-D01D-41A5-A94A-4A953DD178A7}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CY.AR_RecMatchFilter</RootNamespace>
|
||||
<AssemblyName>CY.AR_RecMatchFilter</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Kingdee.BOS">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Business.DynamicForm">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.Business.DynamicForm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Contracts, Version=8.1.571.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Core">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.DataEntity">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.DataEntity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.Model, Version=8.1.571.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.Model.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.ServiceHelper">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.ServiceHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.BOS.VerificationHelper, Version=8.1.571.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.BOS.VerificationHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.Core">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.AP.Business.PlugIn">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.FIN.AP.Business.PlugIn.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.AP.ServiceHelper">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.FIN.AP.ServiceHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.App">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.FIN.App.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.AR.Business.PlugIn">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.FIN.AR.Business.PlugIn.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.Business.PlugIn">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.FIN.Business.PlugIn.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.Contracts, Version=8.1.571.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.FIN.Contracts.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.Core">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.FIN.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Kingdee.K3.FIN.ServiceHelper">
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Kingdee.K3.FIN.ServiceHelper.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\Program Files (x86)\Kingdee\K3Cloud\WebSite\bin\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="RecSpecialEditEx.cs" />
|
||||
<Compile Include="MatchFilterStencilEditEx.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SpecialStencilEditEx.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
11
CY.AR_RecMatchFilter/Class1.cs
Normal file
11
CY.AR_RecMatchFilter/Class1.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CY.AR_RecMatchFilter
|
||||
{
|
||||
internal class Class1
|
||||
{
|
||||
}
|
||||
}
|
||||
78
CY.AR_RecMatchFilter/MatchFilterStencilEditEx.cs
Normal file
78
CY.AR_RecMatchFilter/MatchFilterStencilEditEx.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using Kingdee.BOS.Core.CommonFilter;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.Permission.Objects;
|
||||
using Kingdee.BOS.Util;
|
||||
using Kingdee.K3.FIN.Business.PlugIn.Match;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace CY.AR_RecMatchFilter
|
||||
{
|
||||
[Description("表单插件"), HotUpdate]
|
||||
public class MatchFilterStencilEditEx : MatchFilterStencilEdit
|
||||
{
|
||||
public override void BeforeSetItemValueByNumber(BeforeSetItemValueByNumberArgs e)
|
||||
{
|
||||
base.BeforeSetItemValueByNumber(e);
|
||||
}
|
||||
|
||||
public override void BeforeFilterGridF7Select(BeforeFilterGridF7SelectEventArgs e)
|
||||
{
|
||||
base.BeforeFilterGridF7Select(e);
|
||||
string text;
|
||||
if ((text = e.FieldKey.ToUpperInvariant()) == null || !(text == "F_YECK_Base"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
string[] array = View.Model.DataObject["FBillSelect"].ToString().Split(',');
|
||||
if (array.Length > 0)
|
||||
{
|
||||
string text2 = "";
|
||||
for (int i = 0; i < array.Length; i++)
|
||||
{
|
||||
text2 = text2 + "'" + array[i] + "',";
|
||||
}
|
||||
|
||||
e.ListFilterParameter.Filter = $"FBillFormID in ({text2.Substring(0, text2.Length - 1)})";
|
||||
}
|
||||
}
|
||||
|
||||
public override void BeforeF7Select(BeforeF7SelectEventArgs e)
|
||||
{
|
||||
base.BeforeF7Select(e);
|
||||
switch (e.FieldKey.ToUpperInvariant())
|
||||
{
|
||||
case "FINVOICECUST":
|
||||
{
|
||||
List<BaseDataTempTable> list2 = baseDataTempTable;
|
||||
string filterSQLByTempBaseDataTable2 = GetFilterSQLByTempBaseDataTable("BD_Customer", list2);
|
||||
if (!string.IsNullOrWhiteSpace(filterSQLByTempBaseDataTable2))
|
||||
{
|
||||
if (ObjectUtils.IsNullOrEmptyOrWhiteSpace((object)e.ListFilterParameter.Filter))
|
||||
{
|
||||
e.ListFilterParameter.Filter = filterSQLByTempBaseDataTable2;
|
||||
break;
|
||||
}
|
||||
|
||||
IRegularFilterParameter listFilterParameter2 = e.ListFilterParameter;
|
||||
listFilterParameter2.Filter = listFilterParameter2.Filter + " AND " + filterSQLByTempBaseDataTable2;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//系统自动根据字段标识拼接好的过滤表达式
|
||||
var filterStr = this.CommonFilterModel.FilterObject.GetFilterSQLString(this.Context);
|
||||
//条件过滤行原始数据,含比较符
|
||||
var filterRows = this.CommonFilterModel.FilterObject.FilterRows;
|
||||
//高级过滤原始行数据
|
||||
var advanceFilterRows = this.CommonFilterModel.FilterObject.AdvancedFilterRows;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
36
CY.AR_RecMatchFilter/Properties/AssemblyInfo.cs
Normal file
36
CY.AR_RecMatchFilter/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("CY.AR_RecMatchFilter")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("CY.AR_RecMatchFilter")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// 将 ComVisible 设置为 false 会使此程序集中的类型
|
||||
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
|
||||
[assembly: Guid("7822c382-d01d-41a5-a94a-4a953dd178a7")]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
498
CY.AR_RecMatchFilter/RecSpecialEditEx.cs
Normal file
498
CY.AR_RecMatchFilter/RecSpecialEditEx.cs
Normal file
@@ -0,0 +1,498 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Kingdee.BOS.Contracts;
|
||||
using Kingdee.BOS.Core.CommonFilter;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
|
||||
using Kingdee.BOS.Core.DynamicForm.PlugIn.ControlModel;
|
||||
using Kingdee.BOS.Core.Metadata;
|
||||
using Kingdee.BOS.Core.Metadata.FieldElement;
|
||||
using Kingdee.BOS.Core.Permission;
|
||||
using Kingdee.BOS.JSON;
|
||||
using Kingdee.BOS.Orm.DataEntity;
|
||||
using Kingdee.BOS.Orm.Metadata.DataEntity;
|
||||
using Kingdee.BOS.Resource;
|
||||
using Kingdee.BOS.ServiceHelper;
|
||||
using Kingdee.BOS.Util;
|
||||
using Kingdee.K3.FIN.AP.ServiceHelper;
|
||||
using Kingdee.K3.FIN.Business.PlugIn.Match;
|
||||
using Kingdee.K3.FIN.Core;
|
||||
using Kingdee.K3.FIN.Core.Match;
|
||||
using Kingdee.K3.FIN.Core.Match.Object;
|
||||
using Kingdee.K3.FIN.Core.Object;
|
||||
using Kingdee.K3.FIN.ServiceHelper;
|
||||
using Newtonsoft.Json;
|
||||
using static Kingdee.K3.FIN.Core.Match.MatchBillFrom.BillEntryKey;
|
||||
|
||||
namespace CY.AR_RecMatchFilter
|
||||
{
|
||||
[Description("表单插件"), HotUpdate]
|
||||
public class RecSpecialEditEx : SpecialStencilEdit
|
||||
{
|
||||
protected override string MatchType => "3";
|
||||
|
||||
protected override string TitelInfo => ResManager.LoadKDString("特殊业务核销主要处理异常业务的核销,例如:往来单位不同的单据间的核销;单据尾数的注销等。如果是正常的核销业务,请通过匹配条件核销进行。请确认是否要继续?", "003186000003556", (SubSystemType)4, new object[0]);
|
||||
|
||||
protected override string FilterFromId => "AR_RecMatchFilter";
|
||||
|
||||
protected override string MatchWizardFromId => "AR_Matck";
|
||||
|
||||
protected override string PermissonFormID => "AR_RecSpecial";
|
||||
|
||||
public RecSpecialEditEx()
|
||||
{
|
||||
SetFieldValue.Add("FTheMatchAmount", base.SetAmountValue);
|
||||
SetFieldValue.Add("FMatchAmount", base.SetAmountValue);
|
||||
SetFieldValue.Add("FMaxMatchAmount", base.SetAmountValue);
|
||||
SetFieldValue.Add("FNOTMatchAmount", base.SetAmountValue);
|
||||
SetFieldValue.Add("FWriteMatchAmount", base.SetAmountValue);
|
||||
SetFieldValue.Add("FIVMATCHAMOUNTFOR", base.SetAmountValue);
|
||||
AmountFields.Add("FTheMatchAmount");
|
||||
AmountFields.Add("FMatchAmount");
|
||||
AmountFields.Add("FMaxMatchAmount");
|
||||
AmountFields.Add("FNOTMatchAmount");
|
||||
AmountFields.Add("FWriteMatchAmount");
|
||||
AmountFields.Add("FIVMATCHAMOUNTFOR");
|
||||
sSystemFormID = "AR_SystemParameter";
|
||||
sumField.Add("FSumAmount");
|
||||
sumField.Add("FMatchSumAmount");
|
||||
sumField.Add("FCurMatchSumAmount");
|
||||
sumField.Add("FCurMatchSumAmountFor");
|
||||
}
|
||||
|
||||
public override void DataChanged(DataChangedEventArgs e)
|
||||
{
|
||||
if (e.Field.Key.Equals("FTheIsMatch" + DebitSuffix))
|
||||
{
|
||||
SelectDataChanged(e.Row, DebitSuffix);
|
||||
}
|
||||
else if (e.Field.Key.Equals("FTheIsMatch" + CrebitSuffix))
|
||||
{
|
||||
SelectDataChanged(e.Row, CrebitSuffix);
|
||||
}
|
||||
|
||||
string suffix = "";
|
||||
if (e.Field.Key.Equals("FTheMatchAmount" + DebitSuffix) || e.Field.Key.Equals("FTheIsMatch" + DebitSuffix))
|
||||
{
|
||||
suffix = DebitSuffix;
|
||||
}
|
||||
else if (e.Field.Key.Equals("FTheMatchAmount" + CrebitSuffix) || e.Field.Key.Equals("FTheIsMatch" + CrebitSuffix))
|
||||
{
|
||||
suffix = CrebitSuffix;
|
||||
}
|
||||
|
||||
switch (e.Field.Key.ToUpperInvariant())
|
||||
{
|
||||
case "FTHEISMATCHC":
|
||||
case "FTHEISMATCHD":
|
||||
SetTotalAmount(bolClear: false, suffix);
|
||||
break;
|
||||
case "FTHEMATCHAMOUNTC":
|
||||
case "FTHEMATCHAMOUNTD":
|
||||
SetTotalAmount(bolClear: false, suffix);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetTotalAmount(bool bolClear, string suffix)
|
||||
{
|
||||
decimal num = 0m;
|
||||
decimal num2 = 0m;
|
||||
decimal num3 = 0m;
|
||||
decimal num4 = 0m;
|
||||
short num5 = 0;
|
||||
short num6 = 0;
|
||||
string text = "";
|
||||
if (!bolClear)
|
||||
{
|
||||
string text2 = "";
|
||||
if (suffix == "C")
|
||||
{
|
||||
text2 = "FCreditEntry";
|
||||
text = "FMatchAmount";
|
||||
}
|
||||
else
|
||||
{
|
||||
text2 = "FDebitEntry";
|
||||
text = "FMatchAmount";
|
||||
}
|
||||
|
||||
object obj = View.Model.DataObject[text2];
|
||||
DynamicObjectCollection val = (DynamicObjectCollection)((obj is DynamicObjectCollection) ? obj : null);
|
||||
if (val != null && ((Collection<DynamicObject>)(object)val).Count > 0)
|
||||
{
|
||||
foreach (DynamicObject item in (Collection<DynamicObject>)(object)val)
|
||||
{
|
||||
if (Convert.ToBoolean(item["FTheIsMatch" + suffix]))
|
||||
{
|
||||
decimal num7 = 0m;
|
||||
decimal num8 = 0m;
|
||||
decimal num9 = 0m;
|
||||
decimal num10 = 0m;
|
||||
decimal num11 = 0m;
|
||||
decimal num12 = 0m;
|
||||
short num13 = Convert.ToInt16(item["FAmountDigits" + suffix]);
|
||||
num5 = ((num5 < num13) ? num13 : num5);
|
||||
num7 = Convert.ToDecimal(item[text + suffix]);
|
||||
num8 = Convert.ToDecimal(item["FWriteMatchAmount" + suffix]);
|
||||
num9 = Convert.ToDecimal(item["FTheMatchAmount" + suffix]);
|
||||
num10 = Convert.ToDecimal(item["FWRITTENOFFAMOUNT" + suffix]);
|
||||
short num14 = Convert.ToInt16(item["FAmount_LCDigits" + suffix]);
|
||||
num6 = ((num6 < num14) ? num14 : num6);
|
||||
num11 = Convert.ToDecimal(item["FMatchAmountLocal" + suffix]);
|
||||
bool flag = false;
|
||||
if (num7 - num8 - num9 == 0m)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
|
||||
decimal num15 = Convert.ToDecimal(item["FEXCHANGERATE" + suffix]);
|
||||
if (num15 == 0m)
|
||||
{
|
||||
num15 = num11 / num7;
|
||||
}
|
||||
|
||||
num12 = (flag ? (num11 - num10) : (num9 * num15));
|
||||
if (item["FSOURCEFORMID" + suffix].ToString().ToUpperInvariant().Equals("AP_REFUNDBILL") || item["FSOURCEFORMID" + suffix].ToString().ToUpperInvariant().Equals("AR_REFUNDBILL"))
|
||||
{
|
||||
num += num7 * -1m;
|
||||
num2 += num8 * -1m;
|
||||
num3 += num9 * -1m;
|
||||
num4 -= num12;
|
||||
}
|
||||
else
|
||||
{
|
||||
num += num7;
|
||||
num2 += num8;
|
||||
num3 += num9;
|
||||
num4 += num12;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DecimalFieldAppearance decimalfieldAppearance = (DecimalFieldAppearance)View.GetFieldEditor<FieldEditor>("FSumAmount" + suffix, 0).ControlAppearance;
|
||||
View.StyleManager.SetScale(decimalfieldAppearance, num5);
|
||||
View.Model.SetValue("FSumAmount" + suffix, num);
|
||||
DecimalFieldAppearance decimalfieldAppearance2 = (DecimalFieldAppearance)View.GetFieldEditor<FieldEditor>("FMatchSumAmount" + suffix, 0).ControlAppearance;
|
||||
View.StyleManager.SetScale(decimalfieldAppearance2, num5);
|
||||
View.Model.SetValue("FMatchSumAmount" + suffix, num2);
|
||||
DecimalFieldAppearance decimalfieldAppearance3 = (DecimalFieldAppearance)View.GetFieldEditor<FieldEditor>("FCurMatchSumAmount" + suffix, 0).ControlAppearance;
|
||||
View.StyleManager.SetScale(decimalfieldAppearance3, num5);
|
||||
View.Model.SetValue("FCurMatchSumAmount" + suffix, num3);
|
||||
View.UpdateView("FSumAmount" + suffix);
|
||||
View.UpdateView("FMatchSumAmount" + suffix);
|
||||
View.UpdateView("FCurMatchSumAmount" + suffix);
|
||||
if (View.OpenParameter.FormId == "AR_RecSpecial" || View.OpenParameter.FormId == "AP_PaySpecial")
|
||||
{
|
||||
DecimalFieldAppearance decimalfieldAppearance4 = (DecimalFieldAppearance)View.GetFieldEditor<FieldEditor>("FCurMatchSumAmountFor" + suffix, 0).ControlAppearance;
|
||||
View.StyleManager.SetScale(decimalfieldAppearance4, num6);
|
||||
View.Model.SetValue("FCurMatchSumAmountFor" + suffix, num4);
|
||||
View.UpdateView("FCurMatchSumAmountFor" + suffix);
|
||||
}
|
||||
}
|
||||
|
||||
public override void BeforeUpdateValue(BeforeUpdateValueEventArgs e)
|
||||
{
|
||||
IsAllowSelected(e);
|
||||
SetGenBussinessWhenBeforeUpdate(e);
|
||||
string text = "";
|
||||
if (e.Key.Equals("FTheMatchAmount" + DebitSuffix))
|
||||
{
|
||||
text = DebitSuffix;
|
||||
e.Cancel = TheMatchDataChanged(e, text);
|
||||
}
|
||||
else if (e.Key.Equals("FTheMatchAmount" + CrebitSuffix))
|
||||
{
|
||||
text = CrebitSuffix;
|
||||
e.Cancel = TheMatchDataChanged(e, text);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void SetSumFieldValue(string entitySuffix, Dictionary<long, MatchBillData> datas)
|
||||
{
|
||||
}
|
||||
|
||||
protected override int FieldLocked(MatchFieldConfig fieldConfig)
|
||||
{
|
||||
if (fieldConfig.FieldName.Equals("FTheIsMatch", StringComparison.OrdinalIgnoreCase) || fieldConfig.FieldName.Equals("FTheMatchAmount", StringComparison.OrdinalIgnoreCase) || fieldConfig.FieldName.Equals("FAbstract", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return base.FieldLocked(fieldConfig);
|
||||
}
|
||||
|
||||
protected override int FireUpdateEvent(MatchFieldConfig fieldConfig)
|
||||
{
|
||||
if (fieldConfig.FieldName.Equals("FTheIsMatch", StringComparison.OrdinalIgnoreCase) || fieldConfig.FieldName.Equals("FTheMatchAmount", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
return base.FireUpdateEvent(fieldConfig);
|
||||
}
|
||||
|
||||
protected override void ResultRowData(MatchBillData data, DynamicObject enrtyData, string suffix)
|
||||
{
|
||||
data.FieldValues["FTheMatchAmount"] = enrtyData["FTheMatchAmount" + suffix];
|
||||
data.FieldValues["FMaxMatchAmount"] = enrtyData["FMaxMatchAmount" + suffix];
|
||||
}
|
||||
|
||||
protected override void SelectReverse(MatchBillData data)
|
||||
{
|
||||
data.FieldValues["FTheIsMatch"] = "0";
|
||||
data.FieldValues["FTheMatchAmount"] = 0;
|
||||
data.FieldValues["FMaxMatchAmount"] = data.FieldValues["FWriteMatchAmount"];
|
||||
}
|
||||
|
||||
private void SelectDataChanged(int row, string suffix)
|
||||
{
|
||||
decimal num = Convert.ToDecimal(View.Model.GetValue("FMatchAmount" + suffix, row));
|
||||
decimal num2 = Convert.ToDecimal(View.Model.GetValue("FWriteMatchAmount" + suffix, row));
|
||||
if (Convert.ToBoolean(View.Model.GetValue("FTheIsMatch" + suffix, row)))
|
||||
{
|
||||
View.Model.SetValue("FTheMatchAmount" + suffix, num - num2, row);
|
||||
View.Model.SetValue("FMaxMatchAmount" + suffix, num, row);
|
||||
}
|
||||
else
|
||||
{
|
||||
View.Model.SetValue("FTheMatchAmount" + suffix, 0, row);
|
||||
View.Model.SetValue("FMaxMatchAmount" + suffix, num2, row);
|
||||
}
|
||||
}
|
||||
|
||||
private bool TheMatchDataChanged(BeforeUpdateValueEventArgs e, string suffix)
|
||||
{
|
||||
if (Convert.ToString(e.Key).Equals(FGenDate))
|
||||
{
|
||||
return e.Cancel;
|
||||
}
|
||||
|
||||
decimal num = Convert.ToDecimal(View.Model.GetValue("FMatchAmount" + suffix, e.Row));
|
||||
decimal num2 = Convert.ToDecimal(View.Model.GetValue("FWriteMatchAmount" + suffix, e.Row));
|
||||
decimal num3 = num - num2;
|
||||
decimal num4 = Convert.ToDecimal(e.Value);
|
||||
if (num4 == 0m)
|
||||
{
|
||||
View.Model.SetValue("FTheIsMatch" + suffix, false, e.Row);
|
||||
}
|
||||
else
|
||||
{
|
||||
View.Model.SetValue("FTheIsMatch" + suffix, true, e.Row);
|
||||
if (num > 0m && (num4 > num3 || num4 < 0m))
|
||||
{
|
||||
View.ShowMessage(ResManager.LoadKDString("本次核销金额不能大于未核销金额并且不能小于0!", "003186000003559", (SubSystemType)4, new object[0]));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (num < 0m && (num4 < num3 || num4 > 0m))
|
||||
{
|
||||
View.ShowMessage(ResManager.LoadKDString("本次核销金额不能小于未核销金额并且不能大于0!", "003186000003562", (SubSystemType)4, new object[0]));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
View.Model.SetValue("FMaxMatchAmount" + suffix, num4 + num2, e.Row);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AfterBindData(EventArgs e)
|
||||
{
|
||||
base.AfterBindData(e);
|
||||
GetStartDateAndCloseDateInfo();
|
||||
}
|
||||
|
||||
public override void BarItemClick(BarItemClickEventArgs e)
|
||||
{
|
||||
switch (e.BarItemKey)
|
||||
{
|
||||
case "tbVerify":
|
||||
if (!CheckPermission("580dcd5cb8fbca"))
|
||||
{
|
||||
View.ShowMessage(ResManager.LoadKDString("没有手工核销的权限", "003192000038640", (SubSystemType)4, new object[0]));
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
case "tbVerifyS":
|
||||
if (!CheckPermission("580dcd73b8fbcc"))
|
||||
{
|
||||
View.ShowMessage(ResManager.LoadKDString("没有特殊核销的权限", "003192000038641", (SubSystemType)4, new object[0]));
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
case "tbBDHandle":
|
||||
if (!CheckPermission("5e0ead240e5818"))
|
||||
{
|
||||
View.ShowMessage(ResManager.LoadKDString("没有坏账核销的权限", "003186000022353", (SubSystemType)4, new object[0]));
|
||||
return;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
base.BarItemClick(e);
|
||||
}
|
||||
|
||||
private bool CheckPermission(string permissionItem)
|
||||
{
|
||||
List<BusinessObject> list = new List<BusinessObject>();
|
||||
HashSet<long> hashSet = new HashSet<long>();
|
||||
if (base.DebitDate != null)
|
||||
{
|
||||
object obj = View.Model.DataObject[DebitEntryKey];
|
||||
DynamicObjectCollection val = (DynamicObjectCollection)((obj is DynamicObjectCollection) ? obj : null);
|
||||
if (val != null)
|
||||
{
|
||||
foreach (DynamicObject item in (Collection<DynamicObject>)(object)val)
|
||||
{
|
||||
long key = Convert.ToInt64(item["FEntryId" + DebitSuffix]);
|
||||
if (Convert.ToBoolean(item["FTheIsMatch" + DebitSuffix]))
|
||||
{
|
||||
hashSet.Add(base.DebitDate[key].SettOrgId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (base.CrebitDate != null)
|
||||
{
|
||||
object obj2 = View.Model.DataObject[CreditEntryKey];
|
||||
DynamicObjectCollection val = (DynamicObjectCollection)((obj2 is DynamicObjectCollection) ? obj2 : null);
|
||||
if (val != null)
|
||||
{
|
||||
foreach (DynamicObject item2 in (Collection<DynamicObject>)(object)val)
|
||||
{
|
||||
long key2 = Convert.ToInt64(item2["FEntryId" + CrebitSuffix]);
|
||||
if (Convert.ToBoolean(item2["FTheIsMatch" + CrebitSuffix]))
|
||||
{
|
||||
hashSet.Add(base.CrebitDate[key2].SettOrgId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hashSet.Count > 0)
|
||||
{
|
||||
foreach (long item3 in hashSet)
|
||||
{
|
||||
BusinessObject businessObject = new BusinessObject(item3);
|
||||
businessObject.Id = View.BillBusinessInfo.GetForm().Id;
|
||||
list.Add(businessObject);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BusinessObject businessObject = new BusinessObject();
|
||||
businessObject.Id = View.BillBusinessInfo.GetForm().Id;
|
||||
list.Add(businessObject);
|
||||
}
|
||||
|
||||
List<PermissionAuthResult> list2 = PermissionServiceHelper.FuncPermissionAuth(View.Context, (IEnumerable<BusinessObject>)list, permissionItem);
|
||||
bool result = true;
|
||||
foreach (PermissionAuthResult item4 in list2)
|
||||
{
|
||||
if (!item4.Passed)
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private void GetStartDateAndCloseDateInfo()
|
||||
{
|
||||
DynamicObjectCollection lastestCloseAcctDate = ClosingAccountServiceHelper.GetLastestCloseAcctDate(base.Context, lstSettlesOrgPermissionIDs, "AR");
|
||||
foreach (DynamicObject item in (Collection<DynamicObject>)(object)lastestCloseAcctDate)
|
||||
{
|
||||
BillExtension.AddWithoutExists<long, DateTime>((IDictionary<long, DateTime>)CloseDateInfos, Convert.ToInt64(item["FOrgID"]), Convert.ToDateTime(item["FEndDate"]));
|
||||
}
|
||||
|
||||
DynamicObjectCollection paramterByCtgOrgAcct = CommonServiceHelper.GetParamterByCtgOrgAcct(base.Context, "AR", 0L, lstSettlesOrgPermissionIDs, "ARStartDate");
|
||||
foreach (DynamicObject item2 in (Collection<DynamicObject>)(object)paramterByCtgOrgAcct)
|
||||
{
|
||||
BillExtension.AddWithoutExists<long, DateTime>((IDictionary<long, DateTime>)StartDateInfos, Convert.ToInt64(item2["FOrgID"]), Convert.ToDateTime(item2["FValue"]));
|
||||
}
|
||||
|
||||
SetDateValueForOrgID();
|
||||
}
|
||||
|
||||
protected override void GetBillData(string billDirection, FilterParameter filterPara)
|
||||
{
|
||||
base.GetBillData(billDirection, filterPara);
|
||||
|
||||
//IMatchService service = ServiceFactory.GetService<IMatchService>(this.Context);
|
||||
}
|
||||
|
||||
protected override void ShowFilterBill(string billDirection)
|
||||
{
|
||||
base.ShowFilterBill(billDirection);
|
||||
}
|
||||
|
||||
protected override void RefreshBillData(string billDirection, FilterParameter filterPara)
|
||||
{
|
||||
var filter = filterPara.CustomFilter;
|
||||
var isHandlingGroupCustomer = IsHandlingGroupCustomer(filter);
|
||||
var jsonStr = JsonConvert.SerializeObject(filterPara);
|
||||
IEnumerable<DynamicProperty> enumerable = from DynamicProperty dp in filter.DynamicObjectType.Properties
|
||||
where (dp.Name.EndsWith("From", StringComparison.InvariantCultureIgnoreCase) || dp.Name.EndsWith("To", StringComparison.InvariantCultureIgnoreCase)) && (!isHandlingGroupCustomer || (isHandlingGroupCustomer && dp.Name != "FCONTACTUNITFrom" && dp.Name != "FCONTACTUNITTo"))
|
||||
select dp;
|
||||
//Dictionary<string, MatchBillFrom.BillEntryKey.FieldValue> fieldValues = this.FieldNames.BillEntrys["Head"].FieldValues;
|
||||
IMetaDataService service = ServiceFactory.GetService<IMetaDataService>(this.Context);
|
||||
FormMetadata formMetadata = (FormMetadata)service.Load(this.Context, this.FilterFromId, true);
|
||||
foreach (DynamicProperty dynamicProperty in enumerable)
|
||||
{
|
||||
object obj = filter[dynamicProperty];
|
||||
Field field = formMetadata.BusinessInfo.GetField(dynamicProperty.Name);
|
||||
//if (fieldValues.Any((KeyValuePair<string, MatchBillFrom.BillEntryKey.FieldValue> p) => p.Key.Equals(field.FieldName, StringComparison.OrdinalIgnoreCase))
|
||||
// && (!flag || (!field.Key.ToUpperInvariant().Equals("FCONTACTUNITFROM") && !field.Key.ToUpperInvariant().Equals("FCONTACTUNITTO"))))
|
||||
//{
|
||||
// MatchBillFrom.BillEntryKey.FieldValue fieldValue = fieldValues[field.FieldName];
|
||||
// if (!string.IsNullOrWhiteSpace(fieldValue.FieldKey))
|
||||
// {
|
||||
// if (obj is DynamicObject)
|
||||
// {
|
||||
// string text3 = (obj as DynamicObject)["Number"] as string;
|
||||
// if (!string.IsNullOrEmpty(text3))
|
||||
// {
|
||||
// if (dynamicProperty.Name.IndexOf("From") > 0)
|
||||
// {
|
||||
// stringBuilder.AppendFormat(" and {0}.FNumber >= '" + text3 + "'", fieldValue.FieldKey);
|
||||
// }
|
||||
// else if (dynamicProperty.Name.IndexOf("To") > 0)
|
||||
// {
|
||||
// stringBuilder.AppendFormat(" and {0}.FNumber <= '" + text3 + "'", fieldValue.FieldKey);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// else if (obj is DateTime)
|
||||
// {
|
||||
// if (dynamicProperty.Name.IndexOf("From") > 0 && Convert.ToDateTime(obj) > DateTime.MinValue && Convert.ToDateTime(obj) < DateTime.MaxValue)
|
||||
// {
|
||||
// stringBuilder.AppendFormat(" and {0} >= {1} ", fieldValue.FieldKey, "{ts'" + obj.ToString() + "'}");
|
||||
// }
|
||||
// else if (dynamicProperty.Name.IndexOf("To") > 0 && Convert.ToDateTime(obj) > DateTime.MinValue && Convert.ToDateTime(obj) < DateTime.MaxValue)
|
||||
// {
|
||||
// stringBuilder.AppendFormat(" and {0} <= {1} ", fieldValue.FieldKey, "{ts'" + obj.ToString() + "'}");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
base.RefreshBillData(billDirection, filterPara);
|
||||
}
|
||||
|
||||
public bool IsHandlingGroupCustomer(DynamicObject filter)
|
||||
{
|
||||
return filter.DynamicObjectType.Properties.Contains("FCONTACTUNITTYPE") && string.Equals(Convert.ToString(filter["FCONTACTUNITTYPE"]), "BD_Customer", StringComparison.OrdinalIgnoreCase) && filter.DynamicObjectType.Properties.Contains("FGroupCustomer") && Convert.ToBoolean(filter["FGroupCustomer"]) && filter.DynamicObjectType.Properties.Contains("FCONTACTUNITFrom") && filter.DynamicObjectType.Properties.Contains("FCONTACTUNITTo");
|
||||
}
|
||||
}
|
||||
}
|
||||
2308
CY.AR_RecMatchFilter/SpecialStencilEditEx.cs
Normal file
2308
CY.AR_RecMatchFilter/SpecialStencilEditEx.cs
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user