Browse Source

需求单No.138389

master
luanhui 8 years ago
parent
commit
d384676d8b
10 changed files with 605 additions and 0 deletions
  1. +12
    -0
      B3SubstituteKill.Web/B3SubstituteKill.Web.csproj
  2. +194
    -0
      B3SubstituteKill.Web/Pages/B3SubstituteKill/Reports/SubKillFromToAccountAnalyse_/SubKillFromToAccountAnalyse.cs
  3. +37
    -0
      B3SubstituteKill.Web/Pages/B3SubstituteKill/Reports/SubKillFromToAccountAnalyse_/SubKillFromToAccountAnalyse.xml
  4. +194
    -0
      B3SubstituteKill.Web/Pages/B3SubstituteKill/Reports/SubKillFromToAccountAnalyse_/SubKillFromToAccountSummaryAnalyse.cs
  5. +27
    -0
      B3SubstituteKill.Web/Pages/B3SubstituteKill/Reports/SubKillFromToAccountAnalyse_/SubKillFromToAccountSummaryAnalyse.xml
  6. +1
    -0
      B3SubstituteKill/B3SubstituteKill.csproj
  7. +7
    -0
      B3SubstituteKill/BL/Bills/SubKillGathering/SubKillGatheringBL.cs
  8. +5
    -0
      B3SubstituteKill/BO/Bills/SubKillGathering/SubKillGathering.cs
  9. +120
    -0
      B3SubstituteKill/BO/SubKillFromToAccountAnalyse_View.cs
  10. +8
    -0
      WebFolder/config/Plugins/B3SubstituteKill.plugin

+ 12
- 0
B3SubstituteKill.Web/B3SubstituteKill.Web.csproj View File

@ -200,6 +200,12 @@
<Compile Include="Pages\B3SubstituteKill\Reports\SubKillButcherOrderAnalyse_\SubKillButcherOrderAnalyse.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SubstituteKill\Reports\SubKillFromToAccountAnalyse_\SubKillFromToAccountAnalyse.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SubstituteKill\Reports\SubKillFromToAccountAnalyse_\SubKillFromToAccountSummaryAnalyse.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Pages\B3SubstituteKill\Reports\SubKillWeightBillAnalyse_\SubKillWeightBillAnalyse.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@ -253,6 +259,12 @@
<EmbeddedResource Include="Pages\B3SubstituteKill\Bills\SubKillGathering_\SelectStatPayDialog.xml" />
<EmbeddedResource Include="Pages\B3SubstituteKill\Bills\SubKillGathering_\SubKillGatheringList.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3SubstituteKill\Reports\SubKillFromToAccountAnalyse_\SubKillFromToAccountAnalyse.xml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Pages\B3SubstituteKill\Reports\SubKillFromToAccountAnalyse_\SubKillFromToAccountSummaryAnalyse.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.


+ 194
- 0
B3SubstituteKill.Web/Pages/B3SubstituteKill/Reports/SubKillFromToAccountAnalyse_/SubKillFromToAccountAnalyse.cs View File

