Skip to main content
Skip table of contents

TbeStockReceiptBusinessController

TbeStockReceiptBusinessController

Die Klasse stellt das Funktionalität des Wareneingangs-Moduls im Codeblock zur Verfügung.

Eigenschaft

Bezeichung

CbOptions:O

Options-Objekt

CbBookingOptions:O

Options-Objekt für Buchungsrelevante Eigenschaften

Funktionen und Methoden

Beschreibung

CbClearOptions

Optionen (CbOptions / CbBookingOptions) zurücksetzen

CbCancel

Vorgang abbrechen

Parameter

Beschreibung

aStockReceiptBO:O

Wareneingangs-Businessobjekt

CbInsert

Neuen Wareneingangskopf anlegen

Parameter

Beschreibung

aStockReceiptBO:O

Wareneingangs-Businessobjekt

CbEdit

Wareneingangskopf bearbeiten

Parameter

Beschreibung

aStockReceiptBO:O

Wareneingangs-Businessobjekt

CbValidate

Wareneingansposition validieren (wird schon im CbPost ausgeführt)

Parameter

Beschreibung

aStockReceiptBO:O

Wareneingangs-Businessobjekt

CbDelete

Wareneingangskopf löschen

Parameter

Beschreibung

aStockReceiptBO:O

Wareneingangs-Businessobjekt

CbPost

Wareneingangskopf speichern

Parameter

Beschreibung

aStockReceiptBO:O

Wareneingangs-Businessobjekt

CbInsertPosition

Neue Wareneingangsposition anlegen

Parameter

Beschreibung

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

CbEditPosition

Wareneingangsposition editieren

Parameter

Beschreibung

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

CbValidatePosition

Wareneingansposition validieren (wird schon im CbPostPosition ausgeführt)

Parameter

Beschreibung

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

CbDeletePosition

Wareneingangsposition löschen

Parameter

Beschreibung

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

CbPostPosition

Wareneingangsposition speichern

Parameter

Beschreibung

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

CbBookAllPositions

Alle Positionen im Wareneingangskopf buchen

Parameter

Beschreibung

aStockReceiptBO:O

Wareneingangs-Businessobjekt

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

CbPrintBoxLabel

Box-Ettiket drucken

Parameter

Beschreibung

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

CbPrintSRProtocol

Wareneingangsformular drucken

Parameter

Beschreibung

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

CbPrintSRLabel

Wareneingangs-Ettiket drucken

Parameter

Beschreibung

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

CbPrintQAForm

QS-Formular drucken

Parameter

Beschreibung

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

CbScanDeliveryNote

Eingangslieferschein Scannen

Parameter

Beschreibung

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

aStockReceiptPositionBO:O

Wareneingangspostions-Businessobjekt

Beispiel

Codeblock-Beispiel
CODE
|oBC:O, oBO:O, oPositionBO:O, oDM:O, cStep:C|

// Notwendige Anpassungen in der Datenbank:
// B-1: Platzverwaltung = J
// DabPAL: WE Autom.Buchung zu Joblisten = alle
// DabPAL: Bedingung Autom. Buchung = DAB255:JOBLISTE <> 5


//******************************************************************************
function CreateSR(
      nPersNo:N,
      cType:C,
      cSenderType:C,
      nSenderNo:N,
      cCommission:C,
      dCommissionDate:D)
   |_|
   oDM.CbTransaction_Begin(),
   startseq
      oBC.CbInsert(oBO),
      oBO.CbPersonalNo := nPersNo,
      oBO.CbReceiptType := cType,
      oBO.CbBookingDate := Today(),
      oBO.CbSenderType := cSenderType,
      oBO.CbSenderNo := nSenderNo,
      oBO.CbVoucherNo := cCommission,
      oBO.CbVoucherDate := dCommissionDate,
      oBO.CbPackType := ArrToStr({{'BOX', 1, 1}}),
      oBC.CbPost(oBO),
      oDM.CbTransaction_Commit(),
      Result := oBO.CbStockReceiptNo,
   always
      oDM.CbTransaction_TryRollback(),
   stopseq,
end,

