BlueWhaleERPSources\AJS\BlueWhale_Std_AJS_INVTransferJournalC\INVTransferJournalClass.pasFBillType: string; // 2026-08-02 单别类型过滤(BW_INVLA.LA006)
procedure MarkINVLAAsTransferred(LA006, LA007, LA008: string); // 2026-08-02
procedure SetQueryParams(AStartDate, AEndDate: string; AOnlyAudited: Boolean;
ABillType: string = ''); // 2026-08-02
property BillType: string read FBillType write FBillType; // 2026-08-02
// line 78 新增
FBillType := ''; // 2026-08-02 单别类型过滤
BuildQuerySQL 整体重写BW_CMSMQ MQ, BW_AJSMB MBMQ.MQ002 AS BillTypeName, LA.LA025, AJSMBExistsAND (LA.LA025='N' OR LA.LA025 IS NULL)AND LA.LA006='<FBillType>' (单别类型过滤时)procedure TINVTransferJournal.MarkINVLAAsTransferred(LA006, LA007, LA008: string);
var
strSQL: string;
begin
{ 2026-08-02 标记 BW_INVLA.LA025='Y',表示该单据已抛转分录,不可再抛转 }
try
strSQL := Format('UPDATE BW_INVLA SET LA025=''Y'' ' +
' WHERE LA006=''%s'' AND LA007=''%s'' AND LA008=''%s''',
[LA006, LA007, LA008]);
if Self.ExecSQL(strSQL, False) = False then
Self.WriteLog(Format('标记单据[%s/%s]已抛转分录(LA025)失败!',
[LA007, LA008]), False);
except
on E: Exception do
Self.WriteLog('标记LA025失败: ' + E.Message, False);
end;
end;
SetQueryParams 修改procedure TINVTransferJournal.SetQueryParams(AStartDate, AEndDate: string;
AOnlyAudited: Boolean; ABillType: string = '');
begin
FStartDate := AStartDate;
FEndDate := AEndDate;
FOnlyAudited := AOnlyAudited;
FBillType := ABillType; // 2026-08-02 单别类型过滤
end;
ExecuteTransfer 修改在 try block 末尾追加:
// 2026-08-02 标记 BW_INVLA.LA025='Y',不可再抛转
MarkINVLAAsTransferred(
DataSet.FieldByName('LA006').AsString,
DataSet.FieldByName('LA007').AsString,
DataSet.FieldByName('LA008').AsString);
CancelTransfer 修改---
BlueWhaleERPSources\AJS\BlueWhale_Std_AJS_INVTransferJournalC\INVTransferJournalFrm.pasViewMasterBillTypeName: TcxGridDBBandedColumn; // 2026-08-02 单别名称
ViewMasterLA025: TcxGridDBBandedColumn; // 2026-08-02 是否设置分录性质
ViewMasterAJSMBExists: TcxGridDBBandedColumn; // 2026-08-02 AJSMB存在标志
edtBillType: TcxComboBox; // 2026-08-02 单别类型过滤
lblBillType: TcxLabel; // 2026-08-02 单别类型标签
DoInitWindow 修改新增单别类型下拉框加载逻辑(从 BW_CMSMQ WHERE MQ026='3' 加载 MQ001 + MQ002):
edtBillType.Properties.Items.Clear;
edtBillType.Properties.Items.Add('全部');
edtBillType.ItemIndex := 0;
strSQL := 'SELECT MQ001, MQ002 FROM BW_CMSMQ WHERE MQ026=''3'' ORDER BY MQ001';
varData := INVTransferJournal.GetDataPack(strSQL);
if not VarIsEmpty(varData) then
begin
dsBillType := TClientDataSet.Create(Self);
try
dsBillType.Data := varData;
while not dsBillType.Eof do
begin
edtBillType.Properties.Items.Add(
dsBillType.FieldByName('MQ001').AsString + ' - ' +
dsBillType.FieldByName('MQ002').AsString);
dsBillType.Next;
end;
finally
dsBillType.Free;
end;
end;
btnQueryClick 修改strBillType := '';
if Assigned(edtBillType) and (edtBillType.Text <> '') and
(edtBillType.Text <> '全部') then
strBillType := Trim(edtBillType.Text);
INVTransferJournal.SetQueryParams(
FormatDateTime('yyyymmdd', edtStartDate.Date),
FormatDateTime('yyyymmdd', edtEndDate.Date),
chkOnlyAudited.Checked,
strBillType);
---
BlueWhaleERPSources\AJS\BlueWhale_Std_AJS_INVTransferJournalC\INVTransferJournalFrm.dfmobject lblBillType: TcxLabel
Left = 540
Top = 14
Caption = '单别类型'
TabOrder = 5
Transparent = True
end
object edtBillType: TcxComboBox
Left = 596
Top = 12
Width = 180
Height = 21
TabOrder = 6
Properties.DropDownListStyle = lsEditFixedList
end
| 按钮 | 旧 Left | 新 Left |
|---|---|---|
| btnQuery | 560 | 788 |
| btnTransfer | 648 | 876 |
| btnCancelTransfer | 760 | 988 |
object ViewMasterBillTypeName: TcxGridDBBandedColumn
Caption = '单别名称'
DataBinding.FieldName = 'BillTypeName'
Width = 120
Position.BandIndex = 0
Position.ColIndex = 2
end
object ViewMasterLA025: TcxGridDBBandedColumn
Caption = '是否设置分录性质'
DataBinding.FieldName = 'LA025'
Width = 80
Position.BandIndex = 1
Position.ColIndex = 14
end
| 列 | 旧 ColIndex | 新 ColIndex |
|---|---|---|
| ViewMasterLA007 | 2 | 3 |
| ViewMasterLA008 | 3 | 4 |
| ViewMasterLA001 | 5 | 6 |
| ViewMasterLA005 | 6 | 7 |
| ViewMasterLA014 | 7 | 8 |
| ViewMasterLA009 | 8 | 9 |
| ViewMasterLA011 | 9 | 10 |
| ViewMasterLA015 | 10 | 11 |
| ViewMasterLA023 | 11 | 12 |
| ViewMasterLA024 | 12 | 13 |
Band 1 内 ColIndex 0-4 保持不变(成本/材料/人工/制费/加工 金额列)
---
参考同目录文件 02_ADD_INVLA_LA025.sql: