/// <summary> /// 撤销提交 /// </summary> /// <param name="rep"></param> /// <param name="entity"></param> public override void Unsubmit(IRepository rep, 坏账 entity) { rep.Initialize(entity.费用, entity); System.Diagnostics.Debug.Assert(entity.费用.Count == 1, "坏账费用有且只有一条!"); 对账单 dzd = entity.费用[0].对账单; System.Diagnostics.Debug.Assert(dzd != null, "坏账费用肯定已自动出过对账单!"); rep.Initialize(dzd, entity.费用[0]); rep.Initialize(dzd.费用, dzd); rep.Delete(entity.费用[0]); rep.Initialize(dzd.应收应付款, dzd); //System.Diagnostics.Debug.Assert(dzd.应收应付款.Count == 1, "坏账应收应付款有且只有一条!"); //rep.Delete(dzd.应收应付款[0]); foreach (应收应付款 i in dzd.应收应付款) { rep.Delete(i); } dzd.应收应付款.Clear(); rep.Delete(dzd); entity.Submitted = false; this.Update(rep, entity); }
public static void 打印对账单(ArchiveOperationForm masterForm) { 对账单 entity = masterForm.DisplayManager.CurrentItem as 对账单; if (entity == null) { MessageForm.ShowError("请选择要打印的对账单!"); return; } ReflectionHelper.RunStaticMethod("Hd.Report", "Hd.Report.ReportPrint", "打印对账单", new object[] { entity.编号 }); }
/// <summary> /// 提交 /// </summary> /// <param name="rep"></param> /// <param name="entity"></param> public override void Submit(IRepository rep, 坏账 entity) { 对账单 dzd = new 对账单(); dzd.对账单类型 = (int)财务对账单类型.坏账; dzd.结束日期 = entity.日期; dzd.费用 = new List <费用>(); dzd.费用项编号 = entity.费用项编号; dzd.关账日期 = entity.日期; dzd.结算期限 = entity.日期; dzd.金额 = -entity.金额; dzd.收付标志 = entity.收付标志; dzd.送出时间 = entity.日期; dzd.相关人编号 = entity.相关人编号; dzd.业务类型编号 = entity.业务类型编号; dzd.Submitted = true; (new HdBaseDao <对账单>()).Save(rep, dzd); 非业务费用 fy = new 非业务费用(); fy.费用项编号 = "352"; // 坏账 fy.费用实体 = entity; fy.金额 = entity.金额; fy.收付标志 = entity.收付标志 == 收付标志.付 ? 收付标志.收 : 收付标志.付; fy.相关人编号 = entity.相关人编号; fy.对账单 = dzd; (new 非业务费用Dao()).Save(rep, fy); dzd.费用.Add(fy); entity.费用 = new List <费用>(); entity.费用.Add(fy); 应收应付款 ysyfk = new 应收应付款(); ysyfk.费用项编号 = entity.费用项编号; ysyfk.结算期限 = dzd.结算期限.HasValue ? dzd.结算期限.Value : dzd.关账日期.Value; ysyfk.金额 = dzd.金额; ysyfk.日期 = dzd.关账日期.Value; ysyfk.收付标志 = dzd.收付标志; ysyfk.相关人编号 = dzd.相关人编号; ysyfk.业务类型编号 = entity.业务类型编号; ysyfk.应收应付源 = dzd; (new HdBaseDao <应收应付款>()).Save(rep, ysyfk); dzd.应收应付款 = new List <应收应付款>(); dzd.应收应付款.Add(ysyfk); entity.对账单号 = dzd.编号; entity.Submitted = true; this.Update(rep, entity); }
public static Dictionary<string, object> 自动凭证应付对账单(对账单 entity) { Dictionary<string, object> dict = new Dictionary<string, object>(); IList<GridColumnInfo> infos = new List<GridColumnInfo> { new GridColumnInfo { Caption = "凭证金额", DataControlDefaultValue = entity.金额.Value.ToString("N2"), DataControlVisible = "True", DataControlType = "MyCurrencyTextBox", PropertyName = "凭证金额", NotNull = "True"} , new GridColumnInfo { Caption = "凭证币制编号", DataControlDefaultValue = "CNT", DataControlVisible = "True", DataControlType = "MyComboTextBox", PropertyName = "凭证币制编号", CellEditorManagerParam = "财务_币制", NotNull= "True"} }; ArchiveDataControlForm form = new ArchiveDataControlForm(new ControlManager((ISearchManager)null), infos); if (form.ShowDialog() == DialogResult.OK) { dict["凭证金额"] = form.DataControls["凭证金额"].SelectedDataValue; dict["凭证币制编号"] = form.DataControls["凭证币制编号"].SelectedDataValue; } else { throw new InvalidUserOperationException("必须要填写会计金额和币制!"); } return dict; }
public static Dictionary <string, object> 自动凭证应付对账单(对账单 entity) { Dictionary <string, object> dict = new Dictionary <string, object>(); IList <GridColumnInfo> infos = new List <GridColumnInfo> { new GridColumnInfo { Caption = "凭证金额", DataControlDefaultValue = entity.金额.Value.ToString("N2"), DataControlVisible = "True", DataControlType = "MyCurrencyTextBox", PropertyName = "凭证金额", NotNull = "True" }, new GridColumnInfo { Caption = "凭证币制编号", DataControlDefaultValue = "CNT", DataControlVisible = "True", DataControlType = "MyComboTextBox", PropertyName = "凭证币制编号", CellEditorManagerParam = "财务_币制", NotNull = "True" } }; ArchiveDataControlForm form = new ArchiveDataControlForm(new ControlManager((ISearchManager)null), infos); if (form.ShowDialog() == DialogResult.OK) { dict["凭证金额"] = form.DataControls["凭证金额"].SelectedDataValue; dict["凭证币制编号"] = form.DataControls["凭证币制编号"].SelectedDataValue; } else { throw new InvalidUserOperationException("必须要填写会计金额和币制!"); } return(dict); }