@ -0,0 +1,194 @@
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO;
using BWP.B3Frameworks.BO.MoneyTemplate;
using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.B3ProcurementInterface.BO;
using BWP.B3ProcurementInterface.Utils;
using BWP.B3SubstituteKill.BO;
using BWP.Web.Layout;
using BWP.Web.Utils;
using BWP.Web.WebControls;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using TSingSoft.WebControls2;
using TSingSoft.WebPluginFramework;
namespace BWP.Web.Pages.B3SubstituteKill.Reports.SubKillFromToAccountAnalyse_
{
class SubKillFromToAccountAnalyse: DFBrowseGridReportPage<SubKillFromToAccountAnalyse_View>
{
protected override string AccessRoleName
{
get { return "B3SubstituteKill.报表.代宰往来账"; }
}
protected override string Caption
{
get { return "代宰往来账"; }
}
CheckBoxListWithReverseSelect _checkbox;
protected override void InitQueryPanel(QueryPanel queryPanel)
{
queryPanel.EAdd(new LiteralControl(string.Format("<a style='font-size:20px;color:#000000;margin-right:20px;' href ='{0}'>汇总查询</a>", AspUtil.AddTimeStampToUrl("SubKillFromToAccountSummaryAnalyse.aspx"))));
queryPanel.EAdd(new LiteralControl("<a style='font-size:20px;color:#FFFFFF;background-color:#42a3da;' href ='#'>明细查询</a>"));
base.InitQueryPanel(queryPanel);
var panel = queryPanel.CreateTab("显示字段");
_checkbox = new CheckBoxListWithReverseSelect() { RepeatColumns = 6, RepeatDirection = RepeatDirection.Horizontal };
//单据类型、单据号、日期、会计单位、销售部门、销售人员、购货客户、销售地区、客户分类、结账客户
var showFields = new List<Tuple<string, string>>();
showFields.Add(new Tuple<string, string>("BillType", "单据类型"));
showFields.Add(new Tuple<string, string>("BillID", "单据号"));
showFields.Add(new Tuple<string, string>("Date", "日期"));
showFields.Add(new Tuple<string, string>("AccountingUnit_Name", "会计单位"));
showFields.Add(new Tuple<string, string>("Supplier_Name", "供应商"));
showFields.Add(new Tuple<string, string>("借方", "借方"));
showFields.Add(new Tuple<string, string>("贷方", "贷方"));
showFields.Add(new Tuple<string, string>("余额", "余额"));
var section = mPageLayoutManager.AddSection("显示字段", "显示字段");
section.ApplyLayout(showFields, mPageLayoutManager);
foreach (var item in showFields)
{
_checkbox.Items.Add(new ListItem(item.Item2, item.Item1));
}
panel.EAdd(_checkbox);
queryPanel.ConditonPanel.EAdd(CreateDataRangePanel());
mQueryControls.Add("显示字段", _checkbox);
mQueryControls.EnableHoldLastControlNames.Add("显示字段");
}
Control CreateDataRangePanel()
{
var hPanel = new HLayoutPanel();
hPanel.Add(new SimpleLabel("日期"));
hPanel.Add(QueryCreator.TimeRange(mDFInfo.Fields["Date"], mQueryContainer, "MinDate", "MaxDate"));
return hPanel;
}
DFDropDownList downList;
protected override void AddQueryControls(VLayoutPanel vPanel)
{
var customPanel = new LayoutManager("Main", mDFInfo, mQueryContainer);
customPanel.Add("AccountingUnit_ID", QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["AccountingUnit_ID"], mQueryContainer, "AccountingUnit_ID","授权会计单位"));
customPanel["AccountingUnit_ID"].NotAutoAddToContainer = true;
customPanel.Add("Supplier_ID", QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["Supplier_ID"], mQueryContainer, "Supplier_ID", B3ProcurementInterfaceDataSources.));
customPanel["Supplier_ID"].NotAutoAddToContainer = true;
downList = new DFDropDownList();
downList.Items.Add(new ListItem("待宰结算", DmoTypeIDAttribute.GetID(typeof(StatPay)).ToString()));
downList.Items.Add(new ListItem("待宰收款", DmoTypeIDAttribute.GetID(typeof(SubKillGathering)).ToString()));
customPanel.Add("BillTypeID", downList);
customPanel["BillTypeID"].NotAutoAddToContainer = true;
var config = customPanel.CreateDefaultConfig(2);
config.Expand = false;
var section = mPageLayoutManager.AddSection("查询条件", "查询条件");
section.ApplyLayout(customPanel, config, mPageLayoutManager, mDFInfo);
vPanel.Add(customPanel.CreateLayout());
}
protected override DQueryDom GetQueryDom()
{
var minDate = mQueryContainer.GetControl<DFDateTimeInput>("MinDate").Value;
if (minDate == null)
minDate = new DateTime(2000, 1, 1, 12, 0, 0);
var query = base.GetQueryDom();
query.Where.Conditions.Add(DQCondition.EQ("Domain_ID", DomainContext.Current.ID));
var rootAlias = query.From.RootSource.Alias;
if (downList.SelectedIndex > 0)
{
query.Where.Conditions.Add(DQCondition.EQ("BillTypeID", downList.SelectedItem.Value));
}
foreach (ListItem field in _checkbox.Items)
{
if (field.Selected)
{
switch (field.Value)
{
case "借方":
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.LogicCase(DQCondition.EQ("BillTypeID", DmoTypeIDAttribute.GetID(typeof(StatPay))), DQExpression.Field("Money"), DQExpression.Value(0))), "借方"));
SumColumnIndexs.Add(query.Columns.Count - 1);
break;
case "贷方":
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.LogicCase(DQCondition.EQ("BillTypeID", DmoTypeIDAttribute.GetID(typeof(SubKillGathering))), DQExpression.Multiply(DQExpression.Value(-1), DQExpression.Field("Money")), DQExpression.Value(0))), "贷方"));
SumColumnIndexs.Add(query.Columns.Count - 1);
break;
case "余额":
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.LogicCase(DQExpression.LessThan(DQExpression.Field("Date"), DQExpression.Value(minDate)), DQExpression.Field("Money"), DQExpression.Value(0))), "期初余额"));
SumColumnIndexs.Add(query.Columns.Count - 1);
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value("借方"), "余额方向"));
var initialBalance = GetInitialBalance(query);
IDQSelectColumn col = DQSelectColumn.SumUp(DQExpression.Sum(DQExpression.Field("Money")), "余额|期初:" + initialBalance);
query.Columns.Add(col);
SumColumnIndexs.Add(query.Columns.Count - 1);
break;
default:
query.Columns.Add(DQSelectColumn.Field(field.Value, rootAlias, field.Text));
query.GroupBy.Expressions.Add(DQExpression.Field(rootAlias, field.Value));
break;
}
}
}
if (query.Columns.Count == 0)
throw new Exception("至少选择一条显示列");
return query;
}
private Money<> GetInitialBalance(DQueryDom query)
{
var minDate = mQueryContainer.GetInput("MinDate");
object beginDate = minDate ?? new DateTime(2014, 1, 1, 12, 0, 0);
Money<> result = 0;
var jie = GetJieMoney(Convert.ToDateTime(beginDate));
var dai = GetDaiMoney(Convert.ToDateTime(beginDate));
return jie - dai;
}
private Money<> GetDaiMoney(DateTime minDate)
{
var query = new DQueryDom(new JoinAlias(typeof(SubKillGathering)));
query.Where.Conditions.Add(DQCondition.EQ("BillState", .));
query.Where.Conditions.Add(DQCondition.EQ("Domain_ID", DomainContext.Current.ID));
query.Where.Conditions.Add(DQCondition.LessThanOrEqual("Date", minDate));
query.Columns.Add(DQSelectColumn.Sum("Money"));
return query.EExecuteScalar<Money<>?>() ?? 0;
}
private Money<> GetJieMoney(DateTime minDate)
{
var query = new DQueryDom(new JoinAlias(typeof(StatPay)));
query.Where.Conditions.Add(DQCondition.EQ("BillState",.));
query.Where.Conditions.Add(DQCondition.EQ("Domain_ID", DomainContext.Current.ID));
query.Where.Conditions.Add(DQCondition.LessThanOrEqual("Date", minDate));
query.Columns.Add(DQSelectColumn.Sum("ReceiveMoney"));
return query.EExecuteScalar<Money<>?>()??0;
}
}
}

