"localhost:/firebird/data/ILICHEVSK2.FDB". Процедуры Previous topic Chapter index Next topic

FORWARDER_OWNGRAINJOURNALUPDATE

 

Входные параметры

Параметр

Тип

Описание

INVOICEID

INTEGER

 

PROVIDERID

INTEGER

 

FORWARDERID

INTEGER

 

BUNKERS

NUMERIC(2,1)

 

GRAINFIELDOUTTIME

TIMESTAMP

 

OWNERFIELDID

INTEGER

 

INVENTORYID

INTEGER

 

 

Выходные параметры

(Нет выходных параметров)

 

Описание

(Нет описания для процедуры FORWARDER_OWNGRAINJOURNALUPDATE)

 

Определение

CREATE PROCEDURE FORWARDER_OWNGRAINJOURNALUPDATE(
    INVOICEID INTEGER,
    PROVIDERID INTEGER,
    FORWARDERID INTEGER,
    BUNKERS NUMERIC(2,1),
    GRAINFIELDOUTTIME TIMESTAMP,
    OWNERFIELDID INTEGER,
    INVENTORYID INTEGER)
AS
begin
  if (:InvoiceID is null) then exit;
  update IT
  set
    ProviderID = :ProviderID
  where
    InvoiceID = :InvoiceID;

    update ITTransport
    set
      Bunkers = :Bunkers,
      GrainFieldOutTime = :GrainFieldOutTime,
      OwnerFieldID = :OwnerFieldID
    where
      InventoryID = :InventoryID;

    if (row_count = 0) then
      insert into ITTransport
        (InventoryID, Bunkers, GrainFieldOutTime, OwnerFieldID)
      values
        (:InventoryID, :Bunkers, :GrainFieldOutTime, :OwnerFieldID);

    update Invoices
    set
      ForwarderID = :ForwarderID
    where
      InvoiceID = :InvoiceID;
end

 

     Previous topic Chapter index Next topic