Index: ProScan/UI/DnaCodeScherm.pas =================================================================== diff -u -r529 -r531 --- ProScan/UI/DnaCodeScherm.pas (.../DnaCodeScherm.pas) (revision 529) +++ ProScan/UI/DnaCodeScherm.pas (.../DnaCodeScherm.pas) (revision 531) @@ -129,45 +129,50 @@ fIsDirecteLevering: boolean; begin inherited; - fAantalLadesOpHuidigePallet := BepaalAantalLadesOpHuidigePallet; - if fAantalLadesOpHuidigePallet > 0 then begin - if (UiContext.Modus = modusKAD) then begin - PalletBijwerken(DnaCodeStatus.InBuffer,false); - UiContext.Pallet := ''; - Self.ModalResult := mrPallet; - end else if (UiContext.Modus = modusVHOSS) then begin - if lblAantalGescand.Caption = lblTotaalAantal.Caption then begin + ZetAfrondActieStatus(false); + try + fAantalLadesOpHuidigePallet := BepaalAantalLadesOpHuidigePallet; + if fAantalLadesOpHuidigePallet > 0 then begin + if (UiContext.Modus = modusKAD) then begin PalletBijwerken(DnaCodeStatus.InBuffer,false); UiContext.Pallet := ''; - UiContext.Toelevering := ''; - UiContext.BatchId := ''; Self.ModalResult := mrPallet; - end else begin - if (ToonPopupScherm('Vhoss nog niet volledig.'+#13#10+'Toch verwerken?','Ja','Annuleren',14,6,7) = mrYes) then begin + end else if (UiContext.Modus = modusVHOSS) then begin + if lblAantalGescand.Caption = lblTotaalAantal.Caption then begin PalletBijwerken(DnaCodeStatus.InBuffer,false); UiContext.Pallet := ''; + UiContext.Toelevering := ''; + UiContext.BatchId := ''; Self.ModalResult := mrPallet; end else begin - Self.ModalResult := mrDnaCode; + if (ToonPopupScherm('Vhoss nog niet volledig.'+#13#10+'Toch verwerken?','Ja','Annuleren',14,6,7) = mrYes) then begin + PalletBijwerken(DnaCodeStatus.InBuffer,false); + UiContext.Pallet := ''; + Self.ModalResult := mrPallet; + end else begin + Self.ModalResult := mrDnaCode; + end; end; + end else if ((UiContext.Modus = modusDefault) and (ToonPopupScherm(lblHuidigePalletData.Caption+' verwerken?'+#13#10+inttostr(fAantalLadesOpHuidigePallet)+' lade(s)','Ja','Annuleren',14,6,7) = mrYes)) then begin + fIsDirecteLevering := (UiContext.Modus = modusDefault) and BepaalDirecteLevering; + if fIsDirecteLevering then begin + ToonPopupScherm('Directe levering', 'OK','',15,-1,-1,clBlue); + imgDirecteLevering.Visible := true; + end; + PalletBijwerken(DnaCodeStatus.InBuffer,fIsDirecteLevering); + DrukProboxEtiketAfIndienNodig; + UiContext.Pallet := ''; + Self.ModalResult := mrPallet; + end else begin + Self.ModalResult := mrDnaCode; end; - end else if ((UiContext.Modus = modusDefault) and (ToonPopupScherm(lblHuidigePalletData.Caption+' verwerken?'+#13#10+inttostr(fAantalLadesOpHuidigePallet)+' lade(s)','Ja','Annuleren',14,6,7) = mrYes)) then begin - fIsDirecteLevering := (UiContext.Modus = modusDefault) and BepaalDirecteLevering; - if fIsDirecteLevering then begin - ToonPopupScherm('Directe levering', 'OK','',15,-1,-1,clBlue); - imgDirecteLevering.Visible := true; - end; - PalletBijwerken(DnaCodeStatus.InBuffer,fIsDirecteLevering); - DrukProboxEtiketAfIndienNodig; - UiContext.Pallet := ''; + end else Self.ModalResult := mrPallet; - end else begin - Self.ModalResult := mrDnaCode; - end; - end else - Self.ModalResult := mrPallet; - PostMessage(Self.Handle,WM_Close,0,0); - (Self.Parent.Parent As TfmProScanHoofdscherm).NavigeerNaar(Self.ModalResult); + finally + ZetAfrondActieStatus(true); + PostMessage(Self.Handle,WM_Close,0,0); + (Self.Parent.Parent As TfmProScanHoofdscherm).NavigeerNaar(Self.ModalResult); + end; end; procedure TfmDnaCodeScherm.actAfrondenExecute(Sender: TObject); @@ -180,50 +185,53 @@ if UiContext.Toelevering = '' then exit; ZetAfrondActieStatus(false); - if (UiContext.Modus = modusKAD) then begin - RondAfKaderdeurDag(); - UiContext.Toelevering := ''; - UiContext.Pallet := ''; - end else if (UiContext.Modus = modusVHOSS) then begin - RondAfVhossBatch(); - UiContext.Toelevering := ''; - UiContext.Pallet := ''; - end else begin - fIsDirecteLevering := (UiContext.Modus = modusDefault) and BepaalDirecteLevering; - if lblAantalGescand.Caption = lblTotaalAantal.Caption then begin - if fIsDirecteLevering then begin - ToonPopupScherm('Directe levering', 'OK','',15,-1,-1,clBlue); - imgDirecteLevering.Visible := true; - end; - ZetToeleveringStatus(DnaCodeStatus.InBuffer, fIsDirecteLevering); - if Self.ModalResult = mrPallet then begin - ToonPopupScherm('Toelevering succesvol afgerond','OK','',19,-1,-1,clGreen); - UiContext.Toelevering := ''; - UiContext.BatchId := ''; - DrukProboxEtiketAfIndienNodig; - end; + try + if (UiContext.Modus = modusKAD) then begin + RondAfKaderdeurDag(); + UiContext.Toelevering := ''; + UiContext.Pallet := ''; + end else if (UiContext.Modus = modusVHOSS) then begin + RondAfVhossBatch(); + UiContext.Toelevering := ''; + UiContext.Pallet := ''; end else begin - fOnvolledigeToeleveringScherm := TfmOnvolledigeToeleveringScherm.Create(self); - try - fOnvolledigeToeleveringScherm.UiContext := UiContext; - fWaarschuwingModalResult := fOnvolledigeToeleveringScherm.ShowModal; - if fWaarschuwingModalResult = mrNo then begin - ZetToeleveringStatus(DnaCodeStatus.InBuffer, fIsDirecteLevering); + fIsDirecteLevering := (UiContext.Modus = modusDefault) and BepaalDirecteLevering; + if lblAantalGescand.Caption = lblTotaalAantal.Caption then begin + if fIsDirecteLevering then begin + ToonPopupScherm('Directe levering', 'OK','',15,-1,-1,clBlue); + imgDirecteLevering.Visible := true; + end; + ZetToeleveringStatus(DnaCodeStatus.InBuffer, fIsDirecteLevering); + if Self.ModalResult = mrPallet then begin + ToonPopupScherm('Toelevering succesvol afgerond','OK','',19,-1,-1,clGreen); UiContext.Toelevering := ''; UiContext.BatchId := ''; - Self.ModalResult := mrPallet; DrukProboxEtiketAfIndienNodig; - end else begin - Self.ModalResult := mrDnaCode; end; - finally - fOnvolledigeToeleveringScherm.Free; + end else begin + fOnvolledigeToeleveringScherm := TfmOnvolledigeToeleveringScherm.Create(self); + try + fOnvolledigeToeleveringScherm.UiContext := UiContext; + fWaarschuwingModalResult := fOnvolledigeToeleveringScherm.ShowModal; + if fWaarschuwingModalResult = mrNo then begin + ZetToeleveringStatus(DnaCodeStatus.InBuffer, fIsDirecteLevering); + UiContext.Toelevering := ''; + UiContext.BatchId := ''; + Self.ModalResult := mrPallet; + DrukProboxEtiketAfIndienNodig; + end else begin + Self.ModalResult := mrDnaCode; + end; + finally + fOnvolledigeToeleveringScherm.Free; + end; end; end; + finally + ZetAfrondActieStatus(true); + PostMessage(Self.Handle,WM_Close,0,0); + (Self.Parent.Parent As TfmProScanHoofdscherm).NavigeerNaar(Self.ModalResult); end; - ZetAfrondActieStatus(true); - PostMessage(Self.Handle,WM_Close,0,0); - (Self.Parent.Parent As TfmProScanHoofdscherm).NavigeerNaar(Self.ModalResult); end; function TfmDnaCodeScherm.BepaalAantalLadesOpHuidigePallet: integer;