+ 37
- 0
B3SubstituteKill.Web/Pages/B3SubstituteKill/Reports/SubKillFromToAccountAnalyse_/SubKillFromToAccountAnalyse.xml View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
</Columns>
<From>
<DmoClass class="BWP.B3SubstituteKill.BO.SubKillFromToAccountAnalyse_View, B3SubstituteKill"/>
</From>
<Where>
<And>
<EQ>
<Field name="AccountingUnit_ID"/>
<QBE paramName="AccountingUnit_ID"/>
</EQ>
<EQ>
<Field name="Supplier_ID"/>
<QBE paramName="Supplier_ID"/>
</EQ>
<GreaterThanOrEqual>
<Field name="Date"/>
<QBE paramName="MinDate" />
</GreaterThanOrEqual>
<LessThanOrEqual>
<Field name="Date"/>
<QBE paramName="MaxDate"/>
</LessThanOrEqual>
</And>
</Where>
</Select>

+ 194
- 0
B3SubstituteKill.Web/Pages/B3SubstituteKill/Reports/SubKillFromToAccountAnalyse_/SubKillFromToAccountSummaryAnalyse.cs View File

@ -0,0 +1,194 @@
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO.MoneyTemplate;
using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.B3ProcurementInterface.Utils;
using BWP.B3SubstituteKill.BO;
using BWP.Web.Layout;
using BWP.Web.Utils;
using BWP.Web.WebControls;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.Utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using TSingSoft.WebControls2;
using TSingSoft.WebPluginFramework;
namespace BWP.Web.Pages.B3SubstituteKill.Reports.SubKillFromToAccountAnalyse_
{
class SubKillFromToAccountSummaryAnalyse : DFBrowseGridReportPage<SubKillFromToAccountAnalyse_View>
{
protected override string AccessRoleName
{
get { return "B3SubstituteKill.报表.代宰往来账"; }
}
protected override string Caption
{
get { return "代宰往来账"; }
}
CheckBoxListWithReverseSelect _checkbox;
protected override void InitQueryPanel(QueryPanel queryPanel)
{
queryPanel.EAdd(new LiteralControl("<a style='font-size:20px;margin-right:20px;color:#FFFFFF;background-color:#42a3da;' href ='#'>汇总查询</a>"));
queryPanel.EAdd(new LiteralControl(string.Format("<a style='font-size:20px;color:#000000;' href ='{0}'>明细查询</a>", AspUtil.AddTimeStampToUrl("SubKillFromToAccountAnalyse.aspx"))));
base.InitQueryPanel(queryPanel);
var panel = queryPanel.CreateTab("显示字段");
_checkbox = new CheckBoxListWithReverseSelect() { RepeatColumns = 6, RepeatDirection = RepeatDirection.Horizontal };
//单据类型、单据号、日期、会计单位、销售部门、销售人员、购货客户、销售地区、客户分类、结账客户
var showFields = new List<Tuple<string, string>>();
showFields.Add(new Tuple<string, string>("AccountingUnit_Name", "会计单位"));
showFields.Add(new Tuple<string, string>("Supplier_Name", "供应商"));
showFields.Add(new Tuple<string, string>("期初余额", "期初余额"));
showFields.Add(new Tuple<string, string>("借方", "借方"));
showFields.Add(new Tuple<string, string>("贷方", "贷方"));
showFields.Add(new Tuple<string, string>("余额", "余额"));
var section = mPageLayoutManager.AddSection("显示字段", "显示字段");
section.ApplyLayout(showFields, mPageLayoutManager);
foreach (var item in showFields)
{
_checkbox.Items.Add(new ListItem(item.Item2, item.Item1));
}
panel.EAdd(_checkbox);
queryPanel.ConditonPanel.EAdd(CreateDataRangePanel());
mQueryControls.Add("显示字段", _checkbox);
mQueryControls.EnableHoldLastControlNames.Add("显示字段");
}
Control CreateDataRangePanel()
{
var hPanel = new HLayoutPanel();
hPanel.Add(new SimpleLabel("日期"));
hPanel.Add(QueryCreator.TimeRange(mDFInfo.Fields["Date"], mQueryContainer, "MinDate", "MaxDate"));
return hPanel;
}
DFDropDownList downList;
protected override void AddQueryControls(VLayoutPanel vPanel)
{
var customPanel = new LayoutManager("Main", mDFInfo, mQueryContainer);
customPanel.Add("AccountingUnit_ID", QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["AccountingUnit_ID"], mQueryContainer, "AccountingUnit_ID", "授权会计单位"));
customPanel["AccountingUnit_ID"].NotAutoAddToContainer = true;
customPanel.Add("Supplier_ID", QueryCreator.DFChoiceBoxEnableMultiSelection(mDFInfo.Fields["Supplier_ID"], mQueryContainer, "Supplier_ID", B3ProcurementInterfaceDataSources.));
customPanel["Supplier_ID"].NotAutoAddToContainer = true;
downList = new DFDropDownList();
downList.Items.Add(new ListItem("待宰结算", DmoTypeIDAttribute.GetID(typeof(StatPay)).ToString()));
downList.Items.Add(new ListItem("待宰收款", DmoTypeIDAttribute.GetID(typeof(SubKillGathering)).ToString()));
customPanel.Add("BillTypeID", downList);
customPanel["BillTypeID"].NotAutoAddToContainer = true;
var config = customPanel.CreateDefaultConfig(2);
config.Expand = false;
var section = mPageLayoutManager.AddSection("查询条件", "查询条件");
section.ApplyLayout(customPanel, config, mPageLayoutManager, mDFInfo);
vPanel.Add(customPanel.CreateLayout());
}
protected override DQueryDom GetQueryDom()
{
var minDate = mQueryContainer.GetControl<DFDateTimeInput>("MinDate").Value;
if (minDate == null)
minDate = new DateTime(2000, 1, 1, 12, 0, 0);
var maxDate = mQueryContainer.GetControl<DFDateTimeInput>("MaxDate").Value;
if (maxDate == null)
maxDate = new DateTime(2069, 1, 1, 12, 0, 0);
var query = base.GetQueryDom();
query.Where.Conditions.Add(DQCondition.EQ("Domain_ID", DomainContext.Current.ID));
var rootAlias = query.From.RootSource.Alias;
if (downList.SelectedIndex > 0)
{
query.Where.Conditions.Add(DQCondition.EQ("BillTypeID", downList.SelectedItem.Value));
}
foreach (ListItem field in _checkbox.Items)
{
if (field.Selected)
{
switch (field.Value)
{
case "借方":
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.LogicCase(DQCondition.EQ("BillTypeID", DmoTypeIDAttribute.GetID(typeof(StatPay))), DQExpression.Field("Money"), DQExpression.Value(0))), "借方"));
SumColumnIndexs.Add(query.Columns.Count - 1);
break;
case "贷方":
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.LogicCase(DQCondition.EQ("BillTypeID", DmoTypeIDAttribute.GetID(typeof(SubKillGathering))), DQExpression.Multiply(DQExpression.Value(-1), DQExpression.Field("Money")), DQExpression.Value(0))), "贷方"));
SumColumnIndexs.Add(query.Columns.Count - 1);
break;
case "期初余额":
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.LogicCase(DQExpression.LessThan(DQExpression.Field("Date"), DQExpression.Value(minDate)), DQExpression.Field("Money"), DQExpression.Value(0))), "期初余额"));
SumColumnIndexs.Add(query.Columns.Count - 1);
break;
case "余额":
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value("借方"), "余额方向"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Sum(DQExpression.LogicCase(DQExpression.LessThanOrEqual(DQExpression.Field("Date"), DQExpression.Value(maxDate)), DQExpression.Field("Money"), DQExpression.Value(0))), "余额"));
SumColumnIndexs.Add(query.Columns.Count - 1);
break;
default:
query.Columns.Add(DQSelectColumn.Field(field.Value, rootAlias, field.Text));
query.GroupBy.Expressions.Add(DQExpression.Field(rootAlias, field.Value));
break;
}
}
}
if (query.Columns.Count == 0)
throw new Exception("至少选择一条显示列");
return query;
}
private Money<> GetInitialBalance(DQueryDom query)
{
var minDate = mQueryContainer.GetInput("MinDate");
object beginDate = minDate ?? new DateTime(2014, 1, 1, 12, 0, 0);
Money<> result = 0;
var jie = GetJieMoney(Convert.ToDateTime(beginDate));
var dai = GetDaiMoney(Convert.ToDateTime(beginDate));
return jie - dai;
}
private Money<> GetDaiMoney(DateTime minDate)
{
var query = new DQueryDom(new JoinAlias(typeof(SubKillGathering)));
query.Where.Conditions.Add(DQCondition.EQ("BillState", .));
query.Where.Conditions.Add(DQCondition.EQ("Domain_ID", DomainContext.Current.ID));
query.Where.Conditions.Add(DQCondition.LessThanOrEqual("Date", minDate));
query.Columns.Add(DQSelectColumn.Sum("Money"));
return query.EExecuteScalar<Money<>?>() ?? 0;
}
private Money<> GetJieMoney(DateTime minDate)
{
var query = new DQueryDom(new JoinAlias(typeof(StatPay)));
query.Where.Conditions.Add(DQCondition.EQ("BillState", .));
query.Where.Conditions.Add(DQCondition.EQ("Domain_ID", DomainContext.Current.ID));
query.Where.Conditions.Add(DQCondition.LessThanOrEqual("Date", minDate));
query.Columns.Add(DQSelectColumn.Sum("ReceiveMoney"));
return query.EExecuteScalar<Money<>?>() ?? 0;
}
}
}

