Index: ProScan/UI/PalletScherm.pas =================================================================== diff -u -r684 -r685 --- ProScan/UI/PalletScherm.pas (.../PalletScherm.pas) (revision 684) +++ ProScan/UI/PalletScherm.pas (.../PalletScherm.pas) (revision 685) @@ -23,6 +23,7 @@ private procedure SetContext; procedure SetModus(GescandeInput: string); + procedure ResetPopups; function ValideerPalletCode(GescandeInput: string): boolean; public { Public declarations } @@ -49,20 +50,19 @@ var fZoekViaPalletCodeResponse: ZoekViaPalletCodeResponse; fZoekViaToeleveringResponse: ZoekViaToeleveringResponse; - fPalletGevalideerd: boolean; fAgent: TAgent; begin SetModus(edtPallet.Text); - fPalletGevalideerd := false; - if not (UiContext.Modus = modusKAD) then - fPalletGevalideerd := ValideerPalletCode(edtPallet.Text); - - //checken of pallet in gebruik is indien het vorige geslaagd is - if fPalletGevalideerd and not(UiContext.Modus = modusKAD) and not(UiContext.Modus = modusVHOSS ) then begin - if (UiContext.MoetTbpCodeGenereren = true) then - edtPallet.Text := '000000'; // Kleine hack om hieronder een foute statuscode te geven - fAgent := TAgent.Create(UiContext); + if (UiContext.MoetTbpCodeGenereren = true) then begin + ResetPopups; + Self.ModalResult := mrDnaCode; + end else if (UiContext.Modus = modusKAD) then begin + Self.ModalResult := mrDnaCode; + end else if (UiContext.Modus = modusVHOSS) then begin + Self.ModalResult := mrDnaCode; + end else if (ValideerPalletCode(edtPallet.Text) = true) then begin + fAgent := TAgent.Create(UiContext); fZoekViaPalletCodeResponse := fAgent.ZoekViaPalletCode(edtPallet.Text); fAgent.Free; try @@ -88,20 +88,11 @@ finally fZoekViaPalletCodeResponse.Free; end; - //popups resetten - UiContext.IsDirecteLeveringPopupGetoond := false; - UiContext.IsWegwerpPalletPopupGetoond := false; - UiContext.IsSSTPopupGetoond := false; - UiContext.IsExportPopupGetoond := false; - UiContext.IsBlumXsPopupGetoond := false; - UiContext.InternVhossId := ''; - end else if (UiContext.Modus = modusKAD) then begin - Self.ModalResult := mrDnaCode; - end else if (UiContext.Modus = modusVHOSS) then begin - Self.ModalResult := mrDnaCode; + ResetPopups; end else begin Self.ModalResult := mrPallet; end; + PostMessage(Self.Handle,WM_Close,0,0); (Self.Parent.Parent As TfmProScanHoofdscherm).NavigeerNaar(Self.ModalResult); end; @@ -115,7 +106,7 @@ result := false; if (UiContext.MoetTbpCodeGenereren) then begin - result := true; + result := true; end else begin fAgent := TAgent.Create(UiContext); fValideerPalletCodeResponse := fAgent.ValideerPalletCode(edtPallet.Text); @@ -135,7 +126,17 @@ end; end; +procedure TfmPalletScherm.ResetPopups; +begin + UiContext.IsDirecteLeveringPopupGetoond := false; + UiContext.IsWegwerpPalletPopupGetoond := false; + UiContext.IsSSTPopupGetoond := false; + UiContext.IsExportPopupGetoond := false; + UiContext.IsBlumXsPopupGetoond := false; + UiContext.InternVhossId := ''; +end; + procedure TfmPalletScherm.btnGenereerTbpClick(Sender: TObject); begin inherited;