Index: PlanScan/UI/frameDnaCodes.pas =================================================================== diff -u -r662 -r666 --- PlanScan/UI/frameDnaCodes.pas (.../frameDnaCodes.pas) (revision 662) +++ PlanScan/UI/frameDnaCodes.pas (.../frameDnaCodes.pas) (revision 666) @@ -35,15 +35,17 @@ lblBatch: TLabel; lblLPN: TLabel; edtLPN: TEdit; - edtStatus: TEdit; lblStatus: TLabel; + combStatus: TComboBox; procedure ZoekViaDnaCode(); procedure ZoekViaPallet(); + procedure ZoekViaLpnCode(); procedure ZoekViaToelevering(); procedure ZoekViaKlantnummer(); procedure ZoekViaLadecode(); procedure ZoekViaOrdernummer(); procedure ZoekViaBatch(); + procedure ZoekViaStatus(); procedure btnZoekenClick(Sender: TObject); procedure btnProductetiketClick(Sender: TObject); procedure btnKlantEtiketClick(Sender: TObject); @@ -269,6 +271,26 @@ end; end; +procedure TfrmDnaCodes.ZoekViaLpnCode(); +var + fZoekViaLpnCodeResponse: ZoekViaLpnCodeResponse; + DnaCodes: ArrayOfDnaCodeDnaCode; +begin + fZoekViaLpnCodeResponse := TAgent.Create(fmMain.UiContext).ZoekViaLpnCode(edtLPN.Text); + try + if fZoekViaLpnCodeResponse.Header.Status = '200' then begin + DnaCodes := fZoekViaLpnCodeResponse.DnaCodes; + VulDnaCodeGridMetData(DnaCodes); + if StartsText('TBP',edtPallet.Text) then + btnProboxetiket.Visible := true; + end else begin + ShowMessage(fZoekViaLpnCodeResponse.Header.Omschrijving); + end; + finally + fZoekViaLpnCodeResponse.Free; + end; +end; + procedure TfrmDnaCodes.ZoekViaToelevering(); var fZoekViaToeleveringResponse: ZoekViaToeleveringResponse; @@ -288,15 +310,45 @@ end; end; +procedure TfrmDnaCodes.ZoekViaStatus(); +var + status: DnaCodeStatus; + fZoekViaStatusResponse: ZoekViaStatusResponse; + DnaCodes: ArrayOfDnaCodeDnaCode; +begin + case combStatus.ItemIndex of + 1: status := DnaCodeStatus.Nieuw; + 2: status := DnaCodeStatus.Gescand; + 3: status := DnaCodeStatus.Ongedaan; + 4: status := DnaCodeStatus.OnHold; + 5: status := DnaCodeStatus.InBuffer; + 6: status := DnaCodeStatus.InBatch; + else Exit; + end; + fZoekViaStatusResponse := TAgent.Create(fmMain.UiContext).ZoekViaStatus(status); + try + if fZoekViaStatusResponse.Header.Status = '200' then begin + DnaCodes := fZoekViaStatusResponse.DnaCodes; + VulDnaCodeGridMetData(DnaCodes); + end else begin + ShowMessage(fZoekViaStatusResponse.Header.Omschrijving); + end; + finally + fZoekViaStatusResponse.Free; + end; +end; + procedure TfrmDnaCodes.DnaCodesZoeken; begin if edtToelevering.Text <> '' then ZoekViaToelevering(); if edtPallet.Text <> '' then ZoekViaPallet(); + if edtLPN.Text <> '' then ZoekViaLpnCode(); if edtDNACode.Text <> '' then ZoekViaDNACode(); if edtKlantNummer.Text <> '' then ZoekViaKlantnummer(); if edtOrderNummer.Text <> '' then ZoekViaOrderNummer(); if edtLadeCode.Text <> '' then ZoekViaLadeCode(); if edtBatch.Text <> '' then ZoekViaBatch(); + if combStatus.ItemIndex <> 0 then ZoekViaStatus(); end; procedure TfrmDnaCodes.edtDnaCodeKeyUp(Sender: TObject; var Key: Word;