+ 27
- 0
B3SubstituteKill.Web/Pages/B3SubstituteKill/Reports/SubKillFromToAccountAnalyse_/SubKillFromToAccountSummaryAnalyse.xml View File

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<Select xmlns="urn:XDQuery">
<Columns>
</Columns>
<From>
<DmoClass class="BWP.B3SubstituteKill.BO.SubKillFromToAccountAnalyse_View, B3SubstituteKill"/>
</From>
<Where>
<And>
<EQ>
<Field name="AccountingUnit_ID"/>
<QBE paramName="AccountingUnit_ID"/>
</EQ>
<EQ>
<Field name="Supplier_ID"/>
<QBE paramName="Supplier_ID"/>
</EQ>
</And>
</Where>
</Select>

+ 1
- 0
B3SubstituteKill/B3SubstituteKill.csproj View File

@ -130,6 +130,7 @@
<Compile Include="BO\Bills\SubKillWeightBill\SubKillWeightBill.cs" />
<Compile Include="BO\Bills\SubKillWeightBill\SubKillWeightBill_Detail.cs" />
<Compile Include="BO\Bills\SubKillWeightBill\WeightingInfo.cs" />
<Compile Include="BO\SubKillFromToAccountAnalyse_View.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Rpcs\SupplierRpc.cs" />
<Compile Include="Utils\B3SubstituteKillConsts.cs" />


