From 068b44b1c01932ba35fcd7d44460bc9fa7ce0a6f Mon Sep 17 00:00:00 2001
From: doom4ster <doom4ster@gmail.com>
Date: 星期四, 16 三月 2017 10:50:36 +0800
Subject: [PATCH] OCX ver2.0.1.1

---
 CB_IMGPSScanImp.pas |   38 ++++++++++++++++++++++++++++++++++----
 1 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/CB_IMGPSScanImp.pas b/CB_IMGPSScanImp.pas
index 9b04af0..a963e1f 100644
--- a/CB_IMGPSScanImp.pas
+++ b/CB_IMGPSScanImp.pas
@@ -825,6 +825,7 @@
     function GetCurrentVersionNo: String;
     procedure initParameter;
     procedure LastInitFormidListCreate(path:string);
+    function checkFormCodeIsCustom(path,formcode:string):boolean;
   protected
     { Protected declarations }
     procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override;
@@ -3648,8 +3649,8 @@
   str:='';
   for I := 1 to 11 do // 看 OMRErrInfo 的內容
   begin
-  str:=str+BoolToStr(OMRErrInfo[i].Display)+','
-          +BoolToStr(OMRErrInfo[i].Ignore)+','+OMRErrInfo[i].Info+','
+  str:=str+BoolToStr(OMRErrInfo[i].Display,true)+','
+          +BoolToStr(OMRErrInfo[i].Ignore,true)+','+OMRErrInfo[i].Info+','
           +OMRErrInfo[i].Mode+#10#13;
   end;
   ShowMessage('OMRErrInfo='+str);
@@ -5474,6 +5475,7 @@
   must_formidStr :string;
   last_add_formidstr :string;
   casepath:String;
+  filesizeInt:integer;
 begin
   Result := True;
   TransName := CaseID;
@@ -5584,6 +5586,10 @@
   end;
   ///保留外部影像  end///////////////////////////////
 
+  //file_size 計算  就先不做 20170316
+  filesizeInt:=0;
+
+
   //////壓檔/////
   ZipMainFile(Path,Path,'Img.zip');
   if HaveMask then
@@ -5598,6 +5604,7 @@
   +'&doc_data='+HTTPEncode(UTF8Encode(Doc_Data))
   +'&doc_data1='+HTTPEncode(UTF8Encode(Doc_Data1))
   +'&attach='+AttachYN
+  +'&file_size='+IntToStr(filesizeInt)
   +'&must_formid='+must_formidStr  //擁有的 formid
   +'&last_add_formid='+last_add_formidstr   //當次新加的 formid
   +'&in_doc1='+HTTPEncode(UTF8Encode(In_Doc1))
@@ -6442,6 +6449,27 @@
       Break;
     end;
   end;
+end;
+
+function TCB_IMGPSScanX.checkFormCodeIsCustom(path, formcode: string): boolean;
+var
+  i:integer;
+  ini : Tmeminifile;
+  str1:String;
+begin
+//ShowMessage(path);
+  ini := Tmeminifile.Create(Path+'CustomDocNo.ini');
+  str1:=ini.ReadString(Copy(formcode,1,8),'FormID','');
+//ShowMessage('str1'+str1);
+  if str1 = formcode then
+  begin
+    Result:=True;
+  end
+  else
+  begin
+    Result := False;
+  end;
+
 end;
 
 Function TCB_IMGPSScanX.CheckCaseID_OK:Boolean;  //檢查是否有未配號的案件
@@ -10481,7 +10509,7 @@
           //20131203 yuu說不檢查這個,先拿掉   20170315 楷琳說未歸類要擋
           if FCheck_main_form='Y' then
           begin
-            if (FMode <> 'SSCAN') and (Fmode <> 'ESCAN') then  //簽署章件會換主FormID,先跳過
+            if (FMode <> 'SSCAN') then  //簽署章件會換主FormID,先跳過
             begin
               ErrStr:=_Msg('找不到分案文件');   //找不到主文件
               OMRErr2ini(CaseID,ErrStr,'','','','','','',False,False,True);
@@ -10586,10 +10614,12 @@
         end }
         /////未註冊文件/////
         //////停用文件//
-        {Else} IF ModeNeedCheck(OMRErrInfo[9].Mode,FMode) and (not FormIDExists(FormCode,True,0)) then  //有停用的文件
+        {Else} IF ModeNeedCheck(OMRErrInfo[9].Mode,FMode) and (not FormIDExists(FormCode,True,0)) and (not checkFormCodeIsCustom(ImageSavePath + CaseID+'\upload\',FormCode)) then  //有停用的文件
         begin
+//ShowMessage('AAAA');
           ErrStr:=Format(OMRErrInfo[9].Info,[FormCode2FormName(CaseID,FormCode)]);   //有停用文件
           OMRErr2ini(CaseID,ErrStr,'','','','','','',False,OMRErrInfo[9].Ignore,OMRErrInfo[9].Display);
+//ShowMessage('ErrStr='+ErrStr);
           if OMRErrInfo[9].Display then
             CaseOk := false;
         end;

--
Gitblit v1.8.0