//******************************************************************************
function EditSR(
      cSRNumber:C,
      cType:C,
      cSenderType:C,
      nSenderNo:N,
      aPackType:A)
   |_|
   oDM.CbTransaction_Begin(),
   startseq
      oBO.CbGoToStockReceiptNo(cSRNumber),
      oBC.CbEdit(oBO),
      oBO.CbReceiptType := cType,
      oBO.CbSenderType := cSenderType,
      oBO.CbSenderNo := nSenderNo,
      oBO.CbPackType := ArrToStr(aPackType),
      oBC.CbPost(oBO),
      oDM.CbTransaction_Commit(),
   always
      oDM.CbTransaction_TryRollback(),
   stopseq,
end,

//******************************************************************************
function CancelSR(
      cSRNumber:C)
   |_|
   oDM.CbTransaction_Begin(),
   startseq
      oBO.CbGoToStockReceiptNo(cSRNumber),
      oBC.CbEdit(oBO),
      oBO.CbPackType := ArrToStr({{'Canceled', 1, 1}}),
      oBC.CbCancel(oBO),
      oDM.CbTransaction_Commit(),
   always
      oDM.CbTransaction_TryRollback(),
   stopseq,
end,

//******************************************************************************
function DeleteSR(
      cSRNumber:C)
   |_|
   oDM.CbTransaction_Begin(),
   startseq
      oBO.CbGoToStockReceiptNo(cSRNumber),
      oBC.CbDelete(oBO),
      oDM.CbTransaction_Commit(),
   always
      oDM.CbTransaction_TryRollback(),
   stopseq,
end,

//******************************************************************************
function CreatePosition(
      cArticleNo:C,
      nExpected:N,
      nCurrent:N,
      nJobList:N)
   |_|
   oDM.CbTransaction_Begin(),
   startseq
      oBC.CbInsertPosition(oBO, oPositionBO),
      oPositionBO.CbPersonalNo := oBO.CbPersonalNo,
      oPositionBO.CbArticleNo := cArticleNo,
      oPositionBO.CbExpectedQuantity := nExpected,
      oPositionBO.CbCurrentQuantity := nCurrent,
      oPositionBO.CbPackagingUnits := ArrToStr({{nCurrent, 1}}),
      oPositionBO.CbJobList := nJobList,
      if cArticleNo == 'B-1'  then
         oBC.CbBookingOptions.CommissionArray := {{,nExpected,nCurrent}},
      else
         oBC.CbBookingOptions.CommissionArray := {{'A001',nExpected,nCurrent}},
      endif,
      oBC.CbBookingOptions.StoreNo := '0',
      oBC.CbPostPosition(oPositionBO),
      oDM.CbTransaction_Commit(),
      Result := oPositionBO.CbStockReceiptPositionNo,
   always
      oDM.CbTransaction_TryRollback(),
   stopseq,
end,

//******************************************************************************
function EditPosition(
      cSRPositionNumber:C,
      cArticleNo:C,
      nExpected:N,
      nCurrent:N,
      nJobList:N:=-1)
   |_|
   oDM.CbTransaction_Begin(),
   startseq
      oPositionBO.CbGoToStockReceiptPositionNo(cSRPositionNumber),
      oBC.CbEditPosition(oPositionBO), ,
      oPositionBO.CbArticleNo := cArticleNo,
      oPositionBO.CbExpectedQuantity := nExpected,
      oPositionBO.CbCurrentQuantity := nCurrent,
      oPositionBO.CbPackagingUnits := ArrToStr({{nCurrent, 1}}),
      oPositionBO.CbCharges := ArrToStr({{'WOW',
         nCurrent, nExpected, 0, 0, 0, 0, false}}),
      if nJobList <> -1 then
         oPositionBO.CbJobList := nJobList,
      endif,
      oBC.CbPostPosition(oPositionBO),
      oDM.CbTransaction_Commit(),
   always
      oDM.CbTransaction_TryRollback(),
   stopseq,
end,

//******************************************************************************
function CancelPosition(
      cSRPositionNumber:C)
   |_|
   oDM.CbTransaction_Begin(),
   startseq
      oPositionBO.CbGoToStockReceiptPositionNo(cSRPositionNumber),
      oBC.CbEditPosition(oPositionBO),
      oPositionBO.CbArticleNo := 'MASCHINE',
      oPositionBO.CbExpectedQuantity := 2,
      oPositionBO.CbCurrentQuantity := 2,
      oPositionBO.CbPackagingUnits := ArrToStr({{2, 1}}),
      oPositionBO.CbCharges := ArrToStr({{'WOW1', 1, 1}, {'WOW2', 1, 1}}),
      oBC.CbCancelPosition(oPositionBO),
      oDM.CbTransaction_Commit(),
   always
      oDM.CbTransaction_TryRollback(),
   stopseq,