+ 7
- 0
B3SubstituteKill/BL/Bills/SubKillGathering/SubKillGatheringBL.cs View File

@ -23,6 +23,13 @@ namespace BWP.B3SubstituteKill.BL
public class SubKillGatheringBL : DepartmentWorkFlowBillBL<SubKillGathering>, ISubKillGatheringBL
{
protected override void beforeSave(SubKillGathering dmo)
{
dmo.Money = dmo.Details.Sum(x => (x.ThisReceiveMoney ?? 0).Value);
base.beforeSave(dmo);
}
protected override void doCheck(SubKillGathering dmo)
{
// foreach (var detail in dmo.Details)


+ 5
- 0
B3SubstituteKill/BO/Bills/SubKillGathering/SubKillGathering.cs View File

@ -5,12 +5,14 @@ using System.Text;
using BWP.B3Frameworks;
using BWP.B3Frameworks.Attributes;
using BWP.B3Frameworks.BO;
using BWP.B3Frameworks.BO.MoneyTemplate;
using BWP.B3ProcurementInterface.BO;
using BWP.B3ProcurementInterface.Utils;
using BWP.B3SubstituteKill.Utils;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.Utils;
using TSingSoft.WebControls2;
namespace BWP.B3SubstituteKill.BO
@ -59,6 +61,9 @@ namespace BWP.B3SubstituteKill.BO
public string Supplier_Address { get; set; }
[LogicName("金额")]//本次收款合计
public Money<>? Money { get; set; }
private SubKillGathering_DetailCollection _mDetails = new SubKillGathering_DetailCollection();
[OneToMany(typeof(SubKillGathering_Detail), "ID")]
[Join("ID", "SubKillGathering_ID")]


+ 120
- 0
B3SubstituteKill/BO/SubKillFromToAccountAnalyse_View.cs View File

@ -0,0 +1,120 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BWP.B3Frameworks;
using BWP.B3Frameworks.BO;
using BWP.B3Frameworks.BO.MoneyTemplate;
using BWP.B3Frameworks.BO.NamedValueTemplate;
using BWP.B3ProcurementInterface.BO;
using Forks.EnterpriseServices;
using Forks.EnterpriseServices.DataForm;
using Forks.EnterpriseServices.DomainObjects2;
using Forks.EnterpriseServices.DomainObjects2.DQuery;
using Forks.EnterpriseServices.SqlDoms;
using Forks.Utils;
using Forks.Utils.Data;
using TSingSoft.WebPluginFramework;
namespace BWP.B3SubstituteKill.BO
{
[MapToView]
[DFClass,Serializable]
public class SubKillFromToAccountAnalyse_View : ICreateView
{
public ISqlDom CreateView()
{
UnionItem statPayUnion = new UnionItem(StatPaySelectDom(), UnionType.Default);
UnionItem gatheringUnion = new UnionItem(GatheringSelectDom(), UnionType.All);
UnionDom unionDom = new UnionDom();
unionDom.Items.Add(statPayUnion);
unionDom.Items.Add(gatheringUnion);
return unionDom;
}
private SelectDom GatheringSelectDom()
{
var query = new DQueryDom(new JoinAlias(typeof(SubKillGathering)));
query.Where.Conditions.Add(DQCondition.EQ("BillState", .));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("Domain_ID"), "Domain_ID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value<short>(DmoTypeIDAttribute.GetID(typeof(SubKillGathering))), "BillTypeID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value<string>("待宰收款"), "BillType"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("ID"), "BillID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("Date"), "Date"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("AccountingUnit_ID"), "AccountingUnit_ID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("Supplier_ID"), "Supplier_ID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Multiply(DQExpression.Value(-1), DQExpression.Field("Money")), "Money"));
return (SelectDom)query.Build(DbProviderType.SqlClient, DbmsType.SqlServer2005);
}
private SelectDom StatPaySelectDom()
{
var query = new DQueryDom(new JoinAlias(typeof(StatPay)));
query.Where.Conditions.Add(DQCondition.EQ("BillState", .));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("Domain_ID"), "Domain_ID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value<short>(DmoTypeIDAttribute.GetID(typeof(StatPay))), "BillTypeID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value<string>("待宰结算"), "BillType"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("ID"), "BillID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("Date"), "Date"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("AccountingUnit_ID"), "AccountingUnit_ID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("Supplier_ID"), "Supplier_ID"));
query.Columns.Add(DQSelectColumn.Create(DQExpression.Field("ReceiveMoney"), "Money"));
return (SelectDom)query.Build(DbProviderType.SqlClient, DbmsType.SqlServer2005);
}
public long? Domain_ID { get; set; }
[LogicName("单据类型")]
public short BillTypeID { get; set; }
[LogicName("单据类型")]
public string BillType { get; set; }
[LogicName("单号")]
public long BillID { get; set; }
[LogicName("日期")]
public DateTime? Date { get; set; }
[LogicName("会计单位")]
public long? AccountingUnit_ID { get; set; }
[LogicName("会计单位")]
[ReferenceTo(typeof(AccountingUnit), "Name")]
[Join("AccountingUnit_ID", "ID")]
public string AccountingUnit_Name { get; set; }
[LogicName("供应商")]
public long? Supplier_ID { get; set; }
[LogicName("供应商")]
[ReferenceTo(typeof(Supplier), "Name")]
[Join("Supplier_ID", "ID")]
public string Supplier_Name { get; set; }
[LogicName("金额")]
public Money<>? Money { get; set; }
//[LogicName("借方")]
//public Money<金额>? JieMoney { get; set; }
//[LogicName("贷方")]
//public Money<金额>? DaiMoney { get; set; }
//[LogicName("余额")]
//public Money<金额>? LeftMoney { get; set; }
}
}

