| @ -0,0 +1,150 @@ | |||||
| using BWP.B3SubstituteKill.BL; | |||||
| using BWP.B3SubstituteKill.BO; | |||||
| using BWP.Web.Layout; | |||||
| using BWP.Web.WebControls; | |||||
| using Forks.EnterpriseServices.DataForm; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using System.Web.UI.WebControls; | |||||
| using TSingSoft.WebControls2; | |||||
| using Forks.Utils.Collections; | |||||
| namespace BWP.Web.Pages.B3SubstituteKill.Bills.StatPay_ | |||||
| { | |||||
| class StatPayEdit : DepartmentWorkFlowBillEditPage<StatPay, IStatPayBL> | |||||
| { | |||||
| protected override void BuildBasePropertiesEditor(TitlePanel titlePanel, CustomPageLayout.PageLayoutSection pageLayoutSection) | |||||
| { | |||||
| var layoutManager = new LayoutManager("", mDFInfo, mDFContainer); | |||||
| var config = new AutoLayoutConfig(); | |||||
| config.Add("AccountingUnit_ID"); | |||||
| config.Add("Department_ID"); | |||||
| config.Add("Employee_ID"); | |||||
| config.Add("Date"); | |||||
| config.Add("Supplier_ID"); | |||||
| config.Add("Supplier_Tel"); | |||||
| config.Add("Supplier_Card_ID"); | |||||
| config.Add("Supplier_Address"); | |||||
| config.Add("Number"); | |||||
| config.Add("Weight"); | |||||
| config.Add("PriceBill_ID"); | |||||
| config.Add("ReceiveMoney"); | |||||
| config.Add("Remark"); | |||||
| layoutManager.Config = config; | |||||
| pageLayoutSection.ApplyLayout(layoutManager, config, mPageLayoutManager, mDFInfo); | |||||
| titlePanel.Controls.Add(layoutManager.CreateLayout()); | |||||
| if (layoutManager.Contains("Supplier_ID")) | |||||
| { | |||||
| var supplierInput = layoutManager["Supplier_ID"].InputControl as DFChoiceBox; | |||||
| if (supplierInput != null) | |||||
| { | |||||
| var script = @" | |||||
| var txtValue =parseInt(__DFContainer.getValue('Supplier_ID')); | |||||
| simpleRestCall('/MainSystem/B3SubstituteKill/Rpcs/SupplierRpc/GetSupplierAndPriceBillID',[txtValue,__DFContainer.getControl('Date').value], | |||||
| function(result){ | |||||
| if(typeof(result.Address)!='undefined') | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Address',result.Address); | |||||
| } | |||||
| else | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Address',''); | |||||
| } | |||||
| if(typeof(result.Tel)!='undefined') | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Tel',result.Tel); | |||||
| } | |||||
| else | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Tel',''); | |||||
| } | |||||
| if(typeof(result.Supplier_Card_ID)!='undefined') | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Card_ID',result.Card_ID); | |||||
| } | |||||
| else | |||||
| { | |||||
| __DFContainer.setValue('Supplier_Card_ID',''); | |||||
| } | |||||
| if(typeof(result.SupplierApply_ID)!='undefined') | |||||
| { | |||||
| __DFContainer.setValue('PriceBill_ID',result.SupplierApply_ID); | |||||
| } | |||||
| else | |||||
| { | |||||
| __DFContainer.setValue('PriceBill_ID',''); | |||||
| } | |||||
| },{ });"; | |||||
| supplierInput.OnClientSelected = script; | |||||
| } | |||||
| } | |||||
| } | |||||
| protected override void BuildBody(System.Web.UI.Control parent) | |||||
| { | |||||
| base.BuildBody(parent); | |||||
| AddCostDetail(parent.EAdd(new TitlePanel("代宰费用", "代宰费用"))); | |||||
| AddCallbackPayDetail(parent.EAdd(new TitlePanel("回收应付", "回收应付"))); | |||||
| } | |||||
| DFEditGrid _costDetail; | |||||
| private void AddCostDetail(TitlePanel titlePanel) | |||||
| { | |||||
| var editor = new DFCollectionEditor<StatPay_CostDetail>(() => Dmo.CostDetails); | |||||
| editor.AllowDeletionFunc = () => CanSave; | |||||
| editor.CanDeleteFunc = detail => CanSave; | |||||
| editor.IsEditableFunc = (field, detail) => false; | |||||
| _costDetail = titlePanel.EAdd(new DFEditGrid(editor) { Width = Unit.Percentage(100) }); | |||||
| _costDetail.Columns.Add(new DFEditGridColumn("SubKillProductLine_Name")); | |||||
| _costDetail.Columns.Add(new DFEditGridColumn("GenerationCostItem_Name")); | |||||
| _costDetail.Columns.Add(new DFEditGridColumn("Price")); | |||||
| _costDetail.Columns.EAdd(new DFEditGridColumn("Money")); | |||||
| var section = mPageLayoutManager.AddSection("CostDetail", "代宰费用"); | |||||
| titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name); | |||||
| section.ApplyLayout(_costDetail, mPageLayoutManager, DFInfo.Get(typeof(StatPay_CostDetail))); | |||||
| } | |||||
| DFEditGrid _callbackPayDetail; | |||||
| private void AddCallbackPayDetail(TitlePanel titlePanel) | |||||
| { | |||||
| var editor = new DFCollectionEditor<StatPay_CallbackPayDetail>(() => Dmo.CallbackPayDetails); | |||||
| editor.AllowDeletionFunc = () => CanSave; | |||||
| editor.CanDeleteFunc = detail => CanSave; | |||||
| editor.IsEditableFunc = (field, detail) => false; | |||||
| _callbackPayDetail = titlePanel.EAdd(new DFEditGrid(editor) { Width = Unit.Percentage(100) }); | |||||
| _callbackPayDetail.Columns.Add(new DFEditGridColumn("SubKillCallBack_Name")); | |||||
| _callbackPayDetail.Columns.Add(new DFEditGridColumn("Price")); | |||||
| _callbackPayDetail.Columns.EAdd(new DFEditGridColumn("Money")); | |||||
| var section = mPageLayoutManager.AddSection("CallbackPayDetail", "回收应付"); | |||||
| titlePanel.SetPageLayoutSetting(mPageLayoutManager, section.Name); | |||||
| section.ApplyLayout(_callbackPayDetail, mPageLayoutManager, DFInfo.Get(typeof(StatPay_CallbackPayDetail))); | |||||
| } | |||||
| public override void AppToUI() | |||||
| { | |||||
| base.AppToUI(); | |||||
| _costDetail.DataBind(); | |||||
| _callbackPayDetail.DataBind(); | |||||
| } | |||||
| public override void GetFromUI() | |||||
| { | |||||
| base.GetFromUI(); | |||||
| _costDetail.GetFromUI(); | |||||
| _callbackPayDetail.GetFromUI(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,38 @@ | |||||
| using BWP.B3SubstituteKill.BL; | |||||
| using BWP.B3SubstituteKill.BO; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using TSingSoft.WebControls2; | |||||
| namespace BWP.Web.Pages.B3SubstituteKill.Bills.StatPay_ | |||||
| { | |||||
| class StatPayList : DomainBillListPage<StatPay, IStatPayBL> | |||||
| { | |||||
| protected override void AddQueryControls(VLayoutPanel vPanel) | |||||
| { | |||||
| vPanel.Add(CreateDefaultBillQueryControls((panel, config) => | |||||
| { | |||||
| config.Add("AccountingUnit_ID"); | |||||
| config.Add("Department_ID"); | |||||
| config.Add("Employee_ID"); | |||||
| config.Add("Date"); | |||||
| config.Add("Supplier_ID"); | |||||
| })); | |||||
| } | |||||
| protected override void AddDFBrowseGridColumn(DFBrowseGrid grid, string field) | |||||
| { | |||||
| base.AddDFBrowseGridColumn(grid, field); | |||||
| if (field == "BillState") | |||||
| { | |||||
| AddDFBrowseGridColumn(grid, "AccountingUnit_Name"); | |||||
| AddDFBrowseGridColumn(grid, "Department_Name"); | |||||
| AddDFBrowseGridColumn(grid, "Employee_Name"); | |||||
| AddDFBrowseGridColumn(grid, "Date"); | |||||
| AddDFBrowseGridColumn(grid, "Supplier_Name"); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,72 @@ | |||||
| <?xml version="1.0" encoding="utf-8" ?> | |||||
| <Select xmlns="urn:XDQuery"> | |||||
| <Columns> | |||||
| <Field name="ID"/> | |||||
| </Columns> | |||||
| <From> | |||||
| <DmoClass class="BWP.B3SubstituteKill.BO.StatPay, B3SubstituteKill"/> | |||||
| </From> | |||||
| <Where> | |||||
| <And> | |||||
| <EQ> | |||||
| <Field name="ID"/> | |||||
| <QBE paramName="ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="AccountingUnit_ID"/> | |||||
| <QBE paramName="AccountingUnit_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="Department_ID"/> | |||||
| <QBE paramName="Department_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="Employee_ID"/> | |||||
| <QBE paramName="Employee_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="Supplier_ID"/> | |||||
| <QBE paramName="Supplier_ID"/> | |||||
| </EQ> | |||||
| <EQ> | |||||
| <Field name="IsLocked"/> | |||||
| <QBE paramName="IsLocked"/> | |||||
| </EQ> | |||||
| <Contains> | |||||
| <Field name="Remark"/> | |||||
| <QBE paramName="Remark"/> | |||||
| </Contains> | |||||
| <Contains> | |||||
| <Field name="CreateUser_Name"/> | |||||
| <QBE paramName="CreateUser_Name"/> | |||||
| </Contains> | |||||
| <Contains> | |||||
| <Field name="CheckUser_Name"/> | |||||
| <QBE paramName="CheckUser_Name"/> | |||||
| </Contains> | |||||
| <GreaterThanOrEqual> | |||||
| <Field name="CreateTime"/> | |||||
| <QBE paramName="MinCreateTime" /> | |||||
| </GreaterThanOrEqual> | |||||
| <LessThanOrEqual> | |||||
| <Field name="CreateTime"/> | |||||
| <QBE paramName="MaxCreateTime"/> | |||||
| </LessThanOrEqual> | |||||
| <GreaterThanOrEqual> | |||||
| <Field name="Date"/> | |||||
| <QBE paramName="MinDate" /> | |||||
| </GreaterThanOrEqual> | |||||
| <LessThanOrEqual> | |||||
| <Field name="Date"/> | |||||
| <QBE paramName="MaxDate"/> | |||||
| </LessThanOrEqual> | |||||
| <EQ> | |||||
| <Field name="BillState"/> | |||||
| <QBE paramName ="BillState"/> | |||||
| </EQ> | |||||
| </And> | |||||
| </Where> | |||||
| </Select> | |||||
| @ -0,0 +1,22 @@ | |||||
| using BWP.B3SubstituteKill.BL; | |||||
| using BWP.B3SubstituteKill.BO; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| namespace BWP.Web.Pages.B3SubstituteKill.Bills.StatPay_ | |||||
| { | |||||
| class StatPayPrint : DomainTemplatePrintPage<StatPay, IStatPayBL> | |||||
| { | |||||
| protected override void AddParameters(IDictionary<string, object> dic) | |||||
| { | |||||
| dic.Add("$ID", Dmo.ID); | |||||
| dic.Add("$CostDetails", Dmo.CostDetails); | |||||
| dic.Add("$CostDetailType", typeof(StatPay_CostDetail)); | |||||
| dic.Add("$CallbackPayDetails", Dmo.CallbackPayDetails); | |||||
| dic.Add("$CallbackPayDetailType", typeof(StatPay_CallbackPayDetail)); | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,20 @@ | |||||
| using BWP.B3Frameworks.BL; | |||||
| using BWP.B3SubstituteKill.BO; | |||||
| using Forks.EnterpriseServices; | |||||
| using Forks.EnterpriseServices.BusinessInterfaces; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| namespace BWP.B3SubstituteKill.BL | |||||
| { | |||||
| [BusinessInterface(typeof(StatPayBL))] | |||||
| [LogicName("代宰结算")] | |||||
| public interface IStatPayBL : IDepartmentWorkFlowBillBL<StatPay> | |||||
| { } | |||||
| public class StatPayBL : DepartmentWorkFlowBillBL<StatPay>, IStatPayBL | |||||
| { | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,98 @@ | |||||
| 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 System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| using TSingSoft.WebControls2; | |||||
| namespace BWP.B3SubstituteKill.BO | |||||
| { | |||||
| [DFClass, Serializable] | |||||
| [LogicName("代宰结算")] | |||||
| [DmoTypeID(B3FrameworksConsts.DmoTypeIDBases.B3SubstituteKill, B3SubstituteKillConsts.DmoTypeIDOffsets.StatPay)] | |||||
| [EditUrl("~/B3SubstituteKill/Bills/StatPay_/StatPayEdit.aspx")] | |||||
| public class StatPay : DepartmentWorkFlowBill | |||||
| { | |||||
| private DateTime? date = DateTime.Now; | |||||
| [LogicName("过磅时间")] | |||||
| [DFExtProperty("WebControlType", DFEditControl.DateTimeInput)] | |||||
| [DFNotEmpty] | |||||
| public DateTime? Date | |||||
| { | |||||
| get { return date; } | |||||
| set { date = value; } | |||||
| } | |||||
| [DFDataKind(B3ProcurementInterfaceDataSources.供应商用于屠宰场)] | |||||
| [DFExtProperty(B3FrameworksConsts.DFExtProperties.DisplayField, "Supplier_Name")] | |||||
| [DFExtProperty(B3FrameworksConsts.DFExtProperties.QueryDataKind, B3ProcurementInterfaceDataSources.供应商用于屠宰场全部)] | |||||
| [DFExtProperty("WebControlType", DFEditControl.ChoiceBox)] | |||||
| [DFPrompt("供应商")] | |||||
| [DFNotEmpty] | |||||
| public long? Supplier_ID { get; set; } | |||||
| [ReferenceTo(typeof(Supplier), "Name")] | |||||
| [Join("Supplier_ID", "ID")] | |||||
| [DFPrompt("供应商")] | |||||
| public string Supplier_Name { get; set; } | |||||
| [ReferenceTo(typeof(Supplier), "Tel")] | |||||
| [Join("Supplier_ID", "ID")] | |||||
| [DFPrompt("联系方式")] | |||||
| public string Supplier_Tel { get; set; } | |||||
| [ReferenceTo(typeof(Supplier), "Card_ID")] | |||||
| [Join("Supplier_ID", "ID")] | |||||
| [DFPrompt("身份证号")] | |||||
| public string Supplier_Card_ID { get; set; } | |||||
| [ReferenceTo(typeof(Supplier), "Address")] | |||||
| [Join("Supplier_ID", "ID")] | |||||
| [DFPrompt("地址")] | |||||
| public string Supplier_Address { get; set; } | |||||
| [LogicName("代宰头数")] | |||||
| [DFExtProperty("WebControlType", DFEditControl.StaticText)] | |||||
| public int Number { get; set; } | |||||
| [LogicName("代宰重量")] | |||||
| [DFExtProperty("WebControlType", DFEditControl.StaticText)] | |||||
| public Money<decimal> Weight { get; set; } | |||||
| [LogicName("价格单号")] | |||||
| [DFExtProperty("WebControlType", DFEditControl.StaticText)] | |||||
| public long? PriceBill_ID { get; set; } | |||||
| [LogicName("应收金额")] | |||||
| [DFExtProperty("WebControlType", DFEditControl.StaticText)] | |||||
| public Money<金额>? ReceiveMoney { get; set; } | |||||
| private StatPay_CostDetailCollection _mCostDetails = new StatPay_CostDetailCollection(); | |||||
| [OneToMany(typeof(StatPay_CostDetail), "ID")] | |||||
| [Join("ID", "StatPay_ID")] | |||||
| public StatPay_CostDetailCollection CostDetails | |||||
| { | |||||
| get { return _mCostDetails; } | |||||
| set { _mCostDetails = value; } | |||||
| } | |||||
| private StatPay_CallbackPayDetailCollection _mCallbackPayDetails = new StatPay_CallbackPayDetailCollection(); | |||||
| [OneToMany(typeof(StatPay_CallbackPayDetail), "ID")] | |||||
| [Join("ID", "StatPay_ID")] | |||||
| public StatPay_CallbackPayDetailCollection CallbackPayDetails | |||||
| { | |||||
| get { return _mCallbackPayDetails; } | |||||
| set { _mCallbackPayDetails = value; } | |||||
| } | |||||
| } | |||||
| } | |||||
| @ -0,0 +1,37 @@ | |||||
| using BWP.B3Frameworks.BO; | |||||
| using BWP.B3Frameworks.BO.MoneyTemplate; | |||||
| using Forks.EnterpriseServices; | |||||
| using Forks.EnterpriseServices.DataForm; | |||||
| using Forks.EnterpriseServices.DomainObjects2; | |||||
| using Forks.Utils; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| namespace BWP.B3SubstituteKill.BO | |||||
| { | |||||
| [DFClass, Serializable, LogicName("代宰结算_回收应付")] | |||||
| public class StatPay_CallbackPayDetail : Base | |||||
| { | |||||
| public long StatPay_ID { get; set; } | |||||
| [LogicName("回收项目")] | |||||
| public long SubKillCallBack_ID { get; set; } | |||||
| [LogicName("单价")] | |||||
| public Money<decimal>? Price { get; set; } | |||||
| [LogicName("金额")] | |||||
| public Money<金额>? Money { get; set; } | |||||
| [LogicName("回收项目")] | |||||
| [ReferenceTo(typeof(SubKillCallBack), "Name")] | |||||
| [Join("SubKillCallBack_ID", "ID")] | |||||
| public string SubKillCallBack_Name { get; set; } | |||||
| } | |||||
| [Serializable] | |||||
| public class StatPay_CallbackPayDetailCollection : DmoCollection<StatPay_CallbackPayDetail> | |||||
| { } | |||||
| } | |||||
| @ -0,0 +1,45 @@ | |||||
| using BWP.B3Frameworks.BO; | |||||
| using BWP.B3Frameworks.BO.MoneyTemplate; | |||||
| using Forks.EnterpriseServices; | |||||
| using Forks.EnterpriseServices.DataForm; | |||||
| using Forks.EnterpriseServices.DomainObjects2; | |||||
| using Forks.Utils; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Linq; | |||||
| using System.Text; | |||||
| namespace BWP.B3SubstituteKill.BO | |||||
| { | |||||
| [DFClass, Serializable, LogicName("代宰结算_费用明细")] | |||||
| public class StatPay_CostDetail : Base | |||||
| { | |||||
| public long StatPay_ID { get; set; } | |||||
| [LogicName("生产线")] | |||||
| public long? SubKillProductLine_ID { get; set; } | |||||
| [LogicName("费用项目")] | |||||
| public long GenerationCostItem_ID { get; set; } | |||||
| [LogicName("单价")] | |||||
| public Money<decimal>? Price { get; set; } | |||||
| [LogicName("金额")] | |||||
| public Money<金额>? Money { get; set; } | |||||
| [ReferenceTo(typeof(SubKillProductLine), "Name")] | |||||
| [Join("SubKillProductLine_ID", "ID")] | |||||
| [LogicName("生产线")] | |||||
| public string SubKillProductLine_Name { get; set; } | |||||
| [LogicName("费用项目")] | |||||
| [ReferenceTo(typeof(GenerationCostItem), "Name")] | |||||
| [Join("GenerationCostItem_ID", "ID")] | |||||
| public string GenerationCostItem_Name { get; set; } | |||||
| } | |||||
| [Serializable] | |||||
| public class StatPay_CostDetailCollection : DmoCollection<StatPay_CostDetail> | |||||
| { } | |||||
| } | |||||
| @ -0,0 +1,43 @@ | |||||
| <?xml version="1.0" encoding="utf-8"?> | |||||
| <BillReports xmlns="urn:BillReports" version="1.0" displayName="代宰结算" phyName="代宰结算"> | |||||
| <Report phyName="标准格式"> | |||||
| <BillReport xmlns="urn:BillReport" version="1" displayName="标准格式" > | |||||
| <Bands> | |||||
| <TextBand fontName="黑体" fontSize="15" align="Center">代宰结算单№$Dmo.ID</TextBand> | |||||
| <DFInfoBand object="$Dmo" cols="4"> | |||||
| <Field name="AccountingUnit_Name" lblWidth="4"/> | |||||
| <Field name="Department_Name" lblWidth="4"/> | |||||
| <Field name="Employee_Name" lblWidth="4"/> | |||||
| <Field name="Date" lblWidth="4"/> | |||||
| <Field name="Supplier_Name" lblWidth="4"/> | |||||
| <Field name="Supplier_Tel" lblWidth="4"/> | |||||
| <Field name="Supplier_Card_ID" lblWidth="4"/> | |||||
| <Field name="Supplier_Address" lblWidth="4"/> | |||||
| <Field name="Number" lblWidth="4"/> | |||||
| <Field name="Weight" lblWidth="4"/> | |||||
| <Field name="PriceBill_ID" lblWidth="4"/> | |||||
| <Field name="Remark" lblWidth="4"/> | |||||
| </DFInfoBand> | |||||
| <HtmlBand> | |||||
| <![CDATA[<h2>代宰费用</h2>]]> | |||||
| </HtmlBand> | |||||
| <DFListBand collection="$CostDetails" itemType="$CostDetailType" enablePaging="false" > | |||||
| <LineNo header="序号"/> | |||||
| <Field name="SubKillProductLine_Name"/> | |||||
| <Field name="GenerationCostItem_Name"/> | |||||
| <Field name="Price"/> | |||||
| <Field name="Money" sum="true"/> | |||||
| </DFListBand> | |||||
| <HtmlBand> | |||||
| <![CDATA[<h2>回收应付</h2>]]> | |||||
| </HtmlBand> | |||||
| <DFListBand collection="$CallbackPayDetails" itemType="$CallbackPayDetailType" enablePaging="false" > | |||||
| <LineNo header="序号"/> | |||||
| <Field name="SubKillCallBack_Name"/> | |||||
| <Field name="Price"/> | |||||
| <Field name="Money" sum="true"/> | |||||
| </DFListBand> | |||||
| </Bands> | |||||
| </BillReport> | |||||
| </Report> | |||||
| </BillReports> | |||||