diff --git a/A09财务通用管理/Financial.dpr b/A09财务通用管理/Financial.dpr index b5ffcc3..b87390f 100644 --- a/A09财务通用管理/Financial.dpr +++ b/A09财务通用管理/Financial.dpr @@ -40,6 +40,7 @@ uses U_InvoiceOutInPut in 'U_InvoiceOutInPut.pas' {frmInvoiceOutInPut}, U_PayInput in 'U_PayInput.pas' {frmPayInput}, U_InvoiceInInPut in 'U_InvoiceInInPut.pas' {frmInvoiceInInPut}, + U_BizCateSel in 'U_BizCateSel.pas' {frmBizCateSel}, U_PayableInput in 'U_PayableInput.pas' {frmPayableInput}, U_cxGridCustomCss in '..\..\..\public10\design\U_cxGridCustomCss.pas', U_cxGridCustomSet in '..\..\..\public10\design\U_cxGridCustomSet.pas', diff --git a/A09财务通用管理/Financial.dproj.local b/A09财务通用管理/Financial.dproj.local index 4f8b656..ffc8657 100644 --- a/A09财务通用管理/Financial.dproj.local +++ b/A09财务通用管理/Financial.dproj.local @@ -8,9 +8,9 @@ 1899/12/30 00:00:00.000.292,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\A09财务通用管理\U_FinPurchasePlanSel.pas 1899/12/30 00:00:00.000.683,D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_InvoiceOutSel.pas=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_InvoiceSel.pas 1899/12/30 00:00:00.000.683,D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_InvoiceOutSel.dfm=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_InvoiceSel.dfm - 1899/12/30 00:00:00.000.210,=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_ExpenseInput.pas 1899/12/30 00:00:00.000.987,=D:\Dp10RepoV1\项目代码\RTBasicsV1\A09财务通用管理\U_PayableInput.pas - 1899/12/30 00:00:00.000.422,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas + 1899/12/30 00:00:00.000.210,=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_ExpenseInput.pas + 1899/12/30 00:00:00.000.630,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas 1899/12/30 00:00:00.000.159,=D:\Dp10RepoV1\项目代码\RTBasicsV1\A09财务通用管理\U_CustStatementWriteOff.pas 1899/12/30 00:00:00.000.895,=D:\Dp10RepoV1\项目代码\RTBasicsV1\A09财务通用管理\U_InvoiceOutList.pas 1899/12/30 00:00:00.000.123,=D:\Dp10Repo\public10\design\U_globalVar.pas @@ -18,14 +18,14 @@ 1899/12/30 00:00:00.000.092,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_EmployeeSel.pas 1899/12/30 00:00:00.000.742,=D:\Dp10RepoV1\public10\design\U_cxGridCustomSet.pas 1899/12/30 00:00:00.000.616,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_LablePrint.pas - 1899/12/30 00:00:00.000.630,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas + 1899/12/30 00:00:00.000.422,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.pas 1899/12/30 00:00:00.000.885,=D:\Dp10RepoV1\项目代码\RTBasicsV1\A09财务通用管理\U_ExpenseList.pas 1899/12/30 00:00:00.000.939,=D:\Dp10Repo\public10\design\U_BaseInput.pas 1899/12/30 00:00:00.000.868,D:\Dp10Repo\项目代码\RTBasics\A09财务通用管理\Financial.dproj=D:\Dp10Repo\项目代码\RTBasics\A09财务通用管理\InformationBase.dproj 1899/12/30 00:00:00.000.135,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelp.pas= 1899/12/30 00:00:00.000.806,=D:\Dp10RepoV1\public10\design\U_BaseDataLink.pas - 1899/12/30 00:00:00.000.772,=D:\Dp10RepoV1\public10\design\U_FormLayOutDesign.pas 1899/12/30 00:00:00.000.103,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_BankSel.pas + 1899/12/30 00:00:00.000.772,=D:\Dp10RepoV1\public10\design\U_FormLayOutDesign.pas 1899/12/30 00:00:00.000.060,D:\D10W\项目代码\D10myXingrui\B02基础纱线仓库\U_YarnInfoImport.pas=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_CollectImport.pas 1899/12/30 00:00:00.000.119,D:\D10W\项目代码\D10myXingrui\B02基础纱线仓库\U_YarnInfoImport.pas= 1899/12/30 00:00:00.000.871,D:\Dp10Repo\项目代码\RTBasics\A09财务通用管理\U_InvoiceOutInPut.dfm=D:\Dp10Repo\项目代码\RTBasics\A09财务通用管理\U_InvoiceInInPut.dfm @@ -65,8 +65,8 @@ 1899/12/30 00:00:00.000.052,D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\A09财务通用管理\U_PayableBatchInput.pas=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\A09财务通用管理\U_GETableBatchInput.pas 1899/12/30 00:00:00.000.339,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.pas 1899/12/30 00:00:00.000.844,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_AttachmentUpload.pas - 1899/12/30 00:00:00.000.690,=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_CollectImport.pas 1899/12/30 00:00:00.000.201,=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_CollectImport.pas + 1899/12/30 00:00:00.000.690,=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_CollectImport.pas 1899/12/30 00:00:00.000.975,=D:\Dp10Repo\public10\ThreeFun\Fun\U_CompressionFun.pas 1899/12/30 00:00:00.000.263,D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_CollectInput2.pas=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_ExpenseInput.pas 1899/12/30 00:00:00.000.493,=D:\Dp10Repo\项目代码\RTBasics\A00通用模板\Unit1.pas @@ -165,5 +165,7 @@ + + diff --git a/A09财务通用管理/Financial.identcache b/A09财务通用管理/Financial.identcache index 4984bdd..6c27be5 100644 Binary files a/A09财务通用管理/Financial.identcache and b/A09财务通用管理/Financial.identcache differ diff --git a/A09财务通用管理/U_BizCateSel.dfm b/A09财务通用管理/U_BizCateSel.dfm new file mode 100644 index 0000000..405ea01 --- /dev/null +++ b/A09财务通用管理/U_BizCateSel.dfm @@ -0,0 +1,161 @@ +object frmBizCateSel: TfrmBizCateSel + Left = 400 + Top = 200 + Caption = #19994#21153#22823#31867#26126#32454#39033#36873#25321 + ClientHeight = 500 + ClientWidth = 700 + Color = clWhite + Font.Charset = GB2312_CHARSET + Font.Color = clWindowText + Font.Height = -16 + Font.Name = #24494#36719#38597#40657 + Font.Style = [] + OldCreateOrder = False + Position = poScreenCenter + OnDestroy = FormDestroy + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 21 + object ToolBar1: TToolBar + Tag = 1 + Left = 0 + Top = 0 + Width = 700 + Height = 30 + AutoSize = True + ButtonHeight = 30 + ButtonWidth = 59 + Caption = 'ToolBar1' + DisabledImages = DataLink_Financial.cxImageList_bar + Images = DataLink_Financial.cxImageList_bar + List = True + ShowCaptions = True + TabOrder = 0 + object TBOK: TToolButton + Left = 0 + Top = 0 + AutoSize = True + Caption = #30830#23450 + ImageIndex = 12 + OnClick = TBOKClick + end + object TBAdd: TToolButton + Left = 63 + Top = 0 + AutoSize = True + Caption = #22686#34892 + ImageIndex = 2 + OnClick = TBAddClick + end + object TBDel: TToolButton + Left = 126 + Top = 0 + AutoSize = True + Caption = #21024#34892 + ImageIndex = 6 + OnClick = TBDelClick + end + object TBEdit: TToolButton + Left = 189 + Top = 0 + AutoSize = True + Caption = #20462#25913 + ImageIndex = 3 + OnClick = TBEditClick + end + object TBClose: TToolButton + Left = 252 + Top = 0 + AutoSize = True + Caption = #20851#38381 + ImageIndex = 7 + OnClick = TBCloseClick + end + end + object cxGrid1: TcxGrid + Left = 0 + Top = 30 + Width = 700 + Height = 470 + Align = alClient + TabOrder = 1 + object Tv1: TcxGridDBTableView + Navigator.Buttons.CustomButtons = <> + Navigator.Buttons.Delete.Enabled = False + Navigator.Buttons.Delete.Visible = False + ScrollbarAnnotations.CustomAnnotations = <> + OnCellDblClick = Tv1CellDblClick + DataController.DataSource = DS_1 + DataController.Summary.DefaultGroupSummaryItems = <> + DataController.Summary.FooterSummaryItems = <> + DataController.Summary.SummaryGroups = <> + OptionsCustomize.ColumnFiltering = False + OptionsData.Deleting = False + OptionsData.DeletingConfirmation = False + OptionsData.Editing = False + OptionsSelection.CellSelect = False + OptionsView.GroupByBox = False + OptionsView.Indicator = True + object Tv1BizCate: TcxGridDBColumn + Caption = #19994#21153#22823#31867 + DataBinding.FieldName = 'BizCate' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = Tv1BizCatePropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 240 + end + object Tv1BizItem: TcxGridDBColumn + Caption = #26126#32454#39033 + DataBinding.FieldName = 'BizItem' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = Tv1BizItemPropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 240 + end + object Tv1CateNo: TcxGridDBColumn + Caption = #22823#31867#32534#21495 + DataBinding.FieldName = 'CateNo' + DataBinding.IsNullValueType = True + Visible = False + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv1ItemNo: TcxGridDBColumn + Caption = #26126#32454#32534#21495 + DataBinding.FieldName = 'ItemNo' + DataBinding.IsNullValueType = True + Visible = False + HeaderAlignmentHorz = taCenter + Width = 80 + end + end + object cxGridLevel1: TcxGridLevel + GridView = Tv1 + end + end + object DS_1: TDataSource + DataSet = CDS_1 + Left = 96 + Top = 120 + end + object CDS_1: TClientDataSet + Aggregates = <> + Params = <> + Left = 168 + Top = 120 + end + object ADOQueryTmp: TADOQuery + Connection = DataLink_Financial.ADOLink + Parameters = <> + Left = 560 + Top = 120 + end + object ADOQueryCmd: TADOQuery + Connection = DataLink_Financial.ADOLink + Parameters = <> + Left = 656 + Top = 120 + end +end diff --git a/A09财务通用管理/U_BizCateSel.pas b/A09财务通用管理/U_BizCateSel.pas new file mode 100644 index 0000000..f4ca5c6 --- /dev/null +++ b/A09财务通用管理/U_BizCateSel.pas @@ -0,0 +1,461 @@ +unit U_BizCateSel; + +interface + +uses + Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, + Dialogs, ComCtrls, ToolWin, cxStyles, cxCustomData, cxGraphics, cxFilter, + cxData, cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxClasses, + cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView, + cxGridDBTableView, cxGrid, ADODB, DBClient, ExtCtrls, cxTextEdit, + cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, dxBarBuiltInMenu, + dxDateRanges, dxScrollbarAnnotations, cxContainer, dxSkinsCore, + dxSkinsDefaultPainters, dxSkinWXI, StdCtrls; + +const + CBizCateType = 'FinBizCate'; //KH_ZDY中业务大类的Type标识 + CBizItemType = 'FinBizItem'; //KH_ZDY中明细项的Type标识 + +type + TfrmBizCateSel = class(TForm) + ToolBar1: TToolBar; + TBAdd: TToolButton; + TBDel: TToolButton; + TBEdit: TToolButton; + TBOK: TToolButton; + TBClose: TToolButton; + cxGrid1: TcxGrid; + Tv1: TcxGridDBTableView; + Tv1BizCate: TcxGridDBColumn; + Tv1BizItem: TcxGridDBColumn; + Tv1CateNo: TcxGridDBColumn; + Tv1ItemNo: TcxGridDBColumn; + cxGridLevel1: TcxGridLevel; + DS_1: TDataSource; + CDS_1: TClientDataSet; + ADOQueryTmp: TADOQuery; + ADOQueryCmd: TADOQuery; + procedure FormShow(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure TBAddClick(Sender: TObject); + procedure TBDelClick(Sender: TObject); + procedure TBEditClick(Sender: TObject); + procedure TBOKClick(Sender: TObject); + procedure TBCloseClick(Sender: TObject); + procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; + ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; + AShift: TShiftState; var AHandled: Boolean); + procedure Tv1BizCatePropertiesEditValueChanged(Sender: TObject); + procedure Tv1BizItemPropertiesEditValueChanged(Sender: TObject); + private + procedure InitGrid(); + procedure SetEditMode(AEdit: Boolean); + function FindCateNoByName(const ACateName: string; var ACateNo: string): Boolean; + function ItemNameExists(const ACateNo, AItemName, AExcludeItemNo: string): Boolean; + { Private declarations } + public + SelCateName, SelItemName: string; + { Public declarations } + end; + +var + frmBizCateSel: TfrmBizCateSel; + +implementation + +uses + U_DataLink, U_RTFun; + +{$R *.dfm} + +{一行=一条明细项(BizItem)+其所属业务大类(BizCate); + KH_ZDY存储:大类 Type=FinBizCate,明细 Type=FinBizItem、MainType=大类ZDYNo; + 未点修改前表格锁定,点修改后单元格改动即自动保存。} + +procedure TfrmBizCateSel.InitGrid(); +begin + with ADOQueryTmp do + begin + Close; + SQL.Clear; + SQL.Add('select C.ZDYName as BizCate, I.ZDYName as BizItem'); + SQL.Add(',C.ZDYNo as CateNo, I.ZDYNo as ItemNo'); + SQL.Add('from KH_ZDY C join KH_ZDY I'); + SQL.Add(' on I.Type=''' + CBizItemType + ''' and I.MainType=C.ZDYNo and isnull(I.valid,''Y'')=''Y'''); + SQL.Add('where C.Type=''' + CBizCateType + ''' and isnull(C.valid,''Y'')=''Y'''); + SQL.Add('order by C.ZDYNo, I.ZDYNo'); + Open; + end; + SCreateCDS(ADOQueryTmp, CDS_1); + SInitCDSData(ADOQueryTmp, CDS_1); +end; + +procedure TfrmBizCateSel.SetEditMode(AEdit: Boolean); +begin + Tv1.OptionsData.Editing := AEdit; + Tv1.OptionsSelection.CellSelect := AEdit; + if AEdit then + TBEdit.Caption := #32467#26463#20462#25913 //结束修改 + else + TBEdit.Caption := #20462#25913; //修改 +end; + +function TfrmBizCateSel.FindCateNoByName(const ACateName: string; + var ACateNo: string): Boolean; +begin + Result := False; + ACateNo := ''; + with ADOQueryTmp do + begin + Close; + SQL.Clear; + SQL.Add('select ZDYNo from KH_ZDY where Type=''' + CBizCateType + ''''); + SQL.Add(' and isnull(valid,''Y'')=''Y'' and ZDYName=' + QuotedStr(Trim(ACateName))); + Open; + if not IsEmpty then + begin + Result := True; + ACateNo := Trim(FieldByName('ZDYNo').AsString); + end; + Close; + end; +end; + +function TfrmBizCateSel.ItemNameExists(const ACateNo, AItemName, + AExcludeItemNo: string): Boolean; +begin + Result := False; + with ADOQueryTmp do + begin + Close; + SQL.Clear; + SQL.Add('select ZDYNo from KH_ZDY where Type=''' + CBizItemType + ''''); + SQL.Add(' and MainType=' + QuotedStr(Trim(ACateNo))); + SQL.Add(' and ZDYName=' + QuotedStr(Trim(AItemName))); + Open; + while not Eof do + begin + if Trim(FieldByName('ZDYNo').AsString) <> Trim(AExcludeItemNo) then + begin + Result := True; + Break; + end; + Next; + end; + Close; + end; +end; + +procedure TfrmBizCateSel.FormShow(Sender: TObject); +begin + InitGrid(); + SetEditMode(False); +end; + +procedure TfrmBizCateSel.FormDestroy(Sender: TObject); +begin + frmBizCateSel := nil; +end; + +procedure TfrmBizCateSel.TBAddClick(Sender: TObject); +begin + SetEditMode(True); + CDS_1.Append; + CDS_1.Post; + Tv1.Controller.FocusRecord(CDS_1.RecNo - 1, True); +end; + +procedure TfrmBizCateSel.TBDelClick(Sender: TObject); +var + mCateNo, mItemNo: string; + mLast: Boolean; +begin + if CDS_1.IsEmpty then + Exit; + mCateNo := Trim(CDS_1.FieldByName('CateNo').AsString); + mItemNo := Trim(CDS_1.FieldByName('ItemNo').AsString); + if mItemNo = '' then + begin + CDS_1.Delete; //未落库的新行 + Exit; + end; + + mLast := False; + with ADOQueryTmp do + begin + Close; + SQL.Clear; + SQL.Add('select count(*) as Cnt from KH_ZDY where Type=''' + CBizItemType + ''''); + SQL.Add(' and MainType=' + QuotedStr(mCateNo) + ' and isnull(valid,''Y'')=''Y'''); + Open; + if FieldByName('Cnt').AsInteger <= 1 then + mLast := True; + Close; + end; + + if mLast then + begin + if Application.MessageBox('该明细项是其业务大类下最后一条,删除后将同时删除该业务大类,确定删除吗?', + '提示信息', 1) = 2 then + Exit; + end + else + begin + if Application.MessageBox('确定要删除该明细项吗?', '提示信息', 1) = 2 then + Exit; + end; + + ADOQueryCmd.Connection.BeginTrans; + try + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('delete KH_ZDY where Type=''' + CBizItemType + ''' and ZDYNo=' + QuotedStr(mItemNo)); + ExecSQL; + if mLast then + begin + Close; + SQL.Clear; + SQL.Add('delete KH_ZDY where Type=''' + CBizCateType + ''' and ZDYNo=' + QuotedStr(mCateNo)); + ExecSQL; + end; + end; + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('删除失败!', '提示信息', 0); + Exit; + end; + CDS_1.Delete; +end; + +procedure TfrmBizCateSel.TBEditClick(Sender: TObject); +begin + SetEditMode(not Tv1.OptionsData.Editing); +end; + +procedure TfrmBizCateSel.Tv1BizCatePropertiesEditValueChanged(Sender: TObject); +var + mvalue, mCateNo, mItemNo, mFoundNo, mNewCateNo, maxno: string; + mFound: Boolean; +begin + mvalue := Trim(TcxTextEdit(Sender).EditingText); + if mvalue = '' then + Exit; + if (not CDS_1.Active) or CDS_1.IsEmpty then + Exit; + mCateNo := Trim(CDS_1.FieldByName('CateNo').AsString); + mItemNo := Trim(CDS_1.FieldByName('ItemNo').AsString); + + CDS_1.Edit; + CDS_1.FieldByName('BizCate').Value := mvalue; + CDS_1.Post; + + if mCateNo = '' then + Exit; //新行:只记录大类名称,待明细项录入时统一创建大类+明细 + + if mItemNo = '' then + Exit; + + //已有行:只调整当前这条明细的所属大类。 + //输入已有大类名=移动过去;全新名称=新建该名称的大类再移动过去(不做全大类重命名) + mFound := FindCateNoByName(mvalue, mFoundNo); + if mFound and (mFoundNo = mCateNo) then + Exit; //大类未变化 + + ADOQueryCmd.Connection.BeginTrans; + try + if not mFound then + begin + if GetLSNo(ADOQueryTmp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Exit; + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,valid) values('); + SQL.Add(QuotedStr(Trim(maxno)) + ',' + QuotedStr(mvalue)); + SQL.Add(',''' + CBizCateType + ''',''Y'')'); + ExecSQL; + end; + mNewCateNo := Trim(maxno); + end + else + mNewCateNo := mFoundNo; + + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('update KH_ZDY set MainType=' + QuotedStr(mNewCateNo)); + SQL.Add(' where ZDYNo=' + QuotedStr(mItemNo) + ' and Type=''' + CBizItemType + ''''); + ExecSQL; + end; + + //原大类被移空时一并删除,避免留下界面上看不到的空大类 + with ADOQueryTmp do + begin + Close; + SQL.Clear; + SQL.Add('select count(*) as Cnt from KH_ZDY where Type=''' + CBizItemType + ''''); + SQL.Add(' and MainType=' + QuotedStr(mCateNo) + ' and isnull(valid,''Y'')=''Y'''); + Open; + if FieldByName('Cnt').AsInteger = 0 then + begin + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('delete KH_ZDY where Type=''' + CBizCateType + ''' and ZDYNo=' + QuotedStr(mCateNo)); + ExecSQL; + end; + end; + Close; + end; + + ADOQueryCmd.Connection.CommitTrans; + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('保存业务大类调整失败!', '提示信息', 0); + Exit; + end; + + CDS_1.Edit; + CDS_1.FieldByName('CateNo').Value := mNewCateNo; + CDS_1.Post; +end; + +procedure TfrmBizCateSel.Tv1BizItemPropertiesEditValueChanged(Sender: TObject); +var + mvalue, mCateNo, mItemNo, mCateName, mFoundNo, mNewCateNo, mNewItemNo, maxno: string; +begin + mvalue := Trim(TcxTextEdit(Sender).EditingText); + if mvalue = '' then + Exit; + if (not CDS_1.Active) or CDS_1.IsEmpty then + Exit; + mCateNo := Trim(CDS_1.FieldByName('CateNo').AsString); + mItemNo := Trim(CDS_1.FieldByName('ItemNo').AsString); + mCateName := Trim(CDS_1.FieldByName('BizCate').AsString); + + if mItemNo = '' then + begin + //新行录入明细项:大类存在则挂靠,不存在则先建大类,再建明细项 + if mCateName = '' then + begin + Application.MessageBox('请先输入业务大类!', '提示信息', 0); + Exit; + end; + + ADOQueryCmd.Connection.BeginTrans; + try + mNewCateNo := mCateNo; + if (mNewCateNo = '') and (not FindCateNoByName(mCateName, mFoundNo)) then + begin + if GetLSNo(ADOQueryTmp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Exit; + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,valid) values('); + SQL.Add(QuotedStr(Trim(maxno)) + ',' + QuotedStr(mCateName)); + SQL.Add(',''' + CBizCateType + ''',''Y'')'); + ExecSQL; + end; + mNewCateNo := Trim(maxno); + end + else if mNewCateNo = '' then + mNewCateNo := mFoundNo; + + if ItemNameExists(mNewCateNo, mvalue, '') then + begin + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('该业务大类下已存在同名明细项!', '提示信息', 0); + Exit; + end; + + if GetLSNo(ADOQueryTmp, maxno, 'SY', 'KH_ZDY', 3, 1) = False then + begin + ADOQueryCmd.Connection.RollbackTrans; + Exit; + end; + mNewItemNo := Trim(maxno); + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('insert into KH_ZDY(ZDYNo,ZDYName,Type,MainType,valid) values('); + SQL.Add(QuotedStr(mNewItemNo) + ',' + QuotedStr(mvalue)); + SQL.Add(',''' + CBizItemType + ''',' + QuotedStr(mNewCateNo) + ',''Y'')'); + ExecSQL; + end; + ADOQueryCmd.Connection.CommitTrans; + + CDS_1.Edit; + CDS_1.FieldByName('BizItem').Value := mvalue; + CDS_1.FieldByName('CateNo').Value := mNewCateNo; + CDS_1.FieldByName('ItemNo').Value := mNewItemNo; + CDS_1.Post; + except + ADOQueryCmd.Connection.RollbackTrans; + Application.MessageBox('保存明细项失败!', '提示信息', 0); + end; + end + else + begin + //重命名明细项 + if ItemNameExists(mCateNo, mvalue, mItemNo) then + begin + Application.MessageBox('该业务大类下已存在同名明细项!', '提示信息', 0); + Exit; + end; + CDS_1.Edit; + CDS_1.FieldByName('BizItem').Value := mvalue; + CDS_1.Post; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('update KH_ZDY set ZDYName=' + QuotedStr(mvalue)); + SQL.Add(' where ZDYNo=' + QuotedStr(mItemNo) + ' and Type=''' + CBizItemType + ''''); + ExecSQL; + end; + end; +end; + +procedure TfrmBizCateSel.TBOKClick(Sender: TObject); +begin + if CDS_1.IsEmpty or (Trim(CDS_1.FieldByName('BizCate').AsString) = '') + or (Trim(CDS_1.FieldByName('BizItem').AsString) = '') then + begin + Application.MessageBox('请先选择业务大类和明细项!', '提示信息', 0); + Exit; + end; + SelCateName := Trim(CDS_1.FieldByName('BizCate').AsString); + SelItemName := Trim(CDS_1.FieldByName('BizItem').AsString); + ModalResult := 1; +end; + +procedure TfrmBizCateSel.Tv1CellDblClick(Sender: TcxCustomGridTableView; + ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; + AShift: TShiftState; var AHandled: Boolean); +begin + if Tv1.OptionsData.Editing = False then + TBOKClick(Sender); +end; + +procedure TfrmBizCateSel.TBCloseClick(Sender: TObject); +begin + ModalResult := 2; + Close; +end; + +end. diff --git a/A09财务通用管理/U_ExpenseInput.dfm b/A09财务通用管理/U_ExpenseInput.dfm index 927093a..f319919 100644 --- a/A09财务通用管理/U_ExpenseInput.dfm +++ b/A09财务通用管理/U_ExpenseInput.dfm @@ -167,12 +167,19 @@ object frmExpenseInput: TfrmExpenseInput Visible = False end object Label15: TLabel - Left = 787 + Left = 833 Top = 36 Width = 48 Height = 21 Caption = #21457#31080#21495 end + object Label16: TLabel + Left = 828 + Top = 86 + Width = 80 + Height = 21 + Caption = #21457#31080#26126#32454#39033 + end object FinanceNote: TMemo Tag = 2 Left = 200 @@ -388,8 +395,8 @@ object frmExpenseInput: TfrmExpenseInput end object IVNo: TcxButtonEdit Tag = 2 - Left = 841 - Top = 33 + Left = 920 + Top = 31 Properties.Buttons = < item Default = True @@ -399,6 +406,13 @@ object frmExpenseInput: TfrmExpenseInput TabOrder = 16 Width = 200 end + object IVDetailItem: TcxTextEdit + Left = 920 + Top = 83 + Properties.ReadOnly = True + TabOrder = 17 + Width = 200 + end end object ADOQueryTemp: TADOQuery Connection = DataLink_Financial.ADOLink diff --git a/A09财务通用管理/U_ExpenseInput.pas b/A09财务通用管理/U_ExpenseInput.pas index f226502..f63e472 100644 --- a/A09财务通用管理/U_ExpenseInput.pas +++ b/A09财务通用管理/U_ExpenseInput.pas @@ -1,4 +1,4 @@ -unit U_ExpenseInput; +unit U_ExpenseInput; interface @@ -70,6 +70,8 @@ type Label15: TLabel; IVNo: TcxButtonEdit; oppShuiNo: TcxTextEdit; + Label16: TLabel; + IVDetailItem: TcxTextEdit; procedure FormDestroy(Sender: TObject); procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); @@ -95,6 +97,7 @@ type procedure InitGrid(); function SaveData(): Boolean; procedure InitGrid2(); + procedure LoadIVDetailItem(const AIVIDs: string); public { Public declarations } FFFID: string; @@ -131,7 +134,7 @@ begin begin SCSHData(ADOQueryMain, ScrollBox1, 2); Self.IVNo.Properties.LookupItems.Text := ADOQueryMain.FieldByName('IVID').AsString; - + LoadIVDetailItem(ADOQueryMain.FieldByName('IVID').AsString); if ADOQueryMain.FieldByName('Amount').AsString <> '' then begin nAmount := ADOQueryMain.FieldByName('Amount').AsFloat; @@ -158,7 +161,7 @@ begin Close; sql.Clear; sql.Add('select A.* from BS_Company A where 1=1 '); - sql.Add(' and A.CoType=''¹©ӦÉÌ'' '); + sql.Add(' and A.CoType=''供应商'' '); SQL.Add(' and ShuiNo like ''%' + oppShuiNo.Text + '%'' '); Open; end; @@ -171,6 +174,29 @@ begin end; end; +procedure TfrmExpenseInput.LoadIVDetailItem(const AIVIDs: string); +begin + IVDetailItem.Text := ''; + if Trim(AIVIDs) = '' then + Exit; + try + with ADOQueryTemp do + begin + Close; + SQL.Clear; + SQL.Add('select DetailItems=stuff((select '','' + B.detail_item from Finance_Invoice B'); + SQL.Add(' where isnull(B.detail_item,'''')<>'''''); + SQL.Add(' and charindex('','' + B.IVID + '','', '','' + ' + QuotedStr(Trim(AIVIDs)) + ' + '','')>0'); + SQL.Add(' for xml path('''')),1,1,'''')'); + Open; + IVDetailItem.Text := Trim(FieldByName('DetailItems').AsString); + Close; + end; + except + IVDetailItem.Text := ''; + end; +end; + procedure TfrmExpenseInput.N1Click(Sender: TObject); begin Clipboard.SetTextBuf(PChar(Trim(CDS_1.fieldbyname(TV1.Controller.FocusedColumn.DataBinding.FilterFieldName).AsString))); @@ -182,12 +208,12 @@ var FWZ: Integer; begin fsj := Trim(TcxButtonEdit(Sender).Hint); - FWZ := Pos('/', fsj); //ÏÈӢÎÄÔÙÖÐÎÄ + FWZ := Pos('/', fsj); //先英文再中文 try frmZDYBankSel := TfrmZDYBankSel.Create(Application); with frmZDYBankSel do begin - MainType := '²ÆÎñÒøÐÐ'; + MainType := '财务银行'; flag := Copy(fsj, 1, FWZ - 1); flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ); if ShowModal = 1 then @@ -209,7 +235,7 @@ begin with frmZDYHelp do begin flag := 'OppCoName'; - flagname := '¶Է½µ¥λ'; + flagname := '对方单位'; if ShowModal = 1 then begin TEdit(Sender).Text := Trim(ClientDataSet1.fieldbyname('ZDYName').AsString); @@ -226,7 +252,7 @@ begin frmCompanySel := TfrmCompanySel.Create(Application); with frmCompanySel do begin - FCoType := '¹©ӦÉÌ'; + FCoType := '供应商'; if ShowModal = 1 then begin OppCoName.Text := Trim(frmCompanySel.CDS_1.fieldbyname('CoName').AsString); @@ -250,12 +276,12 @@ var FWZ: Integer; begin fsj := Trim(TcxButtonEdit(Sender).Hint); - FWZ := Pos('/', fsj); //ÏÈӢÎÄÔÙÖÐÎÄ + FWZ := Pos('/', fsj); //先英文再中文 try frmZDYBankSel := TfrmZDYBankSel.Create(Application); with frmZDYBankSel do begin - MainType := '²ÆÎñÒøÐÐ'; + MainType := '财务银行'; flag := Copy(fsj, 1, FWZ - 1); flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ); if ShowModal = 1 then @@ -291,7 +317,7 @@ begin frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do begin - MainType := '·ÑÓÃ'; + MainType := '费用'; flag := Copy(fsj, 1, FWZ - 1); flagname := Copy(fsj, FWZ + 1, Length(fsj) - FWZ); if ShowModal = 1 then @@ -310,7 +336,7 @@ var FWZ: Integer; begin fsj := Trim(TcxButtonEdit(Sender).Hint); - FWZ := Pos('/', fsj); //ÏÈӢÎÄÔÙÖÐÎÄ + FWZ := Pos('/', fsj); //先英文再中文 try frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do @@ -334,7 +360,7 @@ var FWZ: Integer; begin fsj := Trim(TcxButtonEdit(Sender).Hint); - FWZ := Pos('/', fsj); //ÏÈӢÎÄÔÙÖÐÎÄ + FWZ := Pos('/', fsj); //先英文再中文 try frmZDYHelp := TfrmZDYHelp.Create(Application); with frmZDYHelp do @@ -357,13 +383,13 @@ end; // n: Double; // CleanText: string; //begin -// // ÒƳýǧ·Öλ¶ººÅ +// // 移除千分位逗号 // CleanText := StringReplace(Amount.Text, ',', '', [rfReplaceAll]); // // if TryStrToFloat(CleanText, n) then // begin -// // ¸ñʽ»¯ÏÔʾ£¬µ«±ÜÃâÖظ´´¥·¢Ê¼þ -// Amount.Properties.OnEditValueChanged := nil; // ÔÝʱ½ûÓÃʼþ +// // 格式化显示,但避免重复触发事件 +// Amount.Properties.OnEditValueChanged := nil; // 暂时禁用事件 // try // Amount.Text := FormatFloat('#,##0', n); // finally @@ -382,37 +408,37 @@ var CaretPos: Integer; TextBeforeCaret: string; begin - // ¼Çס¹â±êλÖú͹â±êǰµÄÎı¾ + // 记住光标位置和光标前的文本 CaretPos := Amount.SelStart; TextBeforeCaret := Copy(Amount.Text, 1, CaretPos); - // ÒƳýǧ·Öλ¶ººÅ + // 移除千分位逗号 CleanText := StringReplace(Amount.Text, ',', '', [rfReplaceAll]); if TryStrToFloat(CleanText, n) then begin Amount.Properties.OnEditValueChanged := nil; try - // ¼ì²âÓû§ÊäÈëµÄСÊýλÊý + // 检测用户输入的小数位数 DecimalPos := Pos('.', CleanText); if DecimalPos > 0 then DecimalDigits := Length(CleanText) - DecimalPos else DecimalDigits := 0; - // ¶¯̬Éú³ɸñʽ»¯×ַû´® + // 动态生成格式化字符串 if DecimalDigits = 0 then FormatStr := '#,##0' else FormatStr := '#,##0.' + StringOfChar('0', DecimalDigits); - // ӦÓøñʽ»¯ + // 应用格式化 Amount.Text := FormatFloat(FormatStr, n); - // ÖÇÄָܻ´¹â±êλÖà + // 智能恢复光标位置 if CaretPos > 0 then begin - // ¼ÆËãÌí¼ӶººźóµĹâ±êλÖÃƫÒÆ + // 计算添加逗号后的光标位置偏移 CaretPos := Length(TextBeforeCaret) + (StringReplace(Copy(Amount.Text, 1, Length(TextBeforeCaret)), ',', '', [rfReplaceAll]).Length - TextBeforeCaret.Length); if CaretPos <= Length(Amount.Text) then Amount.SelStart := CaretPos; @@ -427,6 +453,7 @@ procedure TfrmExpenseInput.cxButtonEdit1PropertiesButtonClick(Sender: TObject; A var CurrentAmount: Double; TaxAmount: Double; + mDetailItem: string; begin try frmInvoiceSel := TfrmInvoiceSel.Create(Application); @@ -439,7 +466,8 @@ begin Self.IVNo.Properties.LookupItems.Text := ''; Self.Amount.Text := '0'; -// ftype := '½øÏî'; + Self.IVDetailItem.Text := ''; +// ftype := '进项'; while CDS_Invoice.Locate('SSel', true, []) do begin @@ -463,6 +491,19 @@ begin // Self.Amount.Text := FloatToStr(strtofloatdef(Self.Amount.Text, 0) + frmInvoiceSel.CDS_Invoice.FieldByName('TaxAmount').asfloat); end; + //选发票号的同时把明细项带过来(多张发票累加、去重) + mDetailItem := Trim(FieldByName('detail_item').AsString); + if mDetailItem <> '' then + begin + if Pos(',' + mDetailItem + ',', ',' + Trim(Self.IVDetailItem.Text) + ',') = 0 then + begin + if Trim(Self.IVDetailItem.Text) = '' then + Self.IVDetailItem.Text := mDetailItem + else + Self.IVDetailItem.Text := Trim(Self.IVDetailItem.Text) + ',' + mDetailItem; + end; + end; + Self.OppCoName.Text := frmInvoiceSel.CDS_Invoice.FieldByName('Supplier').AsString; Self.OppCoName.Properties.LookupItems.Text := frmInvoiceSel.CDS_Invoice.FieldByName('CoCode').AsString; Self.oppShuiNo.Text := trim(frmInvoiceSel.CDS_Invoice.FieldByName('SupplierShuiNo').AsString); @@ -529,7 +570,7 @@ begin if Trim(FFFID) = '' then begin if not GetLSNo(ADOQueryCmd, MaxId, 'FS', 'Finance_Flow', 4, 1) then - raise Exception.Create('ȡ×î´óºÅʧ°ܣ¡'); + raise Exception.Create('取最大号失败!'); end else begin @@ -555,12 +596,12 @@ begin FieldByName('Filler').Value := Trim(DName); FieldByName('Filltime').Value := SGetServerDateTime(ADOQueryTemp); FieldByName('FFTime').Value := SGetServerDateTime(ADOQueryTemp); - FieldByName('FFFlag').Value := '·ÑÓÃ'; - FieldByName('FFType').Value := '·ÑÓõǼÇ'; - FieldByName('Checkstatus').Value := 'δÉóºË'; - FieldByName('PayStatus').Value := 'δ¸¶¿î'; - FieldByName('PrintStatus').Value := 'δ´òӡ'; - FieldByName('FFQtyFlag').Value := 1; //³öÈë¿â±ê¼Ç + FieldByName('FFFlag').Value := '费用'; + FieldByName('FFType').Value := '费用登记'; + FieldByName('Checkstatus').Value := '未审核'; + FieldByName('PayStatus').Value := '未付款'; + FieldByName('PrintStatus').Value := '未打印'; + FieldByName('FFQtyFlag').Value := 1; //出入库标记 end else begin @@ -588,7 +629,7 @@ begin except Result := false; ADOQueryCmd.Connection.RollbackTrans; - application.MessageBox(PChar(Exception(ExceptObject).Message), 'ÌáʾÐÅϢ', 0); + application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0); end; end; @@ -602,18 +643,18 @@ begin ToolBar1.SetFocus; if Trim(OppCoName.Text) = '' then begin - Application.MessageBox('¶Է½µ¥λ²»ÄÜΪ¿Õ!', 'Ìáʾ', 0); + Application.MessageBox('对方单位不能为空!', '提示', 0); Exit; end; if Trim(Currency.Text) = '' then begin - Application.MessageBox('±ÒÖֲ»ÄÜΪ¿Õ!', 'Ìáʾ', 0); + Application.MessageBox('币种不能为空!', '提示', 0); Exit; end; if SaveData() then begin - Application.MessageBox('±£´æ³ɹ¦!', 'Ìáʾ', 0); + Application.MessageBox('保存成功!', '提示', 0); ModalResult := 1; end; end; diff --git a/A09财务通用管理/U_ExpenseList.dfm b/A09财务通用管理/U_ExpenseList.dfm index 92b10e9..a814fcb 100644 --- a/A09财务通用管理/U_ExpenseList.dfm +++ b/A09财务通用管理/U_ExpenseList.dfm @@ -536,6 +536,14 @@ inherited frmExpenseList: TfrmExpenseList HeaderAlignmentHorz = taCenter Width = 80 end + object Tv1IVDetailItem: TcxGridDBColumn + Caption = #21457#31080#26126#32454#39033 + DataBinding.FieldName = 'IVDetailItem' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 110 + end object Tv1FJFlag: TcxGridDBColumn Caption = #38468#20214 DataBinding.FieldName = 'FJFlag' diff --git a/A09财务通用管理/U_ExpenseList.pas b/A09财务通用管理/U_ExpenseList.pas index eab6e6a..0239937 100644 --- a/A09财务通用管理/U_ExpenseList.pas +++ b/A09财务通用管理/U_ExpenseList.pas @@ -310,6 +310,7 @@ begin Filtered := False; sql.Add(' select A.* '); sql.Add(',FJFlag=CAST((CASE WHEN (SELECT COUNT(X.FileName) FROM FJ_File X where X.TFType=''·ÑÓõǼÇ'' and X.WBID=A.FFID)>0 THEN 1 ELSE 0 END) AS BIT) '); + sql.Add(',IVDetailItem=stuff((select '','' + B.detail_item from Finance_Invoice B where isnull(B.detail_item,'''')<>'''' and charindex('','' + B.IVID + '','', '','' + A.IVID + '','')>0 for xml path('''')),1,1,'''') '); sql.Add(' from Finance_Flow A '); sql.Add(' where A.FFType=''·ÑÓõǼÇ'' '); case cxTabControl1.TabIndex of diff --git a/A09财务通用管理/U_GetDllForm.pas b/A09财务通用管理/U_GetDllForm.pas index fd2c95c..202a635 100644 --- a/A09财务通用管理/U_GetDllForm.pas +++ b/A09财务通用管理/U_GetDllForm.pas @@ -79,7 +79,7 @@ begin DConString := 'Provider=SQLOLEDB.1;Password=' + pswd + ';Persist Security Info=True;User ID=' + user + ';Initial Catalog=' + dtbase + ';Data Source=' + server; Parameters1:='¹ÜÀí'; // Parameters1 := 'ÉóºË2'; -// Parameters1 := 'ÉêÇë'; + Parameters1 := 'ÉêÇë'; end else begin diff --git a/A09财务通用管理/U_InvoiceInInPut.dfm b/A09财务通用管理/U_InvoiceInInPut.dfm index c3ea363..a1a0dfb 100644 --- a/A09财务通用管理/U_InvoiceInInPut.dfm +++ b/A09财务通用管理/U_InvoiceInInPut.dfm @@ -164,6 +164,28 @@ object frmInvoiceInInPut: TfrmInvoiceInInPut HeaderAlignmentHorz = taCenter Width = 80 end + object Tv1BusinessCategory: TcxGridDBColumn + Caption = #19994#21153#22823#31867 + DataBinding.FieldName = 'business_category' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = Tv1BusinessCategoryPropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 120 + end + object Tv1DetailItem: TcxGridDBColumn + Caption = #26126#32454#39033 + DataBinding.FieldName = 'detail_item' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + HeaderAlignmentHorz = taCenter + Width = 120 + end object Tv1SupplierShuiNo: TcxGridDBColumn Caption = #20379#24212#21830#31246#21495 DataBinding.FieldName = 'SupplierShuiNo' diff --git a/A09财务通用管理/U_InvoiceInInPut.pas b/A09财务通用管理/U_InvoiceInInPut.pas index 80daa72..28f26d6 100644 --- a/A09财务通用管理/U_InvoiceInInPut.pas +++ b/A09财务通用管理/U_InvoiceInInPut.pas @@ -71,6 +71,8 @@ type procedure ToolButton5Click(Sender: TObject); procedure Tv1FIAbstractPropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); + procedure Tv1BusinessCategoryPropertiesButtonClick(Sender: TObject; + AButtonIndex: Integer); private procedure initGrid(); function SaveDate(): Boolean; @@ -88,7 +90,7 @@ var implementation uses - U_RTFun, U_ZDYHelp, U_CompanySel, U_dataLink, U_PayableSel; + U_RTFun, U_ZDYHelp, U_CompanySel, U_dataLink, U_PayableSel, U_BizCateSel; {$R *.dfm} //procedure TfrmInvoiceInInPut.SaveFlowInvoice(); @@ -636,6 +638,26 @@ begin end; +procedure TfrmInvoiceInInPut.Tv1BusinessCategoryPropertiesButtonClick(Sender: TObject; + AButtonIndex: Integer); +begin + try + frmBizCateSel := TfrmBizCateSel.Create(Application); + with frmBizCateSel do + begin + if ShowModal = 1 then + begin + Self.CDS_Invoice.Edit; + Self.CDS_Invoice.FieldByName('business_category').Value := SelCateName; + Self.CDS_Invoice.FieldByName('detail_item').Value := SelItemName; + Self.CDS_Invoice.Post; + end; + end; + finally + frmBizCateSel.Free; + end; +end; + procedure TfrmInvoiceInInPut.ButtonEdit(Sender: TObject; AButtonIndex: Integer); begin try diff --git a/A09财务通用管理/U_InvoiceInList.dfm b/A09财务通用管理/U_InvoiceInList.dfm index 7bb13f6..f1ad99b 100644 --- a/A09财务通用管理/U_InvoiceInList.dfm +++ b/A09财务通用管理/U_InvoiceInList.dfm @@ -347,6 +347,29 @@ inherited frmInvoiceInList: TfrmInvoiceInList Options.Editing = False Width = 80 end + object Tv1BusinessCategory: TcxGridDBColumn + Caption = #19994#21153#22823#31867 + DataBinding.FieldName = 'business_category' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxButtonEditProperties' + Properties.Buttons = < + item + Default = True + Kind = bkEllipsis + end> + Properties.OnButtonClick = Tv1BusinessCategoryPropertiesButtonClick + HeaderAlignmentHorz = taCenter + Width = 120 + end + object Tv1DetailItem: TcxGridDBColumn + Caption = #26126#32454#39033 + DataBinding.FieldName = 'detail_item' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxTextEditProperties' + Properties.OnEditValueChanged = Tv1DetailItemPropertiesEditValueChanged + HeaderAlignmentHorz = taCenter + Width = 120 + end object Tv1SupplierShuiNo: TcxGridDBColumn Caption = #20379#24212#21830#31246#21495 DataBinding.FieldName = 'SupplierShuiNo' diff --git a/A09财务通用管理/U_InvoiceInList.pas b/A09财务通用管理/U_InvoiceInList.pas index 96ae74f..0625e2e 100644 --- a/A09财务通用管理/U_InvoiceInList.pas +++ b/A09财务通用管理/U_InvoiceInList.pas @@ -109,6 +109,9 @@ type procedure N2Click(Sender: TObject); procedure ToolButton4Click(Sender: TObject); procedure v1Column14PropertiesEditValueChanged(Sender: TObject); + procedure Tv1BusinessCategoryPropertiesButtonClick(Sender: TObject; + AButtonIndex: Integer); + procedure Tv1DetailItemPropertiesEditValueChanged(Sender: TObject); procedure ToolButton3Click(Sender: TObject); procedure N3Click(Sender: TObject); procedure ToolButton5Click(Sender: TObject); @@ -130,7 +133,7 @@ implementation uses U_DataLink, U_RTFun, U_ZDYHelp, U_InvoiceInInPut, U_LabelPrint, - U_AttachmentUploadIvI, U_PayableSel; + U_AttachmentUploadIvI, U_PayableSel, U_BizCateSel; {$R *.dfm} @@ -779,5 +782,59 @@ begin end; +procedure TfrmInvoiceInList.Tv1BusinessCategoryPropertiesButtonClick(Sender: TObject; + AButtonIndex: Integer); +begin + if CDS_Invoice.IsEmpty then + Exit; + try + frmBizCateSel := TfrmBizCateSel.Create(Application); + with frmBizCateSel do + begin + if ShowModal = 1 then + begin + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('update Finance_Invoice set business_category=' + QuotedStr(Trim(SelCateName))); + SQL.Add(',detail_item=' + QuotedStr(Trim(SelItemName))); + SQL.Add(' where IVID=' + QuotedStr(Trim(CDS_Invoice.FieldByName('IVID').AsString))); + ExecSQL; + end; + CDS_Invoice.Edit; + CDS_Invoice.FieldByName('business_category').Value := Trim(SelCateName); + CDS_Invoice.FieldByName('detail_item').Value := Trim(SelItemName); + CDS_Invoice.Post; + end; + end; + finally + frmBizCateSel.Free; + end; +end; + +procedure TfrmInvoiceInList.Tv1DetailItemPropertiesEditValueChanged(Sender: TObject); +var + mvalue: string; +begin + if CDS_Invoice.IsEmpty then + Exit; + mvalue := TcxTextEdit(Sender).EditingText; + with CDS_Invoice do + begin + Edit; + FieldByName('detail_item').Value := Trim(mvalue); + Post; + end; + with ADOQueryCmd do + begin + Close; + SQL.Clear; + SQL.Add('update Finance_Invoice set detail_item=' + QuotedStr(Trim(mvalue))); + SQL.Add(' where IVID=' + QuotedStr(Trim(CDS_Invoice.FieldByName('IVID').AsString))); + ExecSQL; + end; +end; + end. diff --git a/E02梭织经轴仓库/U_WBSpecInPut.dfm b/E02梭织经轴仓库/U_WBSpecInPut.dfm index bd86467..a5a354f 100644 --- a/E02梭织经轴仓库/U_WBSpecInPut.dfm +++ b/E02梭织经轴仓库/U_WBSpecInPut.dfm @@ -702,9 +702,9 @@ inherited frmWBSpecInPut: TfrmWBSpecInPut object Label43: TLabel Left = 0 Top = 540 - Width = 636 + Width = 822 Height = 21 - Caption = #25972#32463#24037#33402#21517#31216' = '#32463#32433#20195#21495' + '#32463#32433#25903#25968' + '#22383#24067#38376#24133' + '#22383#24067#31181#31867#20195#21495#65288#33394#32455#24067' A '#12289#22383#24067' B'#65289 + Caption = #25972#32463#24037#33402#21517#31216' = '#32463#32433#20195#21495' + '#32463#32433#25903#25968' + '#22383#24067#38376#24133' + '#22383#24067#31181#31867#20195#21495#65288#33394#32455#24067'A'#12289#22383#24067'B'#12289#21943#27668#33394#32455'PA'#12289#21943#27668#30333#22383'PB'#65289 Font.Charset = ANSI_CHARSET Font.Color = clBlue Font.Height = -16 diff --git a/E02梭织经轴仓库/WarpBeamStk.dproj.local b/E02梭织经轴仓库/WarpBeamStk.dproj.local index dc1f227..2920f9d 100644 --- a/E02梭织经轴仓库/WarpBeamStk.dproj.local +++ b/E02梭织经轴仓库/WarpBeamStk.dproj.local @@ -147,31 +147,31 @@ + 1899/12/30 00:00:00.000.512,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatPlanSel.pas + 1899/12/30 00:00:00.000.423,D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatPlanSel.pas=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatPlanSel2.pas + 1899/12/30 00:00:00.000.158,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatGYSel.pas 1899/12/30 00:00:00.000.585,=D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_XZ.pas 1899/12/30 00:00:00.000.024,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_WeaveSel.pas 1899/12/30 00:00:00.000.416,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatYarnSel.pas - 1899/12/30 00:00:00.000.020,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_WBNeedHTList.pas - 1899/12/30 00:00:00.000.162,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_TatWBPlanZJZKInPut.pas - 1899/12/30 00:00:00.000.108,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_TatWBPlan.pas - 1899/12/30 00:00:00.000.512,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatPlanSel.pas - 1899/12/30 00:00:00.000.444,D:\Dp10RepoV1\项目代码\D10gmHuahudie\A02基础产品管理\U_WBSpecInPut.dfm=D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_WBSpecInPut.dfm + 1899/12/30 00:00:00.000.423,D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatPlanSel.dfm=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatPlanSel2.dfm 1899/12/30 00:00:00.000.210,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_WBNeedHTLook.pas + 1899/12/30 00:00:00.000.318,D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_XB.pas=D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_JT.pas 1899/12/30 00:00:00.000.584,=D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_CZ.pas - 1899/12/30 00:00:00.000.158,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatGYSel.pas + 1899/12/30 00:00:00.000.444,D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_WBSpecInPut.pas=D:\Dp10RepoV1\项目代码\D10gmHuahudie\A02基础产品管理\U_WBSpecInPut.pas 1899/12/30 00:00:00.000.717,D:\Dp10RepoV1\项目代码\D10szKaiXiYa\A02基础产品管理\U_TatClothInfoInput.pas= - 1899/12/30 00:00:00.000.318,D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_JT.dfm=D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_XB.dfm + 1899/12/30 00:00:00.000.444,D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_WBSpecInPut.dfm=D:\Dp10RepoV1\项目代码\D10gmHuahudie\A02基础产品管理\U_WBSpecInPut.dfm 1899/12/30 00:00:00.000.215,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_Tat_WB_InPut.pas 1899/12/30 00:00:00.000.192,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_TatWBPlanZJZK.pas 1899/12/30 00:00:00.000.981,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_GKInput.pas 1899/12/30 00:00:00.000.922,=D:\Dp10RepoV1\public10\ThreeFun\Fun\uSZHN_JSON.pas - 1899/12/30 00:00:00.000.423,D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatPlanSel2.dfm=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatPlanSel.dfm + 1899/12/30 00:00:00.000.318,D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_XB.dfm=D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_JT.dfm 1899/12/30 00:00:00.000.378,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\B02基础纱线仓库\U_YarnCFInfoSel.pas 1899/12/30 00:00:00.000.373,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_TatWBPlanZJZKKaiKa.pas + 1899/12/30 00:00:00.000.020,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_WBNeedHTList.pas + 1899/12/30 00:00:00.000.162,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_TatWBPlanZJZKInPut.pas + 1899/12/30 00:00:00.000.108,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_TatWBPlan.pas + 1899/12/30 00:00:00.000.598,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_LogInput.pas 1899/12/30 00:00:00.000.535,=D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_JT.pas 1899/12/30 00:00:00.000.556,=D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_SZ.pas - 1899/12/30 00:00:00.000.444,D:\Dp10RepoV1\项目代码\D10gmHuahudie\A02基础产品管理\U_WBSpecInPut.pas=D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_WBSpecInPut.pas - 1899/12/30 00:00:00.000.423,D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatPlanSel2.pas=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E00梭织通用窗体\U_TatPlanSel.pas - 1899/12/30 00:00:00.000.598,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\E02梭织经轴仓库\U_LogInput.pas - 1899/12/30 00:00:00.000.318,D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_JT.pas=D:\Dp10RepoV1\项目代码\D10gmHuahudie\E02梭织经轴仓库\U_TatWBOutputList_XB.pas diff --git a/E02梭织经轴仓库/WarpBeamStk.identcache b/E02梭织经轴仓库/WarpBeamStk.identcache index 534fae1..c3e65ce 100644 Binary files a/E02梭织经轴仓库/WarpBeamStk.identcache and b/E02梭织经轴仓库/WarpBeamStk.identcache differ