end,

//******************************************************************************
function DeletePosition(
      cSRPositionNo:C)
   |_|
   oDM.CbTransaction_Begin(),
   startseq
      oPositionBO.CbGotoStockReceiptPositionNo(cSRPositionNo),
      oBC.CbDeletePosition(oPositionBO),
      oDM.CbTransaction_Commit(),
   always
      oDM.CbTransaction_TryRollback(),
   stopseq,
end,

//******************************************************************************


//******************************************************************************
function NormalRun()
   | sr_no, pos_no |
   sr_no := CreateSR(1, 'K', 'K', 10000, 'PAKET1', Today()),
   EditSR(sr_no, 'W', 'Z', 70000, {{'PAKET', 2, 2}}),
   CancelSR(sr_no),
   pos_no := CreatePosition('MUTTER M4', 100, 100, 5),
   EditPosition(pos_no, 'KLEBSTOFF', 50, 50),
   CancelPosition(pos_no),
   DeletePosition(pos_no),
   DeleteSR(sr_no),
   writeln('Normal run: OK'),
end,

//******************************************************************************
function AutoBookRun()
   | sr_no, pos_no |
   sr_no := CreateSR(1, 'W', 'Z', 70000, 'PAKET2', Today()),
   writeln(sr_no),
   pos_no := CreatePosition('B-1', 15, 15, 2),
   startseq
      DeletePosition(pos_no),
   onerror
      writeln('AutoBook run: Cant delete done position'),
   stopseq,
   startseq
      DeleteSR(sr_no),
   onerror
      writeln('AutoBook run: Cant delete done SR'),
   stopseq,
   if oPositionBO.CbStockReceiptPositionNo == pos_no then
      writeln('AutoBook run: OK'),
   else
      SetError('AutoBook run: Deleted position!'),
   endif,
end,

//******************************************************************************
function BookAllRun()
   | sr_no, pos_no |
   sr_no := CreateSR(1, 'W', 'Z', 70000, 'PAKET3', Today()),
   pos_no := CreatePosition('B-1', 15, 15, 5),
   pos_no := CreatePosition('MUTTER M4', 100, 100, 5),
   pos_no := CreatePosition('MUTTER M4', 500, 500, 5),

   oDM.CbTransaction_Begin(),
   startseq
      oBC.CbBookingOptions.PersonalNo := 1,
      oBC.CbBookingOptions.StoreNo := '0',
      oBC.CbBookingOptions.BookAll := true,
      oBC.CbBookAllPositions(oBO, oPositionBO),
      oDM.CbTransaction_Commit(),
      writeln('BookAllRun: OK'),
   always
      oDM.CbTransaction_TryRollback(),
   stopseq,
end,

//******************************************************************************
function SetDone()
   | sr_no, pos_no, i |
   sr_no := CreateSR(1, 'W', 'Z', 70000, 'PAKET4', Today()),

   oBC.CbOptions.MarkAsDone := true,
   pos_no := CreatePosition('B-1', 15, 15, 2),
   writeln('Dab250:Done', oBO.CbDone),
   if oBO.CbDone then
      writeln('SetDone: OK 2'),
   else
      writeln('SetDone: Failure 2'),
   endif,
end,

//******************************************************************************
function RunTests()
   NormalRun(),
   AutoBookRun(),
   BookAllRun(),
   SetDone(),
end,

//******************************************************************************
// MAIN PROGRAM
//******************************************************************************
function Main()

   oDM := CreateObject('TbeDbGet'),
   startseq
      oBC := CreateObject('TbeStockReceiptBusinessController',,oDM),
      oBO := CreateObject('TbeStockReceiptBO',,oDM),
      oPositionBO := CreateObject('TbeStockReceiptPositionBO',,oDM),

      oBC.CbDataModule := oDM,
      oBO.CbDataModule := oDM,
      oPositionBO.CbDataModule := oDM,

//Interactive(),

      RunTests(),
   always
      DestroyObject(oDM),
   stopseq,
end,

Main()

Weitere Verknüpfungen

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.