doom4ster
2017-05-10 d825d5f9944e6635747ae8817b73016d82832836
CB_IMGPSScanImp.pas
@@ -4022,14 +4022,17 @@
          end;
          if (FormID <> '') and ISGuideFormID(FormID) then
          begin
            NowGuideFormID := FormID;
          end;
//ShowMessage('NowGuideFormID='+NowGuideFormID);
          if (not (FindDivFormCode(FormID))) and (NowGuideFormID <> '') {and (FormID = '')} then
            FormID := NowGuideFormID;
          DocNo := FormCode2DocNo(FormID);
          if (FormID <>'') and FindDivFormCode(FormID) Then  //只找分案頁上的案件條碼
//ShowMessage('FormID='+FormID);
          if (FormID <>'') and FindDivFormCode(FormID) and (NowGuideFormID <> '')  Then  //只找分案頁上的案件條碼
          begin
            ScanInfo.ImageCount := 0;
            ClearView(1);
            ContextList.Clear;
@@ -4037,6 +4040,7 @@
            ClearCaseIndex;                //清掉案件索引
            ScanCaseno := BarCode2CaseID; //取出案件編號
            NowGuideFormID := '';
//ShowMessage('NowGuideFormID='+NowGuideFormID+#10#13+'FormID='+FormID+#10#13+'ScanCaseno='+ScanCaseno);
          end;
          if ScanCaseno = '' then //一開始都沒找到
          begin
@@ -4126,11 +4130,10 @@
      begin
        ScanSaveFilename := '';
        FormID := BarCode2FormID; //取出FormID
        if (FormID <> '') and ISGuideFormID(FormID) then
          NowGuideFormID := FormID;
        //Showmessage('A:'+FormID+#13+'B:'+NowGuideFormID);
        if (NowGuideFormID <> '') {and (FormID = '')} then
          FormID := NowGuideFormID;
//        if (FormID <> '') and ISGuideFormID(FormID) then   //20170510 註解 因為DSCAN 會全擠在導引頁下
//          NowGuideFormID := FormID;
//        if (NowGuideFormID <> '') {and (FormID = '')} then  //20170510 註解  因為DSCAN 會全擠在導引頁下
//          FormID := NowGuideFormID;
        DocNo := FormCode2DocNo(FormID);
        ScanDocDir := FindLastestDocDir(ScanCaseno,DocNo);
//ShowMessage('ScanDocDir='+ScanDocDir);
@@ -11971,6 +11974,10 @@
  for I := 0 to ContextList.Count - 1 do
  begin
    FileFormID := FileName2FormCode(ContextList.Strings[i]);
    if FileFormID=GuideFormIDList.Strings[0] then //20170509 跳過導引頁的formid
    begin
      Continue;
    end;
    if FindDivFormCode(FileFormID) then
    begin
      Result := FileFormID;