+ 8
- 0
WebFolder/config/Plugins/B3SubstituteKill.plugin View File

@ -139,6 +139,12 @@
<Function index="10" name="完毕"/>
<Function index="11" name="撤销完毕"/>
</FunctionGroup>
<FunctionGroup name="报表" roleSchemas="employee">
<Function index="0" name="代宰往来账" />
</FunctionGroup>
</Security>
<Menus>
<Menu id="0001" name="/B3代宰模块/基础信息/代宰费用" roles="B3SubstituteKill.代宰费用.访问" url="B3SubstituteKill/BaseInfos/GenerationCostItem_/GenerationCostItemList.aspx"/>
@ -150,6 +156,8 @@
<Menu id="0008" name="/B3代宰模块/业务单据/代宰排宰" roles="B3SubstituteKill.代宰排宰.访问" url="B3SubstituteKill/Bills/SubKillButcherOrder_/SubKillButcherOrderList.aspx"/>
<Menu id="0010" name="/B3代宰模块/业务单据/代宰结算" roles="B3SubstituteKill.代宰结算.访问" url="B3SubstituteKill/Bills/StatPay_/StatPayList.aspx"/>
<Menu id="0011" name="/B3代宰模块/业务单据/代宰收款" roles="B3SubstituteKill.代宰收款.访问" url="B3SubstituteKill/Bills/SubKillGathering_/SubKillGatheringList.aspx"/>
<Menu id="0012" name="/B3代宰模块/报表/代宰往来账" roles="B3SubstituteKill.报表.代宰往来账" url="B3SubstituteKill/Reports/SubKillFromToAccountAnalyse_/SubKillFromToAccountAnalyse.aspx"/>
</Menus>
<Features>


Loading…
Cancel
Save