diff --git a/A09财务通用管理/Financial.dproj.local b/A09财务通用管理/Financial.dproj.local index 61f4cb1..227d5df 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 @@ -42,7 +42,7 @@ 1899/12/30 00:00:00.000.736,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ModuleNote.pas= 1899/12/30 00:00:00.000.178,=D:\Dp10Repo\public10\design\U_WindowFormdesign.pas 1899/12/30 00:00:00.000.487,D:\Dp10Repo\项目代码\睿特\新DLL初始化(CSH.dll)\U_ZDYHelpSel.pas= - 1899/12/30 00:00:00.000.844,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_AttachmentUpload.pas + 1899/12/30 00:00:00.000.542,=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_InvoiceSel.pas 1899/12/30 00:00:00.000.795,D:\D10V1W\项目代码\D10SZKaiXiYa\A00通用窗体\U_AttachmentUpload.dfm=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_AttachmentUploadIvI.dfm 1899/12/30 00:00:00.000.621,D:\Dp10Repo\项目代码\RTBasics\A09财务通用管理\U_InvoiceOutList.dfm=D:\Dp10Repo\项目代码\RTBasics\A09财务通用管理\U_InvoiceInList.dfm 1899/12/30 00:00:00.000.060,D:\D10W\项目代码\D10myXingrui\B02基础纱线仓库\U_YarnInfoImport.dfm=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_CollectImport.dfm @@ -64,14 +64,14 @@ 1899/12/30 00:00:00.000.595,=D:\Dp10RepoV1\项目代码\D10SZKaiXiYa\A09财务通用管理\U_PayableBatchInput.pas 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.690,=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_CollectImport.pas + 1899/12/30 00:00:00.000.844,=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_AttachmentUpload.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.542,=D:\D10V1W\项目代码\D10SZKaiXiYa\A09财务通用管理\U_InvoiceSel.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 - 1899/12/30 00:00:00.000.076,=D:\Dp10Repo\项目代码\RTBasics\A09财务通用管理\U_InvoiceOutInPut.pas 1899/12/30 00:00:00.000.871,D:\Dp10Repo\项目代码\RTBasics\A09财务通用管理\U_InvoiceOutInPut.pas=D:\Dp10Repo\项目代码\RTBasics\A09财务通用管理\U_InvoiceInInPut.pas + 1899/12/30 00:00:00.000.076,=D:\Dp10Repo\项目代码\RTBasics\A09财务通用管理\U_InvoiceOutInPut.pas 1899/12/30 00:00:00.000.692,D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_ClothInfoSel.dfm=D:\Dp10Repo\项目代码\RTBasics\A00通用窗体\U_CompanySel.dfm diff --git a/A09财务通用管理/Financial.identcache b/A09财务通用管理/Financial.identcache index 34fc8ba..decfc6e 100644 Binary files a/A09财务通用管理/Financial.identcache and b/A09财务通用管理/Financial.identcache differ diff --git a/A09财务通用管理/U_CollectInput2.dfm b/A09财务通用管理/U_CollectInput2.dfm index 1070d7d..2a470c8 100644 --- a/A09财务通用管理/U_CollectInput2.dfm +++ b/A09财务通用管理/U_CollectInput2.dfm @@ -34,7 +34,6 @@ object frmCollectInput2: TfrmCollectInput2 ParentColor = False ShowCaptions = True TabOrder = 0 - ExplicitWidth = 884 object ToolButton3: TToolButton Left = 0 Top = 0 @@ -67,7 +66,6 @@ object frmCollectInput2: TfrmCollectInput2 ParentCtl3D = False TabOrder = 1 OnClick = ScrollBox1Click - ExplicitWidth = 884 object Label7: TLabel Left = 84 Top = 276 @@ -120,9 +118,9 @@ object frmCollectInput2: TfrmCollectInput2 object Label15: TLabel Left = 440 Top = 36 - Width = 48 + Width = 80 Height = 21 - Caption = #21457#31080#21495 + Caption = #24212#25910#27454#21333#21495 end object Note: TMemo Tag = 2 @@ -216,8 +214,6 @@ object frmCollectInput2: TfrmCollectInput2 Height = 135 Align = alClient TabOrder = 0 - ExplicitWidth = 111 - ExplicitHeight = 127 object Tv1: TcxGridDBTableView OnDblClick = Tv1DblClick Navigator.Buttons.CustomButtons = <> diff --git a/A09财务通用管理/U_CollectInput2.pas b/A09财务通用管理/U_CollectInput2.pas index 7b7fc81..715b295 100644 --- a/A09财务通用管理/U_CollectInput2.pas +++ b/A09财务通用管理/U_CollectInput2.pas @@ -96,7 +96,7 @@ implementation uses U_DataLink, U_RTFun, U_ZDYHelp, U_CompanySel, U_BankSel, U_FinTradePlanSel, - U_FinTradeSalesContractSel, U_ZDYBankSel, U_InvoiceOutSel; + U_FinTradeSalesContractSel, U_ZDYBankSel, U_GetableSel; {$R *.dfm} @@ -277,59 +277,42 @@ end; procedure TfrmCollectInput2.cxButtonEdit1PropertiesButtonClick(Sender: TObject; AButtonIndex: Integer); var - CurrentAmount: Double; - TaxAmount: Double; + TotalTaxInclude: Double; begin try - frmInvoiceOutSel := TfrmInvoiceOutSel.Create(Application); - with frmInvoiceOutSel do + frmGetableSel := TfrmGetableSel.Create(Application); + with frmGetableSel do begin - if ShowModal = 1 then + cxTabControl1.TabIndex := 0; + if ShowModal <> 1 then Exit; + + if FFFIDs = '' then begin - FoppShuiNoChange := '0'; - Self.IVNo.Text := ''; - - Self.IVNo.Properties.LookupItems.Text := ''; - Self.Amount.Text := '0'; - - while CDS_Invoice.Locate('SSel', true, []) do - begin - - with frmInvoiceOutSel.CDS_Invoice do - begin - CurrentAmount := StrToFloatDef(StringReplace(Self.Amount.Text, ',', '', [rfReplaceAll]), 0); - TaxAmount := FieldByName('TaxAmount').AsFloat; - if Self.IVNo.Text = '' then - begin - Self.IVNo.Text := frmInvoiceOutSel.CDS_Invoice.FieldByName('IVNo').AsString; - Self.IVNo.Properties.LookupItems.Text := frmInvoiceOutSel.CDS_Invoice.FieldByName('IVID').AsString; - Self.Amount.Text := FormatFloat('#,##0.00', TaxAmount); - end - else - begin - Self.IVNo.Text := Trim(Self.IVNo.Text) + ',' + Trim(frmInvoiceOutSel.CDS_Invoice.FieldByName('IVNo').AsString); - Self.IVNo.Properties.LookupItems.Text := trim(Self.IVNo.Properties.LookupItems.Text) + ',' + Trim(frmInvoiceOutSel.CDS_Invoice.FieldByName('IVID').AsString); - Self.Amount.Text := FormatFloat('#,##0.00', CurrentAmount + TaxAmount); - end; - - Self.OppCoName.Text := frmInvoiceOutSel.CDS_Invoice.FieldByName('Supplier').AsString; - Self.OppCoName.Properties.LookupItems.Text := frmInvoiceOutSel.CDS_Invoice.FieldByName('CoCode').AsString; - Self.oppShuiNo.Text := trim(frmInvoiceOutSel.CDS_Invoice.FieldByName('SupplierShuiNo').AsString); - - Self.Currency.Text := frmInvoiceOutSel.CDS_Invoice.FieldByName('Currency').AsString; - - OurBankName.Text := Trim(frmInvoiceOutSel.CDS_Invoice.fieldbyname('BankDeposit').AsString); - OurBankCardNo.Text := Trim(frmInvoiceOutSel.CDS_Invoice.fieldbyname('BankCardNo').AsString); - - end; - CDS_Invoice.Delete; - end; - - FoppShuiNoChange := '1'; + Application.MessageBox('δѡκӦտ', 'ʾ', MB_OK + MB_ICONWARNING); + Exit; end; + + FoppShuiNoChange := '0'; + + Self.IVNo.Properties.LookupItems.Text := FFFIDs; + Self.IVNo.Text := FFFIDs; + + TotalTaxInclude := FTaxInclude; + Self.Amount.Text := FormatFloat('#,##0.00', TotalTaxInclude); + + if not frmGetableSel.CDS_1.IsEmpty then + begin + frmGetableSel.CDS_1.First; + Self.OppCoName.Text := frmGetableSel.CDS_1.FieldByName('OppCoName').AsString; + Self.OppCoName.Properties.LookupItems.Text := frmGetableSel.CDS_1.FieldByName('OppCoNo').AsString; + Self.oppShuiNo.Text := frmGetableSel.CDS_1.FieldByName('oppShuiNo').AsString; + Self.Currency.Text := frmGetableSel.CDS_1.FieldByName('Currency').AsString; + end; + + FoppShuiNoChange := '1'; end; finally - frmInvoiceOutSel.Free; + frmGetableSel.Free; end; end; diff --git a/A09财务通用管理/U_CollectList.dfm b/A09财务通用管理/U_CollectList.dfm index 2b56735..384a82f 100644 --- a/A09财务通用管理/U_CollectList.dfm +++ b/A09财务通用管理/U_CollectList.dfm @@ -19,7 +19,7 @@ inherited frmCollectList: TfrmCollectList Height = 30 AutoSize = True ButtonHeight = 30 - ButtonWidth = 99 + ButtonWidth = 95 Caption = 'ToolBar1' Color = clSkyBlue DisabledImages = DataLink_Financial.cxImageList_bar @@ -37,7 +37,7 @@ inherited frmCollectList: TfrmCollectList OnClick = TBRafreshClick end object btnAdd: TToolButton - Left = 71 + Left = 63 Top = 0 AutoSize = True Caption = #26032#22686 @@ -45,7 +45,7 @@ inherited frmCollectList: TfrmCollectList OnClick = btnAddClick end object btnEdit: TToolButton - Left = 142 + Left = 126 Top = 0 AutoSize = True Caption = #20462#25913 @@ -53,7 +53,7 @@ inherited frmCollectList: TfrmCollectList OnClick = btnEditClick end object btnDel: TToolButton - Left = 213 + Left = 189 Top = 0 AutoSize = True Caption = #21024#38500 @@ -61,7 +61,7 @@ inherited frmCollectList: TfrmCollectList OnClick = btnDelClick end object btnChk: TToolButton - Left = 284 + Left = 252 Top = 0 AutoSize = True Caption = #23457#26680 @@ -69,7 +69,7 @@ inherited frmCollectList: TfrmCollectList OnClick = btnChkClick end object btnReChk: TToolButton - Left = 355 + Left = 315 Top = 0 AutoSize = True Caption = #25764#38144#23457#26680 @@ -77,7 +77,7 @@ inherited frmCollectList: TfrmCollectList OnClick = btnReChkClick end object ToolButton7: TToolButton - Left = 458 + Left = 402 Top = 0 AutoSize = True Caption = #26680#38144 @@ -86,7 +86,7 @@ inherited frmCollectList: TfrmCollectList OnClick = ToolButton7Click end object ToolButton8: TToolButton - Left = 529 + Left = 465 Top = 0 AutoSize = True Caption = #26680#38144#26085#24535 @@ -95,15 +95,24 @@ inherited frmCollectList: TfrmCollectList OnClick = ToolButton8Click end object TBInvoice: TToolButton - Left = 632 + Left = 552 Top = 0 AutoSize = True Caption = #20851#32852#21457#31080 ImageIndex = 3 + Visible = False OnClick = TBInvoiceClick end + object TBReceivable: TToolButton + Left = 639 + Top = 0 + AutoSize = True + Caption = #20851#32852#24212#25910#27454 + ImageIndex = 3 + OnClick = TBReceivableClick + end object ToolButton1: TToolButton - Left = 735 + Left = 738 Top = 0 AutoSize = True Caption = #23548#20837 @@ -111,7 +120,7 @@ inherited frmCollectList: TfrmCollectList OnClick = ToolButton1Click end object ToolButton4: TToolButton - Left = 806 + Left = 801 Top = 0 AutoSize = True Caption = #23548#20986 @@ -119,7 +128,7 @@ inherited frmCollectList: TfrmCollectList OnClick = ToolButton4Click end object ToolButton9: TToolButton - Left = 877 + Left = 864 Top = 0 AutoSize = True Caption = #38468#20214 @@ -127,7 +136,7 @@ inherited frmCollectList: TfrmCollectList OnClick = ToolButton9Click end object ToolButton5: TToolButton - Left = 948 + Left = 927 Top = 0 AutoSize = True Caption = #20445#23384#26684#24335 @@ -135,7 +144,7 @@ inherited frmCollectList: TfrmCollectList OnClick = ToolButton5Click end object TBClose: TToolButton - Left = 1051 + Left = 1014 Top = 0 AutoSize = True Caption = #20851#38381 @@ -426,7 +435,7 @@ inherited frmCollectList: TfrmCollectList Width = 120 end object Tv1IVNo: TcxGridDBColumn - Caption = #21457#31080#21495 + Caption = #24212#25910#27454#21333#21495 DataBinding.FieldName = 'IVNo' DataBinding.IsNullValueType = True HeaderAlignmentHorz = taCenter diff --git a/A09财务通用管理/U_CollectList.pas b/A09财务通用管理/U_CollectList.pas index 70c1c86..8ae6429 100644 --- a/A09财务通用管理/U_CollectList.pas +++ b/A09财务通用管理/U_CollectList.pas @@ -81,6 +81,7 @@ type Tv1oppShuiNo: TcxGridDBColumn; Tv1OurBankCardNo: TcxGridDBColumn; Tv1IVNo: TcxGridDBColumn; + TBReceivable: TToolButton; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); procedure btnDelClick(Sender: TObject); @@ -103,6 +104,7 @@ type procedure N3Click(Sender: TObject); procedure ToolButton1Click(Sender: TObject); procedure TBInvoiceClick(Sender: TObject); + procedure TBReceivableClick(Sender: TObject); private procedure InitGrid(); procedure SetStatus(); @@ -114,7 +116,7 @@ implementation uses U_DataLink, U_RTFun, U_CollectInput2, U_CollectInput, U_ZDYHelp, U_CollectWriteOff, - U_CollectWriteOffList, U_AttachmentUpload, U_CollectImport,U_InvoiceOutSel; + U_CollectWriteOffList, U_AttachmentUpload, U_CollectImport,U_InvoiceOutSel,U_GetableSel; {$R *.dfm} procedure TfrmCollectList.SetStatus(); @@ -128,7 +130,7 @@ begin btnAdd.Enabled := false; // btnEdit.Enabled := false; //޸ btnDel.Enabled := false; //ɾ - TBInvoice.Enabled := false; +// TBInvoice.Enabled := false; // if Trim(FAuthority) = '' then begin @@ -139,7 +141,7 @@ begin btnEdit.Enabled := true; btnDel.Enabled := true; // btnChk.Enabled := true; - TBInvoice.Enabled := true; +// TBInvoice.Enabled := true; end; 1: begin @@ -420,6 +422,124 @@ begin end; +procedure TfrmCollectList.TBReceivableClick(Sender: TObject); +var + FFFIDList: TStringList; + ReceivableIDs, ReceivableNos: string; + i: Integer; + LogMsg: string; +begin + inherited; + + if CDS_1.IsEmpty then Exit; + if not CDS_1.Locate('SSel', True, []) then + begin + Application.MessageBox('ȹѡҪӦտտ¼', 'ʾ', MB_OK + MB_ICONINFORMATION); + Exit; + end; + + frmGetableSel := TfrmGetableSel.Create(Application); + try + frmGetableSel.cxTabControl1.TabIndex := 0; + if frmGetableSel.ShowModal <> mrOk then + Exit; + if frmGetableSel.FFFIDs = '' then + begin + Application.MessageBox('δѡκӦտ', 'ʾ', MB_OK + MB_ICONWARNING); + Exit; + end; + ReceivableIDs := frmGetableSel.FFFIDs; + ReceivableNos := frmGetableSel.FFFIDs; + finally + frmGetableSel.Free; + end; + + FFFIDList := TStringList.Create; + try + CDS_1.DisableControls; + CDS_1.First; + while not CDS_1.Eof do + begin + if CDS_1.FieldByName('SSel').AsBoolean then + FFFIDList.Add(CDS_1.FieldByName('FFID').AsString); + CDS_1.Next; + end; + + if FFFIDList.Count = 0 then + begin + Application.MessageBox('ûйѡκտ¼', 'ʾ', MB_OK + MB_ICONINFORMATION); + Exit; + end; + + ADOQueryCmd.Connection.BeginTrans; + try + for i := 0 to FFFIDList.Count - 1 do + begin + ADOQueryCmd.Close; + ADOQueryCmd.SQL.Text := 'UPDATE Finance_Flow SET IVID = :IVID, IVNo = :IVNo WHERE FFID = :FFID'; + ADOQueryCmd.Parameters.ParamByName('IVID').Value := ReceivableIDs; + ADOQueryCmd.Parameters.ParamByName('IVNo').Value := ReceivableNos; + ADOQueryCmd.Parameters.ParamByName('FFID').Value := FFFIDList[i]; + ADOQueryCmd.ExecSQL; + end; + + CDS_1.First; + while not CDS_1.Eof do + begin + if CDS_1.FieldByName('SSel').AsBoolean then + begin + CDS_1.Edit; + CDS_1.FieldByName('IVID').Value := ReceivableIDs; + CDS_1.FieldByName('IVNo').Value := ReceivableNos; + CDS_1.Post; + end; + CDS_1.Next; + end; + + ADOQueryCmd.Connection.CommitTrans; + + LogMsg := Format('ӦտɹӦտIDs%sӰտ¼%d', + [ReceivableIDs, FFFIDList.Count]); + ADOQueryCmd.Close; + ADOQueryCmd.SQL.Text := 'INSERT INTO SY_Syslog (Operor, OperTime, Model, Acction, OPEvent, Result) ' + + 'VALUES (:Operor, GETDATE(), :Model, :Acction, :OPEvent, :Result)'; + ADOQueryCmd.Parameters.ParamByName('Operor').Value := DName + '(' + DCode + ')'; + ADOQueryCmd.Parameters.ParamByName('Model').Value := 'տǼ'; + ADOQueryCmd.Parameters.ParamByName('Acction').Value := 'Ӧտ'; + ADOQueryCmd.Parameters.ParamByName('OPEvent').Value := LogMsg; + ADOQueryCmd.Parameters.ParamByName('Result').Value := 'ɹ'; + ADOQueryCmd.ExecSQL; + + Application.MessageBox('Ӧտɹ', 'ʾ', MB_OK + MB_ICONINFORMATION); + InitGrid; + except + on E: Exception do + begin + ADOQueryCmd.Connection.RollbackTrans; + LogMsg := Format('ӦտʧܣӦտIDs%sӰ¼%dԭ%s', + [ReceivableIDs, FFFIDList.Count, E.Message]); + try + ADOQueryCmd.Close; + ADOQueryCmd.SQL.Text := 'INSERT INTO SY_Syslog (Operor, OperTime, Model, Acction, OPEvent, Result) ' + + 'VALUES (:Operor, GETDATE(), :Model, :Acction, :OPEvent, :Result)'; + ADOQueryCmd.Parameters.ParamByName('Operor').Value := DName + '(' + DCode + ')'; + ADOQueryCmd.Parameters.ParamByName('Model').Value := 'տǼ'; + ADOQueryCmd.Parameters.ParamByName('Acction').Value := 'Ӧտ'; + ADOQueryCmd.Parameters.ParamByName('OPEvent').Value := LogMsg; + ADOQueryCmd.Parameters.ParamByName('Result').Value := 'ʧ'; + ADOQueryCmd.ExecSQL; + except + end; + Application.MessageBox(PChar('ʧܣ' + E.Message), '', MB_OK + MB_ICONERROR); + InitGrid; + end; + end; + finally + FFFIDList.Free; + CDS_1.EnableControls; + end; +end; + procedure TfrmCollectList.cxGridDBColumn5PropertiesEditValueChanged(Sender: TObject); var mvalue, FFieldName: string; diff --git a/A09财务通用管理/U_GETableBatchInput.dfm b/A09财务通用管理/U_GETableBatchInput.dfm index 8dbb4a9..fe7df93 100644 --- a/A09财务通用管理/U_GETableBatchInput.dfm +++ b/A09财务通用管理/U_GETableBatchInput.dfm @@ -177,6 +177,28 @@ inherited frmGetableBatchInput: TfrmGetableBatchInput HeaderAlignmentHorz = taCenter Width = 130 end + object Tv1invoice_no: TcxGridDBColumn + Caption = #21457#31080#21495 + DataBinding.FieldName = 'invoice_no' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv1customs_declare_no: TcxGridDBColumn + Caption = #25253#20851#21333#21495 + DataBinding.FieldName = 'customs_declare_no' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Width = 80 + end + object Tv1invoice_date: TcxGridDBColumn + Caption = #21457#31080#26085#26399 + DataBinding.FieldName = 'invoice_date' + DataBinding.IsNullValueType = True + PropertiesClassName = 'TcxDateEditProperties' + HeaderAlignmentHorz = taCenter + Width = 80 + end object Tv1ourShuiNo: TcxGridDBColumn Caption = #25105#26041#31246#21495 DataBinding.FieldName = 'ourShuiNo' diff --git a/A09财务通用管理/U_GETableBatchInput.pas b/A09财务通用管理/U_GETableBatchInput.pas index 2a4c139..5afb3ff 100644 --- a/A09财务通用管理/U_GETableBatchInput.pas +++ b/A09财务通用管理/U_GETableBatchInput.pas @@ -64,6 +64,9 @@ type cxGridLevel1: TcxGridLevel; Tv1Column1: TcxGridDBColumn; Tv1Column2: TcxGridDBColumn; + Tv1invoice_no: TcxGridDBColumn; + Tv1customs_declare_no: TcxGridDBColumn; + Tv1invoice_date: TcxGridDBColumn; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); procedure FormShow(Sender: TObject); @@ -241,6 +244,17 @@ begin //ҷλ FieldByName('OurCoNo').Value := CDS_1.fieldbyname('OurCoNo').Value; + if not CDS_1.FieldByName('FFTime').IsNull then + begin + if not CDS_1.FieldByName('payment_term').IsNull and (Trim(CDS_1.FieldByName('payment_term').AsString) <> '') then + ADOQueryCmd.FieldByName('due_receive_date').AsDateTime := + CDS_1.FieldByName('FFTime').AsDateTime + StrToIntDef(Trim(CDS_1.FieldByName('payment_term').AsString), 0) + else + ADOQueryCmd.FieldByName('due_receive_date').AsDateTime := CDS_1.FieldByName('FFTime').AsDateTime; + end; + + ADOQueryCmd.FieldByName('payment_term').Value := CDS_1.FieldByName('payment_term').Value; + Post; end; @@ -687,6 +701,7 @@ begin Self.CDS_1.FieldByName('OppCoName').asstring := Trim(frmCompanySel.CDS_1.fieldbyname('CoName').AsString); Self.CDS_1.FieldByName('oppCoNo').asstring := Trim(frmCompanySel.CDS_1.fieldbyname('CoCode').AsString); Self.CDS_1.FieldByName('oppShuiNo').asstring := Trim(frmCompanySel.CDS_1.fieldbyname('ShuiNo').AsString); + Self.CDS_1.FieldByName('payment_term').Value := Trim(frmCompanySel.CDS_1.fieldbyname('BillCycle').AsString); Self.CDS_1.Post; end; end; diff --git a/A09财务通用管理/U_GetableSel.dfm b/A09财务通用管理/U_GetableSel.dfm index 56fc2e8..01f3350 100644 --- a/A09财务通用管理/U_GetableSel.dfm +++ b/A09财务通用管理/U_GetableSel.dfm @@ -1,7 +1,7 @@ inherited frmGetableSel: TfrmGetableSel Left = 65 Top = 113 - Caption = #24212#20184#27454#25209#37327#36873#25321 + Caption = #24212#25910#27454#25209#37327#36873#25321 ClientHeight = 572 ClientWidth = 1406 Color = clWhite @@ -9,7 +9,6 @@ inherited frmGetableSel: TfrmGetableSel Font.Height = -16 Position = poMainFormCenter OnClose = FormClose - ExplicitLeft = -89 ExplicitWidth = 1422 ExplicitHeight = 611 PixelsPerInch = 96 @@ -111,8 +110,8 @@ inherited frmGetableSel: TfrmGetableSel Properties.Style = 11 Properties.TabIndex = 0 Properties.Tabs.Strings = ( - #26410#24320#31080 - #24050#24320#31080 + #26410#25910#27454 + #24050#25910#27454 #20840#37096) LookAndFeel.Kind = lfUltraFlat OnChange = cxTabControl1Change diff --git a/A09财务通用管理/U_GetableSel.pas b/A09财务通用管理/U_GetableSel.pas index 3cec584..2c14f99 100644 --- a/A09财务通用管理/U_GetableSel.pas +++ b/A09财务通用管理/U_GetableSel.pas @@ -136,16 +136,35 @@ begin sql.Add(' where CheckStatus = '''' '); // sql.Add(' where 1=1 '); SQL.Add(' and FFFlag = ''Ӧ'' '); - case cxTabControl1.TabIndex of - 0: - begin - sql.Add(' and not EXISTS ( select 1 from Finance_FlowInvoice X where X.FFID=A.FFID ) '); - end; - 1: - begin - sql.Add(' and EXISTS ( select 1 from Finance_FlowInvoice X where X.FFID=A.FFID ) '); - end; - end; +// case cxTabControl1.TabIndex of +// 0: +// begin +// sql.Add(' and not EXISTS ( select 1 from Finance_FlowInvoice X where X.FFID=A.FFID ) '); +// end; +// 1: +// begin +// sql.Add(' and EXISTS ( select 1 from Finance_FlowInvoice X where X.FFID=A.FFID ) '); +// end; +// end; + case cxTabControl1.TabIndex of + 0: begin + sql.Add(' and not EXISTS ( ' + + ' select 1 from Finance_Flow R ' + + ' where R.FFType = ''տǼ'' ' + + ' and R.IVID is not null ' + + ' and '','' + R.IVID + '','' like ''%,'' + A.FFID + '',%'' ' + + ' ) '); + end; + 1: begin + sql.Add(' and EXISTS ( ' + + ' select 1 from Finance_Flow R ' + + ' where R.FFType = ''տǼ'' ' + + ' and R.IVID is not null ' + + ' and '','' + R.IVID + '','' like ''%,'' + A.FFID + '',%'' ' + + ' ) '); + end; + end; +// showmessage(sql.text); Open; end; SCreateCDS(ADOQueryMain, CDS_1); diff --git a/A09财务通用管理/U_InvoiceOutList.dfm b/A09财务通用管理/U_InvoiceOutList.dfm index 35173c5..3e906c3 100644 --- a/A09财务通用管理/U_InvoiceOutList.dfm +++ b/A09财务通用管理/U_InvoiceOutList.dfm @@ -7,6 +7,7 @@ inherited frmInvoiceOutList: TfrmInvoiceOutList Font.Height = -16 FormStyle = fsMDIChild Visible = True + ExplicitLeft = -113 ExplicitWidth = 1574 ExplicitHeight = 665 PixelsPerInch = 96 @@ -455,7 +456,7 @@ inherited frmInvoiceOutList: TfrmInvoiceOutList DataBinding.FieldName = 'PayDate' DataBinding.IsNullValueType = True HeaderAlignmentHorz = taCenter - Width = 101 + Width = 128 end object Tv1Column2: TcxGridDBColumn Caption = #23457#26680#29366#24577 diff --git a/A09财务通用管理/U_ReceivableList.dfm b/A09财务通用管理/U_ReceivableList.dfm index 2302e5e..476a838 100644 --- a/A09财务通用管理/U_ReceivableList.dfm +++ b/A09财务通用管理/U_ReceivableList.dfm @@ -7,6 +7,7 @@ inherited frmReceivableList: TfrmReceivableList Font.Height = -16 FormStyle = fsMDIChild Visible = True + ExplicitLeft = -166 ExplicitWidth = 1556 ExplicitHeight = 629 PixelsPerInch = 96 @@ -370,25 +371,25 @@ inherited frmReceivableList: TfrmReceivableList Options.Editing = False Width = 82 end - object Tv1CIVNO: TcxGridDBColumn + object Tv1invoice_no: TcxGridDBColumn Caption = #21457#31080#21495 - DataBinding.FieldName = 'CIVNO' + DataBinding.FieldName = 'invoice_no' DataBinding.IsNullValueType = True HeaderAlignmentHorz = taCenter Options.Editing = False Width = 80 end - object Tv1BGDNum: TcxGridDBColumn + object Tv1customs_declare_no: TcxGridDBColumn Caption = #25253#20851#21333#21495 - DataBinding.FieldName = 'BGDNum' + DataBinding.FieldName = 'customs_declare_no' DataBinding.IsNullValueType = True HeaderAlignmentHorz = taCenter Options.Editing = False Width = 80 end - object Tv1IVDate: TcxGridDBColumn + object Tv1invoice_date: TcxGridDBColumn Caption = #21457#31080#26085#26399 - DataBinding.FieldName = 'IVDate' + DataBinding.FieldName = 'invoice_date' DataBinding.IsNullValueType = True HeaderAlignmentHorz = taCenter Options.Editing = False @@ -579,6 +580,61 @@ inherited frmReceivableList: TfrmReceivableList Options.Editing = False Width = 96 end + object Tv1payment_term: TcxGridDBColumn + Caption = #36134#26399 + DataBinding.FieldName = 'payment_term' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object Tv1due_receive_date: TcxGridDBColumn + Caption = #21040#26399#25910#27454#26085 + DataBinding.FieldName = 'due_receive_date' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + end + object Tv1Checkstatus: TcxGridDBColumn + Caption = #23457#26680#29366#24577 + DataBinding.FieldName = 'Checkstatus' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object Tv1Chker: TcxGridDBColumn + Caption = #23457#26680#20154 + DataBinding.FieldName = 'Chker' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object Tv1Chktime: TcxGridDBColumn + Caption = #23457#26680#26102#38388 + DataBinding.FieldName = 'Chktime' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object Tv1CollectStatus: TcxGridDBColumn + Caption = #25910#27454#29366#24577 + DataBinding.FieldName = 'CollectStatus' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end + object Tv1CollectDate: TcxGridDBColumn + Caption = #25910#27454#26085#26399 + DataBinding.FieldName = 'CollectDate' + DataBinding.IsNullValueType = True + HeaderAlignmentHorz = taCenter + Options.Editing = False + Width = 80 + end object Tv1Note: TcxGridDBColumn Caption = #22791#27880 DataBinding.FieldName = 'Note' diff --git a/A09财务通用管理/U_ReceivableList.pas b/A09财务通用管理/U_ReceivableList.pas index 99a2e33..3c07096 100644 --- a/A09财务通用管理/U_ReceivableList.pas +++ b/A09财务通用管理/U_ReceivableList.pas @@ -94,9 +94,16 @@ type Tv1Column2: TcxGridDBColumn; ToolButton6: TToolButton; Tv1NoTaxInclude: TcxGridDBColumn; - Tv1CIVNO: TcxGridDBColumn; - Tv1BGDNum: TcxGridDBColumn; - Tv1IVDate: TcxGridDBColumn; + Tv1invoice_no: TcxGridDBColumn; + Tv1customs_declare_no: TcxGridDBColumn; + Tv1invoice_date: TcxGridDBColumn; + Tv1payment_term: TcxGridDBColumn; + Tv1due_receive_date: TcxGridDBColumn; + Tv1Checkstatus: TcxGridDBColumn; + Tv1Chker: TcxGridDBColumn; + Tv1Chktime: TcxGridDBColumn; + Tv1CollectStatus: TcxGridDBColumn; + Tv1CollectDate: TcxGridDBColumn; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure TBCloseClick(Sender: TObject); procedure btnDelClick(Sender: TObject); @@ -182,21 +189,30 @@ begin SQL.Clear; Filtered := False; - sql.Add(' select A.* ,C.IVNo as CIVNO,C.IVID as CIVID,C.BGDNum,C.IVDate '); + sql.Add(' select A.* '); + sql.Add(' ,ISNULL( (SELECT TOP 1 '); + sql.Add(' CASE R.status '); + sql.Add(' WHEN ''0'' THEN ''δ'' '); + sql.Add(' WHEN ''9'' THEN '''' '); + sql.Add(' ELSE ''δ֪'' '); + sql.Add(' END '); + sql.Add(' FROM Finance_Flow R '); + sql.Add(' WHERE R.FFType = ''տǼ'' '); + sql.Add(' AND R.IVID IS NOT NULL '); + sql.Add(' AND '','' + R.IVID + '','' LIKE ''%,'' + A.FFID + '',%'' '); + sql.Add(' ORDER BY R.FFTime DESC '); + sql.Add(' ), ''δտ'') AS CollectStatus '); + + sql.Add(' ,(SELECT TOP 1 R.FFTime '); + sql.Add(' FROM Finance_Flow R '); + sql.Add(' WHERE R.FFType = ''տǼ'' '); + sql.Add(' AND R.IVID IS NOT NULL '); + sql.Add(' AND '','' + R.IVID + '','' LIKE ''%,'' + A.FFID + '',%'' '); + sql.Add(' ORDER BY R.FFTime DESC '); + sql.Add(' ) AS CollectDate '); 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(' from Finance_Flow A '); -// sql.Add(' left join Finance_FlowInvoice B on A.FFID=B.FFID'); //жȡһ -// SQL.Add(' inner join Finance_Invoice B on A.IVId=C.IVId'); + sql.Add(' FROM Finance_Flow A '); - -// Finance_FlowInvoiceˮ-ƱȡÿˮĵһƱ¼ - sql.Add(' LEFT JOIN ( '); - sql.Add(' SELECT FFID, IVId, ROW_NUMBER() OVER (PARTITION BY FFID ORDER BY IVId) AS RowNum '); - sql.Add(' FROM Finance_FlowInvoice '); - sql.Add(' ) AS B ON A.FFID = B.FFID AND B.RowNum = 1 '); // RowNum=1 ȷֻȡһ - -// ڹ Finance_InvoiceƱͨBIVId - sql.Add(' left JOIN Finance_Invoice C ON B.IVId = C.IVId '); sql.Add(' where A.FFType=''ӦտǼ'' '); case cxTabControl1.TabIndex of 0: