curtis
19小時前 5577f3ba7b9f0319c9b32d7080165207726d1f81
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
{ ==============================================================================
  方法名稱:GetDocNo_IS_WH
  引用相依:
  方法描述:判斷指定文件編號是否屬於「入庫文件」類別。
============================================================================== }
Function TCB_IMGPSScanX.GetDocNo_IS_WH(DocNo:String):Boolean; //DocNo是否為入庫文件
var
  i :Integer;
begin
  Result := False;
  for i := 0 to IN_WH_DocNoList.Count - 1 do
  begin
    if DocNo = IN_WH_DocNoList.Strings[i] then
    begin
      Result := True;
      Break;
    end;
  end;
end;
 
 
{ ==============================================================================
  方法名稱:DocNoIs_In_WH
  引用相依:
  方法描述:判斷指定文件編號(包含自定義 ZZZZZ 系列)是否為入庫文件。
============================================================================== }
Function TCB_IMGPSScanX.DocNoIs_In_WH(DocNo:String):Boolean; //DocNo是否為入庫文件
var
  i : Integer;
begin
  Result := False;
  if (Copy(DocNo,1,5)='ZZZZZ') then //20140728 yuu 說自訂文件也是入庫文件
  begin
    Result := True;
    Exit;
  end;
  for i := 0 to IN_WH_DocNoList.Count -1 do
  begin
    if DocNo = IN_WH_DocNoList.Strings[i] then
    begin
      Result := True;
      Break;
    end;
  end;
end;
 
 
{ ==============================================================================
  方法名稱:FormIDAppear
  引用相依:
  方法描述:判斷特定的表單代碼(FormID)是否符合目前入庫/非入庫作業模式的顯示規則。
            主要過濾掉不屬於當前作業範疇的文件。
============================================================================== }
Function TCB_IMGPSScanX.FormIDAppear(FormID:String):Boolean; //FormID是否可出現
var
  iDocNo : String;
begin
  Result := True;
  iDocNo := FormCode2DocNo(FormID);
  if (((FIs_In_Wh  = 'Y') and (not DocNoIs_In_WH(iDocNo))) or   //入庫掃描不看非入庫文件
     ((FIs_In_Wh  = 'N') and (DocNoIs_In_WH(iDocNo)))) and      //非入庫掃描不看入庫文件
     ((iDocNo <> 'Attach') and (iDocNo <> 'S_Attach') and (Copy(iDocNo,1,5)<>'ZZZZZ')) then
       Result := False;
 
  if (FIs_In_Wh='Y') and (FWH_category='Y') then //20170816 新加
  begin
    if (((FIs_In_Wh  = 'Y') and (not DocNoIs_In_WH(iDocNo))) or   //入庫掃描不看非入庫文件
     ((FIs_In_Wh  = 'N') and (DocNoIs_In_WH(iDocNo)))) and      //非入庫掃描不看入庫文件
     ((iDocNo <> 'Attach') and (iDocNo <> 'S_Attach') and (Copy(iDocNo,1,5)<>'ZZZZZ')) then
       Result := False;
  end;
 
  if (FIs_In_Wh='Y') and (FWH_category='N') then //20170816 新加
  begin
    Result:=True;
  end;
 
end;
 
 
{ ==============================================================================
  方法名稱:DocNoAppear
  引用相依:
  方法描述:判斷文件編號(DocNo)是否應在介面上顯示。包含針對附件與入庫屬性的互斥過
            濾。
============================================================================== }
Function TCB_IMGPSScanX.DocNoAppear(DocNo:String):Boolean;   //DocNo是否可出現
begin
  Result := True;
 
  {if (((FIs_In_Wh  = 'Y') and (not DocNoIs_In_WH(DocNo)) or (DocNo ='S_Attach')) or   //入庫掃描不看非入庫文件
     ((FIs_In_Wh  = 'N') and (DocNoIs_In_WH(DocNo)) or (DocNo ='Attach') )) {and      //非入庫掃描不看入庫文件
     (Copy(DocNo,1,5)<>'ZZZZZ')} {then
       {Result := False;}
  //20181031 應該要換成下面的判斷比較對,FIs_In_Wh傳空的話才會出全部
  if (((FIs_In_Wh  = 'Y') and ((not DocNoIs_In_WH(DocNo)) or (DocNo ='S_Attach'))) or   //入庫掃描不看非入庫文件
     ((FIs_In_Wh  = 'N') and ((DocNoIs_In_WH(DocNo)) or (DocNo ='Attach') ))) {and      //非入庫掃描不看入庫文件
     (Copy(DocNo,1,5)<>'ZZZZZ')} then
       Result := False;
 
 
end;
 
 
{ ==============================================================================
  方法名稱:ISGuideFormID
  引用相依:
  方法描述:檢查指定的表單代碼是否屬於「引導頁(Guide Page)」清單。
============================================================================== }
Function TCB_IMGPSScanX.ISGuideFormID(FormID:String):Boolean;
var
  i : Integer;
begin
  Result := False;
  for i := 0 to GuideFormIDList.Count - 1 do
  begin
    if FormID = GuideFormIDList.Strings[i] then
    begin
      Result := True;
      Break;
    end;
  end;
end;
 
 
{ ==============================================================================
  方法名稱:ISDivPageFormID
  引用相依:
  方法描述:檢查指定的表單代碼是否屬於「分案頁(Division Page)」清單。
============================================================================== }
Function TCB_IMGPSScanX.ISDivPageFormID(FormID:String):Boolean;
var
  i : Integer;
begin
  Result := False;
 
  for i := 0 to DivPageFormIDList.Count - 1 do
  begin
    if FormID = DivPageFormIDList.Strings[i] then
    begin
      Result := True;
      Break;
    end;
  end;
end;