2024-07-04 16:01:24 +08:00
|
|
|
|
unit U_SingleCustStatement;
|
|
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
|
|
|
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
|
|
|
|
|
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin, StdCtrls,
|
|
|
|
|
|
cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
|
|
|
|
|
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
|
|
|
|
|
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
|
|
|
|
|
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
|
|
|
|
|
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
|
|
|
|
|
IdTCPClient, IdFTP, ShellAPI, IniFiles, cxCheckBox, cxCalendar, cxButtonEdit,
|
|
|
|
|
|
cxTextEdit, cxDropDownEdit, RM_e_Xls, cxGridBandedTableView,
|
|
|
|
|
|
cxGridDBBandedTableView, BtnEdit, cxLookAndFeels, cxLookAndFeelPainters,
|
|
|
|
|
|
cxNavigator, dxSkinsCore, dxSkinsDefaultPainters, dxDateRanges,
|
2024-07-13 11:03:15 +08:00
|
|
|
|
dxBarBuiltInMenu, dxSkinWXI, dxScrollbarAnnotations;
|
2024-07-04 16:01:24 +08:00
|
|
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
TfrmSingleCustStatement = class(TForm)
|
|
|
|
|
|
ToolBar1: TToolBar;
|
|
|
|
|
|
TBRafresh: TToolButton;
|
|
|
|
|
|
TBClose: TToolButton;
|
|
|
|
|
|
ADOQueryTemp: TADOQuery;
|
|
|
|
|
|
ADOQueryCmd: TADOQuery;
|
|
|
|
|
|
Panel1: TPanel;
|
|
|
|
|
|
Label1: TLabel;
|
|
|
|
|
|
MPRTCodeName: TEdit;
|
|
|
|
|
|
ADOQueryMain: TADOQuery;
|
|
|
|
|
|
ToolButton1: TToolButton;
|
|
|
|
|
|
Label3: TLabel;
|
|
|
|
|
|
OrderNo: TEdit;
|
|
|
|
|
|
cxGrid2: TcxGrid;
|
|
|
|
|
|
cxGridLevel1: TcxGridLevel;
|
|
|
|
|
|
Label2: TLabel;
|
|
|
|
|
|
Label6: TLabel;
|
|
|
|
|
|
begdate: TDateTimePicker;
|
|
|
|
|
|
Enddate: TDateTimePicker;
|
|
|
|
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|
|
|
|
|
DS_HZ: TDataSource;
|
|
|
|
|
|
CDS_HZ: TClientDataSet;
|
|
|
|
|
|
Label4: TLabel;
|
|
|
|
|
|
OrdDefNote3: TComboBox;
|
|
|
|
|
|
Label5: TLabel;
|
|
|
|
|
|
ToolButton3: TToolButton;
|
|
|
|
|
|
RMGridReport1: TRMGridReport;
|
|
|
|
|
|
RMDBDataSet1: TRMDBDataSet;
|
|
|
|
|
|
RMXLSExport1: TRMXLSExport;
|
|
|
|
|
|
ADOQueryPrint: TADOQuery;
|
|
|
|
|
|
TV1: TcxGridDBBandedTableView;
|
|
|
|
|
|
V1Column2: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column4: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column5: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column6: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column7: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column8: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column9: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column12: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column15: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column3: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column10: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column14: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column16: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column17: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column20: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column21: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column22: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column23: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column25: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column26: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column33: TcxGridDBBandedColumn;
|
|
|
|
|
|
V1Column34: TcxGridDBBandedColumn;
|
|
|
|
|
|
OppCoName: TEdit;
|
|
|
|
|
|
ToolButton2: TToolButton;
|
|
|
|
|
|
TV1Column1: TcxGridDBBandedColumn;
|
|
|
|
|
|
TV1Column2: TcxGridDBBandedColumn;
|
|
|
|
|
|
TV1Column3: TcxGridDBBandedColumn;
|
|
|
|
|
|
TV1Column4: TcxGridDBBandedColumn;
|
|
|
|
|
|
cxStyleRepository1: TcxStyleRepository;
|
|
|
|
|
|
cxStyle1: TcxStyle;
|
2024-07-13 11:03:15 +08:00
|
|
|
|
TV1Column5: TcxGridDBBandedColumn;
|
2025-01-13 16:36:43 +08:00
|
|
|
|
cxGrid1: TcxGrid;
|
|
|
|
|
|
TV11: TcxGridDBTableView;
|
|
|
|
|
|
v2CRTime: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column27: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column23: TcxGridDBColumn;
|
|
|
|
|
|
v2Column2: TcxGridDBColumn;
|
|
|
|
|
|
v2FactoryName: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn1: TcxGridDBColumn;
|
|
|
|
|
|
v2OrderNo: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn2: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column19: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column24: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column20: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column21: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn3: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn4: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column6: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column7: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column8: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column9: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column10: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column13: TcxGridDBColumn;
|
|
|
|
|
|
cxGridDBColumn5: TcxGridDBColumn;
|
|
|
|
|
|
Tv1Column28: TcxGridDBColumn;
|
|
|
|
|
|
cxGridLevel2: TcxGridLevel;
|
|
|
|
|
|
TV11Column1: TcxGridDBColumn;
|
|
|
|
|
|
TV11Column2: TcxGridDBColumn;
|
|
|
|
|
|
TV11Column3: TcxGridDBColumn;
|
2025-04-29 16:36:38 +08:00
|
|
|
|
TV11Column4: TcxGridDBColumn;
|
|
|
|
|
|
TV11Column5: TcxGridDBColumn;
|
2026-06-23 17:26:29 +08:00
|
|
|
|
TV11is_checked: TcxGridDBColumn;
|
|
|
|
|
|
TV11ssel: TcxGridDBColumn;
|
|
|
|
|
|
TBVerify: TToolButton;
|
|
|
|
|
|
TBCancelVerify: TToolButton;
|
2024-07-04 16:01:24 +08:00
|
|
|
|
procedure FormDestroy(Sender: TObject);
|
|
|
|
|
|
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
|
procedure TBCloseClick(Sender: TObject);
|
|
|
|
|
|
procedure FormShow(Sender: TObject);
|
|
|
|
|
|
procedure TBRafreshClick(Sender: TObject);
|
|
|
|
|
|
procedure P_OrderNo_YSK(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
procedure FormCreate(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
procedure ToolButton2Click(Sender: TObject);
|
2026-06-23 17:26:29 +08:00
|
|
|
|
procedure TBVerifyClick(Sender: TObject);
|
|
|
|
|
|
procedure TBCancelVerifyClick(Sender: TObject);
|
|
|
|
|
|
procedure TV11CustomDrawCell(Sender: TcxCustomGridTableView;
|
|
|
|
|
|
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
|
|
|
|
|
|
var ADone: Boolean);
|
2024-07-04 16:01:24 +08:00
|
|
|
|
private
|
|
|
|
|
|
{ Private declarations }
|
|
|
|
|
|
|
|
|
|
|
|
procedure InitGrid();
|
2026-06-23 17:26:29 +08:00
|
|
|
|
|
|
|
|
|
|
procedure UpdateCheckedStatus(Checked: Boolean);
|
2024-07-04 16:01:24 +08:00
|
|
|
|
public
|
|
|
|
|
|
{ Public declarations }
|
2025-04-29 16:36:38 +08:00
|
|
|
|
FOppCoNo, FOurCoNo, FCurrency: string;
|
2024-07-04 16:01:24 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
var
|
|
|
|
|
|
frmSingleCustStatement: TfrmSingleCustStatement;
|
|
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
|
U_DataLink, U_RTFun, U_ZDYHelp;
|
|
|
|
|
|
|
|
|
|
|
|
{$R *.dfm}
|
2026-06-23 17:26:29 +08:00
|
|
|
|
procedure SplitDelimited(const S: string; Delimiter: Char; List: TStrings);
|
|
|
|
|
|
var
|
|
|
|
|
|
i: Integer;
|
|
|
|
|
|
SL: TStringList;
|
|
|
|
|
|
begin
|
|
|
|
|
|
SL := TStringList.Create;
|
|
|
|
|
|
try
|
|
|
|
|
|
SL.StrictDelimiter := True;
|
|
|
|
|
|
SL.Delimiter := Delimiter;
|
|
|
|
|
|
SL.DelimitedText := S;
|
|
|
|
|
|
for i := 0 to SL.Count - 1 do
|
|
|
|
|
|
List.Add(SL[i]);
|
|
|
|
|
|
finally
|
|
|
|
|
|
SL.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
2024-07-04 16:01:24 +08:00
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.InitGrid();
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
with ADOQueryMain do
|
|
|
|
|
|
begin
|
|
|
|
|
|
Close;
|
|
|
|
|
|
SQL.Clear;
|
|
|
|
|
|
Filtered := False;
|
|
|
|
|
|
sql.Add(' exec P_Fin_CustStatementSingle ');
|
|
|
|
|
|
sql.Add(' @Begdate=' + QuotedStr(Trim(FormatDateTime('yyyy-MM-dd', begdate.DateTime))));
|
|
|
|
|
|
sql.Add(' ,@Enddate=' + QuotedStr(Trim(FormatDateTime('yyyy-MM-dd', Enddate.DateTime + 1))));
|
|
|
|
|
|
sql.Add(' ,@OppCoNo=' + QuotedStr(Trim(FOppCoNo)));
|
2025-04-29 16:36:38 +08:00
|
|
|
|
sql.Add(' ,@OurCoNo=' + QuotedStr(Trim(FOurCoNo)));
|
2024-07-04 16:01:24 +08:00
|
|
|
|
sql.Add(' ,@Currency=' + QuotedStr(Trim(FCurrency)));
|
2026-06-24 17:31:02 +08:00
|
|
|
|
// showmessage(sql.text);
|
2024-07-04 16:01:24 +08:00
|
|
|
|
Open;
|
|
|
|
|
|
end;
|
|
|
|
|
|
SCreateCDS(ADOQueryMain, CDS_HZ);
|
|
|
|
|
|
SInitCDSData(ADOQueryMain, CDS_HZ);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.FormDestroy(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
frmSingleCustStatement := nil;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.FormClose(Sender: TObject; var Action: TCloseAction);
|
|
|
|
|
|
begin
|
|
|
|
|
|
Action := caFree;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2026-06-23 17:26:29 +08:00
|
|
|
|
procedure TfrmSingleCustStatement.TBVerifyClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_HZ.IsEmpty then Exit;
|
|
|
|
|
|
if MessageDlg('ȷ<>Ͻ<EFBFBD>ѡ<EFBFBD>еļ<D0B5>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>Ϊ<EFBFBD>Ѻ˶<D1BA><CBB6><EFBFBD><EFBFBD><EFBFBD>', mtConfirmation, [mbYes, mbNo], 0) <> mrYes then Exit;
|
|
|
|
|
|
UpdateCheckedStatus(True);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.TBCancelVerifyClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_HZ.IsEmpty then Exit;
|
|
|
|
|
|
if MessageDlg('ȷ<>Ͻ<EFBFBD>ѡ<EFBFBD>еļ<D0B5>¼ȡ<C2BC><C8A1><EFBFBD>˶<EFBFBD><CBB6><EFBFBD><EFBFBD><EFBFBD>', mtConfirmation, [mbYes, mbNo], 0) <> mrYes then Exit;
|
|
|
|
|
|
UpdateCheckedStatus(False);
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-07-04 16:01:24 +08:00
|
|
|
|
procedure TfrmSingleCustStatement.TBCloseClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
|
|
|
|
|
|
Close;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.FormShow(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-01-13 16:36:43 +08:00
|
|
|
|
// readCxBandedGrid(trim(self.Caption), Tv11, 'Ӧ<>տ<EFBFBD><D5BF><EFBFBD><EFBFBD>˵<EFBFBD>');
|
2026-06-24 17:31:02 +08:00
|
|
|
|
// ReadCxGrid(trim(Self.Caption), Tv11, 'Ӧ<>տ<EFBFBD><D5BF><EFBFBD><EFBFBD>˵<EFBFBD>');
|
2025-01-13 16:36:43 +08:00
|
|
|
|
|
2024-07-04 16:01:24 +08:00
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.TBRafreshClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
begdate.SetFocus;
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2026-06-23 17:26:29 +08:00
|
|
|
|
|
|
|
|
|
|
|
2024-07-04 16:01:24 +08:00
|
|
|
|
procedure TfrmSingleCustStatement.P_OrderNo_YSK(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
ToolButton2.Click;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.ToolButton1Click(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
if ADOQueryMain.IsEmpty then
|
|
|
|
|
|
Exit;
|
2026-05-13 09:17:14 +08:00
|
|
|
|
TcxGridToExcel(self.Caption + '-' + trim(OppCoName.Text), cxgrid1);
|
2025-08-08 09:57:29 +08:00
|
|
|
|
//TcxGridToExcel(self.Caption , cxgrid2);
|
|
|
|
|
|
// TcxGridToExcel(trim(OppCoName.Text), cxgrid2);
|
2024-07-04 16:01:24 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.ToolButton2Click(Sender: TObject);
|
|
|
|
|
|
begin
|
2025-01-13 16:36:43 +08:00
|
|
|
|
// WriteCxBandedGrid(trim(self.Caption), Tv11, 'Ӧ<>տ<EFBFBD><D5BF><EFBFBD><EFBFBD>˵<EFBFBD>');
|
|
|
|
|
|
WriteCxGrid(trim(Self.Caption), Tv11, 'Ӧ<>տ<EFBFBD><D5BF><EFBFBD><EFBFBD>˵<EFBFBD>');
|
2024-07-04 16:01:24 +08:00
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.FormCreate(Sender: TObject);
|
|
|
|
|
|
begin
|
|
|
|
|
|
cxGrid2.Align := AlClient;
|
|
|
|
|
|
Enddate.DateTime := SGetServerDate(ADOQueryTemp);
|
|
|
|
|
|
begdate.DateTime := Enddate.DateTime;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.ToolButton3Click(Sender: TObject);
|
|
|
|
|
|
var
|
|
|
|
|
|
filepath: string;
|
|
|
|
|
|
mBegdate, mEnddate: string;
|
|
|
|
|
|
begin
|
|
|
|
|
|
mBegdate := FormatDateTime('yyyy-MM-dd', begdate.Date);
|
|
|
|
|
|
mEnddate := FormatDateTime('yyyy-MM-dd', enddate.Date);
|
|
|
|
|
|
if CDS_HZ.IsEmpty then
|
|
|
|
|
|
exit;
|
|
|
|
|
|
|
|
|
|
|
|
filepath := ExtractFilePath(Application.ExeName) + 'report\Ӧ<>տ<EFBFBD><D5BF><EFBFBD>ϸ<EFBFBD><CFB8><EFBFBD>˵<EFBFBD>.rmf';
|
|
|
|
|
|
if not FileExists(Pchar(filepath)) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
application.MessageBox(pchar('<27>ļ<EFBFBD>[' + filepath + ']<5D><><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>'), '<27><>ʾ<EFBFBD><CABE>Ϣ', MB_IConError);
|
|
|
|
|
|
exit;
|
|
|
|
|
|
end;
|
|
|
|
|
|
RMGridReport1.LoadFromFile(filepath);
|
|
|
|
|
|
RMGridReport1.ShowReport;
|
|
|
|
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2026-06-23 17:26:29 +08:00
|
|
|
|
procedure TfrmSingleCustStatement.TV11CustomDrawCell(
|
|
|
|
|
|
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
|
|
|
|
|
|
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|
|
|
|
|
var
|
2026-06-24 17:31:02 +08:00
|
|
|
|
isCheckedCol: TcxGridColumn;
|
|
|
|
|
|
isCheckedVal: Variant;
|
2026-06-23 17:26:29 +08:00
|
|
|
|
begin
|
2026-06-24 17:31:02 +08:00
|
|
|
|
try
|
|
|
|
|
|
isCheckedCol := TV11.GetColumnByFieldName('is_checked');
|
|
|
|
|
|
if isCheckedCol = nil then Exit;
|
|
|
|
|
|
|
|
|
|
|
|
isCheckedVal := AViewInfo.GridRecord.Values[isCheckedCol.Index];
|
|
|
|
|
|
|
|
|
|
|
|
if not VarIsNull(isCheckedVal) and (isCheckedVal = True) then
|
|
|
|
|
|
begin
|
|
|
|
|
|
ACanvas.Brush.Color := clMoneyGreen;
|
|
|
|
|
|
end;
|
|
|
|
|
|
except
|
|
|
|
|
|
on E: Exception do
|
|
|
|
|
|
OutputDebugString(PChar('TV11CustomDrawCell<6C><6C><EFBFBD><EFBFBD>: ' + E.Message));
|
2026-06-23 17:26:29 +08:00
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
procedure TfrmSingleCustStatement.UpdateCheckedStatus(Checked: Boolean);
|
|
|
|
|
|
var
|
|
|
|
|
|
FlowIDList, InvoiceIDList, TempIDs: string;
|
|
|
|
|
|
FlowIDsAll, InvoiceIDsAll: TStringList;
|
|
|
|
|
|
vBookmark: TBookmark;
|
|
|
|
|
|
targetValue: Integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_HZ.IsEmpty then Exit;
|
|
|
|
|
|
|
|
|
|
|
|
targetValue := Ord(Checked);
|
|
|
|
|
|
|
|
|
|
|
|
FlowIDsAll := TStringList.Create;
|
|
|
|
|
|
InvoiceIDsAll := TStringList.Create;
|
|
|
|
|
|
try
|
|
|
|
|
|
CDS_HZ.DisableControls;
|
|
|
|
|
|
vBookmark := CDS_HZ.Bookmark;
|
|
|
|
|
|
try
|
|
|
|
|
|
CDS_HZ.First;
|
|
|
|
|
|
while not CDS_HZ.Eof do
|
|
|
|
|
|
begin
|
|
|
|
|
|
if CDS_HZ.FieldByName('ssel').AsBoolean then
|
|
|
|
|
|
begin
|
|
|
|
|
|
if not CDS_HZ.FieldByName('flow_ids').IsNull then
|
|
|
|
|
|
begin
|
|
|
|
|
|
TempIDs := CDS_HZ.FieldByName('flow_ids').AsString;
|
|
|
|
|
|
SplitDelimited(TempIDs, ',', FlowIDsAll);
|
|
|
|
|
|
end;
|
|
|
|
|
|
if not CDS_HZ.FieldByName('invoice_ids').IsNull then
|
|
|
|
|
|
begin
|
|
|
|
|
|
TempIDs := CDS_HZ.FieldByName('invoice_ids').AsString;
|
|
|
|
|
|
SplitDelimited(TempIDs, ',', InvoiceIDsAll);
|
|
|
|
|
|
end;
|
|
|
|
|
|
end;
|
|
|
|
|
|
CDS_HZ.Next;
|
|
|
|
|
|
end;
|
|
|
|
|
|
finally
|
|
|
|
|
|
CDS_HZ.Bookmark := vBookmark;
|
|
|
|
|
|
CDS_HZ.EnableControls;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
FlowIDsAll.Sorted := True;
|
|
|
|
|
|
FlowIDsAll.Duplicates := dupIgnore;
|
|
|
|
|
|
InvoiceIDsAll.Sorted := True;
|
|
|
|
|
|
InvoiceIDsAll.Duplicates := dupIgnore;
|
|
|
|
|
|
|
|
|
|
|
|
if FlowIDsAll.Count > 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
FlowIDList := FlowIDsAll.CommaText;
|
|
|
|
|
|
ADOQueryCmd.Close;
|
|
|
|
|
|
ADOQueryCmd.SQL.Text :=
|
|
|
|
|
|
'UPDATE FF SET is_checked = :p ' +
|
|
|
|
|
|
'FROM Finance_Flow FF ' +
|
|
|
|
|
|
'INNER JOIN dbo.F_Tool_SplitString(:ids, '','') S ON FF.FFID = S.RTValue';
|
|
|
|
|
|
ADOQueryCmd.Parameters.ParamByName('p').Value := targetValue;
|
|
|
|
|
|
ADOQueryCmd.Parameters.ParamByName('ids').Value := FlowIDList;
|
|
|
|
|
|
ADOQueryCmd.ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
if InvoiceIDsAll.Count > 0 then
|
|
|
|
|
|
begin
|
|
|
|
|
|
InvoiceIDList := InvoiceIDsAll.CommaText;
|
|
|
|
|
|
ADOQueryCmd.Close;
|
|
|
|
|
|
ADOQueryCmd.SQL.Text :=
|
|
|
|
|
|
'UPDATE FI SET is_checked = :p ' +
|
|
|
|
|
|
'FROM Finance_Invoice FI ' +
|
|
|
|
|
|
'INNER JOIN dbo.F_Tool_SplitString(:ids, '','') S ON FI.IVId = S.RTValue';
|
|
|
|
|
|
ADOQueryCmd.Parameters.ParamByName('p').Value := targetValue;
|
|
|
|
|
|
ADOQueryCmd.Parameters.ParamByName('ids').Value := InvoiceIDList;
|
|
|
|
|
|
ADOQueryCmd.ExecSQL;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
finally
|
|
|
|
|
|
FlowIDsAll.Free;
|
|
|
|
|
|
InvoiceIDsAll.Free;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
InitGrid();
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
2024-07-04 16:01:24 +08:00
|
|
|
|
end.
|
|
|
|
|
|
|